/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{parseWhereClause as i}from"../../../core/sql.js";class s{constructor(i){this._fieldsIndex=i,this._clauses=[]}async finish(){return{requiresCurrentUser:(await Promise.all(this._clauses)).some(i=>i.currentUserRequired)}}visitClientWhereClause(s){s&&this._clauses.push(i(s,this._fieldsIndex))}visitFeatureReduction(i){if(i)switch(i.type){case"binning":case"cluster":this.visitLabelingInfo(i.labelsVisible,i.labelingInfo)}}visitLabelingInfo(i,s){if(i&&null!=s)for(const e of s)this.visitClientWhereClause(e.where)}visitDisplayFilter(i,s){if(i)for(const e of s?.filters??[])this.visitClientWhereClause(e.where)}visitFilter(i){this.visitClientWhereClause(i?.where)}visitTrackInfo(i){null!=i&&(this.visitLabelingInfo(i?.latestObservations.labelsVisible,i?.latestObservations.labelingInfo),this.visitLabelingInfo(i?.previousObservations.labelsVisible,i?.previousObservations.labelingInfo),this.visitLabelingInfo(i?.trackLines.labelsVisible,i?.trackLines.labelingInfo))}}export{s as WhereClauseVisitor};
