/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{EventEmitter as e}from"../../../../../core/Evented.js";import{create as r}from"../../../../../geometry/support/aaBoundingBox.js";import{getBoundsOptimizedGeometry as t}from"../../../../../layers/graphics/featureConversionUtils.js";import{optimizedFeatureQueryEngineAdapter as a}from"../../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";import{QueryEngine as s}from"../../../../../layers/graphics/data/QueryEngine.js";import{collectExpressionDependencies as o}from"../../../../../support/ArcadeExpression.js";import{AProcessorStrategy as n}from"./AProcessorStrategy.js";class i extends n{constructor(r,t,s,n,i){super(r,t,i),this.spatialReference=s,this.aggregateFields=n,this._arcadeDependencies=new Set,this.events=new e,this.featureAdapter=a;for(const e of n)o(this._arcadeDependencies,e.computed)}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new s({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,featureIdInfo:this._metadata.featureIdInfo,spatialReference:this.spatialReference})),this._aggregateQueryEngine}get isAggregate(){return!0}removeChunks(e){}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,r){}forEachBounds(e,a){const s=r();for(const r of e){const e=t(s,r.geometry);e&&a(e)}}}export{i as AAggregateStrategy};
