{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./build/scripts/home.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","default","object","property","prototype","hasOwnProperty","p","s","./build/scripts/home.js","e","loginErrorEl","document","querySelector","loginEmailEl","getElementById","loginPasswordEl","loginButtonEl","signupErrorEl","signupEmailEl","signupPasswordEl","signupOrganizationEl","signupButtonEl","login","el","listener","qanda","shared","blockedRequest","body","email","password","onSuccess","textContent","onFail","error","httpRequest","status","response","JSON","parse","responseText","window","localStorage","setItem","token","id","location","href","console","log","addEventListener","stopPropagation","classList","remove","style","display","preventDefault","add","focus","click","loginListener","querySelectorAll","forEach","signupListener","organization"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,KACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,KAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,cAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,YAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAG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UAAW,WACVd,EAAce,YAAc,IAE7BC,OAAQ,SAASC,GAChBjB,EAAce,YAAcE,IAE3B,SAASC,GACgB,MAAvBA,EAAYC,QACfvB,EAAarB,MAAQ0B,EAAc1B,MACnCuB,EAAgBvB,MAAQ2B,EAAiB3B,MACzC8B,EAAMD,EAAgB0C,IAEtBf,QAAQC,IAAI,wCAAyCd,EAAYK,kBA7ErE","file":"dist/home.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./build/scripts/home.js\");\n","(function() {\n\tconst loginErrorEl = document.querySelector('#login-container .error');\n\tconst loginEmailEl = document.getElementById('login-email');\n\tconst loginPasswordEl = document.getElementById('login-password');\n\tconst loginButtonEl = document.querySelector('#login-container input[type=\"submit\"]');\n\tconst signupErrorEl = document.querySelector('#signup-container .error');\n\tconst signupEmailEl = document.getElementById('signup-email');\n\tconst signupPasswordEl = document.getElementById('signup-password');\n\tconst signupOrganizationEl = document.getElementById('signup-organization');\n\tconst signupButtonEl = document.querySelector('#signup-container input[type=\"submit\"]');\n\n\tdocument.querySelector('.overlay .container').addEventListener('click', function(e) {\n\t\te.stopPropagation();\n\t});\n\n\tdocument.querySelector('.overlay').addEventListener('click', function(e) {\n\t\tdocument.body.classList.remove('u-no-overflow');\n\t\tdocument.querySelector('.overlay').style.display = 'none';\n\t});\n\n\tdocument.getElementById('button-show-login').addEventListener('click', function(e) {\n\t\te.preventDefault();\n\t\tdocument.body.classList.add('u-no-overflow');\n\t\tdocument.getElementById('login-container').style.display = 'block';\n\t\tdocument.getElementById('signup-container').style.display = 'none';\n\t\tdocument.querySelector('.overlay').style.display = 'block';\n\t\tloginEmailEl.focus();\n\t});\n\n\tdocument.querySelector('#login-container form').addEventListener('submit', function(e) {\n\t\te.preventDefault();\n\t\tloginButtonEl.click();\n\t});\n\n\tloginButtonEl.addEventListener('click', function loginListener(e) {\n\t\te.preventDefault();\n\n\t\tlogin(loginButtonEl, loginListener);\n\t});\n\n\tdocument.querySelectorAll('.button-show-signup').forEach(function(el) {\n\t\tel.addEventListener('click', function(e) {\n\t\t\te.preventDefault();\n\t\t\tdocument.body.classList.add('u-no-overflow');\n\t\t\tdocument.getElementById('login-container').style.display = 'none';\n\t\t\tdocument.getElementById('signup-container').style.display = 'block';\n\t\t\tdocument.querySelector('.overlay').style.display = 'block';\n\t\t\tsignupEmailEl.focus();\n\t\t});\n\t});\n\n\tdocument.querySelector('#signup-container form').addEventListener('submit', function(e) {\n\t\te.preventDefault();\n\t\tsignupButtonEl.click();\n\t});\n\n\tsignupButtonEl.addEventListener('click', function signupListener(e) {\n\t\te.preventDefault();\n\n\t\tqanda.shared.blockedRequest(signupButtonEl, signupListener, 'POST', 'https://iaq3hhok0d.execute-api.us-west-2.amazonaws.com/prod/users', {\n\t\t\tbody: {\n\t\t\t\temail: signupEmailEl.value,\n\t\t\t\tpassword: signupPasswordEl.value,\n\t\t\t\torganization: signupOrganizationEl.value,\n\t\t\t},\n\t\t\tonSuccess: function() {\n\t\t\t\tsignupErrorEl.textContent = '';\n\t\t\t},\n\t\t\tonFail: function(error) {\n\t\t\t\tsignupErrorEl.textContent = error;\n\t\t\t}\n\t\t}, function(httpRequest) {\n\t\t\tif (httpRequest.status === 200) {\n\t\t\t\tloginEmailEl.value = signupEmailEl.value;\n\t\t\t\tloginPasswordEl.value = signupPasswordEl.value;\n\t\t\t\tlogin(signupButtonEl, signupListener);\n\t\t\t} else {\n\t\t\t\tconsole.log('There was a problem with the request.', httpRequest.responseText);\n\t\t\t}\n\t\t});\n\t});\n\n\tfunction login(el, listener) {\n\t\tqanda.shared.blockedRequest(el, listener, 'POST', 'https://iaq3hhok0d.execute-api.us-west-2.amazonaws.com/prod/users/login', {\n\t\t\tbody: {\n\t\t\t\temail: loginEmailEl.value,\n\t\t\t\tpassword: loginPasswordEl.value,\n\t\t\t},\n\t\t\tonSuccess: function() {\n\t\t\t\tloginErrorEl.textContent = '';\n\t\t\t},\n\t\t\tonFail: function(error) {\n\t\t\t\tloginErrorEl.textContent = error;\n\t\t\t}\n\t\t}, function(httpRequest) {\n\t\t\tif (httpRequest.status === 200) {\n\t\t\t\tvar response = JSON.parse(httpRequest.responseText);\n\t\t\t\twindow.localStorage.setItem('token', response.token.id);\n\t\t\t\twindow.location.href = '/app';\n\t\t\t} else {\n\t\t\t\tconsole.log('There was a problem with the request.', httpRequest.responseText);\n\t\t\t}\n\t\t});\n\t}\n})();"],"sourceRoot":""}