\n \n \n \n \n \n \n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./service-status-alert.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./service-status-alert.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./service-status-alert.vue?vue&type=template&id=5a2885d8&\"\nimport script from \"./service-status-alert.vue?vue&type=script&lang=js&\"\nexport * from \"./service-status-alert.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\ninstallComponents(component, {VAlert,VBtn,VDialog,VIcon})\n","import DOMPurify from 'dompurify'\n\n/**\n * Sanitzies strings containing html to remove potentially harmful code and XSS attacks\n * @param {String} dirtyHtml Potentially unsanitised HTML\n * @returns\n */\nexport default function sanitizeHtml(dirtyHtml) {\n return DOMPurify.sanitize(dirtyHtml, {\n USE_PROFILES: { html: true },\n })\n}\n","export const PermissionRequirement = Object.freeze({\n /**\n * Every permission in the permissions list is required\n */\n ALL: 'all',\n /**\n * At least one permission out of the list is required\n */\n ONE: 'one',\n})\n","/**\n * Provided as a catch all and ideally shouldn't be thrown\n */\nexport default class UnknownAppError extends Error {\n constructor(message) {\n super(message || 'Caught an unhandled client side error')\n this.name = 'UnknownAppError'\n }\n}\n","/**\n * Thrown when a paramter expected to be set was passed in null or undefined\n */\nexport default class NullParameterError extends Error {\n /**\n * @param {String} name name of parameter\n */\n constructor({ message = null, name = null }) {\n super(message || `Required parameter was null or undefined: '${name}'`)\n this.name = 'NullParameterError'\n }\n}\n","/**\n * To contain user data for logging purposes\n */\nexport default class UserIdentificationDTO {\n constructor({ id, emailAddress, ipAddress, isImpersonating = false } = {}) {\n /**\n * @type {Number} User's unique ID\n */\n this.user_id = id\n\n /**\n * @type {String}\n */\n this.user_email = emailAddress\n\n /**\n * @type {String}\n */\n this.user_host_address = ipAddress\n\n /**\n * @type {Boolean}\n */\n this.user_is_impersonating = isImpersonating\n }\n}\n","import NullParameterError from '@/models/error/nullParameterError'\nimport UserIdentificationDTO from '@/models/user/userIndentificationDTO'\n\n/**\n * Retrieves user identity (with optional IP address) for logging purposes\n * @param {VuexStore} store\n * @param {Boolean} logIpAddress Will not log ip address if false\n * @returns {UserIdentificationDTO}\n */\nconst fetchUserIdentityWithIpAddress = (store, logIpAddress = false) => {\n if (!store) throw new NullParameterError('store')\n\n const user = store.getters['auth/currentUserSimple']\n let userIpAddress = 'Instructed not to grab IP address'\n\n if (logIpAddress) {\n try {\n const request = new XMLHttpRequest()\n request.open('GET', 'https://api.ipify.org?format=json', false)\n\n request.send(null)\n\n if (request.status === 200) {\n const responseJSON = JSON.parse(request.responseText)\n userIpAddress = responseJSON.ip\n } else {\n throw new Error(\n `Unable to retrieve IP address. Status code: ${request.status}`\n )\n }\n } catch (ex) {\n userIpAddress = `Failed to get IP address. Reason: ${ex}`\n }\n }\n\n return new UserIdentificationDTO({\n id: user.id,\n emailAddress: user.emailAddress,\n ipAddress: userIpAddress,\n isImpersonating: user.isImpersonating,\n })\n}\n\n/**\n * Compiles custom properties object for logging\n * @param {VuexStore} store\n * @param {Object} properties\n * @param {Boolean} logUserDetails Will log the details of the current user\n * @returns\n */\nconst compileCustomProperties = (store, properties, logUserDetails = false) => {\n if (!logUserDetails) return properties\n\n const user = fetchUserIdentityWithIpAddress(store, true)\n\n return { ...properties, ...user }\n}\n\nexport { fetchUserIdentityWithIpAddress, compileCustomProperties }\n","/**\n * Used to track PromiseRejectionEvents\n */\nexport default class PromiseRejectionError extends Error {\n constructor(message) {\n super(message || 'Caught an unhandled promise rejection')\n this.name = 'PromiseRejectionError'\n }\n}\n","/**\n * Code sourced from https://github.com/arunredhu/vuejs_boilerplate/blob/master/src/app/shared/services/app-logger/app-logger.js\n * on 24/10/2022 9:52 AM\n */\n\n/* eslint no-console: [\"off\"] */\nimport config from '@/common/config'\nimport UnknownAppError from '@/models/error/unknownAppError'\nimport VueErrorDTO from '@/models/error/vueErrorDTO'\nimport WindowErrorDTO from '@/models/error/windowErrorDTO'\nimport Environment from '@/shared/constants/core/Environment'\nimport Vue from 'vue'\nimport store from '@state/store.js'\nimport { compileCustomProperties } from '@/helpers/log-helper'\nimport StoreErrorDTO from '@/models/error/storeErrorDTO'\nimport PromiseRejectionError from '@/models/error/promiseRejectionError'\n\n/**\n * @description Logger class\n * This is responsible for logging of all kinds of info in the application\n * Default, we are using the console api for logging and this provides the basic level of logging such as\n * you can use the available method of console in developement but in production these will be replaced with empty methods\n * This can be extended with the help of adding Log level functionality\n */\nclass AppLogger {\n /**\n * @constructor AppLogger\n */\n constructor() {\n /** Initializing the configuration of logger */\n this.initLogger()\n }\n\n /**\n * @description Initializing the configuration such as if environment is production then all log method will be replaced with empty methods\n * except logError, which will be responsible for logging the important info on server or logging service\n */\n initLogger() {\n // Checking the environment\n if (config.get('env') !== Environment.production) {\n this.log = console.log.bind(console)\n\n this.debug = console.debug.bind(console)\n\n this.info = console.info.bind(console)\n\n this.warn = console.warn.bind(console)\n\n this.error = console.error.bind(console)\n\n this.logError = this.error\n } else {\n // In case of production replace the functions definition\n this.log = this.debug = this.info = this.warn = this.error = () => {}\n\n this.logError = (err) => {\n switch (true) {\n case err instanceof VueErrorDTO: {\n const properties = compileCustomProperties(\n store,\n {\n info: err.info,\n route: err.vm?.$route?.name,\n component:\n err.vm?.$options?.name ||\n 'Name prop not set for this component',\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: err.err,\n properties,\n })\n break\n }\n\n case err instanceof WindowErrorDTO: {\n const properties = compileCustomProperties(store, err, true)\n\n Vue.prototype.$appInsights.trackException({\n exception: err.error,\n properties,\n })\n break\n }\n\n case err instanceof PromiseRejectionEvent: {\n const properties = compileCustomProperties(\n store,\n {\n reason: err?.reason,\n type: err?.type,\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: new PromiseRejectionError(err.reason),\n properties,\n })\n break\n }\n case err instanceof StoreErrorDTO: {\n const properties = compileCustomProperties(\n store,\n {\n module: err.module,\n errorResponse: {\n source: err?.errorResponse?.source,\n type: err?.errorResponse?.type,\n message: err?.errorResponse?.message,\n },\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: err.err,\n properties,\n })\n break\n }\n\n default: {\n const properties = compileCustomProperties(\n store,\n {\n error: err,\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: new UnknownAppError(),\n properties,\n })\n break\n }\n }\n }\n }\n }\n}\n\n/** Creating the instance of logger */\nconst logger = new AppLogger()\n\nexport { logger }\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[(_vm.isAppLoading)?_c('Loading'):_c('RouterView',{key:_vm.$route.fullPath})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n
\n \n \n \n
\n\n\n\n\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./app.vue?vue&type=template&id=74ee574d&\"\nimport script from \"./app.vue?vue&type=script&lang=js&\"\nexport * from \"./app.vue?vue&type=script&lang=js&\"\nimport style0 from \"./app.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export default Object.freeze({\n home: {\n name: 'home',\n path: '/',\n },\n myAvailability: {\n name: 'myAvailability',\n path: '/availability',\n },\n clientOverview: {\n path: '/overview',\n name: 'client-overview',\n },\n clientGroupOverview: {\n path: '/group-overview',\n name: 'clientGroupOverview',\n },\n timesheets: {\n path: '/timesheets',\n name: 'timesheets',\n },\n candidates: {\n path: '/candidates',\n name: 'candidates',\n },\n help: {\n path: '/help',\n name: 'help',\n },\n bookings: {\n path: '/bookings',\n },\n bookingsCreate: {\n path: 'create',\n name: 'bookings-create',\n },\n settings: {\n name: 'settings',\n path: '/settings',\n },\n changePassword: {\n name: 'changePassword',\n path: '/settings/change-password',\n },\n login: {\n name: 'login',\n path: '/login',\n },\n impersonateLogout: {\n name: 'impersonateLogout',\n path: '/user/impersonate/logout',\n },\n impersonateLogin: {\n name: 'impersonateLogin',\n path: '/user/impersonate/:contactId',\n },\n finance: {\n name: 'finance',\n path: '/finance',\n },\n invoiceDetails: {\n path: '/finance/invoices/:invoiceNo',\n name: 'invoice-view',\n },\n logout: {\n name: 'logout',\n path: '/logout',\n },\n underConstruction: {\n name: 'underConstruction',\n path: '/under-construction',\n },\n notFound: {\n name: 'NotFoundPage',\n path: '/404',\n },\n error: {\n name: 'ErrorPage',\n path: '/500',\n },\n unauthorized: {\n name: 'UnauthorizedPage',\n path: '/401',\n },\n forbidden: {\n name: 'ForbiddenPage',\n path: '/403',\n },\n accountLoadFailure: {\n name: 'AccountLoadFailedPage',\n },\n noServerResponse: {\n name: 'NoServerResponsePage',\n },\n actionLocked: {\n name: 'accountLockedError',\n },\n})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-btn',_vm._g(_vm._b({},'v-btn',Object.assign({}, _vm.commonAttributes, _vm.$attrs),false),_vm.$listeners),[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n \n \n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-button.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-button.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-button.vue?vue&type=template&id=f330c106&\"\nimport script from \"./_base-button.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-button.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\ninstallComponents(component, {VBtn})\n","export const LogoForm = Object.freeze({\n FULL: 'Full',\n SHORT: 'Short',\n ICON: 'Icon',\n NONE: '',\n})\n","const initResultObject = (\n isSuccess = false,\n error = null,\n data = null,\n message = '',\n statusCode = null\n) => {\n return { isSuccess, error, data, message, statusCode }\n}\n\n/**\n * Successful operation. isSuccess is set to true\n * @param {*} data\n * @param {String} msg\n * @param {Number} statusCode\n * @returns\n */\nexport const success = (data = null, msg = '', statusCode = 200) =>\n initResultObject(true, null, data, msg, statusCode)\n\n/**\n * Failed operation. isSuccess is set to false\n * @param {Object} error\n * @param {String} msg\n * @param {Number} statusCode\n * @returns\n */\nexport const fail = (error = null, msg = '', statusCode = 400) =>\n initResultObject(false, error, null, msg, statusCode)\n","import config from '@common/config.js'\nimport { PublicClientApplication } from '@azure/msal-browser'\n\nexport default new PublicClientApplication(config.get('msalConfig'))\n","import $date from '@/services/date'\nimport { isEmpty } from 'lodash'\n\nconst isCacheFresh = ({\n cacheDuration,\n durationUnits,\n lastUpdated,\n forceRefresh = false,\n}) => {\n // If not being forced to refresh and it hasn't been longer than staleness threshold\n // return resource without API call\n return (\n !isEmpty(lastUpdated) &&\n !forceRefresh &&\n $date().diff(lastUpdated, durationUnits) < cacheDuration\n )\n}\n\nconst getSavedState = (key) => {\n const item = window.localStorage.getItem(key)\n return item && item !== 'undefined' ? JSON.parse(item) : ''\n}\n\nconst saveState = (key, state) => {\n window.localStorage.setItem(key, JSON.stringify(state))\n}\n\nconst deleteState = (key) => {\n saveState(key, null) // extra precaution\n window.localStorage.removeItem(key)\n}\n\nexport { isCacheFresh, saveState, deleteState, getSavedState }\n","import httpStatus from 'statuses'\n\nconst isHttpStatus = (response, statusCode = 'OK') => {\n return response === httpStatus(statusCode)\n}\n\nconst isSuccess = (response) => {\n return (\n isHttpStatus(response, 'OK') ||\n isHttpStatus(response, 'No Content') ||\n isHttpStatus(response, 'Created')\n )\n}\n\nexport { isSuccess, isHttpStatus }\n","export const Tags = Object.freeze({\n /**\n * This is the primary location/client or group for this contact\n */\n PRIMARY: 'primary',\n /**\n * This contact will be notified of any bookings at this location/client or group\n * (aka confirmed contact)\n */\n CONFIRMED: 'confirmed',\n /**\n * Signifies that the replace me feature is enabled at this location/client or group\n */\n REPLACE_ME_ENABLED: 'replace_me_feature_enabled',\n})\n","/**\n * Validates that an object has every key provided in the expected array\n * @param {Array} expected\n * @param {Object} obj\n * @returns {Boolean}\n */\nexport default function objectHasKeys(expected = [], obj = {}) {\n if (!expected || !Array.isArray(expected) || expected.length === 0)\n throw Error('Expected array needs to be a valid, non-empty array')\n\n if (!obj) throw Error('Object needs to be non-empty')\n\n return expected.every((key) => Object.prototype.hasOwnProperty.call(obj, key))\n}\n","export default Object.freeze({\n /**\n * Error is undetermined\n */\n unknown: 'UnknownError',\n /**\n * An internal api error.\n */\n api: 'ApiError',\n /**\n * One or more of the input parameters failed validation.\n */\n validation: 'ValidationError',\n /**\n * An authorisation or authentication error.\n */\n security: 'SecurityError',\n /**\n * Resource not found\n */\n notFoundError: 'NotFoundError',\n})\n","import ErrorResponseType from '@/shared/constants/error/ErrorResponseType'\nimport RequestErrorSource from '@/shared/constants/error/RequestErrorSource'\n\nexport default class ErrorResponse {\n constructor({\n _error = null,\n data = null,\n source = RequestErrorSource.unknown,\n type = ErrorResponseType.unknown,\n code = '',\n message = '',\n param = null,\n } = {}) {\n /**\n * @property {Object} The original error object returned from request attempt\n */\n this._error = _error\n\n /**\n * @property {Object} Container prop to transmit any relevant data down the pipeline\n */\n this.data = data\n\n /**\n * @property {RequestErrorSource} Indicates at what stage the error was triggered when attempting the request\n */\n this.source = source\n\n /**\n * @property {ErrorResponseType} The type of error received from the response (set to unknown if response wasn't received)\n */\n this.type = type\n\n /**\n * @property {string} Error code that may be received from the response or determined locally\n */\n this.code = code\n\n /**\n * @property {string} Message to relate error information to the user\n */\n this.message = message\n\n /**\n * @property {string} Contains the parameter in error (if applicable)\n */\n this.param = param\n }\n}\n","import objectHasKeys from '@/utils/object-has-keys'\nimport ErrorResponseType from '@/shared/constants/error/ErrorResponseType'\nimport RequestErrorSource from '@/shared/constants/error/RequestErrorSource'\nimport ErrorResponse from '@/models/error/ErrorResponse'\nimport { isEmpty } from 'lodash'\n\n// Utils\n\nconst determineRequestErrorType = (error) => {\n if (error?.response) return RequestErrorSource.server\n else if (error?.request) return RequestErrorSource.request\n else return RequestErrorSource.unknown\n}\n\n/**\n * Default API request validation response\n *\n * Object Structure:\n * ```json\n * {\n errors: Object,\n status: Number,\n title: String?,\n traceId: String?,\n type: String?,\n }\n * ```\n *\n * @param {Object} responseData\n * @returns\n */\nconst mapApiValidationErrorResponseToError = (error, errorSource, $i18n) => {\n const base = baseErrorResponse(error, errorSource, $i18n)\n base.data = error.response?.data?.errors\n base.type = error.response?.data?.type || ErrorResponseType.api\n base.message = error.response?.data?.title || base.message\n\n return base\n}\n\n/**\n * Ready2WorkAPI.DTOs.V1.Core.ErrorResponse\n *\n * Object Structure:\n * ```json\n * {\n type: String?,\n code: String?,\n message: String?,\n param: String?,\n }\n * ```\n *\n * @returns\n */\nconst mapR2WErrorResponseToError = (error, errorSource, $i18n) => {\n const base = baseErrorResponse(error, errorSource, $i18n)\n base.type = error.response?.data?.type || ErrorResponseType.api\n base.code = error.response?.data?.code || base.code\n base.message = error.response?.data?.message || base.message\n base.param = error.response?.data?.param\n return base\n}\n\n// Constants\nconst BASE_ERROR_RESPONSE_OBJ_KEYS = ['type', 'code', 'param']\nconst API_VALIDATION_ERROR_OBJ_KEYS = [\n 'errors',\n 'status',\n 'title',\n 'traceId',\n 'type',\n]\n\n// Abstract Product\nconst baseErrorResponse = (error, errorSource, $i18n) => {\n return new ErrorResponse({\n _error: error,\n source: errorSource,\n type: ErrorResponseType.unknown,\n message: $i18n.t('error.genericApiError'),\n })\n}\n\n// Factory\nexport default function(error, $i18n) {\n const errorSource = determineRequestErrorType(error)\n\n switch (errorSource) {\n case RequestErrorSource.server:\n return serverErrorResponse(error, errorSource, $i18n)\n case RequestErrorSource.request:\n return requestErrorResponse(error, errorSource, $i18n)\n default:\n return baseErrorResponse(error, errorSource, $i18n)\n }\n}\n\n// Concrete Products\nconst serverErrorResponse = (error, errorSource, $i18n) => {\n if (!error?.response || isEmpty(error?.response) || !error?.response?.data)\n return baseErrorResponse(error, errorSource, $i18n)\n\n // Case: Default API request validation response\n if (objectHasKeys(API_VALIDATION_ERROR_OBJ_KEYS, error.response?.data)) {\n return mapApiValidationErrorResponseToError(error, errorSource, $i18n)\n }\n\n // Case: Ready2WorkAPI.DTOs.V1.Core.ErrorResponse\n if (objectHasKeys(BASE_ERROR_RESPONSE_OBJ_KEYS, error.response?.data))\n return mapR2WErrorResponseToError(error, errorSource, $i18n)\n\n // Default Case\n return baseErrorResponse(error, errorSource, $i18n)\n}\n\nconst requestErrorResponse = (error, errorSource, $i18n) => {\n return baseErrorResponse(error, errorSource, $i18n)\n}\n","import { fail, success } from '@/helpers/result-helper.js'\nimport router from '@router'\nimport firebase from '@/plugins/firebase'\nimport toast from '@/services/toasts/index.js'\nimport msal from '@plugins/msal'\nimport $date from '@/services/date/index.js'\nimport {\n isCacheFresh,\n getSavedState,\n saveState,\n deleteState,\n} from '@/helpers/cache-helpers'\nimport { DurationUnits } from '@/shared/constants/date/DurationUnits.js'\nimport { isSuccess } from '@/helpers/http-status-helpers'\nimport { LinkType } from '@/shared/constants/permissions/LinkType'\nimport {\n processPermissionsPayload,\n getNodeById,\n getNodePermission,\n hasPermissionAtAnyLevel,\n iterateOverPermissionsTree,\n flattenAccessTree,\n flattenPermissionsWithLocations,\n} from '@/helpers/permissions-helpers'\nimport { PermissionModifier } from '@/shared/constants/permissions/PermissionModifier'\nimport { PermissionScope } from '@/shared/constants/permissions/PermissionScope'\nimport { OperationReturnType } from '@/shared/constants/permissions/OperationReturnType'\nimport { Tags } from '@/shared/constants/permissions/Tags.js'\nimport config from '@common/config.js'\nimport { getLanguageBasedOnBaseURL } from '@/helpers/language-helpers'\nimport ErrorResponseFactory from '@/services/error/ErrorResponseFactory'\nimport StoreErrorDTO from '@/models/error/storeErrorDTO'\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\n\nexport default {\n namespaced: true,\n state: {\n // MSAL User\n account: getSavedState('auth.account'),\n interactionRequired: true,\n // User Profile from DB\n currentUser: getSavedState('auth.currentUser'),\n accessToken: '', // Bearer token\n lastTokenRefresh: null,\n loadingCount: 0,\n auth: firebase,\n permissions: [],\n generalFiles: [],\n impersonateContactId: getSavedState('auth.impersonateContactId'),\n username: null, // used to track errors when user profile is not set\n },\n\n mutations: {\n SET_CURRENT_USER(state, newValue) {\n state.currentUser = { ...newValue, ...{ lastUpdated: $date() } }\n saveState('auth.currentUser', state.currentUser)\n },\n SET_ACCOUNT(state, newValue) {\n state.account = newValue\n saveState('auth.account', newValue)\n },\n SET_IMPERSONATE_CONTACT_ID(state, contactId) {\n state.impersonateContactId = contactId\n saveState('auth.impersonateContactId', contactId)\n },\n SET_USER_PERMISSIONS(state, permissions) {\n state.permissions = processPermissionsPayload(permissions)\n },\n SET_USER_GENERALFILES(state, files) {\n state.generalFiles = files\n },\n SET_INTERACTION_REQUIRED(state, newValue) {\n state.interactionRequired = newValue\n },\n SET_ACCESS_TOKEN(state, token) {\n state.accessToken = token\n state.interactionRequired = false\n state.lastTokenRefresh = $date()\n },\n SET_USER_TO_UNAUTHENTICATED(state) {\n state.account = null\n state.interactionRequired = true\n state.currentUser = null\n state.impersonateContactId = null\n deleteState('auth.account')\n deleteState('auth.currentUser')\n deleteState('auth.impersonateContactId')\n deleteState('client.id')\n deleteState('client.name')\n state.accessToken = null\n state.username = null\n\n sessionStorage.clear()\n localStorage.clear()\n },\n FRESH_IMPERSONATE_CLEAR_STORE(state) {\n state.currentUser = null\n state.impersonateContactId = null\n state.permission = []\n deleteState('auth.currentUser')\n deleteState('auth.impersonateContactId')\n deleteState('client.id')\n deleteState('client.name')\n },\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n SET_USERNAME(state, username) {\n state.username = username\n },\n },\n\n getters: {\n moduleName: () => 'auth',\n currentUserFullName: (state) =>\n state.currentUser\n ? `${state.currentUser.firstName} ${state.currentUser.lastName}`\n : '',\n currentUserEmail: (state) =>\n state.currentUser\n ? state.currentUser.emailAddress\n : state.username || 'not_specified',\n currentUser: (state) => state.currentUser,\n currentUserContactId: (state) =>\n state.currentUser?.id || state.impersonateContactId || 'not_specified',\n currentUserSimple: (state, getters) => {\n return {\n id: getters.currentUserContactId || '',\n emailAddress: getters.currentUserEmail || '',\n isImpersonating: getters.hasImpersonateContactId,\n }\n },\n isClientGroupOverviewEnabled: (state, getters) =>\n getters.currentUser?.isClientGroupOverviewEnabled,\n msalAccount: (state) => state.account,\n impersonateContactId: (state) => state.impersonateContactId,\n hasImpersonateContactId: (state) => !!state.impersonateContactId,\n getUserStandardBookingDetails: (state) => {\n const standardBookings = state.currentUser?.standardBookings\n if (!standardBookings || standardBookings.length === 0) return null\n return standardBookings[0]\n },\n accessToken: (state) => state.accessToken,\n lastTokenRefresh: (state) => state.lastTokenRefresh,\n isUserLoggedIn: (state) =>\n state.accessToken && (!state.interactionRequired || !!state.account),\n\n isLoadingAuth: (state) => state.loadingCount > 0,\n isInteractionRequired: (state) => state.interactionRequired,\n auth: (state) => state.auth,\n msalInstance: (state) => msal,\n permissions: (state) => state.permissions,\n redirectToClientOverview: (state) => {\n let clientCount = 0\n\n if (!state.permissions || state.permissions.length === 0) return false\n\n for (const group of state.permissions) {\n clientCount += group.clients.length\n }\n\n return clientCount > 1\n },\n hasMultipleClients: (state, getters) => {\n return getters.redirectToClientOverview\n },\n firstAvailableClient: (state) => {\n return state.permissions[0].clients[0]\n },\n getNode: (state) => (nodeId, level) => {\n return getNodeById(state.permissions, nodeId, level)\n },\n getGroup: (state, getters) => (id) => {\n return getters.getNode(id, LinkType.GROUP)\n },\n getClient: (state, getters) => (id) => {\n return getters.getNode(id, LinkType.CLIENT)\n },\n getLocation: (state, getters) => (id) => {\n return getters.getNode(id, LinkType.LOCATION)\n },\n getClientLocations: (state, getters) => (id) => {\n const client = getters.getClient(id)\n return client.locations\n },\n getNodeHierarchyByIdAndLevel: (state) => (id, linkType) => {\n const flatTree = flattenPermissionsWithLocations(state.permissions)\n if (!flatTree) return null\n\n switch (linkType) {\n case LinkType.GROUP:\n return flatTree.find((x) => x.groupId === id)\n case LinkType.CLIENT:\n return flatTree.find((x) => x.clientId === id)\n case LinkType.LOCATION:\n return flatTree.find((x) => x.locationId === id)\n default:\n return null\n }\n },\n getFirstClientLocationWithReplaceMePermissions: (state, getters) => (\n clientId\n ) => {\n return getters.getFirstClientLocationWithPermissions(\n clientId,\n PermissionScope.REPLACE_ME\n )\n },\n getAllClients: (state, getters) => {\n return iterateOverPermissionsTree(\n state.permissions,\n LinkType.CLIENT,\n OperationReturnType.LIST\n )\n },\n getAllClientGroups: (state, getters) => {\n return iterateOverPermissionsTree(\n state.permissions,\n LinkType.GROUP,\n OperationReturnType.LIST\n )\n },\n countAllAvailableLocations: (state, getters) => {\n return iterateOverPermissionsTree(\n state.permissions,\n LinkType.LOCATION,\n OperationReturnType.LIST\n ).length\n },\n countAllAvailableBookingLocations: (state, getters) => {\n const list = iterateOverPermissionsTree(\n state.permissions,\n LinkType.LOCATION,\n OperationReturnType.LIST\n )\n\n return list.filter(\n (locationNode) => locationNode?.access?.permissions?.booking?.view\n ).length\n },\n getTimezoneFromFirstClientGroupLocation: (state, getters) => (\n clientGroupId\n ) => {\n const clientGroup = getters.getGroup(clientGroupId)\n\n if (\n !clientGroup ||\n !isNonEmptyArray(clientGroup?.clients) ||\n !isNonEmptyArray(clientGroup?.clients[0]?.locations)\n )\n return ''\n\n return clientGroup?.clients[0]?.locations[0]?.timeZone\n },\n getPermission: (state) => (\n id,\n level,\n scope,\n permission = PermissionModifier.ALL\n ) => {\n return getNodePermission(\n state.permissions,\n id,\n level,\n scope,\n permission // TODO: When more complex permissions required (view, modify, delete) create new perm helpers that use other PermissionModifiers\n )\n },\n hasLocationAccountsPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.ACCOUNTS\n )\n },\n hasLocationBookingPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.BOOKING\n )\n },\n hasLocationTimesheetPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.TIMESHEETS\n )\n },\n hasLocationReplaceMePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.REPLACE_ME\n )\n },\n hasClientAccountsPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.ACCOUNTS\n )\n },\n hasClientBookingPermission: (state, getters) => (id) => {\n return getters.getPermission(id, LinkType.CLIENT, PermissionScope.BOOKING)\n },\n hasClientTimesheetPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.TIMESHEETS\n )\n },\n hasClientReplaceMePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.REPLACE_ME\n )\n },\n hasGroupAccountsPermission: (state, getters) => (id) => {\n return getters.getPermission(id, LinkType.GROUP, PermissionScope.ACCOUNTS)\n },\n hasGroupBookingPermission: (state, getters) => (id) => {\n return getters.getPermission(id, LinkType.GROUP, PermissionScope.BOOKING)\n },\n hasGroupTimesheetPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.GROUP,\n PermissionScope.TIMESHEETS\n )\n },\n hasGroupReplaceMePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.GROUP,\n PermissionScope.REPLACE_ME\n )\n },\n hasPermissionRegardlessOfLevel: (state, getters) => (permissionScope) => {\n return hasPermissionAtAnyLevel(state.permissions, permissionScope)\n },\n flatAccessTree: (state) => {\n return flattenAccessTree(state.permissions)\n },\n getGeneralFiles: (state) => state.generalFiles,\n getFirstClientLocationWithPermissions: (state, getters) => (\n clientId,\n permissionScope\n ) => {\n const client = getters.getClient(clientId)\n if (!client) return null\n if (client.locations.length === 0) return null\n\n // If client has permission, return first location\n if (getters.getPermission(clientId, LinkType.CLIENT, permissionScope)) {\n return client.locations[0]\n }\n\n // Otherwise find first client location with permissions\n const firstAuthorisedLocation = client.locations.find(\n (x) => x.access?.permissions?.[permissionScope]\n )\n return firstAuthorisedLocation\n },\n getAllClientLocationsWithPermission: (state, getters) => (\n clientId,\n permissionScope\n ) => {\n const client = getters.getClient(clientId)\n if (!client || client?.locations.length === 0) return false\n\n // If client has permission, return all locations\n if (getters.getPermission(clientId, LinkType.CLIENT, permissionScope)) {\n return client.locations\n }\n\n const locations = []\n for (const location of client.locations) {\n if (\n getters.getPermission(\n location.locationId,\n LinkType.LOCATION,\n permissionScope\n )\n )\n locations.push(location)\n }\n\n return locations\n },\n getAllClientLocationsWithReplaceMePermission: (state, getters) => (\n clientId\n ) => {\n const client = getters.getClient(clientId)\n if (!client || client?.locations.length === 0) return false\n\n const locations = []\n for (const location of client.locations) {\n if (\n !!location.tags.find((tag) => tag === Tags.REPLACE_ME_ENABLED) &&\n getters.hasLocationReplaceMePermission(location.locationId)\n )\n locations.push(location)\n }\n\n return locations\n },\n hasPermissionForAtleastOneClientLocation: (state, getters) => (\n clientId,\n permissionScope\n ) => {\n const client = getters.getClient(clientId)\n if (!client || client?.locations.length === 0) return false\n\n // Check if client has permission\n if (getters.getPermission(clientId, LinkType.CLIENT, permissionScope))\n return true\n\n // Check if at least one location has the permission\n for (const location of client.locations) {\n if (\n getters.getPermission(\n location.locationId,\n LinkType.LOCATION,\n permissionScope\n )\n )\n return true\n }\n\n return false\n },\n hasReplaceMePermissionForAtleastOneClientLocation: (state, getters) => (\n clientId\n ) => {\n const client = getters.getClient(clientId)\n if (!client || client?.locations.length === 0) return false\n for (const location of client.locations) {\n if (\n !!location.tags.find((tag) => tag === Tags.REPLACE_ME_ENABLED) &&\n getters.hasLocationReplaceMePermission(location.locationId)\n )\n return true\n }\n\n return false\n },\n hasCreateBookingPermissionForAtleastOneClientLocation: (state, getters) => (\n clientId\n ) => {\n const hasCreateBookingPermission = getters.getFirstClientLocationWithPermissions(\n clientId,\n PermissionScope.BOOKING\n )\n\n return !!hasCreateBookingPermission\n },\n },\n\n actions: {\n // This is automatically run in `src/state/store.js` when the app\n // starts, along with any other actions named `init` in other modules.\n init({ dispatch }) {},\n\n // Login via firebase\n async logIn({ dispatch, getters, commit }, { username, password }) {\n // Clean out localStorage to ensure AAD credentials don't remain\n dispatch('clearStore', null, { root: true })\n\n // Setting username in the store to assist with logging\n commit('SET_USERNAME', username)\n\n if (getters.isUserLoggedIn) return dispatch('refreshToken')\n\n commit('START_LOADING')\n\n return await firebase\n .auth()\n .signInWithEmailAndPassword(username, password)\n .then(async (response) => {\n if (!response.user)\n return Promise.reject(\n fail([], this.$i18n.t('auth.loginGetProfileFailureErrorText'))\n )\n commit('SET_INTERACTION_REQUIRED', false)\n return success()\n })\n .catch((error) => {\n let message = ''\n if (error.code === 'auth/wrong-password')\n message = this.$i18n.t('auth.loginWrongPasswordErrorText')\n else if (error.code === 'auth/user-not-found')\n message = this.$i18n.t('auth.loginUserNotFoundErrorText')\n else message = error.message\n\n return fail([], message)\n })\n .finally(() => {\n commit('FINISH_LOADING')\n })\n },\n\n /**\n * Handles redirect auth from MSAL\n * @param {Object} response Response will be populated on msal login\n */\n async handleRedirect({ dispatch }, response) {\n // Redirect to home after login\n if (response !== null) {\n await dispatch('getUserFromMsalProvider')\n router.push({ name: 'home' })\n }\n\n // In case multiple accounts exist, you can select\n const currentAccounts = msal.getAllAccounts()\n if (currentAccounts.length > 0) {\n // TODO: Add choose account code here\n await dispatch('getUserFromMsalProvider')\n }\n },\n\n // Handles already logged in impersonate redirect from login page\n async msalAlreadyLoggedInRedirect(\n { dispatch, commit },\n impersonateContactId\n ) {\n // Attempt to log out of firebase & clear out store in preperation\n try {\n await dispatch('firebaseLogOut', {\n nuke: false,\n showNotifications: false,\n redirect: false,\n setUnauthenticated: false,\n })\n } catch {}\n\n // Clear out certain values that need to be retrieved from API\n await dispatch('client/clear', null, { root: true })\n commit('FRESH_IMPERSONATE_CLEAR_STORE')\n\n // Set the new impersonate contact Id\n commit('SET_IMPERSONATE_CONTACT_ID', impersonateContactId)\n\n // Redirect to dashboard\n router.push({ name: 'home' })\n },\n\n async clearImpersonateId({ commit }) {\n commit('FRESH_IMPERSONATE_CLEAR_STORE')\n },\n\n // Logs in the current user.\n async msalLogIn({ dispatch, getters, commit }, impersonateContactId) {\n // Attempt to log out of firebase & clear out store in preperation\n try {\n await dispatch('firebaseLogOut', {\n nuke: true,\n showNotifications: false,\n redirect: false,\n setUnauthenticated: false,\n })\n } catch {}\n\n commit('SET_IMPERSONATE_CONTACT_ID', impersonateContactId)\n\n if (getters.isUserLoggedIn) return dispatch('msalRefreshToken')\n\n const loginRequest = {\n scopes: ['openid'],\n }\n\n msal.loginRedirect(loginRequest).catch((error) => {\n commit('SET_USER_TO_UNAUTHENTICATED')\n\n const errorCode = error.errorCode\n\n const noNotificationReq = ['user_cancelled']\n\n // Filter through errors that don't require a notifiction\n if (noNotificationReq.some((v) => errorCode.includes(v)))\n return fail(error)\n\n toast.error('Failed to login as impersonated contact')\n return fail(error)\n })\n },\n\n // Logs out the current user.\n async msalLogOut(\n { commit, dispatch },\n payload = { redirect: true, nuke: true }\n ) {\n const { redirect, nuke } = payload\n\n commit('START_LOADING')\n\n return await msal\n .logout({})\n .then(() => {\n commit('SET_USER_TO_UNAUTHENTICATED')\n // Nuke store\n if (nuke) dispatch('clearStore', null, { root: true })\n if (redirect)\n router.push({ path: `${getLanguageBasedOnBaseURL()}/landing` })\n\n return success()\n })\n .catch((error) => {\n toast.error(this.$i18n.t('auth.signOutFailureErrorText'))\n return fail(error)\n })\n .finally(() => {\n commit('FINISH_LOADING')\n })\n },\n\n // Retrieves user account from auth provider\n getUserFromMsalProvider({ commit, dispatch }) {\n if (!msal) return Promise.resolve(null)\n\n try {\n const myAccounts = msal.getAllAccounts()\n commit('SET_ACCOUNT', myAccounts[0])\n } catch {\n commit('SET_ACCOUNT', null)\n }\n },\n\n // Validates the current user's token and refreshes it\n // with new data from the API.\n async msalRefreshToken({ dispatch, commit, state }) {\n if (!msal) return Promise.resolve(fail()) // Prevents trying to access auth object before it is initialised\n await dispatch('getUserFromMsalProvider')\n if (!state.account) return Promise.resolve(fail())\n\n commit('SET_USERNAME', state.account?.username)\n\n commit('START_LOADING')\n\n const request = {\n scopes: [config.get('scopes.openId'), config.get('scopes.read')],\n account: state.account,\n }\n\n let response\n\n try {\n response = await msal.acquireTokenSilent(request)\n commit('SET_ACCESS_TOKEN', response.accessToken)\n return success()\n } catch (error) {\n console.warn('Silent token acquisition failed. Using interactive mode')\n return await msal\n .acquireTokenPopup(request)\n .then((response) => {\n commit('SET_ACCESS_TOKEN', response.accessToken)\n return success()\n })\n .catch(() => {\n toast.error('Failed to authenticate as impersonated contact')\n return fail()\n })\n } finally {\n commit('FINISH_LOADING')\n }\n },\n\n // Logs out the current user.\n async logOut({ getters, dispatch }, payload) {\n return dispatch(\n getters.impersonateContactId ? 'msalLogOut' : 'firebaseLogOut',\n payload\n )\n },\n\n // Logs out the current user.\n async firebaseLogOut(\n { commit, dispatch },\n payload = {\n redirect: true,\n nuke: true,\n showNotifications: true,\n setUnauthenticated: true,\n }\n ) {\n const { redirect, nuke, showNotifications, setUnauthenticated } = payload\n\n commit('START_LOADING')\n return await firebase\n .auth()\n .signOut()\n .then(() => {\n if (setUnauthenticated) commit('SET_USER_TO_UNAUTHENTICATED')\n // Nuke store\n if (nuke) dispatch('clearStore', null, { root: true })\n if (redirect)\n window.location.href = `/${getLanguageBasedOnBaseURL()}/landing`\n\n return success()\n })\n .catch((error) => {\n if (showNotifications)\n toast.error(this.$i18n.t('auth.signOutFailureErrorText'))\n return fail(error)\n })\n .finally(() => {\n commit('FINISH_LOADING')\n })\n },\n\n async refreshToken({ dispatch, getters }, forceRefresh = false) {\n return await dispatch(\n getters.impersonateContactId\n ? 'msalRefreshToken'\n : 'firebaseRefreshToken',\n forceRefresh\n )\n },\n\n /**\n * Checks freshness of access token and will force refresh the token if token\n * is considered stale\n * @param {*} context Vuex context\n * @param {Boolean} forceRefresh Forces a token refresh\n * @returns Access token\n */\n async getAccessTokenOrRefresh({ dispatch, getters }, forceRefresh = false) {\n const isAccessTokenFresh = isCacheFresh({\n cacheDuration: 30,\n durationUnits: DurationUnits.MINUTE,\n lastUpdated: getters.lastTokenRefresh,\n forceRefresh,\n })\n\n if (!isAccessTokenFresh) {\n await dispatch('refreshToken', true)\n }\n\n return getters.accessToken\n },\n\n // Validates the current user's token and refreshes it using Firebase\n // with new data from the API.\n async firebaseRefreshToken({ commit }, forceRefresh = false) {\n const currentUser = firebase.auth().currentUser\n commit('SET_USERNAME', currentUser?.email)\n\n return currentUser\n .getIdToken(forceRefresh)\n .then(function(idToken) {\n commit('SET_ACCESS_TOKEN', idToken)\n return Promise.resolve(success())\n })\n .catch(function(error) {\n console.warn(error)\n\n // Handle error\n commit('SET_USER_TO_UNAUTHENTICATED')\n return Promise.resolve(fail(error))\n })\n },\n\n async resetPasswordAsync({ commit }, payload) {\n commit('START_LOADING')\n\n return await firebase\n .auth()\n .sendPasswordResetEmail(payload.email)\n .then(() => {\n toast.success(this.$i18n.t('auth.resetPasswordSuccessText'))\n return success()\n })\n .catch((error) => {\n let message = ''\n if (error.code === 'auth/user-not-found')\n message = this.$i18n.t(\n 'auth.resetPasswordAccountDoesNotExistErrorText'\n )\n else message = error.message\n\n return fail([], message)\n })\n .finally(() => commit('FINISH_LOADING'))\n },\n\n /**\n * Used to reauthenticate a user before a sensative action (e.g. change password, change email address)\n * This is a security requirement enforced by firebase.\n * Read more: https://firebase.google.com/docs/reference/js/firebase.User#reauthenticatewithcredential\n * @param {String} password\n */\n async reauthenticateWithCredentialsAsync({ commit }, password) {\n commit('START_LOADING')\n\n const user = firebase.auth().currentUser\n\n // Prepare auth credentials\n const credentials = firebase.auth.EmailAuthProvider.credential(\n user.email,\n password\n )\n\n // Use credentials to reauthenticate user\n return await user\n .reauthenticateWithCredential(credentials)\n .then(() => {\n return success()\n })\n .catch(() => {\n toast.error(\n this.$i18n.t('auth.failedToAuthenticateWithCredsErrorText')\n )\n return fail()\n })\n .finally(() => commit('FINISH_LOADING'))\n },\n\n async changePasswordAsync({ commit }, payload) {\n commit('START_LOADING')\n\n const user = firebase.auth().currentUser\n\n return await user\n .updatePassword(payload.newPass)\n .then(() => {\n toast.success(this.$i18n.t('auth.changePasswordSuccessText'))\n return success()\n })\n .catch((error) => {\n return fail(error)\n })\n .finally(() => commit('FINISH_LOADING'))\n },\n\n /**\n * Loads user profile from ClientLogin API.\n * @param {Boolean} forceRefresh forces refresh of user profile, bypassing the cache\n * @returns\n */\n async getCurrentUserProfile(\n { commit, dispatch, getters },\n forceRefresh = false\n ) {\n // 1. Check cache freshness\n if (\n getters.currentUser &&\n getters.permissions &&\n getters.permissions.length > 0 &&\n isCacheFresh({\n cacheDuration: 2,\n durationUnits: DurationUnits.HOUR,\n lastUpdated: getters.currentUser.lastUpdated,\n forceRefresh,\n })\n )\n return success(getters.currentUser)\n\n // 2. Load profile from API & cache user profile\n commit('START_LOADING')\n\n try {\n const response = await this.$api.user.get()\n if (isSuccess(response.status)) {\n commit('SET_CURRENT_USER', response.data.contact)\n commit('SET_USER_PERMISSIONS', response.data.links)\n\n // After permission tree is set, verify that currently selected client\n // existing within tree\n dispatch('client/validateSelectedClient', null, { root: true })\n\n commit('SET_USER_GENERALFILES', response.data.generalFiles)\n\n return success(getters.currentUser)\n }\n } catch (ex) {\n const errorResponse = ErrorResponseFactory(ex, this.$i18n)\n\n await dispatch(\n 'logStoreException',\n new StoreErrorDTO({\n err: ex,\n module: getters.moduleName,\n errorResponse,\n }),\n { root: true }\n )\n\n return fail(errorResponse)\n } finally {\n commit('FINISH_LOADING')\n }\n },\n\n clear({ commit }) {\n commit('SET_USER_TO_UNAUTHENTICATED')\n },\n },\n}\n","import axios from 'axios'\nimport $date from '@services/date/index.js'\n\nconst getDefaultState = () => {\n return {\n cached: {\n list: [],\n lastUpdated: null,\n },\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'users',\n user: (state) => (id) => {\n return state.cached.find((user) => user.id === id)\n },\n users: (state) => {\n return state.cached\n },\n isLoadingUsers: (state) => state.loadingCount > 0,\n isLoadingUserCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n CACHE_USERS(state, users) {\n state.cached.list = users\n state.cached.lastUpdated = users ? $date() : null\n },\n CACHE_USER(state, newUser) {\n state.cached.list.push(newUser)\n },\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async fetchUser({ commit, state, rootState }, { username }) {\n // 1. Check if we already have the user as a current user.\n const { currentUser } = rootState.auth\n if (currentUser && currentUser.username === username) {\n return Promise.resolve(currentUser)\n }\n\n // 2. Check if we've already fetched and cached the user.\n const matchedUser = state.cached.list.find(\n (user) => user.username === username\n )\n if (matchedUser) {\n return Promise.resolve(matchedUser)\n }\n\n // 3. Fetch the user from the API and cache it in case\n // we need it again in the future.\n return axios.get(`/api/users/${username}`).then((response) => {\n const user = response.data\n commit('CACHE_USER', user)\n return user\n })\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper.js'\nimport toast from '@services/toasts/index.js'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\n\nexport default {\n namespaced: true,\n state: {\n loadingCount: 0,\n crudLoadingCount: 0,\n },\n getters: {\n moduleName: () => 'single-invoice',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n },\n actions: {\n async getInvoiceByInvoiceNo({ commit }, invoiceNo) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.invoices.getInvoiceByInvoiceNo(\n invoiceNo\n )\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n if (isHttpStatus(ex.response.status, 'Forbidden')) {\n return fail(null, '', 403)\n }\n\n toast.error('Cannot load invoice')\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n },\n}\n","export default class AddressViewModel {\n constructor({\n line1,\n line2,\n suburb,\n state,\n postcode,\n country,\n latitude,\n longitude,\n fullAddress,\n } = {}) {\n /**\n * Street address, line 1\n * @type {String}\n * @example '44 Diamond Avenue'\n */\n this.line1 = line1\n\n /**\n * Street address, line 2\n * @type {String}\n * @example 'Level 14'\n */\n this.line2 = line2\n\n /**\n * @type {String}\n * @example 'Collingwood'\n */\n this.suburb = suburb\n\n /**\n * @type {String}\n * @example 'Victoria'\n */\n this.state = state\n\n /**\n * @type {String}\n * @example '3000'\n */\n this.postcode = postcode\n\n /**\n * @type {String}\n * @example 'Australia'\n */\n this.country = country\n\n /**\n * @type {Number}\n * @example 34.51223\n */\n this.latitude = parseFloat(latitude)\n\n /**\n * @type {Number}\n * @example -145.92812\n */\n this.longitude = parseFloat(longitude)\n\n /**\n * The combination of all the address parts into a single string\n * @type {String}\n * @example '44 Diamond Avenue Level 14 Collingwood Victoria 3000 Australia'\n */\n this.fullAddress = fullAddress\n }\n}\n","import AddressViewModel from '../location/addressViewModel'\n\nexport default class ClientGroupOverviewViewModel {\n constructor({\n address = null,\n clientId,\n clientName,\n locationId,\n locationName,\n openBookings = 0,\n totalBookings = 0,\n } = {}) {\n /**\n * Location's address\n * @type {AddressViewModel}\n */\n this.address = address ? new AddressViewModel(address) : null\n\n /**\n * @type {Number}\n */\n this.clientId = clientId\n\n /**\n * @type {String}\n */\n this.clientName = clientName.trim()\n\n /**\n * @type {Number}\n */\n this.locationId = locationId\n\n /**\n * @type {String}\n */\n this.locationName = locationName.trim()\n\n const hasSameName =\n this.clientName === this.locationName || !this.locationName\n\n /**\n * Name to display in the UI. It's a combination of the client and location name.\n * If the loction name is the same or unset, it will just display the client name.\n * @type {String}\n */\n this.displayName = `${this.clientName}${hasSameName ? '' : ' - '}${\n hasSameName ? '' : this.locationName\n }`\n\n /**\n * Number of unfilled bookings\n * @type {Number}\n */\n this.openBookings = openBookings\n\n /**\n * Number of total bookings\n * @type {Number}\n */\n this.totalBookings = totalBookings\n }\n}\n","import ClientGroupOverviewViewModel from './clientGroupOverviewViewModel'\n\nexport default class ClientGroupOverviewWithFillRateViewModel extends ClientGroupOverviewViewModel {\n constructor({\n address = null,\n clientId,\n clientName,\n locationId,\n locationName,\n openBookings = 0,\n totalBookings = 0,\n } = {}) {\n super({\n address,\n clientId,\n clientName,\n locationId,\n locationName,\n openBookings,\n totalBookings,\n })\n\n this.filledBookings = totalBookings - openBookings\n\n let fillRatePercentage = -1\n\n if (!totalBookings && !openBookings) {\n fillRatePercentage = -1\n } else {\n const percentage = ((totalBookings - openBookings) / totalBookings) * 100\n\n const normalisedPercentage =\n percentage <= 0 || isNaN(percentage) ? 0 : percentage\n\n fillRatePercentage = Math.round(normalisedPercentage)\n }\n\n /**\n * A rounded percent of the number of bookings filled for this location\n * @type {Number}\n */\n this.fillRatePercentage = fillRatePercentage\n }\n}\n","import { fail, success } from '@/helpers/result-helper'\nimport toast from '@/services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport { orderBy } from 'lodash'\nimport { getSavedState, saveState, deleteState } from '@/helpers/cache-helpers'\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\nimport ClientGroupOverviewWithFillRateViewModel from '@/models/overview/clientGroupOverviewWithFillRateViewModel'\n\nconst getDefaultState = () => {\n return {\n id: getSavedState('client.id'),\n name: getSavedState('client.name'),\n grades: [],\n owners: [],\n classifications: [],\n loadingCount: 0,\n crudLoadingCount: 0,\n classificationLoadingCount: 0,\n detailsLoadingCount: 0,\n gradesLoadingCount: 0,\n overviewLoadingCount: 0,\n overviewDataLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'client',\n selectedClientId: (state) => state.id,\n clientDetails: (state) => {\n if (!state.id) return null\n return {\n id: state.id,\n name: state.name,\n }\n },\n grades: (state) => (clientId) => {\n const grades = state.grades.find((x) => x.clientId === clientId)\n\n return grades ? orderBy(grades.list, ['name'], ['asc']) : []\n },\n owner: (state) => (clientId) => {\n const owner = state.owners.find((x) => x.clientId === clientId)\n return owner?.data\n },\n classifications: (state) => (clientId) => {\n const classifications = state.classifications.find(\n (x) => x.clientId === clientId\n )\n\n return classifications?.list || []\n },\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isLoadingClassifications: (state) => state.classificationLoadingCount > 0,\n isLoadingClientDetails: (state) => state.detailsLoadingCount > 0,\n isLoadingGrades: (state) => state.gradesLoadingCount > 0,\n isLoadingOverview: (state) => state.overviewLoadingCount > 0,\n isLoadingOverviewData: (state) => state.overviewDataLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n START_LOADING_CLASSIFICATIONS(state) {\n state.classificationLoadingCount++\n },\n FINISH_LOADING_CLASSIFICATIONS(state) {\n state.classificationLoadingCount--\n },\n START_LOADING_DETAILS(state) {\n state.detailsLoadingCount++\n },\n FINISH_LOADING_DETAILS(state) {\n state.detailsLoadingCount--\n },\n START_LOADING_GRADES(state) {\n state.gradesLoadingCount++\n },\n FINISH_LOADING_GRADES(state) {\n state.gradesLoadingCount--\n },\n START_LOADING_OVERVIEW(state) {\n state.overviewLoadingCount++\n },\n FINISH_LOADING_OVERVIEW(state) {\n state.overviewLoadingCount--\n },\n START_LOADING_OVERVIEW_DATA(state) {\n state.overviewDataLoadingCount++\n },\n FINISH_LOADING_OVERVIEW_DATA(state) {\n state.overviewDataLoadingCount--\n },\n SET_CLIENT(state, { clientId, clientName }) {\n state.id = clientId\n state.name = clientName\n\n saveState('client.id', clientId)\n saveState('client.name', clientName)\n },\n UPSERT_CLIENT_GRADES(state, payload) {\n const found = state.grades.find((x) => x.clientId === payload.clientId)\n\n if (!found) {\n return state.grades.push({\n clientId: payload.clientId,\n list: payload.grades,\n })\n }\n\n found.list = payload.grades\n },\n UPSERT_ADDITIONAL_DETAILS(state, payload) {\n const found = state.owners.find((x) => x.clientId === payload.clientId)\n\n if (!found) {\n return state.owners.push({\n clientId: payload.clientId,\n data: payload.owner,\n })\n }\n\n found.data = payload.owner\n },\n UPSERT_CLIENT_CLASSIFICATIONS(state, payload) {\n const found = state.classifications.find(\n (x) => x.clientId === payload.clientId\n )\n\n if (!found) {\n return state.classifications.push({\n clientId: payload.clientId,\n list: payload.classifications,\n })\n }\n\n found.list = payload.classifications\n },\n CLEAR_STORE(state) {\n // Clear out LocalStorage\n deleteState('client.id')\n deleteState('client.name')\n\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n setClient({ commit, rootGetters, dispatch }, clientId) {\n const client = rootGetters['auth/getClient'](clientId)\n\n if (!client) {\n toast.error(this.$i18n.t('client.clientNotFoundErrorText'))\n return fail()\n }\n\n dispatch('loadClientAdditionalInformation', clientId)\n\n // Clear store modules of client specific data before switching\n dispatch('invoices/clear', {}, { root: true })\n dispatch('bookings/clear', {}, { root: true })\n dispatch('contacts/clear', {}, { root: true })\n dispatch('timesheets/clear', {}, { root: true })\n\n commit('SET_CLIENT', client)\n return success()\n },\n async loadClientAdditionalInformation({ commit, getters }, clientId) {\n const cId = clientId || getters.selectedClientId\n\n if (!cId)\n return Promise.resolve(\n fail('', 'Must select a client first before loading client details')\n )\n\n // Check cache\n const isCached = getters.owner(cId)\n\n if (isCached) return Promise.resolve(success(isCached))\n\n commit('START_LOADING_DETAILS')\n\n try {\n const response = await this.$api.client.getAdditionalDetails(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_ADDITIONAL_DETAILS', {\n owner: isHttpStatus(response.status, 204) ? [] : response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load client details')\n return fail()\n } finally {\n commit('FINISH_LOADING_DETAILS')\n }\n },\n async loadClientGrades({ commit, getters }, clientId) {\n const cId = clientId || getters.selectedClientId\n\n // Check cached client grades for selected client\n const isCached = getters.grades(cId)\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_GRADES')\n\n try {\n const response = await this.$api.client.getClientGrades(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_CLIENT_GRADES', {\n grades: isHttpStatus(response.status, 204) ? [] : response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load grades')\n return fail()\n } finally {\n commit('FINISH_LOADING_GRADES')\n }\n },\n async loadClientClassifications({ commit, getters }, clientId) {\n const cId = clientId || getters.selectedClientId\n\n // Check cached client classifications for selected client\n const isCached = getters.classifications(cId)\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_CLASSIFICATIONS')\n\n try {\n const response = await this.$api.client.getClientClassifications(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_CLIENT_CLASSIFICATIONS', {\n classifications: isHttpStatus(response.status, 204)\n ? []\n : response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load classifications')\n return fail()\n } finally {\n commit('FINISH_LOADING_CLASSIFICATIONS')\n }\n },\n /**\n * Validates that the user has the permission to access the currently\n * selected client. If not, this client will be removed and another\n * will be selected\n */\n async validateSelectedClient({ rootGetters, dispatch }) {\n if (!getSavedState('client.id')) return\n\n const clientExistsInPermissionTree = rootGetters['auth/getClient'](\n getSavedState('client.id')\n )\n\n // If client exists, no further action required\n if (clientExistsInPermissionTree) return\n\n // User doesn't have access to current client, select first available client\n const firstAvailableClient = rootGetters['auth/firstAvailableClient']\n await dispatch('setClient', firstAvailableClient.clientId)\n },\n async loadClientGroupOverviewSchoolStatus(\n { commit, rootGetters },\n { clientGroupId, filterDate }\n ) {\n commit('START_LOADING_OVERVIEW_DATA')\n\n try {\n const timeZone = rootGetters[\n 'auth/getTimezoneFromFirstClientGroupLocation'\n ](clientGroupId)\n\n const response = await this.$api.clientGroups.getOverviewData(\n clientGroupId,\n filterDate,\n timeZone\n )\n\n if (isSuccess(response.status)) {\n return success(\n isNonEmptyArray(response.data)\n ? response.data.map(\n (overviewVM) =>\n new ClientGroupOverviewWithFillRateViewModel(overviewVM)\n )\n : []\n )\n }\n } catch (ex) {\n return fail(\n ex.response?.data || {\n message: this.$i18n.t(\n 'clientGroupOverview.error.noMessageFromServer'\n ),\n }\n )\n } finally {\n commit('FINISH_LOADING_OVERVIEW_DATA')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper'\nimport toast from '@services/toasts/index'\nimport { isSuccess } from '@/helpers/http-status-helpers'\n\nconst getDefaultState = () => {\n return {\n loadingCount: 0,\n crudLoadingCount: 0,\n downloadingFileCount: 0,\n invoices: [],\n invoicesTotal: 0,\n serverCurrentPage: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'invoices',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isDownloadingFile: (state) => state.downloadingFileCount > 0,\n invoices: (state) => state.invoices,\n invoicesTotal: (state) => state.invoicesTotal,\n serverCurrentPage: (state) => state.serverCurrentPage,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_INVOICES(state, invoices) {\n state.invoices = invoices\n },\n SET_INVOICES_TOTAL(state, total) {\n state.invoicesTotal = total\n },\n SET_SERVER_CURRENT_PAGE(state, page) {\n state.serverCurrentPage = page\n },\n START_DOWNLOADING_FILE(state) {\n state.downloadingFileCount++\n },\n FINISH_DOWNLOADING_FILE(state) {\n state.downloadingFileCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadInvoices({ commit }, { page, pageSize }) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.invoices.get('', {\n skip: (page - 1) * pageSize,\n take: pageSize,\n })\n\n if (isSuccess(response.status)) {\n commit('SET_INVOICES', response.data.invoices)\n commit('SET_INVOICES_TOTAL', response.data.total)\n commit('SET_SERVER_CURRENT_PAGE', response.data.currentPage)\n\n return success(response.data)\n }\n } catch {\n toast.error(this.$i18n.t('error.errorGenericApiErrorText'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async getOustandingInvoicesCount({ commit }) {\n commit('START_LOADING')\n try {\n const response = await this.$api.invoices.getOustandingInvoicesCount()\n if (isSuccess(response.status)) {\n return success(response.data.outstandingInvoicesCount)\n }\n } catch {\n toast.error(`Failed to load Oustanding Invoices Count`)\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async downloadInvoiceFile({ commit }, invoiceId) {\n commit('START_DOWNLOADING_FILE')\n\n try {\n const response = await this.$api.invoices.getInvoiceFile(invoiceId)\n\n if (isSuccess(response.status)) {\n const url = window.URL.createObjectURL(\n new Blob([response.data], { type: 'application/pdf' })\n )\n return success(url)\n }\n } catch (ex) {\n let toastErrorMessage = this.$i18n.t('error.errorGenericApiErrorText')\n // Try to resolve error response. Response type is Blob, need to convert\n // from blob to json\n try {\n const responseObject = JSON.parse(await ex.response.data.text())\n if (responseObject) toastErrorMessage = responseObject.message\n } catch {}\n\n toast.error(toastErrorMessage)\n return fail()\n } finally {\n commit('FINISH_DOWNLOADING_FILE')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","export default class ShiftRecordBreakDto {\n constructor({ type, startTime, endTime } = {}) {\n /**\n * The type of break that was taken\n * @type {String}\n * @see {ShiftRecordBreakType} for valid range of values\n */\n this.type = type\n /**\n * Start time of block in 24 hr format\n * @type {String}\n * @example 08:30\n */\n this.startTime = startTime\n /**\n * End time of block in 24 hr format\n * @type {String}\n * @example 15:30\n */\n this.endTime = endTime\n }\n}\n","import { isNonEmptyArray } from '@/helpers/array-helpers'\nimport dayjs from '@/services/date/index'\nimport ShiftRecordBreakDto from '../shiftRecords/shiftRecordBreakDto'\n\nexport default class TimesheetsPendingApprovalViewModel {\n constructor({\n locationId = 0,\n locationName,\n locationTimeZone,\n clientId = 0,\n clientName,\n clientGroupId = 0,\n payOptionType,\n payOptionTypes = [],\n unitType,\n bookingId = 0,\n startTimeLocal,\n endTimeLocal,\n startTimeUTC,\n endTimeUTC,\n candidateId = 0,\n candidateFirstName,\n candidateLastName,\n candidatePreferredName,\n candidateFullName,\n breakMinutes = 0,\n isApprovedByCandidate = true,\n breaks = [],\n timesheetMethod,\n bookingStatus,\n } = {}) {\n /**\n * @type {Number}\n */\n this.locationId = locationId\n\n /**\n * @type {String}\n */\n this.locationName = locationName\n\n /**\n * @type {String}\n */\n this.locationTimeZone = locationTimeZone\n\n /**\n * @type {Number}\n */\n this.clientId = clientId\n\n /**\n * @type {String}\n */\n this.clientName = clientName\n\n /**\n * @type {Number}\n */\n this.clientGroupId = clientGroupId\n\n /**\n * @type {String}\n */\n this.payOptionType = payOptionType\n\n /**\n * @type {Array}\n */\n this.payOptionTypes = isNonEmptyArray(payOptionTypes) ? payOptionTypes : []\n\n /**\n * @type {String}\n * @see {RateUnitType} for valid range of values\n */\n this.unitType = unitType\n\n /**\n * @type {Number}\n */\n this.bookingId = bookingId\n\n /**\n * @type {Date}\n */\n this.startTimeLocal = startTimeLocal ? dayjs(startTimeLocal) : null\n\n /**\n * @type {Date}\n */\n this.endTimeLocal = endTimeLocal ? dayjs(endTimeLocal) : null\n\n /**\n * @type {Date}\n */\n this.startTimeUTC = startTimeUTC ? dayjs.utc(startTimeUTC) : null\n\n /**\n * @type {Date}\n */\n this.endTimeUTC = endTimeUTC ? dayjs.utc(endTimeUTC) : null\n\n /**\n * @type {Number}\n */\n this.candidateId = candidateId\n\n /**\n * @type {String}\n */\n this.candidateFirstName = candidateFirstName\n\n /**\n * @type {String}\n */\n this.candidateLastName = candidateLastName\n\n /**\n * @type {String}\n */\n this.candidatePreferredName = candidatePreferredName\n\n /**\n * @type {String}\n */\n this.candidateFullName = candidateFullName\n\n /**\n * @type {Number}\n */\n this.breakMinutes = breakMinutes\n\n /**\n * @type {Boolean}\n */\n this.isApprovedByCandidate = isApprovedByCandidate\n\n /**\n * @type {Array}\n */\n this.breaks = isNonEmptyArray(breaks)\n ? breaks.map((breakTaken) => new ShiftRecordBreakDto(breakTaken))\n : []\n\n /**\n * @type {String}\n * @see {TimesheetMethod} for valid range of values\n */\n this.timesheetMethod = timesheetMethod\n\n /**\n * @type {Number}\n * @see {BookingStatus} for valid range of values\n */\n this.bookingStatus = bookingStatus\n }\n}\n","import { isNonEmptyArray } from '@/helpers/array-helpers'\nimport TimesheetsPendingApprovalViewModel from './timesheetsPendingApprovalViewModel'\n\nexport default class TimesheetsViewModel {\n constructor({\n approvedCount = 0,\n pendingReviewCount = 0,\n pendingApprovalList = [],\n } = {}) {\n /**\n * @type {Number}\n */\n this.approvedCount = approvedCount\n\n /**\n * @type {Number}\n */\n this.pendingReviewCount = pendingReviewCount\n\n /**\n * @type {Array}\n */\n this.pendingApprovalList = isNonEmptyArray(pendingApprovalList)\n ? pendingApprovalList.map(\n (pendingApproval) =>\n new TimesheetsPendingApprovalViewModel(pendingApproval)\n )\n : []\n }\n}\n","import { fail, success } from '@helpers/result-helper'\nimport toast from '@services/toasts/index'\nimport { isSuccess } from '@/helpers/http-status-helpers'\nimport TimesheetsViewModel from '@/models/timesheets/timesheetsViewModel'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'timesheets',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadTimesheets({ commit, rootGetters }) {\n commit('START_LOADING')\n\n try {\n const cId = rootGetters['client/selectedClientId']\n const response = await this.$api.timesheets.get(cId)\n\n if (isSuccess(response.status)) {\n return success(new TimesheetsViewModel(response.data))\n }\n } catch {\n toast.error(this.$i18n.t('timesheets.loadFailureToastText'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async submitTimesheetsForApproval({ commit }, timesheets) {\n commit('START_LOADING_CRUD')\n\n try {\n const response = await this.$api.timesheets.post('', timesheets)\n\n if (isSuccess(response.status)) {\n toast.success(this.$i18n.t('timesheets.submissionSuccessToastText'))\n return success(response.data)\n }\n } catch {\n toast.error(this.$i18n.t('timesheets.submissionFailureToastText'))\n return fail()\n } finally {\n commit('FINISH_LOADING_CRUD')\n }\n },\n async downloadTimesheet({ commit }, timesheetRecordId) {\n commit('START_LOADING')\n try {\n const response = await this.$api.timesheets.downloadTimesheetFile(\n timesheetRecordId\n )\n\n if (isSuccess(response.status)) {\n const url = window.URL.createObjectURL(\n new Blob([response.data], { type: 'application/pdf' })\n )\n return success(url)\n }\n } catch (ex) {\n let toastErrorMessage = this.$i18n.t('error.errorGenericApiErrorText')\n // Try to resolve error response. Response type is Blob, need to convert\n // from blob to json\n try {\n const responseObject = JSON.parse(await ex.response.data.text())\n if (responseObject) toastErrorMessage = responseObject.message\n } catch {}\n\n toast.error(toastErrorMessage)\n\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper.js'\nimport toast from '@services/toasts/index.js'\nimport { isHttpStatus, isSuccess } from '@/helpers/http-status-helpers'\n\nexport default {\n namespaced: true,\n state: {\n canListLoadingCount: 0,\n loadingCount: 0,\n crudLoadingCount: 0,\n displayPic: null,\n file: null,\n candidateList: [],\n },\n getters: {\n moduleName: () => 'candidate',\n isCanListLoading: (state) => state.canListLoadingCount > 0,\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n START_CANLIST_LOADING(state) {\n state.canListLoadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n FINISH_CANLIST_LOADING(state) {\n state.canListLoadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_CANDIDATE_LIST(state, data) {\n state.candidateList = data\n },\n },\n actions: {\n async loadCandidate({ commit }, id) {\n commit('START_LOADING')\n try {\n const response = await this.$api.candidate.getCandidateDetails(id)\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch {\n toast.error('Candidate data failed to load')\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n\n async getCandidateList({ commit }, clientID) {\n commit('START_CANLIST_LOADING')\n try {\n const response = await this.$api.candidate.getCandidateList(clientID)\n if (isSuccess(response.status)) {\n commit('SET_CANDIDATE_LIST', response.data)\n return success(response.data)\n }\n } catch (ex) {\n if (isHttpStatus(ex.response.status, 'Forbidden')) {\n return fail([], '', 403)\n }\n\n toast.error(this.$i18n.t('candidateList.candidateListErrorCannotLoad'))\n return fail()\n } finally {\n commit('FINISH_CANLIST_LOADING')\n }\n },\n\n async getDisplayPic({ commit }, id) {\n commit('START_LOADING')\n try {\n const response = await this.$api.candidate.getDisplayPic(id)\n if (isSuccess(response.status)) {\n return success(response.data.base64ProfileImg)\n }\n } catch {\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n },\n}\n","import config from '@/common/config'\nimport { fail, success } from '@/helpers/result-helper'\nimport { isSuccess } from '@/helpers/http-status-helpers'\nimport toasts from '@/services/toasts/index'\nimport { getType } from 'mime'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'file',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async download({ commit }, fileId) {\n commit('START_LOADING')\n try {\n const response = await this.$api.file.createFileAccessToken(fileId)\n if (isSuccess(response.status)) {\n const token = response.data.accessKey\n const baseURL = `${config.get('apiUrl')}v${config.get('apiVersion')}`\n const fileURL = `${baseURL}/file/(${token})`\n try {\n const fileResponse = await this.$api.file.get(`(${token})`)\n if (isSuccess(fileResponse.status)) {\n window.location = fileURL\n }\n } catch (ex) {\n throw Error('Download Failed')\n }\n return success()\n } else {\n toasts.error('Download Failed')\n }\n } catch {\n toasts.error('Download Failed')\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async downloadGeneralFile({ commit }, filePath) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.file.getGeneralFile(filePath)\n\n if (isSuccess(response.status)) {\n const url = window.URL.createObjectURL(\n new Blob([response.data], { type: getType(filePath) })\n )\n return success(url)\n }\n } catch (ex) {\n let toastErrorMessage = this.$i18n.t('error.errorGenericApiErrorText')\n // Try to resolve error response. Response type is Blob, need to convert\n // from blob to json\n try {\n const responseObject = JSON.parse(await ex.response.data.text())\n if (responseObject) toastErrorMessage = responseObject.message\n } catch {}\n\n toasts.error(toastErrorMessage)\n\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper.js'\nimport toast from '@services/toasts/index.js'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport dayjs from '@/services/date/index.js'\nimport { isCacheFresh } from '@/helpers/cache-helpers'\nimport getSelectedDayText from '@/helpers/get-replace-me-selected-day-text'\nimport { orderBy } from 'lodash'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n loadingCount: 0,\n bookingSummaryLoadingCount: 0,\n crudLoadingCount: 0,\n feedbackFormUrlLoadingCount: 0,\n quickFeedbackSubmittingCount: 0,\n repalceMeStatusCheckLoadingCount: 0,\n submitReplaceMeBookingLoadingCount: 0,\n cancelBookingLoadingCount: 0,\n recentLocations: [],\n replaceMeStatusChecks: [],\n bookingOverview: [],\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'bookings',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingBookingSummary: (state) => state.bookingSummaryLoadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n recentLocations: (state) => state.recentLocations,\n isLoadingFeedbackFormUrl: (state) => state.feedbackFormUrlLoadingCount > 0,\n isLoadingReplaceMeStatusCheck: (state) =>\n state.repalceMeStatusCheckLoadingCount > 0,\n isSubmittingQuickFeedback: (state) =>\n state.quickFeedbackSubmittingCount > 0,\n replaceMeStatusChecks: (state) => (clientId) =>\n state.replaceMeStatusChecks.find((x) => x.clientId === clientId),\n isSubmitReplaceMeLoading: (state) =>\n state.submitReplaceMeBookingLoadingCount > 0,\n isLoadingCancelBooking: (state) => state.cancelBookingLoadingCount > 0,\n bookingOverview: (state) => state.bookingOverview,\n getBookingsInABlock: (state) => (groupId) => {\n if (\n !groupId ||\n !state.bookingOverview ||\n state.bookingOverview?.length === 0 ||\n !state.bookingOverview?.bookingSummaryViewModels ||\n state.bookingOverview?.bookingSummaryViewModels?.length === 0\n )\n return []\n\n let block = []\n for (const bookingOverviewData of state.bookingOverview\n .bookingSummaryViewModels) {\n block = [\n ...block,\n ...bookingOverviewData?.bookingSummaries\n .filter((booking) => booking.groupId === groupId)\n .map((booking) => {\n const startDate = booking.startTimeLocal.split('T')\n return { id: booking.bookingId, date: startDate[0] }\n }),\n ]\n }\n\n return orderBy(block, ['date'], 'asc')\n },\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_SELECTED_DATE_BOOKINGS(state) {\n state.bookingSummaryLoadingCount++\n },\n FINISH_LOADING_SELECTED_DATE_BOOKINGS(state) {\n state.bookingSummaryLoadingCount--\n },\n START_LOADING_BOOKINGS_SUMMARY(state) {\n state.bookingSummaryLoadingCount++\n },\n FINISH_LOADING_BOOKINGS_SUMMARY(state) {\n state.bookingSummaryLoadingCount--\n },\n START_LOADING_REPLACE_ME_STATUS_CHECK(state) {\n state.repalceMeStatusCheckLoadingCount++\n },\n FINISH_LOADING_REPLACE_ME_STATUS_CHECK(state) {\n state.repalceMeStatusCheckLoadingCount--\n },\n START_LOADING_SUBMIT_REPLACE_ME(state) {\n state.submitReplaceMeBookingLoadingCount++\n },\n FINISH_LOADING_SUBMIT_REPLACE_ME(state) {\n state.submitReplaceMeBookingLoadingCount--\n },\n START_LOADING_CANCEL_BOOKING(state) {\n state.cancelBookingLoadingCount++\n },\n FINISH_LOADING_CANCEL_BOOKING(state) {\n state.cancelBookingLoadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_RECENT_BOOKING_LOCATION(state, locationId) {\n const found = state.recentLocations.find(\n (x) => x.locationId === locationId\n )\n\n if (found) {\n found.timestamp = dayjs()\n return\n }\n\n state.recentLocations.push({ locationId, timestamp: dayjs() })\n },\n SET_BOOKING_OVERVIEW(state, data) {\n state.bookingOverview = data\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n START_LOADING_FEEDBACK_FORM_URL(state) {\n state.feedbackFormUrlLoadingCount++\n },\n FINISH_LOADING_FEEDBACK_FORM_URL(state) {\n state.feedbackFormUrlLoadingCount--\n },\n START_SUBMITTING_QUICK_FEEDBACK(state) {\n state.quickFeedbackSubmittingCount++\n },\n FINISH_SUBMITTING_QUICK_FEEDBACK(state) {\n state.quickFeedbackSubmittingCount--\n },\n UPSERT_REPLACE_ME_STATUS_CHECK_FOR_CLIENT(state, { payload, clientId }) {\n let found = state.replaceMeStatusChecks.find(\n (x) => x.clientId === clientId\n )\n\n if (found) {\n found = payload\n found.timestamp = dayjs()\n return\n }\n\n const statusCheck = {\n ...payload,\n clientId,\n timestamp: dayjs(),\n }\n\n state.replaceMeStatusChecks.push(statusCheck)\n },\n },\n actions: {\n setRecentLocation({ commit }, locationId) {\n commit('SET_RECENT_BOOKING_LOCATION', locationId)\n },\n async loadBookingsByClientAndDate({ rootGetters, commit }, payload) {\n commit('START_LOADING_SELECTED_DATE_BOOKINGS')\n try {\n const response = await this.$api.client.getBookingsByClientAndDate(\n rootGetters['client/selectedClientId'],\n payload\n )\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load bookings')\n return fail()\n } finally {\n commit('FINISH_LOADING_SELECTED_DATE_BOOKINGS')\n }\n },\n async loadYearOfBookingSummaryData({ commit }, payload) {\n commit('START_LOADING_BOOKINGS_SUMMARY')\n\n try {\n const response = await this.$api.client.getBookingsByYear(\n payload.clientId,\n payload.timezone,\n payload.year\n )\n\n if (isSuccess(response.status)) {\n commit('SET_BOOKING_OVERVIEW', response.data)\n\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load bookings')\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKINGS_SUMMARY')\n }\n },\n async submitBooking({ commit }, payload) {\n commit('START_LOADING_CRUD')\n\n try {\n const response = await this.$api.bookings.post('', payload)\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n return fail(ex.response.data)\n } finally {\n commit('FINISH_LOADING_CRUD')\n }\n },\n async requestFeedbackFormUrl({ commit }, payload) {\n commit('START_LOADING_FEEDBACK_FORM_URL')\n try {\n const response = await this.$api.bookings.getFeedbackFormUrl(\n payload.bookingId\n )\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load feedback form url')\n return fail()\n } finally {\n commit('FINISH_LOADING_FEEDBACK_FORM_URL')\n }\n },\n async submitQuickFeedback({ commit, dispatch, rootGetters }, payload) {\n commit('START_SUBMITTING_QUICK_FEEDBACK')\n try {\n const response = await this.$api.bookings.submitQuickFeedback(\n payload.bookingId,\n payload.data\n )\n\n if (isSuccess(response.status)) {\n await dispatch(\n 'pendingfeedbacks/setFeedbackAsComplete',\n {\n bookingId: payload.bookingId,\n clientId: rootGetters['client/selectedClientId'],\n },\n { root: true }\n )\n return success()\n }\n } catch (ex) {\n return fail(ex.response.data)\n } finally {\n commit('FINISH_SUBMITTING_QUICK_FEEDBACK')\n }\n },\n async checkReplaceMeStatus(\n { commit, getters, rootGetters },\n forceRefresh = false\n ) {\n const cId = rootGetters['client/selectedClientId']\n\n // Check if user has access to replace me\n if (\n !rootGetters['auth/hasReplaceMePermissionForAtleastOneClientLocation'](\n cId\n )\n )\n return success()\n\n // Check cached replace me status\n const isCached = getters.replaceMeStatusChecks(cId)\n\n if (\n isCached &&\n isCacheFresh({\n cacheDuration: 5,\n durationUnits: 'minutes',\n lastUpdated: isCached?.timestamp,\n forceRefresh,\n })\n )\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_REPLACE_ME_STATUS_CHECK')\n\n try {\n const response = await this.$api.bookings.checkReplaceMeStatus(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_REPLACE_ME_STATUS_CHECK_FOR_CLIENT', {\n payload: response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n // Ignore alert if 403 since the user doesn't have permission for replace me\n // and likely doesn't need to be notified they don't. Would just be alert spam\n if (!isHttpStatus(ex.response.status, 'Forbidden'))\n toast.error(\n ex.response?.data?.message\n ? ex.response.data?.message\n : this.$i18n('replaceMe.checkReplaceMeStatusErrorGenericText')\n )\n return fail()\n } finally {\n commit('FINISH_LOADING_REPLACE_ME_STATUS_CHECK')\n }\n },\n async submitReplaceMeBooking({ commit }, payload) {\n commit('START_LOADING_SUBMIT_REPLACE_ME')\n\n try {\n const response = await this.$api.bookings.submitReplaceMeBooking(\n payload\n )\n\n if (isSuccess(response.status)) {\n const selectedDay = getSelectedDayText(\n payload.selectedDay,\n payload.isNextMonday\n )\n toast.success(\n this.$i18n.t('replaceMe.successNotificationText', { selectedDay })\n )\n return success(response.data)\n }\n } catch (ex) {\n toast.error(\n ex.response?.data?.message\n ? ex.response.data?.message\n : this.$i18n.t('error.genericFailedRequestMessage')\n )\n return fail()\n } finally {\n commit('FINISH_LOADING_SUBMIT_REPLACE_ME')\n }\n },\n async cancelBooking({ commit }, payload) {\n commit('START_LOADING_CANCEL_BOOKING')\n\n try {\n const response = await this.$api.bookings.cancelBooking(\n payload.bookingId,\n {\n cancelReason: payload.cancelReason,\n }\n )\n\n if (isSuccess(response.status)) {\n toast.success(\n this.$i18n.t('booking.cancelBookingSuccessText', {\n date: payload.date,\n })\n )\n return success(response.data)\n }\n } catch (ex) {\n toast.error(\n ex.response?.data?.message\n ? ex.response.data?.message\n : this.$i18n.t('error.genericFailedRequestMessage')\n )\n return fail()\n } finally {\n commit('FINISH_LOADING_CANCEL_BOOKING')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@/helpers/result-helper'\nimport toast from '@/services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport { orderBy } from 'lodash'\n\nconst getDefaultState = () => {\n return {\n bookingContacts: [],\n loadingCount: 0,\n crudLoadingCount: 0,\n bookingContactsLoadingCount: 0,\n standardBookingDetailsLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'contacts',\n bookingContacts: (state) => (locationId) => {\n const contacts = state.bookingContacts.find(\n (x) => x.locationId === locationId\n )\n\n return contacts ? orderBy(contacts.list, ['fullName'], ['asc']) : []\n },\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isLoadingBookingContacts: (state) => state.bookingContactsLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n START_LOADING_BOOKING_CONTACTS(state) {\n state.bookingContactsLoadingCount++\n },\n FINISH_LOADING_BOOKING_CONTACTS(state) {\n state.bookingContactsLoadingCount--\n },\n SET_CLIENT_BOOKING_CONTACTS(state, payload) {\n const found = state.bookingContacts.find(\n (x) => x.locationId === payload.locationId\n )\n\n if (!found) {\n return state.bookingContacts.push({\n locationId: payload.locationId,\n list: payload.contacts,\n })\n }\n\n found.list = payload.contacts\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadBookingContacts({ commit, getters }, locationId) {\n // Check cached contacts\n const hasContacts = getters.bookingContacts(locationId)\n\n if (hasContacts && hasContacts.length > 0)\n return Promise.resolve(success(hasContacts))\n\n commit('START_LOADING_BOOKING_CONTACTS')\n\n try {\n const response = await this.$api.contacts.getBookingContacts(locationId)\n\n if (isSuccess(response.status)) {\n commit('SET_CLIENT_BOOKING_CONTACTS', {\n contacts: isHttpStatus(response.status, 204) ? [] : response.data,\n locationId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load booking contacts')\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKING_CONTACTS')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { isNonEmptyArray } from '@/helpers/array-helpers'\nimport dayjs from '@/services/date'\n\n/**\n * @class\n * @public\n */\nexport default class BookingBlockViewModel {\n constructor({ locationId, datesLocal = [], messageMarkDown = '' } = {}) {\n /**\n * @type {Number}\n */\n this.locationId = Number(locationId)\n /**\n * @type {Array}\n */\n this.datesLocal = isNonEmptyArray(datesLocal)\n ? datesLocal.map((date) => dayjs(date))\n : []\n /**\n * Mark down text to be displayed to the user\n * @type {String}\n */\n this.messageMarkDown = messageMarkDown\n }\n}\n","import { fail, success } from '@/helpers/result-helper'\nimport toast from '@/services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport { orderBy } from 'lodash'\nimport BookingBlockViewModel from '@/models/locations/bookingBlockViewModel'\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n bookingLocations: [],\n certifications: [],\n locationRestrictions: [],\n loadingCount: 0,\n crudLoadingCount: 0,\n bookingLocationLoadingCount: 0,\n certificationLoadingCount: 0,\n bookingBlocksLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'locations',\n bookingLocations: (state) => state.bookingLocations,\n certifications: (state) => (locationId) => {\n const certifications = state.certifications.find(\n (x) => x.locationId === locationId\n )\n\n return certifications\n ? orderBy(certifications.list, ['name'], ['asc'])\n : []\n },\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isLoadingCertifications: (state) => state.certificationLoadingCount > 0,\n isLoadingBookingLocations: (state) => state.bookingLocationLoadingCount > 0,\n isLoadingBookingBlocks: (state) => state.bookingBlocksLoadingCount > 0,\n getRestrictionDetailsByLocationId: (state) => (locationId) => {\n if (!locationId || locationId < 1) throw Error('Location Id is required')\n\n return state.locationRestrictions?.find(\n (restriction) => restriction.locationId === locationId\n )\n },\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n START_LOADING_BOOKING_LOCATIONS(state) {\n state.bookingLocationLoadingCount++\n },\n FINISH_LOADING_BOOKING_LOCATIONS(state) {\n state.bookingLocationLoadingCount--\n },\n START_LOADING_CERTIFICATIONS(state) {\n state.certificationLoadingCount++\n },\n FINISH_LOADING_CERTIFICATIONS(state) {\n state.certificationLoadingCount--\n },\n START_LOADING_BOOKING_BLOCKS(state) {\n state.bookingBlocksLoadingCount++\n },\n FINISH_LOADING_BOOKING_BLOCKS(state) {\n state.bookingBlocksLoadingCount--\n },\n SET_BOOKING_LOCATIONS(state, payload) {\n state.bookingLocations = payload\n },\n UPSERT_CERTIFICATIONS(state, payload) {\n const found = state.certifications.find(\n (x) => x.locationId === payload.locationId\n )\n\n if (!found) {\n return state.certifications.push({\n locationId: payload.locationId,\n list: payload.certifications,\n })\n }\n\n found.list = payload.certifications\n },\n SET_LOCATION_RESTRICTIONS(state, restrictions) {\n state.locationRestrictions = isNonEmptyArray(restrictions)\n ? restrictions.map(\n (restriction) => new BookingBlockViewModel(restriction)\n )\n : []\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadBookingLocations({ commit, getters }) {\n const isCached = getters.bookingLocations\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_BOOKING_LOCATIONS')\n\n try {\n const response = await this.$api.locations.getBookingLocations()\n\n if (isSuccess(response.status)) {\n commit(\n 'SET_BOOKING_LOCATIONS',\n isHttpStatus(response.status, 204) ? [] : response.data\n )\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load locations')\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKING_LOCATIONS')\n }\n },\n async loadLocationCertifications({ commit, getters }, locationId) {\n const isCached = getters.certifications(locationId)\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_CERTIFICATIONS')\n\n try {\n const response = await this.$api.locations.getLocationCertifications(\n locationId\n )\n\n if (isSuccess(response.status)) {\n commit('UPSERT_CERTIFICATIONS', {\n certifications: isHttpStatus(response.status, 204)\n ? []\n : response.data,\n locationId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load certifications for this location')\n return fail()\n } finally {\n commit('FINISH_LOADING_CERTIFICATIONS')\n }\n },\n /**\n * Loads the booking blocks for all contact locations\n * booking on a particular day\n * @param {{commit: Function, dispatch: Function}} vuexContext\n * @returns\n */\n async loadLocationBookingBlocks({ commit }) {\n commit('START_LOADING_BOOKING_BLOCKS')\n\n try {\n const response = await this.$api.locations.getLocationBookingBlocks()\n\n if (isSuccess(response.status)) {\n commit('SET_LOCATION_RESTRICTIONS', response.data)\n return success(response.data)\n }\n } catch (ex) {\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKING_BLOCKS')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper'\nimport toast from '@services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport dayjs from '@/services/date/index'\nimport { isCacheFresh } from '@/helpers/cache-helpers'\n\nconst getDefaultState = () => {\n return {\n loadingCount: 0,\n crudLoadingCount: 0,\n pendingFeedback: [],\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'pending-feedback',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n pendingFeedback: (state) => (clientId) =>\n state.pendingFeedback.find((feedback) => feedback.clientId === clientId)\n ?.list || [],\n pendingFeedbackCacheObj: (state) => (clientId) =>\n state.pendingFeedback.find((feedback) => feedback.clientId === clientId),\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_PENDING_FEEDBACK(state, { clientId, feedback }) {\n const found = state.pendingFeedback.find(\n (feedback) => feedback.clientId === clientId\n )\n\n if (found) {\n found.list = feedback\n found.lastUpdated = dayjs()\n return\n }\n\n state.pendingFeedback.push({\n clientId,\n list: feedback,\n lastUpdated: dayjs(),\n })\n },\n SET_FEEDBACK_AS_COMPLETE(state, { bookingId, clientId }) {\n const foundClientFeedbackList = state.pendingFeedback.find(\n (feedback) => feedback.clientId === clientId\n )\n\n if (!foundClientFeedbackList) return\n\n const foundBookingFeedback = foundClientFeedbackList.list.find(\n (feedback) => feedback.bookingID === bookingId\n )\n\n if (!foundBookingFeedback) return\n\n foundBookingFeedback.feedbackCompleted = true\n },\n },\n actions: {\n async getPendingFeedbacks({ commit, getters }, clientId) {\n // Check if cached\n const isCached = getters.pendingFeedbackCacheObj(clientId)\n\n if (\n isCached &&\n isCacheFresh({\n cacheDuration: 5,\n durationUnits: 'minutes',\n lastUpdated: isCached?.lastUpdated,\n })\n )\n return Promise.resolve(success(isCached.list))\n\n commit('START_LOADING')\n try {\n const response = await this.$api.pendingfeedbacks.getPendingFeedbacks(\n clientId\n )\n\n if (isSuccess(response.status)) {\n commit('SET_PENDING_FEEDBACK', { clientId, feedback: response.data })\n return success(response.data)\n }\n } catch (ex) {\n if (isHttpStatus(ex.response.status, 'Forbidden')) {\n return fail(null, '', 403)\n }\n\n toast.error(this.$i18n.t('pendingFeedbacks.pendingFeedbacksError'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n setFeedbackAsComplete({ commit }, { bookingId, clientId }) {\n commit('SET_FEEDBACK_AS_COMPLETE', { bookingId, clientId })\n },\n },\n}\n","import config from '@/common/config'\nimport clientGroupOverviewFeatureFactory from '@/services/features/clientGroupOverviewFeatureFactory'\nimport { createFeatureDecisions } from '@/services/features/featureDecisions'\n\nconst getDefaultState = () => {\n return {\n toggles: config.get('app.featureToggles'),\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'features',\n featureToggles: (state) => state.toggles,\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n SET_FEATURE_TOGGLES(state, toggles) {\n state.toggles = toggles\n },\n },\n actions: {\n setFeatureToggles({ commit }, toggles) {\n commit('SET_FEATURE_TOGGLES', toggles)\n },\n /**\n * Is used to decide if the client group overview page is enabled for this user.\n * @param {{ rootGetters: Object }} VuexAction\n * @returns {Boolean}\n */\n isClientGroupOverviewEnabled({ getters, rootGetters }) {\n const featureDecisions = createFeatureDecisions(getters.featureToggles)\n\n const enabledForClient = rootGetters['auth/isClientGroupOverviewEnabled']\n\n const clientGroupOverviewFeatureToggles = clientGroupOverviewFeatureFactory(\n featureDecisions,\n enabledForClient\n )\n\n return clientGroupOverviewFeatureToggles.canViewDetails\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import authModule from './auth'\nimport usersModule from './users'\nimport singleInvoiceModule from './single-invoice'\nimport clientModule from './client'\nimport invoicesModule from './invoices'\nimport timesheetsModule from './timesheets'\nimport candidateModule from './candidate'\nimport fileModule from './file'\nimport bookingsModule from './bookings'\nimport contactsModule from './contacts'\nimport locationsModule from './locations'\nimport pendingFeedbacksModule from './pending-feedback'\n\nimport featuresModule from './features'\nexport default {\n features: featuresModule,\n locations: locationsModule,\n contacts: contactsModule,\n bookings: bookingsModule,\n timesheets: timesheetsModule,\n file: fileModule,\n singleInvoice: singleInvoiceModule,\n client: clientModule,\n invoices: invoicesModule,\n candidate: candidateModule,\n auth: authModule,\n users: usersModule,\n pendingfeedbacks: pendingFeedbacksModule,\n}\n","import allModules from '@state/modules'\nimport store from '@state/store'\n\nexport default function dispatchActionForAllModules(\n actionName,\n { modules = allModules, modulePrefix = '', flags = {} } = {}\n) {\n // For every module...\n for (const moduleName in modules) {\n const moduleDefinition = modules[moduleName]\n\n // If the action is defined on the module...\n if (moduleDefinition.actions && moduleDefinition.actions[actionName]) {\n // Dispatch the action if the module is namespaced. Otherwise,\n // set a flag to dispatch the action globally at the end.\n if (moduleDefinition.namespaced) {\n store.dispatch(`${modulePrefix}${moduleName}/${actionName}`)\n } else {\n flags.dispatchGlobal = true\n }\n }\n\n // If there are any nested sub-modules...\n if (moduleDefinition.modules) {\n // Also dispatch the action for these sub-modules.\n dispatchActionForAllModules(actionName, {\n modules: moduleDefinition.modules,\n modulePrefix: modulePrefix + moduleName + '/',\n flags,\n })\n }\n }\n\n // If this is the root and at least one non-namespaced module\n // was found with the action...\n if (!modulePrefix && flags.dispatchGlobal) {\n // Dispatch the action globally.\n store.dispatch(actionName)\n }\n}\n","import config from '@/common/config'\nimport store from '@state/store'\nimport { isHttpStatus } from '@/helpers/http-status-helpers'\nimport axios from 'axios'\n\nclass BaseApiService {\n /**\n * Api version (e.g. 1.0)\n */\n apiVersion = config.get('apiVersion')\n\n /**\n * Axios client\n */\n client = axios.create({\n baseURL: config.get('apiUrl'),\n json: true,\n })\n\n /**\n * HTTP methods\n */\n method = {\n GET: 'get',\n POST: 'post',\n DELETE: 'delete',\n PATCH: 'patch',\n PUT: 'put',\n }\n\n /**\n * A particular resource, e.i. users, posts, comments etc.\n */\n resource\n\n constructor(resource) {\n if (!resource) throw new Error('Resource is not provided')\n this.resource = resource\n }\n\n /**\n * Gets the full url for the endpoint\n * @param {String} args has the remaining fragement of the url\n * @param {Object} query key pair list of query args that will be mapped if provided e.g. `{ first: 'value', second: 'value' }`\n * @returns {String} full url including base\n */\n getUrl(args = '', query = null) {\n return `v${this.apiVersion}/${this.resource}${args ? `/${args}` : ''}${\n query ? `?${this.mapQueryParams(query)}` : ''\n }`\n }\n\n async handleErrors(err) {\n // If unauthorised, renew access token then retry\n if (isHttpStatus(err?.response?.status, 'Unauthorized')) {\n await store.dispatch('auth/getAccessTokenOrRefresh', true)\n\n return {\n retry: true,\n err,\n }\n }\n\n throw err\n }\n\n /**\n * Compiles request configuration and handles tasks like generating headers\n * list and retrieving the auth token\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @param {Boolean} isBlob Sets the response type to 'blob'\n * @returns Request config object\n */\n async compileRequestConfig(\n method,\n url,\n data,\n providedHeaders,\n isBlob = false\n ) {\n const accessToken = await store.dispatch('auth/getAccessTokenOrRefresh')\n if (typeof accessToken === 'undefined' || !accessToken) {\n throw Error('An access token is required for authenticated requests')\n }\n\n let impersonateHeader = {}\n\n // Set impersonate header if impersonate id is present\n if (store.getters['auth/hasImpersonateContactId']) {\n impersonateHeader = {\n 'Impersonated-Contact': store.getters['auth/impersonateContactId'],\n }\n }\n\n // Replace versioned URLs to use accept header to request API version\n const headers = {\n Authorization: `Bearer ${accessToken}`,\n 'Accept-Version': this.apiVersion,\n ...providedHeaders,\n ...impersonateHeader,\n }\n\n let config = {\n method,\n url,\n data,\n headers,\n }\n\n if (isBlob) config = { ...config, ...{ responseType: 'blob' } }\n\n return config\n }\n\n /**\n * Executes an authenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @param {Boolean} isBlob Sets the response type to 'blob'\n * @returns Http response\n */\n async execute(method, url, data, providedHeaders, isBlob = false) {\n let config = await this.compileRequestConfig(\n method,\n url,\n data,\n providedHeaders,\n isBlob\n )\n\n try {\n return await this.client(config)\n } catch (err) {\n const response = await this.handleErrors(err)\n\n if (response.retry) {\n // Recompile config to utilise new auth token\n config = await this.compileRequestConfig(\n method,\n url,\n data,\n providedHeaders,\n isBlob\n )\n\n return await this.client(config)\n }\n }\n }\n\n /**\n * Executes an authenticated HTTP request for blob files\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async executeBlob(method, url, data, providedHeaders) {\n return this.execute(method, url, data, providedHeaders, true)\n }\n\n /**\n * Executes an unauthenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @returns Http response\n */\n async executeAnon(method, url, data) {\n return this.client({\n method,\n url,\n data,\n headers: {\n 'Accept-Version': this.apiVersion,\n },\n })\n }\n\n /**\n * Mapper that accepts a 1D object and generates a query string to be appended to a URL\n * @param {Object} queryParams key value object { key: value, ... }\n * @returns A query string e.g. ?key=value&key2=value2...\n */\n mapQueryParams(queryParams) {\n return queryParams\n ? Object.keys(queryParams)\n .map(function(key) {\n return key + '=' + queryParams[key]\n })\n .join('&')\n : ''\n }\n}\n\nclass ReadOnlyApiService extends BaseApiService {\n /**\n * Generic configurable authenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async fetch(method, url, data, headers) {\n return this.execute(method, url, data, headers)\n }\n\n /**\n * HTTP Get authenticated request\n * @param {*} args\n * @param {*} query query object {key: value}\n * @returns\n */\n async get(args, query = null) {\n return this.execute(this.method.GET, this.getUrl(args, query))\n }\n\n /**\n * Generic configurable unauthenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async fetchAnon(method, url, data, headers) {\n return this.executeAnon(method, url, data, headers)\n }\n\n /**\n * HTTP Get unauthenticated request\n * @param {*} args\n * @param {*} query query object {key: value}\n * @returns\n */\n async getAnon(args, query = null) {\n return this.executeAnon(this.method.GET, this.getUrl(args, query))\n }\n\n /**\n * Generic configurable Authenticated HTTP request - Response type: Blob\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async fetchBlob(method, url, data, headers) {\n return this.executeBlob(method, url, data, headers)\n }\n\n /**\n * HTTP Get authenticated request - Response type: Blob\n * @param {*} args\n * @param {*} query query object {key: value}\n * @returns\n */\n async getBlob(args, query = null) {\n return this.executeBlob(this.method.GET, this.getUrl(args, query))\n }\n}\n\nclass ModelApiService extends ReadOnlyApiService {\n /**\n * HTTP Post authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async post(args, data = {}, query = null) {\n return this.execute(this.method.POST, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Post unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async postAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.POST, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Post authenticated request - Response type: Blob\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async postBlob(args, data = {}, query = null) {\n return this.executeBlob(this.method.POST, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Put authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async put(args, data = {}, query = null) {\n return this.execute(this.method.PUT, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Put unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async putAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.PUT, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Put authenticated request - Response type: Blob\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async putBlob(args, data = {}, query = null) {\n return this.executeBlob(this.method.PUT, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Patch authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async patch(args, data = {}, query = null) {\n return this.execute(this.method.PATCH, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Patch unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async patchAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.PATCH, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Delete authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async delete(args, data = {}, query = null) {\n return this.execute(this.method.DELETE, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Delete unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async deleteAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.DELETE, this.getUrl(args, query), data)\n }\n}\n\nexport { ReadOnlyApiService, ModelApiService }\n","import { ModelApiService } from './BaseApiService'\n\nexport default class SignalRApiService extends ModelApiService {\n constructor() {\n super('SignalR')\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class UserApiService extends ModelApiService {\n constructor() {\n super('me')\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class InvoicesApiService extends ModelApiService {\n constructor() {\n super('invoices')\n }\n\n async getInvoiceByInvoiceNo(invoiceNo) {\n return this.get(`GetInvoice/${invoiceNo}`)\n }\n\n async getOustandingInvoicesCount() {\n return this.get(`outstanding-invoices-count`)\n }\n\n async getInvoiceFile(invoiceId) {\n return this.getBlob(`${invoiceId}/file`)\n }\n}\n","import dayjs from '@/services/date'\nimport { ModelApiService } from './BaseApiService'\n\nexport default class ClientApiService extends ModelApiService {\n constructor() {\n super('clients')\n }\n\n async getBookingsByYear(clientId, timeZone, year) {\n const newDate = new Date(year, 1, 1)\n\n const dateFromString = dayjs(newDate)\n .startOf('year')\n .format('YYYY-MM-DD')\n const dateUntilString = dayjs(newDate)\n .endOf('year')\n .format('YYYY-MM-DD')\n\n return this.getBookingsByDateRange(\n clientId,\n timeZone,\n dateFromString,\n dateUntilString\n )\n }\n\n async getBookingsByDateRange(\n clientId,\n timeZone,\n dateFromStringLocal,\n dateUntilStringLocal\n ) {\n return this.get(\n `${clientId}/bookings/summary?timeZone=${timeZone}&dateFromLocal=${dateFromStringLocal}&dateToLocal=${dateUntilStringLocal}`\n )\n }\n\n async getBookingsByClientAndDate(clientId, dateFromStringLocal) {\n return this.get(`${clientId}/bookings?dateFromLocal=${dateFromStringLocal}`)\n }\n\n async getClientGrades(clientId) {\n return this.get(`${clientId}/grades`)\n }\n\n async getClientClassifications(clientId) {\n return this.get(`${clientId}/pay-classes`)\n }\n\n async getAdditionalDetails(clientId) {\n return this.get(`${clientId}/additional-details`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class CandidateApiService extends ModelApiService {\n constructor() {\n super('candidate')\n }\n\n async getCandidateDetails(id) {\n return this.get(`${id}/details`)\n }\n\n getCandidateList(id) {\n return this.get(`CandidateList?ClientId=${id}`)\n }\n\n async getDisplayPic(id) {\n if (id && id >= 0) {\n return this.get(`profile-image/${id}`)\n }\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class FileApiService extends ModelApiService {\n constructor() {\n super('file')\n }\n\n async createFileAccessToken(fileId) {\n return this.get(`generateAccessToken/${fileId}`)\n }\n\n async getGeneralFile(fileName) {\n return this.getBlob('general', { filePath: fileName })\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class TimesheetsApiService extends ModelApiService {\n constructor() {\n super('timesheets')\n }\n\n async downloadTimesheetFile(timesheetRecordId) {\n return this.getBlob(`download/${timesheetRecordId}`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class ContactsApiService extends ModelApiService {\n constructor() {\n super('contacts')\n }\n\n async getBookingContacts(locationId) {\n return this.get(`booking-contacts`, { locationId })\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class LocationsApiService extends ModelApiService {\n constructor() {\n super('locations')\n }\n\n async getBookingLocations() {\n return this.get(`booking-location-list`)\n }\n\n async getLocationCertifications(locationId) {\n return this.get(`${locationId}/certifications`)\n }\n\n async getLocationBookingBlocks() {\n return this.get(`booking-blocks`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class BookingsApiService extends ModelApiService {\n constructor() {\n super('bookings')\n }\n\n async getFeedbackFormUrl(bookingId) {\n return await this.get(`${bookingId}/feedback-form`)\n }\n\n async submitQuickFeedback(bookingId, data) {\n return await this.post(`${bookingId}/quick-feedback`, data)\n }\n\n async checkReplaceMeStatus(clientId) {\n return await this.get('replace-me-status', { clientId })\n }\n\n async submitReplaceMeBooking(payload) {\n return await this.post('replaceMe', payload)\n }\n\n async cancelBooking(bookingId, payload) {\n return await this.post(`${bookingId}/cancel`, payload)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class PendingFeedbackApiServiceApiService extends ModelApiService {\n constructor() {\n super('feedbacks')\n }\n\n async getPendingFeedbacks(clientID) {\n return this.get(`getBookingsPendingFeedback?clientId=${clientID}`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class ClientGroupApiService extends ModelApiService {\n constructor() {\n super('client-groups')\n }\n\n async getOverviewData(clientGroupId, filterDate, timeZone) {\n return this.get(`${clientGroupId}/overview`, { filterDate, timeZone })\n }\n}\n","import SignalRApiService from './SignalRApiService'\nimport UserApiService from './UserApiService'\nimport InvoicesApiService from './InvoicesApiService'\nimport ClientApiService from './ClientApiService'\nimport CandidateApiService from './CandidateApiService'\nimport FileApiService from './FileApiService'\nimport TimesheetsApiService from './TimesheetsApiService'\nimport ContactsApiService from './ContactsApiService'\nimport LocationsApiService from './LocationsApiService'\nimport BookingsApiService from './BookingsApiService'\nimport PendingFeedbackApiServiceApiService from './PendingFeedbackApiServiceApiService'\nimport ClientGroupApiService from './ClientGroupApiService'\n\nexport default {\n pendingfeedbacks: new PendingFeedbackApiServiceApiService(),\n bookings: new BookingsApiService(),\n locations: new LocationsApiService(),\n contacts: new ContactsApiService(),\n timesheets: new TimesheetsApiService(),\n file: new FileApiService(),\n invoices: new InvoicesApiService(),\n client: new ClientApiService(),\n clientGroups: new ClientGroupApiService(),\n candidate: new CandidateApiService(),\n user: new UserApiService(),\n signalR: new SignalRApiService(),\n}\n","import api from '@/services/api'\n\nexport default function(store) {\n store.$api = api\n}\n","import i18n from '@plugins/vue-i18n'\n\nexport default function(store) {\n store.$i18n = i18n\n}\n","import appinsights from '@plugins/appinsights'\n\nexport default function(store) {\n store.$appInsights = appinsights\n}\n","import markdownToHtmlConverter from '@/utils/markdown-to-html-converter.js'\nimport config from '@/common/config'\nimport { success, fail } from './result-helper'\n\nconst extractHeaderData = (headers) => {\n return headers.split('|').reduce((acc, header) => {\n const keyAndValue = header.split(':')\n return {\n ...acc,\n ...{\n [keyAndValue[0]]: keyAndValue[1],\n },\n }\n }, {})\n}\n\nexport const getServiceStatus = async () => {\n try {\n return await fetch(config.get('app.status.url'))\n .then((response) => {\n if (!response.ok) return fail()\n return response.text()\n })\n .then((markdownText) => {\n // Extract header\n const fileLines = markdownText.replace(/\\r\\n/g, '\\n').split('\\n')\n const statusHeader = fileLines[0]\n fileLines.shift()\n\n const headerElements = extractHeaderData(statusHeader)\n\n return Promise.resolve(\n success({\n ...{\n _md: markdownText,\n html: markdownToHtmlConverter(fileLines.join('\\n')),\n },\n ...headerElements,\n })\n )\n })\n } catch (e) {\n return fail({ error: e, message: e.message })\n }\n}\n","import dispatchActionForAllModules from '@utils/dispatch-action-for-all-modules'\nimport Vue from 'vue'\nimport Vuex from 'vuex'\nimport toast from '@services/toasts/index.js'\nimport api from '@/plugins/api.storePlugin'\nimport i18n from '@/plugins/i18n.storePlugin'\nimport appInsights from '@/plugins/appinsights.storePlugin'\nimport { getServiceStatus } from '@/helpers/service-status-helper.js'\nimport { isCacheFresh } from '@/helpers/cache-helpers'\nimport { DurationUnits } from '@/shared/constants/date/DurationUnits.js'\nimport { success } from '@/helpers/result-helper.js'\nimport dayjs from '@/services/date'\nimport { logger } from '@/services/logging/AppLogger'\nimport modules from './modules'\n\nVue.use(Vuex)\n\nconst getDefaultState = () => {\n return {\n debugMessages: [],\n loadingCount: 0,\n appLoadingCount: 0,\n debugActivateCounter: 0,\n darkMode: JSON.parse(localStorage.getItem('darkMode')),\n initialAppLoad: false, // Prevents full page loader on subsequent loads\n embedded: false, // App is embedded within RR\n drawer:\n localStorage.getItem('drawer') === undefined ||\n localStorage.getItem('drawer') === null\n ? false\n : JSON.parse(localStorage.getItem('drawer')),\n serviceStatus: null,\n serviceStatusLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nconst store = new Vuex.Store({\n modules,\n state,\n plugins: [api, i18n, appInsights],\n // Enable strict mode in development to get a warning\n // when mutating state outside of a mutation.\n // https://vuex.vuejs.org/guide/strict.html\n strict: process.env.NODE_ENV !== 'production',\n getters: {\n moduleName: () => 'root-store',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingApp: (state) => state.appLoadingCount > 0,\n serviceStatus: (state) => {\n if (!state.serviceStatus || !state.serviceStatus?.html) return null\n return state.serviceStatus\n },\n isLoadingServiceStatus: (state) => state.serviceStatusLoadingCount > 0,\n hasLoadedAppOnce: (state) => state.initialAppLoad,\n isError: (state) => state.error,\n isDebugModeActive: (state) => state.debugActivateCounter >= 10,\n isDarkModeActive: (state) => state.darkMode,\n isDrawerOpen: (state) => state.drawer,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_SERVICE_STATUS_LOADING(state) {\n state.serviceStatusLoadingCount++\n },\n FINISH_SERVICE_STATUS_LOADING(state) {\n state.serviceStatusLoadingCount--\n },\n INCREMENT_APP_LOADING(state) {\n state.appLoadingCount++\n },\n DECREMENT_APP_LOADING(state) {\n state.appLoadingCount--\n },\n SET_APP_AS_LOADED(state) {\n state.initialAppLoad = true\n },\n RESET_APP_LOADING_STATE(state) {\n state.initialAppLoad = false\n },\n SET_ERROR(state) {\n state.error = true\n },\n ACTIVATE_DEBUG(state) {\n state.debugActivateCounter = 10\n },\n INCREMENT_DEBUG(state) {\n state.debugActivateCounter++\n },\n RESET_DEBUG(state) {\n state.debugActivateCounter = 0\n },\n ENABLE_DARKMODE(state) {\n state.darkMode = true\n localStorage.setItem('darkMode', true)\n },\n DISABLE_DARKMODE(state) {\n state.darkMode = false\n localStorage.setItem('darkMode', false)\n },\n OPEN_DRAWER(state) {\n state.drawer = true\n localStorage.setItem('drawer', true)\n },\n CLOSE_DRAWER(state) {\n state.drawer = false\n localStorage.setItem('drawer', false)\n },\n CLEAR(state) {\n // Clear out local and session storage\n localStorage.clear()\n sessionStorage.clear()\n\n Object.assign(state, getDefaultState())\n },\n ADD_DEBUG_MESSAGE(state, obj) {\n state.debugMessages.push(obj)\n },\n INSERT_SERVICE_STATUS(state, serviceStatus) {\n state.serviceStatus = {\n ...{\n lastUpdated: dayjs(),\n },\n ...serviceStatus,\n }\n },\n },\n actions: {\n addDebugMessage({ commit, getters }, message) {\n if (getters.isDebugModeActive) {\n commit('ADD_DEBUG_MESSAGE', { date: new Date(), message: message })\n toast.debug(message)\n console.log(message)\n }\n },\n startLoadingApp({ commit }) {\n commit('INCREMENT_APP_LOADING')\n },\n finishLoadingApp({ commit }) {\n commit('DECREMENT_APP_LOADING')\n },\n startLoading({ commit }) {\n commit('START_LOADING')\n },\n finishLoading({ commit }) {\n commit('FINISH_LOADING')\n },\n setAppAsLoaded({ commit }) {\n commit('SET_APP_AS_LOADED')\n },\n resetAppLoadingState({ commit }) {\n commit('RESET_APP_LOADING_STATE')\n },\n toggleDebugMode({ commit, dispatch }) {\n if (this.state.debugActivateCounter <= 0) {\n commit('ACTIVATE_DEBUG')\n dispatch('addDebugMessage', 'Debug mode on')\n } else {\n dispatch('addDebugMessage', 'Debug mode off')\n commit('RESET_DEBUG')\n }\n },\n toggleDarkMode({ commit }) {\n this.state.darkMode\n ? commit('DISABLE_DARKMODE')\n : commit('ENABLE_DARKMODE')\n },\n toggleDrawer({ commit }) {\n this.state.drawer ? commit('CLOSE_DRAWER') : commit('OPEN_DRAWER')\n },\n clearStore({ commit }) {\n dispatchActionForAllModules('clear')\n\n commit('CLEAR')\n },\n async setLocale({ dispatch }, locale) {\n this.$i18n.locale = locale\n await dispatch('setFavicon')\n },\n setFavicon(context) {\n const favicon = document.querySelector(\"link[rel~='icon']\")\n favicon.href = this.$i18n.t('app.favicon')\n },\n async fetchServiceStatus({ commit, getters }, forceRefresh) {\n // 1. Check data is cached\n if (\n isCacheFresh({\n cacheDuration: 1,\n durationUnits: DurationUnits.HOUR,\n lastUpdated: state.serviceStatus?.lastUpdated,\n forceRefresh,\n })\n )\n return success({ data: getters.serviceStatus })\n\n // 2. Fetch fresh data\n commit('START_SERVICE_STATUS_LOADING')\n\n const response = await getServiceStatus()\n\n commit('INSERT_SERVICE_STATUS', response.isSuccess ? response.data : null)\n\n commit('FINISH_SERVICE_STATUS_LOADING')\n return response\n },\n /**\n * Logs store exceptions via the app logger\n * @param {*} param0\n * @param {StoreErrorDTO} payload\n */\n logStoreException(context, payload) {\n logger.logError(payload)\n },\n },\n})\n\nexport default store\n\n// Automatically run the `init` action for every module,\n// if one exists.\ndispatchActionForAllModules('init')\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"title\":\"_timeout_title_QmghM\"};","export { default } from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=style&index=0&lang=scss&module=true&\"; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=style&index=0&lang=scss&module=true&\"","export const PermissionLevel = Object.freeze({\n /**\n * Can be either group, client or location level\n */\n GROUP_AND_BELOW: 'group_and_below',\n /**\n * Permissions for strictly the group level\n */\n GROUP: 'group',\n /**\n * Can be either client or location level\n */\n CLIENT_AND_BELOW: 'client_and_below',\n /**\n * Permissions for strictly the client level\n */\n CLIENT: 'client',\n /**\n * Can be either the currently selected client or one of the client's locations\n */\n SELECTED_CLIENT_AND_BELOW: 'selected_client_and_below',\n /**\n * Permissions for strictly the selected client\n */\n SELECTED_CLIENT: 'selected_client',\n /**\n * Permissions for strictly the location level\n */\n LOCATION: 'location',\n})\n","import Vue from 'vue'\nimport { logger } from '@/services/logging/AppLogger'\nimport VueErrorDTO from '@/models/error/vueErrorDTO'\nimport WindowErrorDTO from '@/models/error/windowErrorDTO'\n\n/**\n * Captures the errors that are specific to Vue instances. It would not be able\n * to capture the errors which are outside of Vue instances such as utils files,\n * services etc.\n * @param {*} err complete error trace, contains the `message` and `error stack`\n * @param {*} vm Vue component/instance in which error is occurred\n * @param {*} info Vue specific error information such as lifecycle hooks, events etc.\n */\nVue.config.errorHandler = (err, vm, info) => {\n logger.logError(new VueErrorDTO({ err, vm, info }))\n}\n\n/**\n * Captures unhandled expections outside of the Vue instance\n * @param {String} message A string containing a human-readable error message describing the problem. Same as `ErrorEvent.event`\n * @param {String} source A string containing the URL of the script that generated the error.\n * @param {Number} lineno An integer containing the line number of the script file on which the error occurred.\n * @param {Number} colno An integer containing the column number of the script file on which the error occurred.\n * @param {Error} error The error being thrown. Usually an `Error` object.\n */\nwindow.onerror = function(message, source, lineno, colno, error) {\n logger.logError(new WindowErrorDTO({ message, source, lineno, colno, error }))\n}\n\n/**\n * Captures promise rejections that are not handled by window.onerror\n * @tutorial https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n *\n * @param {PromiseRejectionEvent} event\n */\nconst handlePromiseRejection = function(event) {\n logger.logError(event)\n}\n\nwindow.addEventListener('unhandledrejection', handlePromiseRejection)\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ValidationProvider',{attrs:{\"name\":_vm.$attrs.label,\"rules\":_vm.rules},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nreturn [_c('v-text-field',_vm._g(_vm._b({attrs:{\"type\":_vm.type,\"error-messages\":errors},model:{value:(_vm.innerValue),callback:function ($$v) {_vm.innerValue=$$v},expression:\"innerValue\"}},'v-text-field',\n _vm.$attrs\n // https://vuejs.org/v2/guide/components-props.html#Disabling-Attribute-Inheritance\n ,false),\n _vm.$listeners\n // https://vuejs.org/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components\n ))]}}])})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-input-text.vue?vue&type=template&id=6c2d00da&\"\nimport script from \"./_base-input-text.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-input-text.vue?vue&type=script&lang=js&\"\nimport style0 from \"./_base-input-text.vue?vue&type=style&index=0&lang=scss&module=true&\"\n\n\n\n\nfunction injectStyles (context) {\n \n this[\"$style\"] = (style0.locals || style0)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VTextField})\n","/**\n * Describes environment types related to process.env.NODE_ENV and some custom types\n */\nexport default Object.freeze({\n production: 'production',\n development: 'development',\n unit: 'unit',\n e2e: 'e2e',\n})\n","import store from '@state/store'\nimport i18n from '@plugins/vue-i18n'\nimport { PermissionLevel } from '@/shared/constants/permissions/PermissionLevel'\nimport { PermissionScope } from '@/shared/constants/permissions/PermissionScope'\nimport { PermissionModifier } from '@/shared/constants/permissions/PermissionModifier'\nimport { PermissionRequirement } from '@/shared/constants/permissions/PermissionRequirement'\nimport ErrorPageCodes from '@/shared/constants/error/ErrorPageCodes'\nimport routeDefinitions from '@/shared/constants/routes/routeDefinitions'\n\nexport default [\n {\n ...routeDefinitions.home,\n component: () => lazyLoadView(import('@views/home.vue')),\n meta: {\n title: i18n.t('home.homePageTitle'),\n },\n },\n {\n ...routeDefinitions.clientOverview,\n component: () => lazyLoadView(import('@views/client-overview.vue')),\n meta: {\n title: i18n.t('overview.overviewPageTitle'),\n },\n },\n {\n ...routeDefinitions.clientGroupOverview,\n component: () => lazyLoadView(import('@views/client-group-overview.vue')),\n meta: {\n title: i18n.t('clientGroupOverview.pageTitle'),\n async beforeResolve(routeTo, routeFrom, next) {\n const isClientGroupOverviewEnabled = await store.dispatch(\n 'features/isClientGroupOverviewEnabled'\n )\n\n // If the user isn't linked to multiple clients or the feature isn't enable for them\n if (\n !store.getters['auth/hasMultipleClients'] ||\n !isClientGroupOverviewEnabled\n ) {\n // Redirect to the not found page instead\n next({\n name: routeDefinitions.notFound.name,\n params: [routeTo.fullPath],\n replace: true,\n })\n } else {\n // Continue to the overview page\n next()\n }\n },\n },\n },\n {\n ...routeDefinitions.timesheets,\n component: () => lazyLoadView(import('@views/timesheets.vue')),\n meta: {\n title: i18n.t('timesheets.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: PermissionLevel.SELECTED_CLIENT_AND_BELOW,\n scope: PermissionScope.TIMESHEETS,\n modifier: PermissionModifier.ALL,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.candidates,\n component: () => lazyLoadView(import('@views/candidates.vue')),\n meta: {\n title: i18n.t('candidates.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ONE,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.BOOKING,\n modifier: PermissionModifier.ALL,\n },\n {\n level: PermissionLevel.SELECTED_CLIENT_AND_BELOW,\n scope: PermissionScope.TIMESHEETS,\n modifier: PermissionModifier.ALL,\n },\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.ACCOUNTS,\n modifier: PermissionModifier.ALL,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.help,\n component: () => lazyLoadView(import('@views/help.vue')),\n meta: {\n title: i18n.t('help.pageTitle'),\n },\n },\n {\n ...routeDefinitions.bookings,\n component: {\n render(c) {\n return c('router-view')\n },\n },\n children: [\n {\n ...routeDefinitions.bookingsCreate,\n component: () => import('@views/booking-create.vue'),\n meta: {\n title: i18n.t('bookingCreate.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.BOOKING,\n modifier: PermissionModifier.ALL,\n },\n ],\n },\n },\n },\n ],\n },\n {\n ...routeDefinitions.settings,\n component: () =>\n lazyLoadView(import('@/router/views/settings/settings.vue')),\n },\n {\n ...routeDefinitions.changePassword,\n component: () =>\n lazyLoadView(\n import('@/router/views/settings/settings-change-password.vue')\n ),\n },\n {\n ...routeDefinitions.login,\n component: () => lazyLoadView(import('@views/login.vue')),\n meta: {\n public: true,\n title: i18n.t('login.loginPageTitle'),\n beforeResolve(routeTo, routeFrom, next) {\n // If the user is already logged in\n if (store.getters['auth/isUserLoggedIn']) {\n // Redirect to the home page instead\n next({ name: routeDefinitions.home.name })\n } else {\n // Continue to the login page\n next()\n }\n },\n },\n },\n {\n ...routeDefinitions.impersonateLogout,\n component: () => lazyLoadView(import('@views/impersonate-logout.vue')),\n meta: {\n public: true,\n title: 'Impersonate Logout',\n },\n },\n {\n ...routeDefinitions.impersonateLogin,\n component: () => lazyLoadView(import('@views/login.vue')),\n meta: {\n public: true,\n title: 'Impersonate Login',\n beforeResolve(routeTo, routeFrom, next) {\n // If the user is already logged in\n if (store.getters['auth/isUserLoggedIn']) {\n // Redirect to the home page instead\n next({ name: routeDefinitions.home.name })\n } else {\n // Continue to the login page\n next()\n }\n },\n },\n },\n {\n ...routeDefinitions.finance,\n component: () => lazyLoadView(import('@views/finance.vue')),\n meta: {\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: null,\n scope: PermissionScope.ACCOUNTS,\n modifier: PermissionModifier.ALL,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.invoiceDetails,\n component: () =>\n lazyLoadView(import('@/router/views/finance/invoice-view.vue')),\n meta: {\n title: i18n.t('finance.invoiceViewPageTitle'),\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.ACCOUNTS,\n modifier: PermissionModifier.ALL,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.logout,\n meta: {\n beforeResolve(routeTo, routeFrom, next) {\n store.dispatch('auth/logOut')\n const authRequiredOnPreviousRoute = routeFrom.matched.some(\n (route) => route.meta.authRequired\n )\n // Navigate back to previous page, or home as a fallback\n next(\n authRequiredOnPreviousRoute\n ? { name: routeDefinitions.home.name }\n : { ...routeFrom }\n )\n },\n },\n },\n {\n path: '/404',\n name: '404',\n redirect: { name: routeDefinitions.notFound.name },\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.PAGE_NOT_FOUND.id,\n },\n // Allows props to be passed to the 404 page through route\n // params, such as `resource` to define what wasn't found.\n props: true,\n },\n // Redirect any unmatched routes to the 404 page. This may\n // require some server configuration to work in production:\n // https://router.vuejs.org/en/essentials/history-mode.html#example-server-configurations\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.notFound.name,\n meta: {\n public: true,\n label: 'NotFound',\n type: ErrorPageCodes.PAGE_NOT_FOUND.id,\n },\n },\n {\n path: '/500',\n redirect: { name: routeDefinitions.error.name },\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.INTERNAL_SERVER_ERROR.id,\n },\n },\n {\n path: '/401',\n redirect: { name: routeDefinitions.unauthorized.name },\n meta: {\n public: true,\n label: 'Unauthorized',\n type: ErrorPageCodes.UNAUTHORIZED.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '/403',\n redirect: { name: routeDefinitions.forbidden.name },\n meta: {\n public: true,\n label: 'Forbidden',\n type: ErrorPageCodes.FORBIDDEN.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '/error',\n redirect: { name: routeDefinitions.error.name },\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.INTERNAL_SERVER_ERROR.id,\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.error.name,\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.INTERNAL_SERVER_ERROR.id,\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.unauthorized.name,\n meta: {\n public: true,\n label: 'Unauthorized',\n type: ErrorPageCodes.UNAUTHORIZED.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.forbidden.name,\n meta: {\n public: true,\n label: 'Forbidden',\n type: ErrorPageCodes.FORBIDDEN.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.accountLoadFailure.name,\n meta: {\n public: true,\n label: 'Failed To Load Account',\n type: ErrorPageCodes.ACCOUNT_LOAD_FAILURE.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.noServerResponse.name,\n meta: {\n public: true,\n label: 'Unable to contact server',\n type: ErrorPageCodes.NO_SERVER_RESPONSE.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.actionLocked.name,\n meta: {\n public: true,\n label: 'Action Locked',\n type: ErrorPageCodes.ACTION_LOCKED.id,\n icon: 'mdi-shield-alert',\n },\n },\n {\n path: '/under-construction',\n name: 'underConstruction',\n component: () => lazyLoadView(import('@views/_under-construction.vue')),\n meta: {\n public: true,\n title: i18n.t('underConstruction.pageTitle'),\n },\n },\n]\n\n/** Lazy-loads view components, but with better UX. A loading view\n * will be used if the component takes a while to load, falling\n * back to a timeout view in case the page fails to load. You can\n * use this component to lazy-load a route with:\n *\n * component: () => lazyLoadView(import('@views/my-view'))\n *\n * NOTE: Components loaded with this strategy DO NOT have access\n * to in-component guards, such as beforeRouteEnter,\n * beforeRouteUpdate, and beforeRouteLeave. You must either use\n * route-level guards instead or lazy-load the component directly:\n *\n * component: () => import('@views/my-view')\n */\nfunction lazyLoadView(AsyncView) {\n const AsyncHandler = () => ({\n component: AsyncView,\n // A component to use while the component is loading.\n loading: require('@views/_loading.vue').default,\n // Delay before showing the loading component.\n // Default: 200 (milliseconds).\n delay: 400,\n // A fallback component in case the timeout is exceeded\n // when loading the component.\n error: require('@views/_timeout.vue').default,\n // Time before giving up trying to load the component.\n // Default: Infinity (milliseconds).\n timeout: 10000,\n })\n\n return Promise.resolve({\n functional: true,\n render(h, { data, children }) {\n // Transparently pass any props or children\n // to the view component.\n return h(AsyncHandler, data, children)\n },\n })\n}\n","import store from '@state/store'\nimport Vue from 'vue'\nimport VueRouter from 'vue-router'\n// https://github.com/declandewet/vue-meta\nimport VueMeta from 'vue-meta'\n// Adds a loading bar at the top during page loads.\nimport NProgress from 'nprogress/nprogress'\nimport { hasAccessToRoute } from '@/helpers/permissions-helpers.js'\nimport ErrorPageCodes from '@/shared/constants/error/ErrorPageCodes'\nimport { getLanguageBasedOnBaseURL } from '@/helpers/language-helpers'\nimport RequestErrorSource from '@/shared/constants/error/RequestErrorSource'\nimport { decideRouteBasedOnFeatureToggles } from '@/services/features/featureDecisions.js'\nimport routeDefinitions from '@/shared/constants/routes/routeDefinitions'\nimport routes from './routes'\n\nVue.use(VueRouter)\nVue.use(VueMeta, {\n // The component option name that vue-meta looks for meta info on.\n keyName: 'metaInfo',\n})\n\nconst router = new VueRouter({\n routes,\n // Use the HTML5 history API (i.e. normal-looking routes)\n // instead of routes with hashes (e.g. example.com/#/about).\n // This may require some server configuration in production:\n // https://router.vuejs.org/en/essentials/history-mode.html#example-server-configurations\n mode: 'history',\n // Simulate native-like scroll behavior when navigating to a new\n // route and using back/forward buttons.\n scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n },\n})\n\nconst startRouteLoading = () => {\n // Begin loading animation. Only really required for initial page loads/refreshes.\n if (!store.getters.hasLoadedAppOnce) {\n store.dispatch('startLoadingApp')\n }\n\n // Only display the top loading bar after initial load\n if (store.getters.hasLoadedAppOnce) NProgress.start()\n}\nconst stopRouteLoading = () => {\n // Prevents full page loader showing up on every route change\n if (store.getters.isLoadingApp) {\n store.dispatch('setAppAsLoaded')\n }\n\n // Complete the full page loading animation\n store.dispatch('finishLoadingApp')\n NProgress.done()\n}\n\n// Before each route evaluates...\nrouter.beforeEach(async (routeTo, routeFrom, next) => {\n // Check if auth is required on this route\n // (including nested routes).\n const isPublic = routeTo.matched.some((route) => route.meta.public)\n\n // If auth isn't required for the route, just continue.\n if (isPublic) return next()\n\n startRouteLoading()\n\n // If auth is required and the user isn't logged in...\n if (!store.getters['auth/isUserLoggedIn']) {\n // Retrieve another access token...\n try {\n const validToken = await store.dispatch('auth/refreshToken')\n\n // Then continue if the token is valid & was acquired successfully,\n // otherwise redirect to login.\n if (!validToken.isSuccess || !store.getters['auth/isUserLoggedIn']) {\n throw new Error('Could not refresh access token')\n }\n } catch {\n return redirectToLandingPage()\n }\n }\n\n // Get user's profile if not already set or isn't fresh\n if (\n !store.getters['auth/currentUser'] ||\n !store.getters['auth/permissions'] ||\n store.getters['auth/permissions'].length === 0\n ) {\n try {\n // throw new Error()\n const loadUserProfileResult = await store.dispatch(\n 'auth/getCurrentUserProfile'\n )\n\n if (!loadUserProfileResult.isSuccess)\n return getErrorPageRedirectByStatusCode(loadUserProfileResult)\n\n // Set locale loaded in with profile\n await store.dispatch('setLocale', loadUserProfileResult.data.language)\n } catch (ex) {\n return redirectToErrorPage(ErrorPageCodes.ACCOUNT_LOAD_FAILURE.routeName)\n }\n }\n\n // If auth is required and the user is NOT currently logged in,\n // redirect to login.\n if (\n !store.getters['auth/isUserLoggedIn'] ||\n !store.getters['auth/currentUser']\n )\n redirectToLandingPage()\n\n // If a client hasn't been selected, handle default redirection logic\n // based on permissions\n const overviewPages = [\n routeDefinitions.clientOverview.path,\n routeDefinitions.clientGroupOverview.path,\n ]\n\n if (\n !store.getters['client/clientDetails'] &&\n !overviewPages.includes(routeTo.path)\n ) {\n if (store.getters['auth/redirectToClientOverview'])\n await redirectToClientOverview()\n else {\n const result = await store.dispatch(\n 'client/setClient',\n store.getters['auth/firstAvailableClient'].clientId\n )\n\n if (!result.isSuccess) return redirectToErrorPage()\n }\n }\n\n // Load the contact's rep if they aren't loaded yet\n if (\n !store.getters['client/owner'](store.getters['client/selectedClientId'])\n ) {\n store.dispatch(\n 'client/loadClientAdditionalInformation',\n store.getters['client/selectedClientId']\n )\n }\n\n // Check if permissions are required for route\n if (!hasAccessToRoute(routeTo, store))\n redirectToErrorPage(ErrorPageCodes.FORBIDDEN.routeName)\n\n return decideRouteBasedOnFeatureToggles(\n store.getters['features/featureToggles'],\n routeTo,\n next\n )\n\n function redirectToLandingPage() {\n stopRouteLoading()\n\n // To complete the redirect auth step for MSAL they should be directed to\n // impersonate login instead of the landing page\n if (store.getters['auth/hasImpersonateContactId']) {\n return next({ name: routeDefinitions.login.name })\n }\n\n // Pass the original route to the login component\n window.location.href = `${getLanguageBasedOnBaseURL()}/landing`\n }\n\n async function redirectToClientOverview() {\n stopRouteLoading()\n\n // Determine which overview page they should be taken to\n const isClientGroupOverviewEnabled = await store.dispatch(\n 'features/isClientGroupOverviewEnabled'\n )\n\n const to = {\n name: isClientGroupOverviewEnabled\n ? routeDefinitions.clientGroupOverview.name\n : routeDefinitions.clientOverview.name,\n }\n\n next(to)\n }\n\n function redirectToErrorPage(errorPageName = 'ErrorPage') {\n stopRouteLoading()\n next({ name: errorPageName, params: [routeTo.path], replace: true })\n }\n\n function getErrorPageRedirectByStatusCode(response) {\n switch (response.error.source) {\n case RequestErrorSource.server: {\n const statusCode = response.error._error.response.status\n switch (statusCode) {\n case ErrorPageCodes.FORBIDDEN.statusCode:\n return redirectToErrorPage(ErrorPageCodes.FORBIDDEN.routeName)\n case ErrorPageCodes.UNAUTHORIZED.statusCode:\n return redirectToErrorPage(ErrorPageCodes.UNAUTHORIZED.routeName)\n case ErrorPageCodes.BAD_REQUEST.statusCode:\n return redirectToErrorPage(ErrorPageCodes.BAD_REQUEST.routeName)\n default:\n return redirectToErrorPage(\n ErrorPageCodes.INTERNAL_SERVER_ERROR.routeName\n )\n }\n }\n case RequestErrorSource.request:\n return redirectToErrorPage(ErrorPageCodes.NO_SERVER_RESPONSE.routeName)\n default:\n return redirectToErrorPage(\n ErrorPageCodes.ACCOUNT_LOAD_FAILURE.routeName\n )\n }\n }\n})\n\nrouter.beforeResolve(async (routeTo, routeFrom, next) => {\n // Create a `beforeResolve` hook, which fires whenever\n // `beforeRouteEnter` and `beforeRouteUpdate` would. This\n // allows us to ensure data is fetched even when params change,\n // but the resolved route does not. We put it in `meta` to\n // indicate that it's a hook we created, rather than part of\n // Vue Router (yet?).\n try {\n // For each matched route...\n for (const route of routeTo.matched) {\n await new Promise((resolve, reject) => {\n // If a `beforeResolve` hook is defined, call it with\n // the same arguments as the `beforeEnter` hook.\n if (route.meta && route.meta.beforeResolve) {\n route.meta.beforeResolve(routeTo, routeFrom, (...args) => {\n // If the user chose to redirect...\n if (args.length) {\n // If redirecting to the same route we're coming from...\n if (routeFrom.name === args[0].name) {\n // Complete the animation of the route progress bar.\n NProgress.done()\n }\n // Complete the redirect.\n next(...args)\n reject(new Error('Redirected'))\n } else {\n resolve()\n }\n })\n } else {\n // Otherwise, continue resolving the route.\n resolve()\n }\n })\n }\n // If a `beforeResolve` hook chose to redirect, just return.\n } catch (error) {\n return\n }\n\n // If we reach this point, continue resolving the route.\n next()\n})\n\n// When each route is finished evaluating...\nrouter.afterEach((routeTo, routeFrom) => {\n // Complete the animation of the route progress bar.\n stopRouteLoading()\n})\n\nexport default router\n","// Globally register all base components for convenience, because they\n// will be used very frequently. Components are registered using the\n// PascalCased version of their file name.\n\nimport Vue from 'vue'\n\n// https://webpack.js.org/guides/dependency-management/#require-context\nconst requireComponent = require.context(\n // Look for files in the current directory\n '.',\n // Do not look in subdirectories\n false,\n // Only include \"_base-\" prefixed .vue files\n /_base-[\\w-]+\\.vue$/\n)\n\n// For each matching file name...\nrequireComponent.keys().forEach((fileName) => {\n // Get the component config\n const componentConfig = requireComponent(fileName)\n // Get the PascalCase version of the component name\n const componentName = fileName\n // Remove the \"./_\" from the beginning\n .replace(/^\\.\\/_/, '')\n // Remove the file extension from the end\n .replace(/\\.\\w+$/, '')\n // Split up kebabs\n .split('-')\n // Upper case\n .map((kebab) => kebab.charAt(0).toUpperCase() + kebab.slice(1))\n // Concatenated\n .join('')\n\n // Globally register the component\n Vue.component(componentName, componentConfig.default || componentConfig)\n})\n","// generated by genversion\nexport const version = '1.0.0';\n","import Vue from 'vue'\nimport { version } from '@root/lib/version'\nconst { get, has, set, merge } = require('lodash')\n\n// Load config based on environment\nconst env = process.env.NODE_ENV\n\n// Merge in additional config\nconst config = {\n // Props\n env,\n appVersion: version,\n sameDayBookingCutOffTime: '08:00', // Should be moved to another setting later, possible client by client basis\n password: {\n minChars: 8,\n allowedCharsRegex: /[(@!#?$%^&*)(+=._-]{1,}/,\n },\n ...Vue.prototype.$config,\n\n // Methods\n get(path) {\n return get(this, path)\n },\n has(path) {\n return has(this, path)\n },\n set(path, value) {\n return set(this, path, value)\n },\n load(obj) {\n merge(this, obj)\n },\n}\n\nexport default config\n","export default Object.freeze({\n /**\n * Denotes that the associated feature is enabled\n */\n enabled: 'enabled',\n /**\n * Denotes that the associated feature is disabled\n */\n disabled: 'disabled',\n /**\n * Used by route feature toggles. Will redirect user to under construction page if set.\n */\n underConstruction: 'underConstruction',\n})\n","import featureToggleOptions from '@/shared/constants/features/featureToggleOptions'\nimport routeDefinitions from '@/shared/constants/routes/routeDefinitions'\n\nconst isEnabled = (key, featureToggles) => {\n if (\n !featureToggles ||\n !Object.prototype.hasOwnProperty.call(featureToggles, key)\n )\n return false\n\n const featureToggle = featureToggles[key]\n return featureToggle === featureToggleOptions.enabled\n}\n\n/**\n * Generates a series of feature toggle functions that will instruct which features\n * are enabled or not\n * @param {Object} featureToggles Dictionary of feature toggles\n */\nexport const createFeatureDecisions = (featureToggles) => {\n return {\n // #region Client Group Overview\n\n /**\n * UI level feature toggle that will display the client group overview UI if\n * the client enabled flag and the feature is enabled\n * @param {Boolean} clientEnabled\n * @returns\n */\n canViewClientGroupOverview(clientEnabled = false) {\n return (\n isEnabled('feature_clientGroupOverview_view', featureToggles) &&\n clientEnabled\n )\n },\n // #endregion\n }\n}\n\n/**\n * Returns value of route toggle if set or undefined\n * @param {Object} featureToggles Dictionary of feature toggles\n * @param {String} routeName\n * @returns\n */\nconst getRouteToggle = (featureToggles, routeName) => {\n if (\n !featureToggles ||\n !Object.prototype.hasOwnProperty.call(featureToggles, `route_${routeName}`)\n )\n return featureToggleOptions.enabled\n return featureToggles[`route_${routeName}`]\n}\n\n/**\n * Makes routing decisions based on feature toggles and the desired next route\n * @param {Object} featureToggles Dictionary of feature toggles\n * @param {*} routeTo\n * @param {Function} next\n */\nexport const decideRouteBasedOnFeatureToggles = (\n featureToggles,\n routeTo,\n next\n) => {\n // Check if route toggle exists. If yes, decide based on value. If not, assume enabled\n const routeToggle = getRouteToggle(featureToggles, routeTo.name)\n\n switch (routeToggle) {\n case featureToggleOptions.enabled:\n case undefined:\n return next()\n case featureToggleOptions.underConstruction:\n return next({\n name: routeDefinitions.underConstruction.name,\n query: { redirectFrom: routeTo.fullPath },\n })\n case featureToggleOptions.disabled:\n default:\n return next({\n name: routeDefinitions.notFound.name,\n params: [routeTo.fullPath],\n replace: true,\n })\n }\n}\n\n/**\n * Checks route toggles to determine if a nav item should be displayed or not\n * @param {Object} featureToggles Dictionary of feature toggles\n * @param {String} routeName\n * @returns\n */\nexport const displayNavItem = (featureToggles, routeName) => {\n const routeToggle = getRouteToggle(featureToggles, routeName)\n return routeToggle === featureToggleOptions.enabled\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isDev)?_c('v-system-bar',{attrs:{\"app\":\"\",\"dark\":\"\",\"color\":\"purple\"}},[_c('v-icon',[_vm._v(\"mdi-wrench\")]),_c('span',[_vm._v(\" Dev Mode \")]),_c('v-spacer'),_c('span',{staticClass:\"mr-4 caption\"},[_c('v-switch',{attrs:{\"id\":\"debug-toggle\",\"input-value\":_vm.debugToggle},on:{\"change\":_vm.toggleDebugMode},scopedSlots:_vm._u([{key:\"label\",fn:function(){return [_c('span',{staticClass:\"caption\"},[_vm._v(\"Enable Debug Mode\")])]},proxy:true}],null,false,3585174715)})],1),(!_vm.isMobileViewPort)?_c('span',{staticClass:\"mr-4\"},[_c('v-icon',[_vm._v(\"mdi-code-tags\")]),_c('span',[_vm._v(_vm._s((\"v\" + _vm.appVersion)))])],1):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n mdi-wrench\n \n Dev Mode\n \n \n \n \n \n Enable Debug Mode\n \n \n \n\n \n mdi-code-tags\n {{ `v${appVersion}` }}\n \n \n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./the-debug-bar.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./the-debug-bar.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./the-debug-bar.vue?vue&type=template&id=1d4309ae&\"\nimport script from \"./the-debug-bar.vue?vue&type=script&lang=js&\"\nexport * from \"./the-debug-bar.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VSwitch } from 'vuetify/lib/components/VSwitch';\nimport { VSystemBar } from 'vuetify/lib/components/VSystemBar';\ninstallComponents(component, {VIcon,VSpacer,VSwitch,VSystemBar})\n","export const LogoShade = Object.freeze({\n DARK: 'Dark',\n LIGHT: 'Light',\n WHITE: 'White',\n})\n","var map = {\n\t\"./_base-button.vue\": \"8339\",\n\t\"./_base-checkbox-list.vue\": \"4626\",\n\t\"./_base-icon.vue\": \"670f\",\n\t\"./_base-input-select.vue\": \"16e5\",\n\t\"./_base-input-text.vue\": \"9c57\",\n\t\"./_base-link.vue\": \"cbd4\",\n\t\"./_base-logo.vue\": \"b7c5\",\n\t\"./_base-page-title.vue\": \"feda\",\n\t\"./_base-status-label.vue\": \"f8f2\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"b526\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a',{attrs:{\"href\":_vm.compHref,\"target\":_vm.compTarget}},[_c('v-img',_vm._g(_vm._b({staticClass:\"base-logo\",attrs:{\"src\":_vm.compSrc,\"title\":_vm.compAltText,\"alt\":_vm.compAltText,\"contain\":\"\"}},'v-img',Object.assign({}, _vm.commonAttributes, _vm.$attrs),false),_vm.$listeners))],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export const LogoType = Object.freeze({\n COMPANY: 'company', // Company logo\n APP: 'app', // App logo (Ready2Book)\n})\n","\n\n\n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-logo.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-logo.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-logo.vue?vue&type=template&id=201a930c&\"\nimport script from \"./_base-logo.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-logo.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VImg } from 'vuetify/lib/components/VImg';\ninstallComponents(component, {VImg})\n","/**\n * Checks if an array contains any items.\n * @param {Array} arr The array to check.\n * @returns True, if the array contains items. Otherwise, false.\n */\nconst isNonEmptyArray = (arr) => {\n return arr && Array.isArray(arr) && arr.length > 0\n}\n\nexport { isNonEmptyArray }\n","export default Object.freeze({\n /**\n * Something happened in setting up the request that triggered an Error\n */\n unknown: 'unknown',\n /**\n * The request was made and the server responded with a status code\n * that falls out of the range of 2xx\n */\n server: 'server',\n /**\n * The request was made but no response was received\n */\n request: 'request',\n})\n","import Vue from 'vue'\nimport Toast, { POSITION } from 'vue-toastification'\nimport 'vue-toastification/dist/index.css'\n\n// Options: https://github.com/Maronato/vue-toastification/tree/main#plugin-registration-vueuse\nconst options = {\n position: POSITION.BOTTOM_CENTER,\n}\n\nVue.use(Toast, options)\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.href)?_c('a',_vm._b({attrs:{\"href\":_vm.href,\"target\":\"_blank\"}},'a',_vm.$attrs,false),[_vm._t(\"default\")],2):_c('RouterLink',_vm._b({attrs:{\"to\":_vm.routerLinkTo}},'RouterLink',_vm.$attrs,false),[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-link.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-link.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-link.vue?vue&type=template&id=c82dbe10&\"\nimport script from \"./_base-link.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-link.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import dayjs from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport localizedFormat from 'dayjs/plugin/localizedFormat'\nimport isoWeek from 'dayjs/plugin/isoWeek'\nimport advancedFormat from 'dayjs/plugin/advancedFormat'\nimport isBetween from 'dayjs/plugin/isBetween'\nimport duration from 'dayjs/plugin/duration'\nimport utc from 'dayjs/plugin/utc'\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore'\nimport objectSupport from 'dayjs/plugin/objectSupport'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\nimport isToday from 'dayjs/plugin/isToday'\nimport isYesterday from 'dayjs/plugin/isYesterday'\nimport timezone from 'dayjs/plugin/timezone'\n// TODO: Any new supported i18n locales should have their dayjs equivalent imported here\nimport 'dayjs/locale/en-au'\nimport 'dayjs/locale/en-nz'\nimport 'dayjs/locale/en-ca'\nimport 'dayjs/locale/en-gb'\nimport localeData from 'dayjs/plugin/localeData'\n\ndayjs.extend(customParseFormat)\ndayjs.extend(objectSupport)\ndayjs.extend(isSameOrBefore)\ndayjs.extend(utc)\ndayjs.extend(timezone)\ndayjs.extend(duration)\ndayjs.extend(isBetween)\ndayjs.extend(advancedFormat)\ndayjs.extend(relativeTime)\ndayjs.extend(localizedFormat)\ndayjs.extend(isoWeek)\ndayjs.extend(isToday)\ndayjs.extend(isYesterday)\ndayjs.extend(localeData)\n\nexport default dayjs\n","export { default } from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=style&index=0&lang=scss&module=true&\"; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=style&index=0&lang=scss&module=true&\"","/**\n * Truncates any string provided\n * @param {String} text String to be truncated\n * @param {Number} limit String length before truncating. Default: 0\n * @param {String} delimiter Defaults to '...'\n * @returns Truncated string\n */\nexport default (text, limit = 0, delimiter = '...') => {\n if (typeof text !== 'string')\n throw Error('Invalid data type for text (Expected String)')\n\n if (typeof limit !== 'number')\n throw Error('Invalid data type for limit (Expected Number)')\n\n if (typeof delimiter !== 'string')\n throw Error('Invalid data type for delimiter (Expected String)')\n\n if (limit === 0) return text\n\n if (text.length > limit) text = text.substring(0, limit) + delimiter\n\n return text\n}\n","/**\n * The error event is fired on a Window object when a resource failed to load or couldn't be used — for example if a script has an execution error.\n * @tutorial https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n */\nexport default class WindowErrorDTO {\n constructor({ message, source, lineno, colno, error } = {}) {\n /**\n * @type {String} message A string containing a human-readable error message describing the problem. Same as `ErrorEvent.event`\n */\n this.message = message\n\n /**\n * @type {String} source A string containing the URL of the script that generated the error.\n */\n this.source = source\n\n /**\n * @type {Number} lineno An integer containing the line number of the script file on which the error occurred.\n */\n this.lineno = lineno\n\n /**\n * @type {Number} colno An integer containing the column number of the script file on which the error occurred.\n */\n this.colno = colno\n\n /**\n * @type {Error} error The error being thrown. Usually an `Error` object.\n */\n this.error = error\n }\n}\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_error.vue?vue&type=style&index=0&id=4161b4e7&lang=scss&scoped=true&\"","import Vue from 'vue'\nimport VueI18n from 'vue-i18n'\nimport { getLanguageBasedOnBaseURL } from '@/helpers/language-helpers'\n\n// Locales\nimport en from '@/locales/en.json'\nimport enUS from '@/locales/en-US.json'\nimport enCA from '@/locales/en-CA.json'\nimport enNZ from '@/locales/en-NZ.json'\nimport enGB from '@/locales/en-GB.json'\nimport enAU from '@/locales/en-AU.json'\n\nVue.use(VueI18n)\n\n// https://kazupon.github.io/vue-i18n/api/#constructor-options\nexport default new VueI18n({\n // locale: The locale of localization. If the locale contains a territory and a dialect, this locale contains an implicit fallback.\n locale: getLanguageBasedOnBaseURL(),\n // messages: The locale messages of localization.\n messages: {\n en,\n 'en-US': enUS,\n 'en-CA': enCA,\n 'en-NZ': enNZ,\n 'en-GB': enGB,\n 'en-AU': enAU,\n },\n numberFormats: {\n 'en-US': {\n currency: {\n style: 'currency',\n currency: 'USD',\n },\n },\n 'en-AU': {\n currency: {\n style: 'currency',\n currency: 'AUD',\n },\n },\n 'en-NZ': {\n currency: {\n style: 'currency',\n currency: 'NZD',\n },\n },\n 'en-GB': {\n currency: {\n style: 'currency',\n currency: 'GBP',\n },\n },\n 'en-CA': {\n currency: {\n style: 'currency',\n currency: 'CAD',\n },\n },\n },\n dateTimeFormats: {\n en: {\n time: {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n },\n time24: {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n },\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-AU': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-NZ': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-GB': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-CA': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-US': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n },\n // silentTranslationWarn: Whether suppress warnings outputted when localization fails.\n silentTranslationWarn: true,\n // silentFallbackWarn: Whether suppress fallback warnings when localization fails.\n silentFallbackWarn: true,\n})\n","export const PermissionScope = Object.freeze({\n ACCOUNTS: 'accounts',\n BOOKING: 'booking',\n TIMESHEETS: 'timesheets',\n REPLACE_ME: 'replaceMe',\n})\n","/**\n * List of units available from https://day.js.org/docs/en/display/difference\n */\nexport const DurationUnits = Object.freeze({\n DAY: 'd',\n WEEK: 'w',\n QUARTER: 'Q',\n MONTH: 'M',\n YEAR: 'y',\n HOUR: 'h',\n MINUTE: 'm',\n SECOND: 's',\n MILLISECOND: 'ms',\n})\n","export default class VueErrorDTO {\n constructor({ err, vm, info } = {}) {\n /**\n * @type {Object} complete error trace, contains the `message` and `error stack`\n */\n this.err = err\n\n /**\n * @type {Object} Vue component/instance in which error is occurred\n */\n this.vm = vm\n\n /**\n * @type {Object} info Vue specific error information such as lifecycle hooks, events etc.\n */\n this.info = info\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.offlineConfirmed)?_c('Layout',[_c('h1',{class:_vm.$style.title},[_vm._v(\" The page timed out while loading. Are you sure you're still connected to the Internet? \")])]):_c('LoadingView')}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n
\n The page timed out while loading. Are you sure you're still connected to\n the Internet?\n
\n \n \n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_timeout.vue?vue&type=template&id=c7520ae8&\"\nimport script from \"./_timeout.vue?vue&type=script&lang=js&\"\nexport * from \"./_timeout.vue?vue&type=script&lang=js&\"\nimport style0 from \"./_timeout.vue?vue&type=style&index=0&lang=scss&module=true&\"\n\n\n\n\nfunction injectStyles (context) {\n \n this[\"$style\"] = (style0.locals || style0)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n \n)\n\nexport default component.exports","export default class StoreErrorDTO {\n constructor({ err, module, errorResponse, logIpAddress = false } = {}) {\n /**\n * @type {Error} complete error trace, contains the `message` and `error stack`\n */\n this.err = err\n\n /**\n * @type {String} Name of module the error occurred in\n */\n this.module = module\n\n /**\n * @type {ErrorResponse} Object that determines which error page to display based on error returned from response\n */\n this.errorResponse = errorResponse\n\n /**\n * @type {Boolean} Indicates whether or not to log the user's IP address\n */\n this.logIpAddress = logIpAddress\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',[(_vm.content && _vm.icon && !Array.isArray(_vm.content))?_c('span',{class:['status-badge', _vm.capitalize ? 'text-capitalize' : '']},[_c('v-tooltip',{attrs:{\"disabled\":!_vm.tooltip,\"bottom\":\"\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nvar attrs = ref.attrs;\nreturn [_c('span',_vm._g(_vm._b({},'span',attrs,false),on),[_c('v-icon',{class:_vm.content.color + '--text',attrs:{\"left\":\"\",\"small\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.content.icon)+\" \")]),_vm._v(\" \"+_vm._s(_vm.mobile ? '' : _vm.content.title)+\" \")],1)]}}],null,false,2294613669)},[_c('span',[_vm._v(_vm._s(_vm.tooltip))])])],1):(_vm.content && !Array.isArray(_vm.content))?_c('v-chip',{staticClass:\"status-badge\",attrs:{\"x-small\":\"\",\"outlined\":_vm.outlined,\"label\":_vm.label,\"color\":_vm.content.color,\"dark\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.content.title)+\" \")]):(_vm.content && Array.isArray(_vm.content))?_c('div',[_vm._l((_vm.content),function(badge,index){return [_c('v-chip',{key:index,attrs:{\"x-small\":\"\",\"light\":\"\",\"outlined\":_vm.outlined}},[_vm._v(\" \"+_vm._s(badge.title)+\" \")])]})],2):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export const Severity = Object.freeze({\n /**\n * Services are working as expected\n */\n HEALTHY: 'Healthy',\n /**\n * Services may be runing slow but are otherwise functional\n */\n DEGRADED: 'Degraded',\n /**\n * Services may not be functional at all or at a severly reduced rate\n */\n UNHEALTHY: 'Unhealthy',\n /**\n * A notification that could be used to notify of upcoming maintenance or service degredation\n */\n ADVISORY: 'Advisory',\n})\n","import { Severity } from '@/shared/constants/serviceStatus/Severity'\n\n/**\n * getStatusLabelHashMap: Returns a hash map of all the available status labels\n * @returns\n */\nconst getStatusLabelHashMap = function() {\n const map = new Map()\n\n map.set(Severity.HEALTHY, {\n title: Severity.HEALTHY,\n color: 'success',\n icon: 'mdi-check-circle-outline',\n })\n map.set(Severity.DEGRADED, {\n title: Severity.DEGRADED,\n color: 'warning',\n icon: 'mdi-alert-circle-outline',\n })\n map.set(Severity.UNHEALTHY, {\n title: Severity.UNHEALTHY,\n color: 'error',\n icon: 'mdi-alert-circle-outline',\n })\n map.set(Severity.ADVISORY, {\n title: Severity.ADVISORY,\n color: 'info',\n icon: 'mdi-information-outline',\n })\n\n return map\n}\n\nexport { getStatusLabelHashMap }\n","\n\n\n \n \n \n \n \n \n {{ content.icon }}\n \n {{ mobile ? '' : content.title }}\n \n \n {{ tooltip }}\n \n \n\n \n {{ content.title }}\n \n
\n \n \n {{ badge.title }}\n \n \n \n
\n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-status-label.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-status-label.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-status-label.vue?vue&type=template&id=8b90f0e2&\"\nimport script from \"./_base-status-label.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-status-label.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VChip } from 'vuetify/lib/components/VChip';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VTooltip } from 'vuetify/lib/components/VTooltip';\ninstallComponents(component, {VChip,VIcon,VTooltip})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{class:[_vm.isMobileViewPort ? 'mb-4' : 'mb-8', 'd-flex align-center mt-3']},[_vm._t(\"leftAction\"),_c('header',[(_vm.subtitleOnTop)?_c('h4',{class:[!_vm.isMobileViewPort ? _vm.subtitleClass : 'body-2'],attrs:{\"id\":\"page-subtitle\"}},[_vm._v(\" \"+_vm._s(_vm.subtitle)+\" \")]):_vm._e(),_vm._t(\"title\",[_c('h2',{class:[\n !_vm.isMobileViewPort\n ? 'text-h5 d-inline-block font-weight-medium'\n : 'text-h6 font-weight-medium',\n _vm.subtitleOnTop ? 'mt-0 mb-8' : 'mb-0' ],attrs:{\"id\":\"page-title\"}},[_vm._v(\" \"+_vm._s(_vm.title)+\" \")]),_vm._t(\"appendTitle\")]),_vm._t(\"bottomSubtitle\",[(!_vm.subtitleOnTop)?_c('h4',{class:[!_vm.isMobileViewPort ? _vm.subtitleClass : 'body-2'],attrs:{\"id\":\"page-subtitle\"}},[_vm._v(\" \"+_vm._s(_vm.subtitle)+\" \")]):_vm._e()])],2)],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n
\n {{ subtitle }}\n
\n \n
\n {{ title }}\n
\n \n \n \n
\n {{ subtitle }}\n
\n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-page-title.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-page-title.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-page-title.vue?vue&type=template&id=25fdeeb4&\"\nimport script from \"./_base-page-title.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-page-title.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}