/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let n=class extends s{constructor(e){super(e),this.type="dynamic",this.xyMode="direction-distance",this._isVisibleField=e=>{switch(e.name){case"x":case"y":return this.visibleElements.coordinates;default:return this.visibleElements[e.name]}}}get availableFields(){return this.getAllFields?.()??[]}get elevation(){return this.allFields.find(e=>"elevation"===e.name)}get allFields(){const{availableFields:e,_useCoordinateDisplay:t,_useDirectionDistanceDisplay:i}=this;return(t?e.filter(l):i?e.filter(r):e).filter(this._isVisibleField).sort(o)}get knownConstraintFields(){return this.allFields.filter(a)}get _useCoordinateDisplay(){const{availableFields:e,xyMode:t}=this;return"coordinates"===t&&e.some(e=>"x"===e.name)&&e.some(e=>"y"===e.name)}get _useDirectionDistanceDisplay(){const{availableFields:e,xyMode:t}=this;return"direction-distance"===t&&e.some(e=>"distance"===e.name)&&e.some(e=>"direction"===e.name)}};function o(e,t){return e.displayOrder-t.displayOrder}function l(e){return"direction"!==e.name&&"distance"!==e.name}function r(e){return"x"!==e.name&&"y"!==e.name}function a(e){switch(e.name){case"direction":case"distance":case"elevation":case"x":case"y":return!0;default:return!1}}e([t()],n.prototype,"type",void 0),e([t()],n.prototype,"xyMode",void 0),e([t()],n.prototype,"getAllFields",void 0),e([t()],n.prototype,"availableFields",null),e([t()],n.prototype,"elevation",null),e([t()],n.prototype,"allFields",null),e([t()],n.prototype,"knownConstraintFields",null),e([t()],n.prototype,"_useCoordinateDisplay",null),e([t()],n.prototype,"_useDirectionDistanceDisplay",null),n=e([i("esri.views.interactive.tooltip.infos.DynamicTooltipInfo")],n);export{n as DynamicTooltipInfo};
