/*! For license information please see dll.160.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[160],{1059:function(e,t,n){"use strict";n.r(t);var a=n(13),r=n.n(a),c=n(12),i=n.n(c),l=n(6),s=n.n(l),o=n(14),u=n.n(o),f=n(15),d=n.n(f),p=n(8),m=n.n(p),h=n(5),v=n.n(h),E=n(0),b=n.n(E),y=n(1),g=n.n(y),w=n(24),R=n(173),k=n(19),S=n.n(k),C=n(74),_=n(20),I=n(73);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=m()(e);if(t){var r=m()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return d()(this,n)}}var D=function(e){if(e){var t=e.map((function(e,t){return b.a.createElement("tr",{key:t},b.a.createElement("td",null,S()(e.trigger)?e.trigger.join(", "):e.trigger),b.a.createElement("td",null,e.description))}));return b.a.createElement(R.default,{style:{fontSize:10},id:"voice_control_tooltip"},b.a.createElement("p",null,b.a.createElement("b",null,"Available voice commands:")),b.a.createElement("table",{className:"table table-bordered table-condensed"},b.a.createElement("thead",null,b.a.createElement("tr",null,b.a.createElement("th",null,"Command(s)"),b.a.createElement("th",null,"Description"))),b.a.createElement("tbody",null,t)),b.a.createElement("p",null,"Click to set component as active"))}return null},A=function(e){u()(n,e);var t=x(n);function n(e,a){var c;return r()(this,n),c=t.call(this,e),v()(s()(c),"setInactive",(function(){c.setState({active:!1})})),v()(s()(c),"setActive",(function(){c.setState({active:!0})})),v()(s()(c),"handleClick",(function(){c.state.active?c.setInactive():c.context.speechInterface.setActive(c.props.id)})),c.state={active:!1,show:!!a&&a.voiceRecordingStatus},c}return i()(n,[{key:"componentDidMount",value:function(){var e=this,t=this.context;t&&(t.speechInterface.register({name:this.props.id,reference:this.props.reference,commands:this.props.commands,control:this}),this.unsubscribe=t.subscribe((function(t,n){t===I.VOICE_RECORDING_STATUS&&e.setState({show:n})})))}},{key:"render",value:function(){if(!this.props.id||this.props.hide||!this.state.show)return null;var e=this.state.active?"success":"default";return b.a.createElement(C.default,{placement:"left",overlay:D(this.props.commands)},b.a.createElement(w.default,{style:{boxShadow:"none",float:"right"},variant:e,onClick:this.handleClick,size:"sm"},b.a.createElement("div",{className:"fa fa-phone"}),b.a.createElement("span",{style:{marginLeft:4}},this.props.id)))}}]),n}(E.Component);A.propTypes={id:g.a.string,commands:g.a.array.isRequired,hide:g.a.bool,reference:g.a.object.isRequired},A.defaultProps={id:null,hide:!1},A.contextType=_.default,t.default=A}}]);