@arcgis/core 4.32.0-next.20241222 → 4.32.0-next.20241223

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{9dd167db3f2e68b71cea.js → 178f606c8896ae5f39de.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{0acaf73a938fc933560f.js → 250a810dd4e1ff293564.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{0b2da288fc8cdb025e85.js → 801dbea20966806db1c9.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{3c155f9bc6b9c868170d.js → a1cd84b70030c94d7908.js} +1 -1
  6. package/assets/esri/core/workers/chunks/bab541feca7ab4d3f993.js +1 -0
  7. package/assets/esri/core/workers/chunks/e2f91098793b8742fae6.js +1 -0
  8. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  9. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  10. package/interfaces.d.ts +17 -2
  11. package/layers/knowledgeGraph/layerUtils.js +1 -1
  12. package/package.json +1 -1
  13. package/portal/PortalItem.js +1 -1
  14. package/rest/support/FixedBoundariesBinParameters.js +1 -1
  15. package/support/basemapUtils.js +1 -1
  16. package/support/revision.js +1 -1
  17. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  18. package/views/3d/layers/graphics/webStyleUtils.js +1 -1
  19. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  20. package/webscene/Slide.js +1 -1
  21. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  22. package/widgets/Daylight/DaylightViewModel.js +1 -1
  23. package/widgets/Features/FeaturesViewModel.js +1 -1
  24. package/widgets/support/dateUtils.js +1 -1
  25. package/widgets/support/jsxFactory.js +1 -1
  26. package/assets/esri/core/workers/chunks/610d621a8296b77fb16c.js +0 -1
  27. package/assets/esri/core/workers/chunks/741d5dadfab2a7689054.js +0 -1
package/interfaces.d.ts CHANGED
@@ -1275,7 +1275,7 @@ declare namespace __esri {
1275
1275
  * @param symbol
1276
1276
  * @param threshold
1277
1277
  */
1278
- getContrastingBackgroundTheme(symbol: any, threshold?: number): string;
1278
+ getContrastingBackgroundTheme(symbol: any, threshold?: number): "light" | "dark";
1279
1279
  }
1280
1280
 
1281
1281
  export const previewSymbol2D: previewSymbol2D;
@@ -97546,10 +97546,16 @@ declare namespace __esri {
97546
97546
  *
97547
97547
  * @param view The SceneView the slide should be applied to.
97548
97548
  * @param optionsWithDefaults Animation options. See properties below for object specifications.
97549
+ * @param optionsWithDefaults.animate Indicates whether to animate the slide transition.
97550
+ * @param optionsWithDefaults.speedFactor Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly.
97551
+ * @param optionsWithDefaults.duration Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration.
97552
+ * @param optionsWithDefaults.maxDuration The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account.
97553
+ * @param optionsWithDefaults.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function.
97554
+ * @param optionsWithDefaults.signal Signal object that can be used to abort the asynchronous task. Aborting will cause the slide animation to stop. The returned promise will be rejected with an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html Error} named `AbortError` when an abort is signaled. See also [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for more information on how to construct a controller that can be used to deliver abort signals.
97549
97555
  *
97550
97556
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo Read more...}
97551
97557
  */
97552
- applyTo(view: SceneView, optionsWithDefaults?: any): Promise<Slide>;
97558
+ applyTo(view: SceneView, optionsWithDefaults?: SlideApplyToOptionsWithDefaults): Promise<Slide>;
97553
97559
  /**
97554
97560
  * Creates a deep clone of this object.
97555
97561
  *
@@ -97663,6 +97669,15 @@ declare namespace __esri {
97663
97669
  visibleLayers?: CollectionProperties<SlideVisibleLayersProperties>;
97664
97670
  }
97665
97671
 
97672
+ export interface SlideApplyToOptionsWithDefaults {
97673
+ animate?: boolean;
97674
+ speedFactor?: number;
97675
+ duration?: number;
97676
+ maxDuration?: number;
97677
+ easing?: string | EasingFunction;
97678
+ signal?: AbortSignal;
97679
+ }
97680
+
97666
97681
  export interface SlideCreateFromOptions {
97667
97682
  screenshot?: SlideCreateFromOptionsScreenshot;
97668
97683
  }
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{fetchClientDataAtKeys as e}from"../../rest/knowledgeGraphService.js";const a="ESRI__ID",t="ESRI__OriginID",n="ESRI__DestID",r="ESRI__LayoutGeometry",o="ESRI__AggregationCount",s="LC.ESRI__IsSpatial",i={initializeLayersFromClientData:async(a,t,n)=>{if(t||(t=[...a.layers,...a.tables].map((e=>e.graphTypeName))),0===t?.length)return;const r=new Map;for(const e of t)r.set(e,l(a,e));const o=await e(a.dataManager.knowledgeGraph,Array.from(r.values()),{requestOptions:{signal:n?.signal}});for(const e of[...a.layers,...a.tables]){const t=e.objectType.name;if(null===t)continue;const n=o.get(l(a,t));if(n){const a=JSON.parse(n);null===a||"object"!=typeof a||a.hasOwnProperty("showLabels")||(a.showLabels=!1),e.read(a,{origin:"service"})}}}},l=(e,a)=>"knowledge-graph"===e.type?`${a}/Map`:`${a}/LinkChart/LinkChartSubLayer`;async function p(e,a,t){return i.initializeLayersFromClientData(e,a,t)}export{p as initializeLayersFromClientData,i as layerUtils,o as systemAggregationCountFieldName,n as systemDestinationIdFieldName,s as systemIsSpatialFieldName,r as systemLayoutGeometryFieldName,a as systemOidFieldName,t as systemOriginIdFieldName};
5
+ import{fetchClientDataAtKeys as e}from"../../rest/knowledgeGraphService.js";const a="ESRI__ID",t="ESRI__OriginID",n="ESRI__DestID",r="ESRI__LayoutGeometry",o="ESRI__AggregationCount",s="LC.ESRI__IsSpatial",i={initializeLayersFromClientData:async(a,t,n)=>{if(t||(t=[...a.layers,...a.tables].map((e=>e.graphTypeName))),0===t?.length)return;const r=new Map;for(const e of t)r.set(e,l(a,e));const o=await e(a.dataManager.knowledgeGraph,Array.from(r.values()),{requestOptions:{signal:n?.signal}});for(const e of[...a.layers,...a.tables]){const t=e.objectType.name;if(null==t)continue;const n=o.get(l(a,t));if(n){const a=JSON.parse(n);null===a||"object"!=typeof a||a.hasOwnProperty("showLabels")||(a.showLabels=!1),e.read(a,{origin:"service"})}}}},l=(e,a)=>"knowledge-graph"===e.type?`${a}/Map`:`${a}/LinkChart/LinkChartSubLayer`;async function p(e,a,t){return i.initializeLayersFromClientData(e,a,t)}export{p as initializeLayersFromClientData,i as layerUtils,o as systemAggregationCountFieldName,n as systemDestinationIdFieldName,s as systemIsSpatialFieldName,r as systemLayoutGeometryFieldName,a as systemOidFieldName,t as systemOriginIdFieldName};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.0-next.20241222",
3
+ "version": "4.32.0-next.20241223",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import r from"../core/JSONSupport.js";import{clone as o,fixJson as s}from"../core/lang.js";import a from"../core/Loadable.js";import{isDataProtocol as n,makeAbsolute as l}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import{reader as d}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import m from"../geometry/Extent.js";import h from"./Portal.js";import g from"./PortalItemResource.js";import y from"./PortalRating.js";import{a as w}from"../chunks/persistableUrlUtils.js";var v;const f=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),b=new Set(["KML","GeoJson","CSV"]);let k=v=class extends(r.JSONSupportMixin(a)){static from(e){return c(v,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=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 e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Geocoding Service"===e?i="Locator":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"Raster function template"===e?i="Raster Function Template":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")?i="Instant App":"Insights Page"===e?i="Insights Report":"Excalibur Imagery Project"===e?i="Excalibur Project":"3DTiles Service"===e?i="3D tiles layer":"3DTiles Package"===e&&(i="3D tiles package"),i}readExtent(e){return e&&e.length?new m(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1,u=!1,m=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":d?"utilitynetwork":a?"featureshosted":"features"):"map service"===e||"wms"===e||"wmts"===e?(c=i.includes("Spatiotemporal"),u=i.includes("Relational"),s=c||u?"mapimages":a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages"):s="scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"video service"===e?i.includes("Live Stream")?"livestreamvideolayer":"videolayer":"geoprocessing service"===e?i.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"3dtiles service"===e?i.includes("3DObject")?"3dobjecttileslayer":i.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):"web map"===e||"cityengine web scene"===e?s="maps":"web scene"===e?s=i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?s="instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?s="apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?s="mapsgray":"service definition"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"netcdf"===e||"administrative report"===e?s="datafiles":"360 vr experience"===e?s="360vr":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?s="appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?s="addindesktop":"pdf"===e?s="pdf":"microsoft word"===e?s="word":"microsoft excel"===e?s="excel":"microsoft powerpoint"===e?s="ppt":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"workflow manager package"===e||"explorer map"===e&&i.includes("Explorer Mapping Application")||i.includes("Document")?s="datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?s="toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?s="layersgray":"analysis model"===e?s="analysismodel":"scene package"===e?s="scenepackage":"3dtiles package"===e?s="3dtileslayerpackage":"3dtiles service"===e?s="3dtileslayer":"mobile scene package"===e?s="mobilescenepackage":"tile package"===e||"compact tile package"===e?s="tilepackage":"task file"===e?s="taskfile":"report template"===e?s="report-template":"statistical data collection"===e?s="statisticaldatacollection":"insights workbook"===e?s="workbook":"insights model"===e?s="insightsmodel":"insights page"===e?s="insightspage":"insights theme"===e?s="insightstheme":"hub initiative"===e?s="hubinitiative":"hub page"===e?s="hubpage":"hub site application"===e?s="hubsite":"hub event"===e?s="hubevent":"hub project"===e?s="hubproject":"relational database connection"===e?s="relationaldatabaseconnection":"big data file share"===e?s="datastorecollection":"image collection"===e?s="imagecollection":"desktop style"===e?s="desktopstyle":"style"===e?s=i.includes("Dictionary")?"dictionarystyle":"style":"dashboard"===e?s="dashboard":"raster function template"===e?s="rasterprocessingtemplate":"vector tile package"===e?s="vectortilepackage":"ortho mapping project"===e?s="orthomappingproject":"ortho mapping template"===e?s="orthomappingtemplate":"solution"===e?s="solutions":"geopackage"===e?s="geopackage":"deep learning package"===e?s="deeplearningpackage":"real time analytic"===e?s="realtimeanalytics":"reality mapping project"===e?s="realitymappingproject":"big data analytic"===e?s="bigdataanalytics":"feed"===e?s="feed":"excalibur imagery project"===e?s="excaliburimageryproject":"notebook"===e?s="notebook":"storymap"===e?s="storymap":"survey123 add in"===e?s="survey123addin":"mission"===e?s="mission":"mission report"===e?s="missionreport":"mission template"===e?s="missiontemplate":"quickcapture project"===e?s="quickcaptureproject":"pro report"===e?s="proreport":"pro report template"===e?s="proreporttemplate":"urban model"===e?s="urbanmodel":"urban project"===e?s="urbanproject":"web experience"===e?s="experiencebuilder":"web experience template"===e?s="webexperiencetemplate":"experience builder widget"===e?s="experiencebuilderwidget":"experience builder widget package"===e?s="experiencebuilderwidgetpackage":"workflow"===e?s="workflow":"kernel gateway connection"===e?s="kernelgatewayconnection":"insights script"===e?s="insightsscript":"hub initiative template"===e?s="hubinitiativetemplate":"storymap theme"===e?s="storymaptheme":"knowledge graph"===e?s="knowledgegraph":"knowledge graph layer"===e?s="knowledgegraphlayer":"knowledge studio project"===e?s="knowledgestudio":"native application"===e?s="nativeapp":"native application installer"===e?s="nativeappinstaller":"web link chart"===e?s="linkchart":"knowledge graph web investigation"===e?s="investigation":"ogcfeatureserver"===e?s="features":"pro presentation"===e?s="propresentation":"pro project"===e?s="proproject":"insights workbook package"===e?s="insightsworkbookpackage":"apache parquet"===e?s="apacheparquet":"notebook code snippet library"===e?s="notebookcodesnippets":"suitability model"===e?s="suitabilitymodel":"esri classifier definition"===e?s="classifierdefinition":"esri classification schema"===e?s="classificationschema":"insights data engineering workbook"===e?s="dataengineeringworkbook":"insights data engineering model"===e?s="dataengineeringmodel":"deep learning studio project"===e?s="deeplearningproject":"discussion"===e?s="discussion":"allsource project"===e?s="allsourceproject":"api key"===e?s="apikey":"data pipeline"===e?s="datapipelines":"group layer"===e?(m=i.includes("Map"),s=m?"layergroup2d":"layergroup"):s="media layer"===e?"onlinemedialayer":"form"===e?i.includes("Survey123")?"survey":"datafilesgray":"csv"===e?"csv":"image"===e?"image":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&f.has(this.type)}get itemCdnUrl(){return w(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=h.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof y&&(e=e.rating),null==e||isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new y({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),classification:o(this.classification),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new v({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const i=e[t];i&&(e[t]=JSON.stringify(i))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new y(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e?.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new i("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},l={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:p}=await t.request(`${r}/copy`,l);return new v({id:p,portal:t})}updateThumbnail(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)n(t)?r.query={data:t}:r.query={url:l(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=i?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await import("./support/resourceUtils.js");return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResources:r}=await import("./support/resourceUtils.js");return e.portalItem=this,await r(this,[{resource:e,content:t,compress:i?.compress,access:i?.access}],"add",i),e}async removeResource(e,t){const{removeResource:r}=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await import("./support/resourceUtils.js");return t(this,e)}resourceFromPath(e){return new g({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:o(this.categories),classification:o(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return s(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new v({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([p({type:["private","shared","org","public"]})],k.prototype,"access",void 0),e([p()],k.prototype,"accessInformation",void 0),e([p({type:String})],k.prototype,"apiKey",void 0),e([p({json:{read:{source:"appProxies"}}})],k.prototype,"applicationProxies",void 0),e([p()],k.prototype,"avgRating",void 0),e([p()],k.prototype,"categories",void 0),e([p()],k.prototype,"classification",void 0),e([p({type:Date})],k.prototype,"created",void 0),e([p()],k.prototype,"culture",void 0),e([p()],k.prototype,"description",void 0),e([p({readOnly:!0})],k.prototype,"displayName",null),e([p({type:m})],k.prototype,"extent",void 0),e([d("extent")],k.prototype,"readExtent",null),e([p()],k.prototype,"groupCategories",void 0),e([p({readOnly:!0})],k.prototype,"iconUrl",null),e([p()],k.prototype,"id",void 0),e([p({readOnly:!0})],k.prototype,"isLayer",null),e([p({type:Boolean,readOnly:!0})],k.prototype,"isOrgItem",void 0),e([p()],k.prototype,"itemControl",void 0),e([p({readOnly:!0})],k.prototype,"itemPageUrl",null),e([p({readOnly:!0})],k.prototype,"itemUrl",null),e([p()],k.prototype,"licenseInfo",void 0),e([p({type:Date})],k.prototype,"modified",void 0),e([p()],k.prototype,"name",void 0),e([p()],k.prototype,"numComments",void 0),e([p()],k.prototype,"numRatings",void 0),e([p()],k.prototype,"numViews",void 0),e([p()],k.prototype,"owner",void 0),e([p()],k.prototype,"ownerFolder",void 0),e([p({type:h})],k.prototype,"portal",void 0),e([p()],k.prototype,"screenshots",void 0),e([p()],k.prototype,"size",void 0),e([p()],k.prototype,"snippet",void 0),e([p()],k.prototype,"sourceJSON",void 0),e([p({type:String})],k.prototype,"sourceUrl",void 0),e([p({type:String})],k.prototype,"spatialReference",void 0),e([p()],k.prototype,"tags",void 0),e([p()],k.prototype,"thumbnail",void 0),e([p({readOnly:!0})],k.prototype,"thumbnailUrl",null),e([p()],k.prototype,"title",void 0),e([p()],k.prototype,"type",void 0),e([p()],k.prototype,"typeKeywords",void 0),e([p({type:String,json:{read(e,t){if(b.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],k.prototype,"url",void 0),e([p({readOnly:!0})],k.prototype,"userItemUrl",null),k=v=e([u("esri.portal.PortalItem")],k);const S=k;export{S as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import r from"../core/JSONSupport.js";import{clone as o,fixJson as s}from"../core/lang.js";import a from"../core/Loadable.js";import{isDataProtocol as n,makeAbsolute as l}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import{reader as d}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import m from"../geometry/Extent.js";import h from"./Portal.js";import g from"./PortalItemResource.js";import y from"./PortalRating.js";import{a as w}from"../chunks/persistableUrlUtils.js";var v;const f=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),b=new Set(["KML","GeoJson","CSV"]);let k=v=class extends(r.JSONSupportMixin(a)){static from(e){return c(v,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=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 e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Geocoding Service"===e?i="Locator":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"Raster function template"===e?i="Raster Function Template":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")?i="Instant App":"Insights Page"===e?i="Insights Report":"Excalibur Imagery Project"===e?i="Excalibur Project":"3DTiles Service"===e?i="3D tiles layer":"3DTiles Package"===e&&(i="3D tiles package"),i}readExtent(e){return e&&e.length?new m(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1,u=!1,m=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":d?"utilitynetwork":a?"featureshosted":"features"):"map service"===e||"wms"===e||"wmts"===e?(c=i.includes("Spatiotemporal"),u=i.includes("Relational"),s=c||u?"mapimages":a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages"):s="scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"video service"===e?i.includes("Live Stream")?"livestreamvideolayer":"videolayer":"geoprocessing service"===e?i.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"3dtiles service"===e?i.includes("3DObject")?"3dobjecttileslayer":i.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):"web map"===e||"cityengine web scene"===e?s="maps":"web scene"===e?s=i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?s="instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?s="apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?s="mapsgray":"service definition"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"netcdf"===e||"administrative report"===e?s="datafiles":"360 vr experience"===e?s="360vr":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?s="appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?s="addindesktop":"pdf"===e?s="pdf":"microsoft word"===e?s="word":"microsoft excel"===e?s="excel":"microsoft powerpoint"===e?s="ppt":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"workflow manager package"===e||"explorer map"===e&&i.includes("Explorer Mapping Application")||i.includes("Document")?s="datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?s="toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?s="layersgray":"analysis model"===e?s="analysismodel":"scene package"===e?s="scenepackage":"3dtiles package"===e?s="3dtileslayerpackage":"3dtiles service"===e?s="3dtileslayer":"mobile scene package"===e?s="mobilescenepackage":"tile package"===e||"compact tile package"===e?s="tilepackage":"task file"===e?s="taskfile":"report template"===e?s="report-template":"statistical data collection"===e?s="statisticaldatacollection":"insights workbook"===e?s="workbook":"insights model"===e?s="insightsmodel":"insights page"===e?s="insightspage":"insights theme"===e?s="insightstheme":"hub initiative"===e?s="hubinitiative":"hub page"===e?s="hubpage":"hub site application"===e?s="hubsite":"hub event"===e?s="hubevent":"hub project"===e?s="hubproject":"relational database connection"===e?s="relationaldatabaseconnection":"big data file share"===e?s="datastorecollection":"image collection"===e?s="imagecollection":"desktop style"===e?s="desktopstyle":"style"===e?s=i.includes("Dictionary")?"dictionarystyle":"style":"dashboard"===e?s="dashboard":"raster function template"===e?s="rasterprocessingtemplate":"vector tile package"===e?s="vectortilepackage":"ortho mapping project"===e?s="orthomappingproject":"ortho mapping template"===e?s="orthomappingtemplate":"solution"===e?s="solutions":"geopackage"===e?s="geopackage":"deep learning package"===e?s="deeplearningpackage":"real time analytic"===e?s="realtimeanalytics":"reality mapping project"===e?s="realitymappingproject":"big data analytic"===e?s="bigdataanalytics":"feed"===e?s="feed":"excalibur imagery project"===e?s="excaliburimageryproject":"notebook"===e?s="notebook":"storymap"===e?s="storymap":"survey123 add in"===e?s="survey123addin":"mission"===e?s="mission":"mission report"===e?s="missionreport":"mission template"===e?s="missiontemplate":"quickcapture project"===e?s="quickcaptureproject":"pro report"===e?s="proreport":"pro report template"===e?s="proreporttemplate":"urban model"===e?s="urbanmodel":"urban project"===e?s="urbanproject":"web experience"===e?s="experiencebuilder":"web experience template"===e?s="webexperiencetemplate":"experience builder widget"===e?s="experiencebuilderwidget":"experience builder widget package"===e?s="experiencebuilderwidgetpackage":"workflow"===e?s="workflow":"kernel gateway connection"===e?s="kernelgatewayconnection":"insights script"===e?s="insightsscript":"hub initiative template"===e?s="hubinitiativetemplate":"storymap theme"===e?s="storymaptheme":"knowledge graph"===e?s="knowledgegraph":"knowledge graph layer"===e?s="knowledgegraphlayer":"knowledge studio project"===e?s="knowledgestudio":"native application"===e?s="nativeapp":"native application installer"===e?s="nativeappinstaller":"web link chart"===e?s="linkchart":"knowledge graph web investigation"===e?s="investigation":"ogcfeatureserver"===e?s="features":"pro presentation"===e?s="propresentation":"pro project"===e?s="proproject":"insights workbook package"===e?s="insightsworkbookpackage":"apache parquet"===e?s="apacheparquet":"notebook code snippet library"===e?s="notebookcodesnippets":"suitability model"===e?s="suitabilitymodel":"esri classifier definition"===e?s="classifierdefinition":"esri classification schema"===e?s="classificationschema":"insights data engineering workbook"===e?s="dataengineeringworkbook":"insights data engineering model"===e?s="dataengineeringmodel":"deep learning studio project"===e?s="deeplearningproject":"discussion"===e?s="discussion":"allsource project"===e?s="allsourceproject":"api key"===e?s="apikey":"data pipeline"===e?s="datapipelines":"group layer"===e?(m=i.includes("Map"),s=m?"layergroup2d":"layergroup"):s="media layer"===e?"onlinemedialayer":"form"===e?i.includes("Survey123")?"survey":"datafilesgray":"csv"===e?"csv":"image"===e?"image":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&f.has(this.type)}get itemCdnUrl(){return w(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=h.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}},i=e instanceof y?e.rating:e;return null==i||isNaN(i)||"number"!=typeof e||(t.query.rating=i),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new y({rating:i,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),classification:o(this.classification),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new v({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const i=e[t];i&&(e[t]=JSON.stringify(i))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new y(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e?.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new i("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},l={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:p}=await t.request(`${r}/copy`,l);return new v({id:p,portal:t})}updateThumbnail(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)n(t)?r.query={data:t}:r.query={url:l(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=i?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await import("./support/resourceUtils.js");return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResources:r}=await import("./support/resourceUtils.js");return e.portalItem=this,await r(this,[{resource:e,content:t,compress:i?.compress,access:i?.access}],"add",i),e}async removeResource(e,t){const{removeResource:r}=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await import("./support/resourceUtils.js");return t(this,e)}resourceFromPath(e){return new g({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:o(this.categories),classification:o(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return s(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new v({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([p({type:["private","shared","org","public"]})],k.prototype,"access",void 0),e([p()],k.prototype,"accessInformation",void 0),e([p({type:String})],k.prototype,"apiKey",void 0),e([p({json:{read:{source:"appProxies"}}})],k.prototype,"applicationProxies",void 0),e([p()],k.prototype,"avgRating",void 0),e([p()],k.prototype,"categories",void 0),e([p()],k.prototype,"classification",void 0),e([p({type:Date})],k.prototype,"created",void 0),e([p()],k.prototype,"culture",void 0),e([p()],k.prototype,"description",void 0),e([p({readOnly:!0})],k.prototype,"displayName",null),e([p({type:m})],k.prototype,"extent",void 0),e([d("extent")],k.prototype,"readExtent",null),e([p()],k.prototype,"groupCategories",void 0),e([p({readOnly:!0})],k.prototype,"iconUrl",null),e([p()],k.prototype,"id",void 0),e([p({readOnly:!0})],k.prototype,"isLayer",null),e([p({type:Boolean,readOnly:!0})],k.prototype,"isOrgItem",void 0),e([p()],k.prototype,"itemControl",void 0),e([p({readOnly:!0})],k.prototype,"itemPageUrl",null),e([p({readOnly:!0})],k.prototype,"itemUrl",null),e([p()],k.prototype,"licenseInfo",void 0),e([p({type:Date})],k.prototype,"modified",void 0),e([p()],k.prototype,"name",void 0),e([p()],k.prototype,"numComments",void 0),e([p()],k.prototype,"numRatings",void 0),e([p()],k.prototype,"numViews",void 0),e([p()],k.prototype,"owner",void 0),e([p()],k.prototype,"ownerFolder",void 0),e([p({type:h})],k.prototype,"portal",void 0),e([p()],k.prototype,"screenshots",void 0),e([p()],k.prototype,"size",void 0),e([p()],k.prototype,"snippet",void 0),e([p()],k.prototype,"sourceJSON",void 0),e([p({type:String})],k.prototype,"sourceUrl",void 0),e([p({type:String})],k.prototype,"spatialReference",void 0),e([p()],k.prototype,"tags",void 0),e([p()],k.prototype,"thumbnail",void 0),e([p({readOnly:!0})],k.prototype,"thumbnailUrl",null),e([p()],k.prototype,"title",void 0),e([p()],k.prototype,"type",void 0),e([p()],k.prototype,"typeKeywords",void 0),e([p({type:String,json:{read(e,t){if(b.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],k.prototype,"url",void 0),e([p({readOnly:!0})],k.prototype,"userItemUrl",null),k=v=e([u("esri.portal.PortalItem")],k);const S=k;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import{setDeepValue as o}from"../../core/object.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as t}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"./BinParametersBase.js";function p(r){return r[0]instanceof Date}function n(r,e,s){o(s,r&&p(r)?r.map((r=>r.getTime())):r,e)}let c=class extends a{constructor(r){super(r),this.boundaries=null,this.type="fixed-boundaries"}};r([e({json:{name:"parameters.boundaries",write:{writer:n}}})],c.prototype,"boundaries",void 0),r([t({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=r([i("esri.rest.support.FixedBoundariesBinParameters")],c);const m=c;c.from=s(c);export{m as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import{setDeepValue as o}from"../../core/object.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as t}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"./BinParametersBase.js";function p(r){return r[0]instanceof Date}function c(r,e,s){o(s,r&&p(r)?r.map((r=>r.getTime())):r,e)}let n=class extends a{constructor(r){super(r),this.boundaries=[],this.type="fixed-boundaries"}};r([e({json:{name:"parameters.boundaries",write:{writer:c}}})],n.prototype,"boundaries",void 0),r([t({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],n.prototype,"type",void 0),n=r([i("esri.rest.support.FixedBoundariesBinParameters")],n);const m=n;n.from=s(n);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../core/Collection.js";import{mappedFind as r}from"../core/maybe.js";import{Url as t,makeAbsolute as a,normalize as n}from"../core/urlUtils.js";import{effectEquals as l}from"../layers/effects/utils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";function s(e){return"Web Scene"===e.portalItem?.type||e.referenceLayers.some((e=>"scene"===e.type))}function u(e){return!!e?.portalItem?.tags?.some((e=>"beta"===e.toLowerCase()))}function c(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}let o;function f(e){if(o)return o(e);let r=null;const t=v(e),a=!t?.baseLayers.length;for(const n in i){const e=T(t,R(i[n]),{mustMatchReferences:a});if("equal"===e){r=n;break}"base-layers-equal"===e&&(r=n)}return r}function p(e){o=e}function y(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===T(v(e),v(r),{mustMatchReferences:!0})}function m(e){return!!e?.baseLayers.concat(e.referenceLayers).some(b)}function b(e){if(S(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(S(t?.sourceUrl))return!0}return!1}function d(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const a=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),n=e.spatialReference;return n?{spatialReference:a.find((e=>n.equals(e)))??a[0]??null,updating:!1}:{spatialReference:a[0],updating:!1}}const L=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function S(e){if(!e)return!1;const r=new t(a(e));return!!r.authority&&L.test(r.authority)}function v(e){return e?!e.loaded&&e.resourceInfo?R(e.resourceInfo.data):{baseLayers:g(e.baseLayers),referenceLayers:g(e.referenceLayers)}:null}function g(r){return(e.isCollection(r)?r.toArray():r).map(I)}function I(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:M("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function h(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function R(e){return e?{baseLayers:q((e.baseMapLayers??[]).filter((e=>!h(e)))),referenceLayers:q((e.baseMapLayers??[]).filter((e=>h(e))))}:null}function q(e){return e.map((e=>x(e)))}function x(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;default:r="unknown"}return{type:r,effect:e.effect,url:M(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function T(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!U(e.baseLayers,r.baseLayers))return"not-equal";return U(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function U(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!w(e[t],r[t]))return!1;return!0}function w(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!l(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const a=e.sublayers.at(t),n=r.sublayers.at(t);if(a?.id!==n?.id||a?.visible!==n?.visible)return!1}}return!0}function M(e){return e?n(e).replace(/^\s*https?:/i,"").toLowerCase():""}function j(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const a=f(e);return a?i[a].thumbnailUrl:r(e.baseLayers,k)}function k(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{y as contentEquals,d as findSpatialReference,j as getBasemapThumbnailUrl,f as getWellKnownBasemapId,m as hasDeveloperBasemapLayer,s as isBasemap3D,u as isBasemapInBeta,c as isBasemapLayer,b as isDeveloperBasemapLayer,w as layerDefinitionEquals,I as layerToDefinition,p as overrideGetWellKnownBasemapId};
5
+ import e from"../core/Collection.js";import{mappedFind as r}from"../core/maybe.js";import{Url as t,makeAbsolute as a,normalize as n}from"../core/urlUtils.js";import{effectEquals as l}from"../layers/effects/utils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";function s(e){return"Web Scene"===e.portalItem?.type||e.referenceLayers.some((e=>"scene"===e.type))}function u(e){return!!e?.portalItem?.tags?.some((e=>"beta"===e.toLowerCase()))}function c(e,r){return!(!e.basemap?.referenceLayers?.some((e=>e.uid===r))&&!e.basemap?.baseLayers?.some((e=>e.uid===r)))}let o;function f(e){if(o)return o(e);let r=null;const t=v(e),a=!t?.baseLayers.length;for(const n in i){const e=T(t,R(i[n]),{mustMatchReferences:a});if("equal"===e){r=n;break}"base-layers-equal"===e&&(r=n)}return r}function p(e){o=e}function y(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===T(v(e),v(r),{mustMatchReferences:!0})}function m(e){return!!e?.baseLayers.concat(e.referenceLayers).some(b)}function b(e){if(S(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(S(t?.sourceUrl))return!0}return!1}function d(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const a=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),n=e.spatialReference;return n?{spatialReference:a.find((e=>n.equals(e)))??a[0]??null,updating:!1}:{spatialReference:a[0],updating:!1}}const L=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function S(e){if(!e)return!1;const r=new t(a(e));return!!r.authority&&L.test(r.authority)}function v(e){return e?!e.loaded&&e.resourceInfo?R(e.resourceInfo.data):{baseLayers:g(e.baseLayers),referenceLayers:g(e.referenceLayers)}:null}function g(r){return(e.isCollection(r)?r.toArray():r).map(I)}function I(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:M("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function h(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function R(e){return e?{baseLayers:q((e.baseMapLayers??[]).filter((e=>!h(e)))),referenceLayers:q((e.baseMapLayers??[]).filter((e=>h(e))))}:null}function q(e){return e.map((e=>x(e)))}function x(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;default:r="unknown"}return{type:r,effect:e.effect,url:M(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function T(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!U(e.baseLayers,r.baseLayers))return"not-equal";return U(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function U(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!w(e[t],r[t]))return!1;return!0}function w(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!l(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const a=e.sublayers.at(t),n=r.sublayers.at(t);if(a?.id!==n?.id||a?.visible!==n?.visible)return!1}}return!0}function M(e){return e?n(e).replace(/^\s*https?:/i,"").toLowerCase():""}function j(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const a=f(e);return a?i[a].thumbnailUrl:r(e.baseLayers,k)}function k(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{y as contentEquals,d as findSpatialReference,j as getBasemapThumbnailUrl,f as getWellKnownBasemapId,m as hasDeveloperBasemapLayer,s as isBasemap3D,u as isBasemapInBeta,c as isBasemapLayer,b as isDeveloperBasemapLayer,w as layerDefinitionEquals,I as layerToDefinition,p as overrideGetWellKnownBasemapId};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const e="20241222",b="364e0177afd8e82777b3cd60be03f5708e113306";export{e as buildDate,b as commitHash};
5
+ const a="20241223",d="dd729fa2d3575da7647c9f46aa6819c86bad8690";export{a as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import i from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{zeroMeters as a,scale as l}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as d}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{orientation as v}from"../geometryUtils.js";import{SupportedObjectResult as g}from"../isSupportedObjectUtils.js";import{manipulatedObjectGeometry as _}from"../manipulatedObjectUtils.js";import{canMoveZOperations as M}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as b}from"../tooltipUtils3D.js";import{createVisualElements as y}from"../visualElementUtils.js";import{discRadius as T}from"../manipulations/config.js";import{ManipulationType as w,MoveManipulation as I}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as x}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{dragManipulatedObjectMany as U,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as k}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as H}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import X from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as Y}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as R}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as A,enterInputModeIfAvailable as z}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as D}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoDistanceBetweenPoints2D as V}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.objects=t,this.type="move-start"}}class B{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class N{constructor(t){this.objects=t,this.type="move-stop"}}const q=Symbol("manipulators"),J=Symbol("tooltips");let K=class extends k{constructor(t){super(t),this._infos=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new X,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null}initialize(){const{view:t}=this;this.tooltip=A((()=>({view:t,options:this.sketchOptions.tooltips}))),this.addHandles([this.objects.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),this.objects.on("change",(()=>this._connectTooltips()))]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(t){if(!this.destroyed&&!z(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=_(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(x(e)!==g.SUPPORTED)continue;const t=new Q(e);this._infos.set(e,t)}for(const e of o)this._infos.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infos.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values());this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator((t=>{this.addHandles([t.events.on("immediate-click",(t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{"start"===t?this._showTooltip(w.XY):this._hideTooltip()}))],q)})),this.addHandles(o.manipulationXY.createDragPipeline(((o,e,i,n)=>this._buildDragEventPipeline(t,w.XY,o,e,i,n))),q)}this._createMoveManipulation(t)}_createMoveManipulation(t){const o=new I({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?I.radiusForSymbol(t[0].object.graphic?.symbol):T});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()})),q)}));const e=t=>o=>{this.addHandles([o.events.on("focus-changed",(({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()})),o.events.on("grab-changed",(()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=a)}))],q)};this._moveManipulation.xyManipulation.forEachManipulator(e(w.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(w.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(w.Z));const i=()=>this._updateMoveManipulation(t);for(const a of t)this.addHandles([a.object.on("committed",i),r((()=>a.object.visible),i)],q);const n=t[t.length-1];this.addHandles(n.object.on("committed",(()=>this._updateMoveManipulationAngle(n))),q);const{object:s}=n,{operations:l}=s;if(l){const e=s.graphic;this.addHandles(o.createDragPipeline(((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s)),s.elevationInfo,l.data.spatialReference,e),q)}this._updateMoveManipulationAngle(n)}_createVisualElements(t){for(const o of t){const e=o.object,i=y({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",(()=>{o.object.isDraped||this._updateMoveManipulation(t)})),r((()=>o.object.isDraped),(()=>this._updateMoveManipulation(t)))],q),this.addHandles(i,q))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=v(_(t.object)))}_updateMoveManipulation(t){const o=u(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&M(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&o===w.XY){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next((t=>p?.(t))).next((()=>(l.length&&this.events.emit("move-stop",new N(l)),this.destroyed||c(),null))),{steps:i=i.next((o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=U(l),p=P(l),this._emitRecordUndo(),this.events.emit("move-start",new L(l)),this.destroyed))return null}return 0!==l.length?o:null})).next((t=>r?.(t))).next((t=>(this._updateMoveTooltip(o,t),t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new B(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new N(l)),this.destroyed)return null;c()}return null})),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(J),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new D({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new L([o]))},onMove:()=>e.emit("move",new B(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new N([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=b(this.tooltip,o,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i})))}else t=r((()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null),(t=>{this.tooltip.info=t}),p);this.addHandles(t,J)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case w.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,o)=>V(t,o)));break;case w.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new C({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,e)=>l(V(t,e),S(o))));break;case w.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new F({sketchOptions:e}),W(this._latestTooltipInfo,o,G)}this._latestTooltipInfo.sketchOptions=e}_emitRecordUndo(){const t=this.objects.toArray().map((t=>t.createUndoRecord?.())).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=_(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new Y({elevationInfo:o,pointer:n,editGeometryOperations:H.fromGeometry(a,this.view.state.viewingMode),visualizer:new f,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=R({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(c),{steps:e=e.next((o=>{a.z=d(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}})).next(...p),cancel:i}}};t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"view",void 0),t([c()],K.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:X})],K.prototype,"sketchOptions",void 0),t([c({constructOnly:!0})],K.prototype,"snappingManager",void 0),t([c()],K.prototype,"type",void 0),t([c()],K.prototype,"updating",null),t([c()],K.prototype,"_latestTooltipInfo",void 0),t([c()],K.prototype,"_shouldShowMovePointTooltip",null),t([c()],K.prototype,"activeTooltipInfo",null),K=t([h("esri.views.3d.interactive.editingTools.move.MoveTool3D")],K);class Q{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function W(t,o,e){if(null==o||"end"===o.action)return void(t.distance=a);const{mapStart:i,mapEnd:n}=o,s=e(i,n);t.distance=null!=s?s:a}export{B as MoveEvent,L as MoveStartEvent,N as MoveStopEvent,K as MoveTool3D};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import i from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{zeroMeters as a,scale as l}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as m}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as d}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{orientation as v}from"../geometryUtils.js";import{SupportedObjectResult as g}from"../isSupportedObjectUtils.js";import{manipulatedObjectGeometry as _}from"../manipulatedObjectUtils.js";import{canMoveZOperations as M}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as b}from"../tooltipUtils3D.js";import{createVisualElements as y}from"../visualElementUtils.js";import{discRadius as T}from"../manipulations/config.js";import{ManipulationType as w,MoveManipulation as I}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as x}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{dragManipulatedObjectMany as U,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as k}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as H}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import X from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as Y}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as R}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as A,enterInputModeIfAvailable as z}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as D}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoDistanceBetweenPoints2D as V}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.objects=t,this.type="move-start"}}class B{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class N{constructor(t){this.objects=t,this.type="move-stop"}}const q=Symbol("manipulators"),J=Symbol("tooltips");let K=class extends k{constructor(t){super(t),this._infos=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new X,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new u,this._moveManipulation=null}initialize(){const{view:t}=this;this.tooltip=A((()=>({view:t,options:this.sketchOptions.tooltips}))),this.addHandles([this.objects.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),this.objects.on("change",(()=>this._connectTooltips()))]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(t){if(!this.destroyed&&!z(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=_(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(x(e)!==g.SUPPORTED)continue;const t=new Q(e);this._infos.set(e,t)}for(const e of o)this._infos.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infos.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values());this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator((t=>{this.addHandles([t.events.on("immediate-click",(t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{"start"===t?this._showTooltip(w.XY):this._hideTooltip()}))],q)})),this.addHandles(o.manipulationXY.createDragPipeline(((o,e,i,n)=>this._buildDragEventPipeline(t,w.XY,o,e,i,n))),q)}this._createMoveManipulation(t)}_createMoveManipulation(t){const o=new I({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?I.radiusForSymbol(t[0].object.graphic?.symbol):T});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()})),q)}));const e=t=>o=>{this.addHandles([o.events.on("focus-changed",(({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()})),o.events.on("grab-changed",(()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=a)}))],q)};this._moveManipulation.xyManipulation.forEachManipulator(e(w.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(w.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(w.Z));const i=()=>this._updateMoveManipulation(t);for(const a of t)this.addHandles([a.object.on("committed",i),r((()=>a.object.visible),i)],q);const n=t[t.length-1];this.addHandles(n.object.on("committed",(()=>this._updateMoveManipulationAngle(n))),q);const{object:s}=n,{operations:l}=s;if(l){const e=s.graphic;this.addHandles(o.createDragPipeline(((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s)),s.elevationInfo,l.data.spatialReference,e),q)}this._updateMoveManipulationAngle(n)}_createVisualElements(t){for(const o of t){const e=o.object,i=y({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",(()=>{o.object.isDraped||this._updateMoveManipulation(t)})),r((()=>o.object.isDraped),(()=>this._updateMoveManipulation(t)))],q),this.addHandles(i,q))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=v(_(t.object)))}_updateMoveManipulation(t){const o=m(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&M(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&o===w.XY){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next((t=>p?.(t))).next((()=>(l.length&&this.events.emit("move-stop",new N(l)),this.destroyed||c(),null))),{steps:i=i.next((o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=U(l),p=P(l),this._emitRecordUndo(),this.events.emit("move-start",new L(l)),this.destroyed))return null}return 0!==l.length?o:null})).next((t=>r?.(t))).next((t=>(this._updateMoveTooltip(o,t),t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new B(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new N(l)),this.destroyed)return null;c()}return null})),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(J),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new D({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new L([o]))},onMove:()=>e.emit("move",new B(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new N([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=b(this.tooltip,o,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i})))}else t=r((()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null),(t=>{this.tooltip.info=t}),p);this.addHandles(t,J)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case w.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,o)=>V(t,o)));break;case w.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new C({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,e)=>l(V(t,e),S(o))));break;case w.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new F({sketchOptions:e}),W(this._latestTooltipInfo,o,G)}this._latestTooltipInfo.sketchOptions=e}_emitRecordUndo(){const t=this.objects.toArray().map((t=>t.createUndoRecord?.())).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=_(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new Y({elevationInfo:o,pointer:n,editGeometryOperations:H.fromGeometry(a,this.view.state.viewingMode),visualizer:new f,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=R({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(c),{steps:e=e.next((o=>{a.z=d(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}})).next(...p),cancel:i}}};t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"view",void 0),t([c()],K.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:X})],K.prototype,"sketchOptions",void 0),t([c({constructOnly:!0})],K.prototype,"snappingManager",void 0),t([c()],K.prototype,"type",void 0),t([c()],K.prototype,"updating",null),t([c()],K.prototype,"_latestTooltipInfo",void 0),t([c()],K.prototype,"_shouldShowMovePointTooltip",null),t([c()],K.prototype,"activeTooltipInfo",null),K=t([h("esri.views.3d.interactive.editingTools.move.MoveTool3D")],K);class Q{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function W(t,o,e){if(null==o||"end"===o.action)return void(t.distance=a);const{mapStart:i,mapEnd:n}=o,s=e(i,n);t.distance=null!=s?s:a}export{B as MoveEvent,L as MoveStartEvent,N as MoveStopEvent,K as MoveTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import l from"../../../../core/Error.js";import{fetchStyle as t,symbolUrlFromStyleItem as s}from"../../../../symbols/support/styleUtils.js";import{getStyleItemFromStyle as e,fetchSymbolFromStyle as n}from"../../../../symbols/support/webStyleSymbolUtils.js";async function r(r){if(null===r||null==r.styleName&&null==r.styleUrl)return null;const o=r.name;if(null==o)throw new l("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference");const u={portal:r.portal},i=await t(r,u).catch((()=>null));if(null===i)return null;const m=e(o,i.data);if(m&&!m.formatInfos?.some((l=>"gltf_basisu"===l.type)))return null;const a=await n(i,o,u,"webRef",((l,t)=>s(l,t,["gltf_basisu","gltf"]))).catch((()=>null));if(null===a||"point-3d"!==a.type)return null;const y=a.symbolLayers.items[0];return"object"===y.type?y.resource:null}export{r as getResourceUrlFromSymbolStyle};
5
+ import l from"../../../../core/Error.js";import{fetchStyle as t,symbolUrlFromStyleItem as s}from"../../../../symbols/support/styleUtils.js";import{getStyleItemFromStyle as e,fetchSymbolFromStyle as n}from"../../../../symbols/support/webStyleSymbolUtils.js";async function r(r){if(null==r||null==r.styleName&&null==r.styleUrl)return null;const o=r.name;if(null==o)throw new l("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference");const u={portal:r.portal},i=await t(r,u).catch((()=>null));if(null===i)return null;const m=e(o,i.data);if(m&&!m.formatInfos?.some((l=>"gltf_basisu"===l.type)))return null;const a=await n(i,o,u,"webRef",((l,t)=>s(l,t,["gltf_basisu","gltf"]))).catch((()=>null));if(null===a||"point-3d"!==a.type)return null;const y=a.symbolLayers.items[0];return"object"===y.type?y.resource:null}export{r as getResourceUrlFromSymbolStyle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{assertIsSome as t}from"../../../../core/maybe.js";import{MinPriority as r}from"../../../../core/MemCache.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{generateUUID as n}from"../../../../core/uuid.js";import{normalFromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{p as a}from"../../../../chunks/vec32.js";import{ONES as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as d}from"../../../../geometry/projection/projectBoundingSphere.js";import{isRelativeVertexSpace as u}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{l as c}from"../../../../chunks/sphere.js";import{CachedMeshData as m}from"./CachedMeshData.js";import{convertMeshMaterialToPBRMaterial as h}from"./I3SClientMaterialUtil.js";class f{constructor(e,t,r,o){this._uid=e,this._worker=o,this._id2Meta=new Map,this._oid2Meta=new Map,this._indexSR=t.indexSR,this._vertexSR=t.vertexSR,this._renderSR=t.renderSR,this._memCache=r.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 r=`mesh${t}`,o=e.extent,n=o.spatialReference,s=this._indexSR,i=x(o,e.origin);d(i,n,i,s);return{type:"mesh",id:r,version:w(e),oid:t,mbs:i,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(t,r){if(null!=this.getMeshNodeIndex(r.oid))throw new e(`I3SClientNodeLoader: client side mesh for feature oid=${r.oid} already exists`);r.nodeIndex=t,this._id2Meta.set(r.id,r),this._oid2Meta.set(r.oid,r)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}getMeshNodeInfo(e){const t=this._oid2Meta.values();for(const r of t)if("mesh"===r.type&&r.id===e)return r;return null}removeNode(e){const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(t){const r=this._id2Meta.get(t);if(null==r)throw new e(`I3SClientNodeLoader::loadNodeJSON unable to find node ${t}`);switch(r.type){case"mesh":return this._loadMeshNodeJSON(r);case"mesh-component":return p(r);default:throw new e(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${t}`)}}async _loadMeshNodeJSON(e){const t=e.id,r=(await this._getMeshData(e)).loadedMesh;if(null==r.components||0===r.components.length)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const o=[],n=r.components;for(let s=0;s<n.length;++s){const r=`${t}-component${s}`,n={type:"mesh-component",id:r,mbs:e.mbs,componentIndex:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(n.id,n),e.componentNodeIds.push(r),o.push({id:n.id,href:null,mbs:n.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:o}}updateNodeIndex(e,t,r){const o=this._id2Meta.get(e);o&&"mesh"===o.type&&(o.nodeIndex=r)}async loadNodeData(r,n){const s=this._id2Meta.get(r);if(null==s||"mesh-component"!==s.type)throw new e(`Failed to load client node data for node ${r} (unexpected node info)`);const i=s.meshNodeInfo,a=await this._getMeshData(i),l=a.loadedMesh,d=i.oid;if(null==l.components)throw new e(`Failed to load client node data for node ${r} (unexpected null reference)`);const u=l.components[s.componentIndex],{material:c,requiredTextures:m,textureData:f}=await h(u.material);if(null!=f)for(const e of f)null!=e&&s.textureData.set(e.id,e);const p={params:{material:c},type:"ArrayBufferView"},{vertexSpace:x,origin:M,transform:w}=l,S=[M.x,M.y,M.z??0];a.projectionPromise||(t(this._worker,"SceneLayerWorker is needed to project mesh"),a.projectionPromise=this._worker.project({positions:l.vertexAttributes.position,localMatrix:w?.localMatrix,vertexSpace:x.toJSON(),origin:S,inSpatialReference:l.spatialReference.toJSON(),outSpatialReference:this._vertexSR.toJSON()},n));const{projected:b,original:_,projectedOrigin:N}=await a.projectionPromise;l.vertexAttributes.position=_;const{transformed:v,original:D}=await y(u,a,this._worker,n);l.vertexAttributes.normal=D,o(n);const{geometryBuffer:R,geometryDescriptor:j}=g(b,u.faces,v,l.vertexAttributes.uv,l.vertexAttributes.color,d);return{geometryData:{featureDataPosition:N,featureIds:[],geometries:[p]},attributeDataInfo:{attributeData:{},loadedAttributes:[]},geometryBuffer:R,geometryDescriptor:j,requiredTextures:m,textureData:f,normalReferenceFrame:this._vertexSR.isGeographic?"east-north-up":"vertex-reference-frame"}}async loadAttributes(e,t,r){const o=e.numFeatures,n={};for(const{field:{name:s}}of t)n[s]=new Array(o);return n}async loadTextures(e,t,r){const o=e.id,n=this._id2Meta.get(o);if(null==n||"mesh-component"!==n.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const i of t)s.push(n.textureData.get(i.id)||null);return s}async _getMeshData(e){const t=e.version,o=this._memCache.get(t);if(null==o){if(null!=e.loadMeshPromise)return e.loadMeshPromise;const o=async(o,n)=>{const s=e.unloadedMesh.clone();try{await s.load()}catch(a){n(a)}const i=new m(s);this._memCache.put(t,i,r),e.loadMeshPromise=null,o(i)};return e.loadMeshPromise=new Promise(((e,t)=>o(e,t))),e.loadMeshPromise}return o}}async function p(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}function x(e,t){const{spatialReference:r}=e,o=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],s=r.isGeographic?r.metersPerUnit:1,i=e.center;let a=0;if(e.hasZ)for(let l=0;l<2;++l)for(let e=0;e<2;++e)for(let r=0;r<2;++r){const d=(i.x+o[l]*n[0]-t.x)*s,u=(i.y+o[e]*n[1]-t.y)*s,c=i.z+o[r]*n[2]-t.z;a=Math.max(d*d+u*u+c*c,a)}else for(let l=0;l<2;++l)for(let e=0;e<2;++e){const r=(i.x+o[l]*n[0]-t.x)*s,d=(i.y+o[e]*n[1]-t.y)*s;a=Math.max(r*r+d*d,a)}return c([t.x,t.y,t.z],Math.sqrt(a))}async function y(e,r,o,n){const{transform:d,vertexAttributes:u}=r.loadedMesh,c="source"===e.shading?u.normal:null;if(!(null!=c&&null!=d&&(0!==d.rotationAngle||!a(d.scale,l))))return{transformed:c,original:u.normal};if(!r.normalsTransformPromise){t(o,"SceneLayerWorker is needed to transform mesh normals");const e=i();s(e,d.localMatrix),r.normalsTransformPromise=o.transformNormals({normalMatrix:e,normals:c},n)}return r.normalsTransformPromise}function g(e,t,r,o,n,s){const i=1,a=t.length/3,l=3*a;let d=0,u=0,c=!1,m=0,h=!1,f=0,p=!1,x=0,y=0,g=0;d+=S,d+=S,u=d,d+=3*l*b,null!=r&&(c=!0,m=d,d+=3*l*b),null!=o&&(h=!0,f=d,d+=2*l*b),null!=n&&(p=!0,x=d,d+=4*l*_),y=d,d+=i*N,g=d,d+=2*i*S;const w=new ArrayBuffer(d),v=new Uint8Array(w);M(v,0,l),M(v,S,i);const D=new Float32Array(w,u),R=null!=r?new Float32Array(w,m):null,j=null!=o?new Float32Array(w,f):null,I=null!=n?new Uint8Array(w,x):null;for(let M=0;M<a;++M){const s=3*M;for(let i=0;i<3;++i){const a=t[s+i],l=3*a,d=9*M+3*i;if(D[d]=e[l],D[d+1]=e[l+1],D[d+2]=e[l+2],null!=R&&(R[d]=r[l],R[d+1]=r[l+1],R[d+2]=r[l+2]),null!=j){const e=2*a,t=6*M+2*i;j[t]=o[e],j[t+1]=o[e+1]}if(null!=I){const e=4*a,t=12*M+4*i;I[t]=n[e],I[t+1]=n[e+1],I[t+2]=n[e+2],I[t+3]=n[e+3]}}}M(v,y,s),M(v,y+S,s/2**32),M(v,g,0),M(v,g+S,a-1);return{geometryBuffer:w,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function M(e,t,r){e[t]=255&r,e[t+1]=255&r>>8,e[t+2]=255&r>>16,e[t+3]=255&r>>24}function w(e){const t=e.metadata.displaySource?.source;if(null==t||!Array.isArray(t)||!t.length||t[0]instanceof File)return n();const r=t;let o="";for(const n of r)o+=n.makeHash();return o+JSON.stringify(e.transform?.toJSON()??"")+(u(e.vertexSpace)?JSON.stringify(e.vertexSpace.origin):"")+JSON.stringify(e.spatialReference)}const S=4,b=4,_=1,N=8;export{f as I3SClientNodeLoader,x as createSphereFromExtent,b as sizeOfFloat32,S as sizeOfInt32,N as sizeOfUInt64,_ as sizeOfUInt8,y as transformNormals};
5
+ import e from"../../../../core/Error.js";import{assertIsSome as t}from"../../../../core/maybe.js";import{MinPriority as r}from"../../../../core/MemCache.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{generateUUID as n}from"../../../../core/uuid.js";import{normalFromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{p as a}from"../../../../chunks/vec32.js";import{ONES as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as d}from"../../../../geometry/projection/projectBoundingSphere.js";import{isRelativeVertexSpace as u}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{l as c}from"../../../../chunks/sphere.js";import{CachedMeshData as m}from"./CachedMeshData.js";import{convertMeshMaterialToPBRMaterial as h}from"./I3SClientMaterialUtil.js";class f{constructor(e,t,r,o){this._uid=e,this._worker=o,this._id2Meta=new Map,this._oid2Meta=new Map,this._indexSR=t.indexSR,this._vertexSR=t.vertexSR,this._renderSR=t.renderSR,this._memCache=r.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 r=`mesh${t}`,o=e.extent,n=o.spatialReference,s=this._indexSR,i=x(o,e.origin);d(i,n,i,s);return{type:"mesh",id:r,version:w(e),oid:t,mbs:i,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(t,r){if(null!=this.getMeshNodeIndex(r.oid))throw new e(`I3SClientNodeLoader: client side mesh for feature oid=${r.oid} already exists`);r.nodeIndex=t,this._id2Meta.set(r.id,r),this._oid2Meta.set(r.oid,r)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}getMeshNodeInfo(e){const t=this._oid2Meta.values();for(const r of t)if("mesh"===r.type&&r.id===e)return r;return null}removeNode(e){const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(t){const r=this._id2Meta.get(t);if(null==r)throw new e(`I3SClientNodeLoader::loadNodeJSON unable to find node ${t}`);switch(r.type){case"mesh":return this._loadMeshNodeJSON(r);case"mesh-component":return p(r);default:throw new e(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${t}`)}}async _loadMeshNodeJSON(e){const t=e.id,r=(await this._getMeshData(e)).loadedMesh;if(null==r.components||0===r.components.length)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const o=[],n=r.components;for(let s=0;s<n.length;++s){const r=`${t}-component${s}`,n={type:"mesh-component",id:r,mbs:e.mbs,componentIndex:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(n.id,n),e.componentNodeIds.push(r),o.push({id:n.id,href:null,mbs:n.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:o}}updateNodeIndex(e,t,r){const o=this._id2Meta.get(e);o&&"mesh"===o.type&&(o.nodeIndex=r)}async loadNodeData(r,n){const s=this._id2Meta.get(r);if(null==s||"mesh-component"!==s.type)throw new e(`Failed to load client node data for node ${r} (unexpected node info)`);const i=s.meshNodeInfo,a=await this._getMeshData(i),l=a.loadedMesh,d=i.oid;if(null==l.components)throw new e(`Failed to load client node data for node ${r} (unexpected null reference)`);const u=l.components[s.componentIndex],{material:c,requiredTextures:m,textureData:f}=await h(u.material);if(null!=f)for(const e of f)null!=e&&s.textureData.set(e.id,e);const p={params:{material:c},type:"ArrayBufferView"},{vertexSpace:x,origin:M,transform:w}=l,S=[M.x,M.y,M.z??0];a.projectionPromise||(t(this._worker,"SceneLayerWorker is needed to project mesh"),a.projectionPromise=this._worker.project({positions:l.vertexAttributes.position,localMatrix:w?.localMatrix,vertexSpace:x.toJSON(),origin:S,inSpatialReference:l.spatialReference.toJSON(),outSpatialReference:this._vertexSR.toJSON()},n));const{projected:b,original:_,projectedOrigin:N}=await a.projectionPromise;l.vertexAttributes.position=_;const{transformed:v,original:D}=await y(u,a,this._worker,n);l.vertexAttributes.normal=D,o(n);const{geometryBuffer:R,geometryDescriptor:j}=g(b,u.faces,v,l.vertexAttributes.uv,l.vertexAttributes.color,d);return{geometryData:{featureDataPosition:N,featureIds:[],geometries:[p]},attributeDataInfo:{attributeData:{},loadedAttributes:[]},geometryBuffer:R,geometryDescriptor:j,requiredTextures:m,textureData:f,normalReferenceFrame:this._vertexSR.isGeographic?"east-north-up":"vertex-reference-frame"}}async loadAttributes(e,t,r){const o=e.numFeatures,n={};for(const{field:{name:s}}of t)n[s]=new Array(o);return n}async loadTextures(e,t,r){const o=e.id,n=this._id2Meta.get(o);if(null==n||"mesh-component"!==n.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const i of t)s.push(n.textureData.get(i.id)||null);return s}async _getMeshData(e){const t=e.version,o=this._memCache.get(t);if(null==o){if(null!=e.loadMeshPromise)return e.loadMeshPromise;const o=async(o,n)=>{const s=e.unloadedMesh.clone();try{await s.load()}catch(a){n(a)}const i=new m(s);this._memCache.put(t,i,r),e.loadMeshPromise=null,o(i)};return e.loadMeshPromise=new Promise(((e,t)=>o(e,t))),e.loadMeshPromise}return o}}async function p(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}function x(e,t){const{spatialReference:r}=e,o=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],s=r.isGeographic?r.metersPerUnit:1,i=e.center;let a=0;if(e.hasZ)for(let l=0;l<2;++l)for(let e=0;e<2;++e)for(let r=0;r<2;++r){const d=(i.x+o[l]*n[0]-t.x)*s,u=(i.y+o[e]*n[1]-t.y)*s,c=i.z+o[r]*n[2]-t.z;a=Math.max(d*d+u*u+c*c,a)}else for(let l=0;l<2;++l)for(let e=0;e<2;++e){const r=(i.x+o[l]*n[0]-t.x)*s,d=(i.y+o[e]*n[1]-t.y)*s;a=Math.max(r*r+d*d,a)}return c([t.x,t.y,t.z],Math.sqrt(a))}async function y(e,r,o,n){const{transform:d,vertexAttributes:u}=r.loadedMesh,c="source"===e.shading?u.normal:null;if(!(null!=c&&null!=d&&(0!==d.rotationAngle||!a(d.scale,l))))return{transformed:c,original:u.normal};if(!r.normalsTransformPromise){t(o,"SceneLayerWorker is needed to transform mesh normals");const e=i();s(e,d.localMatrix),r.normalsTransformPromise=o.transformNormals({normalMatrix:e,normals:c},n)}return r.normalsTransformPromise}function g(e,t,r,o,n,s){const i=1,a=(t?.length??0)/3,l=3*a;let d=0,u=0,c=!1,m=0,h=!1,f=0,p=!1,x=0,y=0,g=0;d+=S,d+=S,u=d,d+=3*l*b,null!=r&&(c=!0,m=d,d+=3*l*b),null!=o&&(h=!0,f=d,d+=2*l*b),null!=n&&(p=!0,x=d,d+=4*l*_),y=d,d+=i*N,g=d,d+=2*i*S;const w=new ArrayBuffer(d),v=new Uint8Array(w);M(v,0,l),M(v,S,i);const D=new Float32Array(w,u),R=null!=r?new Float32Array(w,m):null,j=null!=o?new Float32Array(w,f):null,I=null!=n?new Uint8Array(w,x):null;for(let M=0;M<a;++M){const s=3*M;for(let i=0;i<3;++i){const a=t[s+i],l=3*a,d=9*M+3*i;if(D[d]=e[l],D[d+1]=e[l+1],D[d+2]=e[l+2],null!=R&&(R[d]=r[l],R[d+1]=r[l+1],R[d+2]=r[l+2]),null!=j){const e=2*a,t=6*M+2*i;j[t]=o[e],j[t+1]=o[e+1]}if(null!=I){const e=4*a,t=12*M+4*i;I[t]=n[e],I[t+1]=n[e+1],I[t+2]=n[e+2],I[t+3]=n[e+3]}}}M(v,y,s),M(v,y+S,s/2**32),M(v,g,0),M(v,g+S,a-1);return{geometryBuffer:w,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function M(e,t,r){e[t]=255&r,e[t+1]=255&r>>8,e[t+2]=255&r>>16,e[t+3]=255&r>>24}function w(e){const t=e.metadata.displaySource?.source;if(null==t||!Array.isArray(t)||!t.length||t[0]instanceof File)return n();const r=t;let o="";for(const n of r)o+=n.makeHash();return o+JSON.stringify(e.transform?.toJSON()??"")+(u(e.vertexSpace)?JSON.stringify(e.vertexSpace.origin):"")+JSON.stringify(e.spatialReference)}const S=4,b=4,_=1,N=8;export{f as I3SClientNodeLoader,x as createSphereFromExtent,b as sizeOfFloat32,S as sizeOfInt32,N as sizeOfUInt64,_ as sizeOfUInt8,y as transformNormals};
package/webscene/Slide.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Clonable.js";import o from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import a from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{cast as b}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import"../core/has.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as L}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import j from"../layers/Layer.js";import{basemapEnsureType as C,clonePreservingTiledLayers as _}from"../support/basemapEnsureType.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import V from"./SlideLegend.js";import U from"./SunLighting.js";import x from"./VirtualLighting.js";import I from"./support/Description.js";import{SlideEnvironment as D}from"./support/SlideEnvironment.js";import R from"./support/SlideGround.js";import{SlideVisibleLayer as A}from"./support/SlideVisibleLayer.js";import M from"./support/Title.js";let P=0;const q=o.ofType(A),B=["caption","cover","none"];let O=class extends(r.ClonableMixin(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+P++,this.title=new M,this.description=new I,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="caption",this.environment=new D,this.timeExtent=null,this.legend=null,this.visibleLayers=new q}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.legend=null}castTitle(e){return"string"==typeof e?new M({text:e}):f(M,e)}castDescription(e){return"string"==typeof e?new I({text:e}):f(I,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return C(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),q))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof j){const t=N(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=N(i);t.push(new A({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};return e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?x.prototype.clone.apply(e.environment.lighting):U.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?R.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(i))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),o=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw o(),c}if(i.signal.aborted)throw o(),d();const s=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([s.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),s.schedule((()=>this._applyBasemap(e,l)),l.signal),s.schedule((()=>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),s.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal),s.schedule((()=>e.environment.weather=this.environment.weather.clone()))])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),s.remove(),o(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=_(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new o;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map((e=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=G(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=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,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(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,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),l=J(o,a),p=e.renderCoordsHelper,m=L();p.toRenderCoords(e.camera.position,m);const c=L(),h=L();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(s-r)*a,y=z(o,l*a);t.date=this._setTime(d,u,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([v({type:String,json:{write:{isRequired:!0}}})],O.prototype,"id",void 0),e([v({type:M,json:{default:()=>new M({text:""}),write:{isRequired:!0}}})],O.prototype,"title",void 0),e([b("title")],O.prototype,"castTitle",null),e([v({type:I,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],O.prototype,"description",void 0),e([b("description")],O.prototype,"castDescription",null),e([v({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],O.prototype,"hidden",void 0),e([v({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],O.prototype,"thumbnail",void 0),e([b("thumbnail")],O.prototype,"castThumbnail",null),e([v({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],O.prototype,"viewpoint",void 0),e([v({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],O.prototype,"basemap",void 0),e([b("basemap")],O.prototype,"castBasemap",null),e([v({type:R,json:{write:!0}})],O.prototype,"ground",void 0),e([v({type:B,json:{write:!0,default:"caption"},nonNullable:!0})],O.prototype,"layout",void 0),e([v({type:q,json:{write:{isRequired:!0}}})],O.prototype,"visibleLayers",null),e([b("visibleLayers")],O.prototype,"castVisibleLayers",null),e([v({type:D,json:{write:!0}})],O.prototype,"environment",void 0),e([v(k)],O.prototype,"timeExtent",void 0),e([v({type:V,json:{write:!0}})],O.prototype,"legend",void 0),O=e([w("esri.webscene.Slide")],O);const F=O;function G(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function N(e){const t=G(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const W=86400,H=43200;function J(e,t){let i=t-e;return i>H&&(i-=W),i<-H&&(i+=W),i}function z(e,t){return p(e+t,W)}export{F as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Clonable.js";import o from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import a from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{cast as b}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import"../core/has.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as L}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import j from"../layers/Layer.js";import{basemapEnsureType as C,clonePreservingTiledLayers as _}from"../support/basemapEnsureType.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import V from"./SlideLegend.js";import U from"./SunLighting.js";import x from"./VirtualLighting.js";import I from"./support/Description.js";import{SlideEnvironment as D}from"./support/SlideEnvironment.js";import R from"./support/SlideGround.js";import{SlideVisibleLayer as A}from"./support/SlideVisibleLayer.js";import M from"./support/Title.js";let P=0;const q=o.ofType(A),B=["caption","cover","none"];let O=class extends(r.ClonableMixin(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+P++,this.title=new M,this.description=new I,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="caption",this.environment=new D,this.timeExtent=null,this.legend=null,this.visibleLayers=new q}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.legend=null}castTitle(e){return"string"==typeof e?new M({text:e}):f(M,e)}castDescription(e){return"string"==typeof e?new I({text:e}):f(I,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return C(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),q))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof j){const t=N(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=N(i);t.push(new A({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};return e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?x.prototype.clone.apply(e.environment.lighting):U.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?R.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(i))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),o=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw o(),c}if(i.signal.aborted)throw o(),d();const s=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([s.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),s.schedule((()=>this._applyBasemap(e,l)),l.signal),s.schedule((()=>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),s.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal),s.schedule((()=>e.environment.weather=this.environment.weather.clone()))])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),s.remove(),o(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=_(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new o;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map((e=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=G(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=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,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(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,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),l=J(o,a),p=e.renderCoordsHelper,m=L();p.toRenderCoords(e.camera.position,m);const c=L(),h=L();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(s-r)*a,y=z(o,l*a);t.date=this._setTime(d,u,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([v({type:String,json:{write:{isRequired:!0}}})],O.prototype,"id",void 0),e([v({type:M,json:{default:()=>new M({text:""}),write:{isRequired:!0}}})],O.prototype,"title",void 0),e([b("title")],O.prototype,"castTitle",null),e([v({type:I,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],O.prototype,"description",void 0),e([b("description")],O.prototype,"castDescription",null),e([v({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],O.prototype,"hidden",void 0),e([v({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],O.prototype,"thumbnail",void 0),e([b("thumbnail")],O.prototype,"castThumbnail",null),e([v({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],O.prototype,"viewpoint",void 0),e([v({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],O.prototype,"basemap",void 0),e([b("basemap")],O.prototype,"castBasemap",null),e([v({type:R,json:{write:!0}})],O.prototype,"ground",void 0),e([v({type:B,json:{write:!0,default:"caption"},nonNullable:!0})],O.prototype,"layout",void 0),e([v({type:q,json:{write:{isRequired:!0}}})],O.prototype,"visibleLayers",null),e([b("visibleLayers")],O.prototype,"castVisibleLayers",null),e([v({type:D,json:{write:!0}})],O.prototype,"environment",void 0),e([v(k)],O.prototype,"timeExtent",void 0),e([v({type:V,json:{write:!0}})],O.prototype,"legend",void 0),O=e([w("esri.webscene.Slide")],O);const F=O;function G(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function N(e){const t=G(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const W=86400,H=43200;function J(e,t){let i=t-e;return i>H&&(i-=W),i<-H&&(i+=W),i}function z(e,t){return p(e+t,W)}export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import"../../intl.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import r from"../../core/Evented.js";import n from"../../core/Logger.js";import{watch as a,when as h,initial as c}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as l}from"../../core/accessorSupport/decorators/cast.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import v from"../../geometry/Point.js";import{load as p}from"../../geometry/projection.js";import u from"../../symbols/PictureMarkerSymbol.js";import f from"./support/Conversion.js";import{isValidPoint as g,isSupportedNotation as w}from"./support/coordinateConversionUtils.js";import{generateDefaultFormats as _,setDefaultPatterns as y}from"./support/formatUtils.js";import C from"../support/GoTo.js";import{onLocaleChange as b,getLocale as L}from"../../intl/locale.js";import{fetchMessageBundle as M}from"../../intl/messages.js";const P={default:"default",crosshair:"crosshair"},j=new v([0,0,500]),S="xy",F=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",H={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change"},E="esri/images/search/search-symbol-32.png";let x=class extends(C(r.EventedAccessor)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.conversions=new i,this.formats=new i,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new i,this.locationSymbol=new u({url:e(E),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 t=async()=>this.messages=await M("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(_()),t().then((()=>{if(!this.destroyed&&(y(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach((t=>{t.viewModel=this,this.addHandles(a((()=>t.currentPattern),this._saveWidgetState),t.name??"unnamed-format")})),this.addHandles(this.conversions.on("change",this._handleConversionChange),H.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),H.formats),this.addHandles(b((()=>{t().then((()=>{y(this.messages,this.formats)}))}))),p().then((()=>{this.formatterAvailable=!0})).catch((t=>{n.getLogger(this).error(new s("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()})).then((()=>this.addHandles(a((()=>this.view),this._handleViewChange,c),H.viewChange))),0===this.conversions.length)){const t=this.formats.find((t=>t.name===S))||this.formats.at(0);this.conversions.add(new f({format:t}))}}))}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}castConversions(t){return this._castToConversions(t)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){const{storageType:t}=this;return"session"===t?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){if(this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),!t)return;const e=t.clone();e.hasZ&&(e.z=void 0),this._locationGraphic=new o({geometry:e,symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic)}async convert(t,e){if(!g(e))throw new s("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return Promise.resolve().then((()=>t.convert(e)))}async goToLocation(t){const{view:e}=this;if(!e)throw new s("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||i?.length>0){const e=o??i.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new s("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(H.view),this.view&&(this.view.cursor=P.default,this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await W(t,e)).displayCoordinate}resume(){"capture"===this.mode?this._startCaptureMode():this._startLiveMode()}reverseConvert(t,e){return e.reverseConvert(t)}async updateConversions(t,e){if("point"!==e?.type)throw this._clearConversions(this.conversions),new s("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_castToConversions(t){const e=new i;return t.forEach((t=>{let o=null;if(t instanceof f)o=t;else if("string"==typeof t){const e=this.formats.find((e=>e.name===t));e&&(o=new f({format:e}))}o&&e.add(o)})),e}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(H.view),t.cursor=P.default)}_clearConversions(t){t.forEach((t=>{t.position={location:null,coordinate:null}}))}async _convertMany(t,e){return Promise.all(t.map((t=>W(t,e))))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then((t=>{e.position=t,this._set("waitingForConversions",!1)}))))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach((t=>{this.addHandles(a((()=>t.currentPattern),this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this})),t.removed.forEach((t=>{t.viewModel=null;const e=this.conversions.filter((e=>e.format===t));this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}))}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){n.getLogger(this).error(new s("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(H.view),this.view&&(this.view.cursor=P.crosshair,this.currentLocation&&this.setLocation(this.currentLocation),this.addHandles(this.view.on("click",this._onClick),H.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(H.view),this.view&&(this.view.cursor=P.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)],H.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach((e=>{const o=this.formats.find((t=>t.name===e.name));o&&t.locale===L()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new f({format:o}))}))}catch(e){n.getLogger(this).warn(new s("coordinate-conversion:session-storage-read-error","Could not get widget state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:L()}))}catch(e){n.getLogger(this).error(new s("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter((t=>{const e=t.name;return"xy"===e||"basemap"===e||w(e)})).map((t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex((e=>e.format===t))}))).sort(((t,e)=>t.index-e.index)).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(h((()=>this.view?.spatialReference),(t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter((t=>{const{name:e}=t;return!!A(e)||"xy"===e&&!i})),r=this.filteredFormats.filter((t=>"xy"===t.name&&i&&!this.formats.includes(t))),n=e.filter((t=>s.includes(t.format)));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter((t=>!this.filteredFormats.includes(t)))),o.addMany(r)}),{once:!0,initial:!0}),H.view)}};async function W(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function A(t){return F.includes(t)}t([d()],x.prototype,"conversions",void 0),t([l("conversions")],x.prototype,"castConversions",null),t([d({type:v})],x.prototype,"currentLocation",null),t([d()],x.prototype,"formats",void 0),t([d()],x.prototype,"messages",void 0),t([d()],x.prototype,"mode",null),t([d()],x.prototype,"filteredFormats",void 0),t([d({readOnly:!0})],x.prototype,"state",null),t([d()],x.prototype,"locationSymbol",void 0),t([d({readOnly:!0,dependsOn:["storageType"]})],x.prototype,"storage",null),t([d()],x.prototype,"storageEnabled",void 0),t([d()],x.prototype,"storageType",void 0),t([d({readOnly:!0})],x.prototype,"waitingForConversions",null),t([d()],x.prototype,"view",void 0),x=t([m("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],x);const T=x;export{T as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import"../../intl.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import r from"../../core/Evented.js";import n from"../../core/Logger.js";import{watch as a,when as h,initial as c}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as l}from"../../core/accessorSupport/decorators/cast.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import v from"../../geometry/Point.js";import{load as p}from"../../geometry/projection.js";import u from"../../symbols/PictureMarkerSymbol.js";import f from"./support/Conversion.js";import{isValidPoint as g,isSupportedNotation as w}from"./support/coordinateConversionUtils.js";import{generateDefaultFormats as _,setDefaultPatterns as y}from"./support/formatUtils.js";import C from"../support/GoTo.js";import{onLocaleChange as b,getLocale as L}from"../../intl/locale.js";import{fetchMessageBundle as M}from"../../intl/messages.js";const P={default:"default",crosshair:"crosshair"},j=new v([0,0,500]),S="xy",F=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",H={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change"},E="esri/images/search/search-symbol-32.png";let x=class extends(C(r.EventedAccessor)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.conversions=new i,this.formats=new i,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new i,this.locationSymbol=new u({url:e(E),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 t=async()=>this.messages=await M("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(_()),t().then((()=>{if(!this.destroyed&&(y(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach((t=>{t.viewModel=this,this.addHandles(a((()=>t.currentPattern),this._saveWidgetState),t.name??"unnamed-format")})),this.addHandles(this.conversions.on("change",this._handleConversionChange),H.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),H.formats),this.addHandles(b((()=>{t().then((()=>{y(this.messages,this.formats)}))}))),p().then((()=>{this.formatterAvailable=!0})).catch((t=>{n.getLogger(this).error(new s("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()})).then((()=>this.addHandles(a((()=>this.view),this._handleViewChange,c),H.viewChange))),0===this.conversions.length)){const t=this.formats.find((t=>t.name===S))||this.formats.at(0);this.conversions.add(new f({format:t}))}}))}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}castConversions(t){return this._castToConversions(t)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){const{storageType:t}=this;return"session"===t?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){if(this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),!t)return;const e=t.clone();e.hasZ&&(e.z=void 0),this._locationGraphic=new o({geometry:e,symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic)}async convert(t,e){if(!g(e))throw new s("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return Promise.resolve().then((()=>t.convert(e)))}async goToLocation(t){const{view:e}=this;if(!e)throw new s("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new s("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(H.view),this.view&&(this.view.cursor=P.default,this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await W(t,e)).displayCoordinate}resume(){"capture"===this.mode?this._startCaptureMode():this._startLiveMode()}reverseConvert(t,e){return e.reverseConvert(t)}async updateConversions(t,e){if("point"!==e?.type)throw this._clearConversions(this.conversions),new s("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_castToConversions(t){const e=new i;return t.forEach((t=>{let o=null;if(t instanceof f)o=t;else if("string"==typeof t){const e=this.formats.find((e=>e.name===t));e&&(o=new f({format:e}))}o&&e.add(o)})),e}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(H.view),t.cursor=P.default)}_clearConversions(t){t.forEach((t=>{t.position={location:null,coordinate:null}}))}async _convertMany(t,e){return Promise.all(t.map((t=>W(t,e))))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then((t=>{e.position=t,this._set("waitingForConversions",!1)}))))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach((t=>{this.addHandles(a((()=>t.currentPattern),this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this})),t.removed.forEach((t=>{t.viewModel=null;const e=this.conversions.filter((e=>e.format===t));this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}))}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){n.getLogger(this).error(new s("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(H.view),this.view&&(this.view.cursor=P.crosshair,this.currentLocation&&this.setLocation(this.currentLocation),this.addHandles(this.view.on("click",this._onClick),H.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(H.view),this.view&&(this.view.cursor=P.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)],H.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach((e=>{const o=this.formats.find((t=>t.name===e.name));o&&t.locale===L()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new f({format:o}))}))}catch(e){n.getLogger(this).warn(new s("coordinate-conversion:session-storage-read-error","Could not get widget state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:L()}))}catch(e){n.getLogger(this).error(new s("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter((t=>{const e=t.name;return"xy"===e||"basemap"===e||w(e)})).map((t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex((e=>e.format===t))}))).sort(((t,e)=>t.index-e.index)).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(h((()=>this.view?.spatialReference),(t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter((t=>{const{name:e}=t;return!!A(e)||"xy"===e&&!i})),r=this.filteredFormats.filter((t=>"xy"===t.name&&i&&!this.formats.includes(t))),n=e.filter((t=>s.includes(t.format)));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter((t=>!this.filteredFormats.includes(t)))),o.addMany(r)}),{once:!0,initial:!0}),H.view)}};async function W(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function A(t){return F.includes(t)}t([d()],x.prototype,"conversions",void 0),t([l("conversions")],x.prototype,"castConversions",null),t([d({type:v})],x.prototype,"currentLocation",null),t([d()],x.prototype,"formats",void 0),t([d()],x.prototype,"messages",void 0),t([d()],x.prototype,"mode",null),t([d()],x.prototype,"filteredFormats",void 0),t([d({readOnly:!0})],x.prototype,"state",null),t([d()],x.prototype,"locationSymbol",void 0),t([d({readOnly:!0,dependsOn:["storageType"]})],x.prototype,"storage",null),t([d()],x.prototype,"storageEnabled",void 0),t([d()],x.prototype,"storageType",void 0),t([d({readOnly:!0})],x.prototype,"waitingForConversions",null),t([d()],x.prototype,"view",void 0),x=t([m("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],x);const T=x;export{T as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{makeHandle as i}from"../../core/handleUtils.js";import n from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{when as a,initial as l,watch as r,on as o,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as g}from"../../core/scheduling.js";import{truncateLocalTime as d,isValidDate as p,resetUTCDate as u,offsetDate as c}from"../../core/timeUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import m from"../../views/3d/environment/SunLighting.js";import f from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as w}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as D,sliderPosToDateTime as S,getSeasonFromDate as T,getNorthernHemisphereSeason as U,getSeasonDate as v,Hemisphere as L,calculatePlaySpeed as P}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as b}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as O,getSunriseAndSunsetTimes as C}from"../support/timeWidgetUtils.js";let E=class extends e{constructor(t){super(t),this.view=null,this.timeSliderViewModel=new b({min:0,max:1439,values:[0],labelFormatFunction:O,inputFormatFunction:O}),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([a((()=>this.view),(t=>t.when((()=>this._updateLighting()))),l),r((()=>{const t=this._lighting;return"sun"===t?.type?this._ensureValidDate(t):null}),(t=>this._scheduleLightingUpdate(t))),o((()=>this._lighting),"timezone-will-change",(t=>this._timezoneWillChange(t)),{onListenerAdd:()=>this._timezoneWillChange(null)}),r((()=>!0===this.view?.stationary),(()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()}),l),r((()=>{const t=this.timeSliderViewModel;return{vm:t,state:t.state,sliderPosition:this.timeSliderPosition}}),(({vm:t,state:e,sliderPosition:i})=>{"ready"===e&&t.setValue(0,i)})),r((()=>this.timeSliderViewModel?.utcOffset),(t=>{null!=t&&(this.utcOffset=t)})),r((()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel})),(({utcOffset:t,sliderViewModel:e})=>{e&&(e.utcOffset=t)}),h),r((()=>this.timeSliderViewModel.timezonePickerOpen),(()=>this.stopPlaying())),r((()=>this.timeSliderViewModel.values),(t=>this._setTimeSliderPosition(t?.[0]??0,{forceLightingUpdate:!1})))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return null==this.view||"3d"===this.view.type}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(t){t!==this.utcOffset&&null!=this._lighting&&"virtual"!==this._lighting.type&&(this._lighting.displayUTCOffset=t,this._updateLighting())}get localDate(){return d(this._lightingDateDisplay)}set localDate(t){this.view?.ready?p(t)&&t.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=u(this._lightingDateDisplay,t)):n.getLogger(this).error("The localDate property cannot be set before the view and the widget are ready.")}get timeSliderPosition(){return D(this._lightingDateDisplay)}set timeSliderPosition(t){this.view?.ready&&"ready"===this.timeSliderViewModel?.state?this._setTimeSliderPosition(t,{forceLightingUpdate:!0}):n.getLogger(this).error("The timeSliderPosition property cannot be set before the view and the widget are ready.")}_setTimeSliderPosition(t,e){Math.abs(t-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._enableDirectShadowsIfFirstInteraction(),e.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=S(this._lightingDateDisplay,t))}_timezoneFromCamera(t,e){if(null==e||!t.cameraTrackingEnabled)return 0;const i=w([e.longitude,e.latitude]);return null==i?0:Math.round(i.hours+i.minutes/60+i.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(t){const e=this._lighting;e&&(e.directShadowsEnabled=t)}get sunLightingEnabled(){return"sun"===this._lightingType}set sunLightingEnabled(t){const e=this._environment;if(t===this._get("sunLightingEnabled")||null==e)return;const i=e.lighting,n=this._oldLighting;this._oldLighting=i;const s={directShadowsEnabled:i.directShadowsEnabled,cameraTrackingEnabled:i.cameraTrackingEnabled},a=t?"sun":"virtual";let l;l=null!=n&&n.type===a?n:t?new m:new f,l.set(s),e.lighting=l,t||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(t){this.playingState!==t&&(this._set("playingState",t),"none"!==t&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._enableDirectShadowsIfFirstInteraction()))}get dayPlaying(){return"day"===this.playingState}set dayPlaying(t){t?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return"year"===this.playingState}set yearPlaying(t){t?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return T(this.localDate,this._currentHemisphere)}set currentSeason(t){this.stopPlaying();const e=U(t,this._currentHemisphere);this.localDate=v(this.localDate,e,L.NORTHERN)}get _currentHemisphere(){const t=this.view?.camera?.position?.latitude;return null==t||t>=0?L.NORTHERN:L.SOUTHERN}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return c(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(t){const e=this._lighting;if(null==e||!this.sunLightingEnabled||"virtual"===e.type||!p(t))return;const i=this._ensureValidDate(e),n=c(t,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==i.getTime()&&(e.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}onDateChange(t){this.dayPlaying=!1,this.localDate=t}_enableDirectShadowsIfFirstInteraction(){this._firstInteraction&&(this._firstInteraction=!1,this.directShadowsEnabled=!0)}_updateLighting(t){const e=Date.now();this._lastLightingUpdate=e;const{view:i}=this,n=this._lighting;if(null==i||null==n||"virtual"===n.type)return;t??=this._ensureValidDate(n);const s=n.displayUTCOffset,a=null!==s?s:this._timezoneFromCamera(n,i.camera?.position);this._cachedLightingDateUTC.getTime()!==t.getTime()&&(this._cachedLightingDateUTC=new Date(t.getTime())),this._cachedDisplayUTCOffset!==a&&(this._cachedDisplayUTCOffset=a)}_timezoneWillChange(t){const e=this._lighting;if(null==e||"virtual"===e.type||!e.cameraTrackingEnabled)return;let i;if(t)i=t.timezoneOffset;else{if(null!=e.displayUTCOffset)return;i=m.calculateTimezoneOffset(e.positionTimezoneInfo)}e.displayUTCOffset=i,this._scheduleLightingUpdate()}_scheduleLightingUpdate(t){if(t&&(this._lightingUpdateHandle=s(this._lightingUpdateHandle),!p(t)))return;if(this._lightingUpdateHandle)return;const e=Date.now()-this._lastLightingUpdate,n=this.lightingUpdateInterval-e;let a=null;const l=()=>{this._updateLighting(t),this._lightingUpdateHandle===a&&(this._lightingUpdateHandle=null)};if(n<=0)this._lightingUpdateHandle=a=g(l);else{const t=setTimeout(l,n);this._lightingUpdateHandle=a=i((()=>clearTimeout(t)))}}_cancelLightingUpdate(){this._lightingUpdateHandle=s(this._lightingUpdateHandle)}_play(){const t=this._lighting;if(null==t||!this.sunLightingEnabled||"virtual"===t.type)return;const e=this._ensureValidDate(t);if(this.dayPlaying||this.yearPlaying){const i=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=P(this._sunrise,this._sunset,e)*this.playSpeedMultiplier/100*i;if(n>0){let i=new Date(e.getTime()+n);const s=t.displayUTCOffset??0;if(((i.getUTCHours()+s)%24+24)%24<((e.getUTCHours()+s)%24+24)%24){const t=864e5;i=new Date(e.getTime()+n-t)}t.date=i}}else{if(i>1e3){this._lastTime=Date.now();const i=(e.getUTCMonth()+1)%12,n=new Date(e.getTime());n.setUTCMonth(i),t.date=n}}requestAnimationFrame((()=>this._play()))}}_updateSunriseAndSunset(){const t=this._lighting;if(null==t||"virtual"===t.type||!this.sunLightingEnabled)return;const e=this.view?.camera?.position;if(null==e)return;const{latitude:i,longitude:n}=e,{date:s,displayUTCOffset:a}=t,l=C(s,i,n,a??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}_ensureValidDate(t){return p(t.date)||(n.getLogger(this).warn("Invalid date. Reverting to the current date/time."),t.date=new Date),t.date}};t([y()],E.prototype,"view",void 0),t([y({type:b,nonNullable:!0})],E.prototype,"timeSliderViewModel",void 0),t([y()],E.prototype,"isSupported",null),t([y()],E.prototype,"lightingUpdateInterval",void 0),t([y()],E.prototype,"utcOffset",null),t([y()],E.prototype,"localDate",null),t([y()],E.prototype,"timeSliderPosition",null),t([y()],E.prototype,"directShadowsEnabled",null),t([y()],E.prototype,"sunLightingEnabled",null),t([y({type:["none","day","year"],value:"none"})],E.prototype,"playingState",null),t([y()],E.prototype,"dayPlaying",null),t([y()],E.prototype,"yearPlaying",null),t([y()],E.prototype,"playSpeedMultiplier",void 0),t([y()],E.prototype,"currentSeason",null),t([y()],E.prototype,"_lastTime",void 0),t([y()],E.prototype,"_sunrise",void 0),t([y()],E.prototype,"_sunset",void 0),t([y()],E.prototype,"_cachedLightingDateUTC",void 0),t([y()],E.prototype,"_cachedDisplayUTCOffset",void 0),t([y()],E.prototype,"_firstInteraction",void 0),t([y()],E.prototype,"_currentHemisphere",null),t([y()],E.prototype,"_environment",null),t([y()],E.prototype,"_lighting",null),t([y()],E.prototype,"_lightingType",null),t([y()],E.prototype,"_lightingDateDisplay",null),E=t([_("esri.widgets.Daylight.DaylightViewModel")],E);const H=E;export{H as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{makeHandle as i}from"../../core/handleUtils.js";import n from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{when as a,initial as l,watch as r,on as o,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as g}from"../../core/scheduling.js";import{truncateLocalTime as d,isValidDate as p,resetUTCDate as u,offsetDate as c}from"../../core/timeUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import m from"../../views/3d/environment/SunLighting.js";import f from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as w}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as D,sliderPosToDateTime as S,getSeasonFromDate as T,getNorthernHemisphereSeason as U,getSeasonDate as v,Hemisphere as L,calculatePlaySpeed as P}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as b}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as O,getSunriseAndSunsetTimes as C}from"../support/timeWidgetUtils.js";let E=class extends e{constructor(t){super(t),this.view=null,this.timeSliderViewModel=new b({min:0,max:1439,values:[0],labelFormatFunction:O,inputFormatFunction:O}),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([a((()=>this.view),(t=>t.when((()=>this._updateLighting()))),l),r((()=>{const t=this._lighting;return"sun"===t?.type?this._ensureValidDate(t):null}),(t=>this._scheduleLightingUpdate(t))),o((()=>this._lighting),"timezone-will-change",(t=>this._timezoneWillChange(t)),{onListenerAdd:()=>this._timezoneWillChange(null)}),r((()=>!0===this.view?.stationary),(()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()}),l),r((()=>{const t=this.timeSliderViewModel;return{vm:t,state:t.state,sliderPosition:this.timeSliderPosition}}),(({vm:t,state:e,sliderPosition:i})=>{"ready"===e&&t.setValue(0,i)})),r((()=>this.timeSliderViewModel?.utcOffset),(t=>{null!=t&&(this.utcOffset=t)})),r((()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel})),(({utcOffset:t,sliderViewModel:e})=>{e&&(e.utcOffset=t)}),h),r((()=>this.timeSliderViewModel.timezonePickerOpen),(()=>this.stopPlaying())),r((()=>this.timeSliderViewModel.values),(t=>this._setTimeSliderPosition(t?.[0]??0,{forceLightingUpdate:!1})))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return null==this.view||"3d"===this.view.type}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(t){t!==this.utcOffset&&null!=this._lighting&&"virtual"!==this._lighting.type&&(this._lighting.displayUTCOffset=t,this._updateLighting())}get localDate(){return d(this._lightingDateDisplay)}set localDate(t){this.view?.ready?p(t)&&t.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=u(this._lightingDateDisplay,t)):n.getLogger(this).error("The localDate property cannot be set before the view and the widget are ready.")}get timeSliderPosition(){return D(this._lightingDateDisplay)}set timeSliderPosition(t){this.view?.ready&&"ready"===this.timeSliderViewModel?.state?this._setTimeSliderPosition(t,{forceLightingUpdate:!0}):n.getLogger(this).error("The timeSliderPosition property cannot be set before the view and the widget are ready.")}_setTimeSliderPosition(t,e){Math.abs(t-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._enableDirectShadowsIfFirstInteraction(),e.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=S(this._lightingDateDisplay,t))}_timezoneFromCamera(t,e){if(null==e||!t.cameraTrackingEnabled)return 0;const i=w([e.longitude,e.latitude]);return null==i?0:Math.round(i.hours+i.minutes/60+i.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(t){const e=this._lighting;e&&(e.directShadowsEnabled=t)}get sunLightingEnabled(){return"sun"===this._lightingType}set sunLightingEnabled(t){const e=this._environment;if(t===this._get("sunLightingEnabled")||null==e)return;const i=e.lighting,n=this._oldLighting;this._oldLighting=i;const s={directShadowsEnabled:i.directShadowsEnabled,cameraTrackingEnabled:i.cameraTrackingEnabled},a=t?"sun":"virtual";let l;l=null!=n&&n.type===a?n:t?new m:new f,l.set(s),e.lighting=l,t||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(t){this.playingState!==t&&(this._set("playingState",t),"none"!==t&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._enableDirectShadowsIfFirstInteraction()))}get dayPlaying(){return"day"===this.playingState}set dayPlaying(t){t?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return"year"===this.playingState}set yearPlaying(t){t?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return T(this.localDate,this._currentHemisphere)}set currentSeason(t){this.stopPlaying();const e=U(t,this._currentHemisphere);this.localDate=v(this.localDate,e,L.NORTHERN)}get _currentHemisphere(){const t=this.view?.camera?.position?.latitude;return null==t||t>=0?L.NORTHERN:L.SOUTHERN}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return c(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(t){const e=this._lighting;if(null==e||!this.sunLightingEnabled||"virtual"===e.type||!p(t))return;const i=this._ensureValidDate(e),n=c(t,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==i.getTime()&&(e.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}onDateChange(t){this.dayPlaying=!1,this.localDate=t}_enableDirectShadowsIfFirstInteraction(){this._firstInteraction&&(this._firstInteraction=!1,this.directShadowsEnabled=!0)}_updateLighting(t){const e=Date.now();this._lastLightingUpdate=e;const{view:i}=this,n=this._lighting;if(null==i||null==n||"virtual"===n.type)return;t??=this._ensureValidDate(n);const s=n.displayUTCOffset,a=null!=s?s:this._timezoneFromCamera(n,i.camera?.position);this._cachedLightingDateUTC.getTime()!==t.getTime()&&(this._cachedLightingDateUTC=new Date(t.getTime())),this._cachedDisplayUTCOffset!==a&&(this._cachedDisplayUTCOffset=a)}_timezoneWillChange(t){const e=this._lighting;if(null==e||"virtual"===e.type||!e.cameraTrackingEnabled)return;let i;if(t)i=t.timezoneOffset;else{if(null!=e.displayUTCOffset)return;i=m.calculateTimezoneOffset(e.positionTimezoneInfo)}e.displayUTCOffset=i,this._scheduleLightingUpdate()}_scheduleLightingUpdate(t){if(t&&(this._lightingUpdateHandle=s(this._lightingUpdateHandle),!p(t)))return;if(this._lightingUpdateHandle)return;const e=Date.now()-this._lastLightingUpdate,n=this.lightingUpdateInterval-e;let a=null;const l=()=>{this._updateLighting(t),this._lightingUpdateHandle===a&&(this._lightingUpdateHandle=null)};if(n<=0)this._lightingUpdateHandle=a=g(l);else{const t=setTimeout(l,n);this._lightingUpdateHandle=a=i((()=>clearTimeout(t)))}}_cancelLightingUpdate(){this._lightingUpdateHandle=s(this._lightingUpdateHandle)}_play(){const t=this._lighting;if(null==t||!this.sunLightingEnabled||"virtual"===t.type)return;const e=this._ensureValidDate(t);if(this.dayPlaying||this.yearPlaying){const i=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=P(this._sunrise,this._sunset,e)*this.playSpeedMultiplier/100*i;if(n>0){let i=new Date(e.getTime()+n);const s=t.displayUTCOffset??0;if(((i.getUTCHours()+s)%24+24)%24<((e.getUTCHours()+s)%24+24)%24){const t=864e5;i=new Date(e.getTime()+n-t)}t.date=i}}else{if(i>1e3){this._lastTime=Date.now();const i=(e.getUTCMonth()+1)%12,n=new Date(e.getTime());n.setUTCMonth(i),t.date=n}}requestAnimationFrame((()=>this._play()))}}_updateSunriseAndSunset(){const t=this._lighting;if(null==t||"virtual"===t.type||!this.sunLightingEnabled)return;const e=this.view?.camera?.position;if(null==e)return;const{latitude:i,longitude:n}=e,{date:s,displayUTCOffset:a}=t,l=C(s,i,n,a??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}_ensureValidDate(t){return p(t.date)||(n.getLogger(this).warn("Invalid date. Reverting to the current date/time."),t.date=new Date),t.date}};t([y()],E.prototype,"view",void 0),t([y({type:b,nonNullable:!0})],E.prototype,"timeSliderViewModel",void 0),t([y()],E.prototype,"isSupported",null),t([y()],E.prototype,"lightingUpdateInterval",void 0),t([y()],E.prototype,"utcOffset",null),t([y()],E.prototype,"localDate",null),t([y()],E.prototype,"timeSliderPosition",null),t([y()],E.prototype,"directShadowsEnabled",null),t([y()],E.prototype,"sunLightingEnabled",null),t([y({type:["none","day","year"],value:"none"})],E.prototype,"playingState",null),t([y()],E.prototype,"dayPlaying",null),t([y()],E.prototype,"yearPlaying",null),t([y()],E.prototype,"playSpeedMultiplier",void 0),t([y()],E.prototype,"currentSeason",null),t([y()],E.prototype,"_lastTime",void 0),t([y()],E.prototype,"_sunrise",void 0),t([y()],E.prototype,"_sunset",void 0),t([y()],E.prototype,"_cachedLightingDateUTC",void 0),t([y()],E.prototype,"_cachedDisplayUTCOffset",void 0),t([y()],E.prototype,"_firstInteraction",void 0),t([y()],E.prototype,"_currentHemisphere",null),t([y()],E.prototype,"_environment",null),t([y()],E.prototype,"_lighting",null),t([y()],E.prototype,"_lightingType",null),t([y()],E.prototype,"_lightingDateDisplay",null),E=t([_("esri.widgets.Daylight.DaylightViewModel")],E);const H=E;export{H as default};