@arcgis/core 4.31.0-next.20240919 → 4.31.0-next.20240920

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 (142) hide show
  1. package/WebDocument2D.js +1 -1
  2. package/WebLinkChart.js +1 -1
  3. package/WebMap.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{d9d8606f0a7c82b42755.js → 093a1ee161cb6a840283.js} +1 -1
  6. package/assets/esri/core/workers/chunks/2020b99675caabf5ac87.js +1 -0
  7. package/assets/esri/core/workers/chunks/41205645790e5f2bdaf7.js +1 -0
  8. package/assets/esri/core/workers/chunks/42b92b4c2c9fd2b15f60.js +2 -0
  9. package/assets/esri/core/workers/chunks/{ba561e03df67894e437f.js.LICENSE.txt → 42b92b4c2c9fd2b15f60.js.LICENSE.txt} +1 -1
  10. package/assets/esri/core/workers/chunks/65b1d7fa57d4c764efe8.js +1 -0
  11. package/assets/esri/core/workers/chunks/{b99d380cce485e65c990.js → 6cda92678ffeeaea0330.js} +1 -1
  12. package/assets/esri/core/workers/chunks/7b4880b2dc6b01d70ccc.js +1 -0
  13. package/assets/esri/core/workers/chunks/95ea77a7d63c9d7ed78b.js +1 -0
  14. package/assets/esri/core/workers/chunks/ad4fa125e09cc0047f5b.js +1 -0
  15. package/assets/esri/core/workers/chunks/bb5a18dd1e6a71905668.js +2 -0
  16. package/assets/esri/core/workers/chunks/bf406a46515d5dfebe06.js +1 -0
  17. package/assets/esri/core/workers/chunks/e1e9a7695e48e34a69bd.js +1 -0
  18. package/assets/esri/core/workers/chunks/e4f1464ed269c301b4ee.js +1 -0
  19. package/assets/esri/core/workers/chunks/{072029d05ccb56979523.js → e611141692355a1ba2b2.js} +1 -1
  20. package/assets/esri/core/workers/chunks/f41e8d0d6f5e81289179.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5ca8e767cc03e1425338.js → f9e90a2fda559ca68848.js} +1 -1
  22. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +6 -0
  23. package/assets/esri/themes/dark/main.css +1 -1
  24. package/assets/esri/themes/light/main.css +1 -1
  25. package/assets/esri/themes/light/view.css +1 -1
  26. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  27. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  28. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  29. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  30. package/chunks/Centroid-DZi-eb9F.js +1 -1
  31. package/chunks/ComponentShader.glsl.js +10 -13
  32. package/chunks/Distance2DCalculator-De7WFGFq.js +5 -0
  33. package/chunks/GeodeticDistanceCalculator-CN7xMqrJ.js +5 -0
  34. package/chunks/LineSeries.js +1 -1
  35. package/chunks/{OITCompositing.glsl.js → OITBlend.glsl.js} +1 -1
  36. package/chunks/OperatorGeneralize.js +1 -1
  37. package/chunks/OperatorGeodesicBuffer.js +1 -1
  38. package/chunks/OperatorGeodeticArea.js +1 -1
  39. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  40. package/chunks/OperatorGeodeticDistance.js +1 -1
  41. package/chunks/OperatorGeodeticLength.js +1 -1
  42. package/chunks/OperatorProximity.js +1 -1
  43. package/chunks/OperatorShapePreservingLength.js +5 -0
  44. package/chunks/Polyline.js +1 -1
  45. package/chunks/Theme.js +1 -1
  46. package/chunks/Tick.js +1 -1
  47. package/chunks/tslib.es6.js +1 -1
  48. package/geometry/operators/areaOperator.js +5 -0
  49. package/geometry/operators/containsOperator.js +1 -1
  50. package/geometry/operators/crossesOperator.js +1 -1
  51. package/geometry/operators/disjointOperator.js +1 -1
  52. package/geometry/operators/distanceOperator.js +1 -1
  53. package/geometry/operators/equalsOperator.js +1 -1
  54. package/geometry/operators/geodeticDensifyOperator.js +5 -0
  55. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  56. package/geometry/operators/gx/operatorBuffer.js +1 -1
  57. package/geometry/operators/gx/operatorClip.js +1 -1
  58. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  59. package/geometry/operators/gx/operatorCut.js +1 -1
  60. package/geometry/operators/gx/operatorDifference.js +1 -1
  61. package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
  62. package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
  63. package/geometry/operators/gx/{operatorGeodeticDensifyByLength.js → operatorGeodeticDensify.js} +1 -1
  64. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  65. package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
  66. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  67. package/geometry/operators/gx/operatorIntersection.js +1 -1
  68. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  69. package/geometry/operators/gx/operatorOffset.js +1 -1
  70. package/geometry/operators/gx/operatorSimplify.js +1 -1
  71. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  72. package/geometry/operators/gx/operatorUnion.js +1 -1
  73. package/geometry/operators/intersectsOperator.js +1 -1
  74. package/geometry/operators/isNearOperator.js +1 -1
  75. package/geometry/operators/lengthOperator.js +5 -0
  76. package/geometry/operators/overlapsOperator.js +1 -1
  77. package/geometry/operators/relateOperator.js +1 -1
  78. package/geometry/operators/reshapeOperator.js +1 -1
  79. package/geometry/operators/touchesOperator.js +1 -1
  80. package/geometry/operators/withinOperator.js +1 -1
  81. package/interfaces.d.ts +4 -4
  82. package/layers/support/ControlPointsGeoreference.js +1 -1
  83. package/layers/support/MediaElementBase.js +1 -1
  84. package/layers/support/mediaUtils.js +1 -1
  85. package/linkChart/LinkChartProperties.js +1 -1
  86. package/linkChart/utils.js +1 -1
  87. package/package.json +2 -2
  88. package/portal/schemas/definitions.js +1 -1
  89. package/support/revision.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  91. package/views/2d/layers/LayerView2D.js +1 -1
  92. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  93. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  94. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +5 -0
  95. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +5 -0
  96. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +5 -0
  97. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  98. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  99. package/views/LinkChartView.js +1 -1
  100. package/views/MapView.js +1 -1
  101. package/views/View2D.js +1 -1
  102. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  103. package/widgets/BasemapGallery.js +1 -1
  104. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  105. package/widgets/BatchAttributeForm/templates/BatchAttributeFormElementTemplate.js +1 -1
  106. package/widgets/BatchAttributeForm/templates/BatchAttributeFormTemplate.js +1 -1
  107. package/widgets/BatchAttributeForm/templates/BatchFieldElementTemplate.js +1 -1
  108. package/widgets/BatchAttributeForm/templates/batchAttributeFormTemplateUtils.js +1 -1
  109. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  110. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  111. package/widgets/FeatureForm/FieldInput.js +1 -1
  112. package/widgets/LayerList/LayerListViewModel.js +1 -1
  113. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  114. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
  115. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter3D.js +1 -1
  116. package/widgets/OrientedImageryViewer/constants.js +1 -1
  117. package/widgets/OrientedImageryViewer/css.js +1 -1
  118. package/widgets/OrientedImageryViewer/utils.js +1 -1
  119. package/widgets/OrientedImageryViewer.js +1 -1
  120. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  121. package/widgets/support/SnappingControls.js +1 -1
  122. package/assets/esri/core/workers/chunks/0cfa9665dab31e5235a8.js +0 -1
  123. package/assets/esri/core/workers/chunks/22fb5687932019304225.js +0 -1
  124. package/assets/esri/core/workers/chunks/3b3c8362359a82c66793.js +0 -1
  125. package/assets/esri/core/workers/chunks/5e43cb91bbe20f2d32e3.js +0 -1
  126. package/assets/esri/core/workers/chunks/67df47efb9a9dfeafee2.js +0 -1
  127. package/assets/esri/core/workers/chunks/6be62448e33baabe028c.js +0 -1
  128. package/assets/esri/core/workers/chunks/74edde71352e1f578a3b.js +0 -1
  129. package/assets/esri/core/workers/chunks/941fe04f47059074c05b.js +0 -2
  130. package/assets/esri/core/workers/chunks/a0005bc65f79e83f26ee.js +0 -1
  131. package/assets/esri/core/workers/chunks/a6560ff77be29344bc50.js +0 -1
  132. package/assets/esri/core/workers/chunks/ba561e03df67894e437f.js +0 -2
  133. package/assets/esri/core/workers/chunks/ea51a7c32f716f4f1a34.js +0 -1
  134. package/chunks/Distance2DCalculator-BzAEa8Xe.js +0 -5
  135. package/chunks/GeodeticDistanceCalculator-BS_KY66f.js +0 -5
  136. package/chunks/OperatorShapePreservingDensify.js +0 -5
  137. package/geometry/operators/geodeticDensifyByLengthOperator.js +0 -5
  138. package/geometry/operators/gx/operatorShapePreservingDensify.js +0 -5
  139. package/geometry/operators/shapePreservingDensifyOperator.js +0 -5
  140. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +0 -5
  141. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +0 -5
  142. /package/assets/esri/core/workers/chunks/{941fe04f47059074c05b.js.LICENSE.txt → bb5a18dd1e6a71905668.js.LICENSE.txt} +0 -0
