@arcgis/core 4.29.0-next.20231221 → 4.29.0-next.20231222

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 (79) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/01dbff2fdff9d5c95892.js +1 -0
  3. package/assets/esri/core/workers/chunks/046b3920f4aca1061d06.js +1 -0
  4. package/assets/esri/core/workers/chunks/15af5fd13722ef57c8f7.js +1 -0
  5. package/assets/esri/core/workers/chunks/3a4598c384c4c31ab35b.js +1 -0
  6. package/assets/esri/core/workers/chunks/5c269c59f61a185ed5c7.js +1 -0
  7. package/assets/esri/core/workers/chunks/7435463436cda9eb4246.js +1 -0
  8. package/assets/esri/core/workers/chunks/c1c4f3909b724c13033d.js +1 -0
  9. package/assets/esri/core/workers/chunks/ccfdd3d278756f01f630.js +1 -0
  10. package/assets/esri/core/workers/chunks/d4cf3af5f5c30925539c.js +1 -0
  11. package/assets/esri/core/workers/chunks/ee0b43679cc0cc531d7c.js +1 -0
  12. package/assets/esri/core/workers/chunks/f9f3d6b4347e63f440e0.js +1 -0
  13. package/assets/esri/core/workers/chunks/fbfdb4779198f4c35c65.js +1 -0
  14. package/assets/esri/core/workers/chunks/ffad926201d92c4d6b4e.js +1 -0
  15. package/chunks/HUDMaterial.glsl.js +1 -1
  16. package/core/MemCache.js +1 -1
  17. package/core/MemCachePool.js +1 -1
  18. package/core/deprecate.js +1 -1
  19. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  20. package/layers/mixins/operationalLayers.js +1 -1
  21. package/layers/support/editableLayers.js +1 -1
  22. package/layers/support/layersCreator.js +1 -1
  23. package/package.json +1 -1
  24. package/support/revision.js +1 -1
  25. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  26. package/views/2d/layers/StreamLayerView2D.js +1 -1
  27. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  28. package/views/2d/layers/features/FeatureSourceEventLog.js +5 -0
  29. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  30. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  31. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  32. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  33. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  34. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  35. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  36. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  37. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +5 -0
  38. package/views/2d/layers/features/layerAdapters/geometryUtils.js +5 -0
  39. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  40. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  41. package/views/2d/layers/features/sources/strategies/ATileLoadStrategy.js +1 -1
  42. package/views/2d/layers/features/sources/strategies/DrillDownTileLoadStrategy.js +1 -1
  43. package/views/2d/layers/features/sources/strategies/PagedTileLoadStrategy.js +1 -1
  44. package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +1 -1
  45. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  46. package/views/2d/layers/features/sources/strategies/chunks/DrillDownTileSourceChunk.js +1 -1
  47. package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
  48. package/views/2d/layers/features/sources/strategies/chunks/PagedTileSourceChunk.js +1 -1
  49. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  50. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  51. package/views/3d/effects/RenderNode.js +1 -1
  52. package/views/3d/layers/I3SMeshView3D.js +1 -1
  53. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  54. package/views/3d/state/ViewStateManager.js +1 -1
  55. package/views/3d/terrain/TerrainAttributesCache.js +1 -1
  56. package/views/3d/webgl-engine/effects/RenderNodes.js +5 -0
  57. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  58. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  59. package/views/layers/FeatureLayerView.js +1 -1
  60. package/views/webgl/RenderingContext.js +1 -1
  61. package/webdoc/support/webdocSaveUtils.js +1 -1
  62. package/widgets/BasemapLayerList.js +1 -1
  63. package/widgets/Editor/EditorViewModel.js +1 -1
  64. package/widgets/LayerList.js +1 -1
  65. package/widgets/TableList.js +1 -1
  66. package/assets/esri/core/workers/chunks/251ceefdea4b345698a4.js +0 -1
  67. package/assets/esri/core/workers/chunks/2e6f1c788813b4162adf.js +0 -1
  68. package/assets/esri/core/workers/chunks/49ca15b23dd363bc3546.js +0 -1
  69. package/assets/esri/core/workers/chunks/521a38edbeff0073bfdd.js +0 -1
  70. package/assets/esri/core/workers/chunks/573ad8aa1c2cfad61eb8.js +0 -1
  71. package/assets/esri/core/workers/chunks/831283ac6653d7af90b6.js +0 -1
  72. package/assets/esri/core/workers/chunks/90444e25dd487d0bc438.js +0 -1
  73. package/assets/esri/core/workers/chunks/90b34ce04d5a83ea4344.js +0 -1
  74. package/assets/esri/core/workers/chunks/9c80cfae983c8ccfe616.js +0 -1
  75. package/assets/esri/core/workers/chunks/a1cf80c67ee8dbe9c897.js +0 -1
  76. package/assets/esri/core/workers/chunks/c76094c26e80656a2f8d.js +0 -1
  77. package/assets/esri/core/workers/chunks/df394ec25adfc9798f74.js +0 -1
  78. package/assets/esri/core/workers/chunks/e4ab40d895fccc81fe44.js +0 -1
  79. package/views/3d/webgl-engine/effects/RenderNodeCollection.js +0 -5
