(this.webpackJsonpsentimentanalyzer=this.webpackJsonpsentimentanalyzer||[]).push([[0],{10:function(t,e,n){},24:function(t,e,n){},25:function(t,e,n){},43:function(t,e,n){"use strict";n.r(e);var i=n(0),s=n(2),a=n.n(s),o=n(8),r=n.n(o),c=(n(24),n(3)),u=n(4),l=n(6),d=n(5),m=(n(10),n(25),function(t){Object(l.a)(n,t);var e=Object(d.a)(n);function n(){return Object(c.a)(this,n),e.apply(this,arguments)}return Object(u.a)(n,[{key:"render",value:function(){return Object(i.jsxs)("div",{children:["let emotionsArray = Object.entries(this.props.emotions)  ; let tableEmotions = emotionsArray.map((tableEmotion)=>",Object.entries(this.props.emotions).map((function(t){return Object(i.jsxs)("tr",{children:[Object(i.jsx)("td",{children:t[0]}),Object(i.jsx)("td",{children:t[1]})]})})),");"]})}}]),n}(a.a.Component)),j=n(9),b=n.n(j),x=function(t){Object(l.a)(n,t);var e=Object(d.a)(n);function n(){var t;Object(c.a)(this,n);for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return(t=e.call.apply(e,[this].concat(a))).state={innercomp:Object(i.jsx)("textarea",{rows:"4",cols:"50",id:"textinput"}),mode:"text",sentimentOutput:[],sentiment:!0},t.renderTextArea=function(){document.getElementById("textinput").value="","url"===t.state.mode&&t.setState({innercomp:Object(i.jsx)("textarea",{rows:"4",cols:"50",id:"textinput"}),mode:"text",sentimentOutput:[],sentiment:!0})},t.renderTextBox=function(){document.getElementById("textinput").value="","text"===t.state.mode&&t.setState({innercomp:Object(i.jsx)("textarea",{rows:"1",cols:"50",id:"textinput"}),mode:"url",sentimentOutput:[],sentiment:!0})},t.sendForSentimentAnalysis=function(){t.setState({sentiment:!0});var e=".";e="url"===t.state.mode?e+"/url/sentiment?url="+document.getElementById("textinput").value:e+"/text/sentiment?text="+document.getElementById("textinput").value,b.a.get(e).then((function(e){t.setState({sentimentOutput:e.data});var n=e.data;n="positive"===e.data?Object(i.jsx)("div",{style:{color:"green",fontSize:20},children:e.data}):"negative"===e.data?Object(i.jsx)("div",{style:{color:"red",fontSize:20},children:e.data}):Object(i.jsx)("div",{style:{color:"orange",fontSize:20},children:e.data}),t.setState({sentimentOutput:n})}))},t.sendForEmotionAnalysis=function(){t.setState({sentiment:!1});var e=".";e="url"===t.state.mode?e+"/url/emotion?url="+document.getElementById("textinput").value:e+"/text/emotion/?text="+document.getElementById("textinput").value,b.a.get(e).then((function(e){t.setState({sentimentOutput:Object(i.jsx)(m,{emotions:e.data})})}))},t}return Object(u.a)(n,[{key:"render",value:function(){return Object(i.jsxs)("div",{className:"App",children:[Object(i.jsx)("button",{className:"btn btn-info",onClick:this.renderTextArea,children:"Text"}),Object(i.jsx)("button",{className:"btn btn-dark",onClick:this.renderTextBox,children:"URL"}),Object(i.jsx)("br",{}),Object(i.jsx)("br",{}),this.state.innercomp,Object(i.jsx)("br",{}),Object(i.jsx)("button",{className:"btn-primary",onClick:this.sendForSentimentAnalysis,children:"Analyze Sentiment"}),Object(i.jsx)("button",{className:"btn-primary",onClick:this.sendForEmotionAnalysis,children:"Analyze Emotion"}),Object(i.jsx)("br",{}),Object(i.jsx)("div",{children:this.state.sentimentOutput})]})}}]),n}(a.a.Component),p=function(t){t&&t instanceof Function&&n.e(3).then(n.bind(null,44)).then((function(e){var n=e.getCLS,i=e.getFID,s=e.getFCP,a=e.getLCP,o=e.getTTFB;n(t),i(t),s(t),a(t),o(t)}))};r.a.render(Object(i.jsx)(a.a.StrictMode,{children:Object(i.jsx)(x,{})}),document.getElementById("root")),p()}},[[43,1,2]]]);
//# sourceMappingURL=main.be985407.chunk.js.map