// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:widgets/ParcelDrafter/ParcelTools.html":'\x3cdiv class\x3d"esriCTFullWidth"\x3e\r\n    \x3c!-- Rotation tool container--\x3e\r\n    \x3cdiv class\x3d"esriCTMainPageRow"\x3e\r\n        \x3cdiv class\x3d"esriCTRotationButton esriCTButtonIcon esriCTParcelToolButtonIcon esriCTCursorPointer" title\x3d"${nls.parcelTools.rotationToolLabel}"\r\n            data-dojo-attach-point\x3d"rotateButton" tabindex\x3d"0" role\x3d"button"  aria-pressed\x3d"false" aria-label\x3d"${nls.parcelTools.rotationToolLabel}"\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTParcelToolButtonLabel esriCTEllipsis" title\x3d"${nls.parcelTools.rotationToolLabel}"\x3e\r\n            ${nls.parcelTools.rotationToolLabel}\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTParcelToolInputNode" data-dojo-type\x3d"dijit/form/NumberTextBox" trim\x3d"true" required\x3d"true" data-dojo-attach-point\x3d"rotationTxt" aria-label\x3d"${nls.parcelTools.rotationToolLabel}"\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3c!-- Scale tool container--\x3e\r\n    \x3cdiv class\x3d"esriCTMainPageRow"\x3e\r\n        \x3cdiv class\x3d"esriCTScaleButton esriCTButtonIcon esriCTParcelToolButtonIcon esriCTCursorPointer" title\x3d"${nls.parcelTools.scaleToolLabel}"\r\n            data-dojo-attach-point\x3d"scaleButton" tabindex\x3d"0" role\x3d"button" aria-pressed\x3d"false" aria-label\x3d"${nls.parcelTools.scaleToolLabel}"\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTParcelToolButtonLabel esriCTEllipsis" title\x3d"${nls.parcelTools.scaleToolLabel}"\x3e\r\n            ${nls.parcelTools.scaleToolLabel}\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTParcelToolInputNode" data-dojo-type\x3d"dijit/form/NumberTextBox" trim\x3d"true" required\x3d"true" data-dojo-attach-point\x3d"scaleTxt" aria-label\x3d"${nls.parcelTools.scaleToolLabel}"\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare jimu/BaseWidget dijit/_WidgetsInTemplateMixin dojo/text!./ParcelTools.html dojo/_base/lang dojo/Evented dojo/dom-class dojo/dom-attr dojo/on dojo/keys dijit/form/NumberTextBox".split(" "),function(h,k,l,m,b,n,c,e,d,f){return h([k,l,n],{baseClass:"jimu-widget-ParcelDrafter-ParcelTools",templateString:m,rotationAngle:0,scaledValue:1,constructor:function(a){b.mixin(this,a)},postCreate:function(){this.inherited(arguments);c.add(this.domNode,"esriCTFullWidth");this.rotationTxt.constraints=
{min:-360,max:360,places:3};this.scaleTxt.constraints={min:.1,places:3};this.rotationTxt.set("value",this.rotationAngle);this.scaleTxt.set("value",this.scaledValue);this.own(d(this.rotationTxt,"blur",b.hitch(this,function(){this.setRotation(this.rotationTxt.displayedValue)})));this.own(d(this.scaleTxt,"blur",b.hitch(this,function(){this.setScale(this.scaleTxt.displayedValue)})));this.canProjectLocally?(this.own(d(this.rotateButton,"click",b.hitch(this,function(){this._toggleRotating()}))),this.own(d(this.rotateButton,
"keydown",b.hitch(this,function(a){if(a.keyCode===f.ENTER||a.keyCode===f.SPACE)a.preventDefault(),this._toggleRotating()}))),this.own(d(this.scaleButton,"click",b.hitch(this,function(){this._toggleScaling()}))),this.own(d(this.scaleButton,"keydown",b.hitch(this,function(a){if(a.keyCode===f.ENTER||a.keyCode===f.SPACE)a.preventDefault(),this._toggleScaling()})))):(c.add(this.rotateButton,"esriCTDisabledParcelToolButton"),e.set(this.rotateButton,"tabindex","-1"),c.add(this.scaleButton,"esriCTDisabledParcelToolButton"),
e.set(this.scaleButton,"tabindex","-1"));this.own(d(this.rotationTxt,"keypress",b.hitch(this,function(a){(a.charCode||a.keyCode)===f.ENTER&&this.setRotation(this.rotationTxt.displayedValue)})));this.own(d(this.scaleTxt,"keypress",b.hitch(this,function(a){(a.charCode||a.keyCode)===f.ENTER&&this.setScale(this.scaleTxt.displayedValue)})))},setScale:function(a){var g=this.scaledValue;isNaN(Number(a))||(this.scaleTxt.set("value",Number(a)),this.scaleTxt.set("value",Number(this.scaleTxt.displayedValue)));
this.scaleTxt.isValid()?this.scaleGeometries():(this.scaleTxt.set("value",Number(g)),this.scaleTxt.set("value",Number(this.scaleTxt.displayedValue)))},scaleGeometries:function(){var a=Number(this.scaleTxt.get("value"));isNaN(a)||(this.scaledValue=a,this.emit("scaleGeometries",a))},setRotation:function(a){var g=this.rotationAngle;isNaN(Number(a))||(this.rotationTxt.set("value",Number(a)),this.rotationTxt.set("value",Number(this.rotationTxt.displayedValue)));this.rotationTxt.isValid()?this.rotateGeometries():
(this.rotationTxt.set("value",Number(g)),this.rotationTxt.set("value",Number(this.rotationTxt.displayedValue)))},rotateGeometries:function(){var a=Number(this.rotationTxt.get("value"));isNaN(a)||(this.rotationAngle=a,this.emit("rotateGeometries",a))},resetTools:function(){this.rotationAngle=0;this.scaledValue=1;this.rotationTxt.set("value",Number(0));this.scaleTxt.set("value",Number(1))},_toggleRotating:function(){c.contains(this.rotateButton.parentElement,"esriCTDisableButton")?(c.remove(this.rotateButton.parentElement,
"esriCTDisableButton"),e.set(this.rotateButton,"aria-pressed","true"),this.disableScaling(),this.emit("toggleRotating",!0)):(this.disableRotating(),this.emit("toggleRotating",!1))},_toggleScaling:function(){c.contains(this.scaleButton.parentElement,"esriCTDisableButton")?(c.remove(this.scaleButton.parentElement,"esriCTDisableButton"),e.set(this.scaleButton,"aria-pressed","true"),this.disableRotating(),this.emit("toggleScaling",!0)):(this.disableScaling(),this.emit("toggleScaling",!1))},disableRotating:function(){c.add(this.rotateButton.parentElement,
"esriCTDisableButton");e.set(this.rotateButton,"aria-pressed","false")},disableScaling:function(){c.add(this.scaleButton.parentElement,"esriCTDisableButton");e.set(this.scaleButton,"aria-pressed","false")}})});