{"version":3,"sources":["views/auth/UrlChecking/index.js"],"names":["UrlView","history","useHistory","useEffect","window","location","href","includes","push","utmparameter","split","authService","logout","route","URLSearchParams","search","get","localStorage","setItem","params","addToCart","lang"],"mappings":"mHAAA,4CA8EeA,UA9Df,WAGE,IAAMC,EAAUC,cAoDhB,OAnDAC,qBAAU,WAER,GACMC,OAAOC,SAASC,KAAKC,SAAS,oBAC9BH,OAAOC,SAASC,KAAKC,SAAS,sBAC9BH,OAAOC,SAASC,KAAKC,SAAS,qBAC9BH,OAAOC,SAASC,KAAKC,SAAS,wBAC9BH,OAAOC,SAASC,KAAKC,SAAS,uBAEnCN,EAAQO,KAAK,eAER,GAAIJ,OAAOC,SAASC,KAAKC,SAAS,cAAe,CAErD,IAEIE,EAFSL,OAAOC,SAASC,KAAKI,MAAM,KAEb,GAE3BT,EAAQO,KAAK,cAAcC,QACtB,GAAIL,OAAOC,SAASC,KAAKC,SAAS,eAAgB,CAEvD,GADAI,IAAYC,SACRR,OAAOC,SAASC,KAAKC,SAAS,SAAS,CAC3C,IACMM,EADS,IAAIC,gBAAgBV,OAAOC,SAASU,QAC9BC,IAAI,SACzBC,aAAaC,QAAQ,OAAQL,GAE9BZ,EAAQO,KAAK,eACP,GAAIJ,OAAOC,SAASC,KAAKC,SAAS,iBAAkB,CAEzD,GAAIH,OAAOC,SAASC,KAAKC,SAAS,SAAS,CAC3C,IAAMY,EAAS,IAAIL,gBAAgBV,OAAOC,SAASU,QAC7CF,EAAQM,EAAOH,IAAI,SACnBI,EAAYD,EAAOH,IAAI,eAC7B,GAAGI,EAAU,CACX,IAAMC,EAAOF,EAAOH,IAAI,oBACrBK,EACDJ,aAAaC,QAAQ,OAAQL,EAAK,uBAAmBO,EAAnB,iBAAqCC,IAGvEJ,aAAaC,QAAQ,OAAQL,EAAK,uBAAmBO,SAGvDH,aAAaC,QAAQ,OAAQL,GAGhCZ,EAAQO,KAAK,eAGZP,EAAQO,KAAK,YAEd,IAGD,uBACI","file":"static/js/14.43e0277a.chunk.js","sourcesContent":["/** @jsx jsx */\r\n/** @jsxFrag React.Fragment **/\r\n\r\nimport { jsx} from '@emotion/core';\r\nimport {Link as RouterLink, useHistory} from 'react-router-dom';\r\n\r\n\r\nimport { useEffect } from 'react';\r\nimport authService from 'src/services/authService';\r\n\r\n\r\n\r\n\r\n \r\n \r\n\r\nfunction UrlView() {\r\n \r\n \r\n const history = useHistory();\r\n useEffect(() => {\r\n \r\n if(\r\n window.location.href.includes('path=simulation') || \r\n window.location.href.includes('path=medtigoStore') || \r\n window.location.href.includes('path=medtigoRoot') ||\r\n window.location.href.includes('path=medtigoJournal') ||\r\n window.location.href.includes('path=medtigoCourses')\r\n ){\r\n history.push(\"/login\")\r\n }\r\n else if (window.location.href.includes('utm_source')) {\r\n \r\n let spliturl=window.location.href.split(\"?\")\r\n \r\n let utmparameter= spliturl[1]\r\n \r\n history.push(\"/register/?\"+utmparameter)\r\n }else if (window.location.href.includes('path=logout')) {\r\n authService.logout(); \r\n if (window.location.href.includes('route')){\r\n const params = new URLSearchParams(window.location.search);\r\n const route = params.get('route');\r\n localStorage.setItem('data', route);\r\n }\r\n history.push(\"/login\")\r\n }else if (window.location.href.includes('path=redirect')) {\r\n // authService.logout(); \r\n if (window.location.href.includes('route')){\r\n const params = new URLSearchParams(window.location.search);\r\n const route = params.get('route');\r\n const addToCart = params.get('add-to-cart')\r\n if(addToCart){\r\n const lang = params.get('convert_language')\r\n if(lang){\r\n localStorage.setItem('data', route + `&add-to-cart=${addToCart}&lang=${lang}`);\r\n }\r\n else{\r\n localStorage.setItem('data', route + `&add-to-cart=${addToCart}`);\r\n }\r\n }else {\r\n localStorage.setItem('data', route);\r\n }\r\n }\r\n history.push(\"/login\")\r\n }else{\r\n // \r\n history.push(\"/login\")\r\n }\r\n }, []);\r\n\r\n return (\r\n
\r\n

Wait

\r\n
\r\n );\r\n}\r\n\r\nexport default UrlView;\r\n"],"sourceRoot":""}