/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
/*!********************************!*\
  !*** ./extension/js/signin.js ***!
  \********************************/
__webpack_require__.r(__webpack_exports__);
// js/signin.js
// This script handles the user sign-in form.
document.addEventListener('DOMContentLoaded', function () {
  var signinForm = document.getElementById('signin-form');
  var errorMessageDiv = document.getElementById('error-message');
  signinForm.addEventListener('submit', function (e) {
    e.preventDefault();
    var email = signinForm.email.value;
    var password = signinForm.password.value;
    errorMessageDiv.textContent = '';

    // Send the sign-in request to the background script
    chrome.runtime.sendMessage({
      type: 'signInUser',
      target: 'background',
      data: {
        email: email,
        password: password
      }
    }, function (response) {
      if (chrome.runtime.lastError) {
        errorMessageDiv.textContent = "Error: ".concat(chrome.runtime.lastError.message);
        return;
      }
      if (response && response.success) {
        // On successful sign-in, close this tab.
        // The user can then click the toolbar icon to see their signed-in status.
        chrome.tabs.getCurrent(function (tab) {
          chrome.tabs.remove(tab.id);
        });
      } else {
        errorMessageDiv.textContent = "Error: ".concat(response.error);
      }
    });
  });
});
/******/ })()
;
//# sourceMappingURL=signin.js.map