@arcgis/core 4.34.0-next.85 → 4.34.0-next.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/Basemap.js +1 -1
  2. package/arcade/functions/measures.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/06c389283ee5b60573f2.js +1 -0
  5. package/assets/esri/core/workers/chunks/0b679d5a1bfdbd006d6e.js +1 -0
  6. package/assets/esri/core/workers/chunks/1537b02e674f8ef77f4a.js +1 -0
  7. package/assets/esri/core/workers/chunks/{9eb1bfcb9b05f2a36748.js → 1f2d13466c60a6b57717.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7a23b127f551bf13ef54.js → 268f5b233640a9dbbf89.js} +2 -2
  9. package/assets/esri/core/workers/chunks/2896ada406074f754b00.js +1 -0
  10. package/assets/esri/core/workers/chunks/28d30be414e59eabd963.js +1 -0
  11. package/assets/esri/core/workers/chunks/29471e0b3f7296dee096.js +1 -0
  12. package/assets/esri/core/workers/chunks/{3192b68675ff2afcb1d6.js → 2d3ae187f8aa3495d4ae.js} +1 -1
  13. package/assets/esri/core/workers/chunks/336b54144afec0c7d396.js +2 -0
  14. package/assets/esri/core/workers/chunks/42bc1e981624ce9844a4.js +1 -0
  15. package/assets/esri/core/workers/chunks/436bbe99bedd7b331edb.js +1 -0
  16. package/assets/esri/core/workers/chunks/{d66cdb9bb494da19696b.js → 47e4f66c33bb697fbe6b.js} +2 -2
  17. package/assets/esri/core/workers/chunks/4840bd93d8fe15c7aefd.js +1 -0
  18. package/assets/esri/core/workers/chunks/4a06ab00d095f63598b5.js +1 -0
  19. package/assets/esri/core/workers/chunks/4d4db6854aff7656f6e1.js +1 -0
  20. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +1 -0
  21. package/assets/esri/core/workers/chunks/655a878ddea4907d830e.js +1 -0
  22. package/assets/esri/core/workers/chunks/68f5a2d2666636c3f807.js +1 -0
  23. package/assets/esri/core/workers/chunks/6c36cef0b58b87a1f17f.js +316 -0
  24. package/assets/esri/core/workers/chunks/72fe4f1f789abb5b4035.js +1 -0
  25. package/assets/esri/core/workers/chunks/8307f635a5c0c4a95825.js +1 -0
  26. package/assets/esri/core/workers/chunks/{afb76f9d6abedef771df.js → 8380a092ffc8e92ede7a.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f8f85207b382c1ea038c.js → 97489bf16a1d327992b2.js} +3 -3
  28. package/assets/esri/core/workers/chunks/9d7a22746dae1451deaf.js +1 -0
  29. package/assets/esri/core/workers/chunks/a2652d10bb0bc41c9a8d.js +1 -0
  30. package/assets/esri/core/workers/chunks/a845c68e76382a73da5e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{9c64b78c5c9b35b31d98.js → aa78b69219d9a0ef1c54.js} +2 -2
  32. package/assets/esri/core/workers/chunks/{1859a11df9f579b993d7.js → b2fbb44e219232e61cbd.js} +1 -1
  33. package/assets/esri/core/workers/chunks/b4349db7155673329432.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d153b29c542c37ae1636.js → c50e8d5f554cf151865c.js} +2 -2
  35. package/assets/esri/core/workers/chunks/c5cc0fc652432a9264cc.js +1 -0
  36. package/assets/esri/core/workers/chunks/cab2a1382bdd32bb34d8.js +1 -0
  37. package/assets/esri/core/workers/chunks/ce937ff0dd1147ea297e.js +1 -0
  38. package/assets/esri/core/workers/chunks/d142a42755a78bb157ed.js +1 -0
  39. package/assets/esri/core/workers/chunks/{280af3640f8e93c1024e.js → d6e0528eacee7ea4c1ce.js} +2 -2
  40. package/assets/esri/core/workers/chunks/d9d86cf0500fa29d1d43.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b15ff6c9ef2de8a49853.js → f651c05604eab83aef5f.js} +2 -2
  42. package/assets/esri/core/workers/chunks/{ed773dab5965e42a2879.js → f6e18668f728dfd8ba5e.js} +2 -2
  43. package/assets/esri/core/workers/chunks/ff8e2f998169ca3a7a68.js +1 -0
  44. package/assets/esri/libs/dracoMeshDecoder/draco_mesh_decoder.wasm +0 -0
  45. package/assets/esri/libs/i3s/i3s.wasm +0 -0
  46. package/chunks/CloudsComposition.glsl.js +2 -2
  47. package/chunks/HUDMaterial.glsl.js +49 -50
  48. package/chunks/LineMarker.glsl.js +34 -34
  49. package/chunks/PointRenderer.glsl.js +4 -4
  50. package/chunks/ShadowHighlight.glsl.js +3 -3
  51. package/chunks/draco_mesh_decoder.js +1 -1
  52. package/config.js +1 -1
  53. package/core/NestedMap.js +1 -1
  54. package/core/iteratorUtils.js +1 -1
  55. package/editing/geometry/lineUtils.js +1 -1
  56. package/interfaces.d.ts +55 -7
  57. package/kernel.js +1 -1
  58. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  59. package/layers/IntegratedMeshLayer.js +1 -1
  60. package/layers/SceneLayer.js +1 -1
  61. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  62. package/layers/knowledgeGraph/cypherUtils.js +1 -1
  63. package/layers/support/layerUtils.js +1 -1
  64. package/package.json +5 -5
  65. package/support/basemapEnsureType.js +1 -1
  66. package/support/revision.js +1 -1
  67. package/support/userTypeGuards/isBasemap.js +5 -0
  68. package/symbols/support/previewSymbol2D.js +1 -1
  69. package/views/3d/FocusAreasView.js +1 -1
  70. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  71. package/views/3d/glTF/internal/Resource.js +1 -1
  72. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  73. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  74. package/views/3d/support/engineContent/marker.js +1 -1
  75. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  76. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
  77. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  78. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  79. package/views/3d/webgl-engine/materials/renderers/InstancedCommandVAO.js +5 -0
  80. package/views/3d/webgl-engine/materials/renderers/InstancedCommandVAOs.js +5 -0
  81. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  82. package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
  83. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  84. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  85. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +14 -9
  86. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  87. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  88. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  89. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  90. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
  91. package/views/BasemapView.js +1 -1
  92. package/views/GroundView.js +1 -1
  93. package/views/SceneView.js +1 -1
  94. package/views/View.js +1 -1
  95. package/views/View2D.js +1 -1
  96. package/views/support/LayerViewManager.js +1 -1
  97. package/views/webgl/RenderbufferDescriptor.js +1 -1
  98. package/views/webgl/TextureDescriptor.js +1 -1
  99. package/views/webgl/Util.js +1 -1
  100. package/views/webgl/VertexArrayObject.js +1 -1
  101. package/webscene/Slide.js +1 -1
  102. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  103. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  104. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  105. package/widgets/Editor/support/SketchController.js +1 -1
  106. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  107. package/widgets/Editor/workflowUtils.js +1 -1
  108. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  109. package/widgets/Sketch/SketchViewModel.js +1 -1
  110. package/widgets/Sketch/adapters/layer/GraphicsLayerAdapter.js +5 -0
  111. package/widgets/Sketch/adapters/layer/MapNotesLayerAdapter.js +5 -0
  112. package/assets/esri/core/workers/chunks/25ea02dd7d45a90cbb3b.js +0 -1
  113. package/assets/esri/core/workers/chunks/264a9a916e1e972b69d7.js +0 -1
  114. package/assets/esri/core/workers/chunks/30c85a1a4f118cc45a25.js +0 -1
  115. package/assets/esri/core/workers/chunks/3ef8a7468d7e3b2f0b69.js +0 -351
  116. package/assets/esri/core/workers/chunks/5c1cdc2ec06c4c6bd0b3.js +0 -1
  117. package/assets/esri/core/workers/chunks/609abf071c4ea24955c2.js +0 -1
  118. package/assets/esri/core/workers/chunks/71c2a8e5a17803d3e949.js +0 -1
  119. package/assets/esri/core/workers/chunks/7889a909394c61a9d3e0.js +0 -1
  120. package/assets/esri/core/workers/chunks/99ac292a858bbedc6a89.js +0 -1
  121. package/assets/esri/core/workers/chunks/9a6fa91dd204f64d2590.js +0 -1
  122. package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +0 -1
  123. package/assets/esri/core/workers/chunks/aa1eb7b4d9ccda725da5.js +0 -1
  124. package/assets/esri/core/workers/chunks/b4a053063e6022080d31.js +0 -1
  125. package/assets/esri/core/workers/chunks/b4b26cc2ba3ff30e1d03.js +0 -1
  126. package/assets/esri/core/workers/chunks/bbb585f0b484ab5eabb3.js +0 -1
  127. package/assets/esri/core/workers/chunks/c2bc70b65f5c2a2c9671.js +0 -1
  128. package/assets/esri/core/workers/chunks/cd1869e183001266c4c1.js +0 -2
  129. package/assets/esri/core/workers/chunks/d2fe403d6ab237bc89c2.js +0 -1
  130. package/assets/esri/core/workers/chunks/d51e8eeb1e1eb0605cc9.js +0 -1
  131. package/assets/esri/core/workers/chunks/e080628ac6e1cf25dc72.js +0 -1
  132. package/assets/esri/core/workers/chunks/e8e0f73fb94e63e2abc3.js +0 -1
  133. package/assets/esri/core/workers/chunks/f45c343527709f6f91c2.js +0 -1
  134. package/assets/esri/core/workers/chunks/fcac475e4e82911b3126.js +0 -1
  135. /package/assets/esri/core/workers/chunks/{7a23b127f551bf13ef54.js.LICENSE.txt → 268f5b233640a9dbbf89.js.LICENSE.txt} +0 -0
  136. /package/assets/esri/core/workers/chunks/{cd1869e183001266c4c1.js.LICENSE.txt → 336b54144afec0c7d396.js.LICENSE.txt} +0 -0
  137. /package/assets/esri/core/workers/chunks/{280af3640f8e93c1024e.js.LICENSE.txt → 47e4f66c33bb697fbe6b.js.LICENSE.txt} +0 -0
  138. /package/assets/esri/core/workers/chunks/{9c64b78c5c9b35b31d98.js.LICENSE.txt → aa78b69219d9a0ef1c54.js.LICENSE.txt} +0 -0
  139. /package/assets/esri/core/workers/chunks/{d153b29c542c37ae1636.js.LICENSE.txt → c50e8d5f554cf151865c.js.LICENSE.txt} +0 -0
  140. /package/assets/esri/core/workers/chunks/{b15ff6c9ef2de8a49853.js.LICENSE.txt → d6e0528eacee7ea4c1ce.js.LICENSE.txt} +0 -0
  141. /package/assets/esri/core/workers/chunks/{d66cdb9bb494da19696b.js.LICENSE.txt → f651c05604eab83aef5f.js.LICENSE.txt} +0 -0
  142. /package/assets/esri/core/workers/chunks/{ed773dab5965e42a2879.js.LICENSE.txt → f6e18668f728dfd8ba5e.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2561,3548,4342,4812,7548,7694],{4146:(e,t,i)=>{i.d(t,{A:()=>w});var r=i(31635),n=i(78888),s=i(49186),a=i(65529),l=i(4902),o=i(92474),u=i(53966),c=i(74887),d=i(84952),h=i(10107),p=(i(44208),i(87811),i(40608)),f=i(5443),y=i(16930),g=i(92602),m=i(79677);let _=0,w=class extends((0,a.Zt)((0,l.sA)(o.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+_++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([i.e(812),i.e(7982)]).then(i.bind(i,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await Promise.all([i.e(812),i.e(5613),i.e(5710)]).then(i.bind(i,45613));try{return await r(t)}catch(e){const i=t?.portalItem,r=i?.id||"unset",n=i?.portal?.url||g.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,n.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,r.Cg)([(0,h.MZ)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0})],w.prototype,"effectiveVisible",null),(0,r.Cg)([(0,h.MZ)({type:f.A})],w.prototype,"fullExtent",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,r.Cg)([(0,h.MZ)({type:String,clonable:!1})],w.prototype,"id",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,r.Cg)([(0,h.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,r.Cg)([(0,h.MZ)({clonable:!1})],w.prototype,"parent",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,r.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],w.prototype,"persistenceEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,r.Cg)([(0,h.MZ)({type:y.A})],w.prototype,"spatialReference",void 0),(0,r.Cg)([(0,h.MZ)({type:String})],w.prototype,"title",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,r.Cg)([(0,h.MZ)()],w.prototype,"url",void 0),(0,r.Cg)([(0,h.MZ)({type:m.A})],w.prototype,"visibilityTimeExtent",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,r.Cg)([(0,p.$)("esri.layers.Layer")],w)},4902:(e,t,i)=>{i.d(t,{PH:()=>l,sA:()=>a});var r=i(31635),n=i(40608);let s=0;const a=e=>{const t=e;let i=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return i=(0,r.Cg)([(0,n.$)("esri.core.Identifiable")],i),i},l=e=>{const t=e;let i=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:s++})}};return i=(0,r.Cg)([(0,n.$)("esri.core.Identifiable.NumericIdentifiable")],i),i};a(class{})},6797:(e,t,i)=>{i.d(t,{Mj:()=>h,Ui:()=>f,w2:()=>p});var r=i(65008),n=i(7762),s=i(88620);const a=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof r.A}function o(e){return e instanceof n.A?Object.keys(e.items):l(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof n.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function d(e,t){const i=e.diff;if(i&&"function"==typeof i)return i(e,t);const r=o(e),n=o(t);if(0===r.length&&0===n.length)return;if(!r.length||!n.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=n.filter(e=>!r.includes(e)),h=r.filter(e=>!n.includes(e)),p=r.filter(i=>n.includes(i)&&u(e,i)!==u(t,i)).concat(s,h).sort(),f=c(e);if(f&&a.has(f)&&p.length)return{type:"complete",oldValue:e,newValue:t};let y;const g=l(e)&&l(t);for(const r of p){const n=u(e,r),s=u(t,r);let a;if((g||"function"!=typeof n&&"function"!=typeof s)&&n!==s&&(null!=n||null!=s)){if(i&&i[r]&&"function"==typeof i[r])a=i[r]?.(n,s);else if(n instanceof Date&&s instanceof Date){if(n.getTime()===s.getTime())continue;a={type:"complete",oldValue:n,newValue:s}}else a="object"==typeof n&&"object"==typeof s&&c(n)===c(s)?d(n,s):{type:"complete",oldValue:n,newValue:s};null!=a&&(null!=y?y.diff[r]=a:y={type:"partial",diff:{[r]:a}})}}return y}function h(e,t){return function(e,t){if(null==e)return!1;const i=t.split(".");let r=e;for(const e of i){if("complete"===r.type)return!0;if("partial"!==r.type)return!1;{const t=r.diff[e];if(!t)return!1;r=t}}return!0}(e,t)}function p(e,t){if(!e)return!1;if("partial"===e.type){const i=Object.keys(e.diff);return 1===i.length&&i[0]===t}return!1}function f(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>n});var r=i(37539);function n(e,t,i,n,s,a,l=Math.floor(e.length/3)){const o=(0,r.jd)(t,s);if(null==o)return!1;if(o===r.pO){if(e===n&&i===a)return!0;const t=i+3*l;for(let r=i,s=a;r<t;r++,s++)n[s]=e[r];return!0}const u=i+3*l;for(let t=i,r=a;t<u;t+=3,r+=3)o(e,t,n,r);return!0}},17311:(e,t,i)=>{i.d(t,{A:()=>h});var r=i(31635),n=i(65008),s=i(4576),a=i(60999),l=i(7762),o=i(10107),u=(i(44208),i(53966),i(40608)),c=i(30524),d=i(43668);let h=class extends n.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,a.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??i.e(9926).then(i.bind(i,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const i=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(i.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:i,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(i,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const i=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of i){const i=t.split("."),r=this.fieldsIndex.get(i.at(-1)??"");r&&e.add(r.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const i of t){const t=this.fieldsIndex.get(i);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,i){const r=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],i)).get(r)??""}async getTitles(e,t,i){const r=new Map,n=i?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);i?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:a,workingTitle:l}=this,o=l&&a;t.forEach(t=>{const i=t.getObjectId()??t.attributes[e.objectIdField],u=o?s({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:a,globalAttributes:this._createFormattedAttributes(e,t,n).global,layer:e,text:l}):"";r.set(i,u)})}catch{}return r}async _checkAndReQueryGraphics(e,t){const i=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(s.Ru);if(i.length!==t.length)return t;if(t.some(e=>!(0,c.Kl)(e,this.requiredFields))){const r=e.createQuery();r.where="1=1",r.outFields=[...this.requiredFields],r.objectIds=i;const n=await e.queryFeatures(r);if(n?.features.length===t.length)return n.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const i of e){if(!i.fieldName)continue;const e=this.fieldsIndex.get(i.fieldName),r=e?.name??i.fieldName;i.fieldName=r,t.set(r.toLowerCase(),i)}return t}_createFormattedAttributes(e,t,i="system"){const r=this.effectivePopupTemplate?.fieldInfos??[],n={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const i=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{n[`expression/${e.name}`]=e.func({vars:{$feature:i}})}catch{}}const s={...t.attributes,...n};return{global:this._featureUtils.formatAttributes({fieldInfos:r,attributes:s,graphic:t,timeZone:i,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,c.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,r.Cg)([(0,o.MZ)({readOnly:!0})],h.prototype,"_arcadeTask",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"_featureUtils",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],h.prototype,"featureUtilsPromise",null),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],h.prototype,"calculatedExpressions",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"displayField",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"effectivePopupTemplate",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"expressionsUsedInTitle",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"fieldInfoMap",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"fields",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"objectIdField",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"requiredFields",null),h=(0,r.Cg)([(0,u.$)("esri.layers.support.TitleCreator")],h)},22671:(e,t,i)=>{i.d(t,{A:()=>_});var r,n=i(31635),s=i(52106),a=i(66552),l=i(25482),o=i(4718),u=i(10107),c=(i(44208),i(53966),i(36005)),d=i(40608),h=i(43937),p=i(16930),f=i(65864),y=i(50498),g=i(20437);const m=new a.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let _=r=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,i,r){if(e)return void m.write(e,t,i,r);const{features:n}=this;if(n)for(const e of n)if(null!=e?.geometry)return void m.write(e.geometry.type,t,i,r)}readQueryGeometry(e,t){if(!e)return null;const i=!!e.spatialReference,r=(0,f.rS)(e);return r&&!i&&t.spatialReference&&(r.spatialReference=p.A.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,o.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let i=0;i<t.features.length;i++){const r=t.features[i];if(r.geometry){const t=e?.[i];r.geometry=t?.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,i],translate:[r,n]}=e,s=this.features,a=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-r)/t),e=>Math.round((n-e)/i));for(let e=0,t=s.length;e<t;e++)a?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:i}=this;if(!i)return this;const{translate:[r,n],scale:[s,a]}=i;let l=null,o=null;if(this.hasZ&&null!=i?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=i;l=i=>i*t+e}if(this.hasM&&null!=i?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=i;o=i=>null==i?i:i*t+e}const u=this._getHydrationFunction(e,e=>e*s+r,e=>n-e*a,l,o);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,i){const r=p.A.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const s=e[t],a=i.fromJSON(s),l=s.geometry?.spatialReference;null==a.geometry||l||(a.geometry.spatialReference=r);const o=s.aggregateGeometries,u=a.aggregateGeometries;if(o&&null!=u)for(const e in u){const t=u[e],i=o[e],n=i?.spatialReference;null==t||n||(t.spatialReference=r)}n.push(a)}return n}_quantizePoints(e,t,i){let r,n;const s=[];for(let a=0,l=e.length;a<l;a++){const l=e[a];if(a>0){const e=t(l[0]),a=i(l[1]);e===r&&a===n||(s.push([e-r,a-n]),r=e,n=a)}else r=t(l[0]),n=i(l[1]),s.push([r,n])}return s.length>0?s:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,f.Bi)(e)?e.rings:e.paths,n=[];for(let e=0,s=r.length;e<s;e++){const s=r[e],a=this._quantizePoints(s,t,i);a&&n.push(a)}return n.length>0?((0,f.Bi)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,i);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i,r,n){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,f.Bi)(e)?e.rings:e.paths;let a,l;for(let e=0,r=s.length;e<r;e++){const r=s[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];e>0?(a+=n[0],l+=n[1]):(a=n[0],l=n[1]),n[0]=t(a),n[1]=i(l)}}if(r&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2]),i[3]=n(i[3])}}else if(r)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=n(i[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let a,l;for(let e=0,r=s.length;e<r;e++){const r=s[e];e>0?(a+=r[0],l+=r[1]):(a=r[0],l=r[1]),r[0]=t(a),r[1]=i(l)}if(r&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=r(t[2]),t[3]=n(t[3])}else if(r)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=r(t[2])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}}:null}};(0,n.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],_.prototype,"displayFieldName",void 0),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"exceededTransferLimit",void 0),(0,n.Cg)([(0,u.MZ)({type:[s.A],json:{write:!0}})],_.prototype,"features",void 0),(0,n.Cg)([(0,c.w)("features")],_.prototype,"readFeatures",null),(0,n.Cg)([(0,u.MZ)({type:[g.A],json:{write:!0}})],_.prototype,"fields",void 0),(0,n.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],_.prototype,"geometryType",void 0),(0,n.Cg)([(0,h.K)("geometryType")],_.prototype,"writeGeometryType",null),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasM",void 0),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasZ",void 0),(0,n.Cg)([(0,u.MZ)({types:y.yR,json:{write:!0}})],_.prototype,"queryGeometry",void 0),(0,n.Cg)([(0,c.w)("queryGeometry")],_.prototype,"readQueryGeometry",null),(0,n.Cg)([(0,u.MZ)({type:p.A,json:{write:!0}})],_.prototype,"spatialReference",void 0),(0,n.Cg)([(0,h.K)("spatialReference")],_.prototype,"writeSpatialReference",null),(0,n.Cg)([(0,u.MZ)({json:{write:!0}})],_.prototype,"transform",void 0),_=r=(0,n.Cg)([(0,d.$)("esri.rest.support.FeatureSet")],_),_.prototype.toJSON.isDefaultToJSON=!0},29005:(e,t,i)=>{i.d(t,{A:()=>c});var r=i(31635),n=i(69540),s=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(40608));const u=new s.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let c=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"name",void 0),(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"description",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],c.prototype,"drawingTool",void 0),(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"prototype",void 0),(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"thumbnail",void 0),c=(0,r.Cg)([(0,o.$)("esri.layers.support.FeatureTemplate")],c)},30235:(e,t,i)=>{i.d(t,{A:()=>f});var r=i(52106),n=i(87449),s=i(11221),a=i(89169),l=i(33325),o=i(80609),u=i(39516),c=i(91075),d=i(40212),h=i(33143),p=i(20437);class f extends s.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return l.gO}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type||this._layer.objectIdField===i.name)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}_isInFeatureSet(){return 0}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new r.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,n){let s="",l=!1;if(null!==r&&(s=r.constructClause(),l=!0),this.isTable()&&t&&null!==e&&""!==e)return new a.A([],[],!0,null);const c=this._createQuery();c.where=(0,u.mA)(c.where,null===i?null===t?"1=1":"":(0,o.YY)(i,0)),c.spatialRelationship=this._makeRelationshipEnum(e),c.outSpatialReference=this.spatialReference,c.orderByFields=""!==s?s.split(","):null,c.geometry=null===t?null:t,c.relationParameter=this._makeRelationshipParam(e);const d=await this._layer.queryFeatures(c);if(null===d)return new a.A([],[],l,null);this._checkCancelled(n);const h=[];return d.features.forEach(e=>{const t=e.attributes[this._layer.objectIdField];h.push(t),this._featureCache[t]=this._changeFeature(e)}),new a.A([],h,l,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;if(await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const e=[];return this._layer.source.items.forEach(t=>{const i=t.attributes[this._layer.objectIdField];e.push(i),this._featureCache[i]=this._changeFeature(t)}),this._wset=new a.A([],e,!1,null),this._wset}const e=this._createQuery();e.where="1=1";const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(e=>{const t=e.attributes[this._layer.objectIdField];i.push(t),this._featureCache[t]=this._changeFeature(e)}),this._wset=new a.A([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];-1!==t&&void 0===this._featureCache[t]&&r.push(t);for(let n=e._lastFetchedIndex;n<e._known.length&&(e._lastFetchedIndex+=1,!(void 0===this._featureCache[e._known[n]]&&(e._known[n]!==t&&r.push(e._known[n]),r.length>i)));n++);if(0===r.length)return"success";throw new n.d("MissingFeatures")}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",n=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)n.push(h.A.fromJSON(t));let s=e.layerDefinition.geometryType;void 0===s&&(s=e.featureSet.geometryType||"");let a=e.featureSet.features;const l=t.toJSON();if(!i){let t=!1;for(const r of e.layerDefinition.fields)if("oid"===r.type||"esriFieldTypeOID"===r.type){i=r.name,t=!0;break}if(!1===t){let t="FID",r=!0,n=0;for(;r;){let i=!0;for(const r of e.layerDefinition.fields)if(r.name===t){i=!1;break}!0===i?r=!1:(n++,t="FID"+n.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const s=[];for(let i=0;i<a.length;i++)s.push({geometry:e.featureSet.features[i].geometry,attributes:e.featureSet.features[i].attributes?this._cloneAttr(e.featureSet.features[i].attributes):{}}),s[i].attributes[t]=i;a=s,i=t}}const o=[];for(const t of e.layerDefinition.fields)t instanceof p.A?o.push(t):o.push(p.A.fromJSON(t));let u=s;switch(u||(u=""),u){case"esriGeometryPoint":u="point";break;case"esriGeometryPolyline":u="polyline";break;case"esriGeometryPolygon":u="polygon";break;case"esriGeometryEnvelope":u="extent";break;case"esriGeometryMultipoint":u="multipoint";break;case"":case"esriGeometryNull":u="esriGeometryNull"}if("esriGeometryNull"!==u)for(const e of a)e.geometry&&e.geometry instanceof c.A==0&&(e.geometry.type=u,void 0===e.geometry.spatialReference&&(e.geometry.spatialReference=l));else for(const e of a)e.geometry&&(e.geometry=null);const y={outFields:["*"],source:a,fields:o,hasZ:!0===e?.layerDefinition?.hasZ||!0===e?.featureSet?.hasZ,hasM:!0===e?.layerDefinition?.hasM||!0===e?.featureSet?.hasM,types:n,typeIdField:r,objectIdField:i,spatialReference:t},g="esriGeometryNull"===u||null===u;g||(y.geometryType=u);const m=new d.default(y);return e?.layerDefinition?.subtypeField&&e?.layerDefinition?.subtypes&&m.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new f({layer:m,spatialReference:t,isTable:g})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const i=await this._layer.queryFeatures(t);return 1===i.features.length?i.features[0]:null}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return this._layer?.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return this.fsetInfo??{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},32730:(e,t,i)=>{i.d(t,{BI:()=>g,D3:()=>f,XJ:()=>y,lc:()=>p,mX:()=>_,rU:()=>m,tH:()=>S});var r=i(799);const n="__begin__",s="__end__",a=new RegExp(n,"ig"),l=new RegExp(s,"ig"),o=new RegExp("^"+n,"i"),u=new RegExp(s+"$","i"),c='"',d=c+" + ",h=" + "+c;function p(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function f(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function y(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=p(e.labelExpression),t.type="conventional"),t}function g(e){const t=y(e);if(!t)return null;switch(t.type){case"conventional":return _(t.expression);case"arcade":return t.expression}return null}function m(e){const t=y(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return S(t.expression)}return null}function _(e){let t;return e?(t=(0,r.HC)(e,e=>n+'$feature["'+e+'"]'+s),t=o.test(t)?t.replace(o,""):c+t,t=u.test(t)?t.replace(u,""):t+c,t=t.replaceAll(a,d).replaceAll(l,h)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,F=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,I=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function S(e){if(!e)return null;let t=b.exec(e)||F.exec(e);return t?t[1]||t[3]:(t=I.exec(e),t?t[2]:null)}},32756:(e,t,i)=>{i.d(t,{Rr:()=>o,fY:()=>c,ne:()=>u});var r=i(31635),n=i(93637),s=i(10107),a=(i(44208),i(53966),i(87811),i(40608)),l=i(91880);function o(e,t,i){if(!e)return null;const r=e.find(e=>!!e.field);if(!r)return null;const n=new l.A;return n.read(r,i),[n]}const u={type:[l.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:o},write:{writer:function(e,t,i,r){const s=e.find(e=>!!e.field);s&&(0,n.sM)(i,[s.toJSON()],t)}}}},c=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,r.Cg)([(0,s.MZ)(u)],i.prototype,"orderBy",void 0),i=(0,r.Cg)([(0,a.$)("esri.layers.mixins.OrderedLayer")],i),i}},33143:(e,t,i)=>{i.d(t,{A:()=>h});var r=i(31635),n=i(69540),s=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),o=i(40608),u=i(43937),c=i(80451),d=i(29005);let h=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=(0,c.rS)(e[i]);return t}writeDomains(e,t){const i={};for(const t of Object.keys(e))e[t]&&(i[t]=e[t]?.toJSON());t.domains=i}};(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"id",void 0),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"name",void 0),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"domains",void 0),(0,r.Cg)([(0,l.w)("domains")],h.prototype,"readDomains",null),(0,r.Cg)([(0,u.K)("domains")],h.prototype,"writeDomains",null),(0,r.Cg)([(0,a.MZ)({type:[d.A],json:{write:!0}})],h.prototype,"templates",void 0),h=(0,r.Cg)([(0,o.$)("esri.layers.support.FeatureType")],h)},35704:(e,t,i)=>{i.d(t,{A:()=>d});var r=i(87449),n=i(11221),s=i(89169),a=i(33325),l=i(80609),o=i(74887),u=i(88368),c=i(16930);class d extends n.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof u.A?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new c.A({wkid:4326}),this.geometryType=a.ik.point)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),null!==this._whereClauseFunction?this._wset=new s.A(t._candidates.slice().concat(t._known.slice()),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new s.A(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return 1===t?t:(t=this._idstates[e],void 0===t?2:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(null!==this._whereClauseFunction){const t=this._whereClauseFunction(e);return(0,o.$X)(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){const r=new s.A([],e,!1,null),n=Math.min(t,e.length);if(await(this._parent?._getFeatures(r,-1,n,i)),this._checkCancelled(i),null==this._whereClauseFunction){for(let t=0;t<n;t++){const i=this._parent?._featureFromCache(e[t]);!0===this.executeWhereClause(i)?this._idstates[e[t]]=0:this._idstates[e[t]]=1}return"success"}const a=[];for(let t=0;t<n;t++){const i=this._parent?._featureFromCache(e[t]);a.push(await this.executeWhereClauseDeferred(i))}for(let i=0;i<t;i++)!0===a[i]?this._idstates[e[i]]=0:this._idstates[e[i]]=1;return"success"}async _getFilteredSet(e,t,i,r,n){null!==this._whereClauseFunction||(null!==i?null!==this._whereclause&&(i=(0,l.kg)(this._whereclause,i)):i=this._whereclause),await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r,n);let o;return this._checkCancelled(n),o=null!==this._whereClauseFunction?new s.A(a._candidates.slice().concat(a._known.slice()),[],a._ordered,this._clonePageDefinition(a.pagesDefinition)):new s.A(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition)),o}async _stat(e,t,i,r,n,s,a){if(null!==this._whereClauseFunction)return null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1};let o=this._whereclause;null!==n&&null!==this._whereclause&&(o=(0,l.kg)(this._whereclause,n));const u=await this._parent._stat(e,t,i,r,o,s,a);return!1===u.calculated?null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1}:u}async _canDoAggregates(e,t,i,r,n){return null===this._whereClauseFunction&&(null!==n?null!==this._whereclause&&(n=(0,l.kg)(this._whereclause,n)):n=this._whereclause,null!==this._parent&&this._parent._canDoAggregates(e,t,i,r,n))}async _getAggregatePagesDataSourceDefinition(e,t,i,n,s,a,o){if(null===this._parent)throw new r.d("NeverReach");return null!==s?null!==this._whereclause&&(s=(0,l.kg)(this._whereclause,s)):s=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,i,n,s,a,o)}static registerAction(){n.A._featuresetFunctions.filter=function(e){if("function"==typeof e)return new d({parentfeatureset:this,whereclause:e});let t=null;return e instanceof u.A&&(t=e),new d({parentfeatureset:this,whereclause:t})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},36708:(e,t,i)=>{i.d(t,{C_:()=>h,OH:()=>y,Vh:()=>g,on:()=>d,pc:()=>m,wB:()=>o,z7:()=>u});var r=i(37955),n=i(36563),s=i(97768),a=i(74887),l=i(14012);function o(e,t,i={}){return c(e,t,i,p)}function u(e,t,i={}){return c(e,t,i,f)}function c(e,t,i={},r){let n=null;const a=i.once?(e,i)=>{r(e)&&((0,s.xt)(n),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(n=(0,l.Cn)(e,a,i.sync,i.equals),i.initial){const t=e();a(t,t)}return n}function d(e,t,i,a={}){let l=null,u=null,c=null;function d(){l&&u&&(u.remove(),a.onListenerRemove?.(l),l=null,u=null)}function h(e){a.once&&a.once&&(0,s.xt)(c),i(e)}const p=o(e,(e,i)=>{d(),(0,r.wb)(e)&&(l=e,u=(0,r.on)(e,t,h),a.onListenerAdd?.(e))},{sync:a.sync,initial:!0});return c=(0,n.hA)(()=>{p.remove(),d()}),c}function h(e,t){return function(e,t,i){if((0,a.G4)(i))return Promise.reject((0,a.NK)());const r=e();if(t?.(r))return Promise.resolve(r);let l=null;function o(){l=(0,s.xt)(l)}return new Promise((r,s)=>{l=(0,n.vE)([(0,a.u7)(i,()=>{o(),s((0,a.NK)())}),c(e,e=>{o(),r(e)},{sync:!1,once:!0},t??p)])})}(e,f,t)}function p(e){return!0}function f(e){return!!e}i(80559);const y={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},37352:(e,t,i)=>{i.d(t,{A:()=>u});var r,n=i(31635),s=i(7762),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(40608));let u=r=class extends a.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.A}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"floorField",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=r=(0,n.Cg)([(0,o.$)("esri.layers.support.LayerFloorInfo")],u)},37539:(e,t,i)=>{i.d(t,{pO:()=>y,jd:()=>h,Tp:()=>p,w5:()=>d});var r=i(34727),n=i(83047),s=i(73941),a=i(79258);Math.PI;const l=a.$O.radius,o=a.$O.eccentricitySquared,u={a1:l*o,a2:l*o*l*o,a3:l*o*o/2,a4:l*o*l*o*2.5,a5:l*o+l*o*o/2,a6:1-o};a.$O.radius,a.$O.flattening,a.Sw.radius,a.Sw.flattening,a.sH.radius,a.sH.flattening,a.sH.radius;var c=i(21325);const d={2:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:m,11:_,2:y,4:x},5:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:m,11:_,2:y,4:x},7:{5:null,7:y,9:null,10:y,1:null,6:I,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:y,10:y,1:null,6:null,8:F,0:null,3:null,11:null,2:null,4:null},3:{5:g,7:null,9:null,10:g,1:function(e,t,i,r){const n=e[t]/N,s=L-2*Math.atan(Math.exp(-e[t+1]/N)),a=N+e[t+2],l=Math.cos(s)*a;i[r]=Math.cos(n)*l,i[r+1]=Math.sin(n)*l,i[r+2]=Math.sin(s)*a},6:null,8:null,0:null,3:y,11:function(e,t,i,r){g(e,t,i,r),_(i,r,i,r)},2:g,4:function(e,t,i,r){g(e,t,i,r),x(i,r,i,r)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,i,r){R(e,t,i,r),S(i,r,i,r)},6:null,8:null,0:null,3:function(e,t,i,r){R(e,t,i,r),m(i,r,i,r)},11:function(e,t,i,r){R(e,t,i,r),_(i,r,i,r)},2:R,4:y},1:{5:C,7:null,9:null,10:C,1:y,6:null,8:null,0:null,3:function(e,t,i,r){C(e,t,i,r),m(i,r,i,r)},11:function(e,t,i,r){C(e,t,i,r),_(i,r,i,r)},2:C,4:function(e,t,i,r){C(e,t,i,r),x(i,r,i,r)}},6:{5:null,7:T,9:null,10:T,1:null,6:y,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:A,10:A,1:null,6:null,8:y,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:y,3:null,11:null,2:null,4:null},10:{5:y,7:y,9:y,10:y,1:S,6:I,8:F,0:null,3:m,11:_,2:y,4:x},11:{5:w,7:null,9:null,10:w,1:function(e,t,i,r){w(e,t,i,r),S(i,r,i,r)},6:null,8:null,0:null,3:function(e,t,i,r){w(e,t,i,r),m(i,r,i,r)},11:y,2:w,4:function(e,t,i,r){w(e,t,i,r),x(i,r,i,r)}}};function h(e,t){return p(e,t)?.projector}function p(e,t){if(null==e||null==t)return null;if(k.source.spatialReference===e&&k.dest.spatialReference===t)return k;const i=f(e,k.source),r=f(t,k.dest);return 0===i&&0===r?(0,c.aI)(e,t)?k.projector=y:k.projector=null:k.projector=d[i][r],k}function f(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,n.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function y(e,t,i,r){e!==i&&(i[r++]=e[t++],i[r++]=e[t++],i[r]=e[t])}function g(e,t,i,r){i[r]=M*(e[t]/N),i[r+1]=M*(L-2*Math.atan(Math.exp(-e[t+1]/N))),i[r+2]=e[t+2]}function m(e,t,i,n){!function(e,t,i,n,s){const a=.4999999*Math.PI,l=(0,r.qE)(D*e[t+1],-a,a),o=Math.sin(l);i[n++]=D*e[t]*s.radius,i[n++]=s.halfSemiMajorAxis*Math.log((1+o)/(1-o)),i[n]=e[t+2]}(e,t,i,n,a.$O)}function _(e,t,i,r){i[r]=e[t]*P,i[r+1]=e[t+1]*P,i[r+2]=e[t+2]}function w(e,t,i,r){i[r]=e[t]*E,i[r+1]=e[t+1]*E,i[r+2]=e[t+2]}function b(e,t,i,r,n){const s=n+e[t+2],a=D*e[t+1],l=D*e[t],o=Math.cos(a)*s;i[r]=Math.cos(l)*o,i[r+1]=Math.sin(l)*o,i[r+2]=Math.sin(a)*s}function F(e,t,i,r){b(e,t,i,r,a.Sw.radius)}function I(e,t,i,r){b(e,t,i,r,a.sH.radius)}function S(e,t,i,r){b(e,t,i,r,a.$O.radius)}function v(e,t,i,n,s){const a=e[t],l=e[t+1],o=e[t+2],u=Math.sqrt(a*a+l*l+o*o),c=(0,r.YN)(o/(0===u?1:u)),d=Math.atan2(l,a);i[n++]=M*d,i[n++]=M*c,i[n]=u-s}function A(e,t,i,r){v(e,t,i,r,a.Sw.radius)}function T(e,t,i,r){v(e,t,i,r,a.sH.radius)}function C(e,t,i,r){v(e,t,i,r,a.$O.radius)}function x(e,t,i,r){!function(e,t,i,r,n){const s=D*e[t],a=D*e[t+1],l=e[t+2],o=Math.sin(a),u=Math.cos(a),c=n.radius/Math.sqrt(1-n.eccentricitySquared*o*o);i[r++]=(c+l)*u*Math.cos(s),i[r++]=(c+l)*u*Math.sin(s),i[r++]=(c*(1-n.eccentricitySquared)+l)*o}(e,t,i,r,a.$O)}function R(e,t,i,r){const n=u,s=e[t],l=e[t+1],o=e[t+2];let c,d,h,p,f,y,g,m,_,w,b,F,I,S,v,A,T,C,x,R,k;c=Math.abs(o),d=s*s+l*l,h=Math.sqrt(d),p=d+o*o,f=Math.sqrt(p),R=Math.atan2(l,s),y=o*o/p,g=d/p,S=n.a2/f,v=n.a3-n.a4/f,g>.3?(m=c/f*(1+g*(n.a1+S+y*v)/f),x=Math.asin(m),w=m*m,_=Math.sqrt(1-w)):(_=h/f*(1-y*(n.a5-S-g*v)/f),x=Math.acos(_),w=1-_*_,m=Math.sqrt(w)),b=1-a.$O.eccentricitySquared*w,F=a.$O.radius/Math.sqrt(b),I=n.a6*F,S=h-F*_,v=c-I*m,T=_*S+m*v,A=_*v-m*S,C=A/(I/b+T),x+=C,k=T+A*C/2,o<0&&(x=-x),i[r++]=M*R,i[r++]=M*x,i[r]=k}const k={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:y},D=(0,r.kU)(1),M=(0,r.KJ)(1),L=.5*Math.PI,N=a.$O.radius,P=N*Math.PI/180,E=180/(N*Math.PI)},40334:(e,t,i)=>{i.r(t),i.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>re,constructFeatureSet:()=>te,constructFeatureSetFromPortalItem:()=>ce,constructFeatureSetFromRelationship:()=>ne,constructFeatureSetFromUrl:()=>ee,convertToFeatureSet:()=>ue,createFeatureSetCollectionFromMap:()=>le,createFeatureSetCollectionFromService:()=>oe,initialiseMetaDataCache:()=>H});var r=i(78888);class n{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return void 0===this._layerByName[e]?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return void 0===this._layerById[e]?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}var s=i(78878),a=i(35704),l=i(52106),o=i(59534),u=i(68423),c=i(86691),d=i(87449),h=i(11221),p=i(89169),f=i(87594),y=i(33325),g=i(80609),m=i(1262),_=i(88368);class w{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new w;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const n=new w;n.field=e;const s=_.A.create(t,{fieldsIndex:i,timeZone:r}),a=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new m.L("MissingStatisticParameters");const t=_.A.create((0,g.Mi)(e.parseTree.args.value[0],0,e.parameters),{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser});return{name:e.parseTree.name,expr:t}}return null}(s);if(null===a)throw new m.L("UnsupportedSqlFunction",{function:""});const l=a.name.toUpperCase().trim();if("MIN"===l){if(n.typeofstat="MIN",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:"min"})}else if("MAX"===l){if(n.typeofstat="MAX",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:"max"})}else if("COUNT"===l)n.typeofstat="COUNT",n.workingexpr=a.expr;else if("STDEV"===l){if(n.typeofstat="STDDEV",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:"stdev"})}else if("SUM"===l){if(n.typeofstat="SUM",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:"sum"})}else if("MEAN"===l){if(n.typeofstat="AVG",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:l})}else if("AVG"===l){if(n.typeofstat="AVG",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:"avg"})}else{if("VAR"!==l)throw new m.L("UnsupportedSqlFunction",{function:l});if(n.typeofstat="VAR",n.workingexpr=a.expr,null===s)throw new m.L("InvalidFunctionParameters",{function:"var"})}return n}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}var b=i(80200),F=i(74639),I=i(44729),S=i(55612),v=i(15032),A=i(16930),T=i(20437),C=i(95466);const x=new o.b(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class R extends h.A{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(null===this._wset){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return 0}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new C.A([]);for(this.objectIdField="ROW__ID",this.globalIdField="";!1===t;){let e=!1;for(let t=0;t<this._config.groupbyfields.length;t++)if(this._config.groupbyfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(let t=0;t<this._config.statsfields.length;t++)if(this._config.statsfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+i.toString(),i++)}for(const e of this._config.statsfields){const t=new w;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof _.A?e.expression:_.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=x.lookup(e.statistic)??"COUNT",this._decodedStatsfield.push(t)}this._decodedGroupbyfield=[];for(const e of this._config.groupbyfields){const t={name:e.name,singlefield:null,tofieldname:e.name,expression:e.expression instanceof _.A?e.expression:_.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupbyfield.push(t)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const t of this._parent.fields)e[t.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField=""}else this.geometryType=y.ik.point,this.typeIdField="",this.types=null,this.subtypes=null,this.subtypeField="",this.spatialReference=new A.A({wkid:4326});this.fields=[];const n=new w;n.field=this._nextUniqueName(e),n.tofieldname=this.objectIdField,n.workingexpr=_.A.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),n.typeofstat="MIN",this._decodedStatsfield.push(n);for(const t of this._decodedGroupbyfield){const i=new T.A;if(t.name=this._nextUniqueName(e),i.name=t.tofieldname,i.alias=i.name,(0,g.DA)(t.expression)){const e=this._parent.getField((0,g.YY)(t.expression,0));if(!e)throw new d.d("AggregationFieldNotFound");t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),i.type=e.type,t.sqlType=e.type}else{i.type=this._convertToEsriFieldType((0,g.IY)(t.expression,this._parent.fields));const e=new T.A;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new u.Gr(e,t.expression)),this._candosimplegroupby=!1,t.sqlType=i.type}this.fields.push(i)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new u.IO(e));for(let t=0;t<this._decodedStatsfield.length;t++){const i=new T.A;let r=null;const n=this._decodedStatsfield[t];n.field=this._nextUniqueName(e),n.tofieldname===this.objectIdField&&(this._internalObjectIdField=n.field),i.name=n.tofieldname,i.alias=i.name;const s=null!==n.workingexpr&&(0,g.DA)(n.workingexpr)?(0,g.YY)(n.workingexpr,0):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==s){if(r=this._parent.getField(s),!r)throw new d.d("AggregationFieldNotFound");i.type=r.type}else i.type="double";break;case"MIN":case"MAX":if(""!==s){if(r=this._parent.getField(s),!r)throw new d.d("AggregationFieldNotFound");i.type=r.type}else i.type="double";break;case"COUNT":i.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==s&&(r=this._parent.getField(s),!r))throw new d.d("AggregationFieldNotFound");i.type="double"}this.fields.push(i)}}async _canDoAggregates(){return!1}async _getFeatures(e,t,i,r){-1!==t&&this._featureCache[t];const n=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,n)?(await this._expandPagedSet(e,n,0,0,r),this._getFeatures(e,t,i,r)):"success"}async _getFilteredSet(e,t,i,r,n){if(""!==e)return new p.A([],[],!0,null);let s=null;const l={ordered:!1,nowhereclause:!1};if(await this._ensureLoaded(),null!==i)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,g.Ju)(i,this._decodedStatsfield[e].tofieldname)){l.nowhereclause=!0,i=null;break}if(null!==r){l.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,l.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,l.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent._canDoAggregates(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,null)){let e=null;i&&(e=this._reformulateWhereClauseWithoutGroupByFields(i));let t=null;r&&(t=this._reformulateOrderClauseWithoutGroupByFields(r));const a=await this._parent._getAggregatePagesDataSourceDefinition(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,e,t,this._internalObjectIdField);return this._checkCancelled(n),s=!0===l.nowhereclause?new p.A(a._candidates.slice().concat(a._known.slice()),[],!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)):new p.A(a._candidates.slice(),a._known.slice(),!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)),s}let o=this._parent;if(this._adaptedFields.length>0&&(o=new u.a({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===l.nowhereclause)s=new p.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new c.A({parentfeatureset:o,orderbyclause:new f.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let e=o;if(null!==i){let t=null;i&&(t=this._reformulateWhereClauseWithoutGroupByFields(i)),e=new a.A({parentfeatureset:e,whereclause:t})}s=new p.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new c.A({parentfeatureset:e,orderbyclause:new f.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return s}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,g.bD)(e,t.tofieldname,(0,g.YY)(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,g.bD)(e,t.tofieldname,(0,g.YY)(t.expression,0),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupbyfield)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,n){return this._expandPagedSetFeatureSet(e,t,i,r,n)}async _getPhysicalPage(e,t,i){if(!0===e.pagesDefinition.aggregatefeaturesetpagedefinition)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const e of r){const t={geometry:e.geometry,attributes:{}},i={};for(const t in e.attributes)i[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=i[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=i[e.field.toLowerCase()];this._featureCache[t.attributes[this.objectIdField]]=new l.A(t)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((n,s)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),!0===e.pagesDefinition.internal.fullyResolved||0===t?n(r.length):this._nextAggregateItem(e,t,i,r,s=>{null===s?n(r.length):(t-=1,n(this._sequentialGetPhysicalItem(e,t,i,r)))},s)})}_nextAggregateItem(e,t,i,r,n,a){try{(0,s.a1)(e.pagesDefinition.internal.iterator.next()).then(s=>{if(null===s)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(t),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(t.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,n(null)}else e.pagesDefinition.internal.fullyResolved=!0,n(null);else{const l=this._generateAggregateHash(s);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[s],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const i=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(i),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(i.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[s],id:l},void n(i)}e.pagesDefinition.internal.workingItem.features.push(s)}this._nextAggregateItem(e,t,i,r,n,a)}},a)}catch(e){a(e)}}_calculateFieldStat(e,t,i){const r=[];for(const i of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(i);null!==e&&(e instanceof I.n||e instanceof v.k?r.push(e.toNumber()):e instanceof S.g?r.push(e.toMilliseconds()):r.push(e))}else r.push(null);i.attributes[t.tofieldname]=(0,F.s)(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.features[0].attributes[i.singlefield]:_.A.convertValueToStorageFormat(i.expression.calculateValue(e.features[0]),i.sqlType);t.attributes[i.tofieldname]=r}for(const i of this._decodedStatsfield)this._calculateFieldStat(e,i,t);const i=[];for(let r=0;r<this._decodedStatsfield.length;r++)i.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return this._featureCache[t.attributes[this.objectIdField]]=new l.A({attributes:t.attributes,geometry:t.geometry}),t}_generateAggregateHash(e){let t="";for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.attributes[i.singlefield]:i.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,b.d)(t,b.T.String)}async _stat(){return{calculated:!1}}async getFeatureByObjectId(){return null}static registerAction(){h.A._featuresetFunctions.groupby=function(e,t){return new R({parentfeatureset:this,groupbyfields:e,statsfields:t})}}}var k=i(54784),D=i(54461),M=i(70333),L=i(61454),N=i(66395),P=i(50145),E=i(4576),j=i(39516),O=i(65864),G=i(21325),Z=i(40212),q=i(54546),U=i(61956),B=i(7562);class W extends h.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return y.gO}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,y.JB)(e.toJSON());return(0,b.d)(t,b.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return 0}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new U.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch(e){return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i="execute"===t?this._layer.queryFeatures.bind(this._layer):"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(t),null===r&&(r=i(e),this.recentlyUsedQueries.addToCache(t,r),r=r.catch(e=>{throw this.recentlyUsedQueries?.removeFromCache(t),e}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===r&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,n){const s=await this.databaseType();if(this.isTable()&&t&&null!==e&&""!==e)return new p.A([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,n);let a="",l=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=this._createQuery();o.where=(0,j.mA)(o.where,null===i?null===t?"1=1":"":(0,g.YY)(i,s)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null,o.geometry=null===t?null:t,o.relationParameter=this._makeRelationshipParam(e);let u=await this.executeQuery(o,"executeForIds");return null===u&&(u=[]),this._checkCancelled(n),new p.A([],u,l,null)}_expandPagedSet(e,t,i,r,n){return this._expandPagedSetFeatureSet(e,t,i,r,n)}async _getFilteredSetUsingPaging(e,t,i,r,n){let s="",a=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(s=r.constructClause(),a=!0);const l=await this.databaseType(),o=null===i?null===t?"1=1":"":(0,g.YY)(i,l);let u=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<u&&(u=c);let d=null;if(!0===this._pageJustIds)d=new p.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:this._layer.objectIdField,resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:s,returnGeometry:!1,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}});else{let i=!0;!0===this._removeGeometry&&(i=!1);const r=this._overrideFields??this._fieldsIncludingObjectId(["*"]);d=new p.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:r.join(","),resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:s,returnGeometry:i,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}return await this._expandPagedSet(d,u,0,1,n),d}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,n=r,s=e.pagesDefinition.internal.lastPage,a=this._createQuery();a.spatialRelationship=e.pagesDefinition.spatialRel,a.relationParameter=e.pagesDefinition.relationParam,a.outFields=e.pagesDefinition.outFields.split(","),a.num=e.pagesDefinition.resultRecordCount,a.start=e.pagesDefinition.internal.lastPage,a.geometry=e.pagesDefinition.geometry,a.where=(0,j.mA)(a.where,e.pagesDefinition.where),a.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,a.returnGeometry=e.pagesDefinition.returnGeometry,a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==s)return"done";const o=this._layer.objectIdField;for(let t=0;t<l.features.length;t++)e.pagesDefinition.internal.set[n+t]=l.features[t].attributes[o];if(!1===this._pageJustIds)for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return(void 0===l.exceededTransferLimit&&l.features.length!==e.pagesDefinition.resultRecordCount||!1===l.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+l.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,"done"}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFeatures(e,t,i,r){const n=[];if(-1!==t&&void 0===this._featureCache[t]&&n.push(t),!0===this._checkIfNeedToExpandKnownPage(e,this._maxProcessingRate()))return await this._expandPagedSet(e,this._maxProcessingRate(),0,0,r),this._getFeatures(e,t,i,r);let s=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if(e._lastFetchedIndex+=1,s++,void 0===this._featureCache[e._known[r]]){let i=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){const t=this._layer._mode;if(void 0!==t._featureMap[e._known[r]]){const n=t._featureMap[e._known[r]];null!==n&&(i=!0,this._featureCache[e._known[r]]=n)}}if(!1===i&&(e._known[r]!==t&&n.push(e._known[r]),n.length>=this._maxProcessingRate()-1))break}if(s>=i&&0===n.length)break}if(0===n.length)return"success";const a=this._createQuery();a.objectIds=n,a.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),a.returnGeometry=!0,!0===this._removeGeometry&&(a.returnGeometry=!1),a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(r),void 0!==l.error)throw new d.d("RequestFailed",{reason:l.error});const o=this._layer.objectIdField;for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return"success"}async _getDistinctPages(e,t,i,r,n,s,a,l,o){await this._ensureLoaded();const u=await this.databaseType();let c=i.parseTree.column;const h=this._layer.fields??[];for(let e=0;e<h.length;e++)if(h[e].name.toLowerCase()===c.toLowerCase()){c=h[e].name;break}const p=this._createQuery();p.where=(0,j.mA)(p.where,null===s?null===n?"1=1":"":(0,g.YY)(s,u)),p.spatialRelationship=this._makeRelationshipEnum(r),p.relationParameter=this._makeRelationshipParam(r),p.geometry=null===n?null:n,p.returnDistinctValues=!0,p.returnGeometry=!1,p.outFields=[c];const f=await this.executeQuery(p,"execute");if(this._checkCancelled(o),!f.hasOwnProperty("features"))throw new d.d("InvalidStatResponse");let y=!1;for(let e=0;e<h.length;e++)if(h[e].name===c){"date"===h[e].type&&(y=!0);break}for(let e=0;e<f.features.length;e++){if(y){const t=f.features[e].attributes[c];null!==t?l.push(new Date(t)):l.push(t)}else l.push(f.features[e].attributes[c]);if(l.length>=a)break}return 0===f.features.length?l:f.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length<a?{calculated:!0,result:await this._getDistinctPages(e+f.features.length,t,i,r,n,s,a,l,o)}:l}async _distinctStat(e,t,i,r,n,s,a){return{calculated:!0,result:await this._getDistinctPages(0,e,t,i,r,n,s,[],a)}}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}async _countstat(e,t,i,r){const n=await this.databaseType();if(this.isTable()&&i&&null!==t&&""!==t)return{calculated:!0,result:0};const s=this._createQuery();return s.where=(0,j.mA)(s.where,null===r?null===i?"1=1":"":(0,g.YY)(r,n)),s.spatialRelationship=this._makeRelationshipEnum(t),s.relationParameter=this._makeRelationshipParam(t),s.geometry=null===i?null:i,s.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(s,"executeForCount")}}async _stats(e,t,i,r,n,s,a){await this._ensureLoaded();const l=this._layer.capabilities?.query,o=!!l?.supportsSqlExpression,u=!!l?.supportsStatistics,c=!!l?.supportsDistinct;if("count"===e)return c?this._countstat(e,i,r,n):{calculated:!1};if(!1===u||!1===(0,g.DA)(t)&&!1===o||!1===t.isStandardized)return""!==i||null!==n?{calculated:!1}:this._manualStat(e,t,s,a);if("distinct"===e)return!1===c?""!==i||null!==n?{calculated:!1}:this._manualStat(e,t,s,a):this._distinctStat(e,t,i,r,n,s,a);const h=await this.databaseType();if(this.isTable()&&r&&null!==i&&""!==i)return{calculated:!0,result:null};const p=this._createQuery();p.where=(0,j.mA)(p.where,null===n?null===r?"1=1":"":(0,g.YY)(n,h)),p.spatialRelationship=this._makeRelationshipEnum(i),p.relationParameter=this._makeRelationshipParam(i),p.geometry=null===r?null:r;const f=new B.A;f.statisticType=(0,P.Dp)(e),f.onStatisticField=(0,g.YY)(t,h),f.outStatisticFieldName="ARCADE_STAT_RESULT",p.returnGeometry=!1;let y="ARCADE_STAT_RESULT";p.outStatistics=[f];const m=await this.executeQuery(p,"execute");if(!m.hasOwnProperty("features")||0===m.features.length)throw new d.d("InvalidStatResponse");let _=!1;const w=m.fields??[];for(let e=0;e<w.length;e++)if("ARCADE_STAT_RESULT"===w[e].name.toUpperCase()){y=w[e].name,"date"===w[e].type&&(_=!0);break}if(_){let e=m.features[0].attributes[y];return null!==e&&(e=new Date(m.features[0].attributes[y])),{calculated:!0,result:e}}return{calculated:!0,result:m.features[0].attributes[y]}}_stat(e,t,i,r,n,s,a){return this._stats(e,t,i,r,n,s,a)}async _canDoAggregates(e,t){await this._ensureLoaded();let i=!1;const r=this._layer.capabilities?.query,n=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(i=!0),i)for(let e=0;e<t.length-1;e++)(!1===t[e].workingexpr?.isStandardized||!1===(0,g.DA)(t[e].workingexpr)&&!1===n)&&(i=!1);return!1!==i}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _getAggregatePagesDataSourceDefinition(e,t,i,r,n,s,a){await this._ensureLoaded();const l=await this.databaseType();let o=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const t=this.getFieldsIndex();o={keyFields:e.map((e,i)=>({name:t.normalizeFieldName(e)??e,asc:null==s||1===s._directions[i]}))}}let u="",c=!1;null!=s&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==o||(0,E.MJ)(e,0,e.length,s._fields,0,Math.min(s._fields.length,e.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(u=s.constructClause(),c=!0),""===u&&(u=e.join(","));const d=[];for(let e=0;e<t.length;e++){const i=new B.A;i.onStatisticField=null!==t[e].workingexpr?(0,g.YY)(t[e].workingexpr,l):"",i.outStatisticFieldName=t[e].field,i.statisticType=t[e].toStatisticsName(),d.push(i)}let h=this._maxQueryRate();const f=this._layer.capabilities?.query.maxRecordCount;null!=f&&f<h&&(h=f);const y=null===n?null===r?"1=1":"":(0,g.YY)(n,l);return new p.A([],["GETPAGES"],c,{groupbypage:!0,spatialRel:this._makeRelationshipEnum(i),relationParam:this._makeRelationshipParam(i),outFields:["*"],useOIDpagination:!1,generatedOid:a,resultRecordCount:h,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:d,geometry:null===r?null:r,where:y,orderByFields:u,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1,keysetPagination:o}})}async _getAgregagtePhysicalPage(e,t,i){let r=e.pagesDefinition.where;if(!0===e.pagesDefinition.useOIDpagination&&(r=(0,j.mA)(r,e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString())),null!=e.pagesDefinition.internal.keysetPagination?.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new d.d("NotImplemented");r=(0,j.mA)(r,(0,g.YY)(e.pagesDefinition.internal.keysetPagination.clause,await this.databaseType()))}const n=e.pagesDefinition.internal.lastRetrieved,s=n,a=e.pagesDefinition.internal.lastPage,o=this._createQuery();if(o.where=(0,j.mA)(o.where,r),o.spatialRelationship=e.pagesDefinition.spatialRel,o.relationParameter=e.pagesDefinition.relationParam,o.outFields=e.pagesDefinition.outFields,o.outStatistics=e.pagesDefinition.outStatistics,o.geometry=e.pagesDefinition.geometry,o.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,o.num=e.pagesDefinition.resultRecordCount,o.start=e.pagesDefinition.internal.lastPage,o.returnGeometry=e.pagesDefinition.returnGeometry,o.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&o.geometry&&o.spatialRelationship)return[];const u=await this.executeQuery(o,"execute");if(this._checkCancelled(i),!u.hasOwnProperty("features"))throw new d.d("InvalidStatResponse");const c=[];if(e.pagesDefinition.internal.lastPage!==a)return[];u.features.length>0&&void 0===u.features[0].attributes[e.pagesDefinition.generatedOid]&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let t=0;t<u.features.length;t++)e.pagesDefinition.internal.set[s+t]=u.features[t].attributes[e.pagesDefinition.generatedOid];for(let e=0;e<u.features.length;e++)c.push(new l.A({attributes:u.features[e].attributes,geometry:null}));return e.pagesDefinition.internal.keysetPagination?0!==u.features.length&&u.exceededTransferLimit?function(e,t){null==e.clause&&(e.clause=function(e){if(0===e.length)throw new d.d("NeverReach");const t=[];for(let i=0;i<e.length;i++){const r=e[i],n=[`"${r.name.replaceAll('"','""')}" ${r.asc?">":"<"} @last_${i}`];for(let t=0;t<i;t++){const i=e[t];n.push(`"${i.name.replaceAll('"','""')}" = @last_${t}`)}t.push(n.join(" AND "))}const i=t.join(" OR ");return _.A.create(i)}(e.keyFields));for(let i=0;i<e.keyFields.length;i++){const r=e.keyFields[i].name;e.clause.parameters[`last_${i}`]=t.attributes[r]}}(e.pagesDefinition.internal.keysetPagination,c.at(-1)):e.pagesDefinition.internal.fullyResolved=!0:!0===e.pagesDefinition.useOIDpagination?0===u.features.length?e.pagesDefinition.internal.fullyResolved=!0:e.pagesDefinition.internal.lastMaxId=u.features[u.features.length-1].attributes[e.pagesDefinition.generatedOid]:(void 0===u.exceededTransferLimit&&u.features.length!==e.pagesDefinition.resultRecordCount||!1===u.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=n+u.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,c}static create(e,t,i,r,n){const s=new Z.default({url:e,outFields:null===t?["*"]:t});return new W({layer:s,spatialReference:i,lrucache:r,interceptor:n})}relationshipMetaData(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,y.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,i,r,n){const s=this._layer;if(function(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(s)){const a={objectIds:[e],returnMetadata:n};(t&&t>0||i&&i>0)&&(a.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(a.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:s,query:a,method:"attachments"});const l=await s.queryAttachments(new q.A(a)),o=[];return l&&l[e]&&l[e].forEach(t=>{const i=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();let r=null;n&&t.exifInfo&&(r=N.A.convertJsonToArcade(t.exifInfo,"system",!0)),o.push(new L.A(t.id,t.name,t.contentType,t.size,i,r,t.keywords??null))}),o}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};void 0!==e.resultOffset&&null!==e.resultOffset&&(t.resultOffset=e.resultOffset.toString()),void 0!==e.resultRecordCount&&null!==e.resultRecordCount&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=(0,G.YX)(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await(0,r.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const e={},t=i.data;if(t?.relatedRecordGroups){const i=t.spatialReference;for(const r of t.relatedRecordGroups){const n=r.objectId,s=[];for(const e of r.relatedRecords){e.geometry&&(e.geometry.spatialReference=i);const t=new l.A({geometry:e.geometry?(0,O.rS)(e.geometry):null,attributes:e.attributes});s.push(t)}e[n]={features:s,exceededTransferLimit:!0===t.exceededTransferLimit}}}return e}throw new d.d("InvalidRequest")}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=(0,j.mA)(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return 1===r.features.length?r.features[0]:null}async getIdentityUser(){await this.load();const e=M.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=M.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const e=await(0,r.A)(t,{query:{f:"json"}});let i="";return e.data?.owningSystemUrl&&(i=e.data.owningSystemUrl),i}catch(e){return""}}return""}getDataSourceFeatureSet(){const e=new W({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl?.path??null;if(i){const n=await(0,r.A)(i,{responseType:"json",query:{f:"json"}});e=n?.data?.name??null,t=n?.data?.serviceItemId??null}const n=this._layer.title&&null!==(this._layer.parent??null);return this.featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===i?null:i,webMapLayerId:n?this._layer.id??null:null,webMapLayerTitle:n?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}var V=i(30235),$=i(26591);class Q extends h.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,this._findObjectId=e.objectId,this.featureObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return y.gO}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer?.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType,this._requestStandardised=e.requestStandardised),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return await this._relatedLayer.databaseType(),this._databaseType=this._relatedLayer._databaseType,this._databaseType}isTable(){return this._relatedLayer.isTable()}_isInFeatureSet(){return 0}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new l.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,n){if(await this.databaseType(),this.isTable()&&t&&null!==e&&""!==e)return new p.A([],[],!0,null);const s=this._layer.nativeCapabilities();if(!1===s.canQueryRelated)return new p.A([],[],!0,null);if(s.capabilities?.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,i,r,n);let a="",l=!1;null!==r&&!0===s.capabilities?.queryRelated.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=new $.default;o.objectIds=[this._findObjectId];const u=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]);o.outFields=u,o.relationshipId=this.relationship.id,o.where="1=1";let c=!0;!0===this._removeGeometry&&(c=!1),o.returnGeometry=c,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null;const d=await s.source.queryRelatedFeatures(o);this._checkCancelled(n);const h=d[this._findObjectId]?d[this._findObjectId].features:[],f=[];for(let e=0;e<h.length;e++)this._featureCache[h[e].attributes[this._relatedLayer.objectIdField]]=h[e],f.push(h[e].attributes[this._relatedLayer.objectIdField]);const y=t&&null!==e&&""!==e,g=null!=i;return new p.A(y||g?f:[],y||g?[]:f,l,null)}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFilteredSetUsingPaging(e,t,i,r,n){let s="",a=!1;const l=this._layer.nativeCapabilities();null!==r&&!0===l.capabilities?.queryRelated.supportsOrderBy&&(s=r.constructClause(),a=!0),await this.databaseType();let o=this._maxQueryRate();const u=l.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=t&&null!==e&&""!==e,d=null!=i;let h=null,f=!0;!0===this._removeGeometry&&(f=!1);const y=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]);return h=new p.A(c||d?["GETPAGES"]:[],c||d?[]:["GETPAGES"],a,{outFields:y.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:"1=1",orderByFields:s,returnGeometry:f,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(h,o,0,0,n),h}_expandPagedSet(e,t,i,r,n){return this._expandPagedSetFeatureSet(e,t,i,r,n)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,n=r,s=e.pagesDefinition.internal.lastPage,a=this._layer.nativeCapabilities(),l=new $.default;!0===this._requestStandardised&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await a.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==s)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let t=0;t<u.length;t++)e.pagesDefinition.internal.set[n+t]=u[t].attributes[this._relatedLayer.objectIdField];for(let e=0;e<u.length;e++)this._featureCache[u[e].attributes[this._relatedLayer.objectIdField]]=u[e];const c=!o[this._findObjectId]||!1===o[this._findObjectId].exceededTransferLimit;return u.length!==e.pagesDefinition.resultRecordCount&&c&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+u.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,u.length}async _getFeatures(e,t,i,r){const n=[];-1!==t&&void 0===this._featureCache[t]&&n.push(t);const s=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,s))return await this._expandPagedSet(e,s,0,0,r),this._getFeatures(e,t,i,r);let a=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(a++,a<=i&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[r]&&void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&n.push(e._known[r]),n.length>i)))&&!(a>=i&&0===n.length);r++);if(0===n.length)return"success";throw new d.d("MissingFeatures")}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,n,s,a){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,n){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,n){return this._relatedLayer.queryAttachments(e,t,i,r,n)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}var z=i(23732),J=i(92474),K=i(4146),Y=i(80812);function H(){null===z.A.applicationCache&&(z.A.applicationCache=new z.A)}async function X(e,t,i){if(z.A.applicationCache){const i=z.A.applicationCache.getLayerInfo(e);if(i){const r=await i;return new Z.default({url:e,outFields:t,sourceJSON:r})}const r=new Z.default({url:e,outFields:t}),n=(async()=>(await r.load(),r.sourceJSON))();if(z.A.applicationCache){z.A.applicationCache.setLayerInfo(e,n);try{return await n,r}catch(t){throw z.A.applicationCache.clearLayerInfo(e),t}}return await n,r}if(null!=i){const r=i.getCachedLayerMetadata(e);if(r){const i=await r;return new Z.default({url:e,outFields:t,sourceJSON:i})}const n=new Z.default({url:e,outFields:t}),s=(async()=>(await n.load(),n.sourceJSON))();i.setCachedLayerMetadata(e,s);try{return await s,n}catch(t){throw i.removeCachedLayerMetadata(e,s),t}}return new Z.default({url:e,outFields:t})}async function ee(e,t,i,r,n,s=null){return te(await X(e,["*"],n),t,i,r,n,s)}function te(e,t=null,i=null,r=!0,n=null,s=null){switch(e.type){case"catalog-footprint":return te(e.parent,t,i,r,n,s);case"subtype-sublayer":{const a=te(e.parent,t,i,r,n,s);return a.filter(_.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new V.A({layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:n,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:n,interceptor:s};return!e.url&&e.source?new V.A(a):new W(a)}default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function ie(e,t){if(null!==z.A.applicationCache){const t=z.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const i=t.getCachedServiceMetadata(e);if(null!=i)return i}const i=(async()=>{const t=await(0,r.A)(e,{responseType:"json",query:{f:"json"}});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==z.A.applicationCache){z.A.applicationCache.setLayerInfo(e,i);try{return await i}catch(t){throw z.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,i);try{return await i}catch(r){throw t.removeCachedServiceMetadata(e,i),r}}return i}async function re(e,t,i){const n={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},s=await ie(e,null);if(n.metadata=s,void 0!==s.controllerDatasetLayers?.utilityNetworkLayerId&&null!==s.controllerDatasetLayers.utilityNetworkLayerId){if(s.layers)for(const e of s.layers)n.layerNameLkp[e.id]=e.name;if(s.tables)for(const e of s.tables)n.layerNameLkp[e.id]=e.name;const a=s.controllerDatasetLayers.utilityNetworkLayerId;n.networkId=a;const l=await async function(e,t){const i="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==z.A.applicationCache){const e=z.A.applicationCache.getLayerInfo(i);if(null!==e)return e}const n=(async()=>{const i=await(0,r.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(i.data){const e=i.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new d.d("DataElementsNotFound")})();if(null!==z.A.applicationCache){z.A.applicationCache.setLayerInfo(i,n);try{return await n}catch(e){throw z.A.applicationCache.clearLayerInfo(i),e}}return n}(e,a);if(l){n.queryelem=l,n.queryelem?.dataElement&&void 0!==n.queryelem.dataElement.schemaGeneration&&(n.unVersion=n.queryelem.dataElement.schemaGeneration),n.lkp={},n.queryelem.dataElement.domainNetworks||(n.queryelem.dataElement.domainNetworks=[]);for(const e of n.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:n.layerNameLkp[t.layerId]??null};n.layerIdLookup.set(e.layerId,e),n.sourceIdLookup.set(e.sourceId,e),e.className&&(n.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:n.layerNameLkp[t.layerId]??null};n.layerIdLookup.set(e.layerId,e),n.sourceIdLookup.set(e.sourceId,e),e.className&&(n.lkp[e.className]=e)}}if(n.queryelem.dataElement.terminalConfigurations)for(const e of n.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)n.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const s=await async function(e){if(null!==z.A.applicationCache){const t=z.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,r.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==z.A.applicationCache){z.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw z.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+a);if(void 0!==s.systemLayers?.associationsTableId&&null!==s.systemLayers.associationsTableId){let r=null;if(i&&n.unVersion<8){const i=[];n.unVersion>=4&&(i.push("STATUS"),i.push("PERCENTALONG")),r=await ee(e+"/"+s.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...i],!1,null,null),await r.load(),n.unVersion>=4&&(r=r.filter(_.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC})),await r.load())}return{lkp:n.lkp,associations:r,unVersion:n.unVersion,terminals:n.terminals,layerIdLookup:n.layerIdLookup,sourceIdLookup:n.sourceIdLookup}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function ne(e,t,i,r=null,n=null,s=!0,a=null,l=null){let o=e.serviceUrl();if(!o)return null;o=o.endsWith("/")?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await ee(o,r,n,s,a,l);return new Q({layer:e,relatedLayer:u,relationship:t,objectId:i,spatialReference:r,outFields:n,includeGeometry:s,lrucache:a,interceptor:l})}a.A.registerAction(),R.registerAction(),c.A.registerAction(),k.A.registerAction(),D.A.registerAction();class se extends n{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=te(e,this._overrideSpatialReference,null===i?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if((0,J.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.title===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=this._map.allLayers.find(t=>(0,y.eB)(t)&&t.title===e);if(null!=n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.allTables){const r=this._map.allTables.find(t=>(0,y.eB)(t)&&t.title===e);if(null!=r)return this._makeAndAddFeatureSet(r,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){if((0,J.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.id===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=this._map.allLayers.find(t=>(0,y.eB)(t)&&t.id===e);if(n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.allTables){const r=this._map.allTables.find(t=>(0,y.eB)(t)&&t.id===e);if(null!=r)return this._makeAndAddFeatureSet(r,t,i)}return null}}class ae extends n{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=te(e,this._overrideSpatialReference,null===i?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ie(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ae(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.title===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=await this._loadMetaData();let s=null;for(const t of n.layers??[])t.name===e&&(s=t);if(!s)for(const t of n.tables??[])t.name===e&&(s=t);if(s){const e=await X(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);e=null!=e?e.toString():"";for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.id===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=await this._loadMetaData();let s=null;for(const t of n.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(!s)for(const t of n.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(s){const e=await X(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,i)}return null}}function le(e,t,i=null,r=null){return new se(e,t,i,r)}function oe(e,t,i=null,r=null){return new ae(e,t,i,r)}function ue(e,t,i,r,n){if(null===e)return null;if((0,s.m)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof K.A&&(0,y.NI)(e)){const s=e;switch(t){case"datasource":return te(s,n,"outFields"in s?s.outFields:null,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return te(s,n,"outFields"in s?s.outFields:null,!0,i,r)}return null}if((0,s.a0)(e)){switch(t){case"datasource":return te(e.parent,n,e.parent.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return te(e,n,e.parent.outFields,!0,i,r)}return null}return null}async function ce(e,t,i,r,n,s,a,l=null){if(z.A.applicationCache){const o=z.A.applicationCache.getLayerInfo(e+":"+s.url);if(o)return de(await o,t,i,r,n,a,l)}if(null!=a){const o=a.getCachedPortalItem(s.url,e);if(null!=o)return await de(await o,t,i,r,n,a,l)}const o=new Y.default({id:e,portal:s}).load();z.A.applicationCache?z.A.applicationCache.setLayerInfo(e+":"+s.url,o):null!=a&&a.setCachedPortalItem(s.url,e,o);try{return await de(await o,t,i,r,n,a,l)}catch(t){throw z.A.applicationCache&&z.A.applicationCache.clearLayerInfo(e+":"+s.url),null!=a&&a.removeCachedPortalItem(s.url,e,o),t}}async function de(e,t,i,r,n,s,a){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await X((0,y.Qi)(e.url??"")+"/"+t,["*"],s);else{if(t)throw new Error(`layerId=${t} provided for ${e.type} item`);if(null!=s){const t=s.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)l=await t;else{const t=K.A.fromPortalItem(e);s.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(i){throw s.removeCachedPortalItemLayer(e.portal.url,e.id,t),i}}}else l=await K.A.fromPortalItem(e)}return te(l,i,r,n,s,a)}},41366:(e,t,i)=>{i.d(t,{K:()=>h,Q:()=>u});var r=i(31635),n=i(66552),s=i(53966),a=i(10107),l=(i(44208),i(87811),i(93223)),o=i(40608);const u=(0,n.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",h=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&d||i&&c||null,t&&i&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,r.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,r.Cg)([(0,l.e)(u,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,r.Cg)([(0,o.$)("esri.rest.support.NormalizationBinParametersMixin")],i),i}},41560:(e,t,i)=>{i.d(t,{Ch:()=>a,mW:()=>s});var r=i(34727),n=i(39516);function s(e,t){return{...t,filterMode:e.mode}}function a(e,t,i){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:i,maxScale:r}of e.filters)t[0]=Math.max(t[0],c(i)),t[1]=Math.min(t[1],d(r));return t}(e);if(s&&((0,r.gg)(t,s[0])||(0,r.ZH)(i,s[1])))return"";const a=Array.from(l(e,t,i)),o=function(e,t,i){if(0===e.length)return!0;const n=c(e.at(0)?.minScale),s=d(e.at(-1)?.maxScale);if((0,r.ZH)(n,t)||(0,r.gg)(s,i))return!0;for(let t=0;t<e.length-1;t++){const i=e[t],n=e[t+1];if((0,r.ZH)(c(n.minScale),d(i.maxScale)))return!0}return!1}(a,t,i)?"1=1":a.map(e=>e.where||"1=1").reduce((e,t)=>(0,n.IW)(e,t),"");return o&&"1=1"!==o?o:""}function*l(e,t,i){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const r of e.filters)o(r.minScale,r.maxScale,t,i)&&(yield r)}}function o(e,t,i,n){return e=c(e),i=c(i),t=d(t),!(!(0,r.Sp)(i,e)&&(n??i)>e||(0,r.Hx)(t,i)||void 0!==n&&(0,r.Sp)(n,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},45067:(e,t,i)=>{i.d(t,{A:()=>d});var r=i(31635),n=i(69540),s=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(40608));const u=new s.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),c=new s.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let d=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,r.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],d.prototype,"cardinality",void 0),(0,r.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],d.prototype,"catalogId",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"composite",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"id",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyField",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyFieldInRelationshipTable",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"name",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"relatedTableId",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"relationshipTableId",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:c.read,write:c.write}})],d.prototype,"role",void 0),d=(0,r.Cg)([(0,o.$)("esri.layers.support.Relationship")],d)},46140:(e,t,i)=>{i.d(t,{R:()=>n});var r=i(49186);let n=class e{constructor(e,t,i=""){this.major=e,this.minor=t,this._context=i}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",i=this._context&&this._context+" ";throw new r.A(t+"unsupported-version",`Required major ${i}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,i=""){const[n,s]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new r.A((i&&i+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!a.test(s))throw new r.A((i&&i+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(n,10),o=parseInt(s,10);return new e(l,o,i)}}},50498:(e,t,i)=>{i.d(t,{Ye:()=>d,gy:()=>c,yR:()=>h});var r=i(66552),n=i(5443),s=i(91075),a=i(48526),l=i(86738),o=i(39829),u=i(82799);const c=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),d=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),h={base:s.A,key:"type",typeMap:{extent:n.A,multipoint:a.A,point:l.A,polyline:u.A,polygon:o.A}}},52106:(e,t,i)=>{i.d(t,{A:()=>I});var r,n=i(31635),s=i(37838),a=i(69540),l=i(51447),o=i(25482),u=i(53966),c=i(36708),d=i(24326),h=i(10107),p=(i(44208),i(87811),i(40608)),f=i(12195),y=i(65864),g=i(50498),m=i(55156),_=i(60950),w=i(54339),b=i(33910);function F(e){if(null==e)return null;const t={};for(const i in e){const r=e[i];r&&(t[i]=r.toJSON())}return 0!==Object.keys(t).length?t:null}let I=class extends((0,a.OU)(o.o)){static{r=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new r({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,_.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const i=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[i,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,m.I)(this.origin);if(e)return(0,w.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,w.r)(this,t):null}getGlobalId(){const e=(0,m.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:F(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,f.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const i={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",i,i,e.action)}}_notifyLayer(e,t,i,r){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:e,oldValue:t,newValue:i};"origin-transform"===e&&(n.action=r),"attributes"===e&&(n.attributeName=r),this.layer.graphicChanged(n)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,n.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const i in e){const r=(0,y.rS)(e[i]);r&&(t[i]=r)}return 0!==Object.keys(t).length?t:null}}})],I.prototype,"aggregateGeometries",null),(0,n.Cg)([(0,h.MZ)({value:null})],I.prototype,"attributes",null),(0,n.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:y.rS}})],I.prototype,"geometry",null),(0,n.Cg)([(0,h.MZ)({type:Boolean})],I.prototype,"isAggregate",void 0),(0,n.Cg)([(0,h.MZ)({clonable:!1})],I.prototype,"layer",void 0),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],I.prototype,"origin",void 0),(0,n.Cg)([(0,h.MZ)({type:s.A,value:null})],I.prototype,"popupTemplate",null),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],I.prototype,"sourceLayer",void 0),(0,n.Cg)([(0,h.MZ)({value:null,types:b.Es})],I.prototype,"symbol",null),(0,n.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],I.prototype,"_version",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,value:!0})],I.prototype,"visible",null),I=r=(0,n.Cg)([(0,p.$)("esri.Graphic")],I)},52136:(e,t,i)=>{i.d(t,{p:()=>a});var r=i(31635),n=i(10107),s=(i(44208),i(53966),i(87811),i(40608));const a=e=>{const t=e;let i=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,r.Cg)([(0,n.MZ)({type:String})],i.prototype,"apiKey",null),i=(0,r.Cg)([(0,s.$)("esri.layers.mixins.APIKeyMixin")],i),i}},54461:(e,t,i)=>{i.d(t,{A:()=>a});var r=i(87449),n=i(11221),s=i(89169);class a extends n.A{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._countedin=0,this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getSet(e);return this._wset=new s.A(t._candidates.slice(),t._known.slice(),!1,this._clonePageDefinition(t.pagesDefinition)),this._setKnownLength(this._wset)>this._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(1===t)return t;const i=this._idstates[e];return 0===i||1===i?i:0===t&&void 0===i?this._countedin<this._topnum?(this._idstates[e]=0,this._countedin++,0):(this._idstates[e]=1,1):2}async _expandPagedSet(e,t,i,n,s){if(null===this._parent)throw new r.d("NotImplemented");if(t>this._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let t=e._known.length;return t>0&&"GETPAGES"===e._known[t-1]&&(e._known.length=t-1),t=e._candidates.length,t>0&&"GETPAGES"===e._candidates[t-1]&&(e._candidates.length=t-1),"success"}const a=await this._parent._expandPagedSet(e,t,i,n,s);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,i,r){const n=[],a=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,a))return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);-1!==t&&void 0===this._featureCache[t]&&n.push(t);let l=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(l++,l<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&n.push(e._known[r]),n.length>a)));r++);if(0===n.length)return"success";const o=new s.A([],n,!1,null),u=Math.min(n.length,i);await this._parent._getFeatures(o,-1,u,r);for(let e=0;e<u;e++){const t=this._parent._featureFromCache(n[e]);void 0!==t&&(this._featureCache[n[e]]=t)}return"success"}async _getFilteredSet(e,t,i,r,n){await this._ensureLoaded();const a=await this._getSet(n);return new s.A(a._candidates.slice().concat(a._known.slice()),[],!1,this._clonePageDefinition(a.pagesDefinition))}_refineKnowns(e,t){let i=0,r=null;const n=[];for(let s=0;s<e._candidates.length;s++){const a=this._isInFeatureSet(e._candidates[s]);if(0===a){if(e._known.push(e._candidates[s]),i+=1,null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(n.push(r),r={start:s,end:s}),e._known.length>=this._topnum)break}else if(1===a)null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(n.push(r),r={start:s,end:s}),i+=1;else if(2===a)break;if(i>=t)break}null!==r&&n.push(r);for(let t=n.length-1;t>=0;t--)e._candidates.splice(n[t].start,n[t].end-n[t].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){n.A._featuresetFunctions.top=function(e){return new a({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},55156:(e,t,i)=>{i.d(t,{I:()=>n,e:()=>r});const r=Symbol("idFieldsProviderSymbol");function n(e){return(t=e)&&r in t?e[r]:void 0;var t}},55674:(e,t,i)=>{i.d(t,{Ad:()=>p,Gj:()=>g,QY:()=>h,lL:()=>m,xR:()=>f});var r=i(66131),n=i(49186),s=(i(44208),i(44729)),a=i(15032),l=i(65864),o=i(95466),u=i(43668),c=i(98623);const d=["geometry","scale","timeProperties"];function h(e,t){if(null!=t)for(const i of d)t.hasArcadeDependency(i)&&e.add(i);return e}function p(e,t){return y.create(e,t,null,["$feature","$view"])}function f(e,t,i){return y.create(e,t,i,["$feature","$view","$config"])}class y{static async create(e,t,i,r){const{arcade:s,Dictionary:a}=await(0,u.l)();let l;try{l=s.parseScript(e)}catch(t){throw new n.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const o=s.scriptUsesGeometryEngine(l);o&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,l,null,!1,o);const c={vars:r.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},d=s.compileScript(l,c);let h=null;null!=i&&(h=new a(i),h.immutable=!0);const p=new a;return p.immutable=!1,p.setField("scale",0),new y(e,s,l,d,t,p,h,a)}constructor(e,t,i,r,n,s,a,l){this.script=e,this._arcade=t,this._syntaxTree=i,this._compiled=r,this._spatialReference=n,this._viewDict=s,this._configDict=a,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new g,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const i=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:n,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=i?r.lY.epochToArcadeDate(n,i):r.lY.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=i?r.lY.epochToArcadeDate(s,i):r.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:i})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class g{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,i){const r=t??new o.A(m(e.attributes));this._boundTarget=e,this._boundSchema.fields=r.fields,this._boundSchema.fieldsIndex=r,this._boundSchema.spatialReference=i}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const i=this._getField(e);if(i){const t=this._boundTarget.attributes[i.name];if(null==t)return null;switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return a.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return r.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?r.lY.unknownEpochToArcadeDate(t):r.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function m(e){const t=[];for(const i in e)t.push({name:i,alias:i,type:"string"==typeof e[i]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,i)=>{i.d(t,{q:()=>n});var r=i(62815);function n(e,t,i){if(!i?.features||!i.hasZ)return;const n=(0,r.N)(i.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of i.features)n(e.geometry)}},62815:(e,t,i)=>{i.d(t,{N:()=>a});var r=i(83047),n=i(73941),s=i(21325);function a(e,t,i){if(null==t||null==i||i.vcsWkid||(0,s.aI)(t,i)||(0,n.xP)(t)||(0,n.xP)(i))return null;const a=(0,r.G9)(t)/(0,r.G9)(i);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,a);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},68423:(e,t,i)=>{i.d(t,{Gr:()=>_,IO:()=>y,a:()=>w,bV:()=>m,p8:()=>g});var r=i(52106),n=i(78502),s=i(87449),a=i(11221),l=i(89169),o=i(33325),u=i(80609),c=i(97768),d=i(1262),h=i(88368),p=i(16930);class f{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class y extends f{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class g extends f{constructor(e,t,i){super((0,o.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=i}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,u.bD)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class m extends f{constructor(e,t,i){super(e),this.codefield=t,this.lkp=i,this.reverseLkp={};for(const e in i)this.reverseLkp[i[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const i=this.evaluateNodeToWhereClause(e.parseTree,0,this.field.name,this.codefield instanceof h.A?(0,u.YY)(this.codefield,0):this.codefield,e.parameters);return i.includes(m.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.A.create(i,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,i=null,r=null,n){let s,a,l,c;switch(e.type){case"interval":return(0,u.oj)(this.evaluateNodeToWhereClause(e.value,t,i,r,n),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,i,m.BADNESS,n));for(let s=0;s<e.clauses.length;s++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[s].operand,t,i,m.BADNESS,n)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[s].value,t,i,m.BADNESS,n);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,i,m.BADNESS,n)),r+=" END ",r}case"parameter":{const i=n[e.value.toLowerCase()];if("string"==typeof i)return"'"+i.toString().replaceAll("'","''")+"'";if((0,o.$P)(i))return(0,u.bm)(i,t);if((0,o.Lk)(i))return(0,u.bm)(i,t);if((0,o.eg)(i))return(0,u.F1)(i,t);if((0,o.rX)(i))return(0,u.R8)(i,t);if((0,o.f0)(i))return(0,u.Nf)(i,t);if(Array.isArray(i)){const e=[];for(let r=0;r<i.length;r++)"string"==typeof i[r]?e.push("'"+i[r].toString().replaceAll("'","''")+"'"):(0,o.$P)(i[r])||(0,o.Lk)(i[r])?e.push((0,u.bm)(i[r],t)):(0,o.eg)(i[r])?e.push((0,u.F1)(i[r],t)):(0,o.rX)(i[r])?e.push((0,u.R8)(i[r],t)):(0,o.f0)(i[r])?e.push((0,u.Nf)(i[r],t)):e.push(i[r].toString());return e}return i.toString()}case"expression-list":a=[];for(const s of e.value)a.push(this.evaluateNodeToWhereClause(s,t,i,r,n));return a;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,i,m.BADNESS,n)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" AND "+this.evaluateNodeToWhereClause(e.right,t,i,r,n)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" OR "+this.evaluateNodeToWhereClause(e.right,t,i,r,n)+") ";case"IS":if("null"!==e.right.type)throw new d.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new d.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IS NOT NULL )";case"IN":if(s=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const s=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}s.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+s.join(",")+")) "}return s=this.evaluateNodeToWhereClause(e.right,t,i,r,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+s.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,n),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+c+")) ";case"NOT IN":if(s=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const s=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}s.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+s.join(",")+")) "}return s=this.evaluateNodeToWhereClause(e.right,t,i,r,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+s.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,n),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+c+")) ";case"BETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,m.BADNESS,n)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,m.BADNESS,n)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return(0,u.C6)(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":(0,u.Kb)(e.column);case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,i,m.BADNESS,n);return(0,u.F6)(e.name,r,t)}}throw new d.L("UnsupportedSyntax",{node:e.type})}extractValue(e){if(this.codefield instanceof h.A){const t=this.codefield.calculateValueCompiled(e);return this.reverseLkp[h.A.convertValueToStorageFormat(t)]}return this.reverseLkp[e.attributes[this.codefield]]}}class _ extends f{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,u.bD)(e,this.field.name,(0,u.YY)(this._sql,0),t.getFieldsIndex())}}extractValue(e){return h.A.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class w extends a.A{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new p.A({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=o.ik.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();let t=null;return t=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await(this._parent?._getSet(e)),this._checkCancelled(e),(0,c.Lw)(t),this._wset=new l.A(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(e,t,i,s){const a=[];-1!==t&&void 0===this._featureCache[t]&&a.push(t);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,o))return await this._expandPagedSet(e,o,0,0,s),this._getFeatures(e,t,i,s);let u=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(u++,u<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&a.push(e._known[r]),a.length>=o)));r++);if(0===a.length)return"success";e=new l.A([],a,e._ordered,null);const c=Math.min(a.length,i);await(this._parent?._getFeatures(e,-1,c,s)),this._checkCancelled(s);const d=[];for(let e=0;e<c;e++){const t=this._parent?._featureFromCache(a[e]);void 0!==t&&d.push({geometry:t.geometry,attributes:t.attributes,id:a[e]})}for(const e of d){const t=[];for(const i of this.adaptedFields)t[i.field.name]=i.extractValue(e);this._featureCache[e.id]=new r.A({attributes:t,geometry:(0,n.Yq)(e.geometry)})}return"success"}async _fetchAndRefineFeatures(){throw new s.d("NeverReach")}async _getFilteredSet(e,t,i,r,n){let s=!1;const a=this._reformulateWithoutAdaptions(i);s=a.cannot,i=a.where;let o=!1;if(null!==r){o=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof y)&&!0===r.scanForField(t.field.name)){if(!(t instanceof g)){r=null,o=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}r&&e.length>0&&(r=r.replaceFields(e))}null!==i?null!==this._extraFilter&&(i=(0,u.kg)(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const c=await this._parent._getFilteredSet(e,t,i,r,n);let d;return this._checkCancelled(n),d=!0===s?new l.A(c._candidates.slice().concat(c._known.slice()),[],!0===o&&c._ordered,this._clonePageDefinition(c.pagesDefinition)):new l.A(c._candidates.slice(),c._known.slice(),!0===o&&c._ordered,this._clonePageDefinition(c.pagesDefinition)),d}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const i of this.adaptedFields)if(!0===(0,u.Ju)(e,i.field.name)){const r=i.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}async _stat(e,t,i,r,n,s,a){let l=!1,o=this._reformulateWithoutAdaptions(t);if(l=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(n),l=l||o.cannot,null!==(n=o.where)?null!==this._extraFilter&&(n=(0,u.kg)(this._extraFilter,n)):n=this._extraFilter,!0===l)return null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1};const c=await this._parent._stat(e,t,i,r,n,s,a);return!1===c.calculated?null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1}:c}async _canDoAggregates(e,t,i,r,n){if(null===this._parent)return!1;for(let t=0;t<e.length;t++)for(const i of this.adaptedFields)if(e[t].toLowerCase()===i.field.name.toLowerCase()&&!(i instanceof y))return!1;const s=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)return!1;const t=i.clone();t.workingexpr=e.where,s.push(t)}else s.push(i)}const a=this._reformulateWithoutAdaptions(n);return!a.cannot&&(null!==(n=a.where)?null!==this._extraFilter&&(n=(0,u.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent._canDoAggregates(e,s,i,r,n))}async _getAggregatePagesDataSourceDefinition(e,t,i,r,n,a,l){if(null===this._parent)throw new s.d("NeverReach");const o=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)throw new s.d("NeverReach");const t=i.clone();t.workingexpr=e.where,o.push(t)}else o.push(i)}const c=this._reformulateWithoutAdaptions(n);if(c.cannot)throw new s.d("NeverReach");return null!==(n=c.where)?null!==this._extraFilter&&(n=(0,u.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,o,i,r,n,a,l)}}},73681:(e,t,i)=>{i.d(t,{n:()=>o});var r=i(49186),n=i(53966),s=i(46140),a=i(95466),l=i(55674);class o{static async from(e,t,i){const a=e.dictionary_version?s.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(i))h.delete(e);h.size&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const p=await(0,l.xR)(e.expression,null,d);if(!p)throw new r.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const f=!a||!a.greaterEqual(4,0);f&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:a});const y=new u(i,f);return new o(f,c,p,y)}constructor(e,t,i,r){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=i,this._reader=r}get itemNames(){return this._itemNames}evaluate(e,t,i,r){try{return this._reader.bind(e,i,r),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new a.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new a.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},77548:(e,t,i)=>{i.d(t,{Gh:()=>y,tk:()=>d,BR:()=>c,wI:()=>u,G$:()=>p,$x:()=>h,Ov:()=>l,W_:()=>o,OP:()=>f,TU:()=>a,XX:()=>s});var r=i(70333),n=i(78888);i(7762),i(84952),i(36563),i(36708),i(4146),new WeakMap;const s={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function o(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function u(e,t){const i=r.id?.findServerInfo(e);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const a=`${e.slice(0,s)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,n.A)(a,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function c(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function d(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function h(e,t){return null}function p(e){return null}function f(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function y(e,t){if(!t||!f(e))return;const i=(e.url,null);i&&(e.url=i)}},79677:(e,t,i)=>{i.d(t,{A:()=>h});var r,n=i(31635),s=i(25482),a=i(88930),l=i(10107),o=(i(44208),i(53966),i(87811),i(36005)),u=i(40608),c=i(43937),d=i(98623);let h=class extends s.o{static{r=this}static get allTime(){return p}static get empty(){return f}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===r&&i===n}expandTo(e,t=d.qU){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,a.lL)(i,e,t));let n=this.end;if(n){const i=(0,a.lL)(n,e,t);n=n.getTime()===i.getTime()?i:(0,a.S1)(i,1,e,t)}return new r({start:i,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let a,l;return n>=t&&n<=i?a=n:t>=n&&t<=s&&(a=t),i>=n&&i<=s?l=i:s>=t&&s<=i&&(l=s),null==a||null==l||isNaN(a)||isNaN(l)?r.empty:new r({start:a===-1/0?null:new Date(a),end:l===1/0?null:new Date(l)})}offset(e,t,i=d.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new r,{start:s,end:l}=this;return null!=s&&(n.start=(0,a.S1)(s,e,t,i)),null!=l&&(n.end=(0,a.S1)(l,e,t,i)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,n.Cg)([(0,o.w)("end")],h.prototype,"readEnd",null),(0,n.Cg)([(0,c.K)("end")],h.prototype,"writeEnd",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,n.Cg)([(0,o.w)("start")],h.prototype,"readStart",null),(0,n.Cg)([(0,c.K)("start")],h.prototype,"writeStart",null),h=r=(0,n.Cg)([(0,u.$)("esri.time.TimeExtent")],h);const p=new h,f=new h({start:void 0,end:void 0})},86691:(e,t,i)=>{i.d(t,{A:()=>o});var r=i(78878),n=i(87449),s=i(11221),a=i(89169),l=i(87594);class o extends s.A{constructor(e){super(e),this._orderbyclause=null,this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,this._orderbyclause,e);return this._checkCancelled(e),this._wset=t,this._wset}return this._wset}async manualOrderSet(e,t){const i=await this.getIdColumnDictionary(e,[],-1,t);this._orderbyclause?.order(i);const r=new a.A([],[],!0,null);for(let e=0;e<i.length;e++)r._known.push(i[e].id);return r}async getIdColumnDictionary(e,t,i,n){if(i<e._known.length-1){const s=this._maxQueryRate();if("GETPAGES"===e._known[i+1])return await(0,r.a1)(this._parent._expandPagedSet(e,s,0,0,n)),this.getIdColumnDictionary(e,t,i,n);let a=i+1;const l=[];for(;a<e._known.length&&"GETPAGES"!==e._known[a];)l.push(e._known[a]),a++;i+=l.length;const o=await(0,r.a1)(this._parent._getFeatureBatch(l,n));this._checkCancelled(n);for(const e of o)t.push({id:e.attributes[this.objectIdField],feature:e});return this.getIdColumnDictionary(e,t,i,n)}return e._candidates.length>0?(await(0,r.a1)(this._refineSetBlock(e,this._maxProcessingRate(),n)),this._checkCancelled(n),this.getIdColumnDictionary(e,t,i,n)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(void 0===this._featureCache[e]){const t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new n.d("NeverReach")}async _getFilteredSet(e,t,i,r,n){await this._ensureLoaded();const s=await this._parent._getFilteredSet(e,t,i,null===r?this._orderbyclause:r,n);this._checkCancelled(n);const l=new a.A(s._candidates.slice(),s._known.slice(),s._ordered,this._clonePageDefinition(s.pagesDefinition));let o=!0;if(s._candidates.length>0&&(o=!1),!1===l._ordered){let e=await this.manualOrderSet(l,n);return!1===o&&(null===t&&null===i||(e=new a.A(e._candidates.slice().concat(e._known.slice()),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)))),e}return l}static registerAction(){s.A._featuresetFunctions.orderBy=function(e){return""===e?this:new o({parentfeatureset:this,orderbyclause:new l.A(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},87594:(e,t,i)=>{function r(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}i.d(t,{A:()=>n});class n{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const i=t[e].match(/\S+/g);this._fields.push(i[0]),2===i.length?"asc"===i[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort((e,t)=>{for(let i=0;i<this._fields.length;i++){const n=this.featureValue(e.feature,this._fields[i],i),s=this.featureValue(t.feature,this._fields[i],i);let a=0;if(a=1===this._directions[i]?r(n,s):-1*r(n,s),0!==a)return a}return 0})}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let i=0;i<this._fields.length;i++){0!==i&&(t+=",");let r=this._fields[i];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[i]?t+=" ASC":t+=" DESC"}return new n(t)}featureValue(e,t,i){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[i]=r,e.attributes[r];return null}}},91880:(e,t,i)=>{i.d(t,{A:()=>c});var r,n=i(31635),s=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(40608));const u=new s.J({asc:"ascending",desc:"descending"});let c=class extends a.o{static{r=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new r({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],c.prototype,"valueExpression",void 0),(0,n.Cg)([(0,l.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],c.prototype,"order",void 0),c=r=(0,n.Cg)([(0,o.$)("esri.layers.support.OrderByInfo")],c)},98988:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>Q,getTransformation:()=>Z,getTransformations:()=>q,initializeProjection:()=>J,isEqualBaseGCS:()=>z,isLoaded:()=>D,isLoadedOrLoad:()=>M,isLoadedOrLoadFor:()=>L,load:()=>P,project:()=>E,projectExtent:()=>se,projectMany:()=>j,projectMultipoint:()=>X,projectOrLoad:()=>O,projectOrLoadMany:()=>G,projectPoint:()=>Y,projectPolygon:()=>re,projectPolyline:()=>te,projectWithZConversion:()=>$,projectWithoutEngine:()=>K,requiresLoad:()=>N,test:()=>W,tryProjectWithZConversion:()=>V,unload:()=>B});var r=i(49186),n=i(74887),s=i(62788),a=i(95488),l=i(51850),o=i(21276),u=i(73941),c=i(5443),d=i(48526),h=i(83290),p=i(86738),f=i(39829),y=i(82799),g=i(16930),m=i(9762),_=i(37539);function w(e,t,i,r,n,s){return b[0]=e,b[1]=t,b[2]=i,(0,m.projectBuffer)(b,r,0,n,s,0)}const b=(0,l.vt)();let F=0;class I{static fromGE(e){const t=new I;return t._wkt=e.wkt,t._wkid=e.wkid,t._isInverse=e.isInverse,t}constructor(e){this.uid=F++,e?(this._wkt=null!=e.wkt?e.wkt:null,this._wkid=null!=e.wkid?e.wkid:-1,this._isInverse=null!=e.isInverse&&!0===e.isInverse):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=F++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=F++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=F++}getInverse(){const e=new I;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}}class S{static cacheKey(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}static fromGE(e){const t=new S;let i="";for(const r of e.steps){const e=I.fromGE(r);t.steps.push(e),i+=e.uid.toString()+","}return t._cachedProjection={},t._gtlistentry=null,t._chain=i,t}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e?.steps)for(const t of e.steps)t instanceof I?this.steps.push(t):this.steps.push(new I({wkid:t.wkid,wkt:t.wkt,isInverse:t.isInverse}))}getInverse(){const e=new S;e.steps=[];for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}getGTListEntry(){let e="";for(const t of this.steps)e+=t.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,t,i){this._cachedProjection[S.cacheKey(e,t)]=i}getCachedGeTransformation(e,t){let i="";for(const e of this.steps)i+=e.uid.toString()+",";i!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=i);const r=this._cachedProjection[S.cacheKey(e,t)];return void 0===r?null:r}}var v=i(21325),A=i(62815);let T=null,C=null,x=null,R={};const k=new a.I;function D(){return!!T&&(0,h.i)()}function M(){return!!D()||((0,s.gc)(k),P(),!1)}function L(e,t){return!e||!t||Q(e,t)||M()}function N(e,t){return!Q(e,t)&&!D()}function P(e){return null==x&&(x=Promise.all([(0,h.l)(),i.e(9930).then(i.bind(i,49930)).then(e=>e.g),i.e(2731).then(i.bind(i,12731))])),x.then(([,t,{hydratedAdapter:i}])=>{(0,n.Te)(e),C=i,T=t.default,T._enableProjection(h.p),k.notify()})}function E(e,t,i=null,r=null){return Array.isArray(e)?0===e.length?[]:((0,o.H)(e),j(C,e,e[0].spatialReference,t,i,r)):((0,o.f)(e),j(C,[e],e.spatialReference,t,i,r)[0])}function j(e,t,i,r,n=null,s=null){if(null==i||null==r)return t;if(Q(i,r,n))return t.map(e=>K(e,i,r));if(null==n&&(0,u.jA)(i))return t.map(e=>K(e,i,g.A.WGS84)).map(e=>V(e,r));if(null==n&&(0,u.jA)(r))return t.map(e=>V(e,g.A.WGS84)).map(e=>K(e,g.A.WGS84,r));if(null==n){const e=S.cacheKey(i,r);void 0!==R[e]?n=R[e]:(null==(n=Z(i,r,void 0))&&(n=new S),R[e]=n)}if(null==T||null==e)throw new U;return null!=s?T._project(e,t,i,r,n,s):T._project(e,t,i,r,n)}function O(e,t){const i=G([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function G(e,t){if(!D())for(const i of e)if(null!=i&&!(0,v.aI)(i.spatialReference,t)&&(0,v.fn)(i.spatialReference)&&(0,v.fn)(t)&&!Q(i.spatialReference,t))return(0,s.gc)(k),{pending:P(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,v.aI)(e.spatialReference,t)?e:(0,v.fn)(e.spatialReference)&&(0,v.fn)(t)?V(e,t):null)}}function Z(e,t,i=null){if(null==e||null==t)return null;if(null==T||null==C)throw new U;const r=T._getTransformation(C,e,t,i,i?.spatialReference);return null!==r?S.fromGE(r):null}function q(e,t,i=null){if(null==T||null==C)throw new U;const r=T._getTransformationBySuitability(C,e,t,i,i?.spatialReference);if(null!==r){const e=[];for(const t of r)e.push(S.fromGE(t));return e}return[]}class U extends r.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function B(){T=null,C=null,x=null,R={}}const W={get loadPromise(){return x}};function V(e,t){try{const i=E(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const r=(0,A.N)(i.type,e.spatialReference,t);return null!=r&&r(i),i}catch(e){if(!(e instanceof U))throw e;return null}}async function $(e,t,i){const r=e.spatialReference;return null!=r&&null!=t&&await J(r,t,null,i),V(e,t)}function Q(e,t,i){return!i&&(!!(0,v.aI)(e,t)||(0,v.fn)(e)&&(0,v.fn)(t)&&!!(0,_.jd)(e,t))}function z(e,t){if((0,v.aI)(e,t))return!0;if(!(0,v.fn)(e)||!(0,v.fn)(t))return!1;const i=(0,v.oT)(e)||(0,v.K8)(e)||(0,v.x1)(e),r=(0,v.oT)(t)||(0,v.K8)(t)||(0,v.x1)(t);return i&&r}async function J(e,t,i,r){if(D())return(0,n.NO)(r);if(Array.isArray(e)){for(const{source:t,dest:i,geographicTransformation:n}of e)if(t&&i&&!Q(t,i,n))return P(r)}else if(e&&t&&!Q(e,t,i))return P(r);return(0,n.NO)(r)}function K(e,t,i){return e?"x"in e?H(e,t,new p.A,i,0):"xmin"in e?ae(e,t,new c.A,i,0):"rings"in e?ne(e,t,new f.A,i,0):"paths"in e?ie(e,t,new y.A,i,0):"points"in e?ee(e,t,new d.A,i,0):null:null}function Y(e,t,i=t.spatialReference,r=0){return null!=i&&null!=e.spatialReference&&null!=H(e,e.spatialReference,t,i,r)}function H(e,t,i,r,n){oe[0]=e.x,oe[1]=e.y;const s=e.z;return oe[2]=void 0!==s?s:n,(0,m.projectBuffer)(oe,t,0,oe,r,0)?(i.x=oe[0],i.y=oe[1],i.spatialReference=r,void 0!==s||(0,u.xP)(r)?(i.z=oe[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function X(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ee(e,e.spatialReference,t,i,r)}function ee(e,t,i,r,n){const{points:s,hasZ:a,hasM:l}=e,o=[],c=s.length,d=[];for(const e of s)d.push(e[0],e[1],a?e[2]:n);if(!(0,m.projectBuffer)(d,t,0,d,r,0,c))return null;const h=a||(0,u.xP)(r);for(let e=0;e<c;++e){const t=3*e,i=d[t],r=d[t+1];h&&l?o.push([i,r,d[t+2],s[e][3]]):h?o.push([i,r,d[t+2]]):l?o.push([i,r,s[e][2]]):o.push([i,r])}return i.points=o,i.spatialReference=r,i.hasZ=a,i.hasM=l,i}function te(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ie(e,e.spatialReference,t,i,r)}function ie(e,t,i,r,n){const{paths:s,hasZ:a,hasM:l}=e,o=[];if(!le(s,a??!1,l??!1,t,o,r,n))return null;const c=a||(0,u.xP)(r);return i.paths=o,i.spatialReference=r,i.hasZ=c,i.hasM=l,i}function re(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ne(e,e.spatialReference,t,i,r)}function ne(e,t,i,r,n){const{rings:s,hasZ:a,hasM:l}=e,o=[];if(!le(s,a??!1,l??!1,t,o,r,n))return null;const c=a||(0,u.xP)(r);return i.rings=o,i.spatialReference=r,i.hasZ=c,i.hasM=l,i}function se(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ae(e,e.spatialReference,t,i,r)}function ae(e,t,i,r,n){const{xmin:s,ymin:a,xmax:l,ymax:o,hasZ:c,hasM:d}=e;if(!w(s,a,c?e.zmin:n,t,oe,r))return null;const h=c||(0,u.xP)(r);return i.xmin=oe[0],i.ymin=oe[1],h&&(i.zmin=oe[2]),w(l,o,c?e.zmax:n,t,oe,r)?(i.xmax=oe[0],i.ymax=oe[1],h&&(i.zmax=oe[2]),d&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=r,i):null}function le(e,t,i,r,n,s,a=0){const l=new Array;for(const i of e)for(const e of i)l.push(e[0],e[1],t?e[2]:a);if(!(0,m.projectBuffer)(l,r,0,l,s,0))return!1;let o=0;n.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const r of t)c&&i?e.push([l[o++],l[o++],l[o++],r[3]]):c?e.push([l[o++],l[o++],l[o++]]):i?(e.push([l[o++],l[o++],r[2]]),o++):(e.push([l[o++],l[o++]]),o++);n.push(e)}return!0}const oe=(0,l.vt)()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2561],{4146:(e,t,r)=>{r.d(t,{A:()=>b});var i=r(31635),o=r(78888),s=r(49186),n=r(65529),l=r(4902),a=r(92474),p=r(53966),u=r(74887),d=r(84952),c=r(10107),y=(r(44208),r(87811),r(40608)),h=r(5443),g=r(16930),f=r(92602),m=r(79677);let v=0,b=class extends((0,n.Zt)((0,l.sA)(a.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new h.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([r.e(812),r.e(5613),r.e(5710)]).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",o=r?.portal?.url||f.A.portalUrl;throw p.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,u.zf)(e)||p.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,o.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,c.MZ)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],b.prototype,"effectiveVisible",null),(0,i.Cg)([(0,c.MZ)({type:h.A})],b.prototype,"fullExtent",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,i.Cg)([(0,c.MZ)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,i.Cg)([(0,c.MZ)({clonable:!1})],b.prototype,"parent",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,i.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],b.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,c.MZ)({type:g.A})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)({type:String})],b.prototype,"title",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)()],b.prototype,"url",void 0),(0,i.Cg)([(0,c.MZ)({type:m.A})],b.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,i.Cg)([(0,y.$)("esri.layers.Layer")],b)},4902:(e,t,r)=>{r.d(t,{PH:()=>l,sA:()=>n});var i=r(31635),o=r(40608);let s=0;const n=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return r=(0,i.Cg)([(0,o.$)("esri.core.Identifiable")],r),r},l=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:s++})}};return r=(0,i.Cg)([(0,o.$)("esri.core.Identifiable.NumericIdentifiable")],r),r};n(class{})},17311:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),o=r(65008),s=r(4576),n=r(60999),l=r(7762),a=r(10107),p=(r(44208),r(53966),r(40608)),u=r(30524),d=r(43668);let c=class extends o.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,n.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),i=this.fieldsIndex.get(r.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const i=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(i)??""}async getTitles(e,t,r){const i=new Map,o=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:n,workingTitle:l}=this,a=l&&n;t.forEach(t=>{const r=t.getObjectId()??t.attributes[e.objectIdField],p=a?s({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:n,globalAttributes:this._createFormattedAttributes(e,t,o).global,layer:e,text:l}):"";i.set(r,p)})}catch{}return i}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(s.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,u.Kl)(e,this.requiredFields))){const i=e.createQuery();i.where="1=1",i.outFields=[...this.requiredFields],i.objectIds=r;const o=await e.queryFeatures(i);if(o?.features.length===t.length)return o.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),i=e?.name??r.fieldName;r.fieldName=i,t.set(i.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],o={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{o[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const s={...t.attributes,...o};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:s,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,u.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,i.Cg)([(0,a.MZ)({readOnly:!0})],c.prototype,"_arcadeTask",null),(0,i.Cg)([(0,a.MZ)()],c.prototype,"_featureUtils",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],c.prototype,"featureUtilsPromise",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],c.prototype,"calculatedExpressions",null),(0,i.Cg)([(0,a.MZ)()],c.prototype,"displayField",void 0),(0,i.Cg)([(0,a.MZ)()],c.prototype,"effectivePopupTemplate",void 0),(0,i.Cg)([(0,a.MZ)()],c.prototype,"expressionsUsedInTitle",null),(0,i.Cg)([(0,a.MZ)()],c.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,a.MZ)()],c.prototype,"fieldInfoMap",null),(0,i.Cg)([(0,a.MZ)()],c.prototype,"fields",void 0),(0,i.Cg)([(0,a.MZ)()],c.prototype,"objectIdField",void 0),(0,i.Cg)([(0,a.MZ)()],c.prototype,"requiredFields",null),c=(0,i.Cg)([(0,p.$)("esri.layers.support.TitleCreator")],c)},22671:(e,t,r)=>{r.d(t,{A:()=>v});var i,o=r(31635),s=r(52106),n=r(66552),l=r(25482),a=r(4718),p=r(10107),u=(r(44208),r(53966),r(36005)),d=r(40608),c=r(43937),y=r(16930),h=r(65864),g=r(50498),f=r(20437);const m=new n.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=i=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,r,i){if(e)return void m.write(e,t,r,i);const{features:o}=this;if(o)for(const e of o)if(null!=e?.geometry)return void m.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,h.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=y.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,a.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,o]}=e,s=this.features,n=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-i)/t),e=>Math.round((o-e)/r));for(let e=0,t=s.length;e<t;e++)n?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,o],scale:[s,n]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const p=this._getHydrationFunction(e,e=>e*s+i,e=>o-e*n,l,a);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const i=y.A.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const s=e[t],n=r.fromJSON(s),l=s.geometry?.spatialReference;null==n.geometry||l||(n.geometry.spatialReference=i);const a=s.aggregateGeometries,p=n.aggregateGeometries;if(a&&null!=p)for(const e in p){const t=p[e],r=a[e],o=r?.spatialReference;null==t||o||(t.spatialReference=i)}o.push(n)}return o}_quantizePoints(e,t,r){let i,o;const s=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===i&&n===o||(s.push([e-i,n-o]),i=e,o=n)}else i=t(l[0]),o=r(l[1]),s.push([i,o])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,h.Bi)(e)?e.rings:e.paths,o=[];for(let e=0,s=i.length;e<s;e++){const s=i[e],n=this._quantizePoints(s,t,r);n&&o.push(n)}return o.length>0?((0,h.Bi)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,o){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,h.Bi)(e)?e.rings:e.paths;let n,l;for(let e=0,i=s.length;e<i;e++){const i=s[e];for(let e=0,o=i.length;e<o;e++){const o=i[e];e>0?(n+=o[0],l+=o[1]):(n=o[0],l=o[1]),o[0]=t(n),o[1]=r(l)}}if(i&&o)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=o(r[3])}}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(o)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),o&&null!=e.mmax&&null!=e.mmin&&(e.mmax=o(e.mmax),e.mmin=o(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let n,l;for(let e=0,i=s.length;e<i;e++){const i=s[e];e>0?(n+=i[0],l+=i[1]):(n=i[0],l=i[1]),i[0]=t(n),i[1]=r(l)}if(i&&o)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2]),t[3]=o(t[3])}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2])}else if(o)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=o(t[2])}}:null}};(0,o.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,o.Cg)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,o.Cg)([(0,p.MZ)({type:[s.A],json:{write:!0}})],v.prototype,"features",void 0),(0,o.Cg)([(0,u.w)("features")],v.prototype,"readFeatures",null),(0,o.Cg)([(0,p.MZ)({type:[f.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,o.Cg)([(0,p.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],v.prototype,"geometryType",void 0),(0,o.Cg)([(0,c.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,o.Cg)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,o.Cg)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,o.Cg)([(0,p.MZ)({types:g.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,o.Cg)([(0,u.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,o.Cg)([(0,p.MZ)({type:y.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,o.Cg)([(0,c.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,o.Cg)([(0,p.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=i=(0,o.Cg)([(0,d.$)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0},29005:(e,t,r)=>{r.d(t,{A:()=>u});var i=r(31635),o=r(69540),s=r(66552),n=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));const p=new s.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let u=class extends((0,o.OU)(n.o)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"description",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:p.read,write:p.write}})],u.prototype,"drawingTool",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"prototype",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"thumbnail",void 0),u=(0,i.Cg)([(0,a.$)("esri.layers.support.FeatureTemplate")],u)},32756:(e,t,r)=>{r.d(t,{Rr:()=>a,fY:()=>u,ne:()=>p});var i=r(31635),o=r(93637),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608)),l=r(91880);function a(e,t,r){if(!e)return null;const i=e.find(e=>!!e.field);if(!i)return null;const o=new l.A;return o.read(i,r),[o]}const p={type:[l.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:a},write:{writer:function(e,t,r,i){const s=e.find(e=>!!e.field);s&&(0,o.sM)(r,[s.toJSON()],t)}}}},u=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,i.Cg)([(0,s.MZ)(p)],r.prototype,"orderBy",void 0),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.OrderedLayer")],r),r}},33143:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),o=r(69540),s=r(25482),n=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),a=r(40608),p=r(43937),u=r(80451),d=r(29005);let c=class extends((0,o.OU)(s.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,u.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],c.prototype,"id",void 0),(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],c.prototype,"domains",void 0),(0,i.Cg)([(0,l.w)("domains")],c.prototype,"readDomains",null),(0,i.Cg)([(0,p.K)("domains")],c.prototype,"writeDomains",null),(0,i.Cg)([(0,n.MZ)({type:[d.A],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,i.Cg)([(0,a.$)("esri.layers.support.FeatureType")],c)},37352:(e,t,r)=>{r.d(t,{A:()=>p});var i,o=r(31635),s=r(7762),n=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));let p=i=class extends n.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.A}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,o.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"floorField",void 0),(0,o.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],p.prototype,"viewAllMode",void 0),(0,o.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],p.prototype,"viewAllLevelIds",void 0),p=i=(0,o.Cg)([(0,a.$)("esri.layers.support.LayerFloorInfo")],p)},45067:(e,t,r)=>{r.d(t,{A:()=>d});var i=r(31635),o=r(69540),s=r(66552),n=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));const p=new s.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),u=new s.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let d=class extends((0,o.OU)(n.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,i.Cg)([(0,l.MZ)({json:{read:p.read,write:p.write}})],d.prototype,"cardinality",void 0),(0,i.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],d.prototype,"catalogId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"composite",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyField",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyFieldInRelationshipTable",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"relatedTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"relationshipTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],d.prototype,"role",void 0),d=(0,i.Cg)([(0,a.$)("esri.layers.support.Relationship")],d)},52106:(e,t,r)=>{r.d(t,{A:()=>C});var i,o=r(31635),s=r(37838),n=r(69540),l=r(51447),a=r(25482),p=r(53966),u=r(36708),d=r(24326),c=r(10107),y=(r(44208),r(87811),r(40608)),h=r(12195),g=r(65864),f=r(50498),m=r(55156),v=r(60950),b=r(54339),w=r(33910);function M(e){if(null==e)return null;const t={};for(const r in e){const i=e[r];i&&(t[r]=i.toJSON())}return 0!==Object.keys(t).length?t:null}let C=class extends((0,n.OU)(a.o)){static{i=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(p.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new i({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,v.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,m.I)(this.origin);if(e)return(0,b.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,b.r)(this,t):null}getGlobalId(){const e=(0,m.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:M(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,h.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const o={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(o.action=i),"attributes"===e&&(o.attributeName=i),this.layer.graphicChanged(o)}_watchMeshGeometryChanges(){this.addHandles([(0,u.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,u.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,o.Cg)([(0,c.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const i=(0,g.rS)(e[r]);i&&(t[r]=i)}return 0!==Object.keys(t).length?t:null}}})],C.prototype,"aggregateGeometries",null),(0,o.Cg)([(0,c.MZ)({value:null})],C.prototype,"attributes",null),(0,o.Cg)([(0,c.MZ)({value:null,types:f.yR,json:{read:g.rS}})],C.prototype,"geometry",null),(0,o.Cg)([(0,c.MZ)({type:Boolean})],C.prototype,"isAggregate",void 0),(0,o.Cg)([(0,c.MZ)({clonable:!1})],C.prototype,"layer",void 0),(0,o.Cg)([(0,c.MZ)({clonable:"reference"})],C.prototype,"origin",void 0),(0,o.Cg)([(0,c.MZ)({type:s.A,value:null})],C.prototype,"popupTemplate",null),(0,o.Cg)([(0,c.MZ)({clonable:"reference"})],C.prototype,"sourceLayer",void 0),(0,o.Cg)([(0,c.MZ)({value:null,types:w.Es})],C.prototype,"symbol",null),(0,o.Cg)([(0,c.MZ)({clonable:!1,json:{read:!1,write:!1}})],C.prototype,"_version",void 0),(0,o.Cg)([(0,c.MZ)({type:Boolean,value:!0})],C.prototype,"visible",null),C=i=(0,o.Cg)([(0,y.$)("esri.Graphic")],C)},52136:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(31635),o=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const n=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,o.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,s.$)("esri.layers.mixins.APIKeyMixin")],r),r}},55156:(e,t,r)=>{r.d(t,{I:()=>o,e:()=>i});const i=Symbol("idFieldsProviderSymbol");function o(e){return(t=e)&&i in t?e[i]:void 0;var t}},77548:(e,t,r)=>{r.d(t,{Gh:()=>g,tk:()=>d,BR:()=>u,wI:()=>p,G$:()=>y,$x:()=>c,Ov:()=>l,W_:()=>a,OP:()=>h,TU:()=>n,XX:()=>s});var i=r(70333),o=r(78888);r(7762),r(84952),r(36563),r(36708),r(4146),new WeakMap;const s={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function n(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function a(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function p(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const n=`${e.slice(0,s)}/rest/info`,l=null!=t?t.signal:null,{data:a}=await(0,o.A)(n,{query:{f:"json"},responseType:"json",signal:l});return a?.owningSystemUrl||null}function u(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function d(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function c(e,t){return null}function y(e){return null}function h(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function g(e,t){if(!t||!h(e))return;const r=(e.url,null);r&&(e.url=r)}},91880:(e,t,r)=>{r.d(t,{A:()=>u});var i,o=r(31635),s=r(66552),n=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));const p=new s.J({asc:"ascending",desc:"descending"});let u=class extends n.o{static{i=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new i({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,o.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],u.prototype,"field",void 0),(0,o.Cg)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],u.prototype,"valueExpression",void 0),(0,o.Cg)([(0,l.MZ)({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"order",void 0),u=i=(0,o.Cg)([(0,a.$)("esri.layers.support.OrderByInfo")],u)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7136,8535],{17136:(e,t,r)=>{r.d(t,{Y_:()=>S,O7:()=>R,el:()=>A});var n=r(92602),o=r(69052),s=r(49186),i=r(53966),a=r(39829),u=r(82799),l=r(16930),c=r(80754),f=r(21325),d=r(28735),m=r(78888),p=r(65864),h=r(2272),g=r(84952),y=r(92300);const x=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function b(e){return"polyline"===e[0].type}function v(e,t,r){if(t){const t=function(e,t){if(!(e instanceof u.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new s.A("internal:geometry",e)}const r=(0,c.r8)(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 o=e[n][0],s=e[n][1],i=e[n+1][0],a=e[n+1][1],u=Math.sqrt((i-o)*(i-o)+(a-s)*(a-s)),l=(a-s)/u,c=(i-o)/u,f=u/t;if(f>1){for(let e=1;e<=f-1;e++){const n=e*t,i=c*n+o,a=l*n+s;r.push([i,a])}const e=(u+Math.floor(f-1)*t)/2,n=c*e+o,i=l*e+s;r.push([n,i])}r.push([i,a])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:n,spatialReference:e.spatialReference}):new u.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.ci)(t,!0)}return r&&(e=(0,c.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=(0,c.kd)(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=(0,c.kd)(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=(0,c.kd)(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=(0,c.kd)(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function M(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const o=t.cutIndexes[n],s=t.geometries[n],i=(0,c.r8)(s);for(let e=0;e<i.length;e++){const t=i[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,c.kd)(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(o===r){if(w(e))for(const t of(0,c.r8)(s))e[o]=e[o].addRing(t);else if(b(e))for(const t of(0,c.r8)(s))e[o]=e[o].addPath(t)}else r=o,e[o]=s}return e}async function A(e,t,r){if(!Array.isArray(e))return A([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const o="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let s,i,l,w,b,R,B,S,I=0;const _=[],P=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,i=(0,f.Vp)(s),l=s.isWebMercator,R=l?102100:4326,w=c.j7[R].maxX,b=c.j7[R].minX,B=c.j7[R].plus180Line,S=c.j7[R].minus180Line),i)if("mesh"===t.type)P.push(t);else if("point"===t.type)P.push(T(t.clone(),w,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,w,b)),P.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);P.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,r=(0,c.kd)(e.xmin,b)*(2*w);let n=0===r?t.clone():(0,c.kS)(t.clone(),r);e.offset(r,0);let{xmin:o,xmax:s}=e;o=Number(o.toFixed(9)),s=Number(s.toFixed(9)),e.intersects(B)&&s!==w?(I=s>I?s:I,n=v(n,l),_.push(n),P.push("cut")):e.intersects(S)&&o!==b?(I=s*(2*w)>I?s*(2*w):I,n=v(n,l,360),_.push(n),P.push("cut")):P.push(n)}else P.push(t.clone());else P.push(t);else P.push(t);let E=(0,c.kd)(I,w),O=-90;const U=E,L=new u.A;for(;E>0;){const e=360*E-180;L.addPath([[e,O],[e,-1*O]]),O*=-1,E--}if(_.length>0&&U>0){const t=M(_,await async function(e,t,r,n){const o=(0,h.Dl)(e),s=t[0].spatialReference,i={...n,responseType:"json",query:{...o.query,f:"json",sr:(0,f.YX)(s),target:JSON.stringify({geometryType:(0,p.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,m.A)(o.path+"/cut",i),{cutIndexes:u,geometries:l=[]}=a.data;return{cutIndexes:u,geometries:l.map(e=>{const t=(0,p.rS)(e);return t.spatialReference=s,t})}}(o,_,L,r)),n=[],s=[];for(let r=0;r<P.length;r++){const o=P[r];if("cut"!==o)s.push(o);else{const o=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&o.rings.length>=i.rings.length?(n.push(o),s.push("simplify")):s.push(l?(0,d.Gh)(o):o)}}if(!n.length)return s;const i=await async function(e,t,r){const n="string"==typeof e?(0,g.An)(e):e,o=t[0].spatialReference,s=(0,p.$B)(t[0]),i={...r,query:{...n.query,f:"json",sr:(0,f.YX)(o),geometries:JSON.stringify((0,y.X)(t))}},{data:a}=await(0,m.A)(n.path+"/simplify",i);return(0,y.V)(a.geometries,s,o)}(o,n,r),a=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?a.push(t):a.push(l?(0,d.Gh)(i.shift()):i.shift())}return a}const k=[];for(let e=0;e<P.length;e++){const t=P[e];if("cut"!==t)k.push(t);else{const e=_.shift();k.push(!0===l?(0,d.Gh)(e):e)}}return k}function R(e,t,r){const n=(0,f.Vp)(r);if(null==n)return e;const[o,s]=n.valid,i=2*s;let a=0,u=0;t>s?a=Math.ceil(Math.abs(t-s)/i):t<o&&(a=-Math.ceil(Math.abs(t-o)/i)),e>s?u=Math.ceil(Math.abs(e-s)/i):e<o&&(u=-Math.ceil(Math.abs(e-o)/i));let l=e+(a-u)*i;const c=l-t;return c>s?l-=i:c<o&&(l+=i),l}function B(e){const t=(0,f.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new o.hr(r,n)}const S=B(l.A.WGS84);B(l.A.WebMercator)},21015:(e,t,r)=>{r.d(t,{R:()=>u});var n=r(78888),o=r(60999),s=r(49186),i=r(74887),a=r(84952);class u{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load(0,e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,i.Te)(t),(0,a.lJ)(e)):this._load(1,e,t)}async loadImage(e,t){return this._load(2,e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,n.A)(t,{responseType:l[e]})).data;const a=await(0,o.Ke)(this._streamDataRequester.request(t,e,r));if(!0===a.ok)return a.value;throw(0,i.QP)(a.error),new s.A("glt-loader-request-error",`Request for resource failed: ${a.error}`)}}const l={2:"image",1:"array-buffer",0:"json",3:void 0}},43609:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>i,n:()=>o});var n=r(34275);function o(e,t){s(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r=2,o=r){const s=t.length/2;let i=0,a=0;if(!(0,n.iu)(t)||(0,n.dk)(t)){for(let n=0;n<s;++n)e[i]=t[a],e[i+1]=t[a+1],i+=r,a+=o;return}const u=(0,n.a3)(t);if((0,n.JI)(t))for(let n=0;n<s;++n)e[i]=Math.max(t[a]/u,-1),e[i+1]=Math.max(t[a+1]/u,-1),i+=r,a+=o;else for(let n=0;n<s;++n)e[i]=t[a]/u,e[i+1]=t[a+1]/u,i+=r,a+=o}function i(e,t,r,n){const o=e.typedBuffer,s=e.typedBufferStride,i=n?.count??e.count;let a=(n?.dstIndex??0)*s;for(let e=0;e<i;++e)o[a]=t,o[a+1]=r,a+=s}Object.freeze(Object.defineProperty({__proto__:null,fill:i,normalizeIntegerBuffer:s,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},51530:(e,t,r)=>{r.d(t,{KB:()=>i,Xi:()=>o,pn:()=>a,x3:()=>s});var n=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function s(e){return"encoded-mesh-texture"===e?.type}async function i(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function a(e,t){if("image/ktx2"===t)return new o(e);const r=new Blob([e],{type:t});let s=URL.createObjectURL(r);switch(t){case"image/jpeg":s+="#.jpg";break;case"image/png":s+="#.png"}const i=new Image;if((0,n.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{o(),e(i)},n=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(s),i.removeEventListener("load",r),i.removeEventListener("error",n)};i.addEventListener("load",r),i.addEventListener("error",n),i.src=s});try{i.src=s,await i.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(s),i}},61473:(e,t,r)=>{function n(e){return e=e||globalThis.location.hostname,l.some(t=>null!=e?.match(t))}function o(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(s)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(i)||null!=t.match(u)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>o,b5:()=>n});const s=/^devext\.arcgis\.com$/,i=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,u=/^[\w-]*\.mapsqa\.arcgis\.com$/,l=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,s,i,/^jsapps\.esri\.com$/,a,u]},64304:(e,t,r)=>{r.d(t,{fetch:()=>Q});var n=r(40876),o=r(61473),s=r(34727),i=r(77690),a=r(29242),u=r(58083),l=r(9093),c=r(48163),f=r(38954),d=r(51850),m=r(70328),p=r(11868),h=r(13030),g=r(73354),y=r(65686),x=r(43609),w=r(21015),b=r(84498),v=r(51530),T=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,n=null!=e.scale?e.scale:T.Un,o=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),u=(0,a.fA)(n[0],0,0,0,n[1],0,0,0,1),l=(0,a.vt)();return(0,i.lw)(l,s,u),(0,i.lw)(l,o,l),l}class A{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class R{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new A,this.numberOfVertices=0}}var B=r(78888),S=r(60999),I=r(49186),_=r(53966),P=r(69397);class E{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const n=this._outer.get(e);n?n.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}*outerMap(){for(const e of this._outer)yield e}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,n)=>e(t,r,n)))}}var O=r(74887),U=r(46140),L=r(97146),k=r(99677),j=r(46610),q=r(87170),z=r(48833),F=r(2495);const C=()=>_.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class ${constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function V(e){throw new I.A("",`Request for object resource failed: ${e}`)}function N(e){const t=e.params,r=t.topology;let n=!0;switch(t.vertexAttributes||(C().warn("Geometry must specify vertex attributes"),n=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(C().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),n=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(C().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),n=!1)):(C().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),n=!1)}}else C().warn("Indexed geometries must specify faces"),n=!1;break}default:C().warn(`Unsupported topology '${r}'`),n=!1}e.params.material||(C().warn("Geometry requires material"),n=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(C().warn("Geometries with externally defined attributes are not yet supported"),n=!1);return n}function D(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,m.iT)(t,r.bbMin),(0,m.iT)(t,r.bbMax))}),t}function G(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function X(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const W=new U.R(1,2,"wosr");var J=r(74810);async function Q(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const n=await(0,S.Ke)(t.request(e,0,r));if(!0===n.ok)return n.value;(0,O.QP)(n.error),V(n.error.details.url)}(e,r,t);const n=await(0,S.Ke)((0,B.A)(e,t));if(!0===n.ok)return n.value.data;(0,O.QP)(n.error),V(n.error)}(e,t),n=await async function(e,t){const r=new Array;for(const n in e){const o=e[n],s=o.images[0].data;if(!s){C().warn("Externally referenced texture data is not yet supported");continue}const i=o.encoding+";base64,"+s,a="/textureDefinitions/"+n,u="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",l={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==G(u)},c=t?.disableTextures?Promise.resolve(null):(0,k.D)(i,t);r.push(c.then(e=>({refId:a,image:e,parameters:l,alphaChannelUsage:u})))}const n=await Promise.all(r),o={};for(const e of n)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in n)if(n.hasOwnProperty(e)){const t=n[e];o+=t?.image?t.image.width*t.image.height*4:0}return new $(r,n,o+(0,P.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:n}=function(e,t){const r=new Array,n=new Array,o=new Array,s=new E,i=e.resource,a=U.R.parse(i.version||"1.0","wosr");W.validate(a);const u=i.model.name,l=i.model.geometries,c=i.materialDefinitions??{},f=e.textures;let m=0;const p=new Map;for(let e=0;e<l.length;e++){const i=l[e];if(!N(i))continue;const a=X(i),u=i.params.vertexAttributes,h=[],g=e=>{if("PerAttributeArray"===i.params.topology)return null;const t=i.params.faces;for(const r in t)if(r===e)return t[r].values;return null},y=u.position,x=y.values.length/y.valuesPerElement;for(const e in u){const t=u[e],r=t.values,n=g(e)??(0,L.tM)(x);h.push([e,new j.n(r,n,t.valuesPerElement,!0)])}const w=a.texture,b=f&&f[w];if(b&&!p.has(w)){const{image:e,parameters:t}=b,r=new z.g(e,t);n.push(r),p.set(w,r)}const v=p.get(w),T=v?v.id:void 0,M=a.material;let A=s.get(M,w);if(null==A){const e=c[M.slice(M.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=b?G(b.alphaChannelUsage):void 0,n={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:T,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),A=new F.$U(n,t),s.set(M,w,A)}o.push(A);const R=new q.V(A,h);m+=h.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(R)}return{engineResources:[{name:u,stageResources:{textures:n,materials:o,geometries:r},pivotOffset:i.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:D(r)}}(e,t);return{lods:r,referenceBoundingBox:n,isEsriSymbolResource:!1,isWosr:!0}}let T;if(t.cache)T=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));T=await e(new w.R(t.streamDataRequester),a.url,t,t.usePBR)}const A=T.model.meta?.ESRI_proxyEllipsoid,I=T.meta.isEsriSymbolResource&&null!=A&&"EsriRealisticTreesStyle"===T.meta.ESRI_webstyle;I&&!T.customMeta.esriTreeRendering&&(T.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const s of o.parts){const o=s.attributes.normal;if(null==o)return;const i=s.attributes.position,a=i.count,c=(0,d.vt)(),m=(0,d.vt)(),p=(0,d.vt)(),g=new Float32Array(4*a),y=new Float32Array(3*a),x=(0,u.B8)((0,l.vt)(),s.transform);let w=0,b=0;for(let u=0;u<a;u++){i.getVec(u,m),o.getVec(u,c),(0,f.t)(m,m,s.transform),(0,f.d)(p,m,t.center),(0,f.D)(p,p,t.radius);const a=p[2],l=(0,f.l)(p),d=Math.min(.45+.55*l*l,1)**n.Tf;(0,f.D)(p,p,t.radius),null!==x&&(0,f.t)(p,p,x),(0,f.n)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,f.m)(p,p,c,a>-1?.2:Math.min(-4*a-3.8,1)),y[w]=p[0],y[w+1]=p[1],y[w+2]=p[2],w+=3,g[b]=d,g[b+1]=d,g[b+2]=d,g[b+3]=1,b+=4}s.attributes.normal=new h.xs(y.buffer),s.attributes.color=new h.Eq(g.buffer)}}}(T,A));const _=!!t.usePBR,Q=T.meta.isEsriSymbolResource?{usePBR:_,isSchematic:!1,treeRendering:I,mrrFactors:J.SY}:{usePBR:_,isSchematic:!1,treeRendering:!1,mrrFactors:J.mb},K={...t.materialParameters,treeRendering:I},{engineResources:H,referenceBoundingBox:Z}=function(e,t,r,o,a,u){const l=e.model,f=new Array,d=new Map,w=new Map,T=l.lods.length,A=(0,m.Ie)();return l.lods.forEach((e,B)=>{const S=!0===o.skipHighLods&&(T>1&&0===B||T>3&&1===B)||!1===o.skipHighLods&&null!=a&&B!==a;if(S&&0!==B)return;const I=new R(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const a=S?new F.$U({},o):function(e,t,r,o,s,i,a,u,l){const f=e.materials.get(t.material);if(null==f)return null;const{normal:d,color:m,texCoord0:p,tangent:h}=t.attributes,g=t.material+(d?"_normal":"")+(m?"_color":"")+(p?"_texCoord0":"")+(h?"_tangent":""),y=null!=t.attributes.texCoord0,x=null!=t.attributes.normal,w=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(f.alphaMode);if(!i.has(g)){if(y){const t=(t,r=!1,n=!1)=>{if(null!=t&&!a.has(t)){const o=e.textures.get(t);if(o){const e=o.data,s=r&&!(0,v.x3)(e)?u.compressionOptions:void 0;a.set(t,new z.g((0,v.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,v.x3)(e)&&n,encoding:(0,v.x3)(e)?e.encoding:void 0,compressionOptions:s}))}}},r=1!==w&&!l;t(f.colorTexture,r,1!==w),t(f.normalTexture),t(f.occlusionTexture,!0),t(f.emissiveTexture),t(f.metallicRoughnessTexture,!0)}const r=1/n.Tf,d=f.color[0]**r,m=f.color[1]**r,p=f.color[2]**r,h=f.emissiveFactor[0]**r,b=f.emissiveFactor[1]**r,T=f.emissiveFactor[2]**r,A=null!=f.colorTexture&&y?a.get(f.colorTexture):null,R=(0,J.Jr)(f),B=null!=f.normalTextureTransform?.scale?f.normalTextureTransform?.scale:c.Un;i.set(g,new F.$U({...o,customDepthTest:1,textureAlphaMode:w,textureAlphaCutoff:f.alphaCutoff,diffuse:[d,m,p],ambient:[d,m,p],opacity:"OPAQUE"===f.alphaMode?1:f.opacity,doubleSided:f.doubleSided,doubleSidedType:"winding-order",cullFace:f.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:x?0:2,castShadows:!0,receiveShadows:f.receiveShadows,receiveAmbientOcclusion:f.receiveAmbientOcclusion,textureId:null!=A?A.id:void 0,colorMixMode:f.colorMixMode,normalTextureId:null!=f.normalTexture&&y?a.get(f.normalTexture).id:void 0,textureAlphaPremultiplied:null!=A&&!!A.parameters.preMultiplyAlpha,occlusionTextureId:null!=f.occlusionTexture&&y?a.get(f.occlusionTexture).id:void 0,emissiveTextureId:null!=f.emissiveTexture&&y?a.get(f.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=f.metallicRoughnessTexture&&y?a.get(f.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[h,b,T],mrrFactors:R?J.Bt:[f.metallicFactor,f.roughnessFactor,o.mrrFactors[2]],isSchematic:R,colorTextureTransformMatrix:M(f.colorTextureTransform),normalTextureTransformMatrix:M(f.normalTextureTransform),scale:[B[0],B[1]],occlusionTextureTransformMatrix:M(f.occlusionTextureTransform),emissiveTextureTransformMatrix:M(f.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(f.metallicRoughnessTextureTransform),...s},u))}const b=i.get(g);if(r.stageResources.materials.push(b),y){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(f.colorTexture),e(f.normalTexture),e(f.occlusionTexture),e(f.emissiveTexture),e(f.metallicRoughnessTexture)}return b}(l,e,I,t,r,d,w,o,u),{geometry:f,vertexCount:T}=function(e,t){const r=e.attributes.position.count,n=(0,b.x)(e.indices||r,e.primitiveType),o=(0,p.oe)(3*r),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;(0,g.t)(o,a,e.transform,3,u);const l=[["position",new j.n(o,n,3,!0)]];if(null!=e.attributes.normal){const t=(0,p.oe)(3*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.normal;(0,i.Ge)(Y,e.transform),(0,g.b)(t,o,Y,3,a),(0,s.or)(Y)&&(0,g.n)(t,t),l.push(["normal",new j.n(t,n,3,!0)])}if(null!=e.attributes.tangent){const t=(0,p.oe)(4*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.tangent;(0,i.z0)(Y,e.transform),(0,y.t)(t,o,Y,4,a),(0,s.or)(Y)&&(0,g.n)(t,t,4),l.push(["tangent",new j.n(t,n,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,p.oe)(2*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.texCoord0;(0,x.a)(t,o,2,s),l.push(["uv0",new j.n(t,n,2,!0)])}const c=e.attributes.color;if(null!=c){const t=new Uint8Array(4*r);4===c.elementCount?c instanceof h.Eq?(0,y.b)(t,c,1,255):(c instanceof h.XP||c instanceof h.Uz)&&(0,y.b)(t,c,1/255,255):(t.fill(255),c instanceof h.xs?(0,g.f)(t,c.typedBuffer,1,255,4,c.typedBufferStride):(e.attributes.color instanceof h.eI||e.attributes.color instanceof h.nS)&&(0,g.f)(t,c.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),l.push(["color",new j.n(t,n,4,!0)])}return{geometry:new q.V(t,l),vertexCount:r}}(e,a??new F.$U({},o)),R=f.boundingInfo;null!=R&&0===B&&((0,m.iT)(A,R.bbMin),(0,m.iT)(A,R.bbMax)),null!=a&&(I.stageResources.geometries.push(f),I.numberOfVertices+=T)}),S||f.push(I)}),{engineResources:f,referenceBoundingBox:A}}(T,Q,K,t,a.specifiedLodIndex,I);return{lods:H,referenceBoundingBox:Z,isEsriSymbolResource:T.meta.isEsriSymbolResource,isWosr:!1}}const Y=(0,a.vt)()},69052:(e,t,r)=>{r.d(t,{hr:()=>o,ie:()=>u,uC:()=>a});var n=r(34727);class o{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return s(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return s(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(n)?r:n}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function s(e,t,r,n,o=0,s=!1){return(n-=o)<t?n+=i(e,t-n):n>r&&(n-=i(e,n-r)),s&&n===r&&(n=t),n+o}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new o(0,2*Math.PI),u=(new o(-Math.PI,Math.PI),new o(0,360))},69397:(e,t,r)=>{r.d(t,{$B:()=>o,Qf:()=>l,Qh:()=>a,RS:()=>s,ez:()=>d,lM:()=>i,qK:()=>f});var n=r(34275);function o(e){return 32+e.length}const s=16;function i(e){if(!e)return 0;let t=f;for(const r in e)e.hasOwnProperty(r)&&(t+=u(e[r],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let r=d;for(let n=0;n<t;n++)r+=u(e[n]);return r}(e);let t=f;for(const r in e)e.hasOwnProperty(r)&&(t+=u(e[r]));return t}function u(e,t=!0){switch(typeof e){case"object":return t?a(e):f;case"string":return o(e);case"number":return s;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+m:Array.isArray(t)?c(t,s):0:0),0)}function c(e,t){return d+e.length*t}const f=32,d=16,m=145},73354:(e,t,r)=>{r.d(t,{a:()=>f,b:()=>a,c:()=>i,d:()=>o,e:()=>d,f:()=>c,l:()=>l,n:()=>m,t:()=>s});var n=r(40876);function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){if(e.length/n!==Math.ceil(t.length/o))return e;const s=e.length/n,i=r[0],a=r[1],u=r[2],l=r[4],c=r[5],f=r[6],d=r[8],m=r[9],p=r[10],h=r[12],g=r[13],y=r[14];let x=0,w=0;for(let r=0;r<s;r++){const r=t[x],s=t[x+1],b=t[x+2];e[w]=i*r+l*s+d*b+h,e[w+1]=a*r+c*s+m*b+g,e[w+2]=u*r+f*s+p*b+y,x+=o,w+=n}return e}function i(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,n=3,o=n){if(e.length/n!==Math.ceil(t.length/o))return;const s=e.length/n,i=r[0],a=r[1],u=r[2],l=r[3],c=r[4],f=r[5],d=r[6],m=r[7],p=r[8];let h=0,g=0;for(let r=0;r<s;r++){const r=t[h],s=t[h+1],y=t[h+2];e[g]=i*r+l*s+d*y,e[g+1]=a*r+c*s+m*y,e[g+2]=u*r+f*s+p*y,h+=o,g+=n}}function u(e,t,r,n=3,o=n){const s=Math.min(e.length/n,t.length/o);let i=0,a=0;for(let u=0;u<s;u++)e[a]=r*t[i],e[a+1]=r*t[i+1],e[a+2]=r*t[i+2],i+=o,a+=n;return e}function l(e,t,r,n){c(e.typedBuffer,t.typedBuffer,r,n,e.typedBufferStride,t.typedBufferStride)}function c(e,t,r,o,s=3,i=s){const a=Math.min(e.length/s,t.length/i);let u=0,l=0;const c=1/n.Tf;for(let n=0;n<a;n++)e[l]=o*(r*t[u])**c,e[l+1]=o*(r*t[u+1])**c,e[l+2]=o*(r*t[u+2])**c,u+=i,l+=s}function f(e,t,r,n=3,o=n){const s=e.length/n;if(s!==Math.ceil(t.length/o))return e;let i=0,a=0;for(let u=0;u<s;u++)e[a]=t[i]+r[0],e[a+1]=t[i+1]+r[1],e[a+2]=t[i+2]+r[2],i+=o,a+=n;return e}function d(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,n=r){const o=Math.min(e.length/r,t.length/n);let s=0,i=0;for(let a=0;a<o;a++){const o=t[s],a=t[s+1],u=t[s+2],l=o*o+a*a+u*u;if(l>0){const t=1/Math.sqrt(l);e[i]=t*o,e[i+1]=t*a,e[i+2]=t*u}s+=n,i+=r}}r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:m,normalizeView:d,scale:u,scaleView:function(e,t,r){u(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const n=Math.min(e.count,t.count),o=e.typedBuffer,s=e.typedBufferStride,i=t.typedBuffer,a=t.typedBufferStride;let u=0,l=0;for(let e=0;e<n;e++)o[l]=i[u]>>r,o[l+1]=i[u+1]>>r,o[l+2]=i[u+2]>>r,u+=a,l+=s},transformMat3:a,transformMat3View:i,transformMat4:s,transformMat4View:o,translate:f},Symbol.toStringTag,{value:"Module"}))},80754:(e,t,r)=>{r.d(t,{j7:()=>i,kS:()=>u,kd:()=>a,r8:()=>l});var n=r(82799),o=r(16930),s=r(65864);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:o.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:o.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){const r=l(e);for(const e of r)for(const r of e)r[0]+=t;return e}function l(e){return(0,s.Bi)(e)?e.rings:e.paths}},84498:(e,t,r)=>{r.d(t,{x:()=>i});var n=r(34275),o=r(97146),s=r(63907);function i(e,t){switch(t){case s.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,n.mg)(e)?new Uint16Array(e):e}(e);case s.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,n=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(n[e++]=t,n[e++]=t+1,n[e++]=t+2):(n[e++]=t+1,n[e++]=t,n[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(n[t++]=e[o],n[t++]=e[o+1],n[t++]=e[o+2]):(n[t++]=e[o+1],n[t++]=e[o],n[t++]=e[o+2])}return n}(e);case s.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)n[e++]=0,n[e++]=t+1,n[e++]=t+2;return n}const o=e[0];let s=e[1],i=0;for(let t=0;t<r;++t){const r=e[t+2];n[i++]=o,n[i++]=s,n[i++]=r,s=r}return n}(e)}}},88340:(e,t,r)=>{function n(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function s(){return n()}function i(){return o(1,1)}function a(){return o(1,0)}function u(){return o(0,1)}r.d(t,{Un:()=>c,fA:()=>o,uY:()=>l,vt:()=>n});const l=s(),c=i(),f=a(),d=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:f,UNIT_Y:d,ZEROS:l,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:n,fromValues:o,ones:i,unitX:a,unitY:u,zeros:s},Symbol.toStringTag,{value:"Module"}))},92300:(e,t,r)=>{r.d(t,{V:()=>s,X:()=>o});var n=r(65864);function o(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const o=(0,n.xD)(t);return e.map(e=>{const t=o.fromJSON(e);return t.spatialReference=r,t})}}}]);