this.primereact=this.primereact||{},this.primereact.togglebutton=function(t,e,o,n,r){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var p=i(e);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var o=0;o0&&this.props.offLabel&&this.props.offLabel.length>0}},{key:"hasIcon",value:function(){return this.props.onIcon&&this.props.onIcon.length>0&&this.props.offIcon&&this.props.offIcon.length>0}},{key:"getLabel",value:function(){return this.hasLabel()?this.props.checked?this.props.onLabel:this.props.offLabel:" "}},{key:"componentDidMount",value:function(){this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(g({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=n.tip({target:this.container,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var t=this,e=o.classNames("p-button p-togglebutton p-component",{"p-button-icon-only":this.hasIcon()&&!this.hasLabel(),"p-highlight":this.props.checked,"p-disabled":this.props.disabled},this.props.className),n=null,i=this.hasIcon(),s=this.getLabel(),l=this.props.checked?this.props.onIcon:this.props.offIcon;return i&&(n=o.classNames("p-button-icon p-c",{"p-button-icon-left":"left"===this.props.iconPos&&s,"p-button-icon-right":"right"===this.props.iconPos&&s})),p.default.createElement("div",{ref:function(e){return t.container=e},id:this.props.id,className:e,style:this.props.style,onClick:this.toggle,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onKeyDown:this.onKeyDown,tabIndex:!this.props.disabled&&this.props.tabIndex,"aria-labelledby":this.props.ariaLabelledBy},i&&o.IconUtils.getJSXIcon(l,{className:n},{props:this.props}),p.default.createElement("span",{className:"p-button-label"},s),p.default.createElement(r.Ripple,null))}}])&&l(u.prototype,f),y&&l(u,y),Object.defineProperty(u,"prototype",{writable:!1}),v}(e.Component);return y(v,"defaultProps",{id:null,onIcon:null,offIcon:null,onLabel:"Yes",offLabel:"No",iconPos:"left",style:null,className:null,checked:!1,tabIndex:0,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onChange:null,onFocus:null,onBlur:null}),t.ToggleButton=v,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.utils,primereact.tooltip,primereact.ripple);