@arcgis/core 4.28.0-next.20230920 → 4.28.0-next.20230921
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.
- package/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/1cbaba30f55f00f7498b.js +1 -0
- package/assets/esri/core/workers/chunks/21a9c8aa2a9e9990df41.js +1 -0
- package/assets/esri/core/workers/chunks/24629402c647ef6b5f6b.js +1 -0
- package/assets/esri/core/workers/chunks/{b428fcb53ecc82b49e66.js → 332689bf60d246485993.js} +1 -1
- package/assets/esri/core/workers/chunks/{b558a402e2ce2616cf37.js → 3ca759f72d3bb29e9ea9.js} +22 -22
- package/assets/esri/core/workers/chunks/4339ce8aaf87fabb80cc.js +1 -0
- package/assets/esri/core/workers/chunks/4369a6c1e0a82ab4db6a.js +1 -0
- package/assets/esri/core/workers/chunks/43ba2bacd0f7d19915f7.js +1 -0
- package/assets/esri/core/workers/chunks/44b8e75593b7df1843e1.js +1 -0
- package/assets/esri/core/workers/chunks/53097659f31750c03a6d.js +1 -0
- package/assets/esri/core/workers/chunks/{7c72d5368bb2d7484b9b.js → 580039dd491854ca325c.js} +1 -1
- package/assets/esri/core/workers/chunks/59c00d6fba0fd1c03d01.js +1 -0
- package/assets/esri/core/workers/chunks/5edb99b58549cd66b394.js +1 -0
- package/assets/esri/core/workers/chunks/6203ddf6caad3d356327.js +1 -0
- package/assets/esri/core/workers/chunks/652749dc847fcb887234.js +1 -0
- package/assets/esri/core/workers/chunks/74d3ecb1a06d9f81e2c5.js +1 -0
- package/assets/esri/core/workers/chunks/7ea33aa455c5143affb1.js +1 -0
- package/assets/esri/core/workers/chunks/90771b0de3e520a1df9a.js +1 -0
- package/assets/esri/core/workers/chunks/a277c980ba8704939688.js +1 -0
- package/assets/esri/core/workers/chunks/bbc0dcd316c5598bc9ad.js +1 -0
- package/assets/esri/core/workers/chunks/bc1dc6383e60e7e61d50.js +1 -0
- package/assets/esri/core/workers/chunks/c4bb67150ccd01ea6014.js +1 -0
- package/assets/esri/core/workers/chunks/{aa021bc97b4a18a749dd.js → cad260881653567bc8f9.js} +1 -1
- package/assets/esri/core/workers/chunks/cec607d0138351a4952e.js +1 -0
- package/assets/esri/core/workers/chunks/{f147269d85adfb4588ed.js → d9061beaa43065316062.js} +1 -1
- package/assets/esri/core/workers/chunks/e55f7fc7eff0074ce0fc.js +1 -0
- package/assets/esri/core/workers/chunks/{9c40e7ed387071544f8c.js → ed1fbc1bc8d50453e2f5.js} +1 -1
- package/assets/esri/core/workers/chunks/eef27d305023034084a4.js +1 -0
- package/assets/esri/images/portal/onlinemedialayer16.png +0 -0
- package/chunks/LaserlinePath.glsl.js +5 -1
- package/core/sql.js +1 -1
- package/interfaces.d.ts +1 -17
- package/layers/graphics/sources/WFSSourceWorker.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/save/utils.js +1 -1
- package/layers/support/editableLayers.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/rest/geometryService/cut.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/versionManagement/deleteVersion.js +1 -1
- package/rest/versionManagement/gdbVersion/alterVersion.js +1 -1
- package/rest/versionManagement/gdbVersion/post.js +1 -1
- package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
- package/rest/versionManagement/gdbVersion/serverVersionUtils.js +5 -0
- package/support/revision.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/support/dito.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +6 -6
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/Attribute.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/interactive/keybindings.js +1 -1
- package/views/interactive/tooltip/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/content/Fields.js +5 -0
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/webdoc/saveAPIKeyUtils.js +5 -0
- package/webdoc/webdocSaveUtils.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/support/globalCss.js +1 -1
- package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +0 -1
- package/assets/esri/core/workers/chunks/084a85e2e31b4d5fa924.js +0 -1
- package/assets/esri/core/workers/chunks/1a449168d30a688e6128.js +0 -1
- package/assets/esri/core/workers/chunks/21f0fafafcd754f5fb88.js +0 -1
- package/assets/esri/core/workers/chunks/273167b2dd46e58b8739.js +0 -1
- package/assets/esri/core/workers/chunks/2bf58296a6ea4eee960b.js +0 -1
- package/assets/esri/core/workers/chunks/3c2c64832fb498bbaa83.js +0 -1
- package/assets/esri/core/workers/chunks/4b3a5cc435435c81e6a5.js +0 -1
- package/assets/esri/core/workers/chunks/56afd89d08c874f620a1.js +0 -1
- package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +0 -1
- package/assets/esri/core/workers/chunks/74ddc14e4b576ddbb582.js +0 -1
- package/assets/esri/core/workers/chunks/7f680cf24dd97d61bcd2.js +0 -1
- package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +0 -1
- package/assets/esri/core/workers/chunks/a838dc6653ec29503053.js +0 -1
- package/assets/esri/core/workers/chunks/b10a91cae610aba62bf8.js +0 -1
- package/assets/esri/core/workers/chunks/b8eb842ea98a9734e161.js +0 -1
- package/assets/esri/core/workers/chunks/bbb63392485ed57703e0.js +0 -1
- package/assets/esri/core/workers/chunks/bdf13091bd0e1ab0db7e.js +0 -1
- package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +0 -1
- package/assets/esri/core/workers/chunks/e54ae2a4281dd58e0707.js +0 -1
- package/assets/esri/core/workers/chunks/e5fcfd41f0ec12dcb7f2.js +0 -1
- package/assets/esri/core/workers/chunks/f07a0ea10428adecea1a.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4697],{65845:(e,t,r)=>{r.d(t,{D:()=>i});var a=r(81153);function i(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>a})},64697:(e,t,r)=>{r.d(t,{save:()=>c,saveAs:()=>d});var a=r(64383),i=r(14661);const n="Image Service",o="imagery-layer-save",l="imagery-layer-save-as",s="imagery-tile-layer-save",p="imagery-tile-layer-save-as";function u(e){if("imagery"===e.type)return{isValid:!0};const{raster:t}=e;return{isValid:"RasterTileServer"===t?.datasetFormat&&("Raster"===t.tileType||"Map"===t.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function y(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function m(e,t){const{parsedUrl:r,title:a,fullExtent:n}=e;t.url=r.path,t.title||=a,t.extent=await(0,i.$o)(n),"imagery-tile"===e.type&&(0,i.qj)(t,i.Kz.TILED_IMAGERY)}async function c(e,t){const r="imagery"===e.type?o:s;return(0,a.a1)({layer:e,itemType:n,validateLayer:u,createItemData:y,errorNamePrefix:r},t)}async function d(e,t,r){const i="imagery"===e.type?l:p;return(0,a.po)({layer:e,itemType:n,validateLayer:u,createItemData:y,errorNamePrefix:i,newItem:t,setItemProperties:m},r)}},64383:(e,t,r)=>{r.d(t,{a1:()=>g,po:()=>v});var a=r(20102),i=r(65845),n=r(48522),o=r(15235),l=r(33516),s=r(14661),p=r(14769);async function u(e){const{layer:t,errorNamePrefix:r,validateLayer:i}=e;await t.load(),function(e,t,r){const i=r(e);if(!i.isValid)throw new a.Z(`${t}:invalid-parameters`,i.errorMessage,{layer:e})}(t,r,i)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function m(e,t,r,i){if(e.type!==r)throw new a.Z(`${t}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:e,layer:i})}function c(e,t,r){const{portalItem:i}=e;if(!i)throw new a.Z(`${t}:portal-item-not-set`,y(e,"requires the portalItem property to be set"));if(!i.loaded)throw new a.Z(`${t}:portal-item-not-loaded`,y(e,"cannot be saved to a portal item that does not exist or is inaccessible"));(0,p.w)(i),m(i,t,r,e)}function d(e,t,r,a){let i=o.default.from(e);return i.id&&(i=i.clone(),i.id=null),i.type??=r,i.portal??=n.Z.getDefault(),(0,p.w)(i),m(i,t,r,a),i}async function f(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const i=e.write({},t);return function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.Z(e,t,r)));if(t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new a.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),i}function w(e){(0,s.qj)(e,s.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function g(e,t){const{layer:r,createItemData:a,errorNamePrefix:n,itemType:o}=e;await u(e),c(r,n,o);const s=r.portalItem,p=(0,l.Y)(s),y=await f(r,p,t),m=await a({layer:r,layerJSON:y},s);return w(s),await s.update({data:m}),(0,i.D)(p),s}async function v(e,t){const{layer:r,createItemData:a,setItemProperties:n,newItem:o,errorNamePrefix:s,itemType:p}=e;await u(e);const y=d(o,s,p,r),m=(0,l.Y)(y),c=await f(r,m,t),g=await a({layer:r,layerJSON:c},y);return await n(r,y),w(y),await async function(e,t,r){const a=e.portal;await a.signIn(),await(a.user?.addItem({item:e,data:t,folder:r?.folder}))}(y,g,t),r.portalItem=y,(0,i.D)(m),y}},33516:(e,t,r)=>{r.d(t,{Y:()=>o,h:()=>n});var a=r(17452),i=r(48522);function n(e){return{origin:"portal-item",url:(0,a.mN)(e.itemUrl),portal:e.portal||i.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,a.mN)(e.itemUrl):null,portal:e.portal||i.Z.getDefault(),portalItem:e}}},14769:(e,t,r)=>{r.d(t,{w:()=>o});var a=r(68773),i=r(20102),n=r(71058);function o(e){if(a.default.apiKey&&(0,n.r)(e.portal.url))throw new i.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3778],{42033:(e,t,r)=>{async function i(e,t,i="UTC"){const{WhereClause:n}=await r.e(8968).then(r.bind(r,8968));return n.create(e,t,{timeZone:i})}function n(e,t){return null!=e?null!=t?`(${e}) AND (${t})`:e:t}r.d(t,{E:()=>i,_:()=>n})},16859:(e,t,r)=>{r.d(t,{I:()=>E});var i=r(43697),n=r(68773),s=r(40330),l=r(3172),o=r(66643),a=r(20102),p=r(92604),u=r(70586),c=r(95330),d=r(17452),h=r(5600),b=(r(75215),r(67676),r(80442),r(71715)),f=r(52011),m=r(30556),y=r(84230),w=r(48522),v=r(15235),g=r(86082),x=r(14661);const E=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:i}=await r.e(8062).then(r.bind(r,18062));return(0,c.k_)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,c.D_)(e)||p.Z.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async setUserPrivileges(e,t){if(!n.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:n}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",n)}catch(e){(0,c.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=e===r.id;if(i&&r.portal.user)return(0,x.Ss)(r);let n,l;if(i)n=r.portal.url;else try{n=await(0,y.oP)(this.url,t)}catch(e){(0,c.r9)(e)}if(!n||!(0,d.Zo)(n,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(s.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.r9)(e)}if(!l)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(i?await r.reload():(r=new v.default({id:e,portal:{url:n}}),await r.load(t)),r.portal.user)return(0,x.Ss)(r)}catch(e){(0,c.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const r=P.credential===t?P.user:await this._fetchEditingUser(e);return P.credential=t,P.user=r,null==r||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=s.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,n=w.Z.getDefault();if(n&&n.loaded&&(0,d.Fv)(n.restUrl)===(0,d.Fv)(i))return n.user;const a=`${i}/community/self`,p=null!=e?e.signal:null,u=await(0,o.q6)((0,l.Z)(a,{authMode:"no-prompt",query:{f:"json"},signal:p}));return u.ok?g.Z.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,i=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||w.Z.getDefault());return r&&i&&!(0,d.tm)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,h.Cb)({type:v.default})],t.prototype,"portalItem",null),(0,i._)([(0,b.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,h.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,h.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,h.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},P={credential:null,user:null}},54306:(e,t,r)=>{r.d(t,{Z:()=>_});var i,n=r(43697),s=r(9790),l=r(35454),o=r(96674),a=r(22974),p=r(62357),u=r(5600),c=(r(75215),r(71715)),d=r(52011),h=r(30556),b=(r(67676),r(80442),r(8813));let f=i=class extends o.wq{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?(0,b.dI)(t.value):e}writeExpression(e,t,r){null!=this.value&&(e=(0,b.dI)(this.value)),null!=e&&(t[r]=e)}clone(){return new i({expression:this.expression,title:this.title,value:this.value})}};(0,n._)([(0,u.Cb)({type:String,json:{write:{writerEnsuresNonNull:!0}}})],f.prototype,"expression",void 0),(0,n._)([(0,c.r)("expression",["expression","value"])],f.prototype,"readExpression",null),(0,n._)([(0,h.c)("expression")],f.prototype,"writeExpression",null),(0,n._)([(0,u.Cb)({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],f.prototype,"title",void 0),(0,n._)([(0,u.Cb)({json:{read:!1,write:!1}})],f.prototype,"value",void 0),f=i=(0,n._)([(0,d.j)("esri.layers.support.LabelExpressionInfo")],f);const m=f;var y,w=r(84230),v=r(28412),g=r(21878);const x=new l.X({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function E(e,t,r){return{enabled:!(0,w.A2)(r?.layer)}}function P(e){return!e||"service"!==e.origin&&!("map-image"===e.layer?.type)}function S(e){return!!function(e){return"map-image"===e?.type}(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}let I=y=class extends o.wq{static evaluateWhere(e,t){const r=(e,t,r)=>{switch(t){case"=":return e==r;case"<>":return e!=r;case">":return e>r;case">=":return e>=r;case"<":return e<r;case"<=":return e<=r}return!1};try{if(null==e)return!0;const i=e.split(" ");if(3===i.length)return r(t[i[0]],i[1],i[2]);if(7===i.length){const e=r(t[i[0]],i[1],i[2]),n=i[3],s=r(t[i[4]],i[5],i[6]);switch(n){case"AND":return e&&s;case"OR":return e||s}}return!1}catch(t){console.log("Error.: can't parse = "+e)}}constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.repeatLabelDistance=null,this.symbol=v.Rz,this.useCodedValues=void 0,this.where=null}readLabelExpression(e,t){const r=t.labelExpressionInfo;if(!r||!r.value&&!r.expression)return e}writeLabelExpression(e,t,r){if(this.labelExpressionInfo)if(null!=this.labelExpressionInfo.value)e=(0,b.z7)(this.labelExpressionInfo.value);else if(null!=this.labelExpressionInfo.expression){const t=(0,b.el)(this.labelExpressionInfo.expression);t&&(e="["+t+"]")}null!=e&&(t[r]=e)}writeLabelExpressionInfo(e,t,r,i){if(null==e&&null!=this.labelExpression&&P(i))e=new m({expression:this.getLabelExpressionArcade()});else if(!e)return;const n=e.toJSON(i);n.expression&&(t[r]=n)}writeMaxScale(e,t){(e||this.minScale)&&(t.maxScale=e)}writeMinScale(e,t){(e||this.maxScale)&&(t.minScale=e)}getLabelExpression(){return(0,b.hV)(this)}getLabelExpressionArcade(){return(0,b.YI)(this)}getLabelExpressionSingleField(){return(0,b.UO)(this)}hash(){return JSON.stringify(this)}clone(){return new y({allowOverrun:this.allowOverrun,deconflictionStrategy:this.deconflictionStrategy,labelExpression:this.labelExpression,labelExpressionInfo:(0,a.d9)(this.labelExpressionInfo),labelPosition:this.labelPosition,labelPlacement:this.labelPlacement,maxScale:this.maxScale,minScale:this.minScale,name:this.name,repeatLabel:this.repeatLabel,repeatLabelDistance:this.repeatLabelDistance,symbol:(0,a.d9)(this.symbol),where:this.where,useCodedValues:this.useCodedValues})}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],I.prototype,"name",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1},"portal-item":{default:!1,write:{overridePolicy:E}}}}})],I.prototype,"allowOverrun",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0,default:"static",origins:{"web-scene":{write:!1},"portal-item":{default:"static",write:{overridePolicy:E}}}}})],I.prototype,"deconflictionStrategy",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:{overridePolicy(e,t,r){return this.labelExpressionInfo&&"service"===r?.origin&&S(r.layer)?{enabled:!1}:{allowNull:!0}}}}})],I.prototype,"labelExpression",void 0),(0,n._)([(0,c.r)("labelExpression")],I.prototype,"readLabelExpression",null),(0,n._)([(0,h.c)("labelExpression")],I.prototype,"writeLabelExpression",null),(0,n._)([(0,u.Cb)({type:m,json:{write:{overridePolicy:(e,t,r)=>function(e){return P(e)||S(e?.layer)}(r)?{allowNull:!0}:{enabled:!1}}}})],I.prototype,"labelExpressionInfo",void 0),(0,n._)([(0,h.c)("labelExpressionInfo")],I.prototype,"writeLabelExpressionInfo",null),(0,n._)([(0,u.Cb)({type:x.apiValues,json:{type:x.jsonValues,read:x.read,write:x.write}})],I.prototype,"labelPlacement",void 0),(0,n._)([(0,u.Cb)({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],I.prototype,"labelPosition",void 0),(0,n._)([(0,u.Cb)({type:Number})],I.prototype,"maxScale",void 0),(0,n._)([(0,h.c)("maxScale")],I.prototype,"writeMaxScale",null),(0,n._)([(0,u.Cb)({type:Number})],I.prototype,"minScale",void 0),(0,n._)([(0,h.c)("minScale")],I.prototype,"writeMinScale",null),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:E}}}}})],I.prototype,"repeatLabel",void 0),(0,n._)([(0,u.Cb)({type:Number,cast:p.t_,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:E}}}}})],I.prototype,"repeatLabelDistance",void 0),(0,n._)([(0,u.Cb)({types:s.yK,json:{origins:{"web-scene":{types:s.S6,write:g.vX,default:null}},write:g.vX,default:null}})],I.prototype,"symbol",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],I.prototype,"useCodedValues",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],I.prototype,"where",void 0),I=y=(0,n._)([(0,d.j)("esri.layers.support.LabelClass")],I);const _=I},8813:(e,t,r)=>{r.d(t,{UO:()=>m,YI:()=>f,dI:()=>y,el:()=>E,hV:()=>b,z7:()=>h});var i=r(19153);const n="__begin__",s="__end__",l=new RegExp(n,"ig"),o=new RegExp(s,"ig"),a=new RegExp("^"+n,"i"),p=new RegExp(s+"$","i"),u='"',c=u+" + ",d=" + "+u;function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function b(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=function(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}(e.labelExpression),t.type="conventional"),t}function f(e){const t=b(e);if(!t)return null;switch(t.type){case"conventional":return y(t.expression);case"arcade":return t.expression}return null}function m(e){const t=b(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t&&t[1].trim()||null}(t.expression);case"arcade":return E(t.expression)}return null}function y(e){let t;return e?(t=(0,i.gx)(e,(e=>n+'$feature["'+e+'"]'+s)),t=a.test(t)?t.replace(a,""):u+t,t=p.test(t)?t.replace(p,""):t+u,t=t.replaceAll(l,c).replaceAll(o,d)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,v=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,g=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,x=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function E(e){if(!e)return null;let t=v.exec(e)||g.exec(e);return t?t[1]||t[3]:(t=x.exec(e),t?t[2]:null)}},30707:(e,t,r)=>{r.d(t,{a:()=>c,r:()=>p});var i=r(20102),n=r(22974),s=r(92604),l=r(54306);const o=s.Z.getLogger("esri.layers.support.labelingInfo"),a=/\[([^\[\]]+)\]/gi;function p(e,t,r){return e?e.map((e=>{const i=new l.Z;if(i.read(e,r),i.labelExpression){const e=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;i.labelExpression=i.labelExpression.replaceAll(a,((t,r)=>`[${function(e,t){if(!t)return e;const r=e.toLowerCase();for(let e=0;e<t.length;e++){const i=t[e].name;if(i.toLowerCase()===r)return i}return e}(r,e)}]`))}return i})):null}const u={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function c(e,t){const r=(0,n.d9)(e);return r.some((e=>function(e,t){const r=e.labelPlacement,n=u[t];if(!e.symbol)return o.warn("No ILabelClass symbol specified."),!0;if(!n)return o.error(new i.Z("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!n.includes(r)){const i=n[0];r&&o.warn(`Found invalid label placement type ${r} for ${t}. Defaulting to ${i}`),e.labelPlacement=i}return!1}(e,t)))?[]:r}},56545:(e,t,r)=>{r.d(t,{Z:()=>d});var i,n=r(43697),s=r(96674),l=r(22974),o=r(5600),a=r(75215),p=r(52011),u=r(30556);let c=i=class extends s.wq{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new i((0,l.d9)({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};(0,n._)([(0,o.Cb)({type:[String],json:{write:!0}})],c.prototype,"attachmentTypes",void 0),(0,n._)([(0,o.Cb)({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],c.prototype,"attachmentsWhere",void 0),(0,n._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],c.prototype,"cacheHint",void 0),(0,n._)([(0,o.Cb)({type:[String],json:{write:!0}})],c.prototype,"keywords",void 0),(0,n._)([(0,o.Cb)({type:[Number],json:{write:!0}})],c.prototype,"globalIds",void 0),(0,n._)([(0,o.Cb)({json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],c.prototype,"num",void 0),(0,n._)([(0,o.Cb)({type:[Number],json:{write:!0}})],c.prototype,"objectIds",void 0),(0,n._)([(0,o.Cb)({type:Boolean,json:{default:!1,write:!0}})],c.prototype,"returnMetadata",void 0),(0,n._)([(0,o.Cb)({type:[Number],json:{write:!0}})],c.prototype,"size",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],c.prototype,"start",void 0),(0,n._)([(0,u.c)("start"),(0,u.c)("num")],c.prototype,"writeStart",null),(0,n._)([(0,o.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],c.prototype,"where",void 0),c=i=(0,n._)([(0,p.j)("esri.rest.support.AttachmentQuery")],c),c.from=(0,a.se)(c);const d=c},32163:(e,t,r)=>{r.d(t,{eZ:()=>p});var i=r(51773),n=r(35671),s=r(84649),l=(r(63801),r(48074),r(38745),r(9190)),o=(r(10214),r(71423),r(44951),r(422)),a=r(29986);function p({displayField:e,editFieldsInfo:t,fields:r,objectIdField:a,title:p},h){if(!r)return null;const f=function(e,t){const r=t?.visibleFieldNames;return function(e,t){const r=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===r&&(e=e.slice()),e.sort(c),e}(e.fields??[],t?.ignoreFieldTypes||b).map((t=>new o.Z({fieldName:t.name,isEditable:(0,n.Hp)(t,e),label:t.alias,format:d(t),visible:u(t,{...e,visibleFieldNames:r})})))}({editFieldsInfo:t,fields:r,objectIdField:a},h);if(!f.length)return null;const m=function(e){const t=(0,n.O5)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r??""}({titleBase:p,fields:r,displayField:e}),y=[new l.Z,new s.Z];return new i.Z({title:m,content:y,fieldInfos:f})}const u=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):(0,n.Fv)(e,t);function c(e,t){return"oid"===e.type?-1:"oid"===t.type?1:h(e)?-1:h(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function d(e){switch(e.type){case"small-integer":case"integer":case"single":return new a.Z({digitSeparator:!0,places:0});case"double":return new a.Z({digitSeparator:!0,places:2});case"string":return(0,n.Ec)(e.name)?new a.Z({digitSeparator:!0,places:0}):null;default:return null}}function h(e){return"name"===(e.name&&e.name.toLowerCase())||"name"===(e.alias&&e.alias.toLowerCase())}const b=["geometry","blob","raster","guid","xml"]},28412:(e,t,r)=>{r.d(t,{CJ:()=>p,Rz:()=>c,xA:()=>a,z3:()=>u}),r(80442);var i=r(20256),n=r(4095),s=r(77987),l=r(78724),o=r(58333);const a=s.Z.fromJSON(o.I4),p=n.Z.fromJSON(o.ET),u=i.Z.fromJSON(o.lF),c=l.Z.fromJSON(o.qP);s.Z.fromJSON(o.eG),n.Z.fromJSON(o.wW),i.Z.fromJSON(o.lj)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5913],{91303:(e,t,i)=>{var n;i.d(t,{Y:()=>n}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(n||(n={}))},16306:(e,t,i)=>{i.d(t,{aX:()=>I});var n=i(68773),s=i(20102),r=i(92604),a=i(38913),o=i(58901),l=i(73913),c=i(8744),u=i(40488),h=(i(66577),i(3172)),f=i(33955),p=i(11282),d=i(17452);async function m(e,t,i){const n="string"==typeof e?(0,d.mN)(e):e,s=t[0].spatialReference,r=(0,f.Ji)(t[0]),a={...i,query:{...n.query,f:"json",sr:(0,c.B9)(s),geometries:JSON.stringify((l=t,{geometryType:(0,f.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:o}=await(0,h.Z)(n.path+"/simplify",a);var l;return function(e,t,i){const n=(0,f.q9)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}(o.geometries,r,s)}const y=r.Z.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y.error(e),new s.Z(e)}const i=(0,l.x3)(e),n=[];for(const e of i){const i=[];n.push(i),i.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],r=e[n][1],a=e[n+1][0],o=e[n+1][1],l=Math.sqrt((a-s)*(a-s)+(o-r)*(o-r)),c=(o-r)/l,u=(a-s)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const n=e*t,a=u*n+s,o=c*n+r;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,n=u*e+s,a=c*e+r;i.push([n,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:n,spatialReference:e.spatialReference}):new o.Z({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.Sx)(t,!0)}return i&&(e=(0,l.Sy)(e,i)),e}function b(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=(0,l.XZ)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=(0,l.XZ)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=(0,l.XZ)(n,t);e=e.clone().offset(i*(-2*t),0)}else if(n<i){const t=(0,l.XZ)(n,i);e=e.clone().offset(t*(-2*i),0)}}return e}function v(e,t){let i=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],r=t.geometries[n],a=(0,l.x3)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const n=t[e][0];i=n>i?n:i}i=Number(i.toFixed(9));const n=-360*(0,l.XZ)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(n,0))}return!0}}))}if(s===i){if(g(e))for(const t of(0,l.x3)(r))e[s]=e[s].addRing(t);else if(x(e))for(const t of(0,l.x3)(r))e[s]=e[s].addPath(t)}else i=s,e[s]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&y.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.default.geometryServiceUrl;let r,d,g,x,_,S,R,T,C=0;const k=[],M=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,d=(0,c.C5)(r),g=r.isWebMercator,S=g?102100:4326,x=l.UZ[S].maxX,_=l.UZ[S].minX,R=l.UZ[S].plus180Line,T=l.UZ[S].minus180Line),d)if("mesh"===t.type)M.push(t);else if("point"===t.type)M.push(b(t.clone(),x,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,x,_))),M.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,d);M.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,i=(0,l.XZ)(e.xmin,_)*(2*x);let n=0===i?t.clone():(0,l.Sy)(t.clone(),i);e.offset(i,0),e.intersects(R)&&e.xmax!==x?(C=e.xmax>C?e.xmax:C,n=w(n,g),k.push(n),M.push("cut")):e.intersects(T)&&e.xmin!==_?(C=e.xmax*(2*x)>C?e.xmax*(2*x):C,n=w(n,g,360),k.push(n),M.push("cut")):M.push(n)}else M.push(t.clone());else M.push(t);else M.push(t);let F=(0,l.XZ)(C,x),O=-90;const P=F,Z=new o.Z;for(;F>0;){const e=360*F-180;Z.addPath([[e,O],[e,-1*O]]),O*=-1,F--}if(k.length>0&&P>0){const t=v(k,await async function(e,t,i,n){const s=(0,p.en)(e),r=t[0].spatialReference,a={...n,responseType:"json",query:{...s.query,f:"json",sr:(0,c.B9)(r),target:JSON.stringify({geometryType:(0,f.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,h.Z)(s.path+"/cut",a),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map((e=>{const t=(0,f.im)(e);return t.spatialReference=r,t}))}}(s,k,Z,i)),n=[],r=[];for(let i=0;i<M.length;i++){const s=M[i];if("cut"!==s)r.push(s);else{const s=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&s.rings.length>=a.rings.length?(n.push(s),r.push("simplify")):r.push(g?(0,u.$)(s):s)}}if(!n.length)return r;const a=await m(s,n,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(g?(0,u.$)(a.shift()):a.shift())}return o}const D=[];for(let e=0;e<M.length;e++){const t=M[e];if("cut"!==t)D.push(t);else{const e=k.shift();D.push(!0===g?(0,u.$)(e):e)}}return D}},73913:(e,t,i)=>{i.d(t,{Sy:()=>l,UZ:()=>a,XZ:()=>o,x3:()=>c});var n=i(58901),s=i(82971),r=i(33955);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.Z.WebMercator}),minus180Line:new n.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.Z({paths:[[[180,-180],[180,180]]],spatialReference:s.Z.WGS84}),minus180Line:new n.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:s.Z.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.oU)(e)?e.rings:e.paths}},74878:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ft});var n=i(43697),s=i(51773),r=i(2368),a=i(20102),o=i(92604),l=i(16453),c=i(95330),u=i(17445),h=i(5600),f=i(75215),p=i(67676),d=i(80442),m=i(36030),y=i(52011),g=i(87085),x=i(17287),w=i(71612),b=i(17017),v=(i(66577),i(30030)),I=i(3172),_=i(71715),S=i(8744),R=i(66677),T=i(21506),C=i(35956),k=i(29876),M=i(45663),F=i(88281),O=i(11145),P=i(96674),Z=i(609),D=i(39450),z=i(36679),A=i(99815),N=i(73506),B=i(94139);const E=new Map,J=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.refCount--,e.refCount<=0&&(n.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.ts=Date.now(),e.refCount++,n.delete(i),n.set(i,e),e.block}return null}putBlock(e,t,i,n){const s=this._cachedBlocks,r=e+"/"+t;if(s.has(r)){const e=s.get(r);e.ts=Date.now(),e.refCount++}else s.set(r,{block:i,ts:Date.now(),refCount:1,controller:n});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,n=e+"/"+t;i.has(n)&&i.delete(n)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let n=0;n<t.length&&t[n][1].ts<=i-this._duration;n++)e.delete(t[n][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function L(e,t){return null==t?e:`${e}?sliceId=${t}`}function H(e,t,i){const n=E.get(e);if(!n)return null==t?J.decreaseRefCount(e,i):0;if(null==t||null==n[t])return J.decreaseRefCount(e,i);const s=n[t]?.cache,r=s?.get(i);if(s&&r){if(r.refCount--,0===r.refCount){s.delete(i);for(let e=0;e<n.length;e++)n[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function W(e,t,i){const n=E.get(e);if(!n)return null==t?J.getBlock(e,i):null;if(null==t||null==n[t]){for(let e=0;e<n.length;e++){const t=n[e]?.cache.get(i);if(t)return t.refCount++,t.block}return J.getBlock(e,i)}const s=n[t]?.cache.get(i);if(s)return s.refCount++,s.block;for(let e=0;e<n.length;e++){if(e===t||!n[e])continue;const s=n[e]?.cache,r=s?.get(i);if(s&&r)return r.refCount++,s.set(i,r),r.block}return null}function q(e,t,i,n,s=null){const r=E.get(e);if(!r)return void(null==t&&J.putBlock(e,i,n,s));if(null==t||null==r[t])return void J.putBlock(e,i,n,s);const a={refCount:1,block:n,isResolved:!1,isRejected:!1,controller:s};n.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),r[t]?.cache.set(i,a)}function j(e,t,i){const n=E.get(e);n?null!=t&&null!=n[t]?n[t]?.cache.delete(i):J.deleteBlock(e,i):null==t&&J.deleteBlock(e,i)}var G=i(81578),U=i(75993),$=i(55914),V=i(80676),X=i(6570);let Y=class extends((0,Z.v)(P.wq)){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,N.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:O.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,N.ut)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}set url(e){this._set("url",(0,R.Nm)(e,o.Z.getLogger(this)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,n={}){const s=n.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,s);return this.fetchPixels(r,s.size[0],s.size[1],n)}async identify(e,t={}){e=(0,f.TJ)(B.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:n}=t,{rasterInfo:s}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:a}=s;let{transposedVariableName:o}=t;const l=null!=a&&r&&(null!=n||(0,A.WU)(i));l&&!o&&(o=null!=i&&i.length>0?i[0].variableName??void 0:a.variables[0].name,t={...t,transposedVariableName:o}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=s,{datumTransformation:h}=t;let p=(0,N.nF)(e,c,h);if(!u.intersects(p))return{location:p,value:null};if(null!=s.transform){const e=s.transform.inverseTransform(p);if(!s.nativeExtent.intersects(e))return{location:e,value:null};p=e}let d=0;const m=null!=o&&null!=a&&s.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(m)return e.identify(p,t);const{pixelSize:i}=s,n=3,r=i.x*n/2,a=i.y*n/2,o=new X.Z({xmin:p.x-r,xmax:p.x+r,ymin:p.y-a,ymax:p.y+a,spatialReference:c}),l={interpolation:"nearest"},{pixelBlock:u}=await e.fetchPixels(o,n,n,l),{pixelBlock:h}=await this.fetchPixels(o,n,n,l);if(null==u)return{location:p,value:null};const f=Math.floor(n*n*.5),d=!u.mask||u.mask[f]?u.pixels.map((e=>e[f])):null;let y;return null!=h&&(y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):void 0),{location:p,value:d,processedValue:y,pyramidLevel:0}}if(!m)if(t.srcResolution)d=(0,N.kr)(t.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(d=await this.computeBestPyramidLevelForLocation(e,t),null==d)return{location:p,value:null};const y=this.identifyPixelLocation(p,d,null,m);if(null===y)return{location:p,value:null};const{row:g,col:x,rowOffset:w,colOffset:b,blockWidth:v}=y,I=o??t.sliceId,_=L(this.url,I),S=`${d}/${g}/${x}`;let R=W(_,null,S);null==R&&(R=this.fetchRawTile(d,g,x,t),q(_,null,S,R));const T=await R;if(null==T||!T.pixels?.length)return{location:p,value:null};const C=w*v+b;return this._processIdentifyResult(T,{srcLocation:p,position:C,pyramidLevel:d,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,n={}){e=(0,N.Fi)(e),n=this._getRequestOptionsWithSliceId(n);const{_hasNoneOrGCSShiftTransform:s}=this;if(n.requestRawData&&s)return this._fetchPixels(e,t,i,n);const r=(0,N.ut)(e.spatialReference),a=(0,N.Hq)(e);if(null==r||0===a||1===a&&this._isGlobalWrappableSource&&s)return this._fetchPixels(e,t,i,n);if(a>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:l,xmax:c}=e,u=Math.round(r/(c-l)*t),h=u-Math.round((r/2-l)/(c-l)*t);let f=0;const p=[];for(let s=0;s<=a;s++){const d=new X.Z({xmin:0===s?l:-r/2,xmax:s===a?c-r*s:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===s?u-h:s===a?t-f:u;f+=m,p.push(m);const y=n.disableWrapAround&&s>0?null:this._fetchPixels(d,m,i,n);o.push(y)}const d=(await Promise.all(o)).map((e=>e?.pixelBlock));let m=null;const y={width:t,height:i};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:p},n)).pixelBlock:(0,$.us)(d,y,{blockWidths:p}),{extent:e,srcExtent:(0,N.tB)(e,this.rasterInfo.spatialReference,n.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,n={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const s=await this._fetchRawTiles(e,t,i,n),{nativeExtent:r,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**e,c=a.x*l,u=a.y*l,h=new X.Z({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!s)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:p}=s;if(1===f.length&&null!=f[0]&&f[0].width===i.width&&f[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:s.pixelBlocks[0]};const d=e>0?o.pyramidBlockWidth:o.blockWidth,m=e>0?o.pyramidBlockHeight:o.blockHeight,y={x:t.x%d,y:t.y%m};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:p,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:n.interpolation,alignmentInfo:null,blockWidths:null},n)).pixelBlock:(0,$.us)(f,p,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,i,n){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,N.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,U.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:n}=this.ioConfig,{range:s,query:r,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await(0,I.Z)(e,{...t,query:{...r,...n},headers:{...a,...o}})}catch(n){if(i>0)return i--,this.request(e,t,i);throw n}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,A.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,n){const s=n.lodAt(e);return this.getTileExtent({x:s.resolution,y:s.resolution},t,i,n.origin,n.spatialReference,n.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:n}=this.rasterInfo;if(!e.tileInfo){const s=[],r=e.maximumPyramidLevel||0;let a=Math.max(n.x,n.y),o=1/.0254*96*a;for(let e=0;e<=r;e++)s.unshift(new D.Z({level:r-e,resolution:a,scale:o})),a*=2,o*=2;const l=new B.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new O.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:s}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,n){const{width:s,height:r,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new B.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==n&&(n=Math.max(0,Math.round(Math.log(Math.max(s,r))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],n);e.storageInfo=new z.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:n,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,n,s,r=0,a=2){if(1===s.length&&r>0){s=[...s];let{x:e,y:t}=s[0];for(let i=0;i<r;i++)e*=a,t*=a,s.push({x:e,y:t})}const o=[],{x:l,y:c}=n;for(let n=0;n<s.length;n++){const{x:r,y:a}=s[n];o.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:n}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const s=n**e;return{x:t.x*s,y:t.y*s}}identifyPixelLocation(e,t,i,n){const{spatialReference:s,nativeExtent:r,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:o,origin:l,transposeInfo:c}=a,u=n&&null!=c?c.tileSize[0]:a.blockWidth,h=n&&null!=c?c.tileSize[1]:a.blockHeight,f=(0,N.nF)(e,s,i);if(!r.intersects(f))return null;if(t<0||t>o)return null;const p=this.getPyramidPixelSize(t),{x:d,y:m}=p,y=(l.y-f.y)/m/h,g=(f.x-l.x)/d/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),w=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:w,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,n,s,r){const[a,o]=r,l=n.x+i*a*e.x,c=l+a*e.x,u=n.y-t*o*e.y,h=u-o*e.y;return new X.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:s})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const n=this.rasterInfo.storageInfo.blockBoundary[e];return!n||n.maxRow<t||n.maxCol<i||n.minRow>t||n.minCol>i}async _fetchPixels(e,t,i,n={}){let s=(0,N.Hq)(e);if(s>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,n),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:l,pixelBlock:null};const{rasterInfo:f}=this,p=f.transform,d="gcs-shift"===p?.type,m=null!=(0,N.ut)(e.spatialReference);!d&&m||(s=(0,N.Hq)(r.srcExtent,d));const y=await this._fetchRawTiles(a,h,{width:c,height:u,wrapCount:s},n);if(!y)return{extent:e,srcExtent:l,pixelBlock:null};const g=f.storageInfo,x=a>0?g.pyramidBlockWidth:g.blockWidth,w=a>0?g.pyramidBlockHeight:g.blockHeight;let{x:b,y:v}=f.pixelSize;if(a>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=g;if(null!=e&&e[a-1])({x:b,y:v}=e[a-1]);else{const e=t**a;b*=e,v*=e}}const I=f.spatialReference,_=new B.Z({x:b,y:v,spatialReference:I}),S=x===c&&w===u&&h.x%x==0&&h.y%w==0,R=new B.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(I),C=I.isGeographic?1e-9:1e-4,{datumTransformation:k}=n;if(!T&&S&&1===y.pixelBlocks.length&&x===t&&w===i&&this._isSameResolution(o,R,C))return{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:y.pixelBlocks[0]};const M=m&&null!=(0,N.ut)(l.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=n.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,N.zD)();const O=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:R.toJSON(),datumTransformation:k,rasterTransform:p,hasWrapAround:s>0||M,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},n):(0,N.Qp)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:R,datumTransformation:k,rasterTransform:p,hasWrapAround:s>0||M,isAdaptive:!1,includeGCSGrid:F});let P;const Z=!n.requestRawData,D={rows:O.spacing[0],cols:O.spacing[1]},z=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,y.extent.xmin):void 0,{pixelBlocks:A,mosaicSize:E,isPartiallyFilled:J}=y;let L=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:A,srcMosaicSize:E,destDimension:Z?{width:t,height:i}:null,coefs:Z?O.coefficients:null,sampleSpacing:Z?D:null,projectDirections:F,gcsGrid:F?O.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:n.interpolation,alignmentInfo:z,blockWidths:null},n);({pixelBlock:P,localNorthDirections:L}=e)}else{const e=(0,$.us)(A,E,{alignmentInfo:z});P=Z?(0,$.Uk)(e,{width:t,height:i},O.coefficients,D,n.interpolation):e,F&&O.gcsGrid&&(L=(0,$.Qh)({width:t,height:i},O.gcsGrid),P=(0,V.xQ)(P,this.rasterInfo.dataType,L))}return n.requestRawData||F?{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:P,transformGrid:O,localNorthDirections:L,isPartiallyFilled:J}:{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:P}}async _fetchRawTiles(e,t,i,n){const{origin:s,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(e);let{x:l,y:c}=t,{width:u,height:h,wrapCount:f}=i;const p=this._getRasterTileAlignmentInfo(e,0);n.buffer&&(l-=n.buffer.cols,c-=n.buffer.rows,u+=2*n.buffer.cols,h+=2*n.buffer.rows);let d=0,m=0,y=0;f&&null!=p&&(({worldColumnCountFromOrigin:m,originColumnOffset:y,rightPadding:d}=p),m*p.blockWidth-d>=l+u&&(d=0));const g=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+u+d-1)/a),b=Math.floor((c+h+d-1)/o),v=r[e];if(!v)return null;const{minRow:I,minCol:_,maxCol:S,maxRow:R}=v;if(0===f&&(b<I||w<_||x>R||g>S))return null;const T=new Array;let C=!1;const k=null==this.ioConfig.allowPartialFill?n.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=x;t<=b;t++)for(let i=g;i<=w;i++){let s=i;if(!n.disableWrapAround&&f&&null!=p&&m<=i&&(s=i-m-y),t>=I&&s>=_&&R>=t&&S>=s){const i=this._fetchRawTile(e,t,s,n);k?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{C=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const M=await Promise.all(T),F={height:(b-x+1)*o,width:(w-g+1)*a},{spatialReference:O}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:Z,y:D}=P;return{extent:new X.Z({xmin:s.x+g*a*Z,xmax:s.x+(w+1)*a*Z,ymin:s.y-(b+1)*o*D,ymax:s.y-x*o*D,spatialReference:O}),pixelBlocks:M,mosaicSize:F,isPartiallyFilled:C}}_isSameResolution(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}_fetchRawTile(e,t,i,n){const s=this.rasterInfo.storageInfo.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:a,maxCol:o,maxRow:l}=s;if(t<r||i<a||t>l||i>o)return Promise.resolve(null);const u=L(this.url,n.sliceId),h=`${e}/${t}/${i}`;let f=W(u,n.registryId,h);if(null==f){const s=new AbortController;f=this.fetchRawTile(e,t,i,{...n,signal:s.signal}),q(u,n.registryId,h,f,s),f.catch((()=>j(u,n.registryId,h)))}return n.signal&&(0,c.fu)(n,(()=>{H(u,n.registryId,h)})),f}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const n=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[s,r]=e,a=[],o=[];for(let e=0;e<n;e++){const[t,i]=(0,V.Tg)([s[e],r[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,N.P_)(this.rasterInfo)),null==this._rasterTileAlighmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,n={}){const s={datumTransformation:n.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};n.srcResolution&&(s.srcResolution=n.srcResolution,this._updateSourceDataInfo(e,s));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=s,c=a/t,u=o/i,h=l<r&&c*u>=16,f=l===r&&this._requireTooManySrcTiles(a,o,t,i);if(h||f||0===a||0===o){const a=new B.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,N.VO)(a,this.rasterInfo.spatialReference,e,s.datumTransformation);const f=!o||n.srcResolution&&o.x+o.y<n.srcResolution.x+n.srcResolution.y;if(h&&n.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-l+3>=e){const t=2**e;o={x:n.srcResolution.x*t,y:n.srcResolution.y*t}}}o&&(s.srcResolution=o,this._updateSourceDataInfo(e,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,t,i)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(e,t,i,n){const{tileInfo:s}=this.rasterInfo.storageInfo;return Math.ceil(e/s.size[0])*Math.ceil(t/s.size[1])>=256||e/i>8||t/n>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,n=i.spatialReference,{srcResolution:s,datumTransformation:r}=t,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=(0,N.kr)(s,i,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,N.tB)(e,n,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:f}=i.storageInfo.origin,p=Math.floor((c.xmin-h)/o.x+.1),d=Math.floor((f-c.ymax)/o.y+.1),m=Math.floor((c.xmax-h)/o.x-.1),y=Math.floor((f-c.ymin)/o.y-.1),g=c.width<.1*o.x?0:m-p+1,x=c.height<.1*o.y?0:y-d+1;t.pyramidLevel=a,t.pyramidResolution=o,t.srcWidth=g,t.srcHeight=x,t.ul={x:p,y:d}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:n,pyramidLevel:s,useTransposedTile:r}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[n])return{location:i,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(null==o||!r){const t=e.pixels.map((e=>e[n])),r={location:i,value:t,pyramidLevel:s},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(r.magdirValue=a.map((e=>e[0]))),r}let l=e.pixels.map((e=>e.slice(n*a,n*a+a))),c=this._computeMagDirValues(l);const{requestSomeSlices:u,identifyOptions:h}=t;let f=(0,A.MO)(o,h.transposedVariableName);if(u){const e=(0,A.Ur)(f,h.multidimensionalDefinition,h.timeExtent);l=l.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),f=e.map((e=>f[e]))}const p=e.noDataValues||this.rasterInfo.noDataValue,d={pixels:l,pixelType:e.pixelType};let m;return null!=p&&((0,G.A)(d,p),m=d.mask),{location:i,value:null,dataSeries:f.map(((e,t)=>{const i={value:0===m?.[t]?null:l.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new C.Z({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:s}}};(0,n._)([(0,h.Cb)()],Y.prototype,"_rasterTileAlighmentInfo",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"_isGlobalWrappableSource",null),(0,n._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"_hasNoneOrGCSShiftTransform",null),(0,n._)([(0,h.Cb)()],Y.prototype,"rasterJobHandler",null),(0,n._)([(0,h.Cb)(T.HQ)],Y.prototype,"url",null),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetName",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"hasUniqueSourceStorageInfo",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"sourceJSON",void 0),Y=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.BaseRaster")],Y);const K=Y;var Q=i(74889);let ee=class extends K{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){await this.init();const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:n}=this.primaryRasters,s=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(s);const r=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:r,rasterIds:n});if(!o.success||0===r.length)throw new a.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);const l="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===l?.functionName&&(t.rasterInfo.attributeTable=Q.Z.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=r[0];this.hasUniqueSourceStorageInfo=1===r.length||r.slice(1).every((e=>this._hasSameStorageInfo(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,t,i,n={}){const{rasters:s,rasterIds:r}=this.primaryRasters;let a=!1;const{interpolation:o}=n,l=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!n.requestRawData&&"bilinear"!==o&&l&&(a=1===s.length&&!n.skipRasterFunction,n={...n,interpolation:"bilinear",requestRawData:a});const c=s.map((s=>s.fetchPixels(e,t,i,n))),u=await Promise.all(c),h=u.map((e=>e.pixelBlock)),f=a||n.requestRawData?u.map((e=>e.srcTilePixelSize)):null;if(n.skipRasterFunction||h.every((e=>null==e)))return u[0];const p=u.find((e=>null!=e.pixelBlock))?.extent??e,d=this.rasterJobHandler?await this.rasterJobHandler.process({extent:p,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:p,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}),{transformGrid:m}=u[0];if(!a||null==d||null==m)return{...u[0],pixelBlock:d};const y={rows:m.spacing[0],cols:m.spacing[1]};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[d],srcMosaicSize:{width:d.width,height:d.height},destDimension:{width:t,height:i},coefs:m.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},n)).pixelBlock:(0,$.Uk)(d,{width:t,height:i},m.coefficients,y,o),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:g}}_hasSameStorageInfo(e,t){const{storageInfo:i,pixelSize:n,spatialReference:s,extent:r}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return n.x===o.x&&n.y===o.y&&s.equals(l)&&r.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ee.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"tileType",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"rasterFunction",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"primaryRasters",void 0),ee=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.FunctionRaster")],ee);const te=ee;var ie=i(67900),ne=i(5847);var se=i(5154),re=i(15612),ae=i(67058),oe=i(72758),le=i(79681),ce=i(23808),ue=i(82971);const he=o.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),fe=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster="Function"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.rasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,R.Nm)(e,he))}set renderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("renderer",e),this.updateRenderer())}readRenderer(e,t,i){const n=t?.layerDefinition?.drawingInfo?.renderer;return(0,v.ij)(n,i)||void 0}async convertVectorFieldData(e,t){if(null==e||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,V.KC)(e,n)}async computeStatisticsHistograms(e,t){e=(0,f.TJ)(le.Z,e).clone();const{rasterInfo:n}=this,{geometry:s}=e;if(null==s)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=n;s.spatialReference.equals(o)||(await(0,N.zD)(),r="extent"===s.type?(0,N.tB)(s,o):(0,N.Wt)(s,o));const l=e.pixelSize??new B.Z({x:n.pixelSize.x,y:n.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=function(e,t,i,n=!0){const{spatialReference:s}=e,{x:r,y:a}=function(e,t){if(e.spatialReference.equals(t))return e;const i=(0,ie.c9)(e.spatialReference),n=(0,ie.c9)(t);if(i===n)return e;const s=i/n;return{x:e.x*s,y:e.y*s}}(i,s);let o,l,c;const u="extent"===t.type?t:t.extent;let{xmin:h,xmax:f,ymax:p,ymin:d}=u;const{xmin:m,ymax:y}=e.extent;return n?(h=m+(h>m?r*Math.round((h-m)/r):0),p=y-(p<y?a*Math.round((y-p)/a):0),f=m+(f>m?r*Math.round((f-m)/r):0),d=y-(d<y?a*Math.round((y-d)/a):0),o=new X.Z({xmin:h,ymax:p,xmax:f,ymin:d,spatialReference:s}),l=Math.round(o.width/r),c=Math.round(o.height/a)):(l=Math.floor((f-h)/r+.8),c=Math.floor((p-d)/a+.8),h=m+(h>m?r*Math.floor((h-m)/r+.1):0),p=y-(p<y?a*Math.floor((y-p)/a+.1):0),f=h+l*r,d=p-c*a,o=new X.Z({xmin:h,ymax:p,xmax:f,ymin:d,spatialReference:s})),{extent:o,width:l,height:c}}(n,r,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const d=await async function(e,t,n){if("extent"===n.type)return function(e,t,i){const{width:n,height:s}=e,r=new Uint8Array(n*s),a=t.width/n,o=t.height/s;if(i.width/a<.5||i.height/o<.5)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});const{xmin:l,xmax:c,ymin:u,ymax:h}=t,{xmin:f,xmax:p,ymin:d,ymax:m}=i,y=Math.max(l,f),g=Math.min(c,p),x=Math.max(u,d),w=Math.min(h,m),b=.5*a,v=.5*o;if(g-y<b||w-x<v||g<l+b||y>c-b||x>h-v||w<u+v)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});const I=Math.max(0,(y-l)/a),_=Math.min(n,Math.max(0,(g-l)/a)),S=Math.max(0,(h-w)/o),R=Math.min(s,Math.max(0,(h-x)/o)),T=Math.round(I),C=Math.round(_)-1,k=Math.round(S),M=Math.round(R)-1;if(T===C&&I%1>.5&&_%1<.5||k===M&&S%1>.5&&R%1<.5)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});if(0===T&&0===k&&C===n&&M===s)return e;const F=e.mask;for(let e=k;e<=M;e++)for(let t=T;t<=C;t++){const i=e*n+t;r[i]=F?F[i]:255}return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]})}(e,t,n);const{width:s,height:r}=e,a=new Uint8Array(s*r),{contains:o,intersects:l}=await Promise.all([i.e(5837),i.e(1433)]).then(i.bind(i,61433));return l(t,n)?"polyline"===n.type?function(e,t,i){const{width:n,height:s}=e,r=new Uint8Array(n*s),a=t.width/n,o=t.height/s,{xmin:l,ymax:c}=t,{paths:u}=i,h=e.mask;for(let e=0;e<u.length;e++){const t=u[e];for(let e=0;e<t.length-1;e++){const[i,u]=t[e],[f,p]=t[e+1];let d=Math.floor((c-u)/o),m=Math.floor((c-p)/o);if(m<d){const e=d;d=m,m=e}d=Math.max(0,d),m=Math.min(s-1,m);const y=(f-i)/(p-u);for(let e=d;e<=m;e++){const t=e===d?Math.max(u,p):(s+1-e)*o,c=e===m?Math.min(u,p):t-o;let g=p===u?Math.floor((i-l)/a):Math.floor((y*(t-u)+i-l)/a),x=p===u?Math.floor((f-l)/a):Math.floor((y*(c-u)+i-l)/a);if(x<g){const e=g;g=x,x=e}const w=e*n;g=Math.max(0,g),x=Math.min(n-1,x);for(let e=w+g;e<=w+x;e++)r[e]=h?h[e]:255}}}return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]})}(e,t,n):o(n,t)?e:function(e,t,i){if(!e)return e;const{width:n,height:s}=e,r=t.width/n,a=t.height/s,{xmin:o,ymax:l}=t;let c;if("extent"===i.type){const e=(i.xmin-o)/r,t=(i.xmax-o)/r,n=(l-i.ymax)/a,s=(l-i.ymin)/a;c=[[[e,n],[e,s],[t,s],[t,n],[e,n]]]}else c=i.rings.map((e=>e.map((([e,t])=>[(e-o)/r,(l-t)/a]))));const u=document.createElement("canvas");u.width=n,u.height=s;const h=u.getContext("2d");h.fillStyle="#f00",c.forEach((e=>{h.beginPath(),h.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)h.lineTo(e[t][0],e[t][1]);h.closePath(),h.fill()}));const f=h.getImageData(0,0,n,s).data,p=e.mask,d=n*s,m=new Uint8Array(d);for(let e=0;e<d;e++)p&&!p[e]||(m[e]=f[4*e+3]>127?255:0);return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:m,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,n):new ne.Z({pixelType:e.pixelType,width:s,height:r,mask:a,maskIsAlpha:!1,pixels:[...e.pixels]})}(p.pixelBlock,c,r),m=this._rasterJobHandler.instance;return m?m.computeStatisticsHistograms({pixelBlock:d},t):(0,re.js)(d)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,ce.GE)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if(null==t)return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;null!=i&&i.length||(i=(0,A.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=e.timeExtent||this.timeExtent;if(null!=i&&null!=n&&(null!=n.start||null!=n.end)){i=i.map((e=>e.clone()));const s=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),r=i.find((({dimensionName:e})=>"StdTime"===e));if(!s||!r)return{...e,multidimensionalDefinition:null};const{start:a,end:o}=n,l=null==a?null:a.getTime(),c=null==o?null:o.getTime(),u=l??c,h=c??l;if(null!=s.values){const e=s.values.filter((e=>{if(Array.isArray(e)){if(u===h)return e[0]<=u&&e[1]>=u;const t=e[0]<=u&&e[1]>u||e[0]<h&&e[1]>=h,i=e[0]>=u&&e[1]<=h||e[0]<u&&e[1]>h;return t||i}return u===h?e===u:e>=u&&e<=h}));if(e.length){const t=e.sort(((e,t)=>{const i=Array.isArray(e)?e[0]:e,n=Array.isArray(e)?e[1]:e,s=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:t;return u===h?i-s:Math.abs(n-h)-Math.abs(r-h)}))[0];r.values=[t]}else i=null}else if(s.hasRegularIntervals&&s.extent){const[e,t]=s.extent;u>t||h<e?i=null:r.values=u===h?[u]:[Math.max(e,u),Math.min(t,h)]}}return null!=i&&(0,A.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRasterFunction(){if(!this.loaded||"imagery-tile"!==this.type||!this.rasterFunction&&!this._cachedRasterFunctionJson||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){const e=this.raster.rasterFunction.toJSON();return!this.rasterFunction&&e&&this._set("rasterFunction",M.Z.fromJSON(e)),void(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON())}let e,t=this.raster,i=!1;"Function"===t.datasetFormat?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:n}=this;if(n){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=(0,se.Ue)(n.functionDefinition?.toJSON()??n.toJSON(),i),r=new te({rasterFunction:s});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=r}else this.raster=t,this._cachedRasterFunctionJson=null,await t.when();if(this._cachedRendererJson=null,!i&&!n)return;const{bandIds:s}=this,{bandCount:r}=this.raster.rasterInfo,a=s?.length?s.some((e=>e>=r)):r>=3;s&&(a||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:i}=this.raster,n=(0,A.WY)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=n?.name,r=(0,ae.ol)({...this.renderer.toJSON(),variableName:s});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(r))return;const a=this._rasterJobHandler.instance;a&&(t.rasterInfo=(0,ae.FI)(i,s),t.rendererJSON=r,t.bind(),await a.updateSymbolizer(t),this._cachedRendererJson=r)}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let n;await this.updateRenderer();const s=this._rasterJobHandler.instance,r=this.bandIds??[];return n=s?await s.symbolize({...e,simpleStretchParams:t,bandIds:r}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:r}),n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,S.C5)(e);return O.Z.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,n={}){if(s(this),n.requestAsImageElement){const s=this.getTileUrl(e,t,i);return(0,I.Z)(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then((e=>e.data))}const{rasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const s=n.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,s),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,n)}async fetchPixels(e,t,i,n={}){return null!=this.rasterInfo.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,n))}async identify(e,t={}){const{raster:i,rasterInfo:n}=this;if(null!=n.multidimensionalInfo&&!(n.hasMultidimensionalTranspose&&((0,A.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const s=this.multidimensionalSubset?.areaOfInterest;if(s&&!s.contains(e))throw new a.Z("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo?.multidimensionalInfo;return(0,A.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,A.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&"Function"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new F.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{s(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){s(this);const{raster:e}=this,t=(0,ae.In)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){s(this);const{rasterInfo:t}=this.raster;!this.bandIds&&t.bandCount>1&&(this.bandIds=(0,ae.YD)(t));const i=(0,A.WY)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=i?.name;if(!this.renderer||"override"===e){const e=(0,ae.Ob)(t,{bandIds:this.bandIds,variableName:n}),i=t.statistics,s=i&&i.length>0?i[0]:null,r=s?.max??0,a=s?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===e.type&&(r>1e24||a<-1e24)&&(e.dynamicRangeAdjustment=!0,e.statistics=null,"none"===e.stretchType&&(e.stretchType="min-max")),this.renderer=e}const r=(0,ae.ol)({...this.renderer.toJSON(),variableName:n}),a=(0,ae.FI)(t,n);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=a):this.symbolizer=new oe.Z({rendererJSON:r,rasterInfo:a});const o=this.symbolizer.bind();if(o.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,ae.Ob)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.statistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else he.warn("imagery-tile-mixin",o.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}};function s(e){if(!e.raster||!e.rasterInfo)throw new a.Z("imagery-tile","no raster")}return(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,n._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,n._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)({type:[C.Z],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,n._)([(0,h.Cb)({type:k.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,h.Cb)({type:M.Z,json:{name:"renderingRule",write:!0}})],t.prototype,"rasterFunction",null),(0,n._)([(0,h.Cb)()],t.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:ue.Z,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,n._)([(0,h.Cb)({type:O.Z})],t.prototype,"tileInfo",void 0),(0,n._)([(0,h.Cb)(T.HQ)],t.prototype,"url",null),(0,n._)([(0,h.Cb)({types:v.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:v.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,n._)([(0,_.r)("renderer")],t.prototype,"readRenderer",null),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,n._)([(0,y.j)("esri.layers.ImageryTileMixin")],t),t};var pe=i(38009),de=i(16859),me=i(34760),ye=i(72965),ge=i(28294),xe=i(1231),we=i(69608),be=i(25972),ve=i(20095);function Ie(e){const t=e.fields,i=e.records,n=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",s=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),r=s.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[n]=o++,l=1;l<r.length;l++)t[r[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:s,features:a}}class _e{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const n=t.getUint32(4,!0),s=t.getUint16(8,!0),r=t.getUint16(10,!0),a={version:i,recordCount:n,headerByteCount:s,recordByteCount:r};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ve.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<n&&e.byteLength-o>r;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,ve.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const n=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=r}}return{header:a,fields:l,records:c,recordSet:Ie({fields:l,records:c})}}}var Se=i(87521);const Re=new Map;Re.set("int16","esriFieldTypeSmallInteger"),Re.set("int32","esriFieldTypeInteger"),Re.set("int64","esriFieldTypeInteger"),Re.set("float32","esriFieldTypeSingle"),Re.set("float64","esriFieldTypeDouble"),Re.set("text","esriFieldTypeString");let Te=class extends K{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:n}=this._parseHeader(t);if("thematic"===n.dataType){const e=await this._fetchAuxiliaryInformation();n.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",n),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,n={}){const{transposeInfo:s}=this.rasterInfo.storageInfo,{transposedVariableName:r}=n,a=!(!s||!r),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,n.multidimensionalDefinition,r),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:n.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const p=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:n.signal});if(!p)return null;const[d,m]=this._getTileSize(a);return this.decodePixelBlock(p.data,{width:d,height:m,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,colormap:n,blockWidth:s,blockHeight:r,firstPyramidLevel:a,maximumPyramidLevel:o}=e,l=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),c=e.histograms?.[0]?.counts?.length?e.histograms:null,u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ue.Z(u?.wkid||u?.wkt||u?.wkt2?u:h);let p=new X.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const d=new B.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),m=Math.round((p.xmax-p.xmin)/d.x),y=Math.round((p.ymax-p.ymin)/d.y),g=this._parseTransform(e.geodataXform),x=g?p:null;g&&(p=g.forwardTransform(p),d.x=(p.xmax-p.xmin)/m,d.y=(p.ymax-p.ymin)/y);const w=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),v=new B.Z(e.origin.x,e.origin.y,f);let I,_,S,R;if(n&&n.colors)for(I=[],_=0;_<n.colors.length;_++)S=n.colors[_],R=n.values?n.values[_]:_,I.push([R,255&S,S<<16>>>24,S<<8>>>24,S>>>24]);const T=e.LODInfos,C=[];for(_=0;_<T.levels.length;_++)C.push(new D.Z({level:T.levels[_],resolution:T.resolutions[_],scale:96/.0254*T.resolutions[_]}));const k=new O.Z({dpi:96,lods:C,format:b,origin:v,size:[s,r],spatialReference:f}),M={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},F=[{maxCol:Math.ceil(m/s)-1,maxRow:Math.ceil(y/r)-1,minCol:0,minRow:0}];let P=2;if(o>0)for(_=0;_<o;_++)F.push({maxCol:Math.ceil(m/P/s)-1,maxRow:Math.ceil(y/P/r)-1,minCol:0,minRow:0}),P*=2;const Z=e.mdInfo;let A=null;if(Z&&w._yxs){const e=w._yxs;A={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:M,rasterInfo:new be.Z({width:m,height:y,pixelType:t,bandCount:i,extent:p,nativeExtent:x,transform:g,spatialReference:f,pixelSize:d,keyProperties:w,statistics:l,histograms:c,multidimensionalInfo:Z,colormap:I,storageInfo:new z.Z({blockWidth:s,blockHeight:r,pyramidBlockWidth:s,pyramidBlockHeight:r,origin:v,tileInfo:k,transposeInfo:A,firstPyramidLevel:a,maximumPyramidLevel:o,blockBoundary:F})})}}_parseTransform(e){if(!(0,Se.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,Se.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),i=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),n=await Promise.all([t,i]);let s;if(n[0]){let e=n[0].fields;const t=n[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":Re.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(s={fields:e,features:i})}}return!s&&n[1]&&(s=_e.parse(n[1]).recordSet),Q.Z.fromJSON(s)}_buildCacheFilePath(e,t,i,n,s){const r=this._getPackageSize(!!s),a=Math.floor(t/r)*r,o=Math.floor(i/r)*r,l="R"+this._toHexString4(a)+"C"+this._toHexString4(o);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=n?.[0];if(null==u||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let f="_yxs";if(!s){f=u.variables.find((e=>e.name===h.variableName)).dimensions[0].values.indexOf(h.values[0]).toString(16);const e=4-f.length;for(let t=0;t<e;t++)f="0"+f;f="S"+f}const p=this._getVariableFolderName(s||h.variableName);return`${this.url}/_alllayers/${p}/${f}/${c}/${l}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&null!=t?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&null!=i?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replaceAll(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const n=this._getPackageSize(i),s=n*(e%n)+t%n;if(s<0)throw new Error("Invalid level / row / col");return 20+s*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let n,s=0;for(n=0;n<5;n++)s|=(255&i[n])<<8*n;const r=0xffffffffff&s;for(s=0,n=5;n<8;n++)s|=(255&i[n])<<8*(n-5);return{position:r,recordSize:0xffffffffff&s}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,n._)([(0,h.Cb)({readOnly:!0})],Te.prototype,"storageInfo",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.CloudRaster")],Te);const Ce=Te;let ke=class extends K{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:n,histograms:s,name:r,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=i,f=t.extent??new X.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ue.Z({wkid:3857})}),p=t.isPseudoSpatialReference??!t.extent,d={x:f.width/c,y:f.height/u},m=new be.Z({width:c,height:u,pixelType:h,extent:f,nativeExtent:o,transform:l,pixelSize:d,spatialReference:f.spatialReference,bandCount:i.pixels.length,keyProperties:a||{},statistics:n,isPseudoSpatialReference:p,histograms:s});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=r,this.url="/InMemory/"+r}fetchRawTile(e,t,i,n={}){const s=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(s)}async _buildInMemoryRaster(e,t,i){const n=this.rasterInfo.storageInfo.maximumPyramidLevel,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n},i):Promise.resolve((0,$.Vl)(e,t,n)),r=null!=this.rasterInfo.statistics,o=null!=this.rasterInfo.histograms,l=r?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,re.Hv)(e)),u=await(0,c.as)([s,l]);if(!u[0].value&&u[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,r||(this.rasterInfo.statistics=u[1].value?.statistics),o||(this.rasterInfo.histograms=u[1].value?.histograms)}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ke.prototype,"data",void 0),ke=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],ke);const Me=ke;function Fe(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const s=Fe(e,i);for(let e=0;e<s.length;e++)Fe(s[e],t).forEach((e=>n.push(e)));return n}const s=e.getElementsByTagNameNS("*",i);if(!s||0===s.length)return[];for(let e=0;e<s.length;e++)n.push(s[e]||s.item(e));return n}function Oe(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=Fe(e,i);return n.length>0?t?Oe(n[0],t):n[0]:null}function Pe(e,t=null){const i=t?Oe(e,t):e;let n;return i?(n=i.textContent||i.nodeValue,n?n.trim():null):null}function Ze(e,t){return function(e,t){const i=Fe(e,t),n=[];let s;for(let e=0;e<i.length;e++)s=i[e].textContent||i[e].nodeValue,s&&(s=s.trim(),""!==s&&n.push(s));return n}(e,t).map((e=>Number(e)))}function De(e,t){const i=Pe(e,t);return Number(i)}function ze(e,t){const i=e?.nodeName?.toLowerCase(),n=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===n}var Ae=i(87390);function Ne(e,t){if(!e||!t)return null;const i=[];for(let n=0;n<e.length;n++)i.push(e[n]),i.push(t[n]);return i}function Be(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ue.Z({wkid:t});if(e=String(e).trim(),(0,S.xl)(e))return new ue.Z({wkt2:e});const i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;const n=i.indexOf("VERTCS"),s=i.indexOf("PROJCS"),r=s>-1?s:i.indexOf("GEOGCS");if(-1===r)return null;const a=e.slice(r,e.lastIndexOf("]",n)+1).trim(),o=e.slice(n,e.lastIndexOf("]")).trim();t=Ee(a);const l=new ue.Z(t?{wkid:t}:{wkt:a}),c=Ee(o);return c&&(l.vcsWkid=c),l}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=Ee(e),new ue.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ee(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),n=i[0]?.toLowerCase();if(("epsg"===n||"esri"===n)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Je(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(ze(e,"SRS")){if(!t.spatialReference){const i=Pe(e);t.spatialReference=Be(i)}}else if(ze(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:n}=function(e){const t=Oe(e,"GeodataXform"),i=Be(De(t,"SpatialReference/WKID")||Pe(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const n=De(t,"PolynomialOrder")??1,s=Ze(t,"CoeffX/Double"),r=Ze(t,"CoeffY/Double"),a=Ze(t,"InverseCoeffX/Double"),o=Ze(t,"InverseCoeffY/Double"),l=Ne(s,r),c=Ne(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Ae.Z({spatialReference:i,polynomialOrder:n,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=n,t.spatialReference||(t.spatialReference=i)}else Fe(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Pe(e)));else if(ze(e,"PAMRasterBand")){const i=function(e){const t=De(e,"NoDataValue"),i=Oe(e,"Histograms/HistItem"),n=De(i,"HistMin"),s=De(i,"HistMax"),r=De(i,"BucketCount"),a=Pe(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Fe(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=De(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=n&&null!=s?{min:n,max:s,size:r||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(p.pC):null;const n=!!i[0].histogram;t.histograms=n?i.map((e=>e.histogram)).filter(p.pC):null}return t}let Le=class extends K{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:n,histograms:s,transform:r}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ue.Z({wkid:3857})),s?.length&&null==n&&(n=(0,re.Oh)(s));const{width:o,height:l}=t;let c=new X.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=r?r.forwardTransform(c):c;let h=!0;if(r){const e=r.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(r=null,c=u)}const f=new Me({data:{extent:u,nativeExtent:c,transform:r,pixelBlock:t,statistics:n,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,i,n={}){return this._inMemoryRaster.fetchRawTile(e,t,i,n)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,U.y)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const n=i.toLowerCase(),s="gif"===n||"bmp"===n||!(0,d.Z)("ios"),r=await this.decodePixelBlock(t,{format:n,useCanvas:s,hasNoZlibMask:!0});if(null==r)throw new a.Z("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(e){const t=e?.signal,i=this.ioConfig.skipExtensions??[],n=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,r="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,a=r&&i.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),o=await(0,c.as)([n,a]);if(t?.aborted)throw(0,c.zE)();const l=Je(o[0].value?.data);if(!l.transform){const e=o[1].value?o[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;l.transform=6===e?.length?new Ae.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return l}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Le.prototype,"datasetFormat",void 0),Le=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],Le);const He=Le;var We=i(70586),qe=i(17452),je=i(28589),Ge=i(29680),Ue=i(26059);let $e=class extends K{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const t=e&&e.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=i.data;if(this.sourceJSON=n,!n)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const s=await this._fetchRasterInfo({signal:t});if(null==s)throw new a.Z("image-server-raster:open","cannot initialize image service");(0,Ue.n$)(s,n);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:n,minLOD:s,maxLOD:r}=t;if(null!=s&&null!=r)return O.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=s&&e<=r))});if(0!==i&&0!==n){const t=e=>Math.round(1e4*e)/1e4,s=i?t(i):1/0,r=n?t(n):-1/0;return O.Z.fromJSON({...e,lods:e.lods.filter((e=>{const i=t(e.scale);return i<=s&&i>=r}))})}return O.Z.fromJSON(e)}(n.tileInfo,n):O.Z.fromJSON(n.tileInfo);(0,We.O3)(r);const[o,l]=this._computeMinMaxLOD(s,r),{extent:c,pixelSize:u}=s,h=.5/s.width*u.x,f=Math.max(u.x,u.y),{lods:p}=r;("Map"!==this.tileType&&0!==n.maxScale||Math.abs(u.x-u.y)>h||!p.some((e=>Math.abs(e.resolution-f)<h)))&&(u.x=u.y=o.resolution,s.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),s.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const d=o.level-l.level,[m,y]=r.size,g=[],x=[];p.forEach(((e,t)=>{e.level>=l.level&&e.level<=o.level&&g.push({x:e.resolution,y:e.resolution}),t<p.length-1&&x.push(Math.round(10*e.resolution/p[t+1].resolution)/10)})),g.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(c,m,y,r.origin,g,d),b=g.length>1?g.slice(1):null;let v;n.transposeInfo&&(v={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0});const I=x.length<=1||x.length>=3&&x.slice(0,-1).every((e=>e===x[0]))?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/d))/10;if(s.storageInfo=new z.Z({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:b,pyramidScalingFactor:I,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:r,transposeInfo:v,blockBoundary:w}),this._fixGCSShift(s),this._set("rasterInfo",s),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,qe.mN)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new je.y({layer:e})}}async fetchRawTile(e,t,i,n={}){const{storageInfo:s,extent:r}=this.rasterInfo,{transposeInfo:a}=s,o=null!=a&&!!n.transposedVariableName;if(this._slices&&!o&&null==n.sliceId)return null;const l=o?0:s.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:n.transposedVariableName}:{sliceId:n.sliceId||0}:null,{data:h}=await this.request(c,{query:u,responseType:"array-buffer",signal:n.signal});if(!h)return null;const f=o?a.tileSize:s.tileInfo.size,p=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==p)return null;const d=s.blockBoundary[e];if("jpg"!==s.compression||i>d.minCol&&i<d.maxCol&&t>d.minRow&&t<d.maxRow)return p;const{origin:m,blockWidth:y,blockHeight:g}=s,{x,y:w}=this.getPyramidPixelSize(e),b=Math.round((r.xmin-m.x)/x)%y,v=Math.round((r.xmax-m.x)/x)%y||y,I=Math.round((m.y-r.ymax)/w)%g,_=Math.round((m.y-r.ymin)/w)%g||g,S=i===d.minCol?b:0,R=t===d.minRow?I:0,T=i===d.maxCol?v:y,C=t===d.maxRow?_:g;return(0,$.pW)(p,{x:S,y:R},{width:T-S,height:C-R}),p}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),n=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,n]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let n=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let r=s-n+this._levelOffset;const a=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,n++,i=this.identifyPixelLocation(a,n,t.datumTransformation),null===i)return null}return-1===r||null==i?null:n}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),n=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),s=ue.Z.fromJSON(t.spatialReference||e.spatialReference),r=new B.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:s});return new be.Z({width:i,height:n,bandCount:3,extent:X.Z.fromJSON(e),spatialReference:s,pixelSize:r,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,n=(0,Ue.gh)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),s=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,r=await Promise.all([n,s]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ge.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,n=.5/e.width*i.x,{lods:s}=t,r=t.lodAt(Math.max.apply(null,s.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,s.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=s[0].level,[r,a];if("Raster"===o)return[s.find((e=>e.resolution===i.x))??r,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=r;c>0&&(u=s.find((e=>Math.abs(e.scale-c)<n)),u||(u=s.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??r));let h=a;return l>0&&(h=s.find((e=>Math.abs(e.scale-l)<n))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],$e.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],$e.prototype,"tileType",void 0),$e=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],$e);const Ve=$e;var Xe=i(48279);const Ye=new Map;Ye.set("Int8","s8"),Ye.set("UInt8","u8"),Ye.set("Int16","s16"),Ye.set("UInt16","u16"),Ye.set("Int32","s32"),Ye.set("UInt32","u32"),Ye.set("Float32","f32"),Ye.set("Float64","f32"),Ye.set("Double64","f32");const Ke=new Map;Ke.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ke.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ke.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ke.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Qe=class extends K{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:n,files:s}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(n.statistics=t.statistics??n.statistics,n.histograms=t.histograms,t.histograms&&null==n.statistics&&(n.statistics=(0,re.Oh)(t.histograms)))}this._set("rasterInfo",n),this._files=s;const r=await this.request(s.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(r.data);const{blockWidth:a,blockHeight:o}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:u}=this.rasterInfo,h=[],f=this._getBandSegmentCount();let p=0,d=-1;for(;p<this._storageIndex.length;){d++;const e=Math.ceil(c/a/l**d)-1,t=Math.ceil(u/o/l**d)-1;p+=(e+1)*(t+1)*f*4,h.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,d>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=d),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){const{blockWidth:s,blockHeight:r,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(s*r);return new ne.Z({width:s,height:r,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[];let y=0;for(y=0;y<d;y++)p&&!p.includes(y)||m.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:n.signal}));const g=await Promise.all(m),x=g.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),w=new Uint8Array(x);let b=0;for(y=0;y<d;y++)w.set(new Uint8Array(g[y].data),b),b+=g[y].data.byteLength;const v=Ke.get(this.rasterInfo.storageInfo.compression).decoderFormat,I=await this.decodePixelBlock(w.buffer,{width:s,height:r,format:v,planes:p?.length||l,pixelType:c});if(null==I)return null;let{noDataValue:_}=this.rasterInfo;if(null!=_&&"lerc"!==v&&!I.mask&&(_=_[0],null!=_)){const e=I.width*I.height,t=new Uint8Array(e);if(Math.abs(_)>1e24)for(y=0;y<e;y++)Math.abs((I.pixels[0][y]-_)/_)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)I.pixels[0][y]!==_&&(t[y]=1);I.mask=t}let S=0,R=0;if(h!==s||f!==r){let e=I.mask;if(e)for(y=0;y<r;y++)if(R=y*s,y<f)for(S=h;S<s;S++)e[R+S]=0;else for(S=0;S<s;S++)e[R+S]=0;else for(e=new Uint8Array(s*r),I.mask=e,y=0;y<f;y++)for(R=y*s,S=0;S<h;S++)e[R+S]=1}return I}_parseIndex(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,n,s,r,a;if(Xe.f){for(i=new Uint8Array(e),s=new ArrayBuffer(e.byteLength),n=new Uint8Array(s),r=0;r<e.byteLength/4;r++)for(a=0;a<4;a++)n[4*r+a]=i[4*r+3-a];t=new Uint32Array(s)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ke.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:n,blockHeight:s,pyramidScalingFactor:r}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,p=0;for(h=0;h<e;h++)p=r**h,c=Math.ceil(a/n/p),u=Math.ceil(o/s/p),f+=c*u;p=r**e,c=Math.ceil(a/n/p),u=Math.ceil(o/s/p),f+=t*c+i,f*=4*l;const d=this._storageIndex.subarray(f,f+4*l);let m=0,y=0;const g=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],y=m+d[4*e+2]*2**32+d[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<c-1?n:Math.ceil(a/p)-n*(c-1),actualTileHeight:t<u-1?s:Math.ceil(o/p)-s*(u-1)}}_parseHeader(e){const t=Oe(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const i=Oe(t,"Size"),n=parseInt(i.getAttribute("x"),10),s=parseInt(i.getAttribute("y"),10),r=parseInt(i.getAttribute("c"),10),o=(Pe(t,"Compression")||"none").toLowerCase();if(!Ke.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=Pe(t,"DataType")||"UInt8",c=Ye.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=Oe(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),p=Oe(t,"DataValues");let d,m;if(p&&(m=p.getAttribute("NoData"),null!=m&&(d=m.trim().split(" ").map((e=>parseFloat(e))))),Oe(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const y=Oe(e,"MRF_META/GeoTags"),g=Oe(y,"BoundingBox");let x,w=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),n=parseFloat(g.getAttribute("maxy")),s=Pe(y,"Projection")||"";let r=ue.Z.WGS84;if("LOCAL_CS[]"!==s)if(s.toLowerCase().startsWith("epsg:")){const e=Number(s.slice(5));isNaN(e)||0===e||(r=new ue.Z({wkid:e}))}else r=Be(s)??ue.Z.WGS84;else w=!0,r=new ue.Z({wkid:3857});x=new X.Z(e,t,i,n),x.spatialReference=r}else w=!0,x=new X.Z({xmin:-.5,ymin:.5-s,xmax:n-.5,ymax:.5,spatialReference:new ue.Z({wkid:3857})});const b=Oe(e,"MRF_META/Rsets"),v=parseInt(b&&b.getAttribute("scale")||"2",10),I=x.spatialReference,_=new z.Z({origin:new B.Z({x:x.xmin,y:x.ymax,spatialReference:I}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:v}),S=new B.Z({x:x.width/n,y:x.height/s,spatialReference:I}),R=new be.Z({width:n,height:s,extent:x,isPseudoSpatialReference:w,spatialReference:I,bandCount:r,pixelType:c,pixelSize:S,noDataValue:d,storageInfo:_}),T=Pe(e,"datafile"),C=Pe(e,"IndexFile");return{rasterInfo:R,files:{mrf:this.url,index:C||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Ke.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Je(t)}catch{return null}}};(0,n._)([(0,h.Cb)()],Qe.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],Qe.prototype,"_storageIndex",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Qe.prototype,"datasetFormat",void 0),Qe=(0,n._)([(0,y.j)("esri.layers.support.rasterIO.MRFRaster")],Qe);const et=Qe;var tt=i(94793),it=i(9832);const nt=(e,t)=>e.get(t)?.values,st=(e,t)=>e.get(t)?.values?.[0];let rt=class extends K{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:s,isBigTiff:r}=(0,tt.cK)(i),l=[];await this._readIFDs(l,i,n,s,0,r?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l),h=(0,tt.ee)(l),f=(0,tt.I7)(l);if(this._headerInfo={littleEndian:n,isBigTiff:r,ifds:l,pyramidIFDs:h,maskIFDs:f,...c},this._set("rasterInfo",u),!c.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new a.Z("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");u.isPseudoSpatialReference&&o.Z.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const p=l[0].get("PREDICTOR")?.values?.[0],d=l[0].get("SAMPLEFORMAT")?.values?.[0];if(3===d&&2===p)throw new a.Z("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data");const{skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}m.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),null!=u.attributeTable&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,n);if(null!=s&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(e,t,i,!0,n);null!=r&&r.pixels[0]instanceof Uint8Array&&(s.mask=r.pixels[0])}return s}_parseIFDs(e){const t=(0,tt.FI)(e),{width:i,height:n,tileWidth:s,tileHeight:r,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:p,affine:d,metadata:m}=t;let y=Be(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),g=!!t.isPseudoGeographic;null==y&&(g=!0,y=new ue.Z({wkid:3857}));const x=new X.Z({...t.extent,spatialReference:y}),w=new B.Z(x?{x:x.xmin,y:x.ymax,spatialReference:y}:{x:0,y:0}),b=new z.Z({blockWidth:s,blockHeight:r,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:w,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:p}),v=new B.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),I=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{};let _=null;const S=st(e[0],"PHOTOMETRICINTERPRETATION"),R=nt(e[0],"COLORMAP");if(S<=3&&R?.length>3&&R.length%3==0){_=[];const e=R.length/3;for(let t=0;t<e;t++)_.push([t,R[t]>>>8,R[t+e]>>>8,R[t+2*e]>>>8])}const T=new be.Z({width:i,height:n,bandCount:a,pixelType:o,pixelSize:v,storageInfo:b,spatialReference:y,isPseudoSpatialReference:g,keyProperties:I,extent:x,colormap:_,statistics:m?m.statistics:null});return d?.length&&(T.nativeExtent=new X.Z({xmin:-.5,ymin:.5-n,xmax:i-.5,ymax:.5,spatialReference:y}),T.transform=new Ae.Z({polynomialOrder:1,forwardCoefficients:[d[2]+d[0]/2,d[5]-d[3]/2,d[0],d[3],-d[1],-d[4]]}),T.extent=T.transform.forwardTransform(T.nativeExtent),T.pixelSize=new B.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),{imageInfo:t,rasterInfo:T}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,re.Oh)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new B.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}async _readIFDs(e,t,i,n,s,r=4,a){if(!n)return null;(n>=t.byteLength||n<0)&&(t=(await this.request(this.url,{range:{from:n+s,to:n+s+this._bufferSize},responseType:"array-buffer",signal:a})).data,s=n+s,n=0);const o=await this._readIFD(t,i,n,s,it.Z.tiffTags,r,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-s,s,r,a)}async _readIFD(e,t,i,n,s=it.Z.tiffTags,r=4,a){if(!e)return null;const o=(0,tt.vr)(e,t,i,n,s,r);if(o.success){const i=[];if(o.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const s=i.map((e=>e.offlineOffsetSize)).filter(p.pC),r=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-r<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:a});e=s,n=r,i.forEach((i=>(0,tt.Dq)(e,t,i,n)))}}if(o.ifd?.has("GEOKEYDIRECTORY")){const i=o.ifd.get("GEOKEYDIRECTORY"),s=i?.values;if(s&&s.length>4){const r=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,i.valueOffset+6-n,n,it.Z.geoKeys,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:n,to:n+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,n,it.Z.tiffTags,4,a)}}async _fetchRawTiffTile(e,t,i,n,s={}){const r=this._getTileLocation(e,t,i,n);if(!r)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=r,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal}))),h=await Promise.all(u),f=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),p=1===h.length?h[0].data:new ArrayBuffer(f),d=[0],m=[0];if(h.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<h.length;t++){const n=h[t].data;e.set(new Uint8Array(n),i),d[t]=i,i+=n.byteLength,m[t]=n.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;let w,b,v;if(o!==y||l!==g){let e=x.mask;if(e)for(w=0;w<g;w++)if(v=w*y,w<l)for(b=o;b<y;b++)e[v+b]=0;else for(b=0;b<y;b++)e[v+b]=0;else for(e=new Uint8Array(y*g),x.mask=e,w=0;w<l;w++)for(v=w*y,b=0;b<o;b++)e[v+b]=1}return x}_getTileLocation(e,t,i,n=!1){const{firstPyramidLevel:s,blockBoundary:r}=this.rasterInfo.storageInfo,a=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const l=n?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,tt.If)(l,o),u=nt(l,"TILEOFFSETS");if(void 0===u)return null;const h=nt(l,"TILEBYTECOUNTS"),{minRow:f,minCol:p,maxRow:d,maxCol:m}=r[a];if(t>d||i>m||t<f||i<p)return null;const y=st(l,"IMAGEWIDTH"),g=st(l,"IMAGELENGTH"),x=st(l,"TILEWIDTH"),w=st(l,"TILELENGTH"),b=[];if(c){const{bandCount:e}=this.rasterInfo;for(let n=0;n<e;n++){const e=n*(d+1)*(m+1)+t*(m+1)+i;b[n]={from:u[e],to:u[e]+h[e]-1}}}else{const e=t*(m+1)+i;b.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<b.length;e++)if(null==b[e].from||!b[e].to||b[e].to<0)return null;return{ranges:b,ifd:l,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===d&&g%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Je(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=_e.parse(t);return i?.recordSet?Q.Z.fromJSON(i.recordSet):null}catch{return null}}};(0,n._)([(0,h.Cb)()],rt.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],rt.prototype,"_headerInfo",void 0),(0,n._)([(0,h.Cb)()],rt.prototype,"_bufferSize",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],rt.prototype,"datasetFormat",void 0),rt=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.TIFFRaster")],rt);const at=rt,ot=new Map;ot.set("CRF",{desc:"Cloud Raster Format",constructor:Ce}),ot.set("MRF",{desc:"Meta Raster Format",constructor:et}),ot.set("TIFF",{desc:"GeoTIFF",constructor:at}),ot.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Ve}),ot.set("JPG",{desc:"JPG Raster Format",constructor:He}),ot.set("PNG",{desc:"PNG Raster Format",constructor:He}),ot.set("GIF",{desc:"GIF Raster Format",constructor:He}),ot.set("BMP",{desc:"BMP Raster Format",constructor:He});class lt{static get supportedFormats(){const e=new Set;return ot.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:n}=e;let s=e.datasetFormat;null==s&&t.lastIndexOf(".")&&(s=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===s||"TIF"===s?s="TIFF":"JPG"!==s&&"JPEG"!==s&&"JFIF"!==s||(s="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");const r={url:t,sourceJSON:n,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(s&&this.supportedFormats.has(s)){if("CRF"===s&&!i?.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=ot.get(s).constructor,l=new o(r),await l.open({signal:e.signal}),l}if(s)throw new a.Z("rasterfactory:open","not a supported format "+s);const c=Array.from(ot.keys());let u=0;const h=()=>(s=c[u++],s&&("CRF"!==s||i?.enableCRF)?(o=ot.get(s).constructor,l=new o(r),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,i){ot.has(e.toUpperCase())||ot.set(e.toUpperCase(),{desc:t,constructor:i})}}var ct=i(32163),ut=i(12259);let ht=class extends((0,w.h)((0,ye.M)((0,pe.q)((0,de.I)((0,b.N)(fe((0,ge.n)((0,x.Y)((0,me.Q)((0,l.R)((0,r.J)(g.Z)))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,c.Ds)((async(e,t,n)=>{const{save:s,saveAs:r}=await i.e(4697).then(i.bind(i,64697));switch(e){case ut.x.SAVE:return s(this,t);case ut.x.SAVE_AS:return r(this,n,t)}}))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[new xe.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new xe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{rasterInfo:t}=this,i=t?.attributeTable,n=null!=i?i.fields:null;if(n){const t=n.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new xe.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new xe.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}createPopupTemplate(e){const{rasterFields:t}=this,i=new Set(t.map((({name:e})=>e)).filter((e=>"raster.servicepixelvalue.raw"!==e.toLowerCase())));return(0,ct.eZ)({fields:t,title:this.title},{...e,visibleFieldNames:i})}async generateRasterInfo(e,t){if(!(e=(0,f.TJ)(M.Z,e)))return this.rasterInfo;try{const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>i[e.url]=e));const n=(0,se.Ue)(e.functionDefinition?.toJSON()??e.toJSON(),i),s=new te({rasterFunction:n});return await s.open(t),s.rasterInfo}catch(e){if(e instanceof a.Z)throw e;throw new a.Z("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(ut.x.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ut.x.SAVE_AS,t,e)}write(e,t){const i=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),"Function"===this.raster.datasetFormat?(t=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:t}=this,i=[this.url];t&&(0,se.G8)(t.toJSON(),i);const n=await Promise.all(i.map((t=>lt.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e})))),s=n.findIndex((e=>null==e));if(s>-1)throw new a.Z("imagery-tile-layer:open",`cannot open raster: ${i[s]}`);if(this._primaryRasters=n,t){const e={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((t=>e[t.url]=t));const i=(0,se.Ue)(t.functionDefinition?.toJSON()??t.toJSON(),e),s=new te({rasterFunction:i});try{await s.open(),this.raster=s}catch(e){const t=o.Z.getLogger(this);e instanceof a.Z&&t.error("imagery-tile-layer:open",e.message),t.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=n[0]}}else this.raster=n[0]}const i=this.raster.rasterInfo;if(!i)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.YP)((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}};(0,n._)([(0,h.Cb)({clonable:!1})],ht.prototype,"_primaryRasters",void 0),(0,n._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ht.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,m.J)(we.cl)],ht.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)(T.rn)],ht.prototype,"legendEnabled",void 0),(0,n._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ht.prototype,"isReference",void 0),(0,n._)([(0,h.Cb)({type:["show","hide"]})],ht.prototype,"listMode",void 0),(0,n._)([(0,h.Cb)({json:{read:!0,write:!0}})],ht.prototype,"blendMode",void 0),(0,n._)([(0,h.Cb)()],ht.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],ht.prototype,"version",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],ht.prototype,"type",void 0),(0,n._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],ht.prototype,"operationalLayerType",void 0),(0,n._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],ht.prototype,"popupEnabled",void 0),(0,n._)([(0,h.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],ht.prototype,"popupTemplate",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],ht.prototype,"defaultPopupTemplate",null),(0,n._)([(0,h.Cb)({readOnly:!0,type:[xe.Z]})],ht.prototype,"fields",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:[xe.Z]})],ht.prototype,"rasterFields",null),ht=(0,n._)([(0,y.j)("esri.layers.ImageryTileLayer")],ht);const ft=ht},39450:(e,t,i)=>{i.d(t,{Z:()=>u});var n,s=i(43697),r=i(96674),a=i(5600),o=i(75215),l=(i(67676),i(80442),i(52011));let c=n=class extends r.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new n({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s._)([(0,a.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,s._)([(0,a.Cb)({type:o.z8,json:{write:!0}})],c.prototype,"level",void 0),(0,s._)([(0,a.Cb)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,s._)([(0,a.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,s._)([(0,a.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=n=(0,s._)([(0,l.j)("esri.layers.support.LOD")],c);const u=c},11145:(e,t,i)=>{i.d(t,{Z:()=>S});var n,s=i(43697),r=i(35454),a=i(96674),o=i(67900),l=i(5600),c=i(75215),u=(i(67676),i(80442),i(71715)),h=i(52011),f=i(30556),p=i(94139),d=i(82971),m=i(24470),y=i(8744),g=i(40488),x=i(39450),w=i(43077);const b=new r.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=n=class extends a.wq{static create(e={}){const{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:r=d.Z.WebMercator,numLODs:a=24}=e;if(!(0,y.JY)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const n=i[t];e.push(new x.Z({level:t,scale:n,resolution:n}))}else{let t=5e-4;for(let i=a-1;i>=0;i--)e.unshift(new x.Z({level:i,scale:t,resolution:t})),t*=2}return new n({dpi:96,lods:e,origin:new p.Z(0,0,r),size:[s,s],spatialReference:r})}const l=(0,y.C5)(r),c=e.origin?new p.Z({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.Z(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,o.c9)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],n=t*u;h.push(new x.Z({level:e,scale:t,resolution:n}))}else{let e=(0,y.sT)(r)?512/s*591657527.5917094:256/s*591657527.591555;const i=Math.ceil(a/t);h.push(new x.Z({level:0,scale:e,resolution:e*u}));for(let n=1;n<i;n++){const i=e/2**t,s=i*u;h.push(new x.Z({level:n,scale:i,resolution:s})),e=i}}return new n({dpi:96,lods:h,origin:c,size:[s,s],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.C5)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const n=[],s=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{n.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,s[e.level]=e}))),this._set("scales",n),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),n=i+1;return t[i]/(t[i]/t[n])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let n=0;for(;n<i;n++){const i=t[n],s=t[n+1];if(i<=e)return n;if(s===e)return n+1;if(i>e&&s<e)return n+Math.log(i/e)/Math.log(i/s)}return n}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,n){const s=this.lodAt(e);if(!s)return null;let r,a;if("number"==typeof t)r=t,a=i;else if((0,y.fS)(t.spatialReference,this.spatialReference))r=t.x,a=t.y,n=i;else{const e=(0,g.iV)(t,this.spatialReference);if(null==e)return null;r=e.x,a=e.y,n=i}const o=s.resolution*this.size[0],l=s.resolution*this.size[1];return n||(n=new w.f(null,0,0,0,(0,m.Ue)())),n.level=e,n.row=Math.floor((this.origin.y-a)/l+.001),n.col=Math.floor((r-this.origin.x)/o+.001),this.updateTileInfo(n),n}updateTileInfo(e,t=n.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===n.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const s=e.level-i.level,r=i.resolution*this.size[0]/2**s,a=i.resolution*this.size[1]/2**s;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.Ue)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*a,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+a}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:n}=i,s=n*this.size[0],r=n*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+s,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return n.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],s=this.lods.length;for(let e=0;e<s;e++){const n=this.lods[e],s=n.resolution*t;i.push(new x.Z({level:n.level,scale:n.scale,resolution:s}))}return new n({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const n=e[i];this._upsampleLevels[n.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/n.resolution:0},t=n}}};var I,_;(0,s._)([(0,l.Cb)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,s._)([(0,l.Cb)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,s._)([(0,l.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,s._)([(0,l.Cb)({readOnly:!0})],v.prototype,"isWrappable",null),(0,s._)([(0,l.Cb)({type:p.Z,json:{write:!0}})],v.prototype,"origin",void 0),(0,s._)([(0,u.r)("origin")],v.prototype,"readOrigin",null),(0,s._)([(0,l.Cb)({type:[x.Z],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,s._)([(0,l.Cb)({readOnly:!0})],v.prototype,"scales",void 0),(0,s._)([(0,l.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,s._)([(0,u.r)("size",["rows","cols"])],v.prototype,"readSize",null),(0,s._)([(0,f.c)("size",{cols:{type:c.z8},rows:{type:c.z8}})],v.prototype,"writeSize",null),(0,s._)([(0,l.Cb)({type:d.Z,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=n=(0,s._)([(0,h.j)("esri.layers.support.TileInfo")],v),I=v||(v={}),(_=I.ExtrapolateOptions||(I.ExtrapolateOptions={}))[_.NONE=0]="NONE",_[_.POWER_OF_TWO=1]="POWER_OF_TWO";const S=v},43077:(e,t,i)=>{i.d(t,{f:()=>n});class n{constructor(e,t,i,n,s=void 0){this.id=e,this.level=t,this.row=i,this.col=n,this.extent=s}}},28589:(e,t,i)=>{i.d(t,{y:()=>S});var n,s=i(43697),r=i(3172),a=i(92036),o=i(91303),l=i(20102),c=i(50758),u=i(13867),h=i(44553),f=i(95330),p=i(17445),d=i(1654),m=i(17452),y=i(5600),g=(i(75215),i(67676)),x=(i(80442),i(52011)),w=i(43077),b=i(22974),v=i(1533);class I{constructor(e){this._validateJSON(e);const{location:t,data:i}=e;this.location=Object.freeze((0,b.d9)(t));const n=this.location.width,s=this.location.height;let r=!0,a=!0;const o=function(e,t=!1){return e<=v.c8?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(n*s/32));let l=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(a=!1,o[l]|=1<<t):r=!1,31===t&&++l}a?(this._availability="unavailable",this.byteSize=40):r?(this._availability="available",this.byteSize=40):(this._availability=o,this.byteSize=40+(0,v.Xw)(o))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),n=i%32,s=i>>5,r=this._availability;return s<0||s>r.length?"unknown":r[s]&1<<n?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||r.Z,{row:n,col:s,width:a,height:o}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:n,left:s,width:a,height:o},valid:!0,data:(0,g.a9)(a*o,0)};throw e})).then((e=>{if(e.location&&(e.location.top!==n||e.location.left!==s||e.location.width!==a||e.location.height!==o))throw new l.Z("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:n,left:s,width:a,height:o}});return I.fromJSON(e)}))}static fromJSON(e){return Object.freeze(new I(e))}_validateJSON(e){if(!e||!e.location)throw new l.Z("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new l.Z("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new l.Z("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new l.Z("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new l.Z("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function _(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}let S=n=class extends a.Z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=r.Z,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.z(2*o.Y.MEGABYTES),this.addHandles([(0,p.YP)((()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]}),(()=>this._initializeTilemapDefinition()),p.nn)])}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(e,t,i,n){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new l.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const s=this._tmpTilemapDefinition,r=this._tilemapFromCache(e,t,i,s);if(r)return Promise.resolve(r);const a=n&&n.signal;return n={...n,signal:null},new Promise(((e,t)=>{(0,f.fu)(a,(()=>t((0,f.zE)())));const i=_(s);let r=this._pendingTilemapRequests[i];if(!r){r=I.fromDefinition(s,n).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=r,r.then(e,e)}r.then(e,t)}))}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const n=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return n?n.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,n){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(new l.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})):this.fetchTilemap(e,t,i,n).catch((e=>e)).then((n=>{if(n instanceof I){const s=n.getAvailability(t,i);if("unavailable"===s)throw new l.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return s}if((0,f.D_)(n))throw n;return"unknown"}))}fetchAvailabilityUpsample(e,t,i,n,s){n.level=e,n.row=t,n.col=i;const r=this.layer.tileInfo;r.updateTileInfo(n);const a=this.fetchAvailability(e,t,i,s).catch((e=>{if((0,f.D_)(e))throw e;if(r.upsampleTile(n))return this.fetchAvailabilityUpsample(n.level,n.row,n.col,n,s);throw e}));return this._fetchAvailabilityUpsamplePrefetch(n.id,e,t,i,s,a),a}async _fetchAvailabilityUpsamplePrefetch(e,t,i,s,r,a){if(!this._prefetchingEnabled||null==e)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const l=new AbortController;a.then((()=>l.abort()),(()=>l.abort()));let u=!1;const h=(0,c.kB)((()=>{u||(u=!0,l.abort())}));if(this.addHandles(h,o),await(0,d.MU)(10,l.signal).catch((()=>{})),u||(u=!0,this.removeHandles(o)),(0,f.Hc)(l))return;const p=new w.f(e,t,i,s),m={...r,signal:l.signal},y=this.layer.tileInfo;for(let e=0;n._prefetches.length<n._maxPrefetch&&y.upsampleTile(p);++e){const e=this.fetchAvailability(p.level,p.row,p.col,m);n._prefetches.push(e);const t=()=>{n._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,m.B7)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,n){n.level=e,n.row=t-t%this.size,n.col=i-i%this.size;const s=_(n);return this._tilemapCache.get(s)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,n)=>!!e._tilemapFromCache(t,i,n,e._tmpTilemapDefinition)}}};S._maxPrefetch=4,S._prefetches=new h.Z({initialSize:n._maxPrefetch}),(0,s._)([(0,y.Cb)({constructOnly:!0})],S.prototype,"layer",void 0),(0,s._)([(0,y.Cb)({constructOnly:!0})],S.prototype,"minLOD",void 0),(0,s._)([(0,y.Cb)({constructOnly:!0})],S.prototype,"maxLOD",void 0),(0,s._)([(0,y.Cb)({constructOnly:!0})],S.prototype,"request",void 0),(0,s._)([(0,y.Cb)({constructOnly:!0})],S.prototype,"size",void 0),S=n=(0,s._)([(0,x.j)("esri.layers.support.TilemapCache")],S)},11282:(e,t,i)=>{i.d(t,{cv:()=>o,en:()=>a,lA:()=>r}),i(68773),i(40330);var n=i(22974),s=i(17452);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,s.mN)(e):(0,n.d9)(e)}function o(e,t,i){const n={};for(const s in e){if("declaredClass"===s)continue;const r=e[s];if(null!=r&&"function"!=typeof r)if(Array.isArray(r)){n[s]=[];for(let e=0;e<r.length;e++)n[s][e]=o(r[e])}else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i&&i[s]);n[s]=t?e:JSON.stringify(e)}else n[s]=t?r:JSON.stringify(r);else n[s]=r}return n}i(71058)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1161],{21787:(t,e,o)=>{o.d(e,{a:()=>u,d:()=>a,f:()=>r,i:()=>d,m:()=>c,n:()=>l,s:()=>s,t:()=>i});var n=o(46851);function r(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function s(t,e,o,n,r,s,i,a,u,c){return t[0]=e,t[1]=o,t[2]=n,t[3]=r,t[4]=s,t[5]=i,t[6]=a,t[7]=u,t[8]=c,t}function i(t,e){if(t===e){const o=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=o,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){const o=e[0],n=e[1],r=e[2],s=e[3],i=e[4],a=e[5],u=e[6],c=e[7],l=e[8],p=l*i-a*c,d=-l*s+a*u,f=c*s-i*u;let y=o*p+n*d+r*f;return y?(y=1/y,t[0]=p*y,t[1]=(-l*n+r*c)*y,t[2]=(a*n-r*i)*y,t[3]=d*y,t[4]=(l*o-r*u)*y,t[5]=(-a*o+r*s)*y,t[6]=f*y,t[7]=(-c*o+n*u)*y,t[8]=(i*o-n*s)*y,t):null}function u(t,e){const o=e[0],n=e[1],r=e[2],s=e[3],i=e[4],a=e[5],u=e[6],c=e[7],l=e[8];return t[0]=i*l-a*c,t[1]=r*c-n*l,t[2]=n*a-r*i,t[3]=a*u-s*l,t[4]=o*l-r*u,t[5]=r*s-o*a,t[6]=s*c-i*u,t[7]=n*u-o*c,t[8]=o*i-n*s,t}function c(t,e,o){const n=e[0],r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],c=e[6],l=e[7],p=e[8],d=o[0],f=o[1],y=o[2],h=o[3],b=o[4],g=o[5],m=o[6],M=o[7],w=o[8];return t[0]=d*n+f*i+y*c,t[1]=d*r+f*a+y*l,t[2]=d*s+f*u+y*p,t[3]=h*n+b*i+g*c,t[4]=h*r+b*a+g*l,t[5]=h*s+b*u+g*p,t[6]=m*n+M*i+w*c,t[7]=m*r+M*a+w*l,t[8]=m*s+M*u+w*p,t}function l(t,e){const o=e[0],n=e[1],r=e[2],s=e[3],i=e[4],a=e[5],u=e[6],c=e[7],l=e[8],p=e[9],d=e[10],f=e[11],y=e[12],h=e[13],b=e[14],g=e[15],m=o*a-n*i,M=o*u-r*i,w=o*c-s*i,C=n*u-r*a,S=n*c-s*a,v=r*c-s*u,I=l*h-p*y,E=l*b-d*y,T=l*g-f*y,U=p*b-d*h,A=p*g-f*h,x=d*g-f*b;let _=m*x-M*A+w*U+C*T-S*E+v*I;return _?(_=1/_,t[0]=(a*x-u*A+c*U)*_,t[1]=(u*T-i*x-c*E)*_,t[2]=(i*A-a*T+c*I)*_,t[3]=(r*A-n*x-s*U)*_,t[4]=(o*x-r*T+s*E)*_,t[5]=(n*T-o*A-s*I)*_,t[6]=(h*v-b*S+g*C)*_,t[7]=(b*w-y*v-g*M)*_,t[8]=(y*S-h*w+g*m)*_,t):null}function p(t,e,o){return t[0]=e[0]-o[0],t[1]=e[1]-o[1],t[2]=e[2]-o[2],t[3]=e[3]-o[3],t[4]=e[4]-o[4],t[5]=e[5]-o[5],t[6]=e[6]-o[6],t[7]=e[7]-o[7],t[8]=e[8]-o[8],t}function d(t){const e=(0,n.g)(),o=t[0],r=t[1],s=t[2],i=t[3],a=t[4],u=t[5],c=t[6],l=t[7],p=t[8];return Math.abs(1-(o*o+i*i+c*c))<=e&&Math.abs(1-(r*r+a*a+l*l))<=e&&Math.abs(1-(s*s+u*u+p*p))<=e}const f=c,y=p;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,o){return t[0]=e[0]+o[0],t[1]=e[1]+o[1],t[2]=e[2]+o[2],t[3]=e[3]+o[3],t[4]=e[4]+o[4],t[5]=e[5]+o[5],t[6]=e[6]+o[6],t[7]=e[7]+o[7],t[8]=e[8]+o[8],t},adjoint:u,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:function(t){const e=t[0],o=t[1],n=t[2],r=t[3],s=t[4],i=t[5],a=t[6],u=t[7],c=t[8];return e*(c*s-i*u)+o*(-c*r+i*a)+n*(u*r-s*a)},equals:function(t,e){const o=t[0],r=t[1],s=t[2],i=t[3],a=t[4],u=t[5],c=t[6],l=t[7],p=t[8],d=e[0],f=e[1],y=e[2],h=e[3],b=e[4],g=e[5],m=e[6],M=e[7],w=e[8],C=(0,n.g)();return Math.abs(o-d)<=C*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(r-f)<=C*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(s-y)<=C*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(i-h)<=C*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-b)<=C*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(u-g)<=C*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-m)<=C*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(l-M)<=C*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(p-w)<=C*Math.max(1,Math.abs(p),Math.abs(w))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:r,fromQuat:function(t,e){const o=e[0],n=e[1],r=e[2],s=e[3],i=o+o,a=n+n,u=r+r,c=o*i,l=n*i,p=n*a,d=r*i,f=r*a,y=r*u,h=s*i,b=s*a,g=s*u;return t[0]=1-p-y,t[3]=l-g,t[6]=d+b,t[1]=l+g,t[4]=1-c-y,t[7]=f-h,t[2]=d-b,t[5]=f+h,t[8]=1-c-p,t},fromRotation:function(t,e){const o=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:a,isOrthoNormal:d,mul:f,multiply:c,multiplyScalar:function(t,e,o){return t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*o,t},multiplyScalarAndAdd:function(t,e,o,n){return t[0]=e[0]+o[0]*n,t[1]=e[1]+o[1]*n,t[2]=e[2]+o[2]*n,t[3]=e[3]+o[3]*n,t[4]=e[4]+o[4]*n,t[5]=e[5]+o[5]*n,t[6]=e[6]+o[6]*n,t[7]=e[7]+o[7]*n,t[8]=e[8]+o[8]*n,t},normalFromMat4:l,normalFromMat4Legacy:function(t,e){const o=e[0],n=e[1],r=e[2],s=e[4],i=e[5],a=e[6],u=e[8],c=e[9],l=e[10],p=l*i-a*c,d=-l*s+a*u,f=c*s-i*u,y=o*p+n*d+r*f;if(!y)return null;const h=1/y;return t[0]=p*h,t[1]=(-l*n+r*c)*h,t[2]=(a*n-r*i)*h,t[3]=d*h,t[4]=(l*o-r*u)*h,t[5]=(-a*o+r*s)*h,t[6]=f*h,t[7]=(-c*o+n*u)*h,t[8]=(i*o-n*s)*h,t},projection:function(t,e,o){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/o,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,o){const n=e[0],r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],c=e[6],l=e[7],p=e[8],d=Math.sin(o),f=Math.cos(o);return t[0]=f*n+d*i,t[1]=f*r+d*a,t[2]=f*s+d*u,t[3]=f*i-d*n,t[4]=f*a-d*r,t[5]=f*u-d*s,t[6]=c,t[7]=l,t[8]=p,t},scale:function(t,e,o){const n=o[0],r=o[1],s=o[2];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=s*e[6],t[7]=s*e[7],t[8]=s*e[8],t},scaleByVec2:function(t,e,o){const n=o[0],r=o[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t},set:s,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:y,subtract:p,translate:function(t,e,o){const n=e[0],r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],c=e[6],l=e[7],p=e[8],d=o[0],f=o[1];return t[0]=n,t[1]=r,t[2]=s,t[3]=i,t[4]=a,t[5]=u,t[6]=d*n+f*i+c,t[7]=d*r+f*a+l,t[8]=d*s+f*u+p,t},transpose:i},Symbol.toStringTag,{value:"Module"}))},51305:(t,e,o)=>{o.d(e,{a:()=>f,c:()=>b,g:()=>l,j:()=>A,k:()=>h,m:()=>p,s:()=>c});var n=o(46521),r=o(94961),s=o(65617),i=o(46851),a=o(17896),u=o(98766);function c(t,e,o){o*=.5;const n=Math.sin(o);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(o),t}function l(t,e){const o=2*Math.acos(e[3]),n=Math.sin(o/2);return n>(0,i.g)()?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),o}function p(t,e,o){const n=e[0],r=e[1],s=e[2],i=e[3],a=o[0],u=o[1],c=o[2],l=o[3];return t[0]=n*l+i*a+r*c-s*u,t[1]=r*l+i*u+s*a-n*c,t[2]=s*l+i*c+n*u-r*a,t[3]=i*l-n*a-r*u-s*c,t}function d(t,e,o,n){const r=e[0],s=e[1],a=e[2],u=e[3];let c,l,p,d,f,y=o[0],h=o[1],b=o[2],g=o[3];return l=r*y+s*h+a*b+u*g,l<0&&(l=-l,y=-y,h=-h,b=-b,g=-g),1-l>(0,i.g)()?(c=Math.acos(l),p=Math.sin(c),d=Math.sin((1-n)*c)/p,f=Math.sin(n*c)/p):(d=1-n,f=n),t[0]=d*r+f*y,t[1]=d*s+f*h,t[2]=d*a+f*b,t[3]=d*u+f*g,t}function f(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function y(t,e){const o=e[0]+e[4]+e[8];let n;if(o>0)n=Math.sqrt(o+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[3*o+o]&&(o=2);const r=(o+1)%3,s=(o+2)%3;n=Math.sqrt(e[3*o+o]-e[3*r+r]-e[3*s+s]+1),t[o]=.5*n,n=.5/n,t[3]=(e[3*r+s]-e[3*s+r])*n,t[r]=(e[3*r+o]+e[3*o+r])*n,t[s]=(e[3*s+o]+e[3*o+s])*n}return t}function h(t,e,o,n){const r=.5*Math.PI/180;e*=r,o*=r,n*=r;const s=Math.sin(e),i=Math.cos(e),a=Math.sin(o),u=Math.cos(o),c=Math.sin(n),l=Math.cos(n);return t[0]=s*u*l-i*a*c,t[1]=i*a*l+s*u*c,t[2]=i*u*c-s*a*l,t[3]=i*u*l+s*a*c,t}const b=u.c,g=u.s,m=u.a,M=p,w=u.b,C=u.d,S=u.l,v=u.f,I=v,E=u.g,T=E,U=u.n,A=u.h,x=u.e,_=(0,s.c)(),F=(0,s.f)(1,0,0),L=(0,s.f)(0,1,0),z=(0,r.a)(),O=(0,r.a)(),P=(0,n.a)();Object.freeze(Object.defineProperty({__proto__:null,add:m,calculateW:function(t,e){const o=e[0],n=e[1],r=e[2];return t[0]=o,t[1]=n,t[2]=r,t[3]=Math.sqrt(Math.abs(1-o*o-n*n-r*r)),t},conjugate:f,copy:b,dot:C,equals:x,exactEquals:A,fromEuler:h,fromMat3:y,getAxisAngle:l,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,e){const o=e[0],n=e[1],r=e[2],s=e[3],i=o*o+n*n+r*r+s*s,a=i?1/i:0;return t[0]=-o*a,t[1]=-n*a,t[2]=-r*a,t[3]=s*a,t},len:I,length:v,lerp:S,mul:M,multiply:p,normalize:U,random:function(t){const e=i.R,o=e(),n=e(),r=e(),s=Math.sqrt(1-o),a=Math.sqrt(o);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t},rotateX:function(t,e,o){o*=.5;const n=e[0],r=e[1],s=e[2],i=e[3],a=Math.sin(o),u=Math.cos(o);return t[0]=n*u+i*a,t[1]=r*u+s*a,t[2]=s*u-r*a,t[3]=i*u-n*a,t},rotateY:function(t,e,o){o*=.5;const n=e[0],r=e[1],s=e[2],i=e[3],a=Math.sin(o),u=Math.cos(o);return t[0]=n*u-s*a,t[1]=r*u+i*a,t[2]=s*u+n*a,t[3]=i*u-r*a,t},rotateZ:function(t,e,o){o*=.5;const n=e[0],r=e[1],s=e[2],i=e[3],a=Math.sin(o),u=Math.cos(o);return t[0]=n*u+r*a,t[1]=r*u-n*a,t[2]=s*u+i*a,t[3]=i*u-s*a,t},rotationTo:function(t,e,o){const n=(0,a.j)(e,o);return n<-.999999?((0,a.b)(_,F,e),(0,a.k)(_)<1e-6&&(0,a.b)(_,L,e),(0,a.n)(_,_),c(t,_,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,a.b)(_,e,o),t[0]=_[0],t[1]=_[1],t[2]=_[2],t[3]=1+n,U(t,t))},scale:w,set:g,setAxes:function(t,e,o,n){const r=P;return r[0]=o[0],r[3]=o[1],r[6]=o[2],r[1]=n[0],r[4]=n[1],r[7]=n[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],U(t,y(t,r))},setAxisAngle:c,slerp:d,sqlerp:function(t,e,o,n,r,s){return d(z,e,r,s),d(O,o,n,s),d(t,z,O,2*s*(1-s)),t},sqrLen:T,squaredLength:E,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"}))},83932:(t,e,o)=>{o.d(e,{B:()=>c});var n=o(22021),r=o(52138),s=o(65617);function i(t,e,o){const n=Math.sin(t),r=Math.cos(t),s=Math.sin(e),i=Math.cos(e),a=o;return a[0]=-n,a[4]=-s*r,a[8]=i*r,a[12]=0,a[1]=r,a[5]=-s*n,a[9]=i*n,a[13]=0,a[2]=0,a[6]=i,a[10]=s,a[14]=0,a[3]=0,a[7]=0,a[11]=0,a[15]=1,a}var a=o(29166),u=o(8744);function c(t,e,o,n){if(null==t||null==n)return!1;const s=(0,a.eT)(t,a.Jz),c=(0,a.eT)(n,a.sp);if(s===c&&!l(c)&&(s!==a.Ej.UNKNOWN||(0,u.fS)(t,n)))return(0,r.d)(o,e),!0;if(l(c)){const t=a.rf[s][a.Ej.LON_LAT],n=a.rf[a.Ej.LON_LAT][c];return null!=t&&null!=n&&(t(e,0,d,0),n(d,0,f,0),i(p*d[0],p*d[1],o),o[12]=f[0],o[13]=f[1],o[14]=f[2],!0)}if((c===a.Ej.WEB_MERCATOR||c===a.Ej.PLATE_CARREE)&&(s===a.Ej.WGS84||s===a.Ej.CGCS2000&&c===a.Ej.PLATE_CARREE||s===a.Ej.SPHERICAL_ECEF||s===a.Ej.WEB_MERCATOR)){const t=a.rf[s][a.Ej.LON_LAT],n=a.rf[a.Ej.LON_LAT][c];return null!=t&&null!=n&&(t(e,0,d,0),n(d,0,f,0),s===a.Ej.SPHERICAL_ECEF?function(t,e,o){i(t,e,o),(0,r.t)(o,o)}(p*d[0],p*d[1],o):(0,r.g)(o),o[12]=f[0],o[13]=f[1],o[14]=f[2],!0)}return!1}function l(t){return t===a.Ej.SPHERICAL_ECEF||t===a.Ej.SPHERICAL_MARS_PCPF||t===a.Ej.SPHERICAL_MOON_PCPF}const p=(0,n.Vl)(1),d=(0,s.c)(),f=(0,s.c)()},58995:(t,e,o)=>{o.d(e,{rS:()=>c});var n=o(2109),r=o(82971),s=o(8744);const i=new r.Z(n.kU),a=new r.Z(n.JL),u=new r.Z(n.mM);function c(t){return t&&((0,s.BZ)(t)||(0,s.fS)(t,a))?a:t&&((0,s.V2)(t)||(0,s.fS)(t,u))?u:i}new r.Z(n.pn)},51161:(t,e,o)=>{o.d(e,{H3:()=>g,QI:()=>p,U4:()=>u,Yh:()=>f});var n=o(43697),r=o(96674),s=o(5600),i=(o(75215),o(67676),o(80442),o(36030)),a=o(52011);let u=class extends r.wq{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};(0,n._)([(0,s.Cb)({type:Number})],u.prototype,"nodesPerPage",void 0),(0,n._)([(0,s.Cb)({type:Number})],u.prototype,"rootIndex",void 0),(0,n._)([(0,s.Cb)({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=(0,n._)([(0,a.j)("esri.layer.support.I3SNodePageDefinition")],u);let c=class extends r.wq{constructor(){super(...arguments),this.factor=1}};(0,n._)([(0,s.Cb)({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],c.prototype,"id",void 0),(0,n._)([(0,s.Cb)({type:Number})],c.prototype,"factor",void 0),c=(0,n._)([(0,a.j)("esri.layer.support.I3SMaterialTexture")],c);let l=class extends r.wq{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};(0,n._)([(0,s.Cb)({type:[Number]})],l.prototype,"baseColorFactor",void 0),(0,n._)([(0,s.Cb)({type:c})],l.prototype,"baseColorTexture",void 0),(0,n._)([(0,s.Cb)({type:c})],l.prototype,"metallicRoughnessTexture",void 0),(0,n._)([(0,s.Cb)({type:Number})],l.prototype,"metallicFactor",void 0),(0,n._)([(0,s.Cb)({type:Number})],l.prototype,"roughnessFactor",void 0),l=(0,n._)([(0,a.j)("esri.layer.support.I3SMaterialPBRMetallicRoughness")],l);let p=class extends r.wq{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};(0,n._)([(0,i.J)({opaque:"opaque",mask:"mask",blend:"blend"})],p.prototype,"alphaMode",void 0),(0,n._)([(0,s.Cb)({type:Number})],p.prototype,"alphaCutoff",void 0),(0,n._)([(0,s.Cb)({type:Boolean})],p.prototype,"doubleSided",void 0),(0,n._)([(0,i.J)({none:"none",back:"back",front:"front"})],p.prototype,"cullFace",void 0),(0,n._)([(0,s.Cb)({type:c})],p.prototype,"normalTexture",void 0),(0,n._)([(0,s.Cb)({type:c})],p.prototype,"occlusionTexture",void 0),(0,n._)([(0,s.Cb)({type:c})],p.prototype,"emissiveTexture",void 0),(0,n._)([(0,s.Cb)({type:[Number]})],p.prototype,"emissiveFactor",void 0),(0,n._)([(0,s.Cb)({type:l})],p.prototype,"pbrMetallicRoughness",void 0),p=(0,n._)([(0,a.j)("esri.layer.support.I3SMaterialDefinition")],p);let d=class extends r.wq{};(0,n._)([(0,s.Cb)({type:String,json:{read:{source:["name","index"],reader:(t,e)=>null!=t?t:`${e.index}`}}})],d.prototype,"name",void 0),(0,n._)([(0,i.J)({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],d.prototype,"format",void 0),d=(0,n._)([(0,a.j)("esri.layer.support.I3STextureFormat")],d);let f=class extends r.wq{constructor(){super(...arguments),this.atlas=!1}};(0,n._)([(0,s.Cb)({type:[d]})],f.prototype,"formats",void 0),(0,n._)([(0,s.Cb)({type:Boolean})],f.prototype,"atlas",void 0),f=(0,n._)([(0,a.j)("esri.layer.support.I3STextureSetDefinition")],f);let y=class extends r.wq{};(0,n._)([(0,i.J)({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],y.prototype,"type",void 0),(0,n._)([(0,s.Cb)({type:Number})],y.prototype,"component",void 0),y=(0,n._)([(0,a.j)("esri.layer.support.I3SGeometryAttribute")],y);let h=class extends r.wq{};(0,n._)([(0,i.J)({draco:"draco"})],h.prototype,"encoding",void 0),(0,n._)([(0,s.Cb)({type:[String]})],h.prototype,"attributes",void 0),h=(0,n._)([(0,a.j)("esri.layer.support.I3SGeometryCompressedAttributes")],h);let b=class extends r.wq{constructor(){super(...arguments),this.offset=0}};(0,n._)([(0,s.Cb)({type:Number})],b.prototype,"offset",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"position",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"normal",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"uv0",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"color",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"uvRegion",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"featureId",void 0),(0,n._)([(0,s.Cb)({type:y})],b.prototype,"faceRange",void 0),(0,n._)([(0,s.Cb)({type:h})],b.prototype,"compressedAttributes",void 0),b=(0,n._)([(0,a.j)("esri.layer.support.I3SGeometryBuffer")],b);let g=class extends r.wq{};(0,n._)([(0,i.J)({triangle:"triangle"})],g.prototype,"topology",void 0),(0,n._)([(0,s.Cb)()],g.prototype,"geometryBuffers",void 0),g=(0,n._)([(0,a.j)("esri.layer.support.I3SGeometryDefinition")],g)},56765:(t,e,o)=>{o.d(e,{Z:()=>l});var n,r=o(43697),s=o(46791),i=o(96674),a=o(5600),u=(o(75215),o(67676),o(80442),o(52011));let c=n=class extends i.wq{constructor(t){super(t),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.Z}clone(){return new n({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],c.prototype,"floorField",void 0),(0,r._)([(0,a.Cb)({json:{read:!1,write:!1}})],c.prototype,"viewAllMode",void 0),(0,r._)([(0,a.Cb)({json:{read:!1,write:!1}})],c.prototype,"viewAllLevelIds",void 0),c=n=(0,r._)([(0,u.j)("esri.layers.support.LayerFloorInfo")],c);const l=c},15506:(t,e,o)=>{o.d(e,{C:()=>n});const n={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},36405:(t,e,o)=>{function n(t,e){return null!=e&&e.mode?e.mode:function(t){return t?c:l}(t).mode}function r(t,e){return n(null!=t&&t.hasZ,e)}function s(t,e,o){return o&&o.mode!==e?`${t} only support ${e} elevation mode`:null}function i(t,e,o){return o?.mode===e?`${t} do not support ${e} elevation mode`:null}function a(t,e){return null!=e?.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression?`${t} do not support featureExpressionInfo`:null}function u(t,e){e&&t.warn(".elevationInfo=",e)}o.d(e,{LR:()=>u,Uy:()=>s,VW:()=>r,Wb:()=>i,kf:()=>a}),o(12541);const c={mode:"absolute-height",offset:0},l={mode:"on-the-ground",offset:null}},58333:(t,e,o)=>{o.d(e,{ET:()=>s,I4:()=>r,eG:()=>u,lF:()=>i,lj:()=>l,qP:()=>a,wW:()=>c});const n=[252,146,31,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:n,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},s={type:"esriSLS",style:"esriSLSSolid",width:.75,color:n},i={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},u={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},c={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},l={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},91891:(t,e,o)=>{o.d(e,{I_:()=>d,W7:()=>h,qM:()=>g});var n=o(20102),r=o(22974),s=o(92604),i=o(25683),a=o(35065);const u=s.Z.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function c(t,e,o){let r="",s=0;for(;s<o;){const i=t[e+s];if(i<128)r+=String.fromCharCode(i),s++;else if(i>=192&&i<224){if(s+1>=o)throw new n.Z("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&i)<<6|63&t[e+s+1];r+=String.fromCharCode(a),s+=2}else if(i>=224&&i<240){if(s+2>=o)throw new n.Z("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&i)<<12|(63&t[e+s+1])<<6|63&t[e+s+2];r+=String.fromCharCode(a),s+=3}else{if(!(i>=240&&i<248))throw new n.Z("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(s+3>=o)throw new n.Z("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&i)<<18|(63&t[e+s+1])<<12|(63&t[e+s+2])<<6|63&t[e+s+3];if(a>=65536){const t=55296+(a-65536>>10),e=56320+(1023&a);r+=String.fromCharCode(t,e)}else r+=String.fromCharCode(a);s+=4}}}return r}function l(t,e){const o={byteOffset:0,byteCount:0,fields:Object.create(null)};let n=0;for(let r=0;r<e.length;r++){const s=e[r],i=s.valueType||s.type,a=M[i];o.fields[s.property]=a(t,n),n+=m[i].BYTES_PER_ELEMENT}return o.byteCount=n,o}function p(t,e,o){const r=[];let s,i,a=0;for(i=0;i<t;i+=1){if(s=e[i],s>0){if(r.push(c(o,a,s-1)),0!==o[a+s-1])throw new n.Z("string-array-error","Invalid string array: missing null termination.")}else r.push(null);a+=s}return r}function d(t,e){return new(0,m[e.valueType])(t,e.byteOffset,e.count*e.valuesPerElement)}function f(t,e,o){const s=null!=e.header?l(t,e.header):{byteOffset:0,byteCount:0,fields:{count:o}},i={header:s,byteOffset:s.byteCount,byteCount:0,entries:Object.create(null)};let a=s.byteCount;for(let t=0;t<e.ordering.length;t++){const o=e.ordering[t],u=(0,r.d9)(e[o]);if(u.count=s.fields.count??0,"String"===u.valueType){if(u.byteOffset=a,u.byteCount=s.fields[o+"ByteCount"],"UTF-8"!==u.encoding)throw new n.Z("unsupported-encoding","Unsupported String encoding.",{encoding:u.encoding});if(u.timeEncoding&&"ECMA_ISO8601"!==u.timeEncoding)throw new n.Z("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:u.timeEncoding})}else{if(!w(u.valueType))throw new n.Z("unsupported-value-type","Unsupported binary valueType",{valueType:u.valueType});{const t=C(u.valueType);a+=a%t!=0?t-a%t:0,u.byteOffset=a,u.byteCount=t*u.valuesPerElement*u.count}}a+=u.byteCount??0,i.entries[o]=u}return i.byteCount=a-i.byteOffset,i}function y(t,e,o){if(e!==t&&u.error(`Invalid ${o} buffer size\n expected: ${t}, actual: ${e})`),e<t)throw new n.Z("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:e})}function h(t,e){const o=l(t,e&&e.header);let n=o.byteCount;const r={isDraco:!1,header:o,byteOffset:o.byteCount,byteCount:0,vertexAttributes:{}},s=o.fields,i=null!=s.vertexCount?s.vertexCount:s.count;for(const t of e.ordering){if(!e.vertexAttributes[t])continue;const o={...e.vertexAttributes[t],byteOffset:n,count:i},s=b[t]||"_"+t;r.vertexAttributes[s]=o,n+=C(o.valueType)*o.valuesPerElement*i}const a=s.faceCount;if(e.faces&&a){r.faces={};for(const t of e.ordering){if(!e.faces[t])continue;const o={...e.faces[t],byteOffset:n,count:a};r.faces[t]=o,n+=C(o.valueType)*o.valuesPerElement*a}}const u=s.featureCount;if(e.featureAttributes&&e.featureAttributeOrder&&u){r.featureAttributes={};for(const t of e.featureAttributeOrder){if(!e.featureAttributes[t])continue;const o={...e.featureAttributes[t],byteOffset:n,count:u};r.featureAttributes[t]=o,n+=("UInt64"===o.valueType?8:C(o.valueType))*o.valuesPerElement*u}}return y(n,t.byteLength,"geometry"),r.byteCount=n-r.byteOffset,r}const b={position:a.T.POSITION,normal:a.T.NORMAL,color:a.T.COLOR,uv0:a.T.UV0,region:a.T.UVREGION};function g(t,e,o){if("lepcc-rgb"===t.encoding)return(0,i.IT)(e);if("lepcc-intensity"===t.encoding)return(0,i.ti)(e);if(null!=t.encoding&&""!==t.encoding)throw new n.Z("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(u.warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(u.warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const r=f(e,t,o);y(r.byteOffset+r.byteCount,e.byteLength,"attribute");const s=r.entries.attributeValues||r.entries.objectIds;if(s){if("String"===s.valueType){const t=r.entries.attributeByteCounts,o=d(e,t),n=function(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}(e,s);return s.timeEncoding?function(t,e,o){return p(t,e,o).map((t=>{const e=t?Date.parse(t):null;return e&&!Number.isNaN(e)?e:null}))}(t.count,o,n):p(t.count,o,n)}return d(e,s)}throw new n.Z("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const m={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},M={Float32:(t,e)=>new DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function w(t){return m.hasOwnProperty(t)}function C(t){return w(t)?m[t].BYTES_PER_ELEMENT:0}},2358:(t,e,o)=>{o.d(e,{xe:()=>m});var n=o(3172),r=(o(67676),o(20102),o(80442),o(1533)),s=(o(21787),o(46521)),i=(o(52138),o(13598)),a=(o(51305),o(94961)),u=(o(17896),o(65617));o(2109),o(73615),o(82971),o(58995),o(83932),o(87360),(0,u.c)();var c=o(24470),l=(o(8744),o(14165),o(91891));o(22303);var p,d,f=o(88669);(d=p||(p={}))[d.INVISIBLE=0]="INVISIBLE",d[d.TRANSPARENT=1]="TRANSPARENT",d[d.OPAQUE=2]="OPAQUE";(0,f.f)(0,0,0,.2),p.OPAQUE;(0,f.f)(0,0,0,.2),p.OPAQUE,o(6206);var y,h,b=o(87951),g=o(51417);async function m(t,e,o,r,s){const i=[];for(const n of e)if(n&&s.includes(n.name)){const e=`${t}/nodes/${o}/attributes/${n.key}/0`;i.push({url:e,storageInfo:n})}const a=await Promise.allSettled(i.map((t=>(0,n.Z)(t.url,{responseType:"array-buffer"}).then((e=>(0,l.qM)(t.storageInfo,e.data)))))),u=[];for(const t of r){const e={};for(let o=0;o<a.length;o++){const n=a[o];if("fulfilled"===n.status){const r=n.value;e[i[o].storageInfo.name]=C(r,t)}}u.push(e)}return u}(0,c.Ue)(),(h=y||(y={}))[h.OUTSIDE=0]="OUTSIDE",h[h.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",h[h.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",h[h.INSIDE=3]="INSIDE";const M=-32768,w=-(2**31);function C(t,e){if(!t)return null;const o=t[e];return(0,r.z3)(t)?o===M?null:o:(0,r.Hx)(t)?o===w?null:o:o!=o?null:o}const S=new Array(24);new g.U(S,3),(0,u.c)(),(0,u.c)(),(0,s.a)(),(0,i.a)(),(0,a.a)(),(0,c.Ue)(),(0,c.Ue)(),(0,b.Ue)(),(0,u.c)(),new Array(72),(0,i.a)()},25683:(t,e,o)=>{o.d(e,{Gi:()=>c,IT:()=>y,ti:()=>g});var n=o(20102);const r=!0,s={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function i(t,e,o){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,o+s.identifierOffset,s.identifierLength)),version:e.getUint16(o+s.versionOffset,r),checksum:e.getUint32(o+s.checksumOffset,r)}}const a={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function u(t,e){return{sizeLo:t.getUint32(e+a.sizeLo,r),sizeHi:t.getUint32(e+a.sizeHi,r),minX:t.getFloat64(e+a.minX,r),minY:t.getFloat64(e+a.minY,r),minZ:t.getFloat64(e+a.minZ,r),maxX:t.getFloat64(e+a.maxX,r),maxY:t.getFloat64(e+a.maxY,r),maxZ:t.getFloat64(e+a.maxZ,r),errorX:t.getFloat64(e+a.errorX,r),errorY:t.getFloat64(e+a.errorY,r),errorZ:t.getFloat64(e+a.errorZ,r),count:t.getUint32(e+a.count,r),reserved:t.getUint32(e+a.reserved,r)}}function c(t){const e=new DataView(t,0);let o=0;const{identifier:r,version:c}=i(t,e,o);if(o+=s.byteCount,"LEPCC "!==r)throw new n.Z("lepcc-decode-error","Bad identifier");if(c>1)throw new n.Z("lepcc-decode-error","Unknown version");const p=u(e,o);if(o+=a.byteCount,p.sizeHi*2**32+p.sizeLo!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad size");const d=new Float64Array(3*p.count),f=[],y=[],h=[],b=[];if(o=l(t,o,f),o=l(t,o,y),o=l(t,o,h),o=l(t,o,b),o!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad length");let g=0,m=0;for(let t=0;t<f.length;t++){m+=f[t];let e=0;for(let o=0;o<y[t];o++){e+=h[g];const t=b[g];d[3*g]=Math.min(p.maxX,p.minX+2*p.errorX*e),d[3*g+1]=Math.min(p.maxY,p.minY+2*p.errorY*m),d[3*g+2]=Math.min(p.maxZ,p.minZ+2*p.errorZ*t),g++}}return{errorX:p.errorX,errorY:p.errorY,errorZ:p.errorZ,result:d}}function l(t,e,o){const n=[];e=p(t,e,n);const r=[];for(let s=0;s<n.length;s++){r.length=0,e=p(t,e,r);for(let t=0;t<r.length;t++)o.push(r[t]+n[s])}return e}function p(t,e,o){const s=new DataView(t,e),i=s.getUint8(0),a=31&i,u=!!(32&i),c=(192&i)>>6;let l=0;if(0===c)l=s.getUint32(1,r),e+=5;else if(1===c)l=s.getUint16(1,r),e+=3;else{if(2!==c)throw new n.Z("lepcc-decode-error","Bad count type");l=s.getUint8(1),e+=2}if(u)throw new n.Z("lepcc-decode-error","LUT not implemented");const p=Math.ceil(l*a/8),d=new Uint8Array(t,e,p);let f=0,y=0,h=0;const b=-1>>>32-a;for(let t=0;t<l;t++){for(;y<a;)f|=d[h]<<y,y+=8,h+=1;o[t]=f&b,f>>>=a,y-=a,y+a>32&&(f|=d[h-1]>>8-y)}return e+h}const d={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function f(t,e){return{sizeLo:t.getUint32(e+d.sizeLo,r),sizeHi:t.getUint32(e+d.sizeHi,r),count:t.getUint32(e+d.count,r),colorMapCount:t.getUint16(e+d.colorMapCount,r),lookupMethod:t.getUint8(e+d.lookupMethod),compressionMethod:t.getUint8(e+d.compressionMethod)}}function y(t){const e=new DataView(t,0);let o=0;const{identifier:r,version:a}=i(t,e,o);if(o+=s.byteCount,"ClusterRGB"!==r)throw new n.Z("lepcc-decode-error","Bad identifier");if(a>1)throw new n.Z("lepcc-decode-error","Unknown version");const u=f(e,o);if(o+=d.byteCount,u.sizeHi*2**32+u.sizeLo!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad size");if((2===u.lookupMethod||1===u.lookupMethod)&&0===u.compressionMethod){if(3*u.colorMapCount+u.count+o!==t.byteLength||u.colorMapCount>256)throw new n.Z("lepcc-decode-error","Bad count");const e=new Uint8Array(t,o,3*u.colorMapCount),r=new Uint8Array(t,o+3*u.colorMapCount,u.count),s=new Uint8Array(3*u.count);for(let t=0;t<u.count;t++){const o=r[t];s[3*t]=e[3*o],s[3*t+1]=e[3*o+1],s[3*t+2]=e[3*o+2]}return s}if(0===u.lookupMethod&&0===u.compressionMethod){if(3*u.count+o!==t.byteLength||0!==u.colorMapCount)throw new n.Z("lepcc-decode-error","Bad count");return new Uint8Array(t,o).slice()}if(u.lookupMethod<=2&&1===u.compressionMethod){if(o+3!==t.byteLength||1!==u.colorMapCount)throw new n.Z("lepcc-decode-error","Bad count");const r=e.getUint8(o),s=e.getUint8(o+1),i=e.getUint8(o+2),a=new Uint8Array(3*u.count);for(let t=0;t<u.count;t++)a[3*t]=r,a[3*t+1]=s,a[3*t+2]=i;return a}throw new n.Z("lepcc-decode-error","Bad method "+u.lookupMethod+","+u.compressionMethod)}const h={sizeLo:0,sizeHi:4,count:8,scaleFactor:12,bitsPerPoint:14,reserved:15,byteCount:16};function b(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,r),sizeHi:t.getUint32(e+h.sizeHi,r),count:t.getUint32(e+h.count,r),scaleFactor:t.getUint16(e+h.scaleFactor,r),bitsPerPoint:t.getUint8(e+h.bitsPerPoint),reserved:t.getUint8(e+h.reserved)}}function g(t){const e=new DataView(t,0);let o=0;const{identifier:r,version:a}=i(t,e,o);if(o+=s.byteCount,"Intensity "!==r)throw new n.Z("lepcc-decode-error","Bad identifier");if(a>1)throw new n.Z("lepcc-decode-error","Unknown version");const u=b(e,o);if(o+=h.byteCount,u.sizeHi*2**32+u.sizeLo!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad size");const c=new Uint16Array(u.count);if(8===u.bitsPerPoint){if(u.count+o!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad size");const e=new Uint8Array(t,o,u.count);for(let t=0;t<u.count;t++)c[t]=e[t]*u.scaleFactor}else if(16===u.bitsPerPoint){if(2*u.count+o!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad size");const e=new Uint16Array(t,o,u.count);for(let t=0;t<u.count;t++)c[t]=e[t]*u.scaleFactor}else{const e=[];if(p(t,o,e)!==t.byteLength)throw new n.Z("lepcc-decode-error","Bad size");for(let t=0;t<u.count;t++)c[t]=e[t]*u.scaleFactor}return c}},6206:(t,e,o)=>{var n,r;o.d(e,{a9:()=>n}),o(22021),(r=n||(n={}))[r.Multiply=1]="Multiply",r[r.Ignore=2]="Ignore",r[r.Replace=3]="Replace",r[r.Tint=4]="Tint"},87951:(t,e,o)=>{o.d(e,{Ue:()=>l,gI:()=>p}),o(21787);var n=o(46521),r=o(51305),s=o(94961),i=o(17896),a=o(65617),u=(o(98766),o(88669)),c=(o(60437),o(62073),o(64822));function l(t=[0,0,0],e=[-1,-1,-1],o=(0,s.a)()){return{center:(0,a.g)(t),halfSize:(0,a.g)(e),quaternion:(0,s.b)(o)}}function p(t,e,o,n,s){if((0,r.c)(s.quaternion,t.quaternion),n===c.JY.Global){(0,r.a)(h,t.quaternion),(0,i.v)(d,t.center,h),(0,i.w)(f,d),(0,i.x)(y,f,t.halfSize),(0,i.u)(y,f,y);const n=(0,i.l)(y);(0,i.g)(y,f,t.halfSize);const a=(0,i.l)(y);if(n<o)(0,i.c)(s.center,t.center),(0,i.s)(d,o,o,o),(0,i.g)(s.halfSize,t.halfSize,d);else{const r=a>0?1+e/a:1,u=n>0?1+o/n:1,c=(u+r)/2,l=(u-r)/2;(0,i.i)(s.halfSize,f,l),(0,i.q)(s.halfSize,s.halfSize,t.halfSize,c),(0,i.i)(s.center,f,c),(0,i.q)(s.center,s.center,t.halfSize,l),(0,i.z)(d,d),(0,i.A)(s.center,s.center,d),(0,i.v)(s.center,s.center,s.quaternion)}}else{const n=(0,i.s)(d,0,0,1);(0,i.q)(s.center,t.center,n,(o+e)/2),(0,r.a)(h,t.quaternion),(0,i.v)(n,n,h),(0,i.w)(n,n),(0,i.q)(s.halfSize,t.halfSize,n,(o-e)/2)}return s}(0,s.a)(),(0,a.c)(),(0,a.c)(),(0,u.c)(),(0,n.a)(),(()=>{const t=new Int8Array(162);let e=0;const o=o=>{for(let n=0;n<o.length;n++)t[e+n]=o[n];e+=6};o([6,2,3,1,5,4]),o([0,2,3,1,5,4]),o([0,2,3,7,5,4]),o([0,1,3,2,6,4]),o([0,1,3,2,0,0]),o([0,1,5,7,3,2]),o([0,1,3,7,6,4]),o([0,1,3,7,6,2]),o([0,1,5,7,6,2]),o([0,1,5,4,6,2]),o([0,1,5,4,0,0]),o([0,1,3,7,5,4]),o([0,2,6,4,0,0]),o([0,0,0,0,0,0]),o([1,3,7,5,0,0]),o([2,3,7,6,4,0]),o([2,3,7,6,0,0]),o([2,3,1,5,7,6]),o([0,1,5,7,6,2]),o([0,1,5,7,6,4]),o([0,1,3,7,6,4]),o([4,5,7,6,2,0]),o([4,5,7,6,0,0]),o([4,5,1,3,7,6]),o([0,2,3,7,5,4]),o([6,2,3,7,5,4]),o([6,2,3,1,5,4])})();const d=(0,a.c)(),f=(0,a.c)(),y=(0,a.c)(),h=(0,s.a)()},51417:(t,e,o)=>{o.d(e,{U:()=>n,a:()=>r});class n{constructor(t,e,o=e){this.data=t,this.size=e,this.stride=o}}class r extends n{constructor(t,e,o,n=!1,r=o){super(t,o,r),this.indices=e,this.exclusive=n}}},64822:(t,e,o)=>{var n;o.d(e,{JY:()=>n}),function(t){t[t.Global=1]="Global",t[t.Local=2]="Local"}(n||(n={}))},19833:(t,e,o)=>{o.d(e,{V5:()=>s,e7:()=>r});var n=o(35671);async function r(t,e=t.popupTemplate){if(null==e)return[];const o=await e.getRequiredFields(t.fieldsIndex),{lastEditInfoEnabled:r}=e,{objectIdField:s,typeIdField:i,globalIdField:a,relationships:u}=t;if(o.includes("*"))return["*"];const c=r?await(0,n.CH)(t):[],l=(0,n.Q0)(t.fieldsIndex,[...o,...c]);return i&&l.push(i),l&&s&&t.fieldsIndex?.has(s)&&!l.includes(s)&&l.push(s),l&&a&&t.fieldsIndex?.has(a)&&!l.includes(a)&&l.push(a),u&&u.forEach((e=>{const{keyField:o}=e;l&&o&&t.fieldsIndex?.has(o)&&!l.includes(o)&&l.push(o)})),l}function s(t,e){return t.popupTemplate?t.popupTemplate:null!=e&&e.defaultPopupTemplateEnabled&&null!=t.defaultPopupTemplate?t.defaultPopupTemplate:null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4330],{65845:(e,t,r)=>{r.d(t,{D:()=>n});var a=r(81153);function n(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>a})},94330:(e,t,r)=>{r.d(t,{save:()=>c,saveAs:()=>d});var a=r(64383),n=r(14661);const o="Stream Service",i="stream-layer-save",l="stream-layer-save-as";function s(e){return{isValid:"stream"===e.type&&!!e.url&&!e.webSocketUrl,errorMessage:"Stream layer should be created using a url to a stream service"}}function u(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function p(e,t){const{parsedUrl:r,title:a,fullExtent:o}=e;t.url=r.path,t.title||=a,t.extent=null,null!=o&&(t.extent=await(0,n.$o)(o)),(0,n.qj)(t,n.Kz.SINGLE_LAYER)}async function c(e,t){return(0,a.a1)({layer:e,itemType:o,validateLayer:s,createItemData:u,errorNamePrefix:i},t)}async function d(e,t,r){return(0,a.po)({layer:e,itemType:o,validateLayer:s,createItemData:u,errorNamePrefix:l,newItem:t,setItemProperties:p},r)}},64383:(e,t,r)=>{r.d(t,{a1:()=>g,po:()=>v});var a=r(20102),n=r(65845),o=r(48522),i=r(15235),l=r(33516),s=r(14661),u=r(14769);async function p(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.Z(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function c(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function d(e,t,r,n){if(e.type!==r)throw new a.Z(`${t}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:e,layer:n})}function m(e,t,r){const{portalItem:n}=e;if(!n)throw new a.Z(`${t}:portal-item-not-set`,c(e,"requires the portalItem property to be set"));if(!n.loaded)throw new a.Z(`${t}:portal-item-not-loaded`,c(e,"cannot be saved to a portal item that does not exist or is inaccessible"));(0,u.w)(n),d(n,t,r,e)}function f(e,t,r,a){let n=i.default.from(e);return n.id&&(n=n.clone(),n.id=null),n.type??=r,n.portal??=o.Z.getDefault(),(0,u.w)(n),d(n,t,r,a),n}async function y(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const n=e.write({},t);return function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.Z(e,t,r)));if(t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new a.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),n}function w(e){(0,s.qj)(e,s.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function g(e,t){const{layer:r,createItemData:a,errorNamePrefix:o,itemType:i}=e;await p(e),m(r,o,i);const s=r.portalItem,u=(0,l.Y)(s),c=await y(r,u,t),d=await a({layer:r,layerJSON:c},s);return w(s),await s.update({data:d}),(0,n.D)(u),s}async function v(e,t){const{layer:r,createItemData:a,setItemProperties:o,newItem:i,errorNamePrefix:s,itemType:u}=e;await p(e);const c=f(i,s,u,r),d=(0,l.Y)(c),m=await y(r,d,t),g=await a({layer:r,layerJSON:m},c);return await o(r,c),w(c),await async function(e,t,r){const a=e.portal;await a.signIn(),await(a.user?.addItem({item:e,data:t,folder:r?.folder}))}(c,g,t),r.portalItem=c,(0,n.D)(d),c}},33516:(e,t,r)=>{r.d(t,{Y:()=>i,h:()=>o});var a=r(17452),n=r(48522);function o(e){return{origin:"portal-item",url:(0,a.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function i(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,a.mN)(e.itemUrl):null,portal:e.portal||n.Z.getDefault(),portalItem:e}}},14769:(e,t,r)=>{r.d(t,{w:()=>i});var a=r(68773),n=r(20102),o=r(71058);function i(e){if(a.default.apiKey&&(0,o.r)(e.portal.url))throw new n.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3529],{63529:(e,a,r)=>{r.r(a),r.d(a,{fromUrl:()=>d});var t=r(20102),n=r(17452),l=r(66677),s=r(71592),i=r(52104),o=r(84230),c=r(87344),u=r(96187);const y={FeatureLayer:!0,SceneLayer:!0};async function d(e){const a=e.properties?.customParameters,c=await async function(e,a){let r=(0,l.Qc)(e);if(null==r&&(r=await async function(e,a){const r=await(0,u.T)(e,{customParameters:a});let t=null,s=null;const i=r.type;if("Feature Layer"===i||"Table"===i?(t="FeatureServer",s=r.id??null):"indexedVector"===i?t="VectorTileServer":r.hasOwnProperty("mapName")?t="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?t="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":r.hasOwnProperty("streamUrls")?t="StreamServer":m(r)?(t="SceneServer",s=r.id):r.hasOwnProperty("layers")&&m(r.layers?.[0])&&(t="SceneServer"),!t)return null;const o=null!=s?(0,l.DR)(e):null;return{title:null!=o&&r.name||(0,n.vt)(e),serverType:t,sublayer:s,url:{path:null!=o?o.serviceUrl:(0,n.mN)(e).path}}}(e,a)),null==r)throw new t.Z("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:c,sublayer:d}=r;let f;const h={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(c){case"MapServer":f=null!=d?"FeatureLayer":await async function(e,a){return(await(0,u.T)(e,{customParameters:a})).tileInfo}(e,a)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const r=await(0,u.T)(e,{customParameters:a}),{tileInfo:t,cacheType:n}=r;f=t?"LERC"!==t?.format?.toUpperCase()||n&&"elevation"!==n.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await(0,u.T)(r.url.path,{customParameters:a});if(f="SceneLayer",e){const a=e?.layers;if("Voxel"===e?.layerType)f="VoxelLayer";else if(a?.length){const e=a[0]?.layerType;null!=e&&null!=o.fb[e]&&(f=o.fb[e])}}break}default:f=h[c]}const b="FeatureServer"===c,p="SceneServer"===c,v={parsedUrl:r,Constructor:null,layerId:b||p?d??void 0:void 0,layers:[],tables:[]};if(y[f]&&null==d){const r=await async function(e,a,r){let t,n,l=!1;switch(a){case"FeatureServer":{const a=await(0,i.V)(e,{customParameters:r});l=!!a.layersJSON,t=a.layersJSON||a.serviceJSON;break}case"SceneServer":{const a=await async function(e,a){const r=await(0,u.T)(e,{customParameters:a}),t=r.layers?.[0];if(!t)return{serviceInfo:r};try{const{serverUrl:t}=await(0,s.w)(e),n=await(0,u.T)(t,{customParameters:a}).catch((()=>null));return n&&(r.tables=n.tables),{serviceInfo:r,tableServerUrl:t}}catch{return{serviceInfo:r}}}(e,r);t=a.serviceInfo,n=a.tableServerUrl;break}default:t=await(0,u.T)(e,{customParameters:r})}const o=t?.layers,c=t?.tables;return{layers:o?.map((e=>({id:e.id}))).reverse()||[],tables:c?.map((e=>({serverUrl:n,id:e.id}))).reverse()||[],layerInfos:l?o:[],tableInfos:l?c:[]}}(e,c,a);b&&(v.sublayerInfos=r.layerInfos,v.tableInfos=r.tableInfos),1!==r.layers.length+r.tables.length?(v.layers=r.layers,v.tables=r.tables):(b||p)&&(v.layerId=r.layers[0]?.id??r.tables[0]?.id,v.sourceJSON=r.layerInfos?.[0]??r.tableInfos?.[0])}return v.Constructor=await w(f),v}(e.url,a),d={...e.properties,url:e.url};if(c.layers.length+c.tables.length===0)return null!=c.layerId&&(d.layerId=c.layerId),null!=c.sourceJSON&&(d.sourceJSON=c.sourceJSON),new c.Constructor(d);const h=new(0,(await Promise.all([r.e(163),r.e(4609),r.e(7865)]).then(r.bind(r,40504))).default)({title:c.parsedUrl.title});return await async function(e,a,r){function t(e,a,t,n){const l={...r,layerId:a,sublayerTitleMode:"service-name"};return null!=e&&(l.url=e),null!=t&&(l.sourceJSON=t),n(l)}for(const{id:r,serverUrl:n}of a.layers){const l=t(n,r,f(a.sublayerInfos,r),(e=>new a.Constructor(e)));e.add(l)}if(a.tables.length){const r=await w("FeatureLayer");a.tables.forEach((({id:n,serverUrl:l})=>{const s=t(l,n,f(a.tableInfos,n),(e=>new r(e)));e.tables.add(s)}))}}(h,c,d),h}function f(e,a){return e?e.find((e=>e.id===a)):null}function m(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function w(e){return(0,c.T[e])()}},71592:(e,a,r)=>{r.d(a,{w:()=>u});var t=r(40330),n=r(3172),l=r(20102),s=r(95330),i=r(66677),o=r(48522),c=r(15235);async function u(e,a){const r=(0,i.Qc)(e);if(!r)throw new l.Z("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const r=new c.default({id:a,apiKey:e.apiKey}),l=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.Z)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.r9)(e)}return null}(e);null!=l&&(r.portal=new o.Z({url:l}));try{return r.load({signal:e.signal})}catch(e){return(0,s.r9)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new c.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.r9)(e),null}}(u);if(!f?.url)throw new l.Z("related-service-not-found","Could not find feature service through portal item relationship");const m=await d(f.url,u);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.Z)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,i.Qc)(e);if(!r)throw new l.Z("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const o=y(a),c=e=>{const r={query:{f:"json"},responseType:"json",authMode:e,signal:a.signal};return(0,n.Z)(t,r)},u=c("anonymous").catch((()=>c("no-prompt"))),[d,f]=await Promise.all([u,o]),m=f&&f.layers,w=d.data&&d.data.layers;if(!Array.isArray(w))throw new Error("expected layers array");if(Array.isArray(m)){for(let e=0;e<Math.min(m.length,w.length);e++)if(m[e].id===s)return{serverUrl:t,layerId:w[e].id}}else if(null!=s&&s<w.length)return{serverUrl:t,layerId:w[s].id};throw new Error("could not find matching associated sublayer")}},52104:(e,a,r)=>{r.d(a,{V:()=>n});var t=r(96187);async function n(e,a){const r=await(0,t.T)(e,a);r.layers=r.layers.filter(l);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const s=await(0,t.T)(e+"/layers",a);return n.layersJSON={layers:s.layers.filter(l),tables:s.tables},n}function l(e){return!e.type||"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}},87344:(e,a,r)=>{r.d(a,{T:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(8153)]).then(r.bind(r,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(6170),r.e(1241),r.e(8217),r.e(3554)]).then(r.bind(r,30223))).default,CSVLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(3584)]).then(r.bind(r,45425))).default,DimensionLayer:async()=>(await Promise.all([r.e(163),r.e(9717)]).then(r.bind(r,40081))).default,ElevationLayer:async()=>(await Promise.all([r.e(163),r.e(6569),r.e(9016),r.e(2763)]).then(r.bind(r,65665))).default,FeatureLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(7520)]).then(r.bind(r,19238))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(9069)]).then(r.bind(r,23477))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1043)]).then(r.bind(r,3723))).default,GroupLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9059)]).then(r.bind(r,40504))).default,ImageryLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(4165),r.e(4599),r.e(6610),r.e(3663),r.e(4608)]).then(r.bind(r,60590))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(6610),r.e(4136),r.e(3663),r.e(5913)]).then(r.bind(r,74878))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(163),r.e(1241),r.e(1537)]).then(r.bind(r,9310))).default,KMLLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(6472)]).then(r.bind(r,42756))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(163),r.e(4998)]).then(r.bind(r,21786))).default,LinkChartLayer:async()=>(await Promise.all([r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(6404),r.e(8968),r.e(5286),r.e(801)]).then(r.bind(r,19087))).default,MapImageLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(4599),r.e(2863),r.e(7374)]).then(r.bind(r,27374))).default,MapNotesLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(2575)]).then(r.bind(r,62128))).default,MediaLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(4828)]).then(r.bind(r,57765))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(2341)]).then(r.bind(r,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971),r.e(6237)]).then(r.bind(r,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(6964)]).then(r.bind(r,76604))).default,PointCloudLayer:async()=>(await Promise.all([r.e(163),r.e(8775),r.e(8643),r.e(300)]).then(r.bind(r,10608))).default,RouteLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(261)]).then(r.bind(r,40153))).default,SceneLayer:async()=>(await Promise.all([r.e(163),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(6170),r.e(1241),r.e(8217),r.e(1174)]).then(r.bind(r,57476))).default,StreamLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(7132)]).then(r.bind(r,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(8654),r.e(8324),r.e(2596)]).then(r.bind(r,20697))).default,TileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(4599),r.e(9016),r.e(2863),r.e(8636)]).then(r.bind(r,98636))).default,UnknownLayer:async()=>(await r.e(4166).then(r.bind(r,44166))).default,UnsupportedLayer:async()=>(await r.e(9296).then(r.bind(r,39296))).default,VectorTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9016),r.e(4325),r.e(9805),r.e(5481)]).then(r.bind(r,94756))).default,VoxelLayer:async()=>(await Promise.all([r.e(163),r.e(8775),r.e(5464)]).then(r.bind(r,28865))).default,WFSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(6506)]).then(r.bind(r,12653))).default,WMSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(1574)]).then(r.bind(r,25906))).default,WMTSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971),r.e(2594)]).then(r.bind(r,72594))).default,WebTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971)]).then(r.bind(r,16199))).default}},96187:(e,a,r)=>{r.d(a,{T:()=>n});var t=r(3172);async function n(e,a){const{data:r}=await(0,t.Z)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3529],{63529:(e,a,r)=>{r.r(a),r.d(a,{fromUrl:()=>d});var t=r(20102),n=r(17452),l=r(66677),s=r(71592),i=r(52104),o=r(84230),c=r(87344),u=r(96187);const y={FeatureLayer:!0,SceneLayer:!0};async function d(e){const a=e.properties?.customParameters,c=await async function(e,a){let r=(0,l.Qc)(e);if(null==r&&(r=await async function(e,a){const r=await(0,u.T)(e,{customParameters:a});let t=null,s=null;const i=r.type;if("Feature Layer"===i||"Table"===i?(t="FeatureServer",s=r.id??null):"indexedVector"===i?t="VectorTileServer":r.hasOwnProperty("mapName")?t="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?t="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":r.hasOwnProperty("streamUrls")?t="StreamServer":m(r)?(t="SceneServer",s=r.id):r.hasOwnProperty("layers")&&m(r.layers?.[0])&&(t="SceneServer"),!t)return null;const o=null!=s?(0,l.DR)(e):null;return{title:null!=o&&r.name||(0,n.vt)(e),serverType:t,sublayer:s,url:{path:null!=o?o.serviceUrl:(0,n.mN)(e).path}}}(e,a)),null==r)throw new t.Z("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:c,sublayer:d}=r;let f;const h={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(c){case"MapServer":f=null!=d?"FeatureLayer":await async function(e,a){return(await(0,u.T)(e,{customParameters:a})).tileInfo}(e,a)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const r=await(0,u.T)(e,{customParameters:a}),{tileInfo:t,cacheType:n}=r;f=t?"LERC"!==t?.format?.toUpperCase()||n&&"elevation"!==n.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await(0,u.T)(r.url.path,{customParameters:a});if(f="SceneLayer",e){const a=e?.layers;if("Voxel"===e?.layerType)f="VoxelLayer";else if(a?.length){const e=a[0]?.layerType;null!=e&&null!=o.fb[e]&&(f=o.fb[e])}}break}default:f=h[c]}const b="FeatureServer"===c,p="SceneServer"===c,v={parsedUrl:r,Constructor:null,layerId:b||p?d??void 0:void 0,layers:[],tables:[]};if(y[f]&&null==d){const r=await async function(e,a,r){let t,n,l=!1;switch(a){case"FeatureServer":{const a=await(0,i.V)(e,{customParameters:r});l=!!a.layersJSON,t=a.layersJSON||a.serviceJSON;break}case"SceneServer":{const a=await async function(e,a){const r=await(0,u.T)(e,{customParameters:a}),t=r.layers?.[0];if(!t)return{serviceInfo:r};try{const{serverUrl:t}=await(0,s.w)(e),n=await(0,u.T)(t,{customParameters:a}).catch((()=>null));return n&&(r.tables=n.tables),{serviceInfo:r,tableServerUrl:t}}catch{return{serviceInfo:r}}}(e,r);t=a.serviceInfo,n=a.tableServerUrl;break}default:t=await(0,u.T)(e,{customParameters:r})}const o=t?.layers,c=t?.tables;return{layers:o?.map((e=>({id:e.id}))).reverse()||[],tables:c?.map((e=>({serverUrl:n,id:e.id}))).reverse()||[],layerInfos:l?o:[],tableInfos:l?c:[]}}(e,c,a);b&&(v.sublayerInfos=r.layerInfos,v.tableInfos=r.tableInfos),1!==r.layers.length+r.tables.length?(v.layers=r.layers,v.tables=r.tables):(b||p)&&(v.layerId=r.layers[0]?.id??r.tables[0]?.id,v.sourceJSON=r.layerInfos?.[0]??r.tableInfos?.[0])}return v.Constructor=await w(f),v}(e.url,a),d={...e.properties,url:e.url};if(c.layers.length+c.tables.length===0)return null!=c.layerId&&(d.layerId=c.layerId),null!=c.sourceJSON&&(d.sourceJSON=c.sourceJSON),new c.Constructor(d);const h=new(0,(await Promise.all([r.e(163),r.e(4609),r.e(7865)]).then(r.bind(r,40504))).default)({title:c.parsedUrl.title});return await async function(e,a,r){function t(e,a,t,n){const l={...r,layerId:a,sublayerTitleMode:"service-name"};return null!=e&&(l.url=e),null!=t&&(l.sourceJSON=t),n(l)}for(const{id:r,serverUrl:n}of a.layers){const l=t(n,r,f(a.sublayerInfos,r),(e=>new a.Constructor(e)));e.add(l)}if(a.tables.length){const r=await w("FeatureLayer");a.tables.forEach((({id:n,serverUrl:l})=>{const s=t(l,n,f(a.tableInfos,n),(e=>new r(e)));e.tables.add(s)}))}}(h,c,d),h}function f(e,a){return e?e.find((e=>e.id===a)):null}function m(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function w(e){return(0,c.T[e])()}},71592:(e,a,r)=>{r.d(a,{w:()=>u});var t=r(40330),n=r(3172),l=r(20102),s=r(95330),i=r(66677),o=r(48522),c=r(15235);async function u(e,a){const r=(0,i.Qc)(e);if(!r)throw new l.Z("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const r=new c.default({id:a,apiKey:e.apiKey}),l=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.Z)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.r9)(e)}return null}(e);null!=l&&(r.portal=new o.Z({url:l}));try{return r.load({signal:e.signal})}catch(e){return(0,s.r9)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new c.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.r9)(e),null}}(u);if(!f?.url)throw new l.Z("related-service-not-found","Could not find feature service through portal item relationship");const m=await d(f.url,u);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.Z)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,i.Qc)(e);if(!r)throw new l.Z("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const o=y(a),c=e=>{const r={query:{f:"json"},responseType:"json",authMode:e,signal:a.signal};return(0,n.Z)(t,r)},u=c("anonymous").catch((()=>c("no-prompt"))),[d,f]=await Promise.all([u,o]),m=f&&f.layers,w=d.data&&d.data.layers;if(!Array.isArray(w))throw new Error("expected layers array");if(Array.isArray(m)){for(let e=0;e<Math.min(m.length,w.length);e++)if(m[e].id===s)return{serverUrl:t,layerId:w[e].id}}else if(null!=s&&s<w.length)return{serverUrl:t,layerId:w[s].id};throw new Error("could not find matching associated sublayer")}},52104:(e,a,r)=>{r.d(a,{V:()=>n});var t=r(96187);async function n(e,a){const r=await(0,t.T)(e,a);r.layers=r.layers.filter(l);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const s=await(0,t.T)(e+"/layers",a);return n.layersJSON={layers:s.layers.filter(l),tables:s.tables},n}function l(e){return!e.type||"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}},87344:(e,a,r)=>{r.d(a,{T:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(8153)]).then(r.bind(r,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(6170),r.e(3975),r.e(1161),r.e(3554)]).then(r.bind(r,30223))).default,CSVLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(3584)]).then(r.bind(r,45425))).default,DimensionLayer:async()=>(await Promise.all([r.e(163),r.e(9717)]).then(r.bind(r,40081))).default,ElevationLayer:async()=>(await Promise.all([r.e(163),r.e(6569),r.e(9016),r.e(2763)]).then(r.bind(r,65665))).default,FeatureLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(7520)]).then(r.bind(r,19238))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(9069)]).then(r.bind(r,23477))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1043)]).then(r.bind(r,3723))).default,GroupLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9059)]).then(r.bind(r,40504))).default,ImageryLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(4165),r.e(4599),r.e(6610),r.e(3663),r.e(4608)]).then(r.bind(r,60590))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(6610),r.e(4136),r.e(3663),r.e(5913)]).then(r.bind(r,74878))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(163),r.e(3975),r.e(1537)]).then(r.bind(r,9310))).default,KMLLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(6472)]).then(r.bind(r,42756))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(163),r.e(4998)]).then(r.bind(r,21786))).default,LinkChartLayer:async()=>(await Promise.all([r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(6404),r.e(8968),r.e(5286),r.e(801)]).then(r.bind(r,19087))).default,MapImageLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(4599),r.e(2863),r.e(7374)]).then(r.bind(r,27374))).default,MapNotesLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(2575)]).then(r.bind(r,62128))).default,MediaLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(4828)]).then(r.bind(r,57765))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(2341)]).then(r.bind(r,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971),r.e(6237)]).then(r.bind(r,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(8654),r.e(9238),r.e(6964)]).then(r.bind(r,76604))).default,PointCloudLayer:async()=>(await Promise.all([r.e(163),r.e(8775),r.e(3975),r.e(8643),r.e(6138)]).then(r.bind(r,10608))).default,RouteLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(261)]).then(r.bind(r,40153))).default,SceneLayer:async()=>(await Promise.all([r.e(163),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(6170),r.e(3975),r.e(1161),r.e(1174)]).then(r.bind(r,57476))).default,StreamLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(7132)]).then(r.bind(r,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(8654),r.e(8324),r.e(2596)]).then(r.bind(r,20697))).default,TileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(1423),r.e(4165),r.e(3778),r.e(4599),r.e(9016),r.e(2863),r.e(8636)]).then(r.bind(r,98636))).default,UnknownLayer:async()=>(await r.e(4166).then(r.bind(r,44166))).default,UnsupportedLayer:async()=>(await r.e(9296).then(r.bind(r,39296))).default,VectorTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9016),r.e(4325),r.e(9805),r.e(5481)]).then(r.bind(r,94756))).default,VoxelLayer:async()=>(await Promise.all([r.e(163),r.e(8775),r.e(3975),r.e(9327)]).then(r.bind(r,28865))).default,WFSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(3928),r.e(3547),r.e(6569),r.e(1423),r.e(4165),r.e(3778),r.e(6404),r.e(6506)]).then(r.bind(r,12653))).default,WMSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8775),r.e(1574)]).then(r.bind(r,25906))).default,WMTSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971),r.e(2594)]).then(r.bind(r,72594))).default,WebTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971)]).then(r.bind(r,16199))).default}},96187:(e,a,r)=>{r.d(a,{T:()=>n});var t=r(3172);async function n(e,a){const{data:r}=await(0,t.Z)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1444],{16306:(e,t,r)=>{r.d(t,{aX:()=>A});var n=r(68773),a=r(20102),s=r(92604),o=r(38913),i=r(58901),l=r(73913),u=r(8744),d=r(40488),p=(r(66577),r(3172)),c=r(33955),f=r(11282),h=r(17452);async function y(e,t,r){const n="string"==typeof e?(0,h.mN)(e):e,a=t[0].spatialReference,s=(0,c.Ji)(t[0]),o={...r,query:{...n.query,f:"json",sr:(0,u.B9)(a),geometries:JSON.stringify((l=t,{geometryType:(0,c.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:i}=await(0,p.Z)(n.path+"/simplify",o);var l;return function(e,t,r){const n=(0,c.q9)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=r,t}))}(i.geometries,s,a)}const m=s.Z.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function b(e,t,r){if(t){const t=function(e,t){if(!(e instanceof i.Z||e instanceof o.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw m.error(e),new a.Z(e)}const r=(0,l.x3)(e),n=[];for(const e of r){const r=[];n.push(r),r.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const a=e[n][0],s=e[n][1],o=e[n+1][0],i=e[n+1][1],l=Math.sqrt((o-a)*(o-a)+(i-s)*(i-s)),u=(i-s)/l,d=(o-a)/l,p=l/t;if(p>1){for(let e=1;e<=p-1;e++){const n=e*t,o=d*n+a,i=u*n+s;r.push([o,i])}const e=(l+Math.floor(p-1)*t)/2,n=d*e+a,o=u*e+s;r.push([n,o])}r.push([o,i])}}return function(e){return"polygon"===e.type}(e)?new o.Z({rings:n,spatialReference:e.spatialReference}):new i.Z({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.Sx)(t,!0)}return r&&(e=(0,l.Sy)(e,r)),e}function F(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=(0,l.XZ)(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=(0,l.XZ)(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=(0,l.XZ)(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=(0,l.XZ)(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function Z(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const a=t.cutIndexes[n],s=t.geometries[n],o=(0,l.x3)(s);for(let e=0;e<o.length;e++){const t=o[e];t.some((r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const n=t[e][0];r=n>r?n:r}r=Number(r.toFixed(9));const n=-360*(0,l.XZ)(r,180);for(let r=0;r<t.length;r++){const t=s.getPoint(e,r);s.setPoint(e,r,t.clone().offset(n,0))}return!0}}))}if(a===r){if(g(e))for(const t of(0,l.x3)(s))e[a]=e[a].addRing(t);else if(w(e))for(const t of(0,l.x3)(s))e[a]=e[a].addPath(t)}else r=a,e[a]=s}return e}async function A(e,t,r){if(!Array.isArray(e))return A([e],t);t&&"string"!=typeof t&&m.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const a="string"==typeof t?t:t?.url??n.default.geometryServiceUrl;let s,h,g,w,v,S,I,R,$=0;const E=[],x=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,h=(0,u.C5)(s),g=s.isWebMercator,S=g?102100:4326,w=l.UZ[S].maxX,v=l.UZ[S].minX,I=l.UZ[S].plus180Line,R=l.UZ[S].minus180Line),h)if("mesh"===t.type)x.push(t);else if("point"===t.type)x.push(F(t.clone(),w,v));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>F(e,w,v))),x.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,h);x.push(e.rings?new o.Z(e):e)}else if(t.extent){const e=t.extent,r=(0,l.XZ)(e.xmin,v)*(2*w);let n=0===r?t.clone():(0,l.Sy)(t.clone(),r);e.offset(r,0),e.intersects(I)&&e.xmax!==w?($=e.xmax>$?e.xmax:$,n=b(n,g),E.push(n),x.push("cut")):e.intersects(R)&&e.xmin!==v?($=e.xmax*(2*w)>$?e.xmax*(2*w):$,n=b(n,g,360),E.push(n),x.push("cut")):x.push(n)}else x.push(t.clone());else x.push(t);else x.push(t);let O=(0,l.XZ)($,w),L=-90;const U=O,k=new i.Z;for(;O>0;){const e=360*O-180;k.addPath([[e,L],[e,-1*L]]),L*=-1,O--}if(E.length>0&&U>0){const t=Z(E,await async function(e,t,r,n){const a=(0,f.en)(e),s=t[0].spatialReference,o={...n,responseType:"json",query:{...a.query,f:"json",sr:(0,u.B9)(s),target:JSON.stringify({geometryType:(0,c.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},i=await(0,p.Z)(a.path+"/cut",o),{cutIndexes:l,geometries:d=[]}=i.data;return{cutIndexes:l,geometries:d.map((e=>{const t=(0,c.im)(e);return t.spatialReference=s,t}))}}(a,E,k,r)),n=[],s=[];for(let r=0;r<x.length;r++){const a=x[r];if("cut"!==a)s.push(a);else{const a=t.shift(),o=e[r];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&a.rings.length>=o.rings.length?(n.push(a),s.push("simplify")):s.push(g?(0,d.$)(a):a)}}if(!n.length)return s;const o=await y(a,n,r),i=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?i.push(t):i.push(g?(0,d.$)(o.shift()):o.shift())}return i}const X=[];for(let e=0;e<x.length;e++){const t=x[e];if("cut"!==t)X.push(t);else{const e=E.shift();X.push(!0===g?(0,d.$)(e):e)}}return X}},73913:(e,t,r)=>{r.d(t,{Sy:()=>l,UZ:()=>o,XZ:()=>i,x3:()=>u});var n=r(58901),a=r(82971),s=r(33955);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.Z.WebMercator}),minus180Line:new n.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.Z({paths:[[[180,-180],[180,180]]],spatialReference:a.Z.WGS84}),minus180Line:new n.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:a.Z.WGS84})}};function i(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const r=u(e);for(const e of r)for(const r of e)r[0]+=t;return e}function u(e){return(0,s.oU)(e)?e.rings:e.paths}},14720:(e,t,r)=>{r.d(t,{Ey:()=>b,applyEdits:()=>F,aw:()=>g,uploadAssets:()=>$});var n=r(38171),a=r(46791),s=r(20102),o=r(22974),i=r(92604),l=r(95330),u=r(17452),d=r(41123),p=r(16306),c=r(54253),f=r(2981),h=r(84230);function y(e){return e&&null!=e.applyEdits}function m(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function g(e){return e.every(m)}function w(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function b(e){return e.every(w)}async function F(e,t,r,n={}){let u;if((0,c.lQ)(e)&&e.url)u=(0,c.jF)(e.url,e.layerId,n.gdbVersion,"original-and-current-features"===n.returnServiceEditsOption);else{u=(0,l.hh)(),u.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:u.promise};e.emit("apply-edits",t)}try{const{results:l,edits:p}=await async function(e,t,r,n){if(await e.load(),!y(t))throw new s.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,h.ln)(e))throw new s.Z(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:o,options:l}=await async function(e,t,r){const n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=null!=e.infoFor3D;if(!t||!n&&!o)throw new s.Z(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const u=(0,h.S1)(e);if(!u.data.isVersioned&&r?.gdbVersion)throw new s.Z(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!u.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new s.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!u.editing.supportsGlobalId&&r?.globalIdUsed)throw new s.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!u.editing.supportsGlobalId&&o)throw new s.Z(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&o)throw new s.Z(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const p={...r};if(null!=p.rollbackOnFailureEnabled||u.editing.supportsRollbackOnFailure||(p.rollbackOnFailureEnabled=!0),p.rollbackOnFailureEnabled||"original-and-current-features"!==p.returnServiceEditsOption||(!1===p.rollbackOnFailureEnabled&&i.Z.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),p.rollbackOnFailureEnabled=!0),!u.editing.supportsReturnServiceEditsInSourceSpatialReference&&p.returnServiceEditsInSourceSR)throw new s.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(p.returnServiceEditsInSourceSR&&"original-and-current-features"!==p.returnServiceEditsOption)throw new s.Z(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const c={...t};if(c.addFeatures=t&&a.Z.isCollection(t.addFeatures)?t.addFeatures.toArray():c.addFeatures||[],c.updateFeatures=t&&a.Z.isCollection(t.updateFeatures)?t.updateFeatures.toArray():c.updateFeatures||[],c.deleteFeatures=t&&a.Z.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():c.deleteFeatures||[],c.addFeatures.length&&!u.operations.supportsAdd)throw new s.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(c.updateFeatures.length&&!u.operations.supportsUpdate)throw new s.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(c.deleteFeatures.length&&!u.operations.supportsDelete)throw new s.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");c.addAttachments=c.addAttachments||[],c.updateAttachments=c.updateAttachments||[],c.deleteAttachments=c.deleteAttachments||[],c.addFeatures=c.addFeatures.map(I),c.updateFeatures=c.updateFeatures.map(I),c.addAssetFeatures=[];const y=r?.globalIdUsed||l;if(y){const{globalIdField:t}=e;if(null==t)throw new s.Z(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");c.addFeatures.forEach((e=>function(e,t){const{attributes:r}=e;null==r[t]&&(r[t]=(0,d.z)())}(e,t)))}return c.addFeatures.forEach((t=>function(e,t,r){Z(e,t,r),A(e,t)}(t,e,y))),c.updateFeatures.forEach((t=>function(e,t,r){Z(e,t,r),A(e,t);const n=(0,h.S1)(t);if("geometry"in e&&null!=e.geometry&&!n?.editing.supportsGeometryUpdate)throw new s.Z(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,y))),c.deleteFeatures.forEach((t=>function(e,t,r){Z(e,t,r)}(t,e,y))),c.addAttachments.forEach((t=>v(t,e))),c.updateAttachments.forEach((t=>v(t,e))),l&&await async function(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,n=(0,f.S0)("model/gltf-binary",r.supportedFormats)??(0,f.Ow)("glb",r.supportedFormats);if(!n||!r.editFormats.includes(n))throw new s.Z(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const t of e.addFeatures??[])R(t)&&a.push(t);for(const t of e.updateFeatures??[])R(t)&&a.push(t)}(c,e),{edits:await S(c),options:p}}(e,r,n);return o.addFeatures?.length||o.updateFeatures?.length||o.deleteFeatures?.length||o.addAttachments?.length||o.updateAttachments?.length||o.deleteAttachments?.length?{edits:o,results:await t.applyEdits(o,l)}:{edits:o,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,r,n),c=e=>e.filter((e=>!e.error)).map(o.d9),m={edits:p,addedFeatures:c(l.addFeatureResults),updatedFeatures:c(l.updateFeatureResults),deletedFeatures:c(l.deleteFeatureResults),addedAttachments:c(l.addAttachmentResults),updatedAttachments:c(l.updateAttachmentResults),deletedAttachments:c(l.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:l.editMoment?new Date(l.editMoment):null};return l.editedFeatureResults?.length&&(m.editedFeatures=l.editedFeatureResults),u.resolve(m),l}catch(e){throw u.reject(e),e}}function Z(e,t,r){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new s.Z(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new s.Z(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new s.Z(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new s.Z(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function A(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new s.Z(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function v(e,t){const{feature:r,attachment:n}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new s.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new s.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!n.globalId)throw new s.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!n.data&&!n.uploadId)throw new s.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(n.data instanceof File&&n.data.name||n.name))throw new s.Z(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&n.uploadId)throw new s.Z(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof n.data){const e=(0,u.sJ)(n.data);if(e&&!e.isBase64)throw new s.Z(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function S(e){const t=e.addFeatures??[],r=e.updateFeatures??[],n=t.concat(r).map((e=>e.geometry)),a=await(0,p.aX)(n),s=t.length,o=r.length;return a.slice(0,s).forEach(((e,r)=>t[r].geometry=e)),a.slice(s,s+o).forEach(((e,t)=>r[t].geometry=e)),e}function I(e){const t=new n.Z;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function R(e){return"mesh"===e?.geometry?.type}function $(e,t,r,n){if(!y(t))throw new s.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new s.Z(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,n)}},2981:(e,t,r)=>{r.d(t,{$6:()=>h,$z:()=>s,F7:()=>a,Ow:()=>i,S0:()=>o,d1:()=>l,dm:()=>u});const n=[["binary","application/octet-stream","bin",""]];function a(e,t){return null!=p(t.name,e?.supportedFormats??[])}function s(e,t){if(!e)return!1;const r=u(t,e.supportedFormats??[]);return null!=r&&e.editFormats.includes(r)}function o(e,t){return c(function(e,t){const r=e.toLowerCase();return d(t).find((e=>f(e)===r))}(e,t))}function i(e,t){return c(p(e,t))}function l(e,t){return f(function(e,t){return d(t).find((t=>c(t)===e))}(e,t))}function u(e,t){return i(e.name,t)??o(e.type,t)}function d(e){return[...n,...e]}function p(e,t){const r=e.toLowerCase();return d(t).find((e=>function(e){return e?.[2].split(",").map((e=>e.toLowerCase()))??[]}(e).some((e=>r.endsWith(e)))))}function c(e){return e?.[0]}function f(e){return e?.[1].toLowerCase()}function h(e){return e.tables?.find((e=>"assetMaps"===e.role))}},11282:(e,t,r)=>{r.d(t,{cv:()=>i,en:()=>o,lA:()=>s}),r(68773),r(40330);var n=r(22974),a=r(17452);function s(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,a.mN)(e):(0,n.d9)(e)}function i(e,t,r){const n={};for(const a in e){if("declaredClass"===a)continue;const s=e[a];if(null!=s&&"function"!=typeof s)if(Array.isArray(s)){n[a]=[];for(let e=0;e<s.length;e++)n[a][e]=i(s[e])}else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(r&&r[a]);n[a]=t?e:JSON.stringify(e)}else n[a]=t?s:JSON.stringify(s);else n[a]=s}return n}r(71058)}}]);
|