{"version":3,"file":"app-7bd12dde.83952295dd6a51410d9c.bundle.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AAGA;AAKA;AAMA;AAKA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtCA;AAFA;AACA;AAQA;AACA;AACA;AATA;AAuCA;AAAA;AAvCA;;;;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AAGA;AACA;AAIA;AAaA;AAPA;AAEA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;;;;;;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;;AAAA;;;AAMA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;;;;;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AA1HA;AAFA;AACA;AAeA;AACA;AACA;AAhBA;AA2HA;AAAA;AA3HA;;;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AAGA;AACA;AACA;AACA;AAIA;AAOA;AAFA;AAOA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AA7BA;AAFA;AACA;AASA;AACA;AACA;AAVA;AA8BA;AAAA;AA9BA;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AAGA;AAWA;AAPA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;;;;;;AACA;AACA;AACA;AACA;AACA;AAEA;;AAAA;AAOA;AAEA;;;;;AACA;AACA;AACA;AACA;AAzCA;AADA;AAYA;AAXA;AA0CA;AAAA;AA1CA;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAIA;AASA;AAHA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AACA;;AAAA;;;;;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACA;AACA;;AAAA;AACA;;AAAA;;;;;AAEA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACA;AACA;;AAAA;AACA;;AAAA;;;;;AAGA;AACA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;;;AACA;AACA;;;;AACA;AAvFA;AAAA;AAAA;AAAA;AAFA;AAFA;AACA;AAUA;AATA;AA0FA;AAAA;AA1FA;;;;;;;;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AAGA;AAiCA;AA3BA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAGA;AAOA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AAAA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;;AAAA;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApNA;AADA;AAmCA;AACA;AACA;AApCA;AAqNA;AAAA;AArNA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACRA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAaA;AAPA;AACA;AACA;AAEA;AACA;AAOA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AAGA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACA;AACA;AACA;;AAAA;AACA;;AAAA;;;AAEA;AACA;AACA;;AAAA;AACA;;AAAA;;;;;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAAA;AACA;;;AACA;AACA;;;;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAAA;AACA;;;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjJA;AAFA;AACA;AAeA;AACA;AACA;AAhBA;AAkJA;AAAA;AAlJA;;;;;;;;;;;;;;;;;;;;;;;ACfA;AACA;AAGA;AACA;AACA;AACA;AAIA;AAOA;AAFA;AAOA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAjCA;AAFA;AACA;AASA;AACA;AACA;AAVA;AAkCA;AAAA;AAlCA;;;;;;;;;;;;;;;ACTA;AAEA","sources":["webpack://ro-dental/./src/pages/home.html","webpack://ro-dental/./src/pages/login.html","webpack://ro-dental/./src/pages/members.html","webpack://ro-dental/./src/pages/password-reset.html","webpack://ro-dental/./src/pages/patient.html","webpack://ro-dental/./src/pages/register.html","webpack://ro-dental/./src/pages/todays-appointments.html","webpack://ro-dental/./src/pages/transactions.html","webpack://ro-dental/./src/pages/home.ts","webpack://ro-dental/./src/pages/login.ts","webpack://ro-dental/./src/pages/members.ts","webpack://ro-dental/./src/pages/password-reset.ts","webpack://ro-dental/./src/pages/patient.ts","webpack://ro-dental/./src/pages/register.ts","webpack://ro-dental/./src/pages/todays-appointments.ts","webpack://ro-dental/./src/pages/transactions.ts","webpack://ro-dental/./src/resources/index.ts"],"sourcesContent":["// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"/static/logo-black.png\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar code = \"\";\n// Exports\nexport default code;","// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"/static/logo-black.png\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\n\";\n// Exports\nexport default code;","// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"/static/logo-black.png\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar code = \"\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","import { autoinject } from \"aurelia-framework\";\nimport { Router } from \"aurelia-router\";\nimport { connectTo } from \"aurelia-store\";\nimport { AuthenticationService } from \"services/authentication-service\";\nimport { IUser } from \"services/interfaces\";\nimport { State } from \"services/state\";\nimport { StateManager } from \"services/state-manager\";\nimport Swal from \"sweetalert2\";\n\n@autoinject()\n@connectTo()\nexport class HomePage {\n router: Router;\n user: IUser;\n stateManager: StateManager;\n _authenticationService: AuthenticationService;\n\n constructor(\n router: Router,\n stateManager: StateManager,\n authenticationService: AuthenticationService\n ) {\n this.router = router;\n this.stateManager = stateManager;\n this._authenticationService = authenticationService;\n }\n\n activate() {}\n\n attached() {\n if (this.user && this.user.isAdmin) {\n this.router.navigate(\"today\");\n } else if (this.user && !this.user.isAdmin) {\n this.router.navigate(\"dashboard\");\n }\n }\n\n stateChanged(state: State) {\n this.user = state.user;\n }\n\n navigateToRegister() {\n this.router.navigate(\"register\");\n }\n navigateToLogin() {\n this.router.navigate(\"login\");\n }\n navigateToBookNow() {\n this.router.navigate(\"book-now\");\n }\n}\n","import { autoinject } from \"aurelia-framework\";\nimport { Router } from \"aurelia-router\";\nimport { connectTo } from \"aurelia-store\";\nimport { AuthenticationService } from \"services/authentication-service\";\nimport { IUser } from \"services/interfaces\";\nimport { State } from \"services/state\";\nimport { StateManager } from \"services/state-manager\";\nimport Swal from \"sweetalert2\";\n\n@autoinject()\n@connectTo()\nexport class LoginPage {\n router: Router;\n private _authenticationService: AuthenticationService;\n stateManager: StateManager;\n user: IUser;\n\n showingErrors: boolean = false;\n\n loginEmail: string = \"\";\n loginPassword: string = \"\";\n loginError: string = \"\";\n attemptingLogin: boolean = false;\n\n constructor(\n authenticationService: AuthenticationService,\n router: Router,\n stateManager: StateManager\n ) {\n this._authenticationService = authenticationService;\n this.router = router;\n this.stateManager = stateManager;\n }\n\n activate() {\n if (this.user && this.user.isAdmin) {\n this.router.navigateToRoute(\"today\");\n }\n if (this.user && !this.user.isAdmin) {\n this.router.navigateToRoute(\"dashboard\");\n }\n }\n\n stateChanged(state: State) {\n this.user = state.user;\n }\n\n async login() {\n if (!this.loginEmail || !this.loginPassword) {\n this.loginError = \"Please enter an email and password\";\n return;\n }\n\n this.attemptingLogin = true;\n var loginSucceeded = null;\n\n if (this.loginEmail && this.loginPassword) {\n loginSucceeded = await this._authenticationService.loginAsync(\n this.loginEmail,\n this.loginPassword\n );\n }\n\n if (loginSucceeded == \"Please Confirm Your Email Address\") {\n this.loginError =\n \"Please confirm your email address. Click below to send a new confirmation email.\";\n }\n\n if (loginSucceeded == \"Unknown User\") {\n this.loginError = \"Invalid email or password. Please try again.\";\n this.loginPassword = \"\";\n }\n if (loginSucceeded == \"Name Taken\") {\n this.loginError = \"That email is already in use. Please try again.\";\n this.loginPassword = \"\";\n }\n\n this.attemptingLogin = false;\n this.loginPassword = \"\";\n\n const user: IUser = await this.stateManager.getUserAsync();\n if (user.isAdmin) {\n this.router.navigateToRoute(\"today\");\n } else {\n this.router.navigateToRoute(\"dashboard\");\n }\n }\n\n sendPasswordResetEmail() {\n Swal.fire({\n title: \"Enter Your Email Address\",\n input: \"email\",\n inputPlaceholder: \"janero@gmail.com\",\n confirmButtonColor: \"#40684e\",\n showCancelButton: true,\n cancelButtonColor: \"#d33\",\n }).then((result) => {\n if (result.value) {\n this._authenticationService.sendPasswordResetEmail(result.value);\n Swal.fire({\n title: \"Password Reset\",\n text: \"If that email has an account with us, you will receive a password reset link shortly.\",\n icon: \"success\",\n iconColor: \"#40684e\",\n confirmButtonColor: \"#40684e\",\n });\n }\n });\n }\n\n sendConfirmationEmail() {\n Swal.fire({\n title: \"Enter Your Email Address\",\n input: \"email\",\n inputPlaceholder: \"janero@gmail.com\",\n confirmButtonColor: \"#40684e\",\n showCancelButton: true,\n cancelButtonColor: \"#d33\",\n }).then((result) => {\n if (result.value) {\n this._authenticationService.sendConfirmationEmail(result.value);\n Swal.fire({\n title: \"Account Confirmation\",\n text: \"If that email has an account with us, you will receive a confirmation email shortly.\",\n icon: \"success\",\n iconColor: \"#40684e\",\n });\n }\n });\n }\n\n navigateToRegisterPage() {\n this.router.navigateToRoute(\"register\");\n }\n}\n","import { autoinject, TaskQueue, bindable } from \"aurelia-framework\";\nimport { connectTo } from \"aurelia-store\";\nimport { IUser } from \"services/interfaces\";\nimport { State } from \"services/state\";\nimport { StateManager } from \"services/state-manager\";\nimport \"flatpickr/dist/flatpickr.css\";\nimport { ISubscription, Router } from \"aurelia-router\";\nimport { DialogService } from \"aurelia-dialog\";\n\n@connectTo()\n@autoinject()\nexport class PatientAppointments {\n _stateManager: StateManager;\n _router: Router;\n _dialogService: DialogService;\n activeSubscriptions: ISubscription[];\n isLoadingTableData: boolean = false;\n\n constructor(\n stateManager: StateManager,\n router: Router,\n dialogService: DialogService\n ) {\n this._stateManager = stateManager;\n this._router = router;\n this._dialogService = dialogService;\n }\n\n stateChanged(state: State) {\n this.activeSubscriptions = state.activeSubscriptions;\n this.isLoadingTableData = false;\n }\n\n attached() {\n this.isLoadingTableData = true;\n this._stateManager.getActiveSubscriptionsAsync();\n }\n\n navigateToPatient(user: IUser) {\n this._router.navigateToRoute(\"patient\", { userId: user.userId });\n }\n}\n","import { autoinject } from \"aurelia-framework\";\nimport { Router } from \"aurelia-router\";\nimport { AuthenticationService } from \"services/authentication-service\";\n\n@autoinject()\nexport class PasswordResetPage {\n router: Router;\n private _authenticationService: AuthenticationService;\n\n passwordResetMessage: string = \"\";\n passwordResetPassword: string = \"\";\n passwordResetPasswordRepeat: string = \"\";\n token: string = \"\";\n passwordResetEmail: string = \"\";\n attemptingPasswordReset: boolean = false;\n\n constructor(authenticationService: AuthenticationService, router: Router) {\n this._authenticationService = authenticationService;\n this.router = router;\n }\n\n activate(params) {\n this.token = params.token;\n this.passwordResetEmail = params.email;\n }\n\n async resetPassword() {\n if (this.passwordResetPassword !== this.passwordResetPasswordRepeat) {\n this.passwordResetMessage = \"Passwords do not match\";\n return;\n }\n this.attemptingPasswordReset = true;\n\n var resetMessage = await this._authenticationService.resetPassword(\n this.passwordResetPassword,\n this.passwordResetPasswordRepeat,\n this.token,\n this.passwordResetEmail\n );\n\n this.passwordResetMessage = resetMessage;\n\n this.attemptingPasswordReset = false;\n }\n navigateToLogin() {\n this.router.navigateToRoute(\"login\");\n }\n}\n","import { autoinject, TaskQueue, bindable } from \"aurelia-framework\";\nimport { connectTo } from \"aurelia-store\";\nimport { IAppointment, IAppointmentRequest, IUser } from \"services/interfaces\";\nimport { State } from \"services/state\";\nimport { StateManager } from \"services/state-manager\";\nimport \"flatpickr/dist/flatpickr.css\";\nimport { Router } from \"aurelia-router\";\nimport { DialogService } from \"aurelia-dialog\";\nimport { NewAppointmentFromRequestDialog } from \"modals/new-appointment-from-request\";\nimport Swal from \"sweetalert2\";\n\n@connectTo()\n@autoinject()\nexport class Patient {\n _stateManager: StateManager;\n @bindable _router: Router;\n dialogService: DialogService;\n\n patient: IUser;\n appointments: IAppointment[] = [];\n editingUserInfo: boolean = false;\n\n constructor(stateManager: StateManager, dialogService: DialogService) {\n this._stateManager = stateManager;\n this.dialogService = dialogService;\n }\n\n stateChanged(state) {\n this.patient = state.patient;\n if (state.patient) {\n this.sortPatientAppointments();\n }\n }\n\n async activate(params, routeConfig, navigationInstruction) {\n await this._stateManager.getPatientAsync(params.userId);\n }\n\n deleteAppointmentRequest(appointmentRequest: IAppointmentRequest) {\n Swal.fire({\n title: `Confirm Deletion`,\n text: `Are you sure you want to delete ${appointmentRequest.user.firstName}'s appointment request?`,\n showDenyButton: false,\n showCancelButton: true,\n showConfirmButton: true,\n confirmButtonText: `Yes, Delete`,\n confirmButtonColor: \"#40684e\",\n }).then(async (result) => {\n if (result.isConfirmed) {\n await this._stateManager.deleteAppointmentRequest(appointmentRequest);\n await this._stateManager.getPatientAppointmentRequests();\n }\n });\n }\n\n createAppointment(appointmentRequest: IAppointmentRequest) {\n this.dialogService\n .open({\n viewModel: NewAppointmentFromRequestDialog,\n model: appointmentRequest,\n lock: false,\n })\n .whenClosed(async (response) => {\n if (!response.wasCancelled) {\n await this._stateManager.postAppointmentAsync(response.output);\n await this._stateManager.getPatientAppointmentRequests();\n } else {\n }\n });\n }\n\n sortPatientAppointments() {\n if (!this.patient || !this.patient.appointments) return;\n\n this.appointments = this.patient.appointments.sort((a, b) => {\n if (a.date > b.date) {\n return -1;\n }\n if (a.date < b.date) {\n return 1;\n }\n return 0;\n });\n }\n\n getTextColor(appointment) {\n if (appointment.isCancelled) {\n return \"text-danger\";\n }\n if (appointment.isCompleted) {\n return \"text-success\";\n }\n return \"\";\n }\n\n edit() {\n this.editingUserInfo = true;\n }\n\n async save() { \n this._stateManager.updatePatientAsync(this.patient); \n this.editingUserInfo = false;\n }\n}\n","import { autoinject, TaskQueue } from \"aurelia-framework\";\nimport { Router } from \"aurelia-router\";\nimport { AuthenticationService } from \"services/authentication-service\";\nimport Swal from \"sweetalert2\";\nimport * as FlatPickr from \"flatpickr\";\nimport \"flatpickr/dist/flatpickr.css\";\n\n@autoinject()\nexport class RegisterPage {\n router: Router;\n private _authenticationService: AuthenticationService;\n taskQueue: TaskQueue;\n flatPickerObject: any;\n\n showingErrors: boolean = false;\n attemptingRegistration: boolean = false;\n\n registerFirstName: string = \"\";\n firstNameError: string = \"\";\n\n registerLastName: string = \"\";\n lastNameError: string = \"\";\n\n registerEmail: string = \"\";\n emailError: string = \"\";\n\n registerPhoneNumber: string = \"\";\n phoneNumberError: string = \"\";\n\n registerPassword: string = \"\";\n passwordError: string = \"\";\n\n registerPasswordRepeat: string = \"\";\n passwordRepeatError: string = \"\";\n\n registerWantsNewsletter: boolean = true;\n registerServerMessage: string = \"\";\n\n birthday: Date;\n birthdayError: string = \"\";\n\n constructor(\n authenticationService: AuthenticationService,\n router: Router,\n taskQueue: TaskQueue\n ) {\n this._authenticationService = authenticationService;\n this.router = router;\n this.taskQueue = taskQueue;\n }\n\n attached() {\n this.taskQueue.queueMicroTask(() => {\n this.createDatePicker();\n });\n }\n\n createDatePicker() {\n var htmlElement = document.getElementById(\"birthday-calendar\");\n\n if (htmlElement == null) return;\n\n if (this.flatPickerObject != null) return;\n\n this.flatPickerObject = new (FlatPickr)(htmlElement, {\n dateFormat: \"F d\",\n onChange: (date) => {\n this.birthday = date[0];\n },\n });\n }\n\n async registerNewUser() {\n if (!this.registerFirstName) {\n this.firstNameError = \"Please enter your first name\";\n } else {\n this.firstNameError = \"\";\n }\n\n if (!this.registerLastName) {\n this.lastNameError = \"Please enter your last name\";\n } else {\n this.lastNameError = \"\";\n }\n\n this.checkEmailAddress();\n\n this.checkPhoneNumber();\n\n this.checkPasswords();\n\n if (\n this.firstNameError ||\n this.lastNameError ||\n this.emailError ||\n this.phoneNumberError ||\n this.passwordError ||\n this.passwordRepeatError\n ) {\n this.showingErrors = true;\n return;\n }\n\n this.attemptingRegistration = true;\n\n var registerResult = await this._authenticationService.registerAsync(\n this.registerFirstName,\n this.registerLastName,\n this.registerEmail,\n this.registerPhoneNumber,\n this.registerPassword,\n this.registerPasswordRepeat,\n this.registerWantsNewsletter,\n this.birthday\n );\n\n if (registerResult == \"Email Taken\") {\n this.registerServerMessage = \"Email already in use\";\n this.attemptingRegistration = false;\n }\n if (registerResult == \"Failed To Create User\") {\n this.registerServerMessage =\n \"Failed to create account. Please try again later\";\n this.attemptingRegistration = false;\n }\n\n if (registerResult === \"Success\") {\n this.registerServerMessage = \"Account Successfully Created!\";\n this.attemptingRegistration = false;\n //set delay for one second\n setTimeout(() => {\n this.navigateToLoginPage();\n }, 1000);\n }\n }\n\n toggleNewsletter() {\n this.registerWantsNewsletter = !this.registerWantsNewsletter;\n }\n\n checkPhoneNumber() {\n if (!this.registerPhoneNumber) {\n this.phoneNumberError = \"Please enter your phone number\";\n return;\n }\n\n var phoneRegex = /^[0-9]{10}$/;\n if (this.registerPhoneNumber.match(phoneRegex)) {\n this.phoneNumberError = \"\";\n } else {\n this.phoneNumberError = \"Please enter a valid 10-digit phone number\";\n }\n }\n\n checkEmailAddress() {\n if (!this.registerEmail) {\n this.emailError = \"Please enter your email address\";\n return;\n }\n\n if (\n this.registerEmail.includes(\"@\") === false ||\n this.registerEmail.includes(\".\") === false\n ) {\n this.emailError = \"Please enter a valid email address\";\n return;\n }\n this.emailError = \"\";\n }\n\n checkPasswords() {\n if (!this.registerPassword) {\n this.passwordError = \"Please enter a password\";\n return;\n }\n if (!this.registerPasswordRepeat) {\n this.passwordRepeatError = \"Please repeat your password\";\n return;\n }\n if (this.registerPassword !== this.registerPasswordRepeat) {\n this.passwordRepeatError = \"Passwords do not match\";\n return;\n }\n\n var regularExpression =\n /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{8,24}$/;\n // var decimal =\n // /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\s).{8,15}$/;\n if (this.registerPassword.match(regularExpression)) {\n this.passwordError = \"\";\n } else {\n this.passwordError =\n \"Password must contain at least 8 characters. One uppercase, one lowercase, one number and one special character\";\n return;\n }\n\n this.passwordError = \"\";\n }\n\n navigateToLoginPage() {\n this.router.navigateToRoute(\"login\");\n }\n\n sendConfirmationEmail() {\n Swal.fire({\n title: \"Enter your Email Address\",\n input: \"email\",\n inputPlaceholder: \"janero@gmail.com\",\n confirmButtonColor: \"#40684e\",\n }).then((result) => {\n if (result.value) {\n this._authenticationService.sendConfirmationEmail(result.value);\n Swal.fire({\n title: \"Account Confirmation\",\n text: \"If that email has an account with us, you will receive a confirmation email shortly.\",\n icon: \"success\",\n iconColor: \"#40684e\",\n });\n }\n });\n }\n}\n","import { autoinject, TaskQueue, bindable } from \"aurelia-framework\";\nimport { connectTo } from \"aurelia-store\";\nimport { IAppointment, IUser } from \"services/interfaces\";\nimport { State } from \"services/state\";\nimport { StateManager } from \"services/state-manager\";\nimport \"flatpickr/dist/flatpickr.css\";\nimport { ISubscription, Router } from \"aurelia-router\";\nimport moment from \"moment\";\nimport { DialogService } from \"aurelia-dialog\";\nimport Swal from \"sweetalert2\";\nimport { CancelAppointmentDialog } from \"modals/cancel-appointment\";\nimport { CompleteMemberAppointmentDialog } from \"modals/complete-member-appointment\";\n\n@connectTo()\n@autoinject()\nexport class Appointments {\n _stateManager: StateManager;\n _router: Router;\n _dialogService: DialogService;\n\n appointments: IAppointment[];\n isLoadingTableData: boolean = false;\n todaysAppointments: IAppointment[] = [];\n activeSubscriptions: ISubscription[] = [];\n\n birthdayInt: number = 7;\n clientBirthdays: IUser[] = [];\n\n constructor(\n stateManager: StateManager,\n router: Router,\n dialogService: DialogService\n ) {\n this._stateManager = stateManager;\n this._router = router;\n this._dialogService = dialogService;\n }\n\n stateChanged(state: State) {\n this.appointments = state.todaysAppointments;\n this.clientBirthdays = state.clientBirthdays;\n this.isLoadingTableData = false;\n\n if (this.appointments) {\n this.getTodaysAppointments();\n }\n }\n\n attached() {\n this.isLoadingTableData = true;\n this._stateManager.getTodaysAppointments();\n this._stateManager.getActiveSubscriptionsAsync();\n this._stateManager.getClientBirthdaysAsync(this.birthdayInt);\n }\n\n navigateToPatient(user: IUser) {\n this._router.navigateToRoute(\"patient\", { userId: user.userId });\n }\n\n generateComortPreferences(user: IUser) {\n var comfortPreferences = \"\";\n if (user.soundCancellingHeadphones)\n comfortPreferences += \"Sound Cancelling Headphones, \";\n if (user.netflix) comfortPreferences += \"Netflix, \";\n if (user.lemongrassDiffuser) comfortPreferences += \"Lemongrass Diffuser, \";\n if (user.weightedBlanket) comfortPreferences += \"Weighted Blanket, \";\n if (user.stressBalls) comfortPreferences += \"Stress Balls, \";\n if (user.heatedBlanket) comfortPreferences += \"Heated Blanket, \";\n if (user.latte) comfortPreferences += \"Latte, \";\n if (user.waterBottle) comfortPreferences += \"Water Bottle, \";\n if (user.eyeMask) comfortPreferences += \"Eye Mask, \";\n\n //remove last comma from the list if there is one.\n if (comfortPreferences.length > 0)\n comfortPreferences = comfortPreferences.slice(0, -2);\n\n return comfortPreferences;\n }\n\n appointmentIsToday(appointment) {\n var appointmentDate = moment.utc(appointment.date).local();\n var today = moment();\n\n return appointmentDate.isSame(today, \"day\");\n }\n\n async completeAppointment(appointment: IAppointment) {\n if (appointment.user.activeSubscription == null) {\n Swal.fire({\n title: \"Complete Appointment?\",\n text: \"Are you sure you want to complete this appointment?\",\n icon: \"success\",\n showDenyButton: true,\n showCancelButton: true,\n confirmButtonText: \"Mark Complete\",\n confirmButtonColor: \"#40684e\",\n denyButtonText: \"Mark No Show\",\n customClass: {\n actions: \"my-actions\",\n cancelButton: \"order-1 right-gap\",\n confirmButton: \"order-3\",\n denyButton: \"order-2\",\n },\n }).then(async (result) => {\n if (result.isConfirmed) {\n appointment.isCompleted = true;\n await this._stateManager.updateAppointmentAsync(appointment);\n await this._stateManager.getTodaysAppointments();\n }\n if (result.isDenied) {\n appointment.isNoShow = true;\n await this._stateManager.updateAppointmentAsync(appointment);\n await this._stateManager.getTodaysAppointments();\n }\n });\n } else {\n this._dialogService\n .open({\n viewModel: CompleteMemberAppointmentDialog,\n model: appointment,\n })\n .whenClosed(async (response) => {\n if (!response.wasCancelled) {\n } else {\n }\n });\n }\n }\n cancelAppointment(appointment) {\n this._dialogService\n .open({\n viewModel: CancelAppointmentDialog,\n model: appointment,\n lock: false,\n })\n .whenClosed(async (response) => {\n if (!response.wasCancelled) {\n } else {\n }\n });\n }\n getTodaysAppointments() {\n this.todaysAppointments = this.appointments.filter((appointment) =>\n this.appointmentIsToday(appointment)\n );\n }\n \n getBadgeColor(membershipString) {\n switch (membershipString) {\n case \"Founder\":\n return \"ro-orange\";\n case \"Gold\":\n return \"ro-gold\";\n case \"Silver\":\n return \"ro-green\";\n case \"Bronze\":\n return \"ro-blue\";\n default:\n return \"primary\";\n }\n }\n}\n","import { autoinject, TaskQueue, bindable } from \"aurelia-framework\";\nimport { connectTo } from \"aurelia-store\";\nimport { ITransaction, IUser } from \"services/interfaces\";\nimport { State } from \"services/state\";\nimport { StateManager } from \"services/state-manager\";\nimport \"flatpickr/dist/flatpickr.css\";\nimport { ISubscription, Router } from \"aurelia-router\";\nimport { DialogService } from \"aurelia-dialog\";\n\n@connectTo()\n@autoinject()\nexport class PatientAppointments {\n _stateManager: StateManager;\n _router: Router;\n _dialogService: DialogService;\n transactions: ITransaction[];\n isLoadingTableData: boolean = false;\n\n constructor(\n stateManager: StateManager,\n router: Router,\n dialogService: DialogService\n ) {\n this._stateManager = stateManager;\n this._router = router;\n this._dialogService = dialogService;\n }\n\n stateChanged(state: State) {\n this.transactions = state.transactions;\n console.log(\"Transactions\", this.transactions);\n this.isLoadingTableData = false;\n }\n\n attached() {\n this.isLoadingTableData = true;\n this._stateManager.getTransactionsAsync();\n }\n\n navigateToPatient(user: IUser) {\n this._router.navigateToRoute(\"patient\", { userId: user.userId });\n }\n getReceiptSentValue(transaction: ITransaction) {\n return transaction.receiptSent ? \"Yes\" : \"No\";\n }\n}\n","import {FrameworkConfiguration} from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration): void {\n //config.globalResources([]);\n}\n"],"names":[],"sourceRoot":""}