/*
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/Accessor","../../core/Handles","../../core/reactiveUtils","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass"],(function(e,t,i,o,r,a,n,s,c,d){"use strict";let l=function(t){function i(e){var i;return(i=t.call(this,e)||this)._handles=new o,i.navigationMode="pan",i.view=null,i}e._inheritsLoose(i,t);var a=i.prototype;return a.initialize=function(){this._handles.add(r.when((()=>{var e;return null==(e=this.view)?void 0:e.inputManager}),(()=>this._setNavigationMode())))},a.destroy=function(){this._handles.destroy(),this._handles=null,this.view=null},a.toggle=function(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate",this._setNavigationMode())},a._setNavigationMode=function(){this.get("view.inputManager").primaryDragAction="pan"===this.navigationMode?"pan":"rotate"},e._createClass(i,[{key:"state",get:function(){return this.get("view.ready")&&"3d"===this.view.type?"ready":"disabled"}}]),i}(i);t.__decorate([a.property({readOnly:!0})],l.prototype,"state",null),t.__decorate([a.property()],l.prototype,"navigationMode",void 0),t.__decorate([a.property()],l.prototype,"view",void 0),l=t.__decorate([d.subclass("esri.widgets.NavigationToggleViewModel")],l);return l}));
