/*
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","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../SmartMappingPrimaryHandleSliderViewModel"],(function(e,t,r,s,a,o,i,n){"use strict";let p=function(t){function r(e){var r;return(r=t.call(this,e)||this).persistSizeRangeEnabled=!1,r}return e._inheritsLoose(r,t),r.prototype.updateStops=function(e){const{primaryHandleEnabled:t,persistSizeRangeEnabled:r,stops:s}=this,a=this.getValuesFromStops();if(null==a||!a.length)return;if(e.sort(((e,t)=>e.value>t.value?1:-1)).forEach((e=>{a[e.index]=e.value})),s.forEach(((e,t)=>e.value=a[t])),t&&r){const{stops:e}=this,t=this.getValuesFromStops(),r=e.map((e=>e.size)),s=Math.max(...r),a=Math.min(...r),o=Math.max(...t),i=Math.min(...t),n=e[5===e.length?2:1].value,p=Math.abs(o-n),l=Math.abs(i-n),c=p>l?p:l,u=s-a;if(0===c)return;e.forEach((e=>{e.size=Math.abs(e.value-n)/c*u+a}))}},e._createClass(r,[{key:"stops",get:function(){return this.stops}}]),r}(n);t.__decorate([r.property()],p.prototype,"persistSizeRangeEnabled",void 0),t.__decorate([r.property()],p.prototype,"stops",null),p=t.__decorate([i.subclass("esri.widgets.smartMapping.SizeSlider.SizeSliderViewModel")],p);return p}));
