/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as e}from"tslib";import{watch as i,sync as o}from"../../../core/reactiveUtils.js";import{property as r,subclass as t}from"../../../core/accessorSupport/decorators.js";import{ElevationProfileLineComputation as l}from"./ElevationProfileLineComputation.js";import{getQuerySourceMinDemResolution as s}from"./elevationProfileQuerySourceUtils.js";let n=class extends l{constructor(){super(...arguments),this.type="query",this.numSamplesForPreview=50,this.numSamplesPerChunk=500}get minDemResolution(){return s(this.profile.source)}get available(){const{source:e}=this.profile;return!!e&&(null==e.visible||e.visible)&&(null==e.layers||e.layers.some(e=>e.visible))}initialize(){this.addHandles(i(()=>this.profile.source,()=>this.onInvalidate(this),o))}queryElevation(e,i){if(!this.profile.source)throw new Error("No source configured for the elevation profile line");return this.profile.source.queryElevation(e,i)}};e([r({readOnly:!0})],n.prototype,"minDemResolution",null),e([r()],n.prototype,"available",null),n=e([t("esri.views.analysis.ElevationProfile.ElevationProfileLineQueryComputation")],n);export{n as ElevationProfileLineQueryComputation};