package/WebDocument2D.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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import{isSome as o}from"./core/arrayUtils.js";import s from"./core/Collection.js";import n from"./core/Error.js";import a from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{MultiOriginJSONMixin as m}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as h}from"./core/Promise.js";import{debounce as c}from"./core/promiseUtils.js";import{whenOnce as d}from"./core/reactiveUtils.js";import{addQueryParameter as g,isDataProtocol as f,dataComponents as b}from"./core/urlUtils.js";import{property as w}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import{reader as y}from"./core/accessorSupport/decorators/reader.js";import{subclass as A}from"./core/accessorSupport/decorators/subclass.js";import{writer as S}from"./core/accessorSupport/decorators/writer.js";import{readLoadable as _}from"./core/accessorSupport/read.js";import v from"./geometry/SpatialReference.js";import V from"./portal/PortalItem.js";import{typeKeyword as j}from"./portal/support/portalItemUtils.js";import I from"./support/MapFloorInfo.js";import{SaveOperationType as U}from"./webdoc/interfaces.js";import P from"./webdoc/RangeInfo.js";import O from"./webdoc/Widgets.js";import{getOptimalThumbnailSize as F}from"./webdoc/support/thumbnailUtils.js";import{loadFromSource as L}from"./webdoc/support/webdocLoadUtils.js";import{getLayerJSON as R}from"./webdoc/support/writeUtils.js";import k from"./webmap/ApplicationProperties.js";import x from"./webmap/Bookmark.js";import T from"./webmap/InitialViewProperties.js";import{Version as B}from"./webmap/Version.js";import E from"./webmap/background/ColorBackground.js";const N=s.ofType(x),J=new Map([["image/jpeg","jpeg"],["image/jpg","jpg"],["image/png","png"],["image/gif","gif"]]),M="ArcGIS Pro",Z=j.JSAPI;let W=class extends(m(a.LoadableMixin(h(r)))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new N,this.floorInfo=null,this.initialViewProperties=new T,this.portalItem=null,this.sourceVersion=null,this.widgets=null,this._debouncedSaveOperations=c((async(e,t,r)=>{const{save:i,saveAs:o}=await import("./webdoc/support/webdocSaveUtils.js");switch(e){case U.SAVE:return i(this.context,this,t);case U.SAVE_AS:return o(this.context,this,r,t)}})),this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){this.portalItem=u(this.portalItem)}initialize(){if(this.when().catch((e=>{l.getLogger(this).error("#load()","Failed to load web map",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=Z}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new T;t.background&&(r.background=E.fromJSON(t.background));const o=t.initialState?.viewpoint;if(o){if(o.rotation){B.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===M&&(o.rotation*=-1)}r.viewpoint=i.fromJSON(o)}return t.mapRangeInfo&&(r.rangeInfo=P.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=v.fromJSON(t.spatialReference)),t.timeZone&&(r.timeZone=t.timeZone),r}writeInitialViewProperties(e,t,r,i){e&&(e.background?.color&&(t.background=e.background.write({},i)),e.viewpoint&&(t.initialState={viewpoint:e.viewpoint.write({},i)}),e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i)),t.timeZone=e.timeZone)}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new B(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${this.context.currentVersion.major}.${this.context.currentVersion.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}get updatingFromView(){return!!this._updateFromPromise}load(e){return this.addResolvingPromise(L(this.context,this)),Promise.resolve(this)}loadAll(){return p(this,(e=>{e(this.ground,this.basemap,this.layers,this.tables)}))}read(e,t){t={...t,origin:this.context.origin};const r=this._getAuthoringPropsState();_(this,e,(t=>super.read(e,t)),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new n("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:this.context.origin,restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){return this._debouncedSaveOperations(U.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(U.SAVE_AS,t,e)}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find((t=>t.id===e.id))}async updateItemThumbnail(){this.thumbnailUrl&&this._isOverridden("thumbnailUrl")&&(await(this.portalItem?.updateThumbnail({thumbnail:this.thumbnailUrl,filename:this._thumbnailFilename})),this._clearThumbnailOverride())}getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:g(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_collectAllLayersJSON(e){return e.reduce(((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e)),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map((e=>R(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t))).filter(o).toArray()}_validateJSON(e){const t=B.parse(e.version||"","webmap");return this.context.currentVersion.validate(t),e.version=`${t.major}.${t.minor}`,e}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e?.viewing?.search,r=e=>this.allLayers.some((t=>t.id===e));if(t?.layers&&(t.layers=t.layers.filter((e=>r(e.id)))),t?.tables&&(t.tables=t.tables.filter((e=>this.tables.some((t=>t.id===e.id))))),e){const t=e.editing?.locationTracking;t?.info&&!r(t.info.layerId)&&(e.editing=null)}const i="presentation"in this?this.presentation:null,o=i?.slides;o&&o.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>r(e.id))))}))}async _updateFromInternal(e,t){if(t??={},await d((()=>e.ready)),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)"visible"in r&&"visible"in r.layer&&r._isOverridden("visible")&&(r.layer.visible=r.visible),"featureEffect"in r&&"featureEffect"in r.layer&&r._isOverridden("featureEffect")&&(r.layer.featureEffect=r.featureEffect);await this._updateThumbnailUrl(e,t),this.updateFromView(e)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),this.initialViewProperties.timeZone=e.timeZone,t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.persistableViewModels)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=F(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(f(e)){const t=b(e),r=t?.mediaType,i=r&&J.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}};e([w()],W.prototype,"_updateFromPromise",void 0),e([w({type:k,json:{write:!0}})],W.prototype,"applicationProperties",void 0),e([w({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringApp",null),e([S("authoringApp")],W.prototype,"writeAuthoringApp",null),e([w({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringAppVersion",null),e([S("authoringAppVersion")],W.prototype,"writeAuthoringAppVersion",null),e([w({type:N,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],W.prototype,"bookmarks",void 0),e([w({type:I,json:{name:"mapFloorInfo",write:!0}})],W.prototype,"floorInfo",void 0),e([w({type:T,nonNullable:!0,json:{read:{source:["background","initialState.viewpoint","mapRangeInfo","spatialReference","timeZone"]},write:{ignoreOrigin:!0,target:{background:{type:E},"initialState.viewpoint":{type:i},mapRangeInfo:{type:P},spatialReference:{type:v},"timeZone:":{type:String}}}}})],W.prototype,"initialViewProperties",void 0),e([y("initialViewProperties")],W.prototype,"readInitialViewProperties",null),e([S("initialViewProperties")],W.prototype,"writeInitialViewProperties",null),e([w({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],W.prototype,"layers",void 0),e([S("layers")],W.prototype,"writeLayers",null),e([w({type:V})],W.prototype,"portalItem",void 0),e([w()],W.prototype,"resourceInfo",void 0),e([w({readOnly:!0,type:B,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],W.prototype,"sourceVersion",void 0),e([y("sourceVersion")],W.prototype,"readSourceVersion",null),e([S("sourceVersion")],W.prototype,"writeSourceVersion",null),e([w({json:{read:!1,write:{ignoreOrigin:!0}}})],W.prototype,"tables",void 0),e([S("tables")],W.prototype,"writeTables",null),e([w()],W.prototype,"thumbnailUrl",null),e([w()],W.prototype,"updatingFromView",null),e([w({type:O,json:{write:!0}})],W.prototype,"widgets",void 0),W=e([A("esri.WebDocument2D")],W);const $=W;export{$ as default};
5
+ import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import{isSome as o}from"./core/arrayUtils.js";import s from"./core/Collection.js";import n from"./core/Error.js";import a from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{MultiOriginJSONMixin as m}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as h}from"./core/Promise.js";import{debounce as c}from"./core/promiseUtils.js";import{whenOnce as d}from"./core/reactiveUtils.js";import{addQueryParameter as g,isDataProtocol as f,dataComponents as b}from"./core/urlUtils.js";import{property as y}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import{reader as w}from"./core/accessorSupport/decorators/reader.js";import{subclass as A}from"./core/accessorSupport/decorators/subclass.js";import{writer as S}from"./core/accessorSupport/decorators/writer.js";import{readLoadable as _}from"./core/accessorSupport/read.js";import v from"./geometry/SpatialReference.js";import V from"./portal/PortalItem.js";import{typeKeyword as j}from"./portal/support/portalItemUtils.js";import I from"./support/MapFloorInfo.js";import{SaveOperationType as U}from"./webdoc/interfaces.js";import P from"./webdoc/RangeInfo.js";import O from"./webdoc/Widgets.js";import{getOptimalThumbnailSize as L}from"./webdoc/support/thumbnailUtils.js";import{loadFromSource as F}from"./webdoc/support/webdocLoadUtils.js";import{getLayerJSON as R}from"./webdoc/support/writeUtils.js";import k from"./webmap/ApplicationProperties.js";import x from"./webmap/Bookmark.js";import T from"./webmap/InitialViewProperties.js";import{Version as B}from"./webmap/Version.js";import E from"./webmap/background/ColorBackground.js";const N=s.ofType(x),J=new Map([["image/jpeg","jpeg"],["image/jpg","jpg"],["image/png","png"],["image/gif","gif"]]),M="ArcGIS Pro",Z=j.JSAPI;let W=class extends(m(a.LoadableMixin(h(r)))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new N,this.floorInfo=null,this.initialViewProperties=new T,this.portalItem=null,this.sourceVersion=null,this.widgets=null,this._debouncedSaveOperations=c((async(e,t,r)=>{const{save:i,saveAs:o}=await import("./webdoc/support/webdocSaveUtils.js");switch(e){case U.SAVE:return i(this.context,this,t);case U.SAVE_AS:return o(this.context,this,r,t)}})),this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){this.portalItem=u(this.portalItem)}initialize(){if(this.when().catch((e=>{l.getLogger(this).error("#load()","Failed to load web map",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=Z}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new T;t.background&&(r.background=E.fromJSON(t.background));const o=t.initialState?.viewpoint;if(o){if(o.rotation){B.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===M&&(o.rotation*=-1)}r.viewpoint=i.fromJSON(o)}return t.mapRangeInfo&&(r.rangeInfo=P.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=v.fromJSON(t.spatialReference)),t.timeZone&&(r.timeZone=t.timeZone),r}writeInitialViewProperties(e,t,r,i){e&&(e.background?.color&&(t.background=e.background.write({},i)),e.viewpoint&&(t.initialState={viewpoint:e.viewpoint.write({},i)}),e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i)),t.timeZone=e.timeZone)}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new B(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${this.context.currentVersion.major}.${this.context.currentVersion.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}get updatingFromView(){return!!this._updateFromPromise}load(e){return this.addResolvingPromise(F(this.context,this)),Promise.resolve(this)}loadAll(){return p(this,(e=>{e(this.ground,this.basemap,this.layers,this.tables)}))}read(e,t){t={...t,origin:this.context.origin};const r=this._getAuthoringPropsState();_(this,e,(t=>super.read(e,t)),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new n("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:this.context.origin,restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){return this._debouncedSaveOperations(U.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(U.SAVE_AS,t,e)}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find((t=>t.id===e.id))}async updateItemThumbnail(){this.thumbnailUrl&&this._isOverridden("thumbnailUrl")&&(await(this.portalItem?.updateThumbnail({thumbnail:this.thumbnailUrl,filename:this._thumbnailFilename})),this._clearThumbnailOverride())}getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:g(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_collectAllLayersJSON(e){return e.reduce(((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e)),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map((e=>R(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t))).filter(o).toArray()}_validateJSON(e){const t=B.parse(e.version||"","webmap");return this.context.currentVersion.validate(t),e.version=`${t.major}.${t.minor}`,e}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e?.viewing?.search,r=e=>this.allLayers.some((t=>t.id===e));if(t?.layers&&(t.layers=t.layers.filter((e=>r(e.id)))),t?.tables&&(t.tables=t.tables.filter((e=>this.tables.some((t=>t.id===e.id))))),e){const t=e.editing?.locationTracking;t?.info&&!r(t.info.layerId)&&(e.editing=null)}const i="presentation"in this?this.presentation:null,o=i?.slides;o&&o.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>r(e.id))))}))}async _updateFromInternal(e,t){if(t??={},await d((()=>e.ready)),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)"visible"in r&&"visible"in r.layer&&r._isOverridden("visible")&&(r.layer.visible=r.visible),"featureEffect"in r&&"featureEffect"in r.layer&&r._isOverridden("featureEffect")&&(r.layer.featureEffect=r.featureEffect);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),this.initialViewProperties.timeZone=e.timeZone,t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.persistableViewModels)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=L(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(f(e)){const t=b(e),r=t?.mediaType,i=r&&J.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}};e([y()],W.prototype,"_updateFromPromise",void 0),e([y({type:k,json:{write:!0}})],W.prototype,"applicationProperties",void 0),e([y({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringApp",null),e([S("authoringApp")],W.prototype,"writeAuthoringApp",null),e([y({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringAppVersion",null),e([S("authoringAppVersion")],W.prototype,"writeAuthoringAppVersion",null),e([y({type:N,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],W.prototype,"bookmarks",void 0),e([y({type:I,json:{name:"mapFloorInfo",write:!0}})],W.prototype,"floorInfo",void 0),e([y({type:T,nonNullable:!0,json:{read:{source:["background","initialState.viewpoint","mapRangeInfo","spatialReference","timeZone"]},write:{ignoreOrigin:!0,target:{background:{type:E},"initialState.viewpoint":{type:i},mapRangeInfo:{type:P},spatialReference:{type:v},"timeZone:":{type:String}}}}})],W.prototype,"initialViewProperties",void 0),e([w("initialViewProperties")],W.prototype,"readInitialViewProperties",null),e([S("initialViewProperties")],W.prototype,"writeInitialViewProperties",null),e([y({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],W.prototype,"layers",void 0),e([S("layers")],W.prototype,"writeLayers",null),e([y({type:V})],W.prototype,"portalItem",void 0),e([y()],W.prototype,"resourceInfo",void 0),e([y({readOnly:!0,type:B,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],W.prototype,"sourceVersion",void 0),e([w("sourceVersion")],W.prototype,"readSourceVersion",null),e([S("sourceVersion")],W.prototype,"writeSourceVersion",null),e([y({json:{read:!1,write:{ignoreOrigin:!0}}})],W.prototype,"tables",void 0),e([S("tables")],W.prototype,"writeTables",null),e([y()],W.prototype,"thumbnailUrl",null),e([y()],W.prototype,"updatingFromView",null),e([y({type:O,json:{write:!0}})],W.prototype,"widgets",void 0),W=e([A("esri.WebDocument2D")],W);const $=W;export{$ as default};
package/WebLinkChart.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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"./chunks/tslib.es6.js";import e from"./WebDocument2D.js";import t from"./core/Error.js";import{property as o}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/Logger.js";import"./core/RandomLCG.js";import{subclass as i}from"./core/accessorSupport/decorators/subclass.js";import s from"./linkChart/LinkChartProperties.js";import a from"./webmap/InitialViewProperties.js";import{currentVersion as p}from"./webmap/utils.js";import{Version as n}from"./webmap/Version.js";var c;const m={currentVersion:p,createInitialViewProperties:()=>new a,parseVersion:n.parse,itemType:"Web Link Chart",name:"linkchart",origin:"link-chart"};let l=c=class extends e{constructor(r){super(r),this.mapType="webLinkChart",this.linkChartProperties=new s}get activeLinkChartLayer(){return this.layers.find((({type:r})=>"link-chart"===r))}get context(){return m}static fromJSON(r){if(r)return new c({resourceInfo:r});throw new t("linkchart:empty-resource","Expected a JSON resource but got nothing")}updateFromView(r){this.linkChartProperties.layoutType=r.layoutType}};r([o({readOnly:!0})],l.prototype,"activeLinkChartLayer",null),r([o({json:{write:!0}})],l.prototype,"mapType",void 0),r([o({type:s,nonNullable:!0,json:{write:!0}})],l.prototype,"linkChartProperties",void 0),l=c=r([i("esri.WebLinkChart")],l);const h=l;export{h as default};
5
+ import{_ as r}from"./chunks/tslib.es6.js";import t from"./WebDocument2D.js";import e from"./core/Error.js";import{watch as o}from"./core/reactiveUtils.js";import{property as i}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/Logger.js";import"./core/RandomLCG.js";import{subclass as s}from"./core/accessorSupport/decorators/subclass.js";import{OriginId as a}from"./core/accessorSupport/PropertyOrigin.js";import{layoutMap as n}from"./linkChart/enums.js";import p from"./linkChart/LinkChartProperties.js";import c from"./webmap/InitialViewProperties.js";import{currentVersion as m}from"./webmap/utils.js";import{Version as l}from"./webmap/Version.js";var h;const u={currentVersion:m,createInitialViewProperties:()=>new c,parseVersion:l.parse,itemType:"Web Link Chart",name:"linkchart",origin:"link-chart"};let y=h=class extends t{constructor(r){super(r),this.mapType="webLinkChart",this.linkChartProperties=new p}initialize(){this.addHandles(o((()=>this.linkChartProperties.layoutType),(async r=>{if(this.linkChartProperties.originIdOf("layoutType")!==a.LINK_CHART&&n.has(r)){const t=n.get(r);await(this.activeLinkChartLayer?.applyNewLinkChartLayout(t))}})))}get activeLinkChartLayer(){return this.layers.find((({type:r})=>"link-chart"===r))}get context(){return u}static fromJSON(r){if(r)return new h({resourceInfo:r});throw new e("linkchart:empty-resource","Expected a JSON resource but got nothing")}};r([i({readOnly:!0})],y.prototype,"activeLinkChartLayer",null),r([i({json:{write:!0}})],y.prototype,"mapType",void 0),r([i({type:p,nonNullable:!0,json:{write:!0}})],y.prototype,"linkChartProperties",void 0),y=h=r([s("esri.WebLinkChart")],y);const f=y;export{f as default};
package/WebMap.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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"./chunks/tslib.es6.js";import t from"./WebDocument2D.js";import r from"./core/Collection.js";import e from"./core/Error.js";import{loadAll as s}from"./core/loadAll.js";import{property as i}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/Logger.js";import"./core/RandomLCG.js";import{subclass as p}from"./core/accessorSupport/decorators/subclass.js";import n from"./networks/UtilityNetwork.js";import m from"./webdoc/GeotriggersInfo.js";import a from"./webdoc/IPSInfo.js";import c from"./webmap/InitialViewProperties.js";import{currentVersion as l}from"./webmap/utils.js";import{Version as f}from"./webmap/Version.js";const u={currentVersion:l,createInitialViewProperties:()=>new c,parseVersion:f.parse,itemType:"Web Map",name:"webmap",origin:"web-map"},w=r.ofType(n);let y=class extends t{constructor(o){super(o),this.geotriggersInfo=null,this.ipsInfo=null,this.presentation=null,this.utilityNetworks=null}destroy(){if(this.utilityNetworks){const o=this.utilityNetworks.removeAll();for(const t of o)t.destroy();this.utilityNetworks.destroy()}}get context(){return u}loadAll(){return s(this,(o=>{o(this.ground,this.basemap,this.layers,this.tables,this.ipsInfo?.positioningService?.portalItem)}))}static fromJSON(o){if(o)return new this({resourceInfo:o});throw new e("webmap:empty-resource","Expected a JSON resource but got nothing")}updateFromView(o){}};y.VERSION=l,o([i({type:m,json:{write:!0}})],y.prototype,"geotriggersInfo",void 0),o([i({type:a,json:{write:!0,name:"mapIPSInfo"}})],y.prototype,"ipsInfo",void 0),o([i({json:{write:!0}})],y.prototype,"presentation",void 0),o([i({type:w,json:{read:!0,write:!0}})],y.prototype,"utilityNetworks",void 0),y=o([p("esri.WebMap")],y);const d=y;export{d as default};
5
+ import{_ as o}from"./chunks/tslib.es6.js";import t from"./WebDocument2D.js";import r from"./core/Collection.js";import e from"./core/Error.js";import{loadAll as s}from"./core/loadAll.js";import{property as i}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/Logger.js";import"./core/RandomLCG.js";import{subclass as p}from"./core/accessorSupport/decorators/subclass.js";import n from"./networks/UtilityNetwork.js";import m from"./webdoc/GeotriggersInfo.js";import a from"./webdoc/IPSInfo.js";import c from"./webmap/InitialViewProperties.js";import{currentVersion as l}from"./webmap/utils.js";import{Version as f}from"./webmap/Version.js";const u={currentVersion:l,createInitialViewProperties:()=>new c,parseVersion:f.parse,itemType:"Web Map",name:"webmap",origin:"web-map"},w=r.ofType(n);let y=class extends t{constructor(o){super(o),this.geotriggersInfo=null,this.ipsInfo=null,this.presentation=null,this.utilityNetworks=null}destroy(){if(this.utilityNetworks){const o=this.utilityNetworks.removeAll();for(const t of o)t.destroy();this.utilityNetworks.destroy()}}get context(){return u}loadAll(){return s(this,(o=>{o(this.ground,this.basemap,this.layers,this.tables,this.ipsInfo?.positioningService?.portalItem)}))}static fromJSON(o){if(o)return new this({resourceInfo:o});throw new e("webmap:empty-resource","Expected a JSON resource but got nothing")}};y.VERSION=l,o([i({type:m,json:{write:!0}})],y.prototype,"geotriggersInfo",void 0),o([i({type:a,json:{write:!0,name:"mapIPSInfo"}})],y.prototype,"ipsInfo",void 0),o([i({json:{write:!0}})],y.prototype,"presentation",void 0),o([i({type:w,json:{read:!0,write:!0}})],y.prototype,"utilityNetworks",void 0),y=o([p("esri.WebMap")],y);const j=y;export{j as default};