/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../intl","../../../core/Handles","../../../core/maybe","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../SmartMappingSliderViewModel","../../../intl/locale","../../../intl/messages"],(function(e,t,o,r,a,s,n,i,p,l,c,d,u){"use strict";let y=function(t){function o(e){var o;return(o=t.call(this,e)||this)._handles=new r,o.hasTimeData=!1,o.labelFormatFunction=(e,t)=>"min"===t?o.messages.bottomLabel:"max"===t?o.messages.topLabel:e.toString(),o.max=1,o.messages=null,o.min=0,o.zoomingEnabled=!1,o}e._inheritsLoose(o,t);var s=o.prototype;return s.initialize=function(){var t=this;const o=function(){var o=e._asyncToGenerator((function*(){return t.messages=yield u.fetchMessageBundle("esri/widgets/smartMapping/HeatmapSlider/t9n/HeatmapSlider")}));return function(){return o.apply(this,arguments)}}();o(),this._handles.add(d.onLocaleChange(o))},s.getStopInfo=function(){const{stops:e}=this;return e&&e.length?e.map((e=>({color:e.color,offset:1-e.ratio}))):[]},e._createClass(o,[{key:"state",get:function(){const{messages:e,max:t,min:o}=this;return e&&a.isSome(t)&&a.isSome(o)?"ready":"disabled"}},{key:"stops",get:function(){return this.stops}},{key:"values",get:function(){const{stops:e}=this;return!e||!e.length||e.length<2?[]:[e[0].ratio,e[e.length-1].ratio]}}]),o}(c);t.__decorate([s.property({readOnly:!0})],y.prototype,"hasTimeData",void 0),t.__decorate([s.property({readOnly:!0})],y.prototype,"labelFormatFunction",void 0),t.__decorate([s.property({readOnly:!0})],y.prototype,"max",void 0),t.__decorate([s.property()],y.prototype,"messages",void 0),t.__decorate([s.property({readOnly:!0})],y.prototype,"min",void 0),t.__decorate([s.property({readOnly:!0})],y.prototype,"state",null),t.__decorate([s.property()],y.prototype,"stops",null),t.__decorate([s.property({readOnly:!0})],y.prototype,"values",null),t.__decorate([s.property({readOnly:!0})],y.prototype,"zoomingEnabled",void 0),y=t.__decorate([l.subclass("esri.widgets.smartMapping.HeatmapSlider.HeatmapSliderViewModel")],y);return y}));
