/*
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/aliasOf","../core/arrayUtils","../core/has","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/property","../core/accessorSupport/decorators/subclass","./Widget","./support/widgetUtils","./support/decorators/messageBundle","./support/jsxFactory","./Zoom/IconButton","./Zoom/ZoomViewModel"],(function(o,t,e,s,i,n,r,a,u,c,l,d,p,m){"use strict";const h={base:"esri-zoom esri-widget",horizontalLayout:"esri-zoom--horizontal",zoomInIcon:"esri-icon-plus",zoomOutIcon:"esri-icon-minus",widgetIcon:"esri-icon-zoom-in-magnifying-glass"};let z=function(t){function e(o,e){var s;return(s=t.call(this,o,e)||this).iconClass=h.widgetIcon,s.label=void 0,s.messages=null,s.view=null,s.viewModel=new m,s}o._inheritsLoose(e,t);var s=e.prototype;return s.initialize=function(){this._zoomInButton=new p({action:this.zoomIn.bind(this),iconClass:h.zoomInIcon}),this._zoomOutButton=new p({action:this.zoomOut.bind(this),iconClass:h.zoomOutIcon})},s.destroy=function(){this._zoomInButton.destroy(),this._zoomOutButton.destroy(),this._zoomInButton=null,this._zoomOutButton=null},s.render=function(){const o=this.viewModel,t={[h.horizontalLayout]:"horizontal"===this.layout};return this._zoomInButton.enabled="ready"===o.state&&o.canZoomIn,this._zoomOutButton.enabled="ready"===o.state&&o.canZoomOut,this._zoomInButton.title=this.messages.zoomIn,this._zoomOutButton.title=this.messages.zoomOut,d.tsx("div",{class:this.classes(h.base,t)},this._zoomInButton.render(),this._zoomOutButton.render())},s.zoomIn=function(){return this.viewModel.zoomIn()},s.zoomOut=function(){return this.viewModel.zoomOut()},o._createClass(e,[{key:"layout",set:function(o){"horizontal"!==o&&(o="vertical"),this._set("layout",o)}}]),e}(u);t.__decorate([r.property()],z.prototype,"iconClass",void 0),t.__decorate([r.property({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],z.prototype,"label",void 0),t.__decorate([r.property({value:"vertical"})],z.prototype,"layout",null),t.__decorate([r.property(),l.messageBundle("esri/widgets/Zoom/t9n/Zoom")],z.prototype,"messages",void 0),t.__decorate([e.aliasOf("viewModel.view")],z.prototype,"view",void 0),t.__decorate([r.property({type:m})],z.prototype,"viewModel",void 0),z=t.__decorate([a.subclass("esri.widgets.Zoom")],z);return z}));
