// 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/FontSetting.html":'\x3cdiv class\x3d"style-selector"\x3e\r\n  \x3cdiv class\x3d"setting-items font clearFix" data-dojo-attach-point\x3d"fontSetting"\x3e\r\n    \x3cdiv class\x3d"label-position jimu-float-leading" title\x3d"${nls.font}"\x3e${nls.font}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cselect data-dojo-attach-point\x3d"fontSelect" data-dojo-props\x3d\'style:{width:"100%"}\' data-dojo-type\x3d"dijit/form/Select"\x3e\x3c/select\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"setting-items text-size clearFix" data-dojo-attach-point\x3d"textSizeSetting"\x3e\r\n    \x3cdiv class\x3d"label-position jimu-float-leading" title\x3d"${nls.textSize}"\x3e${nls.textSize}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cdiv class\x3d"text-size-group jimu-float-leading"\x3e\r\n        \x3cselect data-dojo-type\x3d"dijit/form/ComboBox" data-dojo-attach-point\x3d"textSizeSelect"\x3e\x3c/select\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"text-size-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"sliderbar" data-dojo-attach-point\x3d"sliderBar"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"setting-items text-color clearFix" data-dojo-attach-point\x3d"textColorSetting"\x3e\r\n    \x3cdiv class\x3d"label-position jimu-float-leading" title\x3d"${nls.textColor}"\x3e${nls.textColor}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cdiv class\x3d"font-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"text-color-btn" data-dojo-attach-point\x3d"textColorBtn"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"font-group font-group-btns jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"font-btn jimu-float-leading bold" data-dojo-attach-point\x3d"bold"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"font-btn jimu-float-leading italic" data-dojo-attach-point\x3d"italic"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"font-btn jimu-float-leading underline" data-dojo-attach-point\x3d"underline"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/lang dojo/on dojo/_base/html dojo/_base/array jimu/utils dojo/Evented dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./FontSetting.html jimu/dijit/ColorPickerPopup dijit/form/HorizontalSlider dojo/store/Memory dijit/form/NumberSpinner jimu/dijit/CheckBox jimu/dijit/ImageChooser dijit/form/Select".split(" "),function(h,d,e,c,k,g,l,m,n,p,q,r,t,u){return h([m,n,p,l],{templateString:q,nls:null,_FONTS:null,_MIN_TEXT_SIZE:12,_MAX_TEXT_SIZE:60,
_INTERVAL_TEXT_SIZE:2,_DEFAULT_CONFIG:null,postCreate:function(){this.inherited(arguments);this._FONTS="Arial;Comic Sans MS;Courier New;Garamond;Tahoma;Times New Roman;Verdana".split(";");this._DEFAULT_CONFIG={font:{fontFamily:this._FONTS[0],bold:!1,italic:!1,underline:!1},fontSize:"24",textColor:"#282828"};this.config=d.mixin(d.clone(this._DEFAULT_CONFIG),this.config);k.forEach(this._FONTS,d.hitch(this,function(b){this.fontSelect.addOption({value:b,label:b})}));for(var a=new u({}),f=this._MIN_TEXT_SIZE,
v=this._MAX_TEXT_SIZE;f<=v;f+=this._INTERVAL_TEXT_SIZE)a.put({id:f,name:f});this.textSizeSelect.store=a;this.textSizeSelect.validator=d.hitch(this,function(){var b=this.textSizeSelect.getValue();return null!==b&&""!==b?g.isLocalizedNumber(b):!1});this.textSizeSlider=new t({name:"slider",value:0,minimum:this._MIN_TEXT_SIZE,maximum:this._MAX_TEXT_SIZE,discreteValues:this._MAX_TEXT_SIZE-this._MIN_TEXT_SIZE+1,intermediateChanges:!0,showButtons:!1,style:"display: inline-block;"},this.sliderBar);this.textSizeSlider.startup();
this.textColorPicker=new r({appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showCoustomRecord:!0},recordUID:this.recordUID});this.textColorPicker.placeAt(this.textColorBtn);this.textColorPicker.startup();this.own(e(this.fontSelect,"change",d.hitch(this,function(b){if(this.config.font.fontFamily!==b)this.onSettingChange({font:{fontFamily:b,bold:this.config.font.bold,italic:this.config.font.italic,underline:this.config.font.underline}})})));this._initAppearance();this.own(e(this.bold,
"click",d.hitch(this,function(){var b=!c.hasClass(this.bold,"selected");this.fontBtnClickd({bold:b});this.onSettingChange({font:{fontFamily:this.config.font.fontFamily,bold:b,italic:this.config.font.italic,underline:this.config.font.underline}})})));this.own(e(this.italic,"click",d.hitch(this,function(){var b=!c.hasClass(this.italic,"selected");this.fontBtnClickd({italic:b});this.onSettingChange({font:{fontFamily:this.config.font.fontFamily,bold:this.config.font.bold,italic:b,underline:this.config.font.underline}})})));
this.own(e(this.underline,"click",d.hitch(this,function(){var b=!c.hasClass(this.underline,"selected");this.fontBtnClickd({underline:b});this.onSettingChange({font:{fontFamily:this.config.font.fontFamily,bold:this.config.font.bold,italic:this.config.font.italic,underline:b}})})));this.own(e(this.textSizeSelect,"change",d.hitch(this,function(b){this.config.fontSize!==b&&!1!==this.textSizeSelect.isValid()&&(this.setTextSize(b),this.onSettingChange({fontSize:g.parseNumberToUSENFormat(b)}))})));this.own(e(this.textSizeSlider,
"change",d.hitch(this,function(b){this.config.fontSize!==b&&(this.setTextSize(b),this.onSettingChange({fontSize:b}))})));this.own(e(this.textColorPicker,"change",d.hitch(this,function(b){if(this.config.textColor!==b)this.onSettingChange({textColor:b.toHex()})})))},startup:function(){this.inherited(arguments);this.setConfig(this.config);this.refresh()},onSettingChange:function(a){this.config=d.mixin(this.config,a);this.onChange(this.config)},onChange:function(a){this.emit("change",a)},refresh:function(){this.onSettingChange({})},
isValid:function(){return!1===this.textSizeSelect.isValid()?!1:!0},getConfig:function(){return this.isValid()?this.config:!1},setConfig:function(a){if("undefined"!==a){"undefined"!==typeof a.font&&(this.config.font=a.font,this.config.font.fontFamily&&this.fontSelect.set("value",this.config.font.fontFamily),this.fontBtnClickd(this.config.font));"undefined"!==typeof a.fontSize&&(this.config.fontSize=a.fontSize,this.setTextSize(this.config.fontSize));if("undefined"===typeof a.textColor||""===a.textColor)a.textColor=
this._DEFAULT_CONFIG.textColor;this.config.textColor=a.textColor;c.setStyle(this.textColorPicker.domNode,"backgroundColor",this.config.textColor);this.textColorPicker.picker.refreshRecords();this.textColorPicker.picker.setColor(this.config.textColor,!1,!0)}},setTextSize:function(a){var f=g.localizeNumber(a);f!==this.textSizeSelect.getValue()&&this.textSizeSelect.set("value",f);a=g.parseNumberToUSENFormat(a);a!==this.textSizeSlider.getValue()&&(a>this._MAX_TEXT_SIZE?a=this._MAX_TEXT_SIZE:a<this._MIN_TEXT_SIZE&&
(a=this._MIN_TEXT_SIZE),this.textSizeSlider.set("value",a))},fontBtnClickd:function(a){!0===a.bold?c.addClass(this.bold,"selected"):!1===a.bold&&c.removeClass(this.bold,"selected");!0===a.italic?c.addClass(this.italic,"selected"):!1===a.italic&&c.removeClass(this.italic,"selected");!0===a.underline?c.addClass(this.underline,"selected"):!1===a.underline&&c.removeClass(this.underline,"selected")},_initAppearance:function(){this.appearance&&(!1===this.appearance.bold&&c.addClass(this.bold,"hide"),!1===
this.appearance.italic&&c.addClass(this.italic,"hide"),!1===this.appearance.underline&&c.addClass(this.underline,"hide"))}})});