/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../input/InputHandler"],(function(e,i,t){"use strict";let n=function(e){function t(i,t,n){var o;return(o=e.call(this,!0)||this).view=i,o.keys=t,o._pressed=!1,o._keyToDirection={[t.clockwiseOption1]:"clockwise",[t.clockwiseOption2]:"clockwise",[t.counterClockwiseOption1]:"counterClockwise",[t.counterClockwiseOption2]:"counterClockwise",[t.resetOption1]:"reset",[t.resetOption2]:"reset"},o.registerIncoming("key-down",n,(e=>o._handleKeyDown(e))),o.registerIncoming("key-up",n,(e=>o._handleKeyUp(e))),o.registerIncoming("blur",n,(()=>o._handleBlur())),o}i._inheritsLoose(t,e);var n=t.prototype;return n._handleKeyDown=function(e){e.data.repeat||this._handleKey(e,!0)},n._handleKeyUp=function(e){this._handleKey(e,!1)},n._handleBlur=function(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())},n._handleKey=function(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[e.data.key];if(this._pressed=null!=n,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}},t}(t.InputHandler);e.KeyRotate=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