@@ -141,7 +141,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
141
141
  void main() {
142
142
  ${I}
143
143
  outputObjectAndLayerIdColor();
144
- }`);break;case l.Highlight:H.constants.add("occludedHighlightFlag","vec4",u).add("unoccludedHighlightFlag","vec4",p),H.code.add(z`
144
+ }`);break;case l.Highlight:H.constants.add("occludedHighlightFlag","vec4",u),H.constants.add("unoccludedHighlightFlag","vec4",p),H.code.add(z`
145
145
  void main() {
146
146
  ${I}
147
147
  if (voccluded == 1.0) {
package/core/MemCache.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import t from"./PooledArray.js";const e=-3;var s;!function(t){t[t.ALL=0]="ALL",t[t.SOME=1]="SOME"}(s||(s={}));class i{constructor(t,e,s){this.name=t,this._storage=e,this.id=h+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(t,e,s,i=0){this._storage.put(this,t,e,s,i)}get(t){const e=this._storage.get(this,t);return void 0===e?++this._miss:++this._hit,e}peek(t){return this._storage.peek(this,t)}pop(t){const e=this._storage.pop(this,t);return void 0===e?++this._miss:++this._hit,e}updateSize(t,e,s){this._storage.updateSize(this,t,e,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class r{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new t,this._users=new t}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(t){this._users.push(t)}deregister(t){this._users.removeUnordered(t)}registerRemoveFunc(t,e){this._removeFuncs.push([t,e])}deregisterRemoveFunc(t){this._removeFuncs.filterInPlace((e=>e[0]!==t))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,0),this._checkSizeLimits()}put(t,i,r,h,o){i=t.id+i;const n=this._db.get(i);if(n&&(this._size-=n.size,t.size-=n.size,this._db.delete(i),n.entry!==r&&this._notifyRemove(i,n.entry,s.ALL)),h>this._maxSize)return void this._notifyRemove(i,r,s.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!h||h<0)return console.warn(`Refusing to cache entry with size ${h} for key ${i}`),void this._notifyRemove(i,r,s.ALL);const _=1+Math.max(o,e)-e;this._db.set(i,{entry:r,size:h,lifetime:_,lives:_}),this._size+=h,t.size+=h,this._checkSizeLimits()}updateSize(t,e,i,r){e=t.id+e;const h=this._db.get(e);if(h&&h.entry===i){for(this._size-=h.size,t.size-=h.size;r>this._maxSize;){const t=this._notifyRemove(e,i,s.SOME);if(!(null!=t&&t>0))return void this._db.delete(e);r=t}h.size=r,this._size+=r,t.size+=r,this._checkSizeLimits()}}pop(t,e){e=t.id+e;const s=this._db.get(e);if(s)return this._size-=s.size,t.size-=s.size,this._db.delete(e),++this._hit,s.entry;++this._miss}get(t,e){e=t.id+e;const s=this._db.get(e);if(void 0!==s)return this._db.delete(e),s.lives=s.lifetime,this._db.set(e,s),++this._hit,s.entry;++this._miss}peek(t,e){const s=this._db.get(t.id+e);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},s={},i=new Array;this._db.forEach(((t,e)=>{const r=t.lifetime;i[r]=(i[r]||0)+t.size,this._users.forAll((i=>{const{id:r,name:h}=i;if(e.startsWith(r)){const e=s[h]||0;s[h]=e+t.size}}))}));const r={};this._users.forAll((t=>{const e=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){const i=s[e]||0;s[e]=i,r[e]=Math.round(100*t.hitRate)+"%"}else r[e]="0%"}));const h=Object.keys(s);h.sort(((t,e)=>s[e]-s[t])),h.forEach((e=>t[e]=Math.round(s[e]/2**20)+"MB / "+r[e]));for(let o=i.length-1;o>=0;--o){const s=i[o];s&&(t["Priority "+(o+e-1)]=Math.round(s/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forAll((t=>t.resetHitRate()))}clear(t){const e=t.id;this._db.forEach(((t,i)=>{i.startsWith(e)&&(this._size-=t.size,this._db.delete(i),this._notifyRemove(i,t.entry,s.ALL))})),t.size=0}clearAll(){this._db.forEach(((t,e)=>this._notifyRemove(e,t.entry,s.ALL))),this._users.forEach((t=>t.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,s){let i;return this._removeFuncs.some((r=>{if(t.startsWith(r[0])){const t=r[1](e,s);return"number"==typeof t&&(i=t),!0}return!1})),i}_checkSizeLimits(){if(this._size>this._maxSize)for(const[t,e]of this._db)if(this._purgeItem(t,e),this._size<=.9*this.maxSize)return;this._users.forEach((t=>{if(t.maxSize>0&&t.size>t.maxSize)for(const[e,s]of this._db)if(e.startsWith(t.id)&&(this._purgeItem(e,s,t),t.size<=.9*t.maxSize))return}))}_purgeItem(t,e,i=this._users.find((e=>t.startsWith(e.id)))){if(this._db.delete(t),e.lives<=1){this._size-=e.size,i&&(i.size-=e.size);const r=this._notifyRemove(t,e.entry,s.SOME);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),e.lives=e.lifetime,e.size=r,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}let h=0;export{i as MemCache,r as MemCacheStorage,s as RemoveMode,e as minPriority};
5
+ import t from"./PooledArray.js";const e=-3;var i;!function(t){t[t.ALL=0]="ALL",t[t.SOME=1]="SOME"}(i||(i={}));class s{constructor(t,e,i){this.name=t,this._storage=e,this.id=h+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),i&&(this._storage.registerRemoveFunc(this.id,i),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}getSize(t){return this._storage.getSize(this,t)}resetHitRate(){this._hit=this._miss=0}put(t,e,i,s=0){this._storage.put(this,t,e,i,s)}get(t){const e=this._storage.get(this,t);return void 0===e?++this._miss:++this._hit,e}peek(t){return this._storage.peek(this,t)}pop(t){const e=this._storage.pop(this,t);return void 0===e?++this._miss:++this._hit,e}updateSize(t,e,i){this._storage.updateSize(this,t,e,i)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class r{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new t,this._users=new t}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(t){this._users.push(t)}deregister(t){this._users.removeUnordered(t)}registerRemoveFunc(t,e){this._removeFuncs.push([t,e])}deregisterRemoveFunc(t){this._removeFuncs.filterInPlace((e=>e[0]!==t))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,0),this._checkSizeLimits()}getSize(t,e){const i=t.id+e,s=this._db.get(i);return s?s.size:0}put(t,s,r,h,o){s=t.id+s;const n=this._db.get(s);if(n&&(this._size-=n.size,t.size-=n.size,this._db.delete(s),n.entry!==r&&this._notifyRemove(s,n.entry,i.ALL)),h>this._maxSize)return void this._notifyRemove(s,r,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!h||h<0)return console.warn(`Refusing to cache entry with size ${h} for key ${s}`),void this._notifyRemove(s,r,i.ALL);const _=1+Math.max(o,e)-e;this._db.set(s,{entry:r,size:h,lifetime:_,lives:_}),this._size+=h,t.size+=h,this._checkSizeLimits()}updateSize(t,e,s,r){e=t.id+e;const h=this._db.get(e);if(h&&h.entry===s){for(this._size-=h.size,t.size-=h.size;r>this._maxSize;){const t=this._notifyRemove(e,s,i.SOME);if(!(null!=t&&t>0))return void this._db.delete(e);r=t}h.size=r,this._size+=r,t.size+=r,this._checkSizeLimits()}}pop(t,e){e=t.id+e;const i=this._db.get(e);if(i)return this._size-=i.size,t.size-=i.size,this._db.delete(e),++this._hit,i.entry;++this._miss}get(t,e){e=t.id+e;const i=this._db.get(e);if(void 0!==i)return this._db.delete(e),i.lives=i.lifetime,this._db.set(e,i),++this._hit,i.entry;++this._miss}peek(t,e){const i=this._db.get(t.id+e);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},i={},s=new Array;this._db.forEach(((t,e)=>{const r=t.lifetime;s[r]=(s[r]||0)+t.size,this._users.forAll((s=>{const{id:r,name:h}=s;if(e.startsWith(r)){const e=i[h]||0;i[h]=e+t.size}}))}));const r={};this._users.forAll((t=>{const e=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){const s=i[e]||0;i[e]=s,r[e]=Math.round(100*t.hitRate)+"%"}else r[e]="0%"}));const h=Object.keys(i);h.sort(((t,e)=>i[e]-i[t])),h.forEach((e=>t[e]=Math.round(i[e]/2**20)+"MB / "+r[e]));for(let o=s.length-1;o>=0;--o){const i=s[o];i&&(t["Priority "+(o+e-1)]=Math.round(i/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forAll((t=>t.resetHitRate()))}clear(t){const e=t.id;this._db.forEach(((t,s)=>{s.startsWith(e)&&(this._size-=t.size,this._db.delete(s),this._notifyRemove(s,t.entry,i.ALL))})),t.size=0}clearAll(){this._db.forEach(((t,e)=>this._notifyRemove(e,t.entry,i.ALL))),this._users.forEach((t=>t.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,i){let s;return this._removeFuncs.some((r=>{if(t.startsWith(r[0])){const t=r[1](e,i);return"number"==typeof t&&(s=t),!0}return!1})),s}_checkSizeLimits(){if(this._size>this._maxSize)for(const[t,e]of this._db)if(this._purgeItem(t,e),this._size<=.9*this.maxSize)return;this._users.forEach((t=>{if(t.maxSize>0&&t.size>t.maxSize)for(const[e,i]of this._db)if(e.startsWith(t.id)&&(this._purgeItem(e,i,t),t.size<=.9*t.maxSize))return}))}_purgeItem(t,e,s=this._users.find((e=>t.startsWith(e.id)))){if(this._db.delete(t),e.lives<=1){this._size-=e.size,s&&(s.size-=e.size);const r=this._notifyRemove(t,e.entry,i.SOME);null!=r&&r>0&&(this._size+=r,s&&(s.size+=r),e.lives=e.lifetime,e.size=r,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}let h=0;export{s as MemCache,r as MemCacheStorage,i as RemoveMode,e as minPriority};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{minPriority as e,RemoveMode as t}from"./MemCache.js";class c{constructor(e,t){this._cache=e(t,((e,t)=>this._remove(e,t)))}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}pop(e){const t=this._cache.peek(e);if(!t)return;const c=t.pop();if(t.length>0){const c=t.reduce(((e,t)=>e+t.usedMemory),0);this._cache.updateSize(e,t,c)}else this._cache.pop(e);return c}put(t,c,s=e){const r=this._cache.peek(t);if(!r)return void this._cache.put(t,[c],c.usedMemory,s);r.push(c);const h=r.reduce(((e,t)=>e+t.usedMemory),0);this._cache.updateSize(t,r,h)}_remove(e,c){switch(c){case t.ALL:return e.forEach((e=>e.dispose())),0;case t.SOME:return e.shift()?.dispose(),e.reduce(((e,t)=>e+t.usedMemory),0)}}}export{c as MemCachePool};
5
+ import{minPriority as e,RemoveMode as t}from"./MemCache.js";class c{constructor(e,t){this._cache=e(t,((e,t)=>this._remove(e,t)))}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}getSize(e){return this._cache.getSize(e)}pop(e){const t=this._cache.peek(e);if(!t)return;const c=t.pop();if(t.length>0){if(c){const s=this._cache.getSize(e)-Math.round(c.usedMemory);this._cache.updateSize(e,t,s)}}else this._cache.pop(e);return c}put(t,c,s=e){const h=this._cache.peek(t);if(!h)return void this._cache.put(t,[c],c.usedMemory,s);h.push(c);const r=this._cache.getSize(t)+Math.round(c.usedMemory);this._cache.updateSize(t,h,r)}_remove(e,c){switch(c){case t.ALL:return e.forEach((e=>e.dispose())),0;case t.SOME:return e.shift()?.dispose(),e.reduce(((e,t)=>e+t.usedMemory),0)}}}export{c as MemCachePool};
package/core/deprecate.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"./has.js";const n=new Set;function e(e,i,o=!1){o&&n.has(i)||(o&&n.add(i),e.warn(`🛑 DEPRECATED - ${i}`))}function i(n,e,i={}){has("esri-deprecation-warnings")&&r(n,`Module: ${e}`,i)}function o(n,e,i={}){if(has("esri-deprecation-warnings")){const{moduleName:o}=i;r(n,`Function: ${(o?o+"::":"")+e+"()"}`,i)}}function t(n,e,i={}){if(has("esri-deprecation-warnings")){const{moduleName:o}=i;r(n,`Property: ${(o?o+"::":"")+e}`,i)}}function r(n,i,o={}){if(has("esri-deprecation-warnings")){const{replacement:t,version:r,see:s,warnOnce:a}=o;let c=i;t&&(c+=`\n\t🛠️ Replacement: ${t}`),r&&(c+=`\n\t⚙️ Version: ${r}`),s&&(c+=`\n\t🔗 See ${s} for more details.`),e(n,c,a)}}export{r as deprecated,o as deprecatedFunction,i as deprecatedModule,t as deprecatedProperty};
5
+ import has from"./has.js";const e=new WeakMap;function n(n,t,i=!1){const o=`🛑 DEPRECATED - ${t}`;if(!i)return void n.warn(o);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.has(t)||(r.add(t),n.warn(o))}function t(e,n,t={}){has("esri-deprecation-warnings")&&r(e,`Module: ${n}`,t)}function i(e,n,t={}){if(has("esri-deprecation-warnings")){const{moduleName:i}=t;r(e,`Function: ${(i?i+"::":"")+n+"()"}`,t)}}function o(e,n,t={}){if(has("esri-deprecation-warnings")){const{moduleName:i}=t;r(e,`Property: ${(i?i+"::":"")+n}`,t)}}function r(e,t,i={}){if(has("esri-deprecation-warnings")){const{replacement:o,version:r,see:a,warnOnce:s}=i;let c=t;o&&(c+=`\n\t🛠️ Replacement: ${o}`),r&&(c+=`\n\t⚙️ Version: ${r}`),a&&(c+=`\n\t🔗 See ${a} for more details.`),n(e,c,s)}}export{r as deprecated,i as deprecatedFunction,t as deprecatedModule,o as deprecatedProperty};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default};export{a as typeModuleMap};
5
+ const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:()=>Promise.resolve(null),MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default};export{a as typeModuleMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const e={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},r={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},a={ArcGISFeatureLayer:!0},i={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0,IntegratedMesh3DTilesLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":e,"web-map/basemap":r,"web-map/tables":a,"link-chart/operational-layers":{...e,LinkChartLayer:!0},"link-chart/basemap":r,"link-chart/tables":a,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,IntegratedMesh3DTilesLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}};export{i as supportedTypes};
5
+ const e={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},r={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},a={ArcGISFeatureLayer:!0},i={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0,IntegratedMesh3DTilesLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":e,"web-map/basemap":r,"web-map/tables":a,"link-chart/operational-layers":{...e,LinkChartLayer:!0},"link-chart/basemap":r,"link-chart/tables":a,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,IntegratedMesh3DTilesLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}};export{i as supportedTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Logger.js";import{equals as r}from"../../geometry/support/spatialReferenceUtils.js";import{getMimeTypeFormatId as t,getFilenameFormatId as i}from"./infoFor3D.js";import{getEffectiveLayerCapabilities as s,getEffectiveEditingEnabled as a}from"./layerUtils.js";function o(e){return!(!(e&&"object"==typeof e&&"loaded"in e&&e.loaded&&s(e)?.operations?.supportsEditing&&"type"in e)||"editingEnabled"in e&&!a(e)||"scene"===e.type&&!n(e))}function n(s){const{associatedLayer:a}=s,o=a?.infoFor3D;if(!!!o)return!0;const{supportedFormats:n,queryFormats:l}=o,d=t("model/gltf-binary",n)??i("glb",n);if(!(null!=d&&l.includes(d)))return e.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${s.title??"Untitled layer"}, ${s.id}) is not editable because it does not support GLB queries.`),!1;const c=s.spatialReference,p=a.spatialReference;if(!r(c,p))return e.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${s.title??"Untitled layer"}, ${s.id}) is not editable because its spatial reference (wkid:${c.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${p.wkid}).`),!1;const f=a.sourceJSON.sourceSpatialReference;return!(null!=f&&!r(f,p))||(e.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${s.title??"Untitled layer"}, ${s.id}) is not editable because the spatial reference of its associated FeatureLayer's service (wkid:${p.wkid}) is different from its source spatial reference (wkid:${f.wkid}).`),!1)}export{o as isEditableLayer};
5
+ import e from"../../core/Logger.js";import{equals as r}from"../../geometry/support/spatialReferenceUtils.js";import{getMimeTypeFormatId as t,getFilenameFormatId as i}from"./infoFor3D.js";import{getEffectiveLayerCapabilities as s,getEffectiveEditingEnabled as a}from"./layerUtils.js";function o(e){return!(!(e&&"object"==typeof e&&"loaded"in e&&e.loaded&&s(e)?.operations?.supportsEditing&&"type"in e)||"editingEnabled"in e&&!a(e)||"scene"===e.type&&!n(e)||"oriented-imagery"===e.type)}function n(s){const{associatedLayer:a}=s,o=a?.infoFor3D;if(!!!o)return!0;const{supportedFormats:n,queryFormats:l}=o,d=t("model/gltf-binary",n)??i("glb",n);if(!(null!=d&&l.includes(d)))return e.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${s.title??"Untitled layer"}, ${s.id}) is not editable because it does not support GLB queries.`),!1;const c=s.spatialReference,p=a.spatialReference;if(!r(c,p))return e.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${s.title??"Untitled layer"}, ${s.id}) is not editable because its spatial reference (wkid:${c.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${p.wkid}).`),!1;const f=a.sourceJSON.sourceSpatialReference;return!(null!=f&&!r(f,p))||(e.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${s.title??"Untitled layer"}, ${s.id}) is not editable because the spatial reference of its associated FeatureLayer's service (wkid:${p.wkid}) is different from its source spatial reference (wkid:${f.wkid}).`),!1)}export{o as isEditableLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Collection.js";import"../../core/has.js";import{LayerLoadContext as r}from"./LayerLoadContext.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import t from"../../portal/PortalItem.js";import{isMapNotesLayer as y,isMarkupLayer as i,isRouteLayer as L}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as n}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as o}from"../../renderers/support/styleUtils.js";async function c(e,r,a){if(!r)return;const t=[];for(const i of r)t.push(g(i,a));const y=await Promise.allSettled(t);for(const i of y)"rejected"===i.status||i.value&&e.add(i.value)}const l={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},s={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},p={ArcGISFeatureLayer:"FeatureLayer"},S={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},u={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISFeatureLayer:"FeatureLayer"},I={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},m={...u,LinkChartLayer:"LinkChartLayer"},f={...d},T={...I};async function g(e,r){return G(await M(e,r),e,r)}async function G(e,r,a){const t=new e;return t.read(r,a.context),"group"===t.type&&("GroupLayer"===r.layerType?await w(t,r,a):v(r)?h(t,r,a.context):A(r)&&await C(t,r,a.context)),await o(t,a.context),t}async function M(e,o){const c=o.context,l=b(c);let s=e.layerType||e.type;!s&&o?.defaultLayerType&&(s=o.defaultLayerType);const p=l[s];let S=p?a[p]:a.UnknownLayer;if(v(e)){const y=c?.portal;if(e.itemId){const i=new t({id:e.itemId,portal:y});await i.load();const L=(await n(i,new r)).className||"UnknownLayer";S=a[L]}}else"ArcGISFeatureLayer"===s?y(e)||i(e)?S=a.MapNotesLayer:L(e)?S=a.RouteLayer:A(e)&&(S=a.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?S=a.WMTSLayer:"WFS"===s&&"2.0.0"!==e.wfsInfo?.version&&(S=a.UnsupportedLayer);return S()}function A(e){if("ArcGISFeatureLayer"!==e.layerType||v(e))return!1;return(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function b(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=S;break;case"ground":r=s;break;case"tables":r=p;break;default:r=l}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=T;break;case"tables":r=f;break;default:r=m}break;default:switch(e.layerContainerType){case"basemap":r=I;break;case"tables":r=d;break;default:r=u}}return r}async function w(r,a,t){const y=new e,i=c(y,Array.isArray(a.layers)?a.layers:[],t);try{try{if(await i,"group"===r.type)return r.layers.addMany(y),r}catch(L){r.destroy();for(const e of y)e.destroy();throw L}}catch(L){throw L}}function h(e,r,a){r.itemId&&(e.portalItem=new t({id:r.itemId,portal:a?.portal}),e.when((()=>{const t=t=>{const y=t.layerId;F(t,e,r,y,a);const i=r.featureCollection?.layers?.[y];i&&t.read(i,a)};e.layers?.forEach(t),e.tables?.forEach(t)})))}async function C(e,r,t){const y=a.FeatureLayer,i=await y(),L=r.featureCollection,n=L?.showLegend,o=L?.layers?.map(((a,y)=>{const L=new i;L.read(a,t);const o={...t,ignoreDefaults:!0};return F(L,e,r,y,o),null!=n&&L.read({showLegend:n},o),L}));e.layers.addMany(o??[])}function F(e,r,a,t,y){e.read({id:`${r.id}-sublayer-${t}`,visibility:a.visibleLayers?.includes(t)??!0},y)}export{w as populateGroupLayer,c as populateOperationalLayers};
5
+ import e from"../../core/Collection.js";import"../../core/has.js";import{LayerLoadContext as r}from"./LayerLoadContext.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import t from"../../portal/PortalItem.js";import{isMapNotesLayer as y,isMarkupLayer as i,isRouteLayer as L}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as n}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as o}from"../../renderers/support/styleUtils.js";async function c(e,r,a){if(!r)return;const t=r.map((e=>f(e,a))),y=await Promise.allSettled(t);for(const i of y)"rejected"===i.status||i.value&&e.add(i.value)}const l={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},s={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},p={ArcGISFeatureLayer:"FeatureLayer"},S={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},u={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISFeatureLayer:"FeatureLayer"},I={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},m={...u,LinkChartLayer:"LinkChartLayer"},T={...d},g={...I};async function f(e,r){return G(await M(e,r),e,r)}async function G(e,r,a){const t=new e;return t.read(r,a.context),"group"===t.type&&("GroupLayer"===r.layerType?await w(t,r,a):v(r)?h(t,r,a.context):A(r)&&await C(t,r,a.context)),await o(t,a.context),t}async function M(e,o){const c=o.context,l=b(c);let s=e.layerType||e.type;!s&&o?.defaultLayerType&&(s=o.defaultLayerType);const p=l[s];let S=p?a[p]:a.UnknownLayer;if(v(e)){const y=c?.portal;if(e.itemId){const i=new t({id:e.itemId,portal:y});await i.load();const L=(await n(i,new r)).className||"UnknownLayer";S=a[L]}}else"ArcGISFeatureLayer"===s?y(e)||i(e)?S=a.MapNotesLayer:L(e)?S=a.RouteLayer:A(e)&&(S=a.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?S=a.WMTSLayer:"WFS"===s&&"2.0.0"!==e.wfsInfo?.version&&(S=a.UnsupportedLayer);return S()}function A(e){if("ArcGISFeatureLayer"!==e.layerType||v(e))return!1;return(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function b(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=S;break;case"ground":r=s;break;case"tables":r=p;break;default:r=l}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=g;break;case"tables":r=T;break;default:r=m}break;default:switch(e.layerContainerType){case"basemap":r=I;break;case"tables":r=d;break;default:r=u}}return r}async function w(r,a,t){const y=new e,i=c(y,Array.isArray(a.layers)?a.layers:[],t);try{try{if(await i,"group"===r.type)return r.layers.addMany(y),r}catch(L){r.destroy();for(const e of y)e.destroy();throw L}}catch(L){throw L}}function h(e,r,a){r.itemId&&(e.portalItem=new t({id:r.itemId,portal:a?.portal}),e.when((()=>{const t=t=>{const y=t.layerId;F(t,e,r,y,a);const i=r.featureCollection?.layers?.[y];i&&t.read(i,a)};e.layers?.forEach(t),e.tables?.forEach(t)})))}async function C(e,r,t){const y=a.FeatureLayer,i=await y(),L=r.featureCollection,n=L?.showLegend,o=L?.layers?.map(((a,y)=>{const L=new i;L.read(a,t);const o={...t,ignoreDefaults:!0};return F(L,e,r,y,o),null!=n&&L.read({showLegend:n},o),L}));e.layers.addMany(o??[])}function F(e,r,a,t,y){e.read({id:`${r.id}-sublayer-${t}`,visibility:a.visibleLayers?.includes(t)??!0},y)}export{w as populateGroupLayer,c as populateOperationalLayers};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.29.0-next.20231221",
3
+ "version": "4.29.0-next.20231222",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const d="20231221",e="76de41932e45406ad14dd069d5528804a8f28e7f";export{d as buildDate,e as commitHash};
5
+ const e="20231222",b="4376df8311fa6b3ffee6480baec26b23a3c18eb8";export{e as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{neverReached as a}from"../../../core/compilerUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{clone as u}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{debounce as c,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as y,initial as d}from"../../../core/reactiveUtils.js";import{pt2px as f}from"../../../core/screenUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as _}from"../../../core/accessorSupport/diffUtils.js";import w from"../../../layers/effects/FeatureEffectView.js";import{isHostedAgolService as b}from"../../../layers/support/arcgisLayerUrl.js";import v from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as S}from"../../../layers/support/layerUtils.js";import F from"../../../layers/support/OrderByInfo.js";import I from"../../../rest/support/AggregateFeatureSet.js";import E from"../../../rest/support/FeatureSet.js";import x from"../../../rest/support/Query.js";import R from"../engine/webgl/shaderGraph/techniques/InstanceStore.js";import{LayerView2DMixin as V}from"./LayerView2D.js";import{FeatureContainer as j}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as A}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureLayerAdapter as C}from"./features/layerAdapters/FeatureLayerAdapter.js";import{InMemoryLayerAdapter as U}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as q}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as Q}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as O}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{StreamLayerAdapter as k}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as M}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createFeatureSchema as L}from"./features/schema/FeatureSchema.js";import{createComplexSymbolInstances as N}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import D from"./support/FeatureCommandQueue.js";import{getSizeForValueSimple as H}from"./support/visualVariableSimpleUtils.js";import{FeatureTileSubscriptionManager as J}from"../tiling/FeatureTileSubscriptionManager.js";import T from"../../layers/FeatureLayerView.js";import P from"../../layers/LayerView.js";import G from"../../layers/RefreshableLayerView.js";import B from"../../../geometry/Extent.js";function $(e){return e&&"openPorts"in e}function z(e){for(const t of e){const e="featureReduction"in t&&t.featureReduction&&"labelingInfo"in t.featureReduction?t.featureReduction:void 0,r=[...t.labelingInfo||[],...e?.labelingInfo||[]];if(!t.labelsVisible||!r.length)continue;if(r.some((e=>"none"===e.deconflictionStrategy)))return!0}return!1}function K(e){return t=>f(H(t,e))}function Z(e){const t=null!=e&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const r of t)if("size"===r.type)return K(r);return null}const W="esri.views.2d.layers.FeatureLayerView2D";function X(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":case"multipatch":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";default:return l.getLogger(W).error(new o("unsupported-geometry-type",`Geometry type of ${e.geometryType} is not supported`)),null}}const Y=4294967294;let ee=class extends(T(G(V(P)))){constructor(){super(...arguments),this._commandsQueue=new D({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=c((async()=>this._worker.processor.setHighlight(Array.from(this._highlightIds.keys())))),this._instanceStore=new R,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this.featureEffectView=new w}destroy(){this._worker?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if(("feature"===e.type||"subtype-group"===e.type)&&!S(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._worker&&this._worker.destroy();const t=this._createClientOptions();this._worker=await A(t)}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e?"selection"===e.type?null:!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale?e:null:null}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get labelingCollisionInfos(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer],t=this.layer.geometryType,r=!z(e),i={};if("subtype-group"!==this.layer.type){const e=Z(this.layer.renderer);i[0]=e}const s=!this.suspended;return[{container:this.featureContainer,vvEvaluators:i,deconflictionEnabled:r,geometryType:t,visible:s}]}get layerAdapter(){switch(this.layer.type){case"feature":return new C(this.layer);case"geojson":case"csv":case"wfs":return new U(this.layer);case"subtype-group":return new M(this.layer);case"ogc-feature":return new Q(this.layer);case"stream":return new k(this.layer);case"oriented-imagery":return new O(this.layer);case"knowledge-graph-sublayer":return new q(this.layer);default:a(this.layer)}return null}get queryMode(){throw new Error("Not implemented")}get updateHash(){if(!this.layerAdapter)return null;const{availableFields:e,_displayRefreshVersion:t,timeExtent:r,clips:i,filter:s,featureEffect:a,_sourceRefreshVersion:o,view:{timeZone:n}}=this,u=JSON.stringify(i),l=a?.toJSON(),h=s?.toJSON();return JSON.stringify({availableFields:e,clipsHash:u,displayRefreshVersion:t,effectHash:l,filterHash:h,sourceRefreshVersion:o,timeExtent:r,timeZone:n,...this.layerAdapter.getUpdateHashProperties(this.view)})}getDisplayStatistics(e,t){return this.featureContainer.getDisplayStatistics(e,t)}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:s.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const a=t?.filter(i);return a?.length?(this._addHighlight(a),n((()=>this._removeHighlight(a)))):n()}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){const s=await this.featureContainer.hitTest(i);if(0===s.length)return null;has("featurelayer-force-marker-text-draw-order")&&s.sort(((e,t)=>e-t));const{features:a,aggregates:o}=await this._worker.processor.getDisplayFeatures(s);return[...o.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._worker.pipeline.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._worker.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._worker.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._worker.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._worker.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=E.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryVisibleFeatures(e,t){const r=await this._worker.pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=E.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}async queryAggregates(e,t){const r=await this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=I.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._worker.aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._worker.aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._worker.features.executeQuery(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._worker.features.executeQueryForIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._worker.features.executeQueryForCount(this._cleanUpQuery(e),t)}async queryExtent(e,t){const r=await this._worker.features.executeQueryForExtent(this._cleanUpQuery(e),t);return{count:r.count,extent:B.fromJSON(r.extent)}}async getSampleFeatures(e){return this._worker.pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;const t=this._subscriptionManager.update(e);this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),this.featureContainer=new j(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new J({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>(this.featureContainer.updateSubscriptions(e),this._worker.pipeline.updateSubscriptions(e)),isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([y((()=>this.updateHash),(()=>this._update()),d),y((()=>this.suspended),(e=>{e||this._subscriptionManager.resume()}))]),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this.featureContainer.destroy(),this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=h(this._subscriptionManager),this._worker.pipeline.onDetach()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=this.featureContainer.updatingHandles.updating,s=this.dataUpdating,a=e&&(t||r)||i;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${a}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> updatingData ${s}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return a}_createClientOptions(){const e=this;return{get featureView(){return e.featureContainer},setDataUpdating:e=>{this._set("dataUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)},fetch:t=>Promise.all(t.map((t=>e.view.stage.painter.textureManager.rasterizeItem(t)))),fetchDictionary:e=>Promise.all(e.map((e=>this._fetchDictionaryRequest(e))))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this._instanceStore,scaleExpression:r.scaleExpression},s=r.visualVariableUniforms,a=await t.getSymbolAsync(e.feature);if(!a||!a.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await N(a.data,{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_exceedsMinimumSnapshotCoverage(){const e=this.view.extent,t=this.layer.fullExtent,r=t?.clone().intersection(e),i=null!=r?r.width*r.height:0,s=t?.width*t?.height,a=0===s?0:i/s,o=has("featurelayer-snapshot-point-coverage");return!isNaN(a)&&a>=o}get source(){return this._getSource()}async _getSource(){if("ogc-feature"===this.layer.type)return this.layer.source.getSource();if("source"in this.layer&&$(this.layer.source))return this.layer.source.openPorts();const e=u(this.layer.parsedUrl);return"dynamicDataSource"in this.layer&&this.layer.dynamicDataSource&&(e.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})}),e}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const t=S(e),{capabilities:r,objectIdField:i}=e,s=e.fieldsIndex.toJSON(),a=s.fields,o=null!=e.fullExtent?e.fullExtent.toJSON():null,n=X(e),u="timeInfo"in e&&e.timeInfo?.toJSON()||null,l=e.spatialReference?e.spatialReference.toJSON():null,h="feature"===e.type?e.globalIdField:null,c=await this._getSource(),p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,y=("subtypeField"in this.layer?this.layer.subtypeField:null)??null;let d=this.layer.objectIdField;if("feature"===this.layer.type&&null!=this.layer.orderBy&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(d=e)}const f="path"in c,g="editingInfo"in e&&e.editingInfo?.lastEditDate,m="refreshInterval"in e&&!!e.refreshInterval,_=!g&&m,w=has("featurelayer-snapshot-enabled")&&f&&("feature"===e.type||"subtype-group"===e.type)&&"point"===e.geometryType&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!_,v=w&&this._exceedsMinimumSnapshotCoverage(),F="path"in c&&b(c.path);return{type:"remote",supportsSnapshotMinThreshold:w,supportsSnapshotMaxThreshold:v,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")},isSourceHosted:F,typeIdField:"typeIdField"in e&&e.typeIdField||void 0,types:"types"in e&&e.types?.map((e=>e.toJSON()))||void 0,timeReferenceUnknownClient:p,subtypeField:y,globalIdField:h,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:t,fields:a,fieldsIndex:s,fullExtent:o,geometryType:n,objectIdField:i,source:c,timeInfo:u,spatialReference:l,orderByFields:d,lastEditDate:"editingInfo"in this.layer?this.layer.editingInfo?.lastEditDate?.getTime():null}}_cleanUpQuery(e){const t=x.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=x.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._subscriptionManager.suspend();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){this.attached&&(this.suspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Y+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Y+1}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(l.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone());try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this._instanceStore;e.updateStart();const t=await this._createSchemaConfig(),r=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},s=await L(i,t);if(!_(s,this._lastSchema))return this.featureContainer.requestRender(),void e.updateEnd();this._lastSchema=s;const a=Math.round(performance.now());this.featureContainer.updateStart();let o=[];Array.isArray(t.service.source)&&(o=t.service.source),await this._worker.pipeline.update(s,a,{transferList:o}),e.updateEnd(),this.featureEffectView.featureEffect=r,this.featureEffectView.endTransitions(),this.featureContainer.updateEnd(e,a),has("esri-2d-update-debug")&&console.debug(`Version[${a}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){try{this.featureContainer.editStart(),await this._worker.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(t){p(t),0}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return null!=this.filter||null!=this.timeExtent||this._visibilityOverrides.size>0||e}async _createSchemaConfig(){const e=te(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),t=this.layer,r=[e,this.featureEffect?.filter?.toJSON()??null];return{fields:this.layer.fields.map((e=>e.toJSON())),tileInfoJSON:this.view.featuresTilingScheme.tileInfo.toJSON(),renderer:"renderer"in t?t.renderer?.clone():null,outSpatialReference:this.view.spatialReference,timeExtent:"timeExtent"in t?t.timeExtent:null,definitionExpression:"definitionExpression"in t?t.definitionExpression:null,featureReduction:this._effectiveFeatureReduction,geometryType:t.geometryType,historicMoment:"historicMoment"in t?t.historicMoment:null,labelsVisible:"labelsVisible"in t&&t.labelsVisible,labelingInfo:"labelingInfo"in t?t.labelingInfo:null,availableFields:this.availableFields,filters:r,gdbVersion:"gdbVersion"in t?t.gdbVersion:null,orderBy:"orderBy"in t&&t.orderBy?t.orderBy:[new F({field:this.layer.objectIdField})],customParameters:{..."customParameters"in t?t.customParameters:void 0,token:"apiKey"in t?t.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in t?t.subtypeCode:void 0,subtypeField:"subtypeField"in t?t.subtypeField:void 0,service:await this._createServiceOptions(),displayRefreshVersion:this._displayRefreshVersion,sourceRefreshVersion:this._sourceRefreshVersion}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||l.getLogger(this).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||l.getLogger(this).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function te(e,t,r,i,s){s&&(s=s.clone());const a=null!=s?s.timeExtent:null,o=null!=r&&null!=a?r.intersection(a):r||a;o&&(s??=new v,s.timeExtent=o),s=t.addFilters?.(s,e)??s;let n=s?.toJSON()??null;return i.size&&(n??=(new v).toJSON(),n.hiddenIds=Array.from(i)),n}e([g()],ee.prototype,"_worker",void 0),e([g()],ee.prototype,"_effectiveFeatureReduction",null),e([g()],ee.prototype,"_commandsQueue",void 0),e([g()],ee.prototype,"_sourceRefreshVersion",void 0),e([g()],ee.prototype,"_displayRefreshVersion",void 0),e([g()],ee.prototype,"featureEffectView",void 0),e([g()],ee.prototype,"labelsVisible",null),e([g()],ee.prototype,"labelingCollisionInfos",null),e([g()],ee.prototype,"layerAdapter",null),e([g({readOnly:!0})],ee.prototype,"queryMode",null),e([g()],ee.prototype,"updateHash",null),e([g()],ee.prototype,"updating",void 0),e([g()],ee.prototype,"source",null),ee=e([m(W)],ee);const re=ee;export{re as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import i from"../../../core/Collection.js";import{neverReached as a}from"../../../core/compilerUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as l}from"../../../core/maybe.js";import{debounce as h,isAbortError as c}from"../../../core/promiseUtils.js";import{watch as p,initial as y}from"../../../core/reactiveUtils.js";import{pt2px as d}from"../../../core/screenUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as m}from"../../../core/accessorSupport/diffUtils.js";import _ from"../../../layers/effects/FeatureEffectView.js";import w from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as b}from"../../../layers/support/layerUtils.js";import v from"../../../layers/support/OrderByInfo.js";import F from"../../../rest/support/AggregateFeatureSet.js";import S from"../../../rest/support/FeatureSet.js";import A from"../../../rest/support/Query.js";import V from"../engine/webgl/shaderGraph/techniques/InstanceStore.js";import{LayerView2DMixin as E}from"./LayerView2D.js";import{FeatureContainer as R}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as j}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as I}from"./features/FeatureSourceEventLog.js";import{FeatureLayerAdapter as x}from"./features/layerAdapters/FeatureLayerAdapter.js";import{InMemoryLayerAdapter as Q}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as U}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as C}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as q}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{StreamLayerAdapter as k}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as O}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createFeatureSchema as L}from"./features/schema/FeatureSchema.js";import{createComplexSymbolInstances as H}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import M from"./support/FeatureCommandQueue.js";import{getSizeForValueSimple as D}from"./support/visualVariableSimpleUtils.js";import{FeatureTileSubscriptionManager as J}from"../tiling/FeatureTileSubscriptionManager.js";import N from"../../layers/FeatureLayerView.js";import T from"../../layers/LayerView.js";import G from"../../layers/RefreshableLayerView.js";import P from"../../../geometry/Extent.js";function $(e){for(const t of e){const e="featureReduction"in t&&t.featureReduction&&"labelingInfo"in t.featureReduction?t.featureReduction:void 0,r=[...t.labelingInfo||[],...e?.labelingInfo||[]];if(!t.labelsVisible||!r.length)continue;if(r.some((e=>"none"===e.deconflictionStrategy)))return!0}return!1}function z(e){return t=>d(D(t,e))}function B(e){const t=null!=e&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const r of t)if("size"===r.type)return z(r);return null}const K="esri.views.2d.layers.FeatureLayerView2D",Z=4294967294;let W=class extends(N(G(E(T)))){constructor(){super(...arguments),this._commandsQueue=new M({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=h((async()=>this._worker.processor.setHighlight(Array.from(this._highlightIds.keys())))),this._instanceStore=new V,this.eventLog=new I,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this.featureEffectView=new _}destroy(){this._worker?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if("mesh"===e.geometryType)throw new o("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!b(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._worker&&this._worker.destroy();const t=this._createClientOptions();this._worker=await j(t)}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e?"selection"===e.type?null:!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale?e:null:null}get hasAllFeatures(){return this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.eventLog.hasFullGeometries}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get labelingCollisionInfos(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer],t=this.layer.geometryType,r=!$(e),s={};if("subtype-group"!==this.layer.type){const e=B(this.layer.renderer);s[0]=e}const i=!this.suspended;return[{container:this.featureContainer,vvEvaluators:s,deconflictionEnabled:r,geometryType:t,visible:i}]}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new Q(this.layer):new x(this.layer);case"geojson":case"csv":case"wfs":return new Q(this.layer);case"subtype-group":return new O(this.layer);case"ogc-feature":return new C(this.layer);case"stream":return new k(this.layer);case"oriented-imagery":return new q(this.layer);case"knowledge-graph-sublayer":return new U(this.layer);default:a(this.layer)}return null}get updateHash(){if(!this.layerAdapter)return null;const{availableFields:e,_displayRefreshVersion:t,timeExtent:r,clips:s,filter:i,featureEffect:a,_sourceRefreshVersion:o,view:{timeZone:n}}=this,u=JSON.stringify(s),l=a?.toJSON(),h=i?.toJSON();return JSON.stringify({availableFields:e,clipsHash:u,displayRefreshVersion:t,effectHash:l,filterHash:h,sourceRefreshVersion:o,timeExtent:r,timeZone:n,...this.layerAdapter.getUpdateHashProperties(this.view)})}getDisplayStatistics(e,t){return this.featureContainer.getDisplayStatistics(e,t)}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:i.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const a=t?.filter(s);return a?.length?(this._addHighlight(a),n((()=>this._removeHighlight(a)))):n()}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,s){const i=await this.featureContainer.hitTest(s);if(0===i.length)return null;has("featurelayer-force-marker-text-draw-order")&&i.sort(((e,t)=>e-t));const{features:a,aggregates:o}=await this._worker.processor.getDisplayFeatures(i);return[...o.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._worker.pipeline.queryStatistics()}async querySummaryStatistics(e,t,r){const s={...t,scale:this.view.scale};return this._worker.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r)}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r)}async queryUniqueValues(e,t,r){const s={...t,scale:this.view.scale};return this._worker.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r)}async queryAggregateUniqueValues(e,t,r){const s={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r)}async queryClassBreaks(e,t,r){const s={...t,scale:this.view.scale};return this._worker.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r)}async queryAggregateClassBreaks(e,t,r){const s={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r)}async queryHistogram(e,t,r){const s={...t,scale:this.view.scale};return this._worker.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r)}async queryAggregateHistogram(e,t,r){const s={...t,scale:this.view.scale};return this._worker.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=S.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryVisibleFeatures(e,t){const r=await this._worker.pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=S.fromJSON(r);return s.features.forEach((e=>this._setLayersForFeature(e))),s}async queryAggregates(e,t){const r=await this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=F.fromJSON(r);return s.features.forEach((e=>this._setLayersForFeature(e))),s}queryAggregateIds(e,t){return this._worker.aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._worker.aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._worker.features.executeQuery(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._worker.features.executeQueryForIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._worker.features.executeQueryForCount(this._cleanUpQuery(e),t)}async queryExtent(e,t){const r=await this._worker.features.executeQueryForExtent(this._cleanUpQuery(e),t);return{count:r.count,extent:P.fromJSON(r.extent)}}async getSampleFeatures(e){return this._worker.pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;const t=this._subscriptionManager.update(e);this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),this.featureContainer=new R(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new J({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>(this.featureContainer.updateSubscriptions(e),this._worker.pipeline.updateSubscriptions(e)),isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([p((()=>this.updateHash),(()=>this._update()),y),p((()=>this.suspended),(e=>{e||this._subscriptionManager.resume()}))]),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this.featureContainer.destroy(),this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=l(this._subscriptionManager),this._worker.pipeline.onDetach()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,s=this.featureContainer.updatingHandles.updating,i=this.dataUpdating,a=e&&(t||r)||s;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${a}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> updatingData ${i}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return a}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setDataUpdating:e=>{this._set("dataUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map((t=>e.view.stage.painter.textureManager.rasterizeItem(t)))),fetchDictionary:e=>Promise.all(e.map((e=>this._fetchDictionaryRequest(e))))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this._instanceStore,scaleExpression:r.scaleExpression},i=r.visualVariableUniforms,a=await t.getSymbolAsync(e.feature);if(!a||!a.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await H(a.data,{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=A.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=A.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._subscriptionManager.suspend();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){this.attached&&(this.suspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Z+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Z+1}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),s=t&&this.availableFields.includes(t);return r&&!s?(u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone());try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this._instanceStore;e.updateStart();const t=await this._createSchemaConfig(),r=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},i=await L(s,t);if(!m(i,this._lastSchema))return this.featureContainer.requestRender(),void e.updateEnd();this._lastSchema=i;const a=Math.round(performance.now());this.featureContainer.updateStart();let o=[];Array.isArray(t.service.source)&&(o=t.service.source),await this._worker.pipeline.update(i,a,{transferList:o}),e.updateEnd(),this.featureEffectView.featureEffect=r,this.featureEffectView.endTransitions(),this.featureContainer.updateEnd(e,a),has("esri-2d-update-debug")&&console.debug(`Version[${a}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){try{this.featureContainer.editStart(),await this._worker.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(t){c(t),0}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return null!=this.filter||null!=this.timeExtent||this._visibilityOverrides.size>0||e}async _createSchemaConfig(){const e=X(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),t=this.layer,r=[e,this.featureEffect?.filter?.toJSON()??null];return{fields:this.layer.fields.map((e=>e.toJSON())),tileInfoJSON:this.view.featuresTilingScheme.tileInfo.toJSON(),renderer:"renderer"in t?t.renderer?.clone():null,outSpatialReference:this.view.spatialReference,timeExtent:"timeExtent"in t?t.timeExtent:null,definitionExpression:"definitionExpression"in t?t.definitionExpression:null,featureReduction:this._effectiveFeatureReduction,geometryType:t.geometryType,historicMoment:"historicMoment"in t?t.historicMoment:null,labelsVisible:"labelsVisible"in t&&t.labelsVisible,labelingInfo:"labelingInfo"in t?t.labelingInfo:null,availableFields:this.availableFields,filters:r,gdbVersion:"gdbVersion"in t?t.gdbVersion:null,orderBy:"orderBy"in t&&t.orderBy?t.orderBy:[new v({field:this.layer.objectIdField})],customParameters:{..."customParameters"in t?t.customParameters:void 0,token:"apiKey"in t?t.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in t?t.subtypeCode:void 0,subtypeField:"subtypeField"in t?t.subtypeField:void 0,service:await this.layerAdapter.createServiceOptions(this.view),displayRefreshVersion:this._displayRefreshVersion,sourceRefreshVersion:this._sourceRefreshVersion}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{c(e)||u.getLogger(this).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{c(e)||u.getLogger(this).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function X(e,t,r,s,i){i&&(i=i.clone());const a=null!=i?i.timeExtent:null,o=null!=r&&null!=a?r.intersection(a):r||a;o&&(i??=new w,i.timeExtent=o),i=t.addFilters?.(i,e)??i;let n=i?.toJSON()??null;return s.size&&(n??=(new w).toJSON(),n.hiddenIds=Array.from(s)),n}e([f()],W.prototype,"_worker",void 0),e([f()],W.prototype,"_effectiveFeatureReduction",null),e([f()],W.prototype,"_commandsQueue",void 0),e([f()],W.prototype,"_sourceRefreshVersion",void 0),e([f()],W.prototype,"_displayRefreshVersion",void 0),e([f({readOnly:!0})],W.prototype,"hasAllFeatures",null),e([f({readOnly:!0})],W.prototype,"hasAllFeaturesInView",null),e([f({readOnly:!0})],W.prototype,"hasFullGeometries",null),e([f()],W.prototype,"featureEffectView",void 0),e([f()],W.prototype,"labelsVisible",null),e([f()],W.prototype,"labelingCollisionInfos",null),e([f()],W.prototype,"layerAdapter",null),e([f()],W.prototype,"updateHash",null),e([f()],W.prototype,"updating",void 0),W=e([g(K)],W);const Y=W;export{Y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{handlesGroup as r,makeHandle as s}from"../../../core/handleUtils.js";import{watch as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../rest/support/FeatureSet.js";import l from"./FeatureLayerView2D.js";import{toJSONGeometryType as c}from"./support/util.js";import p from"../../layers/StreamLayerView.js";function u(e,t){if(null==e&&null==t)return null;const r={};return null!=t&&(r.geometry=t.toJSON()),null!=e&&(r.where=e),r}let m=class extends(p(l)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([n((()=>this.layer.customParameters),(e=>this._worker.streamMessenger.updateCustomParameters(e))),this.layer.on("send-message-to-socket",(e=>this._worker.streamMessenger.sendMessageToSocket(e))),this.layer.on("send-message-to-client",(e=>{this._worker.streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()})),n((()=>this.layer.purgeOptions),(()=>this._update())),n((()=>this.suspended),this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new t("stream-controller",this.pipelineErrorString):null}on(e,t){if(Array.isArray(e))return r(e.map((e=>this.on(e,t))));const n=["data-received","message-received"].includes(e);n&&this._worker.streamMessenger.enableEvent(e,!0);const o=super.on(e,t),i=this;return s((()=>{o.remove(),n&&(i._worker.closed||i.hasEventListener(e)||i._worker.streamMessenger.enableEvent(e,!1))}))}queryLatestObservations(e,r){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new t("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return this._worker.features.executeQueryForLatestObservations(this._cleanUpQuery(e),r).then((e=>{const t=a.fromJSON(e);return t.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),t}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval((()=>this.incrementSourceRefreshVersion()),this.layer.updateInterval)}_doDisconnect(){this._worker.streamMessenger.disconnect(),this._doPause()}_doConnect(){this._worker.streamMessenger.connect(),this._doResume()}_doClear(){this._worker.streamMessenger.clear(),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),t=this;return{...e,get featureView(){return t.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}async _createServiceOptions(){const e=this.layer,{objectIdField:t}=e,r=e.fields.map((e=>e.toJSON())),s=c(e.geometryType),n=e.timeInfo?.toJSON()||null,o=e.spatialReference?e.spatialReference.toJSON():null;return{type:"stream",fields:r,fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:t,timeInfo:n,source:this.layer.parsedUrl,serviceFilter:u(this.layer.definitionExpression,this.layer.geometryDefinition),purgeOptions:this.layer.purgeOptions.toJSON(),spatialReference:o,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,customParameters:e.customParameters}}};e([o()],m.prototype,"pipelineConnectionStatus",void 0),e([o()],m.prototype,"pipelineErrorString",void 0),e([o({readOnly:!0})],m.prototype,"connectionError",null),e([o({readOnly:!0})],m.prototype,"_streamConnectionStatus",null),m=e([i("esri.views.2d.layers.StreamLayerView2D")],m);const h=m;export{h as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{handlesGroup as t,makeHandle as s}from"../../../core/handleUtils.js";import{watch as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../rest/support/FeatureSet.js";import c from"./FeatureLayerView2D.js";import l from"../../layers/StreamLayerView.js";let h=class extends(l(c)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([o((()=>this.layer.customParameters),(e=>this._worker.streamMessenger.updateCustomParameters(e))),this.layer.on("send-message-to-socket",(e=>this._worker.streamMessenger.sendMessageToSocket(e))),this.layer.on("send-message-to-client",(e=>{this._worker.streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()})),o((()=>this.layer.purgeOptions),(()=>this._update())),o((()=>this.suspended),this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new r("stream-controller",this.pipelineErrorString):null}on(e,r){if(Array.isArray(e))return t(e.map((e=>this.on(e,r))));const o=["data-received","message-received"].includes(e);o&&this._worker.streamMessenger.enableEvent(e,!0);const n=super.on(e,r),i=this;return s((()=>{n.remove(),o&&(i._worker.closed||i.hasEventListener(e)||i._worker.streamMessenger.enableEvent(e,!1))}))}queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new r("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return this._worker.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then((e=>{const r=a.fromJSON(e);return r.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),r}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval((()=>this.incrementSourceRefreshVersion()),this.layer.updateInterval)}_doDisconnect(){this._worker.streamMessenger.disconnect(),this._doPause()}_doConnect(){this._worker.streamMessenger.connect(),this._doResume()}_doClear(){this._worker.streamMessenger.clear(),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),r=this;return{...e,get container(){return r.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([n()],h.prototype,"pipelineConnectionStatus",void 0),e([n()],h.prototype,"pipelineErrorString",void 0),e([n({readOnly:!0})],h.prototype,"connectionError",null),e([n({readOnly:!0})],h.prototype,"_streamConnectionStatus",null),h=e([i("esri.views.2d.layers.StreamLayerView2D")],h);const p=h;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as t,createResolver as r}from"../../../../core/promiseUtils.js";import i from"../../../../core/RandomLCG.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import u from"../../../../layers/support/TileInfo.js";import a from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{PipelineConnectionHandlers as c}from"./PipelineConnectionHandlers.js";import p from"./Processor.js";import{FeatureSource as h}from"./sources/FeatureSource.js";import{FeatureTileSubscription as d}from"./sources/FeatureTileSubscription.js";import{Tile as l}from"./support/Tile.js";class g{constructor(e){this.edit=e,this.resolver=r()}}class _{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._source=new h(this._aggregateAdapter,this._subscriptions,(()=>this._updateChunks())),this._preventChunkUpdates=!1,this._handles=s([o((()=>this.updatingData),(e=>{this._updateChunks(),this._connection.layerView.setDataUpdating(e)}))])}destroy(){this._handles.remove(),this._source.destroy(),this._processor?.destroy()}onDetach(){this._subscriptions.clear(),this._processor.destroy(),this._source.destroy(),this._source=new h(this._aggregateAdapter,this._subscriptions,(()=>this._updateChunks())),this._processor=new p(this._connection,this._source),this._editState=null,this._tileInfoView=null}set remoteClient(e){this._connection=new c(e),this._processor=new p(this._connection,this._source)}get features(){return this._source.queryEngine}get aggregates(){return this._processor.aggregateQueryEngine}get processor(){return this._processor}get streamMessenger(){return null==this._source.streamMessenger&&has("esri-2d-update-debug")&&console.error("Pipeline error -- main thread tried to access nonexistent stream messenger"),this._source.streamMessenger}get updatingData(){return this._source.updating}async onEdits(e){if(null!=this._editState)throw new Error("InternalError - Already processing an edit");this._editState=new g(e);const s=this._editState.resolver.promise;return this._updateChunks(),s}async updateSubscriptions(e){if(has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e),!this._tileInfoView){const s=u.fromJSON(e.tileInfoJSON);this._tileInfoView=new a(s)}for(const s of e.subscribe)this._subscribe(s);for(const s of e.unsubscribe)this._unsubscribe(s);if(has("featurelayer-query-pausing-enabled"))for(const s of e.pause)this._pauseSubscription(s)}async update(e,s){if(this._preventChunkUpdates=!0,has("esri-2d-update-debug")&&console.debug(`Version[${s}] Pipeline.updateStart`,{schema:e}),!this._tileInfoView){const s=u.fromJSON(e.source.tileInfoJSON);this._tileInfoView=new a(s)}const t={tileInfo:this._tileInfoView?.tileInfo};try{const r=(await this._source.update(e,s,this._connection)).sourceDataChanged,i=Array.from(this._subscriptions.values());await this._processor.update(e,s,t,r,i),this._preventChunkUpdates=!1,await this._updateChunks()}catch(r){console.error(r)}has("esri-2d-update-debug")&&console.debug(`Version[${s}] Pipeline.updateEnd`)}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,s){return this.features.executeQuery(e,s)}async getSampleFeatures(e){const s=this._source.chunks();if(s.reduce(((e,s)=>e+s.size()),0)<=e.minFeatureCount){if(!this._source.updating){const e=[];return this._source.store.forEachUnsafe((s=>e.push(s.readLegacyFeatureWorldSpace()))),e}return null}const t=new Set,r=[],o=s.map((e=>e.reader.getCursor())),n=new i,u=3*e.sampleSize;for(let i=0;i<u&&r.length<e.sampleSize;i++){const e=o[n.getIntRange(0,s.length-1)];if(0===e.getSize())continue;const i=n.getIntRange(0,e.getSize()-1);e.setIndex(i);const u=e.getObjectId();t.has(u)||(t.add(u),r.push(e.readLegacyFeatureWorldSpace()))}return r.length>=e.sampleSize?r:null}_subscribe(e){const s=e.tileId;if(this._subscriptions.has(s)){const t=this._subscriptions.get(s);return void(t.paused&&(has("esri-2d-update-debug")&&console.debug(`Tile[${s}] Pipeline.resume`),t.resume(),t.version=e.version,this._source.onResume(t)))}has("esri-2d-update-debug")&&console.debug(`Tile[${s}] Pipeline.subscribe`);const t=new l(this._tileInfoView,s),r=new d(t,e.version);this._subscriptions.set(s,r),this._source.onSubscribe(r),this._processor.onSubscribe(r)}_unsubscribe(e){const s=this._subscriptions.get(e);s&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),this._source.onUnsubscribe(s),this._processor.onUnsubscribe(s),this._subscriptions.delete(s.key.id),s.destroy())}_pauseSubscription(e){const s=this._subscriptions.get(e);s&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.pause`),s.pause())}async _updateChunks(){if(!this._preventChunkUpdates){if(null!=this._editState){has("esri-2d-update-debug")&&console.debug("Pipeline.handleEdit",this._editState.edit);const e=this._editState;this._editState=null;const s=await this._source.getOverride(e.edit);await this._processor.applyOverride(s),e.resolver.resolve()}try{await this._processor.updateChunks()}catch(e){t(e)}}}}e([n()],_.prototype,"updatingData",null);export{_ as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as t,createResolver as i}from"../../../../core/promiseUtils.js";import r from"../../../../core/RandomLCG.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import u from"../../../../layers/support/TileInfo.js";import a from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{PipelineConnectionHandlers as c}from"./PipelineConnectionHandlers.js";import p from"./Processor.js";import{FeatureSource as d}from"./sources/FeatureSource.js";import{FeatureTileSubscription as h}from"./sources/FeatureTileSubscription.js";import{Tile as l}from"./support/Tile.js";class g{constructor(e){this.edit=e,this.resolver=i()}}class _{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._preventChunkUpdates=!1}destroy(){this._subscriptions.clear(),this._processor.destroy(),this._source.destroy(),this._handles.remove(),this._editState=null,this._tileInfoView=null}onDetach(){this.destroy(),this._initialize(this._connection)}_initialize(e){this._source=new d(this._aggregateAdapter,this._subscriptions,(()=>this._updateChunks()),e),this._handles=s([o((()=>this.updatingData),(e=>{this._updateChunks(),this._connection.layerView.setDataUpdating(e)}))]),this._processor=new p(e,this._source)}set remoteClient(e){this._connection=new c(e),this._initialize(this._connection)}get features(){return this._source.queryEngine}get aggregates(){return this._processor.aggregateQueryEngine}get processor(){return this._processor}get streamMessenger(){return null==this._source.streamMessenger&&has("esri-2d-update-debug")&&console.error("Pipeline error -- main thread tried to access nonexistent stream messenger"),this._source.streamMessenger}get updatingData(){return this._source.updating}async onEdits(e){if(null!=this._editState)throw new Error("InternalError - Already processing an edit");this._editState=new g(e);const s=this._editState.resolver.promise;return this._updateChunks(),s}async updateSubscriptions(e){if(has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e),!this._tileInfoView){const s=u.fromJSON(e.tileInfoJSON);this._tileInfoView=new a(s)}for(const s of e.subscribe)this._subscribe(s);for(const s of e.unsubscribe)this._unsubscribe(s);if(has("featurelayer-query-pausing-enabled"))for(const s of e.pause)this._pauseSubscription(s)}async update(e,s){if(this._preventChunkUpdates=!0,has("esri-2d-update-debug")&&console.debug(`Version[${s}] Pipeline.updateStart`,{schema:e}),!this._tileInfoView){const s=u.fromJSON(e.source.tileInfoJSON);this._tileInfoView=new a(s)}const t={tileInfo:this._tileInfoView?.tileInfo};try{const i=(await this._source.update(e,s,this._connection)).sourceDataChanged,r=Array.from(this._subscriptions.values());await this._processor.update(e,s,t,i,r),this._preventChunkUpdates=!1,await this._updateChunks()}catch(i){console.error(i)}has("esri-2d-update-debug")&&console.debug(`Version[${s}] Pipeline.updateEnd`)}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,s){return this.features.executeQuery(e,s)}async getSampleFeatures(e){const s=this._source.chunks();if(s.reduce(((e,s)=>e+s.size()),0)<=e.minFeatureCount){if(!this._source.updating){const e=[];return this._source.store.forEachUnsafe((s=>e.push(s.readLegacyFeatureWorldSpace()))),e}return null}const t=new Set,i=[],o=s.map((e=>e.reader.getCursor())),n=new r,u=3*e.sampleSize;for(let r=0;r<u&&i.length<e.sampleSize;r++){const e=o[n.getIntRange(0,s.length-1)];if(0===e.getSize())continue;const r=n.getIntRange(0,e.getSize()-1);e.setIndex(r);const u=e.getObjectId();t.has(u)||(t.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_subscribe(e){const s=e.tileId;if(this._subscriptions.has(s)){const t=this._subscriptions.get(s);return void(t.paused&&(has("esri-2d-update-debug")&&console.debug(`Tile[${s}] Pipeline.resume`),t.resume(),t.version=e.version,this._source.onResume(t)))}has("esri-2d-update-debug")&&console.debug(`Tile[${s}] Pipeline.subscribe`);const t=new l(this._tileInfoView,s),i=new h(t,e.version);this._subscriptions.set(s,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const s=this._subscriptions.get(e);s&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),this._source.onUnsubscribe(s),this._processor.onUnsubscribe(s),this._subscriptions.delete(s.key.id),s.destroy())}_pauseSubscription(e){const s=this._subscriptions.get(e);s&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.pause`),s.pause())}async _updateChunks(){if(!this._preventChunkUpdates){if(null!=this._editState){has("esri-2d-update-debug")&&console.debug("Pipeline.handleEdit",this._editState.edit);const e=this._editState;this._editState=null;const s=await this._source.getOverride(e.edit);await this._processor.applyOverride(s),e.resolver.resolve()}try{await this._processor.updateChunks()}catch(e){t(e)}}}}e([n()],_.prototype,"updatingData",null);export{_ as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import r from"../../../../core/ReactiveMap.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";const o="esri.views.2d.layers.features.FeatureSourceEventLog";let n=class extends e{constructor(){super(...arguments),this.events=new s,this._updatingStrategy=!0,this._tileToEvent=new r,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(t){switch(t.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(t);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=t.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",t);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),t.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const t of this._tileToEvent.values()){if("loaded"!==t[t.length-1].type)return!1}return!0}_handleTileEvent(t){switch(t.type){case"subscribe":this._tileToEvent.set(t.tile,[t]);break;case"unsubscribe":this._tileToEvent.delete(t.tile);break;case"loaded":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.push(t),this._tileToEvent.set(t.tile,e);break}case"error":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.push(t),this._tileToEvent.set(t.tile,e),this.events.emit("error",t);break}}}};t([a({readOnly:!0})],n.prototype,"hasAllFeatures",null),t([a({readOnly:!0})],n.prototype,"hasAllFeaturesInView",null),t([a({readOnly:!0})],n.prototype,"hasFullGeometries",null),t([a()],n.prototype,"_updatingStrategy",void 0),t([a()],n.prototype,"_strategyInfo",void 0),t([a()],n.prototype,"_tileToEvent",void 0),n=t([i(o)],n);export{n as FeatureSourceEventLog};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy(),this.container=this._client.createInvokeProxy("featureView"),this.attributeView=this._client.createInvokeProxy("featureView.attributeView")}}export{e as PipelineConnectionHandlers};
5
+ class t{constructor(t){this._client=t,this.layerView=this._client.createInvokeProxy(),this.container=this._client.createInvokeProxy("container"),this.attributeView=this._client.createInvokeProxy("container.attributeView"),this.eventLog=this._client.createInvokeProxy("eventLog")}}export{t as PipelineConnectionHandlers};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{hasFloorFilter as r,addFloorFilter as t}from"./floorFilterUtils.js";import{isRendererSupported as i}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}get hasRequiredSupport(){return i(this.layer.renderer)}hasFilters(e){return r(this.layer,e)}addFilters(e,r){return t(this.layer,e,r)}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:s,renderer:o,gdbVersion:n,apiKey:l,subtypeCode:a}=i,d=this.layer.labelsVisible?this.layer.labelingInfo:null,u=i.historicMoment?.getTime()??void 0,p=JSON.stringify(i.customParameters),y=e(i,t)?.toJSON(),f=JSON.stringify(i.orderBy);return{apiKey:l,customParameters:p,definitionExpression:s,featureReduction:y,floors:r(this.layer,t)?t.floors:null,gdbVersion:n,historicMoment:u,labelingInfo:d,orderBy:f,renderer:o,subtypeCode:a}}}export{s as FeatureLayerAdapter};
5
+ import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as s}from"./featureServiceUtils.js";import{hasFloorFilter as o,addFloorFilter as l}from"./floorFilterUtils.js";import{getEffectiveGeometryType as a}from"./geometryUtils.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}async createServiceOptions(i){const o=this.layer,l=r(o),{capabilities:n,editingInfo:d,objectIdField:p,typeIdField:y,globalIdField:u,datesInUnknownTimezone:f,orderBy:m,subtypeField:c,refreshInterval:h}=o,g=o.fieldsIndex.toJSON(),b=g.fields,S=o.fullExtent?.toJSON(),x=a(o),I=o.timeInfo?.toJSON(),F=o.spatialReference.toJSON(),j=o.types?.map((e=>e.toJSON())),U=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(U.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let E=this.layer.objectIdField;if(m?.length){const e=!m[0].valueExpression&&m[0].field;e&&(E=e)}const O=!(null!=d?.lastEditDate)&&h>0,R=has("featurelayer-snapshot-enabled")&&"point"===o.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!O,C=R&&s(i,o.fullExtent),J=t(U.path);return{type:"remote",supportsSnapshotMinThreshold:R,supportsSnapshotMaxThreshold:C,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")},isSourceHosted:J,typeIdField:y??void 0,types:j,timeReferenceUnknownClient:f,subtypeField:c,globalIdField:u,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,capabilities:n,effectiveCapabilities:l,fields:b,fieldsIndex:g,fullExtent:S,geometryType:x,objectIdField:p,source:U,timeInfo:I,spatialReference:F,orderByFields:E,lastEditDate:d?.lastEditDate?.getTime()}}get hasRequiredSupport(){return n(this.layer.renderer)}hasFilters(e){return o(this.layer,e)}addFilters(e,t){return l(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:s,gdbVersion:l,apiKey:a,subtypeCode:n}=t,d=this.layer.labelsVisible?this.layer.labelingInfo:null,p=t.historicMoment?.getTime()??void 0,y=JSON.stringify(t.customParameters),u=i(t,e)?.toJSON(),f=JSON.stringify(t.orderBy);return{apiKey:a,customParameters:y,definitionExpression:r,featureReduction:u,floors:o(this.layer,e)?e.floors:null,gdbVersion:l,historicMoment:p,labelingInfo:d,orderBy:f,renderer:s,subtypeCode:n}}}export{d as FeatureLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{isRendererSupported as r}from"../support/rendererUtils.js";class t{constructor(e){this.layer=e}get hasRequiredSupport(){return r(this.layer.renderer)}getUpdateHashProperties(r){const t=this.layer,{definitionExpression:i,renderer:s}=t,n=this.layer.labelsVisible?this.layer.labelingInfo:null,o=e(t,r)?.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:s,labelingInfo:n,featureReduction:o}}}export{t as InMemoryLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{getEffectiveLayerCapabilities as r}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as o}from"./geometryUtils.js";import{isRendererSupported as i}from"../support/rendererUtils.js";function s(r){if(!("openPorts"in r))throw new e("source-not-supported")}class n{constructor(e){this.layer=e}async createServiceOptions(e){const t=this.layer,i=r(t),{capabilities:n,objectIdField:l}=t,a=t.fieldsIndex.toJSON(),u=a.fields,d=null!=t.fullExtent?t.fullExtent.toJSON():null,c=o(t),p=t.timeInfo?.toJSON(),f=t.spatialReference.toJSON();s(t.source);const y=await t.source.openPorts(),m=l;return{type:"remote",maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,capabilities:n,effectiveCapabilities:i,fields:u,fieldsIndex:a,fullExtent:d,geometryType:c,objectIdField:l,source:y,timeInfo:p,spatialReference:f,orderByFields:m}}get hasRequiredSupport(){return i(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:o,renderer:i}=r,s=this.layer.labelsVisible?this.layer.labelingInfo:null,n=t(r,e)?.toJSON();return{orderBy:JSON.stringify(r.orderBy),definitionExpression:o,renderer:i,labelingInfo:s,featureReduction:n}}}export{n as InMemoryLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{isRendererSupported as r}from"../support/rendererUtils.js";class t{constructor(e){this.layer=e}get hasRequiredSupport(){return r(this.layer.renderer)}getUpdateHashProperties(r){const t=this.layer,{definitionExpression:i,renderer:s}=t,n=this.layer.labelsVisible?this.layer.labelingInfo:null,o=e(t,r)?.toJSON();return{definitionExpression:i,renderer:s,labelingInfo:n,featureReduction:o}}}export{t as KnowledgeGraphSublayerAdapter};
5
+ import{getEffectiveLayerCapabilities as e}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getEffectiveGeometryType as r}from"./geometryUtils.js";import{isRendererSupported as i}from"../support/rendererUtils.js";class o{constructor(e){this.layer=e}async createServiceOptions(t){const i=this.layer,o=e(i),{capabilities:l,objectIdField:s}=i,n=i.fieldsIndex.toJSON(),a=n.fields,d=null!=i.fullExtent?i.fullExtent.toJSON():null,u=r(i),p=i.spatialReference.toJSON(),c=await i.source.openPorts(),f=s;return{type:"remote",maxRecordCount:l.query.maxRecordCount,tileMaxRecordCount:l.query.tileMaxRecordCount,capabilities:l,effectiveCapabilities:o,fields:a,fieldsIndex:n,fullExtent:d,geometryType:u,objectIdField:s,source:c,spatialReference:p,orderByFields:f}}get hasRequiredSupport(){return i(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:i,renderer:o}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,s=t(r,e)?.toJSON();return{definitionExpression:i,renderer:o,labelingInfo:l,featureReduction:s}}}export{o as KnowledgeGraphSublayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{isRendererSupported as r}from"../support/rendererUtils.js";class t{constructor(e){this.layer=e}get hasRequiredSupport(){return r(this.layer.renderer)}getUpdateHashProperties(r){const t=this.layer,{renderer:s,apiKey:i}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),l=e(t,r)?.toJSON();return{apiKey:i,customParameters:o,featureReduction:l,labelingInfo:a,orderBy:JSON.stringify(t.orderBy),renderer:s}}}export{t as OGCFeatureLayerAdapter};
5
+ import{getEffectiveLayerCapabilities as e}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{isRendererSupported as i}from"../support/rendererUtils.js";class o{constructor(e){this.layer=e}async createServiceOptions(r){const i=this.layer,o=e(i),{capabilities:s,objectIdField:l}=i,a=i.fieldsIndex.toJSON(),n=a.fields,d=i.fullExtent?.toJSON(),c=t(i),u=i.timeInfo?.toJSON(),p=i.spatialReference.toJSON(),y=i.source.getSource(),f=this.layer.objectIdField;return{type:"remote",maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,capabilities:s,effectiveCapabilities:o,fields:n,fieldsIndex:a,fullExtent:d,geometryType:c,objectIdField:l,source:y,timeInfo:u,spatialReference:p,orderByFields:f}}get hasRequiredSupport(){return i(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:o}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,l=JSON.stringify(t.customParameters),a=r(t,e)?.toJSON();return{apiKey:o,customParameters:l,featureReduction:a,labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}}export{o as OGCFeatureLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{hasFloorFilter as e,addFloorFilter as t}from"./floorFilterUtils.js";import{isRendererSupported as s}from"../support/rendererUtils.js";class i{constructor(r){this.layer=r}get hasRequiredSupport(){return s(this.layer.renderer)}hasFilters(r){return e(this.layer,r)}addFilters(r,e){return t(this.layer,r,e)}getUpdateHashProperties(t){const s=this.layer,{definitionExpression:i,renderer:o}=s,l=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(s.customParameters),a=r(s,t)?.toJSON();return{orderBy:JSON.stringify(s.orderBy),definitionExpression:i,renderer:o,labelingInfo:l,featureReduction:a,customParameters:n,floors:e(this.layer,t)?t.floors:null}}}export{i as OrientedImageryLayerAdapter};
5
+ import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{exceedsMinimumSnapshotCoverage as o}from"./featureServiceUtils.js";import{hasFloorFilter as i,addFloorFilter as l}from"./floorFilterUtils.js";import{getEffectiveGeometryType as a}from"./geometryUtils.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class p{constructor(e){this.layer=e}async createServiceOptions(s){const i=this.layer,l=t(i),{capabilities:n,objectIdField:p,globalIdField:d,orderBy:u,refreshInterval:f}=i,h=i.fieldsIndex.toJSON(),m=h.fields,y=i.fullExtent?.toJSON(),c=a(i),g=i.timeInfo?.toJSON(),x=i.spatialReference.toJSON(),b=e(this.layer.parsedUrl);let S=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(S=e)}const j=f>0,I=has("featurelayer-snapshot-enabled")&&"point"===i.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!j,F=I&&o(s,i.fullExtent),R=r(b.path);return{type:"remote",supportsSnapshotMinThreshold:I,supportsSnapshotMaxThreshold:F,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")},isSourceHosted:R,globalIdField:d,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,capabilities:n,effectiveCapabilities:l,fields:m,fieldsIndex:h,fullExtent:y,geometryType:c,objectIdField:p,source:b,timeInfo:g,spatialReference:x,orderByFields:S}}get hasRequiredSupport(){return n(this.layer.renderer)}hasFilters(e){return i(this.layer,e)}addFilters(e,r){return l(this.layer,e,r)}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:t,renderer:o}=r,l=this.layer.labelsVisible?this.layer.labelingInfo:null,a=JSON.stringify(r.customParameters),n=s(r,e)?.toJSON();return{orderBy:JSON.stringify(r.orderBy),definitionExpression:t,renderer:o,labelingInfo:l,featureReduction:n,customParameters:a,floors:i(this.layer,e)?e.floors:null}}}export{p as OrientedImageryLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{isRendererSupported as r}from"../support/rendererUtils.js";class t{constructor(e){this.layer=e}get hasRequiredSupport(){return r(this.layer.renderer)}getUpdateHashProperties(r){const t=this.layer,{definitionExpression:i,renderer:s}=t,n=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=e(t,r)?.toJSON();return{definitionExpression:i,renderer:s,labelingInfo:n,featureReduction:a,customParameters:o,streamFilter:`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`}}}export{t as StreamLayerAdapter};
5
+ import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getEffectiveGeometryType as t}from"./geometryUtils.js";import{isRendererSupported as r}from"../support/rendererUtils.js";class i{constructor(e){this.layer=e}async createServiceOptions(e){const r=this.layer,{objectIdField:i}=r,s=r.fields.map((e=>e.toJSON())),o=t(r),l=r.timeInfo?.toJSON()||null,a=r.spatialReference?r.spatialReference.toJSON():null;return{type:"stream",fields:s,fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:o,objectIdField:i,timeInfo:l,source:this.layer.parsedUrl,serviceFilter:n(this.layer.definitionExpression,this.layer.geometryDefinition),purgeOptions:this.layer.purgeOptions.toJSON(),spatialReference:a,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,customParameters:r.customParameters}}get hasRequiredSupport(){return r(this.layer.renderer)}getUpdateHashProperties(t){const r=this.layer,{definitionExpression:i,renderer:n}=r,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(r.customParameters),l=e(r,t)?.toJSON();return{definitionExpression:i,renderer:n,labelingInfo:s,featureReduction:l,customParameters:o,streamFilter:`${JSON.stringify(r.geometryDefinition)}${r.definitionExpression}`}}}function n(e,t){if(null==e&&null==t)return null;const r={};return null!=t&&(r.geometry=t.toJSON()),null!=e&&(r.where=e),r}export{i as StreamLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{floatEqualAbsolute as e}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import s from"../../../../../layers/support/FeatureFilter.js";import{hasFloorFilter as i,addFloorFilter as t}from"./floorFilterUtils.js";class l{constructor(e){this.layer=e}hasFilters(e){return i(this.layer,e)||a(this.layer,e)}addFilters(e,i){e=t(this.layer,e,i);const l=this.layer.sublayers.filter((e=>!o(e,i))).map((e=>e.subtypeCode));if(!l.length)return e;e??=new s;const a=`NOT ${this.layer.subtypeField} IN (${l.join(",")})`;return e.where=r(e.where,a),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const r=this.layer,{definitionExpression:s,gdbVersion:t,apiKey:l}=r,a=r.historicMoment?.getTime()??void 0,o=JSON.stringify(r.customParameters),n=i(this.layer,e)?e.floors:null;return{gdbVersion:t,definitionExpression:s,historicMoment:a,customParameters:o,apiKey:l,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,r)=>e+`${r.visible?1:0}.${JSON.stringify(r.renderer)}.${r.labelsVisible}\n.${JSON.stringify(r.labelingInfo)}`),""),floors:n}}}function a(e,r){return e.sublayers.some((e=>!o(e,r)))}function o(r,s){return r.visible&&(0===r.minScale||e(s.scale,r.minScale)||s.scale<r.minScale)&&(0===r.maxScale||e(s.scale,r.maxScale)||s.scale>r.maxScale)}export{l as SubtypeGroupLayerAdapter};
5
+ import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as o}from"../../../../../layers/support/layerUtils.js";import{exceedsMinimumSnapshotCoverage as a}from"./featureServiceUtils.js";import{hasFloorFilter as l,addFloorFilter as n}from"./floorFilterUtils.js";import{getEffectiveGeometryType as p}from"./geometryUtils.js";class m{constructor(e){this.layer=e}async createServiceOptions(t){const r=this.layer,i=o(r),{capabilities:l,datesInUnknownTimezone:n,editingInfo:m,globalIdField:u,objectIdField:d,refreshInterval:c,subtypeField:y}=r,f=r.fieldsIndex.toJSON(),h=f.fields,b=r.fullExtent?.toJSON(),g=p(r),S=r.timeInfo?.toJSON(),x=r.spatialReference.toJSON(),j=e(this.layer.parsedUrl),F=d,I=!(null!=m?.lastEditDate)&&c>0,U=has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&l?.query.supportsPagination&&!l?.operations.supportsEditing&&!I,E=U&&a(t,r.fullExtent),N=s(j.path);return{type:"remote",supportsSnapshotMinThreshold:U,supportsSnapshotMaxThreshold:E,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")},isSourceHosted:N,timeReferenceUnknownClient:n,subtypeField:y,globalIdField:u,maxRecordCount:l.query.maxRecordCount,tileMaxRecordCount:l.query.tileMaxRecordCount,capabilities:l,effectiveCapabilities:i,fields:h,fieldsIndex:f,fullExtent:b,geometryType:g,objectIdField:d,source:j,timeInfo:S,spatialReference:x,orderByFields:F,lastEditDate:m?.lastEditDate?.getTime()}}hasFilters(e){return l(this.layer,e)||u(this.layer,e)}addFilters(e,t){e=n(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!d(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new i;const o=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,o),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:i}=t,o=t.historicMoment?.getTime()??void 0,a=JSON.stringify(t.customParameters),n=l(this.layer,e)?e.floors:null;return{gdbVersion:s,definitionExpression:r,historicMoment:o,customParameters:a,apiKey:i,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),floors:n}}}function u(e,t){return e.sublayers.some((e=>!d(e,t)))}function d(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{m as SubtypeGroupLayerAdapter};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
+ */
5
+ import has from"../../../../../core/has.js";function t(t,e){const n=t.extent,o=e?.clone().intersection(n),i=null!=o?o.width*o.height:0,r=e?e.width*e.height:0,h=0===r?0:i/r,s=has("featurelayer-snapshot-point-coverage");return!isNaN(h)&&h>=s}export{t as exceedsMinimumSnapshotCoverage};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
+ */
5
+ function e(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":case"multipatch":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";default:return null}}export{e as getEffectiveGeometryType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a}from"../../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as i}from"../../../../../core/support/UpdatingHandles.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import n from"../../../../../layers/support/FieldsIndex.js";import{executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as u,isStreamSourceQueryInfo as c,isFeatureSourceQueryInfo as g}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as m}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as l}from"./strategies/PagedTileLoadStrategy.js";import{SnapshotLoadStrategy as _}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as y}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as f}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as S}from"../support/FeatureMetadata.js";class I{constructor(e,t,s){this._aggregateAdapter=e,this._subscriptions=t,this._onChange=s,this._updatingHandles=new i,this._queryInfo=new u}destroy(){this._strategy.destroy(),this._streamMessenger?.destroy()}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get service(){return this._schema.service}get store(){return this._store}get streamMessenger(){return this._streamMessenger}get statistics(){return h.from(this._store)}get updating(){return this._updatingHandles.updating}get queryEngine(){if(!this._queryEngine){const{outSpatialReference:e,definitionExpression:t,availableFields:s}=this._schema,{objectIdField:r,geometryType:a,timeInfo:i}=this._schema.service;this._queryEngine=new o({featureStore:this._store,fieldsIndex:n.fromJSON(this._schema.service.fieldsIndex),geometryType:a,objectIdField:r,hasM:!1,hasZ:!1,spatialReference:e,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:i,definitionExpression:t,availableFields:s})}return this._queryEngine}get isStream(){return c(this._queryInfo)}chunks(){return Array.from(this._store.chunks())}onSubscribe(e){this._updatingHandles.addPromise(t(this._strategy?.load(e)))}onResume(e){this._updatingHandles.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._strategy?.unload(e)}getOverride(e){return this._updatingHandles.addPromise(this._doGetOverride(e))}applyOverride(e){this._store.applyOverrides(e)}async update(e,t,s){const i=e.source,o=this._schema,n=r(o,i);if(null==n)return{outFieldsChanged:!1,sourceDataChanged:!1};if(this._schema=i,a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),{sourceDataChanged:!0,outFieldsChanged:!1};this._queryEngine?.destroy(),this._queryEngine=null,this._metadata=new S(this._schema.service),null==this._lastEditDate&&"lastEditDate"in this._schema.service&&(this._lastEditDate=this._schema.service.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.service.type&&(this._streamMessenger=new p(s));const d=this._queryInfo.update(this._schema,t);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changeState:d}),d.sourceDataChanged=d.sourceDataChanged||o?.sourceRefreshVersion!==this._schema.sourceRefreshVersion,d.sourceDataChanged?await this._updateStrategy(t):d.outFieldsChanged&&(await this._queryLastEditDateChanged()?await this._updateStrategy(t):await this._strategy.updateFields()),d}async _doGetOverride({edits:e}){const t=[],s=[];for(const i of e.removed)null!=i.objectId&&-1!==i.objectId?t.push(i.objectId):s.push(i.globalId);t.push(...this._mapGlobalIdsToObjectIds(s));const r=e.addOrModified.map((({objectId:e})=>e)),a=this._queryInfo.createQuery({objectIds:r});return{reader:await this._strategy.fetch(a),removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),s=this.service.globalIdField,r=[];return this._store.forEachUnsafe((e=>{const a=e.readAttribute(s);t.has(a)&&r.push(e.getObjectId())})),r}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this._schema.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(e){const t=this._queryInfo.serviceInfo,s="remote"===t.type&&t.isSourceHosted,r=Array.isArray(t.source),a=s||r;if(c(this._queryInfo)){const t=new y(this._queryInfo,e,{outSR:this._schema.outSpatialReference},this.metadata);return this._streamMessenger.strategy=t,t}if(!g(this._queryInfo))throw new Error("Unknown load strategy!");const i=await this._supportSnapshotMode();return i?new _(this._queryInfo,e,i.featureCount,this.metadata):a?new l(this._queryInfo,e,this.metadata):new m(this._queryInfo,e,this.metadata)}async _updateStrategy(e){const r=new f(this._onChange),a=await this._createStrategy(r),i=!!this._strategy;this._store?.destroy(),this._store=r,this._strategy?.destroy(),this._strategy=a,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:a});const o=Array.from(this._subscriptions.values());if(!o.length)return;const n=Promise.all(o.map((e=>t(this._strategy.load(e)))));this._updatingHandles.addPromise(n);try{i&&await n}catch(d){s(d)}has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:a})}async _supportSnapshotMode(){const e=this._schema.service;if("stream"===e.type||"memory"===e.type)return null;if(!e.supportsSnapshotMinThreshold)return null;const t=e.source,s=this._queryInfo.createQuery();s.returnGeometry=!1;const r=(await d(t,s)).data.count,{min:a,max:i}=e.snapshotCountThresholds;return r<=a||e.supportsSnapshotMaxThreshold&&r<i?{featureCount:r}:null}}export{I as FeatureSource};
5
+ import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a}from"../../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as i}from"../../../../../core/support/UpdatingHandles.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import n from"../../../../../layers/support/FieldsIndex.js";import{executeQueryForCount as h}from"../../../../../rest/query/operations/query.js";import{FeatureStoreStatistics as d}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as u,isStreamSourceQueryInfo as c,isFeatureSourceQueryInfo as g}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as _}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as l}from"./strategies/PagedTileLoadStrategy.js";import{SnapshotLoadStrategy as y}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as m}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as f}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as v}from"../support/FeatureMetadata.js";class S{constructor(e,t,s,r){this._aggregateAdapter=e,this._subscriptions=t,this._onChange=s,this._connection=r,this._updatingHandles=new i,this._queryInfo=new u,this._store=new f(this._onChange)}destroy(){this._strategy.destroy(),this._store.destroy(),this._streamMessenger?.destroy()}get _eventLog(){return this._connection.eventLog}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get service(){return this._schema.service}get store(){return this._store}get streamMessenger(){return this._streamMessenger}get statistics(){return d.from(this._store)}get updating(){return this._updatingHandles.updating}get queryEngine(){if(!this._queryEngine){const{outSpatialReference:e,definitionExpression:t,availableFields:s}=this._schema,{objectIdField:r,geometryType:a,timeInfo:i}=this._schema.service;this._queryEngine=new o({featureStore:this._store,fieldsIndex:n.fromJSON(this._schema.service.fieldsIndex),geometryType:a,objectIdField:r,hasM:!1,hasZ:!1,spatialReference:e,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:i,definitionExpression:t,availableFields:s})}return this._queryEngine}get isStream(){return c(this._queryInfo)}chunks(){return Array.from(this._store.chunks())}onSubscribe(e){this._eventLog.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then((()=>this._eventLog.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._eventLog.onEvent({type:"error",tile:e.tile.id,error:t}))),this._updatingHandles.addPromise(t))}onResume(e){this._updatingHandles.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._eventLog.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getOverride(e){return this._updatingHandles.addPromise(this._doGetOverride(e))}applyOverride(e){this._store.applyOverrides(e)}async update(e,t,s){const i=e.source,o=this._schema,n=r(o,i);if(null==n)return{outFieldsChanged:!1,sourceDataChanged:!1};if(this._schema=i,a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),{sourceDataChanged:!0,outFieldsChanged:!1};this._queryEngine?.destroy(),this._queryEngine=null,this._metadata=new v(this._schema.service),null==this._lastEditDate&&"lastEditDate"in this._schema.service&&(this._lastEditDate=this._schema.service.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.service.type&&(this._streamMessenger=new p(s));const h=this._queryInfo.update(this._schema,t);if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changeState:h}),h.sourceDataChanged=h.sourceDataChanged||o?.sourceRefreshVersion!==this._schema.sourceRefreshVersion,h.sourceDataChanged)await this._updateStrategy(t);else if(h.outFieldsChanged)if(await this._queryLastEditDateChanged())await this._updateStrategy(t);else{this._eventLog.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(),this._eventLog.onEvent({type:"updateFieldsEnd"})}catch(d){this._eventLog.onEvent({type:"updateFieldsError",error:d})}}return h}async _doGetOverride({edits:e}){const t=[],s=[];for(const i of e.removed)null!=i.objectId&&-1!==i.objectId?t.push(i.objectId):s.push(i.globalId);t.push(...this._mapGlobalIdsToObjectIds(s));const r=e.addOrModified.map((({objectId:e})=>e)),a=this._queryInfo.createQuery({objectIds:r});return{reader:await this._strategy.fetch(a),removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),s=this.service.globalIdField,r=[];return this._store.forEachUnsafe((e=>{const a=e.readAttribute(s);t.has(a)&&r.push(e.getObjectId())})),r}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this._schema.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e=this._queryInfo.serviceInfo,t="remote"===e.type&&e.isSourceHosted,s=Array.isArray(e.source),r=t||s;if(c(this._queryInfo)){const e=new m(this._queryInfo,this._store,{outSR:this._schema.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if(!g(this._queryInfo))throw new Error("Unknown load strategy!");const a=await this._supportSnapshotMode();return a?new y(this._queryInfo,this._store,a.featureCount,this.metadata,this._eventLog):r?new l(this._queryInfo,this._store,this.metadata,this._eventLog):new _(this._queryInfo,this._store,this.metadata,this._eventLog)}async _updateStrategy(e){const t=await this._createStrategy();this._eventLog.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._eventLog.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map((e=>this._strategy.load(e).then((()=>this._eventLog.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._eventLog.onEvent({type:"error",tile:e.tile.id,error:t}))))));this._updatingHandles.addPromise(i);try{r&&await i}catch(o){s(o)}this._eventLog.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(){const e=this._schema.service;if("stream"===e.type||"memory"===e.type)return null;if(!e.supportsSnapshotMinThreshold)return null;const t=e.source,s=this._queryInfo.createQuery();s.returnGeometry=!1;const r=(await h(t,s)).data.count,{min:a,max:i}=e.snapshotCountThresholds;return r<=a||e.supportsSnapshotMaxThreshold&&r<i?{featureCount:r}:null}}export{S as FeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as e}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{QueueProcessor as r}from"../../../../../support/QueueProcessor.js";class o extends e{constructor(t,e,o){super(t,e),this._queryInfo=t,this._queue=new r({concurrency:8,process:async t=>this._adapter.executeQuery(t.query,t.options)}),this._adapter=s(this._queryInfo.serviceInfo,o)}async updateFields(){const e=Array.from(this._store.chunks()).map((async e=>{const s=t.fromJSON(e.queryInfo.queryJSON);s&&await this._tryUpdateFields(e.reader,s)}));await Promise.all(e)}async fetch(t,e){const s=await this._queue.push({query:t,options:e});return await this._tryUpdateFields(s,t),s}async _tryUpdateFields(t,e){const s=this._queryInfo.createPatchFieldsQuery(e,t.fields);if(!s)return;const r=await this._queue.push({query:s,options:this._options});t.joinAttributes(r)}}export{o as AFetchLoadStrategy};
5
+ import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{QueueProcessor as o}from"../../../../../support/QueueProcessor.js";class n extends r{constructor(e,t,r,n){super(e,t),this._queryInfo=e,this._metadata=r,this._eventLog=n,this._queue=new o({concurrency:8,process:async e=>this._adapter.executeQuery(e.query,e.options)}),this._adapter=s(this._queryInfo.serviceInfo,r)}async updateFields(){const r=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),s=(await Promise.all(r)).filter((e=>e));if(s.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:s})}async fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e.fields);if(!r)return;const s=await this._enqueue(r,this._options);e.joinAttributes(s)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally((()=>{this._eventLog.onEvent({type:"fetchEnd",done:0===this._queue.length})}))}}export{n as AFetchLoadStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../../core/has.js";import{AFetchLoadStrategy as e}from"./AFetchLoadStrategy.js";class s extends e{constructor(){super(...arguments),this._chunksById=new Map}unload(e){this._removeChunks(e.tile)}_addChunk(e){const s=e.tile.id,t=this._queryInfo.version;this._chunksById.has(s)||this._chunksById.set(s,[]),has("esri-2d-update-debug")&&this._chunksById.get(s).some((e=>e.end));const o=e.size();(o||e.first)&&(has("esri-2d-update-debug")&&console.debug(`Version[${t}] Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${o}]`),this._chunksById.get(s).push(e),this._store.insert(e,t))}_removeChunks(e){const s=this._chunksById.get(e.key.id)??[];for(const t of s){if(has("esri-2d-update-debug")){const s=this._queryInfo.version;console.debug(`Version[${s}] Tile[${e.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`)}this._store.remove(t)}this._chunksById.delete(e.key.id)}}export{s as ATileLoadStrategy};
5
+ import has from"../../../../../../core/has.js";import{AFetchLoadStrategy as e}from"./AFetchLoadStrategy.js";class s extends e{constructor(){super(...arguments),this._chunksById=new Map}unload(e){this._removeChunks(e.tile)}_addChunk(e){const s=e.tile.id,t=this._queryInfo.version;this._chunksById.has(s)||this._chunksById.set(s,[]);const o=e.size();(o||e.first||e.end)&&(has("esri-2d-update-debug")&&console.debug(`Version[${t}] Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${o}]`),this._chunksById.get(s).push(e),this._store.insert(e,t))}_removeChunks(e){const s=this._chunksById.get(e.key.id)??[];for(const t of s){if(has("esri-2d-update-debug")){const s=this._queryInfo.version;console.debug(`Version[${s}] Tile[${e.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`)}this._store.remove(t)}this._chunksById.delete(e.key.id)}}export{s as ATileLoadStrategy};