$.widget("ui.RadioGroup",{options:{options:[],defaultValue:"",name:"",onchange:$.noop},_create:function(){var e=this.element,i=this,o=$.utils.getRandom(1e4),n=this.options.options,t=this.options.name||"radio-"+o;n.forEach&&n.forEach(function(n){var a,l,u;if(n&&"object"==typeof n){a=n.value;l=n.label;u=n.id}else{a=n;l=i18n(n);u=n}void 0===u&&(u=a);u+=o;$("<input id = '"+u+"' type = 'radio' name = '"+t+"' value = '"+a+"'/><label for = '"+u+"'>"+l+"</label>").appendTo(e).first().customInput().click(function(){i.options.onchange&&i.options.onchange(a)}).parent().css("width","auto")});n.defaultValue&&this.value(n.defaultValue)},value:function(e){if(void 0===e)return this.element.find("input:checked").attr("value");this.element.find("input[value = '"+e+"']").customInput("checked",!0);return void 0},checkedLabel:function(){return this.element.find("input:checked").next().text()}});$.widget("ui.RadioGroupWithToggler",{options:{options:[],defaultValue:"",name:"",onchange:$.noop,togglerClass:"",iconClass:"",radioGroupClass:""},_create:function(){var e=this.element,i=this,o=this.options;e.append("<div class = 'toggler "+(o.togglerClass||"")+"'><span class = 'ui-icon ui-icon-triangle-1-s "+(o.iconClass||"")+"'></span><span class = 'text'></span></div><div class = 'radio-group "+(o.radioGroupClass||"")+"'></div>");e.find(".toggler").click(function(){$(this).toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-se");e.find(".radio-group").toggle()});e.find(".radio-group").RadioGroup({options:o.options,name:o.name,defaultValue:o.defaultValue,onchange:function(e){i.value(e);o.onchange&&o.onchange(e)}})},value:function(e){var i=this.element.find(".radio-group");if(void 0===e)return i.RadioGroup("value");i.RadioGroup("value",e);this.element.find(".toggler .text").text(i.RadioGroup("checkedLabel"))}});