{ "version": 3, "sources": ["../../../dev-www.usfa.fema.gov/src/_js/plugins/redirector.js"], "sourcesContent": ["// Redirector v1.0.3\nlet attemptedURL = document.location.href;\nconsole.log('Here is the URL attempt: ' + attemptedURL)\nif (attemptedURL.endsWith('.html')) {\n /* empty */\n} else if (attemptedURL.endsWith('/')) {\n attemptedURL += 'index.html';\n console.log('if statement')\n} else {\n attemptedURL += '/index.html';\n console.log('else statement')\n}\nconst updateLink = async () => {\n const res = await fetch(\n `https://apps.usfa.fema.gov/contact/api/redirectorJSON?oldUrl=${attemptedURL}&callback=?`\n );\n if (res?.ok) {\n const data = await res.json();\n\n if (Object.keys(data).length > 0) {\n document.getElementById('redirect').classList.remove('visually-hidden');\n oldURL.innerText = data.oldUrl;\n newURL.innerText = data.newUrl;\n newURL.setAttribute('href', data.newUrl);\n }\n }\n};\nupdateLink();\n"], "mappings": "AACA,IAAI,aAAe,SAAS,SAAS,KACrC,QAAQ,IAAI,4BAA8B,YAAY,EAClD,aAAa,SAAS,OAAO,IAEtB,aAAa,SAAS,GAAG,GAClC,cAAgB,aAChB,QAAQ,IAAI,cAAc,IAE1B,cAAgB,cAChB,QAAQ,IAAI,gBAAgB,IAE9B,MAAM,WAAa,SAAY,CAC7B,MAAMA,EAAM,MAAM,MAChB,gEAAgE,YAAY,aAC9E,EACA,GAAIA,GAAK,GAAI,CACX,MAAMC,EAAO,MAAMD,EAAI,KAAK,EAExB,OAAO,KAAKC,CAAI,EAAE,OAAS,IAC7B,SAAS,eAAe,UAAU,EAAE,UAAU,OAAO,iBAAiB,EACtE,OAAO,UAAYA,EAAK,OACxB,OAAO,UAAYA,EAAK,OACxB,OAAO,aAAa,OAAQA,EAAK,MAAM,EAE3C,CACF,EACA,WAAW", "names": ["res", "data"] }