/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{property as r,subclass as a}from"../../../core/accessorSupport/decorators.js";import{copyToClipboard as s,getConvertedArea as n,getConvertedDistance as i,getConvertedHeight as c}from"../imageMeasurementUtils.js";const u=u=>{const m=u;let o=class extends m{constructor(){super(...arguments),this.messages=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters"}copyMeasurementResult(e){let r,a;switch(e){case"area":r={measurement:this.getConvertedAreaString("measurement"),accuracy:this.getConvertedAreaString("accuracy")},a="{measurement} ± {accuracy}";break;case"distance":r={measurement:this.getConvertedDistanceString("measurement"),accuracy:this.getConvertedDistanceString("accuracy")},a="{measurement} ± {accuracy}";break;case"height":r={measurement:this.getConvertedHeightString("measurement"),accuracy:this.getConvertedHeightString("accuracy")},a="{measurement} ± {accuracy}"}const n=t(a,r);s(n)}getConvertedAreaString(e){const{oiViewModel:t,measurementUnitMessages:r,pixelAreaMeasurementUnit:a,messages:s}=this,{areaMeasurementResult:i,areaMeasurementAccuracy:c}=t;return n(e,i,c,r,a)??s.startMeasurement}getConvertedDistanceString(e){const{oiViewModel:t,measurementUnitMessages:r,pixelMeasurementUnit:a,messages:s}=this,{distanceAccuracyArray:n,distanceMeasurementResult:c}=t;return i(e,c,n,r,a)??s.startMeasurement}getAccuracy(e){let r,a;switch(e){case"area":return r={accuracy:this.getConvertedAreaString("accuracy")},a="± {accuracy}",t(a,r);case"distance":return r={accuracy:this.getConvertedDistanceString("accuracy")},a="± {accuracy}",t(a,r);case"height":return r={accuracy:this.getConvertedHeightString("accuracy")},a="± {accuracy}",t(a,r)}}getConvertedHeightString(e){const{oiViewModel:t,measurementUnitMessages:r,pixelMeasurementUnit:a,messages:s}=this,{heightMeasurementAccuracy:n,heightMeasurementResult:i}=t;return c(e,i,n,r,a)??s.startMeasurement}handleLengthMeasurementUnitChange(e){this.pixelMeasurementUnit=e}handleAreaMeasurementUnitChange(e){this.pixelAreaMeasurementUnit=e}};return e([r()],o.prototype,"messages",void 0),e([r()],o.prototype,"measurementUnitMessages",void 0),e([r()],o.prototype,"measurementType",void 0),e([r()],o.prototype,"pixelMeasurementUnit",void 0),e([r()],o.prototype,"pixelAreaMeasurementUnit",void 0),e([r()],o.prototype,"oiViewModel",void 0),o=e([a("esri.widgets.OrientedImageryViewer.mixins.ImageMeasurementMixin")],o),o};export{u as ImageMeasurementMixin};
