(this.webpackJsonpec2=this.webpackJsonpec2||[]).push([[0],{110:function(e,t,n){},171:function(e,t,n){},172:function(e,t,n){},185:function(e,t){},187:function(e,t){},198:function(e,t){},200:function(e,t){},225:function(e,t){},227:function(e,t){},228:function(e,t){},23:function(e,t,n){},233:function(e,t){},235:function(e,t){},254:function(e,t){},266:function(e,t){},269:function(e,t){},321:function(e,t,n){"use strict";n.r(t);var s=n(0),r=n(1),i=n.n(r),c=n(32),a=n.n(c),o=(n(171),n(8)),d=(n(172),n.p+"static/media/logo.6dc9265c.png"),u=n(328),l=n(52),f=n.n(l),j=n(161),b=n(11),p=n(10),x=(n(110),"https://api.stage.pursuit.carolynleepllc.com/"),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return fetch(x+e,{headers:{Authorization:null!=t?"Bearer "+t:null}}).then((function(e){return e.json()}))},m=function(e,t){return fetch(x+e,{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(t)}).then((function(e){return e.json()}))},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return fetch(x+e,{headers:{Accept:"application/json","Content-Type":"application/json",Authorization:null!=n?"Bearer "+n:null},method:"POST",body:JSON.stringify(t)}).then((function(e){return e.json()}))},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return fetch(x+"answer",{headers:{Accept:"multipart/form-data",Authorization:null!=t?"Bearer "+t:null},method:"POST",body:e}).then((function(e){return e.json()}))};n(177);function w(e){var t=Object(r.useState)(""),n=Object(o.a)(t,2),i=n[0],c=n[1],a=Object(r.useState)(""),d=Object(o.a)(a,2),u=d[0],l=d[1],x=Object(r.useState)(""),O=Object(o.a)(x,2),h=O[0],g=O[1],w=function(){var t=Object(j.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:m("user/login",{login:i,password:u}).then((function(t){1==t.success?e.setSessionCookie(t.data.accessToken):g("Invalid email and/or password")}));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("div",{className:"card",style:{textAlign:"center",marginTop:"100px"},children:[Object(s.jsx)("div",{className:"text-danger",style:{marginBottom:"10px"},children:h}),Object(s.jsxs)("div",{className:"form-group has-feedback",children:[Object(s.jsx)("input",{name:"Email",className:"form-control",autoFocus:!0,placeholder:"email",value:i,onChange:function(e){var t=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);c(e.target.value),t.test(e.target.value)||""==i?g(""):g("Please enter a valid email")}}),Object(s.jsx)("span",{className:"form-control-feedback",children:Object(s.jsx)(b.a,{icon:p.c})})]}),Object(s.jsxs)("div",{className:"form-group has-feedback",children:[Object(s.jsx)("input",{type:"password",name:"Password",className:"form-control",placeholder:"password",value:u,onChange:function(e){return l(e.target.value)}}),Object(s.jsx)("span",{className:" form-control-feedback",children:Object(s.jsx)(b.a,{icon:p.d})})]}),Object(s.jsx)("button",{onClick:w,style:{marginTop:"20px"},children:"Sign In"})]})})}var v=n(9),y=n(330),I=(n(23),n(17)),q=(n(63),function(e){var t=Object(r.useState)(null),n=Object(o.a)(t,2),i=n[0],c=n[1],a=Object(r.useState)(null),d=Object(o.a)(a,2),u=d[0],l=d[1];return Object(r.useEffect)((function(){var t=setTimeout((function(){null!=u&&e.onChange(u)}),1e3);return function(){return clearTimeout(t)}}),[i]),Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[(e.answer.text===i||null===i)&&""!==e.answer.text&&null!=e.answer.text&&Object(s.jsx)("span",{style:{marginLeft:"-20px",position:"absolute",color:"#0569a9"},children:Object(s.jsx)(b.a,{icon:p.b})}),Object(s.jsx)("label",{children:Object(s.jsx)("input",{name:e.question.id,"answer-id":e.answer.id,type:(e.question.type,"text"),value:null!=i?i:e.answer.text,onChange:function(e){c(e.target.value),l(e)}})}),(0!==e.answers.filter((function(t){return t.questionId===e.question.id&&t.displayIndex===e.displayIndex})).findIndex((function(t){return t.id===e.answer.id}))||8===e.question.type&&e.answers.filter((function(t){return t.questionId===e.question.id&&t.displayIndex===e.displayIndex})).length>0)&&Object(s.jsx)("span",{style:{marginLeft:"5px"},className:"deleteFile",onClick:function(){e.DeleteExtraAnswer(e.answer.id)},children:Object(s.jsx)(b.a,{icon:p.e})})]})})}),A=function(e){return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsxs)("div",{className:"questionText",children:[e.question.displayText," ",e.question.required&&Object(s.jsx)("span",{style:{color:"#ff1526"},children:Object(s.jsx)(b.a,{icon:p.a})})]}),Object(s.jsx)("br",{}),e.answers.length>0&&e.answers.filter((function(t){return t.questionId==e.question.id&&t.formId==e.form.id&&t.displayIndex==e.displayIndex})).map((function(t){return Object(s.jsx)(q,{question:e.question,answer:t,onChange:e.onChange,displayIndex:e.displayIndex,DeleteExtraAnswer:e.DeleteExtraAnswer,answers:e.answers})}))]})},F=function(e){var t;return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsxs)("div",{className:"questionText",children:[e.question.displayText," ",e.question.required&&Object(s.jsx)("span",{style:{color:"#ff1526"},children:Object(s.jsx)(b.a,{icon:p.a})})]}),Object(s.jsx)("br",{}),null===(t=e.answers.filter((function(t){return t.questionId==e.question.id&&t.formId==e.form.id})))||void 0===t?void 0:t.map((function(t){return Object(s.jsxs)(s.Fragment,{children:[t.saved&&Object(s.jsx)("span",{style:{marginLeft:"-20px",position:"absolute",color:"#0569a9"},children:Object(s.jsx)(b.a,{icon:p.b})}),e.question.choices.map((function(n){var r;return Object(s.jsxs)(s.Fragment,{children:[" ",Object(s.jsxs)("label",{children:[Object(s.jsx)("input",{type:2===e.question.type?"radio":"checkbox","data-key":n.id,"answer-id":t.id,name:e.question.id,checked:2===e.question.type?t.text==n.id:!!(null===(r=t.text)||void 0===r?void 0:r.includes(n.id)),onChange:e.onChange.bind(undefined)},n.id),n.text]})]})}))]})}))]})},k=function(e){var t=e.onFileSelect,n=e.selectedFile,i=e.DeleteFile,c=Object(r.useRef)(null);return Object(s.jsxs)("div",{className:"file-uploader",children:[Object(s.jsx)("input",{type:"file",onChange:function(e){t(e.target.files)},ref:c,multiple:!0}),Object(s.jsx)("button",{style:{marginRight:"10px"},onClick:function(e){return c.current&&c.current.click()},children:"Upload File"}),Object(s.jsx)("br",{}),Object(s.jsx)("span",{style:{fontWeight:"500"},children:"Previously Uploaded For This Question:"}),Object(s.jsx)("br",{}),n.map((function(e){return null!=e.displayName&&Object(s.jsxs)(s.Fragment,{children:[" ",e.displayName," ",Object(s.jsx)("span",{className:"deleteFile",onClick:function(){i(e.id)},children:Object(s.jsx)(b.a,{icon:p.e})}),Object(s.jsx)("br",{})]})}))]})},S=function(e){var t,n=function(t,n){var s=t.find((function(e){return e.id===n})),r=(Array(s.files.length).fill(0),new FormData);r.append("answerId",n),r.append("questionId",s.questionId),r.append("formId",s.formId),r.append("text","");for(var i=0;i0&&Object(s.jsx)("span",{style:{marginLeft:"-20px",position:"absolute",color:"#0569a9"},children:Object(s.jsx)(b.a,{icon:p.b})}),Object(s.jsx)(k,{onFileSelect:function(s){return function(t,s){for(var r,i=Object(v.a)(e.selectedFiles),c=0;r=t[c];c++)i.find((function(e){return e.id===s})).files.push({displayName:r.name,id:0,file:r});e.setSelectedFiles(Object(v.a)(i)),n(i,s)}(s,t.id,t.formId,t.questionId)},selectedFile:t.files,DeleteFile:function(s){!function(t,s){var r=Object(v.a)(e.selectedFiles);r.find((function(e){return e.id===s})).files.splice(r.find((function(e){return e.id===s})).files.findIndex((function(e){return e.id===t})),1),e.setSelectedFiles(Object(v.a)(r)),n(r,s)}(s,t.id)}})]})}))]})},T=function(e){var t;return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsxs)("div",{className:"questionText",children:[e.question.displayText," ",e.question.required&&Object(s.jsx)("span",{style:{color:"#ff1526"},children:Object(s.jsx)(b.a,{icon:p.a})})]}),Object(s.jsx)("br",{}),null===(t=e.answers.filter((function(t){return t.questionId==e.question.id&&t.formId==e.form.id})))||void 0===t?void 0:t.map((function(t){return Object(s.jsxs)(s.Fragment,{children:[t.saved&&Object(s.jsx)("span",{style:{marginLeft:"-20px",position:"absolute",color:"#0569a9"},children:Object(s.jsx)(b.a,{icon:p.b})}),Object(s.jsx)("label",{children:Object(s.jsx)("select",{name:e.question.id,"answer-id":t.id,value:t.text,onChange:e.onChange.bind(undefined),children:e.question.choices.map((function(e){return Object(s.jsx)("option",{"data-key":e.id,value:e.id,children:e.text},e.id)}))})})]})}))]})},C=n(97),N=n.n(C),D=function(e){var t;return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsxs)("div",{className:"questionText",children:[e.question.displayText," ",e.question.required&&Object(s.jsx)("span",{style:{color:"#ff1526"},children:Object(s.jsx)(b.a,{icon:p.a})})]}),Object(s.jsx)("br",{}),null===(t=e.answers.filter((function(t){return t.questionId==e.question.id&&t.formId==e.form.id})))||void 0===t?void 0:t.map((function(t){return Object(s.jsxs)(s.Fragment,{children:[t.saved&&Object(s.jsx)("span",{style:{marginLeft:"-20px",position:"absolute",color:"#0569a9"},children:Object(s.jsx)(b.a,{icon:p.b})}),Object(s.jsx)(N.a,{selected:""!=t.text?new Date(t.text):new Date,onChange:function(n){return function(t,n){var s=e.answers;s.find((function(e){return e.id===t})).text=n.toISOString(),e.setAnswers(Object(v.a)(s)),e.submitAnswer(t)}(t.id,n)}},t.id)]})}))]})},E=(n(315),function(e){var t=Object(r.useState)(!1),n=Object(o.a)(t,2),i=n[0],c=n[1];return Object(r.useEffect)((function(){e.answer.length>0&&c(!0)}),[]),Object(r.useEffect)((function(){0===e.answer.length&&i&&e.AddAnotherAnswer(e.question.id)}),[i]),Object(s.jsxs)(s.Fragment,{children:[Object(s.jsxs)("div",{className:"questionText",children:[e.question.displayText," ",e.question.required&&Object(s.jsx)("span",{style:{color:"#ff1526"},children:Object(s.jsx)(b.a,{icon:p.a})})]}),Object(s.jsx)("br",{}),Object(s.jsxs)("label",{children:[Object(s.jsx)("input",{type:"checkbox","type-key":"Dependant",disabled:e.answer.length>1,name:e.question.id,checked:i,onChange:function(){i&&1===e.answer.length&&e.DeleteExtraAnswer(e.answer[0].id),i||0!==e.answer.length||e.AddAnotherAnswer(e.question.id),c(!i)}}),"Yes"]}),i&&Object(s.jsxs)(s.Fragment,{children:[e.question.additionalText,e.answer.map((function(t){return Object(s.jsx)(q,{question:e.question,answer:t,onChange:e.onChange,displayIndex:e.displayIndex,DeleteExtraAnswer:e.DeleteExtraAnswer,answers:e.answer})})),Object(s.jsx)("button",{onClick:function(){e.AddAnotherAnswer(e.question.id)},children:"Add Another One"}),Object(s.jsx)("br",{})]})]})}),P=function(e){var t=Object(r.useState)(e.answersDisplayOrder),n=Object(o.a)(t,2),i=n[0],c=(n[1],function(t){var n=e.answers;console.log(n);var s=n.filter((function(e){return e.questionId===t&&e.displayIndex===i})),r=s[s.length-1],c={id:Object(y.a)(),questionId:t,order:0,displayIndex:i,formId:e.form.id,text:"",saved:!1};void 0!=r&&(c={id:Object(y.a)(),questionId:r.questionId,order:r.order,displayIndex:r.displayIndex,formId:r.formId,text:""}),n.splice(n.indexOf(r)+1,0,c),e.setAnswers(Object(v.a)(n))}),a=function(t){var n=e.answers.find((function(e){return e.id===t})),s=new FormData;void 0!==n?(s.append("answerId",t),s.append("questionId",n.questionId),s.append("formId",n.formId),s.append("text",""),s.append("order",n.order),g(s,e.accessToken).then((function(n){if(!1===n.success)n.errors.map((function(e){return Object(I.b)(e)}));else{var s=e.answers;s.find((function(e){return e.id===t}));s.splice(s.findIndex((function(e){return e.id===t})),1),e.setAnswers(Object(v.a)(s))}}))):Object(I.b)("Something went wrong when saving your answer")},d=function(t){var n=e.answers;if(t.target.hasOwnProperty("checked"))if("radio"===t.target.getAttribute("type"))n.find((function(e){return e.id==t.target.getAttribute("answer-id")})).text=t.target.getAttribute("data-key"),n.find((function(e){return e.id==t.target.getAttribute("answer-id")})).saved=!1,u(t.target.getAttribute("answer-id"));else{var s,r=n.find((function(e){return e.id===t.target.getAttribute("answer-id")})).text;if(null===(s=r)||void 0===s?void 0:s.includes(t.target.getAttribute("data-key")))try{r.splice(r.indexOf(t.target.getAttribute("data-key")),1)}catch(i){r=r.replace(","+t.target.getAttribute("data-key"),"")}else try{r=r+","+t.target.getAttribute("data-key")}catch(c){r=[r,t.target.getAttribute("data-key")]}void 0!==n.find((function(e){return e.id===t.target.getAttribute("answer-id")}))&&(","===(r=r.replace("null",""))[0]&&(r=r.substring(1)),n.find((function(e){return e.id===t.target.getAttribute("answer-id")})).text=r,n.find((function(e){return e.id==t.target.getAttribute("answer-id")})).saved=!1,u(t.target.getAttribute("answer-id")))}else n.find((function(e){return e.id===t.target.getAttribute("answer-id")})).text=t.target.value,n.find((function(e){return e.id==t.target.getAttribute("answer-id")})).saved=!1,u(t.target.getAttribute("answer-id"));e.setAnswers(Object(v.a)(n))},u=function(t){var n=e.answers.find((function(e){return e.id===t})),s=new FormData;void 0!==n?(s.append("answerId",t),s.append("questionId",n.questionId),s.append("formId",n.formId),s.append("text",n.text),s.append("order",n.order),g(s,e.accessToken).then((function(n){if(!1===n.success)n.errors.map((function(e){return Object(I.b)(e)}));else{var s=Object(v.a)(e.answers);s.find((function(e){return e.id===t})).saved=!0,e.setAnswers(Object(v.a)(s))}}))):Object(I.b)("Something went wrong when saving your answer")};return void 0===e.question||null===e.question?null:1===e.question.type||4===e.question.type?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(A,{answers:e.answers,displayIndex:i,question:e.question,form:e.form,onChange:d,DeleteExtraAnswer:a}),e.question.allowMultiple&&Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("button",{onClick:function(){c(e.question.id)},children:"Add Another One"}),Object(s.jsx)("br",{})]}),Object(s.jsx)("hr",{})]}):2===e.question.type||3==e.question.type?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(F,{answers:e.answers,question:e.question,form:e.form,onChange:d}),Object(s.jsx)("hr",{})]}):6===e.question.type?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(S,{question:e.question,form:e.form,selectedFiles:e.selectedFiles,setSelectedFiles:e.setSelectedFiles,accessToken:e.accessToken}),Object(s.jsx)("hr",{})]}):5===e.question.type?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(T,{form:e.form,question:e.question,answers:e.answers,onChange:d}),Object(s.jsx)("hr",{})]}):7===e.question.type?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(D,{form:e.form,question:e.question,answers:e.answers,setAnswers:e.setAnswers,submitAnswer:u}),Object(s.jsx)("hr",{})]}):8===e.question.type?Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(E,{answer:e.answers.filter((function(t){return t.questionId==e.question.id&&t.formId==e.form.id})),displayIndex:i,question:e.question,form:e.form,onChange:d,DeleteExtraAnswer:a,AddAnotherAnswer:c}),Object(s.jsx)("hr",{})]}):Object(s.jsxs)(s.Fragment,{children:["Something is wrong with this question type, please contact our support staff",Object(s.jsx)("hr",{})]})},L=n(36),B=function e(t){var n=Object(r.useState)(t.index),i=Object(o.a)(n,2),c=i[0],a=i[1];return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)("hr",{}),Object(s.jsxs)("div",{className:"group",children:[Object(s.jsx)("div",{className:"groupText",children:t.group.name}),Object(s.jsx)("br",{}),t.group.items.map((function(n){switch(n.type){case 0:return Object(s.jsx)(P,{question:t.questions.find((function(e){return e.id===n.id})),answers:t.answers,form:t.form,setAnswers:t.setAnswers,selectedFiles:t.selectedFiles,setSelectedFiles:t.setSelectedFiles,accessToken:t.accessToken,answersDisplayOrder:c,setAnswersDisplayOrder:a});case 1:return Object(v.a)(Array(t.groups.find((function(e){return e.id==n.id})).repeat)).map((function(r,i){return Object(s.jsx)(e,{questions:t.questions,answers:t.answers,setAnswers:t.setAnswers,selectedFiles:t.selectedFiles,setSelectedFiles:t.setSelectedFiles,accessToken:t.accessToken,form:t.form,setGroups:t.setGroups,index:i,groups:t.groups,group:t.groups.find((function(e){return e.id===n.id}))})}))}}))]}),t.index+1===t.group.repeat&&Object(s.jsxs)("button",{onClick:function(){return function(e){var n=t.groups.findIndex((function(t){return t.id===e.id})),s=Object(L.a)(Object(L.a)({},e),{},{repeat:e.repeat+1}),r=Object(v.a)(t.groups);r[n]=s,t.setGroups(Object(v.a)(r));var i=t.answers,c=[];e.items.map((function(e){return t.answers.filter((function(t){return t.questionId===e.id})).map((function(e){return c.push(e)}))}));var a=0;c.map((function(e){e.displayIndex>a&&(a=e.displayIndex)})),c.map((function(e,t){e.displayIndex===a&&i.push({id:Object(y.a)(),questionId:e.questionId,order:e.order+1,displayIndex:e.displayIndex+1,formId:e.formId,text:"",saved:!1})})),t.setAnswers(i)}(t.group)},children:["Add Another Group ",t.group.name]}),0!=t.index&&Object(s.jsx)("button",{onClick:function(){!function(e,n){var s=t.groups.findIndex((function(t){return t.id===e.id})),r=Object(L.a)(Object(L.a)({},e),{},{repeat:e.repeat-1}),i=Object(v.a)(t.groups);i[s]=r,t.setGroups(Object(v.a)(i));var c=[];e.items.map((function(e){return t.answers.filter((function(t){return t.questionId===e.id})).map((function(e){return c.push(e)}))}));var a=0;c.map((function(e){e.displayIndex>a&&(a=e.displayIndex)})),c.map((function(e){if(e.displayIndex===n){var s=t.answers.find((function(t){return t.id===e.id})),r=new FormData;void 0!==s?(r.append("answerId",e.id),r.append("questionId",s.questionId),r.append("formId",s.formId),r.append("text",""),r.append("order",s.order),g(r,t.accessToken).then((function(n){if(!1===n.success)n.errors.map((function(e){return Object(I.b)(e)}));else{var s=t.answers;s.splice(s.findIndex((function(t){return t.id===e.id})),1);var r=s.filter((function(t){return t.questionId===e.questionId})),i=e.displayIndex;r.map((function(e){e.displayIndex>i&&(s.splice(s.findIndex((function(t){return t.id===e.id})),1,Object(L.a)(Object(L.a)({},e),{},{displayIndex:i})),i+=1)})),t.setAnswers(Object(v.a)(s))}}))):Object(I.b)("Something went wrong when saving your answer")}}))}(t.group,t.index)},children:" Delete Group"}),Object(s.jsx)("hr",{})]})};var G=function(e){var t=Object(r.useState)(null),n=Object(o.a)(t,2),i=n[0],c=n[1],a=Object(r.useState)(null),d=Object(o.a)(a,2),u=d[0],l=d[1],f=Object(r.useState)([]),j=Object(o.a)(f,2),b=j[0],p=j[1],x=Object(r.useState)([]),m=Object(o.a)(x,2),h=m[0],g=m[1],w=Object(r.useState)([]),q=Object(o.a)(w,2),A=q[0],F=q[1],k=Object(r.useState)(!1),S=Object(o.a)(k,2),T=S[0],C=S[1],N=function e(t,n,s,r,i){if(0==t.type){var c=n.find((function(e){return e.id===t.id}));if(6!==c.type){var a=A;if(0===a.filter((function(e){return e.questionId===c.id&&e.displayIndex===i})).length&&0===r.answers.filter((function(e){return e.questionId===c.id})).length){if(8===c.type)return;a.push({id:Object(y.a)(),questionId:c.id,order:i,displayIndex:i,formId:r.id,text:"",saved:!1})}else{var o=i,d=r.answers.filter((function(e){return e.questionId===c.id}));0===d.length&&(d=a.filter((function(e){return e.questionId===c.id&&e.displayIndex===i}))),d.sort((function(e,t){return e.order>t.order?1:-1})).map((function(e){void 0!=r.answers.find((function(t){return t.id===e.id}))&&void 0===a.find((function(t){return t.id===e.id}))&&a.push({id:e.id,questionId:e.questionId,order:e.order,displayIndex:o,formId:r.id,text:e.text,saved:!0}),o+=1}))}F(Object(v.a)(a))}else{var u=h;if(void 0===u.find((function(e){return e.questionId==c.id}))&&void 0===r.answers.find((function(e){return e.questionId===c.id})))u.push({id:Object(y.a)(),questionId:c.id,order:0,displayIndex:i,formId:r.id,files:[{displayName:"",id:0}],text:null});else{var l=r.answers.filter((function(e){return e.questionId===c.id})),f=i;0===l.length&&(l=u.filter((function(e){return e.questionId===c.id&&e.displayIndex===i}))),l.sort((function(e,t){return e.order>t.order?1:-1})).map((function(e){void 0!=r.answers.find((function(t){return t.id===e.id}))&&void 0===u.find((function(t){return t.id===e.id}))&&u.push({id:e.id,questionId:e.questionId,order:e.order,displayIndex:f,formId:r.id,files:e.attachments,text:null}),f+=1}))}g(Object(v.a)(u))}}else Object(v.a)(Array(s.find((function(e){return e.id==t.id})).repeat)).map((function(i,c){s.find((function(e){return e.id==t.id})).items.map((function(t){e(t,n,s,r,c)}))}))},D=function(){O("applicant",e.accessToken).then((function(t){var n=t.data.forms,s=t.data.groups,r=t.data.questions;p(r),null!=n&&n[e.formIndex].items.map((function(t){N(t,r,s,n[e.formIndex],0)})),l(s),c(n)}))};return Object(r.useEffect)((function(){C(!0),null!=i&&b.map((function(t){t.required&&(6!=t.type?A.filter((function(n){return n.questionId===t.id&&n.formId===i[e.formIndex].id})).map((function(e){""!=e.text&&null!=e.text||C(!1)})):h.filter((function(n){return n.questionID===t.id&&n.formId===i[e.formIndex].id})).map((function(e){0===e.files.length&&C(!1)})))}))}),[A,h]),Object(r.useEffect)((function(){D()}),[e.accessToken]),Object(s.jsxs)("div",{className:"card",children:[Object(s.jsx)("div",{className:"formName",children:null!=i&&i[e.formIndex].name}),Object(s.jsxs)("form",{onSubmit:function(e){e.preventDefault()},children:[null==i?null:i[e.formIndex].items.map((function(t){switch(t.type){case 0:return Object(s.jsx)(P,{question:b.find((function(e){return e.id===t.id})),answersDisplayOrder:0,answers:A,form:i[e.formIndex],setAnswers:F,selectedFiles:h,setSelectedFiles:g,accessToken:e.accessToken});case 1:return Object(v.a)(Array(u.find((function(e){return e.id==t.id})).repeat)).map((function(n,r){return Object(s.jsx)(B,{setGroups:l,questions:b,answers:A,setAnswers:F,selectedFiles:h,setSelectedFiles:g,accessToken:e.accessToken,form:i[e.formIndex],index:r,groups:u,group:u.find((function(e){return e.id===t.id}))})}))}})),Object(s.jsx)("div",{style:{margin:"10px 0px"}}),Object(s.jsx)("button",{class:"submitbtn",disabled:!T,onClick:function(){return Object(I.b)("FORM SUBMITTED")},children:"Submit"})]})]})};function z(e){var t=Object(r.useState)(null),n=Object(o.a)(t,2),i=n[0],c=n[1];return Object(r.useEffect)((function(){O("applicant",e.accessToken).then((function(e){var t=e.data.forms;c(t)}))}),[e.accessToken]),Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("div",{className:"card",style:{textAlign:"center",marginTop:"100px",width:"400px"},children:[" ",null!=i&&i.map((function(t,n){return Object(s.jsx)(s.Fragment,{children:Object(s.jsxs)("button",{style:{marginTop:"10px"},onClick:function(){return e.setFormIndex(n)},children:["Form ",t.name]})})}))]})})}var J=n(12);function M(e){var t=Object(r.useState)(""),n=Object(o.a)(t,2),i=n[0],c=n[1],a=Object(r.useState)(null),u=Object(o.a)(a,2),l=u[0],f=u[1],j=Object(r.useState)(null),b=Object(o.a)(j,2),p=b[0],x=b[1],O=Object(r.useState)(""),m=Object(o.a)(O,2),g=m[0],w=m[1],v=Object(r.useState)(""),y=Object(o.a)(v,2),I=y[0],q=y[1],A=Object(J.f)();return Object(s.jsxs)(s.Fragment,{children:[Object(r.useEffect)((function(){var t=e.location.search.split("&"),n=t[0].replace("?u=",""),s=t[1].replace("t=","");f(n),x(s)}),[]),Object(s.jsx)("div",{className:"App-header",children:Object(s.jsx)("div",{className:"AppLogo",children:Object(s.jsx)("a",{href:"https://carolynleepllc.com/",children:Object(s.jsx)("img",{src:d,alt:"Carolyn Lee",style:{width:"200px"}})})})}),Object(s.jsxs)("div",{className:"card",style:{textAlign:"center",marginTop:"100px",width:"500px"},children:[Object(s.jsx)("div",{className:"text-danger",style:{marginBottom:"10px"},children:I}),Object(s.jsx)("div",{className:"form-group has-feedback",children:Object(s.jsx)("input",{type:"password",name:"Password",className:"form-control",placeholder:"enter new password",value:i,onChange:function(e){return c(e.target.value)}})}),Object(s.jsx)("div",{className:"form-group has-feedback",children:Object(s.jsx)("input",{type:"password",name:"ConfirmPassword",className:"form-control",placeholder:"confirm password",value:g,onChange:function(e){return w(e.target.value)}})}),Object(s.jsx)("button",{onClick:function(){i===g&&""!==i?h("user/"+l.toString()+"/password",{password:i,confirmPassword:g,token:p}).then((function(e){if(!1!==e.success)return q(""),A.push("/");e.errors.map((function(e){q(e)}))})):q("Passwords do not match")},style:{marginTop:"20px"},children:"Activate"})]})]})}var R=n(103);n(319);function U(){var e=Object(r.useState)(null),t=Object(o.a)(e,2),n=t[0],i=t[1],c=Object(r.useState)(!1),a=Object(o.a)(c,2),l=a[0],f=a[1],j=Object(u.a)(["token"]),b=Object(o.a)(j,3),p=b[0],x=b[1],O=b[2];return Object(s.jsxs)("div",{children:[Object(r.useEffect)((function(){null!=p.token?f(!0):f(!1)}),[p]),Object(s.jsxs)("div",{className:"App-header",children:[Object(s.jsx)("div",{className:"AppLogo",children:Object(s.jsx)("a",{href:"https://carolynleepllc.com/",children:Object(s.jsx)("img",{src:d,alt:"Carolyn Lee",style:{width:"200px"}})})}),null!=n&&Object(s.jsx)("button",{className:"navbutton",onClick:function(){return i(null)},children:"All Forms"}),l&&Object(s.jsx)("button",{className:"navbutton",onClick:function(){return O("token"),f(!1),void i(null)},children:"Sign Out"})]}),l?Object(s.jsx)(s.Fragment,{children:null!=n?Object(s.jsx)(G,{accessToken:p.token,formIndex:n,setFormIndex:i}):Object(s.jsx)(z,{accessToken:p.token,setFormIndex:i})}):Object(s.jsx)(w,{setSessionCookie:function(e){return x("token",e,{path:"/"},f(!0))}})]})}var $=function(){return Object(s.jsx)(R.a,{children:Object(s.jsxs)("div",{className:"App",children:[Object(s.jsxs)(J.c,{children:[Object(s.jsx)(J.a,{path:"/activate",component:M}),Object(s.jsx)(J.a,{path:"/",children:Object(s.jsx)(U,{})})]}),Object(s.jsx)(I.a,{})]})})},Q=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,331)).then((function(t){var n=t.getCLS,s=t.getFID,r=t.getFCP,i=t.getLCP,c=t.getTTFB;n(e),s(e),r(e),i(e),c(e)}))},W=n(329);a.a.render(Object(s.jsx)(i.a.StrictMode,{children:Object(s.jsx)(W.a,{children:Object(s.jsx)($,{})})}),document.getElementById("root")),Q()}},[[321,1,2]]]); //# sourceMappingURL=main.ed6ff978.chunk.js.map