text: (function(){var a=[].slice;!function(b,c){"use strict";var d;d=function(){function a(a,c){null==c&&(c={}),this.$element=b(a),this.options=b.extend({},b.fn.bootstrapSwitch.defaults,{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class"),radioAllOff:this.$element.data("radio-all-off")},c),this.$wrapper=b("<div>",{class:function(a){return function(){var b;return b=[""+a.options.baseClass].concat(a._getClasses(a.options.wrapperClass)),b.push(a.options.state?a.options.baseClass+"-on":a.options.baseClass+"-off"),null!=a.options.size&&b.push(a.options.baseClass+"-"+a.options.size),a.options.animate&&b.push(a.options.baseClass+"-animate"),a.options.disabled&&b.push(a.options.baseClass+"-disabled"),a.options.readonly&&b.push(a.options.baseClass+"-readonly"),a.options.indeterminate&&b.push(a.options.baseClass+"-indeterminate"),a.$element.attr("id")&&b.push(a.options.baseClass+"-id-"+a.$element.attr("id")),b.join(" ")}}(this)()}),this.$container=b("<div>",{class:this.options.baseClass+"-container"}),this.$on=b("<span>",{html:this.options.onText,class:this.options.baseClass+"-handle-on "+this.options.baseClass+"-"+this.options.onColor}),this.$off=b("<span>",{html:this.options.offText,class:this.options.baseClass+"-handle-off "+this.options.baseClass+"-"+this.options.offColor}),this.$label=b("<label>",{html:this.options.labelText,class:this.options.baseClass+"-label"}),this.options.indeterminate&&this.$element.prop("indeterminate",!0),this.$element.on("init.bootstrapSwitch",function(b){return function(){return b.options.onInit.apply(a,arguments)}}(this)),this.$element.on("switchChange.bootstrapSwitch",function(b){return function(){return b.options.onSwitchChange.apply(a,arguments)}}(this)),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.$on).before(this.$label).before(this.$off).trigger("init.bootstrapSwitch"),this._elementHandlers(),this._handleHandlers(),this._labelHandlers(),this._formHandler()}return a.prototype._constructor=a,a.prototype.state=function(a,b){return void 0===a?this.options.state:this.options.disabled||this.options.readonly||this.options.indeterminate?this.$element:this.options.state&&!this.options.radioAllOff&&this.$element.is(":radio")?this.$element:(a=!!a,this.$element.prop("checked",a).trigger("change.bootstrapSwitch",b),this.$element)},a.prototype.toggleState=function(a){return this.options.disabled||this.options.readonly||this.options.indeterminate?this.$element:this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",a)},a.prototype.size=function(a){return void 0===a?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(this.options.baseClass+"-"+this.options.size),a&&this.$wrapper.addClass(this.options.baseClass+"-"+a),this.options.size=a,this.$element)},a.prototype.animate=function(a){return void 0===a?this.options.animate:(a=!!a,this.$wrapper[a?"addClass":"removeClass"](this.options.baseClass+"-animate"),this.options.animate=a,this.$element)},a.prototype.disabled=function(a){return void 0===a?this.options.disabled:(a=!!a,this.$wrapper[a?"addClass":"removeClass"](this.options.baseClass+"-disabled"),this.$element.prop("disabled",a),this.options.disabled=a,this.$element)},a.prototype.toggleDisabled=function(){return this.$element.prop("disabled",!this.options.disabled),this.$wrapper.toggleClass(this.options.baseClass+"-disabled"),this.options.disabled=!this.options.disabled,this.$element},a.prototype.readonly=function(a){return void 0===a?this.options.readonly:(a=!!a,this.$wrapper[a?"addClass":"removeClass"](this.options.baseClass+"-readonly"),this.$element.prop("readonly",a),this.options.readonly=a,this.$element)},a.prototype.toggleReadonly=function(){return this.$element.prop("readonly",!this.options.readonly),this.$wrapper.toggleClass(this.options.baseClass+"-readonly"),this.options.readonly=!this.options.readonly,this.$element},a.prototype.indeterminate=function(a){return void 0===a?this.options.indeterminate:(a=!!a,this.$wrapper[a?"addClass":"removeClass"](this.options.baseClass+"-indeterminate"),this.$element.prop("indeterminate",a),this.options.indeterminate=a,this.$element)},a.prototype.toggleIndeterminate=function(){return this.$element.prop("indeterminate",!this.options.indeterminate),this.$wrapper.toggleClass(this.options.baseClass+"-indeterminate"),this.options.indeterminate=!this.options.indeterminate,this.$element},a.prototype.onColor=function(a){var b;return b=this.options.onColor,void 0===a?b:(null!=b&&this.$on.removeClass(this.options.baseClass+"-"+b),this.$on.addClass(this.options.baseClass+"-"+a),this.options.onColor=a,this.$element)},a.prototype.offColor=function(a){var b;return b=this.options.offColor,void 0===a?b:(null!=b&&this.$off.removeClass(this.options.baseClass+"-"+b),this.$off.addClass(this.options.baseClass+"-"+a),this.options.offColor=a,this.$element)},a.prototype.onText=function(a){return void 0===a?this.options.onText:(this.$on.html(a),this.options.onText=a,this.$element)},a.prototype.offText=function(a){return void 0===a?this.options.offText:(this.$off.html(a),this.options.offText=a,this.$element)},a.prototype.labelText=function(a){return void 0===a?this.options.labelText:(this.$label.html(a),this.options.labelText=a,this.$element)},a.prototype.baseClass=function(a){return this.options.baseClass},a.prototype.wrapperClass=function(a){return void 0===a?this.options.wrapperClass:(a||(a=b.fn.bootstrapSwitch.defaults.wrapperClass),this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" ")),this.$wrapper.addClass(this._getClasses(a).join(" ")),this.options.wrapperClass=a,this.$element)},a.prototype.radioAllOff=function(a){return void 0===a?this.options.radioAllOff:(this.options.radioAllOff=a,this.$element)},a.prototype.onInit=function(a){return void 0===a?this.options.onInit:(a||(a=b.fn.bootstrapSwitch.defaults.onInit),this.options.onInit=a,this.$element)},a.prototype.onSwitchChange=function(a){return void 0===a?this.options.onSwitchChange:(a||(a=b.fn.bootstrapSwitch.defaults.onSwitchChange),this.options.onSwitchChange=a,this.$element)},a.prototype.destroy=function(){var a;return a=this.$element.closest("form"),a.length&&a.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element},a.prototype._elementHandlers=function(){return this.$element.on({"change.bootstrapSwitch":function(a){return function(c,d){var e;if(c.preventDefault(),c.stopImmediatePropagation(),(e=a.$element.is(":checked"))!==a.options.state)return a.options.state=e,a.$wrapper.removeClass(e?a.options.baseClass+"-off":a.options.baseClass+"-on").addClass(e?a.options.baseClass+"-on":a.options.baseClass+"-off"),d?void 0:(a.$element.is(":radio")&&b("[name='"+a.$element.attr("name")+"']").not(a.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),a.$element.trigger("switchChange.bootstrapSwitch",[e]))}}(this),"focus.bootstrapSwitch":function(a){return function(b){return b.preventDefault(),a.$wrapper.addClass(a.options.baseClass+"-focused")}}(this),"blur.bootstrapSwitch":function(a){return function(b){return b.preventDefault(),a.$wrapper.removeClass(a.options.baseClass+"-focused")}}(this),"keydown.bootstrapSwitch":function(a){return function(b){if(b.which&&!a.options.disabled&&!a.options.readonly&&!a.options.indeterminate)switch(b.which){case 37:return b.preventDefault(),b.stopImmediatePropagation(),a.state(!1);case 39:return b.preventDefault(),b.stopImmediatePropagation(),a.state(!0)}}}(this)})},a.prototype._handleHandlers=function(){return this.$on.on("click.bootstrapSwitch",function(a){return function(b){return a.state(!1),a.$element.trigger("focus.bootstrapSwitch")}}(this)),this.$off.on("click.bootstrapSwitch",function(a){return function(b){return a.state(!0),a.$element.trigger("focus.bootstrapSwitch")}}(this))},a.prototype._labelHandlers=function(){return this.$label.on({"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function(a){return function(b){var c,d,e,f;if(a.isLabelDragging)return b.preventDefault(),a.isLabelDragged=!0,d=b.pageX||b.originalEvent.touches[0].pageX,e=(d-a.$wrapper.offset().left)/a.$wrapper.width()*100,c=25,f=75,a.options.animate&&a.$wrapper.removeClass(a.options.baseClass+"-animate"),e<c?e=c:e>f&&(e=f),a.$container.css("margin-left",e-f+"%"),a.$element.trigger("focus.bootstrapSwitch")}}(this),"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function(a){return function(b){if(!(a.isLabelDragging||a.options.disabled||a.options.readonly||a.options.indeterminate))return b.preventDefault(),a.isLabelDragging=!0,a.$element.trigger("focus.bootstrapSwitch")}}(this),"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function(a){return function(b){if(a.isLabelDragging)return b.preventDefault(),a.isLabelDragged?(a.isLabelDragged=!1,a.state(parseInt(a.$container.css("margin-left"),10)>-a.$container.width()/6),a.options.animate&&a.$wrapper.addClass(a.options.baseClass+"-animate"),a.$container.css("margin-left","")):a.state(!a.options.state),a.isLabelDragging=!1}}(this),"mouseleave.bootstrapSwitch":function(a){return function(b){return a.$label.trigger("mouseup.bootstrapSwitch")}}(this)})},a.prototype._formHandler=function(){var a;if(a=this.$element.closest("form"),!a.data("bootstrap-switch"))return a.on("reset.bootstrapSwitch",function(){return c.setTimeout(function(){return a.find("input").filter(function(){return b(this).data("bootstrap-switch")}).each(function(){return b(this).bootstrapSwitch("state",this.checked)})},1)}).data("bootstrap-switch",!0)},a.prototype._getClasses=function(a){var c,d,e,f;if(!b.isArray(a))return[this.options.baseClass+"-"+a];for(d=[],e=0,f=a.length;e<f;e++)c=a[e],d.push(this.options.baseClass+"-"+c);return d},a}(),b.fn.bootstrapSwitch=function(){var c,e,f;return e=arguments[0],c=2<=arguments.length?a.call(arguments,1):[],f=this,this.each(function(){var a,g;if(a=b(this),g=a.data("bootstrap-switch"),g||a.data("bootstrap-switch",g=new d(this,e)),"string"==typeof e)return f=g[e].apply(g,c)}),f},b.fn.bootstrapSwitch.Constructor=d,b.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:"&nbsp;",baseClass:"bootstrap-switch",wrapperClass:"wrapper",radioAllOff:!1,onInit:function(){},onSwitchChange:function(){}}}(window.jQuery,window)}).call(this);