(this["webpackJsonpso-auth-validation"]=this["webpackJsonpso-auth-validation"]||[]).push([[0],{22:function(e){e.exports=JSON.parse('{"redirectUrls":[{"customer":{"id":"Cust45123","redirect_url":"https://launch.leadx360.com/integrations/configureCRM"}},{"customer":{"id":"Cust36660","redirect_url":"https://beta.leadx360.com/integrations/configureCRM"}},{"customer":{"id":"Cust29691","redirect_url":"https://culligan.leadx360.com/integrations/configureCRM"}}]}')},31:function(e,t,c){},33:function(e,t,c){},39:function(e,t,c){"use strict";c.r(t);var n=c(0),i=c(12),r=c.n(i),a=(c(31),c(14)),s=c(2),o=c(20),u=c(22),l=c.p+"static/media/Loader.3ee1fc4c.png",d=c(3);function f(){var e=Object(n.useState)(null),t=Object(o.a)(e,2),c=(t[0],t[1],Object(n.useState)("validating")),i=Object(o.a)(c,2),r=i[0],a=i[1];Object(n.useEffect)((function(){setTimeout((function(){s()}),1e3)}),[]);var s=function(){try{var e=window.location.href.replace(/.*#/,"").split("&").map((function(e){return e.replace(/.*=/,"")}))[4].split(".").map((function(e){return e.replace(/.*:/,"")}))[1],t=window.location.href.replace(/^.*validate#/,"#"),c=function(e,t){return t.redirectUrls.find((function(t){return t.customer.id===e})).customer.redirect_url}(JSON.parse(atob(e))["http://schemes.superoffice.net/identity/ctx"],u),n="".concat(c,"?").concat(t);a("success"),setTimeout((function(){window.location.href=n}),1e3)}catch(i){a("failure")}};return Object(d.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",flexDirection:"column"},children:[Object(d.jsx)("img",{src:l,style:{width:"50%"},alt:"Connecting"}),Object(d.jsx)("span",{children:function(e){switch(e){case"success":return"Connection with SuperOffice is successful ! ";case"failure":return"Sorry, failed to connect with SuperOffice";default:return"Validating connection with SuperOffice"}}(r)})]})}c(33);var h=function(){return Object(d.jsx)("div",{className:"App",style:{height:"100%"},children:Object(d.jsx)(a.a,{children:Object(d.jsx)(s.c,{children:Object(d.jsx)(s.a,{path:"/validate",children:Object(d.jsx)(f,{})})})})})},j=function(e){e&&e instanceof Function&&c.e(3).then(c.bind(null,41)).then((function(t){var c=t.getCLS,n=t.getFID,i=t.getFCP,r=t.getLCP,a=t.getTTFB;c(e),n(e),i(e),r(e),a(e)}))},p=c(26),O=c(8),b=c(25),g=c(11),m="SET_CustomerId",v="SET_RedirectURL",C={CustomerId:"",RedirectUrl:""},x={validate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m:return Object(g.a)(Object(g.a)({},e),{},{CustomerId:t.payload.CustomerId});case v:return Object(g.a)(Object(g.a)({},e),{},{RedirectUrl:t.payload.RedirectUrl});default:return e}}},S=Object(O.c)(x),w=O.d,y=Object(O.e)((function(e,t){return"USER_LOGOUT_SUCCESS"===t.type&&(e=void 0),S(e,t)}),w(Object(O.a)(b.a)));r.a.render(Object(d.jsx)(p.a,{store:y,children:Object(d.jsx)(a.a,{children:Object(d.jsx)(h,{})})}),document.getElementById("root")),j()}},[[39,1,2]]]); //# sourceMappingURL=main.e0894e4d.chunk.js.map