(this["webpackJsonpmatx-react"]=this["webpackJsonpmatx-react"]||[]).push([[38],{1264:function(e,t){},1265:function(e,t){},1284:function(e,t){},1677:function(e,t,n){"use strict";n.r(t);var s=n(5),r=n(9),i=n(1),o=n.n(i),c=(n(207),n(27)),a=n(95),l=n(60),u=n(519),d=n(532),j=n(322),p=(n(1142),n(23)),b=n(22),O=n(29),m=n(30),h=n(196),f=(new(function(e){Object(O.a)(n,e);var t=Object(m.a)(n);function n(){var e;return Object(b.a)(this,n),(e=t.call(this,"/api/services")).adminBusinessServices=function(t){return e.post("/api/services/adminBusinessServices",{query:t})},e}return Object(p.a)(n)}(h.a)),n(57),new(function(e){Object(O.a)(n,e);var t=Object(m.a)(n);function n(){var e;return Object(b.a)(this,n),(e=t.call(this,"/api/userResponses/customerResponses")).customerResponses=function(t){return e.post("/api/userResponses/customerResponses",t)},e}return Object(p.a)(n)}(h.a))),v=n(1292),x=n(208),g=n(2),w=(Object(l.a)("h6")((function(e){return{margin:0,marginTop:"4px",fontWeight:"500",fontSize:"14px",color:e.theme.palette.primary.main}})),Object(l.a)("div")((function(e){var t,n=e.theme;return t={margin:"30px"},Object(r.a)(t,n.breakpoints.down("sm"),{margin:"16px"}),Object(r.a)(t,"& .breadcrumb",Object(r.a)({marginBottom:"30px"},n.breakpoints.down("sm"),{marginBottom:"16px"})),t}))),y=(Object(l.a)(u.a)((function(e){var t=e.theme;return Object(r.a)({display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",padding:"24px !important",background:t.palette.background.paper},t.breakpoints.down("sm"),{padding:"16px !important"})})),Object(l.a)("div")((function(e){var t=e.theme;return{display:"flex",flexWrap:"wrap",alignItems:"center","& small":{color:t.palette.text.secondary},"& .icon":{opacity:.6,fontSize:"44px",color:t.palette.primary.main}}})),v.e.create({page:{flexDirection:"row",backgroundColor:"#E4E4E4"},section:{margin:10,padding:10,flexGrow:1}}));t.default=function(e){var t,n,r,l=Object(c.g)().id,u=Object(c.f)(),p=Object(c.e)();console.log("LOCATIONS:",p);var b=Object(i.useState)(),O=Object(s.a)(b,2),m=O[0],h=O[1],k=Object(i.useState)(!1),S=Object(s.a)(k,2),R=S[0],N=S[1],A=o.a.useState(""),q=Object(s.a)(A,2),B=(q[0],q[1],o.a.useState(!1)),C=Object(s.a)(B,2),G=C[0],I=C[1];return o.a.useEffect((function(){l&&(N(!0),f.customerResponses({guestId:l}).then((function(e){console.log("UserResponseService:",e),h(e)})).catch((function(e){var t,n;console.log(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error),I(!0),x.b.error("No response found for this customer.")})).finally((function(){N(!1)})))}),[]),R?Object(g.jsx)(a.f,{}):Object(g.jsxs)(w,{children:[G&&Object(g.jsx)("p",{style:{color:"red"},children:"No response found for this customer. After filling form, this customer leaves the test."}),!G&&Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)(d.a,{container:!0,spacing:2,children:[Object(g.jsx)(d.a,{item:!0,lg:4,md:4,sm:12,xs:12,children:Object(g.jsx)(j.a,{variant:"outlined",onClick:function(){console.log("LOCAION:",p),u(p.state.prevPath)},children:"Go Back"})}),Object(g.jsx)(d.a,{item:!0,lg:8,md:8,sm:12,xs:12,style:{color:"orange"},children:Object(g.jsx)(v.c,{document:Object(g.jsx)(v.a,{children:Object(g.jsx)(v.d,{size:"A4",style:y.page,children:Object(g.jsx)(v.g,{style:y.section,children:m&&Object(g.jsxs)(v.g,{children:[Object(g.jsxs)(v.f,{children:["User name:"," ",(null===m||void 0===m||null===(t=m.guest)||void 0===t?void 0:t.firstName)+" "+(null===m||void 0===m||null===(n=m.guest)||void 0===n?void 0:n.lastName)]}),(null===m||void 0===m||null===(r=m.responses)||void 0===r?void 0:r.length)>0&&m.responses.map((function(e){var t;return Object(g.jsxs)(v.g,{children:[Object(g.jsx)(v.f,{children:Object(g.jsxs)("p",{children:["Question:"," ",Object(g.jsx)("b",{children:null===e||void 0===e||null===(t=e.question)||void 0===t?void 0:t.question})]})}),Object(g.jsx)(v.f,{children:Object(g.jsxs)("p",{children:["Answer:"," ",Object(g.jsx)("b",{children:null===e||void 0===e?void 0:e.answer})]})})]})})),(null===m||void 0===m?void 0:m.testGraph)&&Object(g.jsx)(v.b,{src:null===m||void 0===m?void 0:m.testGraph,alt:"Test Graph",width:"500px",height:"500px"})]})})})}),fileName:"test.pdf",children:function(e){e.blob,e.url;var t=e.loading;e.error;return t?"Loading document...":"Download result!"}})})]}),m&&m.responses.length>0&&Object(g.jsx)(a.m,{title:"User Responses",children:m.responses.map((function(e,t){var n;return Object(g.jsxs)(a.m,{children:[Object(g.jsxs)("p",{children:["Question:"," ",Object(g.jsx)("b",{children:null===e||void 0===e||null===(n=e.question)||void 0===n?void 0:n.question})]}),Object(g.jsxs)("p",{children:["Answer: ",Object(g.jsx)("b",{children:null===e||void 0===e?void 0:e.answer})]})]},t)}))})]})]})}}}]);
//# sourceMappingURL=38.1749c018.chunk.js.map