// 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/Infographic/setting/dijitsSetting/_dijits/Mark/MarkArea.html":'\x3cdiv\x3e\r\n\t\x3cdiv class\x3d"mark-row"\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e${nls.valueString}\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e\r\n\t\t\t\x3cdiv class\x3d"text-2-text"\x3e\r\n\t\t\t\t\x3cinput class\x3d"mark-input text-2" data-dojo-type\x3d"dijit/form/NumberTextBox" required  data-dojo-attach-point\x3d"valInput1" data-dojo-attach-event\x3d"change:_onValueChanged" /\x3e\r\n\t\t\t\t\x3cdiv class\x3d"t-to-t textOverFlow" title\x3d"${nls.toString}"\x3e${nls.toString}\x3c/div\x3e\r\n\t\t\t\t\x3cinput class\x3d"mark-input text-2" data-dojo-type\x3d"dijit/form/NumberTextBox" required  data-dojo-attach-point\x3d"valInput2" data-dojo-attach-event\x3d"change:_onValueChanged" /\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\r\n\t\x3cdiv class\x3d"mark-row"\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e${nls.labelString}\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e\r\n\t\t\t\x3cinput class\x3d"mark-input" data-dojo-type\x3d"dijit/form/TextBox" data-dojo-attach-point\x3d"labelInput" data-dojo-attach-event\x3d"change:_onChange" /\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\r\n\t\x3cdiv class\x3d"mark-row"\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e${nls.labelColor}\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e\r\n\t\t\t\x3cdiv data-dojo-attach-point\x3d"labelColor" data-dojo-type\x3d"widgets/Infographic/setting/dijitsSetting/_dijits/ChartColorSetting" data-dojo-attach-event\x3d"change:_onChange"\x3e\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\r\n\t\x3cdiv class\x3d"mark-row"\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e${nls.labelPosition}\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d"mark-col flex-center-sb"\x3e\r\n\t\t\t\x3cdiv class\x3d"left-pos"\x3e\r\n\t\t\t\t\x3cselect data-dojo-attach-point\x3d"posSelect" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-event\x3d"change:_onChange" class\x3d"restrict-select-width mark-select-width"\x3e\r\n\t\t\t\t\t\x3coption value\x3d"left"\x3e${nls.left}\x3c/option\x3e\r\n\t\t\t\t\t\x3coption value\x3d"top"\x3e${nls.top}\x3c/option\x3e\r\n\t\t\t\t\t\x3coption value\x3d"right"\x3e${nls.right}\x3c/option\x3e\r\n\t\t\t\t\t\x3coption value\x3d"bottom"\x3e${nls.bottom}\x3c/option\x3e\r\n\t\t\t\t\x3c/select\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"right-loc flex-center-sb"\x3e\r\n\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"insideBtn" data-dojo-attach-event\x3d"click:_oninsideClicked" class\x3d"box box-2 box-style textOverFlow jimu-auto-vertical" title\x3d"${nls.inString}"\x3e${nls.inString}\x3c/div\x3e\r\n\t\t\t\t\x3cdiv data-dojo-attach-event\x3d"click:_onoutsideClicked" data-dojo-attach-point\x3d"outsideBtn" class\x3d"box box-2 box-style clear-left-border textOverFlow jimu-auto-vertical" title\x3d"${nls.outString}"\x3e${nls.outString}\x3c/div\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\r\n\t\x3cdiv class\x3d"mark-row"\x3e\r\n\t\t\x3cdiv class\x3d"mark-col"\x3e${nls.areaColor}\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d"mark-col flex-center-sb"\x3e\r\n\t\t\t\x3cdiv class\x3d"left-clr"\x3e\r\n\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"areaColor" data-dojo-type\x3d"widgets/Infographic/setting/dijitsSetting/_dijits/ChartColorSetting" data-dojo-attach-event\x3d"change:_onChange"\x3e\x3c/div\x3e\r\n\t\t\t\x3c/div\x3e\r\n\t\t\t\x3cdiv data-dojo-attach-point\x3d"opacityDiv" class\x3d"right-opa"\x3e\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dijit/_WidgetBase dojo/Evented dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./MarkArea.html dijit/form/HorizontalSlider dojo/on dojo/_base/html dojo/_base/lang ../../../utils jimu/utils dijit/form/Select jimu/dijit/CheckBox dijit/form/TextBox dijit/form/NumberTextBox ../ChartColorSetting".split(" "),function(n,p,q,r,t,u,v,w,g,x,l,y){return n([p,q,r,t],{baseClass:"infographic-setting-mark-area",templateString:u,_defaultAreaColor:"#68D2E0",_defaultOpacity:.4,
postCreate:function(){this.inherited(arguments);this.ignoreEvent=!0;this._initDom();setTimeout(function(){this.ignoreEvent=!1}.bind(this),200);this.setConfig(this.config)},isValid:function(){return this.valInput1.isValid()&&this.valInput2.isValid()},_showInputError:function(){var a=this.valInput1.getErrorMessage();this.valInput1.displayMessage(a);a=this.valInput2.getErrorMessage();this.valInput2.displayMessage(a)},getConfig:function(){if(!this.isValid())return this._showInputError(),!1;var a=[{},
{}],b=this._getValue(),c=this.labelInput.get("value");c=y.sanitizeHTML(c);var d=this.labelColor.getSingleColor(),h=this.posSelect.get("value"),f=this._getSelectedLoaction(),k=this.areaColor.getSingleColor(),e=this.opacitySlider.get("value");e=e.toFixed(1);e=1-e;var m="bar"===this.chartType?"xAxis":"yAxis";a[1][m]=b[1];a[0][m]=b[0];a[0].name=c;b={show:!!c};b.position=this._splicingPosition(f,h);b.color=d;a[0].label=b;a[0].itemStyle={color:k,opacity:e};return a},_onChange:function(){if(!this.ignoreEvent){if(!this.isValid())return this._showInputError(),
!1;this.emit("change")}},_onValueChanged:function(){if(!this.ignoreEvent){var a=this._getValue();a&&(this.emit("value-change",a),this._onChange())}},_firstUpperCase:function(a){return"string"!==typeof a?a:a.replace(/^\S/,function(b){return b.toUpperCase()})},_splicingPosition:function(a,b){"inside"===a?(b=this._firstUpperCase(b),a+=b):a=b;return a},_getValue:function(){if(this.isValid()){var a=this.valInput1.get("value");a=Number(a);var b=this.valInput2.get("value");b=Number(b);a=[a,b];a.sort(function(c,
d){return c-d});return a}},setConfig:function(a){if(a&&a.length){this.ignoreEvent=!0;this._cleanUI();var b=a[0],c=a[1];if(b&&c){var d="bar"===this.chartType?"xAxis":"yAxis";a=b[d];c=c[d];d=b.name;var h=b.label&&b.label.color,f=this._splitPositionAttr(b.label&&b.label.position),k=f.pos;f=f.loc;var e=b.itemStyle&&b.itemStyle.color;b=b.itemStyle&&b.itemStyle.opacity;b=1-b;"undefined"!==typeof a&&this.valInput1.set("value",a);"undefined"!==typeof c&&this.valInput2.set("value",c);"undefined"!==typeof d&&
this.labelInput.set("value",d);"undefined"!==typeof h&&this.labelColor.setSingleColor(h);"undefined"!==typeof k&&l.updateOptions(this.posSelect,null,k);"undefined"!==typeof f&&this._selectLocation(f);"undefined"!==typeof e&&this.areaColor.setSingleColor(e);"undefined"!==typeof b&&this.opacitySlider.set("value",b);setTimeout(function(){this.ignoreEvent=!1}.bind(this),200)}}},_splitPositionAttr:function(a){if(!a)return{};if(-1<a.indexOf("inside")){var b="inside";a=a.replace("inside","");a=a.toLowerCase()}else b=
"outside";return{pos:a,loc:b}},_initDom:function(){this.opacitySlider=new v({name:"slider",value:0,minimum:0,maximum:1,discreteValues:10,intermediateChanges:!1,showButtons:!1,style:"margin: auto 0;"});this.own(w(this.opacitySlider,"change",x.hitch(this,this._onChange)));this.opacitySlider.placeAt(this.opacityDiv);this._cleanUI()},_cleanUI:function(){this.valInput1.set("value","");this.valInput2.set("value","");this.labelInput.set("value","");this.labelColor.setSingleColor(this.defaultColor);l.updateOptions(this.posSelect,
null,"top");this._selectLocation("inside");this.areaColor.setSingleColor(this._defaultAreaColor);this.opacitySlider.set("value",this._defaultOpacity)},_unselectlocBtns:function(){g.removeClass(this.insideBtn,"selected");g.removeClass(this.outsideBtn,"selected")},_getSelectedLoaction:function(){return g.hasClass(this.insideBtn,"selected")?"inside":"outside"},_selectLocation:function(a){this._unselectlocBtns();"inside"===a?g.addClass(this.insideBtn,"selected"):"outside"===a&&g.addClass(this.outsideBtn,
"selected");this._onChange()},_oninsideClicked:function(a){a.stopPropagation();this._selectLocation("inside")},_onoutsideClicked:function(a){a.stopPropagation();this._selectLocation("outside")}})});