diff --git a/staff/assets/maps/Zurich-L5.svg b/staff/assets/maps/Zurich-L5.svg new file mode 100644 index 000000000..fb270c890 --- /dev/null +++ b/staff/assets/maps/Zurich-L5.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/staff/assets/maps/frankfurt/level_37.svg b/staff/assets/maps/frankfurt/level_37.svg index 235479fa8..20518619f 100644 --- a/staff/assets/maps/frankfurt/level_37.svg +++ b/staff/assets/maps/frankfurt/level_37.svg @@ -87,7 +87,8 @@ C439.4,1043.5,439.6,1043.1,439.7,1042.7z M436,1040.9h3.8c0-0.5-0.2-0.9-0.4-1.3c-0.3-0.4-0.9-0.7-1.4-0.7s-1,0.2-1.3,0.5 C436.2,1039.8,436,1040.4,436,1040.9L436,1040.9z"/> + c-0.3-0.2-0.5-0.2-0.8-0.2c-0.2,0-0.5,0.1-0.7,0.2c-0.2,0.2-0.4,0.4-0.4,0.6c-0.1,0.4-0.2,0.9-0.2,1.3v3.5h-1.1L442.3,1044.9 + L442.3,1044.9z"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1433,9 +1194,9 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2739,6 +2155,14 @@ + + + + + + + + @@ -2846,1033 +2270,1940 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/staff/assets/maps/frankfurt/level_7.svg b/staff/assets/maps/frankfurt/level_7.svg index 20518619f..78f2b85a2 100644 --- a/staff/assets/maps/frankfurt/level_7.svg +++ b/staff/assets/maps/frankfurt/level_7.svg @@ -4403,5 +4403,6 @@ + diff --git a/staff/assets/maps/houston/level_22.svg b/staff/assets/maps/houston/level_22.svg index bd882050d..86fe52bbc 100644 --- a/staff/assets/maps/houston/level_22.svg +++ b/staff/assets/maps/houston/level_22.svg @@ -3372,6 +3372,7 @@ + + hide', animate('200ms ease-in'))\n]);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class AnimationsModule {}\n","export * from './lib/base.module';\nexport * from './lib/types.utilities';\nexport * from './lib/general.utilities';\nexport * from './lib/base.class';\nexport * from './lib/base.directive';\nexport * from './lib/date.utils'\nexport * from './lib/date.spec-helpers'\nexport * from './lib/replace.pipe'\nexport * from './lib/cdk-drop-list-scroll-container.directive'\nexport * from './lib/image.directive';\n","import { Subscription, BehaviorSubject } from \"rxjs\";\n\nexport class BaseClass {\n /** Store for named timers */\n protected _timers: { [name: string]: number } = {};\n /** Store for named intervals */\n protected _intervals: { [name: string]: number } = {};\n /** Store for named subscription unsub callbacks */\n protected _subscriptions: { [name: string]: (Subscription | (() => void)) } = {};\n /** Subject which stores the initialised state of the object */\n protected readonly _initialised = new BehaviorSubject(false);\n\n /** Observable of the initialised state of the object */\n public get initialised(): BehaviorSubject {\n return this._initialised;\n }\n /** Whether the object has been initialised */\n public get is_initialised(): boolean {\n return this._initialised.getValue();\n }\n\n protected destroy() {\n for (const key in this._timers) {\n if (this._timers.hasOwnProperty(key)) {\n this.clearTimeout(key);\n }\n }\n for (const key in this._intervals) {\n if (this._intervals.hasOwnProperty(key)) {\n this.clearInterval(key);\n }\n }\n for (const key in this._subscriptions) {\n if (this._subscriptions.hasOwnProperty(key)) {\n this.unsub(key);\n }\n }\n }\n\n /**\n * Creates a named timer\n * @param name Name of the timer\n * @param fn Callback function for the timer\n * @param delay Callback delay\n */\n protected timeout(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearTimeout(name);\n this._timers[name] = setTimeout(() => {\n fn();\n this._timers[name] = null;\n }, delay);\n } else {\n throw new Error(\n name ? 'Cannot create named timeout without a name' : 'Cannot create a timeout without a callback'\n );\n }\n }\n\n /**\n * Clears the named timer\n * @param name Timer name\n */\n protected clearTimeout(name: string) {\n if (this._timers[name]) {\n clearTimeout(this._timers[name]);\n this._timers[name] = null;\n }\n }\n\n /**\n * Creates a named interval\n * @param name Name of the interval\n * @param fn Callback function for the interval\n * @param delay Callback delay\n */\n protected interval(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearInterval(name);\n this._intervals[name] = setInterval(() => fn(), delay);\n } else {\n throw new Error(\n name ? 'Cannot create named interval without a name' : 'Cannot create a interval without a callback'\n );\n }\n }\n\n /**\n * Clears the named interval\n * @param name Timer name\n */\n protected clearInterval(name: string) {\n if (this._intervals[name]) {\n clearInterval(this._intervals[name]);\n this._intervals[name] = null;\n }\n }\n\n /**\n * Store named subscription\n * @param name Name of the subscription\n * @param unsub Unsubscribe callback or Subscription object\n */\n protected subscription(name: string, unsub: Subscription | (() => void)) {\n this.unsub(name);\n this._subscriptions[name] = unsub\n }\n\n /**\n * Call unsubscribe callback with the given name\n * @param name\n */\n protected unsub(name: string) {\n if (this._subscriptions && this._subscriptions[name]) {\n this._subscriptions[name] instanceof Subscription\n ? (this._subscriptions[name] as Subscription).unsubscribe()\n : (this._subscriptions[name] as any)();\n this._subscriptions[name] = null;\n }\n }\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\n\n@Directive({\n selector: 'a-very-basic-component-base-that-should-not-be-used'\n})\nexport class BaseDirective extends BaseClass implements OnDestroy {\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NumbersOnlyDirective } from './numbers-only.directive';\n\n@NgModule({\n imports: [CommonModule,],\n declarations: [\n NumbersOnlyDirective\n ],\n exports: [\n NumbersOnlyDirective\n ]\n})\nexport class BaseModule {\n}\n","import {\n Directive,\n Input,\n Renderer2,\n SimpleChanges,\n OnChanges,\n ContentChildren,\n QueryList,\n AfterContentInit\n} from '@angular/core';\nimport { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';\nimport { BaseDirective } from './base.directive';\n\nexport enum ScrollDirection {\n NONE,\n X,\n Y,\n BOTH\n}\n\n@Directive({\n selector: '[cdkDropList][scrollContainer]'\n})\nexport class CdkDropListScrollContainer extends BaseDirective\n implements OnChanges, AfterContentInit {\n /** Direction of scroll to determine updating the position of the drop list */\n @Input() direction: ScrollDirection = ScrollDirection.X;\n /** Name of the scroll container for the list */\n @Input() scrollContainer: string;\n /** Scroll container element */\n public element: HTMLElement;\n /** Last scroll position */\n public last_scroll: { x: number; y: number } = { x: 0, y: 0 };\n\n /** Draggable children elements */\n @ContentChildren(CdkDrag) private items: QueryList;\n\n constructor(private _cdkDropList: CdkDropList, private _renderer: Renderer2) {\n super();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.scrollContainer && this.scrollContainer) {\n this.element = this._cdkDropList.element.nativeElement.closest(\n this.scrollContainer\n ) as HTMLElement;\n }\n }\n\n public ngAfterContentInit(): void {\n this.subscription(\n 'drag_items',\n this.items.changes.subscribe((items: QueryList) => {\n const list = items.toArray();\n list.forEach((i, index) => {\n this.subscription(\n `list-item-${index}`,\n this._renderer.listen(i.element.nativeElement, 'mousedown', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'mouseup', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n this.subscription(\n `list-item-touch-${index}`,\n this._renderer.listen(i.element.nativeElement, 'touchstart', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'touchend', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n });\n })\n );\n }\n\n /** Start listing for scroll events on the container */\n public onDrag() {\n if (this.element) {\n this.subscription(\n 'scroll',\n this._renderer.listen(this.element, 'scroll', () => this.updateListPosition())\n );\n }\n }\n\n /** Stop listening for scroll events on the container */\n public onDrop() {\n this.unsub('scroll');\n }\n\n /**\n * Forcefully update the position data of the drop list\n */\n private updateListPosition() {\n this.timeout(\n 'update_positions',\n () => {\n const scroll = { x: this.element.scrollLeft, y: this.element.scrollTop };\n if (\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.Y) &&\n scroll.y !== this.last_scroll.y) ||\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.X) &&\n scroll.x !== this.last_scroll.x)\n ) {\n (this._cdkDropList._dropListRef as any)._cacheOwnPosition();\n (this._cdkDropList._dropListRef as any)._siblings.forEach(i =>\n i.isReceiving() ? i._cacheOwnPosition() : null\n );\n }\n this.last_scroll = scroll;\n },\n 50\n );\n }\n}\n","import MockDate from 'mockdate';\n\n/**\n * August 13, 2020 at 7:22:12 UTC\n */\nconst initialTime = 1597346532 * 1000;\n\nexport const mockDate = (timeOverride = initialTime) => MockDate.set(new Date(timeOverride));\n\nexport const resetDate = () => MockDate.reset();\n","import { DateNow, DateTZ } from '@mckinsey-converge/date-tz'\nimport { DateTime } from 'luxon';\nimport * as dayjs from 'dayjs';\nimport {\n dayJsHoursMinutes,\n dayJsTimeFormatString,\n} from './general.utilities';\n\n/**\n * Allows you to split up durations into a group.\n */\nexport interface DurationGroup {\n /**\n * Step amount to generate between start and max.\n */\n step: number;\n /**\n * Where to start in minutes.\n */\n start: number;\n /**\n * Where to end in minutes.\n */\n max: number;\n}\n\n/**\n * Find the multiple of `stepMinute` which is closest to the 'minutes' property of the given date.\n * @param date - Any Lexon date.\n * @param stepMinute - The number of minutes between one timeslot and the next. Integer value\n * 1 to 59, inclusive.\n */\n// R--- depreciate this one\nexport const closestToTimeSlot = (date: DateTime, stepMinute: number, start: number = 0) : DateTime => {\n return date.set({ millisecond: 0, second: 0, minute: Math.ceil(date.minute / stepMinute) * stepMinute })\n .plus({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\nexport const closestToTimeSlotTz = (dateTz: DateTZ, stepMinute: number, start: number = 0) : DateTZ => {\n return dateTz.setValue({ millisecond: 0, second: 0, minute: Math.ceil(dateTz.minutes / stepMinute) * stepMinute })\n .addValue({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as hrs, or minutes as mins\n */\nexport function durationHumanized(duration: number, short: boolean = false): string {\n if (!duration || duration < 0) {\n return '';\n }\n const h = Math.floor(duration / 60);\n let d = `${h >= 1 ? h + (short ? ' hr' : ' hour' + (h === 1 ? '' : 's')) : ''}`;\n if (duration % 60 !== 0) {\n if (d) {\n d += short ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${m >= 1 ? m + (short ? ' min' : ' minute' + (m === 1 ? '' : 's')) : ''}`;\n }\n return d;\n}\n\nexport const weekDayMonthYearFormat = (date: DateTZ): string => date.formatDate('ccc dd MMM yyyy');\n\n/**\n * Tries to extract best-fit input\n * @return undefined if not valid. otherwise if good\n */\nexport const extractDateFromInput = (input: string,\n checkHour,\n startDate: dayjs.Dayjs): dayjs.Dayjs | undefined => {\n // check if input has am/pm or normal 24 hour time.\n // let date = dayjs(input, 'HH:mm');\n // let date = dayjs(input, 'h:mma');\n let date = dayjs(input, dayJsTimeFormatString());\n if (!date.isValid()) {\n // patch if time is in format xx:x to assume you meant xx:x0\n let cleanedInput = input;\n const times = input.split(':');\n if(!input){\n return undefined\n }\n if (times.length === 2) {\n if (times[1].length === 1) {\n cleanedInput = `${times[0]}:${times[1]}0`;\n }\n }\n // may be other input, lets try next value (without am/pm)\n date = dayjs(cleanedInput, dayJsHoursMinutes());\n // might be just purely an hour\n if (!date.isValid() && checkHour) {\n date = dayjs(input, 'H');\n }\n }\n // We expect input times to be in the future. If now is in the afternoon, this\n // simple block will ensure the returned date is also in the afternoon.\n //\n // NB: dayjs parses times as morning by default.\n if (date.isValid()) {\n // Move to the selected start date\n date = date.month(startDate.month()).date(startDate.date()).year(startDate.year());\n if (startDate.hour() > date.hour() && date.date() === startDate.date()) {\n date = date.set('hour', date.hour() + 12);\n }\n }\n\n return date.isValid() ? date : undefined;\n};\n\n\n/**\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 3. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n * @param step The step between time slots.\n * @param input The input text.\n */\nexport const nearestStepToInput = (\n step: number,\n input: string,\n currentStartDate: number,\n start: number = 0\n): string => {\n let date = extractDateFromInput(input, false, dayjs(currentStartDate));\n if (date) {\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, step, start);\n return closestDate.toFormat(dayJsHoursMinutes());\n } else {\n return input;\n }\n};\n/**\n * Similiar to {@link nearestStepToInput} instead:\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds which duration group is closest to the currentStartDate. If not found\n * return vanilla text.\n * 3. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 4. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n */\nexport const nearestDurationToInput = (durationGroups: DurationGroup[],\n currentStartDate: number,\n value: string): string => {\n\n let date = extractDateFromInput(value, false, dayjs(currentStartDate));\n\n if (!date) {\n // Check if the input is a duration \n const duration = parseInt(value);\n if (typeof (duration) === 'number' && value.indexOf(':') === -1 && duration > 12) {\n date = dayjs(currentStartDate).add(duration, 'm');\n }\n }\n\n if (date) {\n const minutes = date.diff(currentStartDate, 'minute');\n const closestDurationGroup = durationGroups.find(d => {\n return (minutes <= d.max);\n });\n if (closestDurationGroup) {\n const offset = [closestDurationGroup].reduce((previousValue, currentValue) => {\n return previousValue + currentValue.start;\n }, 0);\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, closestDurationGroup.step, 0);\n return closestDate.toFormat(dayJsHoursMinutes());\n }\n }\n\n return value;\n};\n\nexport const resetSecondsOnTimestamp = (timestamp: number) => {\n return DateTime.fromMillis(timestamp).set({ second: 0, millisecond: 0 }).toMillis();\n}\n\nexport const formatDateWithSuffix = (date: string): string => {\n const dateObj = new Date(date);\n const day = dateObj.getDate();\n const month = dateObj.toLocaleString(\"default\", { month: \"short\" });\n const year = dateObj.getFullYear();\n return `${day}${nthNumber(day)} ${month} ${year}`; //this.event.date_string;\n}\n\nconst nthNumber = (number) => {\n return number > 0\n ? [\"th\", \"st\", \"nd\", \"rd\"][\n (number > 3 && number < 21) || number % 10 > 3 ? 0 : number % 10\n ]\n : \"\";\n};\n\nexport const getListOfDateFormat = () => {\n return [\t\n 'MMMM dd y', \t//March 07 2023\n 'MMM dd, y',\t//Mar 07 2023\n 'MMMM dd',\t\t//March 07\n 'MMM dd', \t\t//Mar 07\n 'MM dd', \t\t//03 07\n\n 'MM-dd-yy',\t\t//03-07-23\n 'MM-dd-yyyy',\t//03-07-2023\n 'MMMM-dd-yyyy', //March-07-2023\n 'MMMM-dd-yy',\t//March-07-23\n\n 'MMMM-dd',\t\t//March-07\n 'MMM-dd',\t\t//Mar-07\n \n 'MMM-dd-y',\t\t//Mar-07-2023\n\n 'MM/dd',\t\t//03/07\n 'MM/dd/yy',\t\t//03/07/23\n 'MM/dd/yyyy',\t//03/07/2023\n \n 'dd/MM',\t\t//07/03\n 'dd/MM/yy',\t\t//07/03/23\n 'dd/MM/yyyy',\t//07/03/2023\n \n 'dd-MMMM',\t\t//07-March\n 'dd MMMM',\t\t//07 March\n 'dd-MMM',\t\t//07-Mar\n 'dd MMM',\t\t//07 Mar\n\n 'dd-MM-y',\t\t//07-03-23\n 'dd MMMM yy',\t//07 March 23\n \n 'dd/MMM/y',\t //07/Mar/2023\n 'dd/MMMM/y', //07/March/2023\n 'dd/MMM/yy', //07/Mar/23\n 'dd/MMMM/yy', //07/March/23\n \n\n 'dd-MMMM-yy',\t//07-March-23\n 'dd-MMM-yy',\t//07-Mar-23\n 'dd-MM-yy',\t\t//07-03-23\n 'MMMM-dd-yy',\t//March-07-23\n 'MMM-dd-yy',\t//Mar-07-23\n\n 'MMMM dd yy',\t//March 07 23\n 'MMM dd, yy',\t//Mar 07 23\n 'MM dd, yy',\t//03 07 23\n\n 'dd MMMM y',\t//07 March 2023\n 'dd MMM, y',\t//07 Mar 2023\n 'dd MM, yy',\t//07 03, 23\n 'dd-MMM-y',\t//07-Mar-2023\n\n 'h:mm a', // 3:30 pm\n 'h:mma' // 3:30 pm\n\n ];\n}","import { HashMap, Point } from './types.utilities';\n\nimport * as dayjs from 'dayjs';\nimport * as utc from 'dayjs/plugin/utc';\nimport * as timezone from 'dayjs/plugin/timezone';\nimport * as isToday from 'dayjs/plugin/isToday';\nimport * as weekday from 'dayjs/plugin/weekday';\nimport * as customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n// TODO: this is not the best place to import this timezone addition\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isToday);\ndayjs.extend(weekday);\ndayjs.extend(customParseFormat);\n\n/** Available console output streams. */\nexport type ConsoleStream = 'debug' | 'warn' | 'log' | 'error' | 'info';\n\n/**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\nexport function log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false,\n app_name: string = 'STAFF'\n) {\n if ((window as any).debug || force) {\n const colors: string[] = [\n 'color: #E91E63',\n 'color: #3F51B5',\n 'color: default',\n ];\n if (args) {\n console[stream](\n `%c[${app_name}]%c[${type}] %c${msg}`,\n ...colors,\n args\n );\n } else {\n console[stream](`%c[${app_name}]%c[${type}] %c${msg}`, ...colors);\n }\n }\n}\n\n/**\n * Get item from the nested object\n * @param keys List of sub-keys to search for\n * @param map Object to search\n */\n export function getItemWithKeys(keys: string[], map: HashMap) {\n const key = keys[0];\n if (map && key in map) {\n return keys.length > 1\n ? getItemWithKeys(keys.slice(1), map[key] || {})\n : map[key];\n }\n return null;\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the platform is a mobile device.\n */\nexport function isMobileDevice(): boolean {\n const r = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n return !!navigator.userAgent.match(r);\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Mobile Safari.\n */\nexport function isMobileSafari(): boolean {\n const agent = navigator.userAgent;\n return !!(\n agent.match(/iPhone|iPad|iPod/) &&\n agent.match(/AppleWebKit/) &&\n !agent.match('CriOS')\n );\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Android Chrome.\n */\nexport function isAndroidChrome(): boolean {\n const agent = navigator.userAgent;\n return !!(agent.match(/Android/) && agent.match(/Chrome/));\n}\n\n/**\n * Generate string representation of a number with zeros padding the length\n * @param value Number to pad with zeros\n * @param length Length of the resulting string\n */\nexport function padZero(value: number, length: number): string {\n let str = value.toString();\n while (str.length < length) {\n str = '0' + str;\n }\n return str;\n}\n\n/**\n * Remove duplicates from the given array\n * @param array List of items to remove duplicates from\n * @param key Key on array objects to compare for uniqueness\n */\nexport function unique(array: T[], key: keyof T | undefined = undefined) {\n return array.filter(\n (el, pos, arr) =>\n el &&\n arr.indexOf(\n key\n ? arr.find((i) => i && i[key] === el[key])\n : arr.find((i) => i === el)\n ) === pos\n );\n}\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as h\n */\nexport function humaniseDuration(durationInput: number, size: string = 'long') {\n const duration = Math.floor(durationInput);\n if (!duration || duration < 0) {\n return '';\n }\n let singular = false;\n let format = { hours: ' hour', minutes: ' minute' };\n switch (size) {\n case 'medium':\n format = { hours: 'hr', minutes: 'min' };\n break;\n case 'short':\n format = { hours: 'h', minutes: 'm' };\n singular = true;\n break;\n }\n const h = Math.floor(duration / 60);\n let d = `${\n h >= 1\n ? h +\n (singular ? format.hours : format.hours + (h === 1 ? '' : 's'))\n : ''\n }`;\n if (duration % 60 !== 0) {\n if (d) {\n d += singular ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${\n m >= 1\n ? m +\n (singular\n ? format.minutes\n : format.minutes + (m === 1 ? '' : 's'))\n : ''\n }`;\n }\n return d;\n}\n\n/**\n * Get a filtered list of items\n * @param filter Value to filter on\n * @param items List of results to filter\n * @param fields Fields to check for matches on each item\n */\nexport function filterList(\n filter: string,\n items?: T[],\n fields: string[] = ['id']\n): T[] {\n let results: any[];\n // Tokenise filter string\n const filters = (filter || '').toLowerCase().split(' ');\n const list = {};\n for (const f of filters) {\n /* istanbul ignore else */\n if (f) {\n /* istanbul ignore else */\n if (!list[f]) {\n list[f] = 0;\n }\n list[f]++;\n }\n }\n // Group similar tokens\n const parts = [];\n for (const f in list) {\n /* istanbul ignore else */\n if (list.hasOwnProperty(f)) {\n parts.push({ word: f, count: list[f], regex: new RegExp(f, 'gi') });\n }\n }\n parts.sort(\n (a, b) => b.word.length - a.word.length || a.word.localeCompare(b.word)\n );\n const item_list = JSON.parse(JSON.stringify(items || []));\n /* istanbul ignore else */\n if (filter) {\n results = item_list.filter((item) => {\n let match_count = 0;\n item.match_index = 65535;\n item.match = '';\n const field_list = {};\n // Initialise field match variables\n for (const f of fields) {\n field_list[f] = {\n value: (item[f] || '').toLowerCase(),\n index: 65536,\n matched: 0,\n };\n }\n // Search for matches with the tokenised filter string\n for (const i of parts) {\n /* istanbul ignore else */\n if (i.word) {\n // Check fields for matches\n for (const f of fields) {\n const field = field_list[f];\n const index = field.value.indexOf(i.word);\n field.index = index < field.index ? index : field.index;\n field.matches = (\n field.value.match(i.regex) || []\n ).length;\n field.value = field.value.replace(i.regex, ' ');\n }\n // Update token match count\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.matches >= i.count) {\n match_count++;\n // Update field matches\n let changed = 0;\n const tokens = (\n item[`match_${f}`] ||\n item[f] ||\n ''\n ).split(' ');\n for (const k of tokens) {\n /* istanbul ignore else */\n if (changed >= i.count) {\n break;\n }\n /* istanbul ignore else */\n if (\n k.toLowerCase().indexOf(i.word) >= 0 &&\n k.indexOf('`') < 0\n ) {\n tokens[tokens.indexOf(k)] = k.replace(\n i.regex,\n '`$&`'\n );\n changed++;\n }\n }\n item[`match_${f}`] = tokens.join(' ');\n break;\n }\n }\n }\n }\n // Get field with the most relevent match\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.index < item.match_index && field.index >= 0) {\n item.match_index = field.index;\n item.match = f;\n }\n }\n return (\n item.match_index >= 0 &&\n item.match &&\n match_count >= parts.length\n );\n });\n } else {\n results = item_list;\n }\n // Sort by order of relevence then name\n results.sort((a, b) => {\n const diff = a.match_index - b.match_index;\n return diff === 0 ? a.name.localeCompare(b.name) : diff;\n });\n return results;\n}\n\n/**\n * Convert a match string from `filterList` to renderable HTML\n * @param str Match string to change\n */\nexport function matchToHighlight(str: string): string {\n /* istanbul ignore else */\n if (str) {\n str = str.replace(\n /\\`[a-zA-Z0-9\\@\\.\\_]*\\`/g,\n '$&'\n );\n str = str.replace(/\\`/g, '');\n }\n return str;\n}\n\n/**\n * Convert time string to ms from UTC epoch for today\n * @param time Time string in the format `HH:mm`\n */\nexport function timeToDate(time: string): number {\n const parts = time.split(':');\n const date = DateNow(new Date())\n .setValue({\n hour: +parts[0],\n minute: +parts[1],\n })\n .startOfValue('minute');\n return date.ms;\n}\n\n/**\n * Generate a random number\n * @param ceil Biggest value to generate not inclusive\n * @param floor Smallest value to generate. Defaults to 0\n */\nexport function randomInt(ceil: number, floor: number = 0) {\n return Math.floor(Math.random() * (ceil - floor)) + floor;\n}\n\n/**\n * Get time format string for locale\n * @param isLowerCaseAmPm - if true, we use lowercase for am/pm.\n */\nexport function timeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const hoursMinutes = (): string => (is24HourTime() ? 'HH:mm' : 'h:mma');\n\nexport function dayJsTimeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const dayJsHoursMinutes = (): string =>\n is24HourTime() ? 'HH:mm' : 'h:mm';\n\n/**\n * Converts a timeZone name into a date object.\n * @param timeZoneName - name of timezone\n */\nexport const timezoneNameToDate = (\n timeZoneName: string | undefined\n): DateTZ | undefined => {\n let zone: DateTZ | undefined;\n if (timeZoneName) {\n try {\n zone = DateNow(new Date()).toZone(timeZoneName);\n } catch (e) {\n // invalid timezone. Suppress logs here.\n // console.error(e);\n }\n }\n return zone;\n};\n\nexport const timezoneDisplay = (date: DateTZ) =>\n !!date ? `${date.formatDate('ZZZZ')}` : '';\nexport const gmtOffsetDisplay = (date: DateTZ) =>\n !!date ? `(GMT${date.formatDate('ZZ')})` : '';\n\n/**\n * Returns a full time with timezone.\n * @param date\n */\nexport function timeWithZoneFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${timezoneDisplay(date)}`;\n}\n\nexport function timeWithGmtOffsetFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(date)}`;\n}\n\n/**\n * Returns a full start end range.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}`;\n}\n\n/**\n * Returns a full start end range with timezone.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeWithZoneFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(startDateTz)}`;\n}\n\n/**\n * Returns a full date with weekday day month year.\n * @param date\n * @param comma optional boolean to display a comma after the month\n */\nexport function dateLocalFormatString(date: DateTZ, comma?: boolean): string {\n if (comma) {\n return date.formatLocalDate('cccc d MMMM, yyyy');\n }\n return date.formatLocalDate('cccc d MMMM yyyy');\n}\n\nexport function dateBuildingFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('cccc d MMMM, yyyy');\n }\n return date.formatDate('cccc d MMMM yyyy');\n}\n\nexport function shorterLocalDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatLocalDate('ccc d MMM, yyyy');\n }\n return date.formatLocalDate('ccc d MMM yyyy');\n}\n\nexport function shorterBuildingDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('ccc d MMM, yyyy');\n }\n return date.formatDate('ccc d MMM yyyy');\n}\n\n/** Whether locale string is displayed in 24 hour time */\nexport function is24HourTime(): boolean {\n const date = new Date();\n const localeString = date\n .toLocaleTimeString(\n document.querySelector('html').getAttribute('lang') ||\n navigator.language\n )\n .toLowerCase();\n return localeString.indexOf('am') < 0 && localeString.indexOf('pm') < 0;\n}\n\n/* istanbul ignore next */\n/**\n * Downloads a file to the users computer with the given filename and contents\n * @param filename Name of the file to download\n * @param contents Contents of the file to download\n */\nexport function downloadFile(filename: string, contents: string) {\n const element = document.createElement('a');\n element.setAttribute(\n 'href',\n 'data:text/plain;charset=utf-8,' +\n encodeURIComponent('\\uFEFF' + contents)\n );\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n}\n\n/**\n * Parse raw CSV data into a JSON object\n * @param csv CSV data to parse\n */\nexport function csvToJson(csv: string) {\n const lines = csv.split('\\n');\n let fields = lines.splice(0, 1)[0].split(',');\n fields = fields.map((v) => v.replace('\\r', ''));\n const list: any[] = [];\n for (const line of lines) {\n let parts = line.split(',');\n parts = parts.map((v) => v.replace('\\r', ''));\n /* istanbul ignore else */\n if (parts.length >= fields.length) {\n const item: any = {};\n for (let i = 0; i <= parts.length; i++) {\n let part = null;\n part = parts[i];\n /* istanbul ignore else */\n if (part !== undefined) {\n item[(fields[i] || '').split(' ').join('_').toLowerCase()] =\n part;\n }\n }\n list.push(item);\n }\n }\n\n return list;\n}\n\n/**\n * Convert javascript array to CSV string\n * @param json Javascript array to convert\n */\nexport function jsonToCsv(json: HashMap[]) {\n /* istanbul ignore else */\n if (json instanceof Array && json.length > 0) {\n const keys = Object.keys(json[0]);\n const valid_keys = keys.filter((key) => json[0].hasOwnProperty(key));\n return `${valid_keys.join(',')}\\n${json\n .map((item) =>\n valid_keys\n .map((key) => {\n return typeof item[key] !== 'boolean'\n ? `\"${item[key] || ''}\"`\n : item[key];\n })\n .join(',')\n )\n .join('\\n')}`;\n }\n return '';\n}\n\n/* istanbul ignore next */\n/**\n * detect IE\n * returns version of IE or false, if browser is not Internet Explorer\n */\nexport function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n/**\n * Grab point details from mouse or touch event\n * @param event Event to grab details from\n */\nexport function eventToPoint(event: MouseEvent | TouchEvent): Point {\n if (!event) {\n return { x: -1, y: -1 };\n }\n if (event instanceof MouseEvent) {\n return { x: event.clientX, y: event.clientY };\n } else {\n return event.touches && event.touches.length > 0\n ? { x: event.touches[0].clientX, y: event.touches[0].clientY }\n : { x: -1, y: -1 };\n }\n}\n\n/* istanbul ignore next */\n/**\n * Flatten nested array\n * @param an_array Array to flatten\n */\nexport function flatten(an_array: T[]) {\n const stack = [...an_array];\n const res = [];\n while (stack.length) {\n // pop value from stack\n const next = stack.pop();\n if (Array.isArray(next)) {\n // push back array items, won't modify the original input\n stack.push(...next);\n } else {\n res.push(next);\n }\n }\n // reverse to restore input order\n return res.reverse();\n}\n\nconst seed = xmur3('PlaceOS');\nconst rand = sfc32(0x9e3779b9, 0x243f6a88, 0xb7e15162, seed());\n\nexport function predictableRandomInt(ceil: number = 100, floor: number = 0) {\n return Math.floor(rand() * (ceil - floor)) + floor;\n}\n\n// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript\nfunction xmur3(str) {\n for (var i = 0, h = 1779033703 ^ str.length; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)),\n (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n var t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n\nexport function isLessThanBreakpoint(breakpoint: number): boolean {\n if (window) {\n return window.innerWidth < breakpoint;\n }\n return false;\n}\n\nexport function toTitleCase(str: string): string {\n return typeof str === 'string'\n ? str\n .toLowerCase()\n .split(' ')\n .map(function (word) {\n return word.replace(word[0], word[0].toUpperCase());\n })\n .join(' ')\n : '';\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\nimport { SpaceImageObject } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\n\n@Directive({\n selector: 'a-very-basic-component-image-that-should-not-be-used'\n})\nexport class ImageDirective extends BaseClass implements OnDestroy {\n public foundImages?: SpaceImageObject[];\n public loadImages?: BehaviorSubject\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import {\n Directive,\n ElementRef,\n HostListener\n} from '@angular/core';\n\n@Directive({\n selector: 'input[type=number], input[numbersOnly]'\n})\nexport class NumbersOnlyDirective {\n\n constructor(private _el: ElementRef) {\n }\n\n @HostListener('input', ['$event']) onInputChange(event) {\n const initalValue = this._el.nativeElement.value;\n this._el.nativeElement.value = initalValue.replace(/[^0-9]*/g, '');\n if (initalValue !== this._el.nativeElement.value) {\n event.stopPropagation();\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'replace'\n})\nexport class ReplacePipe implements PipeTransform {\n\n transform(value: string, from: string = '_', to: string = ' '): string {\n return (value|| '').split(from).join(to);\n }\n}\n","export * from './lib/bookings.module';\nexport * from './lib/bookings.actions'\nexport * from './lib/bookings.reducer'\nexport * from './lib/bookings.types'\nexport * from './lib/bookings.utils'\n","\nimport { IBookingQueryOptions, PaginatedBooking } from '@mckinsey-converge/data-common';\nimport { \n createLoadingAction\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n MyBookingsState,\n MyBookingsStoreState,\n} from './bookings.types';\nimport {\n createAction,\n props\n} from '@ngrx/store';\n\nexport const bookingStateSelector = (state: MyBookingsStoreState) => state.bookings;\n\nexport const loadBookingsWithQuery = createAction('[Bookings] Load Bookings with query', props());\n\nexport const loadHomepageBookingsResults = createLoadingAction('HomepageBookings', 'homepage');\n\nexport const loadUpcomingBookingsResults = createLoadingAction('UpcomingBookings', 'upcoming');\n\nexport const loadPastBookingsResults = createLoadingAction('PastBookings', 'past');\n\nexport const loadCancelledBookingsResults = createLoadingAction('CancelledBookings', 'cancelled');\n\nexport const loadBookingByIdResults = createLoadingAction('BookingById', 'bookingById');\n\nexport const clearBookingByIdResults = createAction('[BookingById] Clear Booking Data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n IBookingQueryOptions,\n BookingsPaginatedService\n} from '../../../data-common/src/lib/bookings';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadHomepageBookingsResults,\n loadPastBookingsResults,\n loadUpcomingBookingsResults,\n loadCancelledBookingsResults,\n loadBookingsWithQuery,\n loadBookingByIdResults\n} from './bookings.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n\n} from './bookings.utils';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Injectable()\nexport class BookingsEffects {\n constructor(private actions: Actions,\n private bookingService: BookingsPaginatedService) {\n }\n\n @Effect()\n public afterBookingsRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadBookingsWithQuery),\n mergeMap((action: LoadingAction) => {\n const date = new DateTZ({date: action.from})\n const yourBookingsRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.subtractValue({ minutes: 5 }).seconds}`,\n },\n include_rooms: true\n };\n const upcomingRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.seconds}`,\n },\n include_rooms: true\n };\n const pastRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n end_epoch: `<${date.seconds}`,\n },\n include_rooms: true\n };\n const cancelledRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: true,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n },\n include_rooms: true\n };\n const byIdRequest = {\n email: action.email,\n id: action.id,\n pagination: true,\n limit: 1,\n include_rooms: true\n };\n\n const effects = [];\n switch(action.target) {\n case 'upcoming':\n effects.push(loadUpcomingBookingsResults.request(upcomingRequest));\n break;\n case 'past':\n effects.push(loadPastBookingsResults.request(pastRequest));\n break;\n case 'cancelled':\n effects.push(loadCancelledBookingsResults.request(cancelledRequest));\n break;\n case 'bookingById':\n effects.push(loadBookingByIdResults.request(byIdRequest));\n break\n case 'homepage':\n effects.push(loadHomepageBookingsResults.request(yourBookingsRequest));\n // effects.push(loadPastBookingsResults.request(pastRequest));\n break\n default:\n }\n return effects;\n })\n );\n\n @Effect()\n public loadHomepageBookingsResultsEffect = createLoadingEffect(this.actions, loadHomepageBookingsResults,\n (action) => this.bookingService.userBookings(action, `homepage-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadUpcomingBookingsResultsEffect = createLoadingEffect(this.actions, loadUpcomingBookingsResults,\n (action) => this.bookingService.userBookings(action, `upcoming-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n \n @Effect()\n public loadPastBookingsResultsEffect = createLoadingEffect(this.actions, loadPastBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `past-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadCancelledBookingsResultsEffect = createLoadingEffect(this.actions, loadCancelledBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `cancelled-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadBookingByIdResultsEffect = createLoadingEffect(this.actions, loadBookingByIdResults,\n (action) => \n this.bookingService.userBookings(action, `bookingById-${action.id}`));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingsReducer } from './bookings.reducer';\nimport { BookingsEffects } from './bookings.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([BookingsEffects]),\n StoreModule.forFeature('bookings', bookingsReducer)\n ]\n})\nexport class BookingsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n createReducer,\n on\n} from '@ngrx/store';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n clearBookingByIdResults,\n} from './bookings.actions';\nimport { MyBookingsState } from './bookings.types';\n \nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\n\n\nexport const initialBookingsState: MyBookingsState = {\n query: LoadingModel.empty(),\n homepage: LoadingModel.empty(),\n upcoming: LoadingModel.empty(),\n past: LoadingModel.empty(),\n cancelled: LoadingModel.empty(),\n bookingById: LoadingModel.empty(),\n};\n\nexport const bookingsReducer = createReducer(initialBookingsState,\n on(clearBookingByIdResults, (state: MyBookingsState) => ({\n ...state,\n bookingById: LoadingModel.empty(),\n }) as MyBookingsState),\n ...loadHomepageBookingsResults.ons,\n ...loadUpcomingBookingsResults.ons,\n ...loadPastBookingsResults.ons,\n ...loadCancelledBookingsResults.ons,\n ...loadBookingByIdResults.ons,\n );\n\n\n\n export const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n };\n \n export const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: undefined\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n );\n \n","import { Booking } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport const mapBookingToSelectOption = (booking?: Booking): SelectOption => booking ? ({\n value: booking.id,\n display: booking.name\n}) : undefined;\n","export * from './lib/buildings.module';\nexport * from './lib/buildings.actions'\nexport * from './lib/buildings.types'\nexport * from './lib/buildings.reducer'\n","import { \n createLoadingAction,\n} from '../../../loading/src/lib/loading.actions';\nimport {\n Building,\n BuildingCity,\n} from '../../../data-common/src/lib/organisation/building.class';\nimport {\n BuildingLevel,\n} from '../../../data-common/src/lib/organisation/level.class'\nimport {\n Organisation,\n} from '../../../data-common/src/lib/organisation/organisation.class'\nimport { createSelector } from '@ngrx/store';\nimport {\n BuildingState,\n BuildingStoreState\n} from './buildings.types';\n\nexport const loadBuildings = createLoadingAction('Buildings', 'data');\n\nexport const buildingStateSelector = (state: BuildingStoreState) => state.buildings;\n\nexport const selectLoadBuildingsSuccess = createSelector(buildingStateSelector, loadBuildings.selectors.optionalSuccess);\n\n/**\n * Groups buildings by city\n */\nexport const selectBuildingOptionsGroupedByCity = createSelector(loadBuildings.selectors.optionalSuccess, (success) => {\n if (success) {\n const mapped = new Map();\n success.forEach(s => {\n const found = Array.from(mapped.keys()).find(c => c.name === s.city);\n let list = found ? mapped.get(found) : undefined;\n if (!list) {\n list = [];\n mapped.set({\n name: s.city,\n timezone: s.timezone\n }, list);\n }\n list.push(s);\n });\n return mapped;\n }\n return new Map();\n});\n\nexport const selectLevelByZoneId = createSelector(selectLoadBuildingsSuccess,\n (buildings, param: string) => {\n if (buildings) {\n return buildings.map(b => b.levels.find((l: BuildingLevel) => l.id === param))\n ?.[0] ?? undefined;\n }\n return undefined;\n });\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n Organisation,\n OrganisationService\n} from '../../../data-common/src/lib/organisation';\nimport { loadBuildings } from './buildings.actions';\nimport {\n createLoadingEffect,\n LoadingAction,\n Payload\n} from '@mckinsey-converge/loading';\nimport { loadOrganisations } from '../../../organisation/src/lib/organisation.actions';\nimport { map } from 'rxjs/operators';\n\n\n@Injectable()\nexport class BuildingsEffects {\n\n constructor(private actions: Actions,\n private organizationService: OrganisationService) {\n\n }\n\n @Effect()\n public loadBuildings = createLoadingEffect(this.actions, loadBuildings,\n (action) => this.organizationService.loadBuildingsWithOrg(action));\n\n @Effect()\n public loadBuildingsAfterOrg = this.actions.pipe(\n ofType(loadOrganisations.success),\n map((action: LoadingAction>) => loadBuildings.request(action.payload)));\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { BuildingsEffects } from './buildings.effects';\nimport { StoreModule } from '@ngrx/store';\nimport { buildingsReducer } from './buildings.reducer';\n\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n BuildingsEffects\n ]),\n StoreModule.forFeature('buildings', buildingsReducer)\n ]\n})\nexport class BuildingsModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadBuildings } from './buildings.actions';\nimport { BuildingState } from './buildings.types';\n\nexport const initialBuildingState: BuildingState = {\n data: LoadingModel.empty()\n};\n\nexport const buildingsReducer = createReducer(initialBuildingState,\n ...loadBuildings.ons\n);\n","export * from './lib/data-common.module';\nexport * from './lib/booking';\nexport * from './lib/bookings';\nexport * from './lib/catering';\nexport * from './lib/location';\nexport * from './lib/organisation';\nexport * from './lib/spaces';\nexport * from './lib/users';\nexport * from './lib/app.service';\nexport * from './lib/hotkeys.service';\nexport * from './lib/base.service';\nexport * from './lib/base-api.class';\nexport * from './lib/reports'\nexport * from './lib/service-manager.class';\nexport * from './lib/settings.service';\nexport * from './lib/spec-helpers';\nexport * from './lib/settings.interfaces';\nexport * from './lib/validation.utilities';\nexport * from './lib/status.interfaces';\nexport * from './lib/recurrence/recurrence.utils';\nexport * from './lib/close-modal-dialog-service';\nexport * from './lib/validation.utilities';\nexport * from './lib/collapse-accordion-service';","import { HashMap } from '@mckinsey-converge/base';\n\n/**\n * Convert map into a query string\n * @param map Key value pairs to convert\n */\nexport function toQueryString(map: HashMap) {\n let str = '';\n if (map) {\n for (const key in map) {\n if (map.hasOwnProperty(key) && map[key] !== undefined && map[key] !== null) {\n str += `${(str ? '&' : '')}${key}=${map[key]}`;\n }\n }\n }\n return str;\n}\n","import {\n ApplicationRef,\n Injectable,\n NgZone,\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { take, first } from 'rxjs/operators';\n\nimport { ComposerService } from '@placeos/composer';\nimport { PlaceOSOptions } from '@placeos/ts-client';\nimport { HeapIoService } from '@acaprojects/ngx-heap-io';\n\nimport {\n BehaviorSubject,\n Observable,\n Subject\n} from 'rxjs';\n\nimport {\n ApplicationLoadingState,\n BaseClass,\n ConsoleStream,\n log\n} from '@mckinsey-converge/base';\nimport { SettingsService } from './settings.service';\n\nimport { HotkeysService } from './hotkeys.service';\nimport {\n ApplicationIcon,\n ComposerSettings\n} from './settings.interfaces';\nimport { EnvironmentService } from '../../../environment/src/lib/environment.service'; // '@mckinsey-converge/environment';\nimport {\n Store\n} from '@ngrx/store';\nimport { selectCurrentUser } from '../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../user/src/lib/user.types';\nimport { Booking } from './bookings';\nimport { filter } from 'rxjs/operators';\nimport { SnackBarService } from '../../../ui/src/lib/custom-snackbar-component/custom-snackbar-component.service';\n\ndeclare global {\n interface Window {\n application: ApplicationService;\n mock: {\n enabled: boolean;\n backend: any;\n };\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationService extends BaseClass {\n /** Map of state variables for Service */\n protected _subjects: {\n [key: string]: BehaviorSubject | Subject;\n } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n _kioskFormFilter: boolean;\n\n constructor(\n public store: Store,\n public analytics: HeapIoService,\n private _app_ref: ApplicationRef,\n private _zone: NgZone,\n private _title: Title,\n private _settings: SettingsService,\n private _hotkeys: HotkeysService,\n private _composer: ComposerService,\n private _snackbar: MatSnackBar,\n private _environment: EnvironmentService,\n private snack: SnackBarService\n\n ) {\n super();\n this.set('system', null);\n this.set('title', 'Home');\n this.set('loading', {});\n this.set('CONCIERGE.day_view.viewing', null);\n this.set('undo', new BehaviorSubject<{\n action: 'series' | 'booking',\n booking: Booking\n } | null>(null));\n\n this.set('APP.breakdown', false);\n\n this._app_ref.isStable.pipe(first(_ => _)).subscribe(() => {\n this._zone.run(() => {\n this.log('APP', `Application has stablised.`);\n this.waitForSettings();\n });\n });\n }\n\n public set kioskFormFilter(isIt: boolean) {\n this._kioskFormFilter = isIt;\n }\n\n public get kioskFormFilter():boolean {\n return this._kioskFormFilter \n }\n\n /** Analytics service */\n public get Analytics() {\n return {};\n }\n\n /** Hotkeys service */\n public get Hotkeys() {\n return this._hotkeys;\n }\n\n /**\n * Get a setting from the settings service\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n return this._settings.get(key);\n }\n\n /**\n * Title of the page\n */\n public set title(value: string) {\n const title_suffix = this.setting('app.title');\n this.set('title', value);\n this._title.setTitle(`${value ? value + ' | ' : ''}${title_suffix}`);\n }\n\n /**\n * Title of the page\n */\n public get title(): string {\n return this._title.getTitle();\n }\n\n /** Root API Endpoint */\n public get endpoint() {\n return `/api/staff/`;\n }\n\n /** Root API Endpoint for engine */\n public get engine_endpoint() {\n return this._composer.auth.api_endpoint + '/';\n }\n\n /** Whether settings has been loaded */\n public get has_settings(): boolean {\n return this._settings.is_initialised;\n }\n\n /**\n * Create notification popup\n * @param type CSS Class to add to the notification\n * @param message Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n * @param icon Icon to render to the left of the notification message\n */\n public notify(\n type: string,\n message: string,\n action: string = 'OK',\n on_action?: () => void,\n icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'info'\n }\n ): void {\n this.openSnack(message, type);\n // const snackbar_ref = this._snackbar.open(message, action, {\n // panelClass: [type],\n // duration: 5000\n // });\n // this.subscription(\n // 'snackbar_close',\n // snackbar_ref.afterDismissed().subscribe(() => {\n // this.unsub('snackbar_close');\n // this.unsub('notify');\n // })\n // );\n // if (action) {\n // on_action = on_action || (() => snackbar_ref.dismiss());\n // this.subscription(\n // 'notify',\n // snackbar_ref.onAction().subscribe(() => on_action())\n // );\n // }\n }\n\n public openSnack(message, type) {\n this.snack.openSnackBar(message, type, 5000);\n }\n \n /**\n * Create success notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifySuccess(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'done'\n };\n this.notify('success', msg, action, on_action, icon);\n }\n\n /**\n * Create error notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyError(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'error'\n };\n this.notify('error', msg, action, on_action, icon);\n }\n\n /**\n * Create warning notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyWarn(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'warning'\n };\n this.notify('warn', msg, action, on_action, icon);\n }\n\n /**\n * Create info notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyInfo(msg: string, action?: string, on_action?: () => void): void {\n this.notify('info', msg, action, on_action);\n }\n\n /**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\n public log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false\n ): void {\n log(type, msg, args, stream, force);\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n return this._subjects[name] && this._subjects[name] instanceof BehaviorSubject\n ? (this._subjects[name] as BehaviorSubject).getValue()\n : null;\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n public set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /** Wait for settings to be initialised before setting up the application */\n private waitForSettings() {\n // Wait until the settings have loaded before initialising\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => this.init());\n }\n\n /**\n * Initialise application services\n */\n private init(): void {\n this.setupComposer();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe( filter(user => user !== undefined) )\n .pipe(take(1))\n .subscribe((user: any) => {\n // Once we know we have the user loaded.\n this.setupAnalytics(user?.fmno);\n })\n );\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n this._initialised.next(true);\n });\n // Add service to window if in debug mode\n if (window.debug) {\n window.application = this;\n }\n }\n\n /**\n * Initialise the composer library comms\n */\n private setupComposer(): void {\n this.log('SYSTEM', 'Setup up composer...');\n const loading: ApplicationLoadingState = this.get('loading');\n loading.composer = {\n message: 'Initialising service connection',\n state: 'loading'\n };\n this.set('loading', loading);\n // Get application settings\n const settings: ComposerSettings = this._settings.get('composer') || {};\n const protocol = settings.protocol || location.protocol;\n const host = settings.domain || location.hostname;\n const port = settings.port || location.port;\n const url = settings.use_domain ? `${protocol}//${host}:${port}` : location.origin;\n const route = host.includes('localhost') && port === '4200' ? '' : settings.route || '';\n const mock =\n this._settings.get('mock') ||\n location.href.includes('mock=true') ||\n localStorage.getItem('mock') === 'true';\n // Generate configuration object\n const config: PlaceOSOptions = {\n scope: 'public',\n host: `${host}:${port}`,\n auth_uri: `${url}/auth/oauth/authorize`,\n token_uri: `${url}/auth/token`,\n redirect_uri: `${location.origin}${route}/oauth-resp.html`,\n handle_login: !settings.local_login,\n mock\n };\n this._composer.setup(config);\n loading.composer = {\n message: 'Initialising service connection',\n state: 'complete'\n };\n this.set('loading', loading);\n }\n\n private setupAnalytics(fmno: string) {\n this.log('HEAP', `Loading heap ${this._environment?.heap_io_id}`);\n // Default Heap app ID via the default setting\n const heapIo = this._settings.get('app.heap_io');\n if (this._environment?.heap_io_id) {\n // Apply Heap app ID via the environmental setting\n heapIo.app_id = this._environment.heap_io_id;\n }\n if (heapIo) {\n this.analytics.load(heapIo);\n if (fmno) {\n this.analytics.identify(fmno);\n }\n } else {\n this.log('HEAP', `Heap could not be found for the current frontend ${this._settings.frontend}`);\n }\n }\n\n}\n","import { Subject } from 'rxjs';\n\nimport {\n BaseClass,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n ServiceLike,\n ServiceManager\n} from './service-manager.class';\n\nexport type ApiEventType = 'value_change' | 'item_saved' | 'reset' | 'other';\n\nexport interface ApiEvent {\n type: ApiEventType;\n metadata: T;\n}\n\n\nexport class BaseDataClass extends BaseClass {\n /** Subject for emitting events on the object */\n protected readonly event_subject = new Subject();\n /** Observable for events on this object */\n public readonly events = this.event_subject.asObservable();\n /** Unique Identifier of the object */\n public readonly id: string;\n /** Human readable name of the object */\n public readonly name: string;\n /** Email address associated with the object */\n public readonly email: string;\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(BaseDataClass);\n }\n\n constructor(raw_data: HashMap) {\n super();\n this.id = raw_data.id || raw_data.zone_id || raw_data.email || '';\n this.name = raw_data.name || '';\n this.email = `${raw_data.email || ''}`.toLowerCase();\n }\n\n /**\n * Save pending changes to server\n */\n public save(): Promise {\n if (this._service) {\n const form = this.toJSON();\n return new Promise((resolve, reject) => {\n const promise = this.id\n ? this._service.update(this.id, form)\n : this._service.add(form);\n promise.then(\n (d) => {\n this.event_subject.next({ type: 'item_saved', metadata: d });\n resolve(d);\n },\n (_) => reject(_)\n );\n });\n } else {\n Promise.reject('No service to process request');\n }\n }\n\n /**\n * Delete this item from the server\n */\n public delete(): Promise {\n if (this.id) {\n return this._service.delete(this.id);\n }\n }\n\n /**\n * Run task for this item on the service\n * @param task_name Name of the task\n * @param parameters Parameters to pass to the task request\n */\n public runTask(task_name: string, parameters: HashMap): Promise {\n if (this.id) {\n return this._service.task(this.id, task_name, parameters);\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: BaseDataClass): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._service;\n delete obj._changes;\n delete obj.event_subject;\n delete obj.events;\n // Remove parent private members\n delete obj._timers;\n delete obj._intervals;\n delete obj._subscriptions;\n delete obj._server_names;\n delete obj._initialised;\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substring(1)] || key.substring(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): BaseDataClass {\n return new BaseDataClass(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): BaseDataClass {\n return new BaseDataClass({ ...this, id: null, email: null });\n }\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseDataClass } from './base-api.class';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class BaseAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = typeof query_params.cache !== 'boolean' ? query_params.cache || 1000 : 1000;\n typeof query_params.cache !== 'boolean' && delete query_params.cache;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n // Bring back once implemented in the API\n // if (this.settingsService.concierge) {\n // query = query + '&check_access=true';\n // }\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: T[] | HashMap[] = [];\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n result =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryObsr(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );;\n }\n\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse | HashMap[]{\n let result: IEngineResponse | HashMap[] =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n return result;\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryRoomsForQR(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url);\n }\n \n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public \n task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * V-2\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public taskObsr( \n id: string, \n task_name: string, \n form_data: HashMap = {}, \n method: 'post' | 'get' = 'post' ):Observable{\n const query = toQueryString(this.injectConcierge(form_data));\n let engine = false;\n let cache = 1000;\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n\n const request = method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n \n return request;\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param id url id with respect to update api\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public updateObsr(id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n \n return this.http.put(url, body)\n .pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) \n ),\n catchError((error: any, result?: T) => {\n console.log(error);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n return of(error as T);\n })\n );\n\n }\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public uploadSpacePhotos(apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${apiSubRoute}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n\n const token = sessionStorage.length ? JSON.parse(sessionStorage.getItem('OAUTH.params')).access_token : '';\n\n const headers = new HttpHeaders({\n 'Authorization': `Bearer ${token}`,\n });\n \n const requestOptions = { headers: headers };\n\n // return this.httpClient.post(url, body, {\n // ...requestOptions \n // });\n\n return this.http.post(url, body);\n\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { Building } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { User } from '../users';\nimport { Space } from '../spaces';\nimport { SpaceBookingRuleOptions } from '../spaces/space.class';\nimport {\n BookingFormData,\n} from './booking.form.data';\nimport { statusFromBookings } from '../bookings/booking.utilities';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { SpaceStatus } from '../bookings/space.types';\nimport { SpaceFeatures } from '../spaces/space.class';\nimport { HashMap } from 'libs/base/src/lib/types.utilities';\n\nexport const spaceExtraFeatureToDisplayName = (feature: SpaceFeatures) => {\n switch (feature) {\n case SpaceFeatures.VideoConference:\n return 'Video conference (VC)';\n case SpaceFeatures.ConferencePhone:\n return 'Conference phone';\n case SpaceFeatures.WirelessContentSharing:\n return 'Wireless content sharing';\n case SpaceFeatures.FlipChart:\n return 'Flip chart';\n case SpaceFeatures.Glassboard:\n return 'Glassboard';\n case SpaceFeatures.ElectronicWhiteboard:\n return 'Whiteboard';\n case SpaceFeatures.ConferenceRoom:\n return 'Conference';\n case SpaceFeatures.TeamRoom:\n return 'Team';\n case SpaceFeatures.PartnerOffice:\n return 'Partner';\n case SpaceFeatures.PhoneBooth:\n return 'Phone booth';\n case SpaceFeatures.NaturalLight:\n return 'Room with window only (natural light)';\n case SpaceFeatures.BoardRoom:\n return 'Boardroom room style';\n case SpaceFeatures.CocktailRoom:\n return 'Cocktail room style';\n case SpaceFeatures.TheatreRoom:\n return 'Theatre room style';\n case SpaceFeatures.WorkshopRoom:\n return 'Workshop room style';\n case SpaceFeatures.UShapeRoom:\n return 'U Shape room style';\n case SpaceFeatures.Miscellaneous:\n return 'Miscellaneous room style'\n case SpaceFeatures.Catering:\n return 'Rooms with catering';\n // TODO: add any special display handling here.\n default:\n return feature;\n }\n};\n\n\nexport const instantBookOption: SelectOption = {\n value: 'instant-book',\n display: 'Listing you can book without waiting for a host approval',\n shortDisplay: 'Instant book'\n};\nexport const instantBookOptions: SelectOption[] = [\n instantBookOption\n];\n\nexport const mapSpaceFeaturesToSelectOption = (f: SpaceFeatures): SelectOption => {\n const display = spaceExtraFeatureToDisplayName(f);\n return ({\n value: f,\n display,\n // Useful for long text, like that of the instant-book\n // option.\n //\n // We do not expect this option object to be modified\n // at any further point before it appears on screen -\n // although that may change in future releases.\n shortDisplay: display\n });\n};\n\nexport const roomEquipmentRequiredOptions: SelectOption[] = [\n SpaceFeatures.VideoConference,\n SpaceFeatures.ConferencePhone,\n SpaceFeatures.WirelessContentSharing,\n SpaceFeatures.FlipChart,\n SpaceFeatures.Glassboard,\n SpaceFeatures.ElectronicWhiteboard\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const internalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.PartnerOffice,\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom,\n SpaceFeatures.PhoneBooth\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const externalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomDetailsRequired: SelectOption[] = [\n SpaceFeatures.NaturalLight,\n SpaceFeatures.BoardRoom,\n SpaceFeatures.CocktailRoom,\n SpaceFeatures.TheatreRoom,\n SpaceFeatures.WorkshopRoom,\n SpaceFeatures.UShapeRoom,\n SpaceFeatures.Miscellaneous\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomCateringAvailable: SelectOption[] = [\n SpaceFeatures.Catering,\n].map(mapSpaceFeaturesToSelectOption);\n\n/**\n * Defines the reason by which spaces are filtered out / missing.\n */\nexport enum SpaceFilterReason {\n /**\n * Spaces were shown and not all filtered out.\n */\n None = 'None',\n\n /**\n * If room filters are applied to the set of rooms,\n * and rooms are available if not applied by filtering.\n */\n Filters = 'Filters',\n\n /**\n * We check office rules first to determine if its been filtered.\n */\n OfficeRules = 'OfficeRules',\n\n /**\n * Fallback as the end case if no results are found.\n */\n DateTime = 'DateTime',\n\n /**\n * In case there are no results for a buiding but there are other office buidings in the same city.\n */\n AlternateBuildingsFound = 'AlternateBuildingsFound',\n\n /**\n * If room is non-bookable in the system\n */\n NonBookable = 'NonBookable'\n}\n\nexport interface FilteredSpaces {\n spaces: Space[] | undefined;\n reason: SpaceFilterReason;\n statusMap: HashMap;\n specificReason?: SpaceFilterReason;\n}\n\n/**\n * Filter spaces by filters locally. TBD in the future for real API pagination.\n *\n * @param formFilters - the set of filters to apply on the list of spaces.\n * @param spaces - the list of spaces to filter\n * @param activeForm - the landing page set of filters.\n * @param buildings - the list of buildings loaded, used to retrieve building-specific booking rules.\n * @param currentUser - the current user\n */\nexport const filterSpacesByAppliedFilters = (\n formFilters: SelectOption[],\n spaces: Space[] | undefined, // the resultshere are raw JSON Spaces, not an array of the Space class\n activeForm: BookingFormData,\n buildings: Building[] = [],\n currentUser: User | undefined,\n isStaffMap: boolean = false): FilteredSpaces => {\n const instantBook: boolean = formFilters.some(f => f.value === instantBookOption.value);\n const onlyCatering: boolean = formFilters.some(f => f.value === SpaceFeatures.Catering);\n // Drop incompatible spaces. If no filters were given, just return the array unchanged.\n const featureFilters = formFilters.filter(filter => ![instantBookOption.value, SpaceFeatures.Catering].includes(filter.value));\n const formFiltersEmpty = featureFilters.length === 0;\n\n // R--- refactor activeForm? Only after forms can handle dateTz\n // Blocked by date time input refactor\n const options: SpaceBookingRuleOptions = {\n duration: activeForm.duration,\n host: currentUser,\n dateTz: activeForm.dateTz,\n };\n let rulesCount = 0;\n let ruleReason = '';\n let excludedByFiltersCount = 0;\n const statusMap: HashMap = {};\n // console.group();\n const filteredSpaces = spaces?.map(space => space instanceof Space ? space : new Space(space)).filter(raw_space => {\n const space = new Space(raw_space); // Construct the full fledged space\n const building = buildings.find(b => space.zones.includes(b.id));\n const rules = rulesForSpace({\n time: options?.dateTz?.ms,\n duration: options.duration,\n user: options.host,\n rules: building?.booking_rules,\n space\n });\n ruleReason = rules.reason;\n let valid = !rules.hide;\n if (!valid) {\n rulesCount++;\n return false;\n }\n\n\n // Check for all the form filters ( except 'catering' )\n let hasAllFeatures: boolean;\n const internalRoomTypeFilters = [\n 'conference',\n 'meeting_room',\n 'partner',\n 'phone_booth',\n 'team_room',\n ];\n\n if (featureFilters.length === 0) {\n hasAllFeatures = true;\n } else if(featureFilters.every(f => internalRoomTypeFilters.includes(f.value))) { // If all featureFilters(selected filters) are present in internalRoomTypeFilters, make the filtering inclusive(return on first true) \n hasAllFeatures = featureFilters.some(f => space.featuresArray.includes(f.value));\n } else { // If any featureFilters(selected filters) are not present in internalRoomTypeFilters, make the filtering exclusive(return on first false)\n hasAllFeatures = featureFilters.every(f => space.featuresArray.includes(f.value));\n }\n\n const canBook = instantBook ? space.bookable : true;\n const matchesType = activeForm?.bookingType?.value === 'allRooms'\n ? true\n : space?.internal_or_external?.length\n ? space.internal_or_external === activeForm?.bookingType?.value\n : true;\n valid = valid && matchesType && (formFiltersEmpty || hasAllFeatures) && canBook;\n let hasCatering = building?.has_catering;\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n // need the room catering to override.\n if (onlyCatering && !hasCatering) {\n valid = false;\n // console.log('Excluded by Catering');\n }\n\n // count this space if the only reason it can't be shown is because one of the filters excluded it\n if (!hasAllFeatures) {\n valid = false;\n // console.log('Excluded by Status');\n }\n\n const status = statusFromBookings(\n space.bookings.length ? space.bookings.map(b => new Booking(b)) : space.settings.bookings.map(b => new Booking(b)),\n space.bookable && !rules.hide,\n !rules.auto_approve,\n activeForm.dateTz,\n space\n );\n\n // only compute room availability here right now if instant book option is chosen and room still valid.\n if (instantBook && valid) {\n valid = status.status === SpaceStatus.Available;\n if (!valid) console.group('Excluded by Status');\n \n }\n\n\n /** \n * If there are rooms that are recurring but not available at all during the queried times, we filter them out from the results displayed on the page.\n * The \"Available\" status indicates whether a room can be booked during the queried times.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\n if(activeForm.is_recurrent && !space.availableOccurrences && !isStaffMap) {\n valid = false;\n }\n /** */\n\n // cache space status\n if (valid) {\n if(activeForm.is_recurrent && space.availableOccurrences && space.availableOccurrences<= space.totalOccurrences) {\n // space is available and requested for recurrence booking and few occurences are available to book then let the space select/bookable from map with limited availability\n statusMap[space.id] = !rules.auto_approve ? SpaceStatus.Requestable : SpaceStatus.Available;\n }else\n {\n statusMap[space.id] = status.status;\n }\n \n } else {\n excludedByFiltersCount++;\n }\n // console.log('Valid:', valid);\n return valid;\n });\n\n const buildingsInSameCity = buildings.filter(\n (_) =>activeForm?.location!==undefined && activeForm?.location?.length && _.city === activeForm?.location[0]?.meta?.building?.city\n ) || [];\n const alternateBuildings = buildingsInSameCity.filter(building =>\n !activeForm.location.some(locationItem =>\n locationItem.meta?.building?.id === building.id\n )\n );\n\n // console.groupEnd();\n let reason, specificReason = SpaceFilterReason.None;\n // console.log('Spaces:', filteredSpaces?.length, excludedByFiltersCount, rulesCount, ruleReason)\n if (filteredSpaces?.length === 0) {\n if (excludedByFiltersCount > 0 && (!formFiltersEmpty || onlyCatering)) {\n reason = SpaceFilterReason.Filters;\n } else if (rulesCount > 0) {\n reason = SpaceFilterReason.OfficeRules;\n } else if(alternateBuildings){\n reason = SpaceFilterReason.AlternateBuildingsFound;\n }\n else {\n reason = SpaceFilterReason.DateTime;\n }\n\n if (ruleReason === SpaceFilterReason.OfficeRules) {\n specificReason = SpaceFilterReason.OfficeRules;\n }\n }\n\n return { spaces: filteredSpaces, reason, statusMap, specificReason };\n};\n","import { BookingFormData } from './booking.form.data';\nimport {\n createAction,\n props\n} from '@ngrx/store';\nimport { Payload } from '../../../../loading/src/lib/loading.actions';;\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\n\nexport const storeBookingFormData = createAction('[BookingForm] Store Form Data',\n props>>());\n\nexport const clearBookingFormData = createAction('[BookingForm] Clear Form Data');\n\nexport const storeRoomFilters = createAction('[BookingForm] Store Room Filters',\n props[]>>());\n\nexport const clearRoomFilters = createAction('[BookingForm] Clear Room Filters');\n\nexport const openBookingSurvey = createAction('[BookingSurvey] Open Survey Modal');\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { RoomQueryOptions } from '../../../../rooms/src/lib/rooms.types';\nimport { User } from '../users/user.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { Building } from '../organisation';\n\nexport const DEFAULT_BOOKING_DURATION = 30;\n\nexport const internalBookingTypeOption = {\n value: 'internal',\n display: 'Internal',\n};\n\nexport const allBookingTypeOption = {\n value: 'allRooms',\n display: 'All Rooms',\n};\n\nexport const bookingTypeOptions: SelectOption[] = [\n internalBookingTypeOption,\n {\n value: 'external',\n display: 'External',\n }\n];\n\nexport const defaultRoomSizeOption = {\n value: '2',\n display: '3-9 People',\n};\n\nexport const roomSizeOptions: SelectOption[] = [\n {\n value: '1',\n display: '1-2 People',\n },\n defaultRoomSizeOption,\n {\n value: '3',\n display: '10+ People',\n }\n];\n\nexport const roomSizeOptionsKiosk: SelectOption[] = [\n ...roomSizeOptions,\n {\n value: '4',\n display: 'All Rooms',\n },\n];\n\nexport const roomCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 1;\n case '2':\n return 3;\n case '3':\n return 10;\n case '4':\n return null;\n }\n};\n\nexport const roomMaxCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 2;\n case '2':\n return 9;\n default:\n return null;\n }\n};\n\nexport interface BookingFormData {\n // R--- off the rails, define these \"any's\"\n id?: string;\n location: SelectOption[];\n dateTz: DateTZ;\n /**\n * Duration, in minutes.\n */\n duration: number;\n bookingType: SelectOption;\n roomSize: SelectOption;\n selectedRoom?: any;\n organiser?: SelectOption;\n title?: string;\n attendees?: any[];\n code?: string;\n notes?: string;\n head_count?: number;\n creator?: User;\n company?: any[];\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n action?: string; // helping to set staff app recurring action flag for edit/clone in the active form\n ignore?: string; // helping while editing - recurring series rooms search api call\n bookable?: boolean; // set while editing - recurring series rooms search api call\n occurrence_edits?: string[];\n opt_out?:boolean;\n nextBusinessDay?: boolean; // set property if user room selection from next business day section on result page\n outlook_opt_out?:boolean;\n expanded_section_ids?: string[]; // set property if user room selection from next business day section on result page\n resultLoaded?: number; // set property if user room selection from any section on result page after clicking load more button\n}\n\n/**\n * Converts form data into API query parameters.\n */\nexport const roomFormDataToQuery = (\n data: BookingFormData\n): RoomQueryOptions => {\n // remove all buildings chip from query\n const filteredLocationIds = data?.location\n .filter((l) => l.groupChild)\n .map((l) => l.value)\n .join(',');\n return {\n dateTz: data?.dateTz,\n duration: data?.duration,\n locations: filteredLocationIds,\n capacity: roomCapacityToValue(data?.roomSize?.value),\n capacity_max: roomMaxCapacityToValue(data?.roomSize?.value),\n\n is_recurrent: data?.is_recurrent,\n is_multiroom: data?.is_multiroom,\n merged: data?.merged,\n recurrence_period: data?.recurrence_period,\n recurrence_interval: data?.recurrence_interval,\n recurrence_endTz: data?.recurrence_endTz,\n recurrence_count: data?.recurrence_count,\n recurrence_starts: data?.recurrence_starts,\n recurrence_exceptions: data?.recurrence_exceptions, //SHOULD BE DATETZ\n recurrence_days: data?.recurrence_days,\n timezone: data?.timezone,\n offset: data?.offset,\n buildings: data?.buildings,\n bookable: data?.bookable,\n ignore: data?.ignore\n };\n};\n","import { BookingFormState } from './booking.form.types';\nimport {\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption\n} from './booking.form.data';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nconst now = DateNow(new Date())\n\nexport const defaultTestBookingForm = (): BookingFormState => ({\n activeForm: {\n dateTz: now,\n duration: 2 * DEFAULT_BOOKING_DURATION,\n location: [],\n bookingType: internalBookingTypeOption,\n roomSize: defaultRoomSizeOption\n },\n activeFormFilters: []\n});\n","import { createSelector } from '@ngrx/store';\nimport {\n RoomStoreState\n} from '../../../../rooms/src/lib/rooms.types';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n roomStateSelector,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from '../../../../rooms/src/lib/rooms.actions';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n bookingStateSelector\n} from '../../../../bookings/src/lib/bookings.actions';\nimport { Building } from '../organisation/building.class';\nimport { BuildingStoreState } from '../../../../buildings/src/lib/buildings.types';\nimport { selectLoadBuildingsSuccess } from '../../../../buildings/src/lib/buildings.actions';\nimport { Space } from '../spaces/space.class';\nimport { User } from '../users/user.class';\nimport { selectCurrentUser } from '../../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../../user/src/lib/user.types';\nimport { LoadingModel } from '../../../../loading/src/lib/loading.model';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\nimport {\n SpaceFilterReason,\n filterSpacesByAppliedFilters,\n FilteredSpaces\n} from './booking-filter.utils';\nimport {\n BookingFormData,\n internalBookingTypeOption,\n} from './booking.form.data';\nimport {\n BookingFormState,\n BookingStoreState,\n} from './booking.form.types';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\n\n\nexport const selectBookingFormsData =\n (state: BookingStoreState | RoomStoreState | BuildingStoreState | UserStoreState) =>\n (state as any).bookingForm as BookingFormState;\n\nexport const selectActiveForm = createSelector(selectBookingFormsData, state => {\n // Recreate because serialized form dateTz doesn't have DateTZ class methods\n if (!state.activeForm?.dateTz) {\n return state.activeForm\n }\n const { date, is_local_tz, building_tz} = state.activeForm?.dateTz;\n const endTzDate = state.activeForm?.recurrence_endTz?.date;\n const recurrence_endTz = endTzDate ? {\n recurrence_endTz : new DateTZ({ date: endTzDate.valueOf(), is_local_tz, building_tz })\n } : {};\n\n const recurrence_starts = state.activeForm?.recurrence_starts\n\t\t\t? {\n\t\t\t\t\trecurrence_starts: state.activeForm?.recurrence_starts.map( el =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// at final step of booking creation process recurrence_start becomes Array which need to be Array\n\t\t\t\t\t\t\t// To Do: Refactor - apps/staff/src/app/booking/booking-create/booking-form-base.component.ts lno: 186\n\t\t\t\t\t\t\treturn new DateTZ({ date: typeof el === 'number' ? el * 1000 : el.date.valueOf(), is_local_tz, building_tz })\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\n\n const recEditingSearchPayload = (state.activeForm.action === SeriesAction.EDIT && state.activeForm.is_recurrent)\n\t\t\t?\n\t\t {\n\t\t\t\tid: state.activeForm.id,\n\t\t\t\tignore: state.activeForm.ignore,\n\t\t\t\tbookable: state.activeForm.bookable\n\t\t\t}\n\t\t\t: {};\n\n\n\n\n return {\n ...state.activeForm,\n dateTz: new DateTZ({ date: date.valueOf(), is_local_tz, building_tz }),\n ...recurrence_endTz,\n ...recurrence_starts,\n\t\t\t\t...recEditingSearchPayload\n }\n});\n\nexport const selectBookingType = createSelector(selectActiveForm,\n (form) => form?.bookingType);\n\nexport const selectBookingLocations = createSelector(selectActiveForm,\n (form) => (form?.location || []).filter(f => !f.groupHeader));\n\nexport const selectIsInternal = createSelector(selectBookingType,\n (type) => type?.value === internalBookingTypeOption.value);\n\nexport const selectFormFilters = createSelector(selectBookingFormsData,\n (state) => state.activeFormFilters || []);\n\nconst selectRoomResultsFromState = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.model);\n\nconst selectRoomResultsFromState_map = createSelector(roomStateSelector,\n loadRoomsForResultsMap.selectors.model);\n\nconst selectLaterThatDayResultsFromState = createSelector(roomStateSelector,\n loadLaterThatDayResults.selectors.model);\nconst selectNextDayResultsFromState = createSelector(roomStateSelector,\n loadNextDayResults.selectors.model);\nconst selectByIdResultsFromState = createSelector(roomStateSelector,\n loadByIdResults.selectors.model);\nconst selectDiffSizeResultsFromState = createSelector(roomStateSelector,\n loadDiffSizeResults.selectors.model);\n\nexport const selectHomepageBookingsResultsFromState = createSelector(bookingStateSelector,\n loadHomepageBookingsResults.selectors.model);\nexport const selectUpcomingBookingsResultsFromState = createSelector(bookingStateSelector,\n loadUpcomingBookingsResults.selectors.model);\nexport const selectPastBookingsResultsFromState = createSelector(bookingStateSelector,\n loadPastBookingsResults.selectors.model);\nexport const selectCancelledBookingsResultsFromState = createSelector(bookingStateSelector,\n loadCancelledBookingsResults.selectors.model);\nexport const selectBookingByIdResultsFromState = createSelector(bookingStateSelector,\n loadBookingByIdResults.selectors.model);\n\n/**\n * Wraps {@link filterSpacesByAppliedFilters} with {@link LoadingModel} interop.\n * This will only filter data if there is data to filter, and returns a success {@link LoadingModel}.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\nconst filterSpacesByAppliedFiltersIfSuccess = (\n results: LoadingModel,\n formFilters: SelectOption[],\n activeForm: BookingFormData,\n buildings: Building[] | undefined,\n currentUser: User | undefined,\n isStaffMap: boolean = false): LoadingModel => {\n const data = results.optionalSuccess;\n\n // don't filter model if no success found\n return !activeForm ? results.mutate({\n spaces: data, // the result here is a raw JSON Space, not the Space class\n reason: SpaceFilterReason.None,\n statusMap: {}\n }) : results.mutate(\n filterSpacesByAppliedFilters(formFilters, data, activeForm, buildings || activeForm.buildings, currentUser, isStaffMap));\n};\n\nexport const selectFilteredResults = createSelector(selectRoomResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectMapFilteredResults = createSelector(selectRoomResultsFromState_map,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser, isStaffMap) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser, true));\n\nexport const selectFilteredLaterDayResults = createSelector(selectLaterThatDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectFilteredNextDayResults = createSelector(selectNextDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n\nexport const selectFilteredByIdResults = createSelector(selectByIdResultsFromState,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser));\n\nexport const selectFilteredDiffSizeResults = createSelector(selectDiffSizeResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n/**\n * Maps selected options by loaded buildings.\n */\nexport const selectSelectedBuildingOptions = createSelector(\n selectBookingLocations,\n selectLoadBuildingsSuccess,\n (locations, buildings) => (locations\n .map(l => buildings?.find(b => b.id === l.value))\n .filter(f => !!f) as Building[])\n);\n\n","import { Building, BuildingCity } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { BuildingLevel } from '../organisation/level.class';\nimport { Space } from '../spaces/space.class';\nimport { SpacesService } from '../spaces/spaces.service';\nimport {\n timezoneDisplay,\n timezoneNameToDate,\n unique,\n ImageDirective,\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * If more than 3 are selected, we truncate location display.\n */\nconst MAX_ABBREV_LOCATIONS = 3;\n\nexport const mapBuildingToSelectOption = (\n city: string,\n building: Building\n): SelectOption => ({\n display: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n dropdownOverride: `${building.code}-${building.name}, ${building.address}`,\n value: building.id,\n groupId: city,\n groupChild: true,\n shortDisplay: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n meta: { building, city },\n});\n\nexport const mapCityToAllSelectOption = (\n city: BuildingCity\n): SelectOption => ({\n display: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n value: city.name,\n groupHeader: true,\n groupId: city.name,\n shortDisplay: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n meta: { city },\n});\n\n/**\n * Flattens a map of {@link BuildingCity} to {@link Building} array into a list of {@link SelectOption}.\n * @param grouped The grouping\n */\nexport const flattenDisplayOffices = (\n grouped: Map\n) => {\n const options: SelectOption[] = [];\n grouped.forEach((value, key) => {\n options.push(mapCityToAllSelectOption(key));\n value.forEach((b) =>\n options.push(mapBuildingToSelectOption(key.name, b))\n );\n });\n return options;\n};\n\n/**\n * This method will either add or remove a selected option from the selectedOptions list based on\n * these conditions:\n * 1. If the option EXISTS in the list AND is a groupHeader, de-select all of its children.\n * 2. If the option EXISTS in the list AND is a groupChild, remove it and its associated header from the list.\n * 3. If the option does NOT EXIST in the list AND is a groupHeader, select all other children.\n * 4. If the option does NOT EXIST in the list AND is a groupChild, add it to the list.\n *\n * Special note regarding item 4:\n * 4a. If that selection completes the children selection, select its associated header as well.\n */\nexport const toggleSelectedByGroup = (\n options: SelectOption[],\n selectedOptions: SelectOption[],\n option: SelectOption\n) => {\n if (selectedOptions.find((s) => s.value === option.value)) {\n return selectedOptions.filter((s) => {\n let filter = s.value !== option.value;\n // if group header, also remove any option that is the child of it.\n if (option.groupHeader) {\n filter =\n filter &&\n (!s.groupChild ||\n (s.groupChild && s.groupId !== option.groupId));\n } else if (option.groupChild) {\n // if child removing, remove the associated header.\n filter =\n filter &&\n (!s.groupHeader ||\n (s.groupHeader && s.groupId !== option.groupId));\n }\n return filter;\n });\n }\n // option does NOT EXIST\n // if adding header, add the other children to the selected list, ensuring no dupes.\n if (option.groupHeader) {\n const toSelect = options.filter(\n (v) =>\n v.groupChild &&\n v.groupId === option.value &&\n !selectedOptions.find((selected) => selected.value === v.value)\n );\n return [...selectedOptions, option, ...toSelect];\n }\n // add group child, add the group header if all satisfied\n const newGroup = [...selectedOptions, option];\n\n // check if we have selected all children from options by filtering down by city and checking if\n // they're in the selected options list.\n const remainingChildrenInGroup = options.filter(\n (o) =>\n o.groupChild &&\n o.groupId === option.groupId &&\n !newGroup.find((ng) => ng.value === o.value)\n );\n // if we dont have remaining children, add the group\n if (remainingChildrenInGroup.length === 0) {\n return [\n ...newGroup,\n options.find((o) => o.groupHeader && o.groupId === option.groupId),\n ];\n }\n return newGroup;\n};\n\n/**\n * If the list of locations are larger than {@link MAX_ABBREV_LOCATIONS}, then truncate\n * and display the remaining count.\n */\nexport const truncateLocationList = (\n locations: readonly SelectOption[]\n): string => {\n // comma separate the locations\n let truncatedLocations = [...locations];\n const shouldTruncate = locations.length > MAX_ABBREV_LOCATIONS;\n if (shouldTruncate) {\n truncatedLocations = truncatedLocations.splice(0, MAX_ABBREV_LOCATIONS);\n }\n let display = truncatedLocations\n .map((l) => l.shortDisplay || l.display)\n .join(', ');\n if (shouldTruncate) {\n display += `...(${locations.length})`;\n }\n return display;\n};\n\nexport const mapBuildingLevelToOption = (\n level?: BuildingLevel\n): SelectOption =>\n level\n ? {\n value: level.id,\n display: level.name,\n }\n : undefined;\n\n/**\n * Returns all levels included with the building, deduped.\n * @param buildings\n */\nexport const flattenBuildingsWithLevels = (buildings: Building[]) => {\n const flattenedLevels = unique(\n buildings.reduce((next: BuildingLevel[], building: Building) => {\n next.push(...building.levels);\n return next;\n }, []),\n 'id'\n );\n return {\n flattenedLevels,\n buildings,\n };\n};\n\n/** Gets route to image placeholder if room image isn't found */\n\nexport const placeholderRoute = (num: number): string => {\n let index: number;\n if (num <= 3) {\n index = num;\n } else if (num % 3 === 0) {\n index = 3;\n } else {\n index = 1;\n }\n return `assets/img/rooms/placeholder-${index}.png`;\n};\n\n/**\n * Method takes the rootFolderURL and fileSlug to create an array of three images\n * that should exist. If a room image exists, it replaces the placehoder image.\n */\nexport const setupRoomImages = (\n componentReference: ImageDirective,\n image_positions: number[],\n rootFolderURL: string,\n fileSlug: string,\n imagesLoaded: boolean = false\n): void => {\n let foundImages: any[] = image_positions.map((i) =>\n i ? { path: placeholderRoute(i) } : false\n );\n image_positions.forEach((n) => {\n const desiredImageName = `${rootFolderURL}${fileSlug}-part-${n}.png`;\n const desiredImage = location.pathname.includes('concierge') ? `${location.origin}/staff/${desiredImageName}` : desiredImageName;\n if (!imagesLoaded) {\n const tester = new Image();\n tester.onload = () => {\n // Will never run on unit test\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = [...foundImages.slice()];\n componentReference?.loadImages && componentReference?.loadImages.next([...foundImages.slice()]);\n };\n tester.src = desiredImage;\n }\n\n // Force valid image output on unit test\n if (imagesLoaded) {\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = foundImages.slice();\n }\n });\n};\n\nexport const bookingStatusDetails = (booking: Booking) => {\n const now = DateNow(new Date());\n let image = '';\n let text = '';\n let title = '';\n\n if (booking?.status) {\n const status = now > booking.endDateTz ? 'expired' : booking.status;\n switch (status) {\n case 'unavailable':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Unavailable';\n text = 'Unavailable';\n break;\n case 'declined':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'cancelled':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'expired':\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n case 'tentative':\n image = 'assets/icon/booking_pending.svg';\n title = 'Requested';\n text = 'Pending';\n break;\n case 'accepted':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n case 'approved':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n default:\n // TODO\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n }\n }\n return { text, title, image };\n};\n\nexport const roomHasCateringHours = (building: Building, space: Space) => {\n let hasCatering = building\n ? building.has_catering && building.catering_hours\n : false;\n // Room catering status as false overrides building status\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n};\n\nexport const cateringAllowed = (booking: Booking, building: Building) => {\n const status = bookingStatusDetails(booking);\n const disallowedStatus = ['declined', 'cancelled', 'expired'].includes(\n status.text\n );\n const opens = building?.catering_hours?.start;\n const closed = building?.catering_hours?.end;\n\n if (disallowedStatus) {\n return false;\n }\n\n if (typeof opens === 'undefined' || typeof closed === 'undefined') {\n return false;\n }\n\n // Catering time could be a decimal so convert to a date\n const openMinutes = opens * 60;\n const closeMinutes = closed * 60;\n\n const startOfDay = booking.startDateTz.startOfValue('day');\n const cateringOpenTime = startOfDay.addValue({ minutes: openMinutes });\n const cateringCloseTime = startOfDay.addValue({ minutes: closeMinutes });\n\n if (\n cateringOpenTime.ms <= booking.startDateTz.ms ||\n cateringCloseTime.ms > booking.startDateTz.ms\n ) {\n // Booking ends before catering opens\n if (booking.endDateTz.ms <= cateringOpenTime.ms) {\n return false;\n }\n // Booking starts after catering closes\n if (booking.startDateTz.ms > cateringCloseTime.ms) {\n return false;\n }\n\n // Start time is OK\n if (booking.startDateTz.ms > DateNow(new Date()).ms) {\n // Due to COVID, no orders are available once a meeting begins.\n return true;\n }\n }\n\n return false;\n};\n\nexport const checkCollisions = (\n service: SpacesService,\n booking: Booking\n): Promise => {\n return new Promise((resolve, reject) => {\n\n let availabilityParams: {\n room_ids: string;\n dateTz: DateTZ;\n duration: number;\n setup: number;\n breakdown: number;\n hide_bookings: boolean;\n [key: string]: any;\n } = {\n room_ids: booking.space.id,\n dateTz: booking.startDateTz,\n duration: booking.duration,\n setup: booking.setup[booking.space.email],\n breakdown: booking.breakdown[booking.space.email],\n hide_bookings: false,\n };\n\n if (booking.recurrence_type === \"master\" || booking.recurrence_type === null) {\n availabilityParams = {\n ...availabilityParams,\n ignore: booking?.icaluid,\n recurrence_count: booking?.recurrence_count,\n recurrence_period: booking?.recurrence_period,\n recurrence_endTz: booking?.recurrence_endTz,\n recurrence_interval: booking?.recurrence_interval,\n recurrence_starts: booking?.recurrence_starts,\n is_recurrent: booking?.is_recurrent,\n recurrence_days: booking?.recurrence_days\n } as typeof availabilityParams;\n }\n\n service\n .available(\n availabilityParams,\n null,\n false\n )\n .then(\n (list) => {\n const space = list.length ? list[0] : null;\n if (space) {\n if (!space.bookable) return reject('Has conflict');\n const setup = booking?.setup[space?.email] || 0;\n const breakdown = booking?.breakdown[space?.email] || 0;\n const start_time = booking?.startDateTz.seconds - setup;\n const end_time = booking.endDateTz.seconds + breakdown;\n\n const bookings = space.settings.bookings;\n // console.log('Bookings:', bookings);\n // Compare the existing bookings to see if any truely conflict.\n if (bookings.length) {\n const has_conflict = bookings.find(bkn => {\n const b_setup = bkn.setup[space.email] || 0;\n const b_breakdown = bkn.setup[space.email] || 0;\n const start = (bkn.start_epoch || bkn.start) - b_setup;\n const end = (bkn.end_epoch || bkn.end) + b_breakdown;\n return (\n (end_time > start && end_time <= end) || // Booking ends during the meeting\n (start_time >= start && start_time < end) || // Booking starts during a meeting\n (start_time <= start && end_time >= end) // Booking overlaps entire meeting\n ) && \n ( \n bkn.id !== booking.id \n || \n ( !!booking.is_recurrent && (booking.recurrence_type === \"master\" || booking.recurrence_type === null ) ) \n ?\n bkn.recurrence_master_id !== booking.id\n :\n false\n \n )\n\n\n\n });\n // Conflicts found, reject\n if (has_conflict) return reject('has booking conflict');\n }\n return resolve(space.bookable);\n }\n reject('space not found');\n },\n () => reject('available error')\n );\n });\n};\n\nexport const getStatusErrorMessage = (status?: number) => {\n let msg = '';\n switch (status) {\n\t\t\tcase 400:\n\t\t\t\tmsg = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\tbreak;\n\t\t\tcase 403:\n\t\t\t\tmsg = 'Your do not have permission to update this booking.';\n\t\t\t\tbreak;\n\t\t\tcase 409:\n\t\t\t\tmsg = 'Sorry, your booking time conflicts with another booking.';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmsg = 'Your booking failed to update, please try again';\n }\n return msg;\n};\n","export * from './room-results/room-results.viewmodel'\nexport * from './booking-filter.utils'\nexport * from './booking.form.actions'\nexport * from './booking.form.data'\nexport * from './booking.form.spec-helpers'\nexport * from './booking.form.types'\nexport * from './booking.selectors'\nexport * from './booking.utils'","import { Space } from '../../spaces/space.class';\nimport { BuildingLevel } from '../../organisation/level.class';\nimport { Building } from '../../organisation/building.class';\n\nexport class RoomResultsViewModel {\n\n public levelDisplay: string;\n public title: string;\n public office: string;\n public capacity: string;\n\n constructor(public space: Space,\n public level?: BuildingLevel,\n public building?: Building) {\n\n this.levelDisplay = `Level ${this.space?.level?.short_name}`;\n this.title = this.space.local_name;\n this.office = this.building ? `(${this.building?.code}) ${this.building?.name}` : '';\n this.capacity = `Capacity: ${this.space.capacity} people`;\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Space[],\n flattenedLevels: BuildingLevel[],\n buildings: Building[]): RoomResultsViewModel[] =>\n results.map((r: Space) => {\n const level = flattenedLevels.find(l => r.zones.includes(l.id));\n const building = buildings.find(b => r.zones.includes(b.id));\n return new RoomResultsViewModel(\n r,\n level,\n building\n );\n });\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, combineLatest, of, Observable } from 'rxjs';\nimport {\n catchError,\n debounceTime,\n filter,\n first,\n map,\n shareReplay,\n switchMap,\n} from 'rxjs/operators';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { replaceBookings, timePeriodsIntersect } from './booking.utilities';\nimport { SpacesService } from '../spaces/spaces.service';\nimport { Booking } from '../bookings/booking.class';\nimport { Space } from '../spaces/space.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { OrganisationService } from '../organisation/organisation.service';\n\nexport type BookingType =\n | 'internal'\n | 'client'\n | 'external'\n | 'setup'\n | 'training'\n | 'interview'\n | 'declined';\n\nexport interface BookingFilters {\n /** List of zone ids to get bookings for */\n zone_ids?: string[];\n space_emails?: string[];\n hide_type?: BookingType[];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class BookingStateService extends BaseClass {\n /** List of bookings */\n private _poll = new BehaviorSubject(false);\n /** List of bookings */\n private _long_poll = new BehaviorSubject<'month' | ''>('');\n private _long_poll_week = new BehaviorSubject<'week' | ''>('');\n /** List of bookings */\n private _bookings = new BehaviorSubject([]);\n /** List of meeting count per date */\n public _noOfMeetings = new BehaviorSubject<{}>({});\n /** Filter details for bookings */\n private _filters = new BehaviorSubject({});\n /** Currently active date */\n private _dateTz = new BehaviorSubject(DateNow(new Date()));\n /** Currently displayed zone */\n private _zone = new BehaviorSubject(' ');\n /** Whether booking data is being loaded */\n private _loading = new BehaviorSubject(false);\n /** Observable for filter and booking list changes */\n private _state = combineLatest(\n this._bookings,\n this._filters,\n this._dateTz,\n this._zone\n );\n\n /** Observable for list of bookings */\n public readonly bookings = this._bookings.asObservable();\n /** Observable for active date */\n public readonly dateTz = this._dateTz.asObservable();\n /** Observable for active zone */ // R-- zone was this._date.asObservable(); this looks like a mistake but it exists from the beginning of time\n public readonly zone = this._dateTz.asObservable();\n /** Observable for loading state of bookings */\n public readonly loading = this._loading.asObservable();\n\n public get booking_date() {\n // When this class is initialized this._dateTz is local timezone\n return this._dateTz.value;\n }\n\n public get timezone() {\n return localStorage.getItem('CONCIERGE.timezone');\n }\n\n /** Obsevable for filtered list of bookings */\n public readonly filtered = this._state.pipe(\n map((state) => {\n const bdTz = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const startTz = bdTz.startOfValue('day');\n const endTz = startTz.addValue({}).endOfValue('day');\n return this.filterBookings(startTz, endTz);\n }),\n shareReplay(1)\n );\n\n /** Obsevable for filtered list of bookings of the active week */\n public readonly filtered_week = this._state.pipe(\n map(() => {\n // Tested to be valid in building time now.\n const bd = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const start = bd.startOfValue('week').startOfValue('day');\n const end = this.getEndOfWeek(bd);\n return this.filterBookings(start, end);\n })\n );\n\n /** Obsevable for filtered list of bookings for active month */\n public readonly filtered_month = this._state.pipe(\n map(() => {\n const start = this.booking_date.startOfValue('month');\n const end = this.booking_date.endOfValue('month');\n return this.filterBookings(start, end);\n })\n );\n\n /** Active filters */\n public get filters() {\n return this._filters.getValue();\n }\n\n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private ngZone: NgZone,\n ) {\n super();\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Just to get the timezone correct\n this._dateTz.next(\n new DateTZ({\n date: this._dateTz.value.ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone,\n })\n );\n });\n\n /** Generate observable for updating bookings */\n const search = combineLatest(this._poll, this._zone, this._dateTz).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap(() => {\n const fzone = this._zone.getValue();\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n const start = this.booking_date.startOfValue('day');\n const end = start.endOfValue('day');\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start.seconds,\n available_to: end.seconds,\n });\n }),\n catchError(() => of([]))\n );\n\n const search_long_week = combineLatest(\n this._long_poll_week,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, false);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n\n //TO DO: make sure both spaces have same booking\n /** Subscribe to update observable */\n search.subscribe((space_list) => {\n this.processBookings(space_list);\n this._loading.next(false);\n });\n search_long_week.subscribe((space_list) => {\n this.processBookings(space_list, this._long_poll_week.getValue() as any);\n this._loading.next(false);\n });\n }\n\n /**\n * Function to build\n */\n private buildSpaceLongQuery(dailyCount: boolean = false): Observable {\n return combineLatest(\n this._long_poll,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = dailyCount ? this._org.building.id : props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, dailyCount);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n }\n\n private querySpace(type: string, fzone: string, dateTz: DateTZ, dailyCount: boolean = false) : Observable | Observable{\n const start = () => {\n const s = dateTz;\n if (type === 'week') {\n return s.startOfValue('week');\n } else {\n return s.startOfValue('month');\n }\n };\n\n const end = () => {\n const e = start();\n if (type === 'week') {\n /**\n * To Do: date-tz.class.ts endOfValue subtracts 1 day from end of week for 7 days a week type which returns Friday instead of Saturday\n * below is the adjustment -\n */\n return e.addValue({ days: 1 }).endOfValue('week');\n } else {\n return e.endOfValue('month');\n }\n /**\n * R--- when testing March 2022 London offices, the month is an hour short.\n * Is this a Luxon bug or London DST?\n */\n };\n\n // dates here are ok\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start().seconds,\n available_to: end().seconds,\n ...(dailyCount) ? { daily_count: true } : ''\n });\n }\n\n\n public getDailyMeetingCount() : void {\n this._long_poll.next('month');\n this.buildSpaceLongQuery(true).subscribe((counts) => {\n this._noOfMeetings.next(counts);\n this._loading.next(false);\n });\n }\n\n /**\n * Update the booking filters\n * @param details\n */\n public setFilters(details: BookingFilters) {\n this._filters.next(details);\n }\n\n /**\n * Update the booking date\n * @param details\n */\n public setDate(dateTz: DateTZ) {\n this._dateTz.next(dateTz);\n }\n\n /**\n * Update the booking's zone\n * @param details\n */\n public setZone(zone: string) {\n this._zone.next(zone);\n }\n\n /**\n * update day view once\n */\n public pollOnce(){\n this._poll.next(true);\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPolling(delay: number = 30 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingWeek(delay: number = 4 * 30 * 1000 ) {\n this._long_poll_week.next('week');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll_week.next('week'),\n delay\n );\n });\n }\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingEveryFiveMin(delay: number = 60 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingMonth(delay: number = 5 * 60 * 1000) {\n this._long_poll.next('month');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll.next('month'),\n delay\n );\n });\n }\n\n\n /**\n * Stop polling to update bookings;\n */\n public stopPolling() {\n this._poll.next(false);\n this.clearInterval('polling');\n this._long_poll.next('');\n this.clearInterval('polling_long');\n }\n\n public updateRoomList() {\n this._spaces.updateRoomList();\n }\n\n /**\n * Add booking to bookings listing\n * @param booking\n */\n public add(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Update booking in the bookings list\n * @param booking\n */\n public replace(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings\n .filter(\n (bkn) =>\n bkn.icaluid !== booking.icaluid && bkn.id !== booking.id\n )\n .concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Remove booking in the bookings list\n * @param booking\n */\n public remove(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.filter(\n (bkn) => bkn.icaluid !== booking.icaluid\n );\n this._bookings.next(new_bookings);\n }\n\n public attentToDelete(\n booking: Booking,\n action: 'series' | 'booking' = 'booking',\n undo: boolean = false\n ) {\n const bookings = this._bookings.getValue();\n const attempted_to_delete = ((action) => {\n return (bkg: Booking) => {\n switch (action) {\n case 'booking': {\n const booking_master = bookings.find(\n (bkn) => bkn.icaluid === booking.icaluid\n );\n if (!booking_master) return false;\n return bkg.id === booking.id;\n }\n case 'series': {\n const booking_master = bookings.find(\n (bkg) =>\n bkg.id ===\n (booking.recurrence_type === 'occurrence'\n ? booking.recurrence_master_id\n : booking.id)\n );\n if (!booking_master) return false;\n return (\n booking_master.id === bkg.id ||\n bkg.recurrence_master_id === booking_master.id\n );\n }\n default:\n false;\n }\n };\n })(action);\n\n const new_bookings = [...bookings].map((bkg) => {\n if (!undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = action;\n }\n\n if (undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = null;\n }\n\n return bkg;\n });\n\n this._bookings.next(new_bookings);\n }\n\n private processBookings(\n space_list: Space[],\n period: 'day' | 'week' | 'month' = 'day'\n ) {\n const start = () => {\n switch (period) {\n case 'month':\n return this.booking_date.startOfValue('month');\n case 'week':\n return this.booking_date.startOfValue('week');\n default:\n return this.booking_date.startOfValue('day');\n }\n };\n const end = () => {\n const s = start();\n switch (period) {\n case 'month':\n return s.endOfValue('month');\n case 'week':\n return s.endOfValue('week');\n default:\n return s.endOfValue('day');\n }\n };\n\n let bookings = this._bookings.getValue();\n space_list.forEach((space) => {\n return (bookings = replaceBookings(\n bookings,\n space.bookings.map((bkn) => new Booking(bkn)),\n {\n room_email: space.email,\n fromTz: start(),\n toTz: end(),\n }\n ));\n });\n this._bookings.next(bookings);\n }\n\n // private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n // const filters = this._filters.getValue();\n // const bookings = this._bookings.getValue();\n // const fzone = this._zone.getValue();\n // return bookings.filter((bkn) => {\n // const intersects = timePeriodsIntersect(\n // startTz.ms,\n // endTz.ms,\n // bkn.startDateTz.ms,\n // bkn.endDateTz.ms\n // );\n // const in_zone = bkn.room.zones.includes(fzone);\n // const has_space =\n // !filters.space_emails?.length ||\n // filters.space_emails.includes(bkn.room.email);\n // const in_zones =\n // !filters.zone_ids?.length ||\n // !!bkn.room.zones.find((zone) =>\n // filters.zone_ids.includes(zone)\n // );\n // const type = bkn.declined ? 'declined' : bkn.getType();\n\n // const show =\n // !filters.hide_type?.length ||\n // !filters.hide_type.includes(type as any);\n // return intersects && has_space && in_zone && in_zones && show;\n // });\n // }\n\n private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n const filters = this._filters.getValue();\n const bookings = this._bookings.getValue();\n const fzone = this._zone.getValue();\n return bookings.filter((bkn) => {\n const intersects = timePeriodsIntersect(\n startTz.ms,\n endTz.ms,\n bkn.startDateTz.ms,\n bkn.endDateTz.ms\n );\n // Check if any room in the booking satisfies the conditions\n const roomSatisfiesConditions = bkn.multi_rooms.some((room) => {\n const in_zone = room.zones.includes(fzone);\n const has_space =\n !filters.space_emails?.length ||\n filters.space_emails.includes(room.email);\n const in_zones =\n !filters.zone_ids?.length ||\n !!room.zones.find((zone) => filters.zone_ids.includes(zone));\n return in_zone && has_space && in_zones;\n });\n \n const type = bkn.declined ? 'declined' : bkn.getType();\n \n const show =\n !filters.hide_type?.length ||\n !filters.hide_type.includes(type as any);\n return intersects && roomSatisfiesConditions && show;\n });\n } \n\n /**If Sunday add one day to get Saturday as end of week */\n private getEndOfWeek(date: DateTZ): DateTZ {\n return date.dateWeekday === 7\n ? date.addValue({ days: 1 }).endOfValue('week').endOfValue('day')\n : date.endOfValue('week').endOfValue('day');\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport { CateringOrder } from '../catering';\nimport { User } from '../users';\nimport {\n flatten,\n HashMap,\n humaniseDuration,\n shorterBuildingDateFormatString,\n shorterLocalDateFormatString,\n toTitleCase,\n unique\n} from '@mckinsey-converge/base';\nimport { Space } from '../spaces/space.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport {\n BookingNote,\n} from './booking.types';\nimport { convertLocalTimestampToTimezonedDateTz, DateNow, DateTZ, getTimezoneOffsetString } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, getLastDateFromList, handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { findSpace } from '../spaces';\nimport { DateTime } from 'luxon';\n\n\nexport interface IBookingQueryOptions {\n /** booking ID */\n id?: string;\n email?: string;\n target?: string;\n from?: number; // R--- depreciate\n until?: number; // R--- depreciate\n fromTz?: DateTZ;\n untilTz?: DateTZ;\n show_cancelled?: boolean;\n pagination?: boolean;\n limit?: number;\n offset?: number;\n sort?: string,\n filters?: any;\n include_rooms?: boolean;\n building_zone?: string;\n}\n\nexport class Booking extends BaseDataClass {\n /** Unique calendar event ID */\n // public readonly icaluid: string;\n /** Subject or title of the booking */\n public title: string;\n /** Luxon based date class of the booking start time */\n public startDateTz: DateTZ;\n /** Luxon based date class of the booking start time */\n public endDateTz: DateTZ;\n /** Description or details of the booking */\n public readonly body: string;\n /** Type of booking */\n public readonly booking_type: string;\n /** List of catering orders for the booking */\n public catering: readonly CateringOrder[];\n /** Whether booking's duration covers all day */\n public readonly all_day: boolean;\n /** Mapping of emails to approval statuses */\n public approval_status: HashMap;\n /**\n * New booking approval status set in constructor\n *\n * timeBasedStatusLabel is a getter calculated via current time, some parts of the application\n * may use status when it should use timeBasedStatusLabel\n */\n public status: 'tentative' | 'accepted' | 'approved' | 'declined' | 'cancelled' | 'expired' | 'unavailable';\n /** Host/Organiser of the booking */\n public organiser: User;\n /** List of people invited to attend the booking */\n public attendees: User[];\n /** Author of the booking */\n public readonly creator: User;\n\n /** List of notes associated with the booking */\n public notes: readonly BookingNote[];\n /** Mapping of spaces to equipment charge codes */\n public equipment_codes: HashMap;\n /** Mapping of spaces to expected number of attendees */\n public expected_attendees: HashMap;\n /** Map of space emails to the setup time before the meeting in minutes */\n public setup: HashMap;\n /** List of checked in attendees */\n public check_ins: object;\n /** Map of space emails to the breakdown time before the meeting in minutes */\n public breakdown: HashMap;\n /** List of fields edited since creation */\n public readonly edits: string[];\n /** List of users to be notified on visitor arrivals */\n public readonly notify_users: readonly string[];\n /** Whether the time or duration has changed */\n public time_changed = false;\n /**\n * Booking Space\n * Bookings only have one room on MCK\n */\n public room: Space;\n /** building_zone */\n public building_zone: string;\n /** Initialized Timezone */\n public timezone: string;\n /** Array of company names */\n public company?: string[];\n /** Flag for multiroom booking */\n public is_multiroom: boolean;\n /** Multiroom booking ID */\n public multiroom_master_id: string; \n /** Merged - field holds flag for merged-multiroom booking which tightly coupled with multiroom booking only */\n public merged: boolean;\n /** Type of recurrence, Shows whether this is a master or an occurence in the series. */\n public readonly recurrence_type: string;\n /** The frequency of the recurring booking. */\n public readonly recurrence_period: RecurrencePeriod;\n /** The interval time between each period. Defaults to 1. For example, with a period of \"weekly\" and an interval of 2, the recurrencd happen every 2 weeks. */\n public readonly recurrence_interval: number;\n /** Unix epoch in seconds of the recurrence end date */\n private _recurrence_endTz: DateTZ;\n /** The number of times to repeat the recurring booking. */\n public readonly recurrence_count: number;\n /** ID of the booking considered the master */\n public readonly recurrence_master_id: string;\n /** An array of booking IDs which belong to this recurring series. This INCLUDES the master booking ID. */\n public readonly occurrence_ids: string[];\n /** A list of INDIVIDUAL edits to any of the bookings in the series. This is so we can prompt the user if they are going to override previously updated bookings with a whole-series update. */\n public readonly occurrence_edits: string[];\n /** A list of Ocurrences */\n public readonly occurrence_details: { id: string, start_epoch: number }[];\n /** When the booking was created */\n public created_epoch: number;\n /** Is the Application concierge */\n public is_concierge: boolean;\n /**helper to know if recurring toggle is on */\n public is_recurrent: boolean;\n /**array of start dates of each ocurrence in the series */\n public recurrence_starts: Array\n /**array of conflicting dates not to be included in the recurrence series */\n public recurrence_exceptions: Array\n\n public recurrence_days?: Array\n\n /** Master recurrence start */\n public recurrence_start: number;\n\n /** Start Epoch */\n public start_epoch: number;\n public end_epoch: number;\n public level_zone: string;\n public opt_out: boolean;\n public outlook_opt_out: boolean;\n public multi_rooms: Space[];\n public room_setup: any;\n public room_breakdown: any;\n public headcount: number;\n public equipment_code: string;\n\n /** Currently back-end is not properly setting the recurrence_end property, this is a workaround */\n public get recurrence_endTz(): DateTZ {\n return this._recurrence_endTz;\n }\n\n public set recurrence_endTz(date: DateTZ) {\n this._recurrence_endTz = date;\n }\n\n /** Mark a booking for deleting */\n public attempted_to_delete?: 'series' | 'booking' | null;\n\n // No specific reason to set readonly but canm be change if needed to update in future\n public readonly booked_by : string | { name: string };\n public readonly booker: Object;\n public readonly booker_concierge: Object\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = settingsService.concierge;\n\n /**\n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = new DateTZ();\n\n const defaultTitle = ''; // Blank since the create booking form will init with test values.\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n const defaultBuildingZone = null // R --- no idea, should be a building.id but which and how\n const defaultOrgainiser = User.active_user || new User(); // meh, non American use.\n const defaultBookingType = 'internal';\n\n /**\n * Process the simple raw_data with defaults mixed in\n */\n this.title = raw_data.title || defaultTitle;\n this.timezone = raw_data.timezone || defaultLocalTimezone;\n // Used by components to get the building details\n this.building_zone = raw_data.building_zone || defaultBuildingZone;\n this.body = raw_data.body || '';\n // Provided booking type\n this.booking_type = raw_data.booking_type || defaultBookingType;\n // Attendees provided in API booking data\n this.attendees = (raw_data.attendees || []).map((i) => new User(i));\n // Provided organiser, active user, or empty user?\n this.organiser = raw_data.organiser ? new User(raw_data.organiser) : defaultOrgainiser;\n // Creator is provided or defaults to the organizer\n this.creator = (raw_data.booked_by ? new User(raw_data.booked_by) : defaultOrgainiser) || this.organiser;\n // Setup and breakdown times can conflict but not the true event start and end times\n this.setup = raw_data.setup || {};\n this.breakdown = raw_data.breakdown || {};\n this.room_setup = raw_data.room_setup;\n this.room_breakdown = raw_data.room_breakdown;\n // Notes are assigned by room but we only support a single room\n this.notes = raw_data.notes || [];\n this.equipment_codes = raw_data.equipment_codes || {};\n this.equipment_code = raw_data.equipment_code || '';\n this.expected_attendees = raw_data.expected_attendees || {};\n this.headcount = raw_data.headcount;\n this.check_ins = raw_data.check_ins || {};\n this.notify_users = raw_data.notify_users?.length ? raw_data.notify_users : [this.organiser?.name];\n this.company = raw_data.company || [];\n // retain booked by if there : helps to get correct creator above\n this.booked_by = raw_data.booked_by;\n this.booker = raw_data.booker;\n this.booker_concierge = raw_data.booker_concierge;\n this.level_zone = raw_data.level_zone;\n this.opt_out = raw_data.opt_out;\n this.outlook_opt_out = raw_data.outlook_opt_out;\n\n /**\n * \n */\n this.merged = raw_data?.merged || null;\n\n /**\n * Multiroom fields\n */\n this.is_multiroom = raw_data.is_multiroom || null;\n this.multiroom_master_id = raw_data.multiroom_master_id || null;\n\n /**\n * Setup Defaults when raw_data values are not provided\n *\n * all room_ids and space_list inputs can be refactored into just room like an API booking\n *\n * raw_data.room can be provides as the Space class or JSON object\n */\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n // this.room = raw_data?.room ? (Array.isArray(raw_data?.room) && raw_data.room.length > 0) ? raw_data?.room.map((element) => new Space(element))[0]: [new Space(raw_data.room)][0] : [new Space()][0];\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n\n if (raw_data && raw_data.room) {\n if (Array.isArray(raw_data.room) && raw_data.room.length) {\n this.room = raw_data.room.map((element) => new Space(element))[0];\n } else if (Array.isArray(raw_data.room) && raw_data.room.length === 0) {\n this.room = [new Space()][0];\n } else {\n this.room = [new Space(raw_data.room)][0];\n }\n } else {\n this.room = [new Space()][0];\n }\n\n\n const room_id = raw_data.room_id || raw_data.room_ids // Not sure why we have room_id and room_ids\n if (!this.room?.id && room_id?.length) {\n this.room = findSpace(room_id[0]) || this.room;\n }\n\n const roomsData = raw_data?.multi_rooms || raw_data?.room;\n this.multi_rooms = roomsData\n ? Array.isArray(roomsData)\n ? roomsData.map((element) => new Space(element))\n : [new Space(roomsData)]\n : [new Space()];\n\n \n const room_ids = [...(raw_data?.room_id || []), ...(raw_data?.room_ids || [])];\n\n room_ids.forEach(roomId => {\n const newRoom = findSpace(roomId);\n // Check if the room is found and not already included in this.room\n if (newRoom && !this.multi_rooms.some(room => room.id === newRoom.id)) {\n // Add the new room to this.room\n this.multi_rooms.push(newRoom);\n }\n });\n\n // this.room is sometimes getting set to undefined when raw_data?.room is coming as an object\n if(this.multi_rooms.length && this.room === undefined){\n this.room = this.multi_rooms[0];\n }\n \n /**\n * Setup the booking start and end time\n *\n *\n * Booking defaults to now if start is not defined.\n * Booking durration is now a getter\n */\n // now rounded to the next 5 minute increment\n const defaultStartTz = new DateTZ({ date: nowTz.ms, is_local_tz: false, building_tz: this.timezone }).setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n\n /**\n * When saving a booking the BaseDataClass doens't know to use the toAPIJson\n * so startDateTz isn't being convert to the epoch timestamp\n *\n * I'm not testing for the end time values because we can assume those follow the same pattern.\n */\n const startEpochProvided = !!(raw_data.start_epoch || raw_data.start);\n const startDateTzProvided = !!raw_data.startDateTz;\n\n /**\n * Not trying to be fancy here, just clear.\n */\n if (!startEpochProvided && startDateTzProvided) {\n /**\n * Once a booking is saved the BaseDataClass recreates the Booking\n * but doesn't use the toApiJSON method adapt the class input, mainly the\n * startDateTz isn't converted to the start_epoch timestamp.\n */\n this.startDateTz = raw_data.startDateTz;\n this.endDateTz = raw_data.endDateTz;\n } else if (startEpochProvided) {\n /**\n * A Booking created from the API responses arrives with the booking\n * start_epoch and end_epoch timestamps.\n */\n this.startDateTz = new DateTZ({\n date: ((raw_data.start_epoch || raw_data.start) * 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n this.endDateTz = new DateTZ({\n date: ((raw_data.end_epoch || raw_data.end)* 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n } else {\n /**\n * And there are uses of new Booking where there are no inputs\n * and defaults are necessary.\n */\n this.startDateTz = defaultStartTz;\n this.endDateTz = defaultStartTz.addValue({ minutes: 60 });;\n }\n\n /**\n * End time was by design ending at one minute before, IE 4:00PM is 3:59PM,\n * because of calendar and conflcit checking\n *\n * Check and finesse it.\n * Not sure why but some booking endtime added extra seconds\n */\n if ((this.endDateTz.minutes % 5) !== 0 || this.endDateTz.second > 0) {\n // Not sure of the source but some bookings do not conform.\n this.endDateTz = this.endDateTz.setValue({ second: 0, minute: Math.round(this.endDateTz.minutes / 5) * 5 });\n }\n\n\n\n /**\n * Setup the booking created_date\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n this.created_epoch = raw_data.created_epoch || nowTz.seconds;\n\n\n /**\n * Setup the booking all_day boolean\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n if ('all_day' in raw_data) {\n this.all_day = raw_data.all_day;\n } else {\n this.all_day = !!raw_data.all_day || this.duration > 23 * 60;\n }\n\n\n // R--- TODO Concierge will use startDateTz so i'm not sure if this is needed.\n if (!this.is_concierge && this.all_day && this.timezone) {\n /**\n * Concierge has a all_day form field, I can see it may need this for that, does it really?\n */\n this.startDateTz = this.startDateTz.startOfValue('day')\n }\n\n /**\n * Setup the booking approval status\n */\n let status = raw_data.status;\n // If not provided default to approved.\n if (!raw_data.status) {\n status = 'accepted';\n }\n // \"show_as\" is a special rule to override how the applications display the status\n if (raw_data.show_as && raw_data.show_as === 'cancelled') {\n status = 'declined';\n }\n const approvalStatus = {};\n this.multi_rooms.forEach(room => {\n approvalStatus[room.email] = status;\n });\n // Tracking new \"status\" and legacy \"approval_status\" from raw_data.status.\n this.status = status;\n this.approval_status = raw_data.approval_status || {};\n\n /**\n * Catering setup\n *\n * Bring in and sort the catering order by delivery time\n */\n\n this.catering = (raw_data.catering instanceof Array ? raw_data.catering : []).map(\n (i) => new CateringOrder(i)\n );\n\n\n\n /**\n * Edited fields setup\n *\n * Bring in and sort the catering order by delivery time\n *\n * cateringOrders can return the order sorted\n */\n const edited_fields = Array.isArray(raw_data.edits)\n ? raw_data.edits\n : unique(\n flatten(\n Object.keys(raw_data.edits || {}).map((room) => {\n return flatten(Object.values(raw_data.edits[room]));\n })\n )\n );\n this.edits = edited_fields;\n\n /**\n * New Recurring booking feilds\n *\n * New fields do not match the BookingRecurrenceDetails type\n * and are simpler to manage this way\n */\n this.recurrence_count = raw_data.recurrence_count || null;\n this.recurrence_days = raw_data.recurrence_days || null;\n this.occurrence_edits = raw_data.occurrence_edits || null;\n this.recurrence_endTz = raw_data.recurrence_end ? new DateTZ({date: raw_data.recurrence_end * 1000, is_local_tz: false, building_tz: this.timezone}) : null;\n this.recurrence_exceptions = raw_data.recurrence_exceptions || null;\n this.occurrence_ids = raw_data.occurrence_ids || null;\n this.recurrence_interval = raw_data.recurrence_interval || null;\n this.recurrence_period = raw_data.recurrence_period || null;\n this.recurrence_type = raw_data.recurrence_type || null;\n this.recurrence_master_id = raw_data.recurrence_master_id\n this.occurrence_details = raw_data.occurrence_details\n this.is_recurrent = raw_data.is_recurrent || (!!this.recurrence_type && !!this.recurrence_period) || null;\n this.recurrence_starts = raw_data.recurrence_starts || []\n this.start_epoch = raw_data.start_epoch\n this.end_epoch = raw_data.end_epoch\n\n /**\n * I'm not clear why, but the booking body, aka description is copied into the notes.\n * R--- In concerge data description is only a key when saving, also in the note array?\n */\n if (raw_data.body && !this.notes.find((i) => i.type === 'description')) {\n this.notes = [\n ...this.notes,\n {\n type: 'description',\n date: 0,\n message: raw_data.body,\n author: this.organiser.email\n }\n ];\n }\n\n /**\n * In case there is a cancellation in progress the property attempted_to_delete is set to false\n * And it is persisted until the booking is gone\n */\n this.attempted_to_delete = raw_data.attempted_to_delete || null;\n }\n\n\n /** Service for managing Bookings */\n protected get _service() {\n return ServiceManager.serviceFor(Booking);\n }\n\n /** Alias to approval_status */\n public get auto_approve(): boolean {\n // if concierge we auto_approve always.\n if (this.is_concierge) {\n return true;\n }\n return !this.multi_rooms.some(room => room.byRequest({\n dateTz: this.startDateTz,\n duration: this.duration,\n host: this.organiser\n }));\n }\n\n /** Whether booking has been approved */\n public get approved(): boolean {\n return !this.declined && !this.tentative;\n }\n\n /** All of the booking attendees including the organizer */\n public get allAttendees(): User[] {\n return unique([this.organiser].concat(this.attendees), 'email');\n }\n\n /** Computer format for booking type */\n public get bookingTypeId(): string {\n return this.booking_type.toLowerCase();\n }\n\n /** Human format for booking type */\n public get bookingTypeLabel(): string {\n return toTitleCase(this.booking_type);\n }\n\n /** Get accessor for the check in object, app expect array */\n public get checkInsArray(): string[] {\n return Object.keys(this.check_ins || {})\n }\n\n /** Legacy getter for \"class\" */ // R-- TODO remove\n public get class(): string {\n return this.booking_type;\n }\n\n /** */\n public get displayEndDateTz(): DateTZ {\n if ((this.endDateTz.minutes % 5) !== 0) {\n // All the bookings should end in 59 seconds\n return this.endDateTz.addValue({ seconds: 1 });\n }\n // but if not they return 00\n return this.endDateTz;\n }\n\n /** Whether booking has been declined */\n public get declined(): boolean {\n /**\n * I'm not sure, nor is Cam if this is ever used to decline\n * all booking for a specific room\n */\n const isAnyRoomDeclined = this.multi_rooms.some(room => room.name.toLowerCase().includes('decline'));\n if (isAnyRoomDeclined) {\n return true;\n }\n\n if (this.status.includes('decline')) {\n return true;\n }\n\n return false;\n }\n\n /** Description of the booking purpose */\n public get description(): string {\n const note = (this.notes || []).find((i) => i.type === 'description');\n return note ? note.message : '';\n }\n\n /** Catering getter */\n public get cateringOrders() {\n // Return the catering orders sorted by delivery time\n return this.catering ? this.catering.slice().sort((a, b) => {\n if (a?.delivery_time > b?.delivery_time) return 1;\n if (b?.delivery_time > a?.delivery_time) return -1;\n\n return 0;\n }) : [];\n }\n\n /** Get the created date as DateTz */\n public get creationDateTz() {\n return new DateTZ({ date: this.created_epoch * 1000, is_local_tz: false, building_tz: this.timezone })\n }\n\n public get tz_offset() {\n return getTimezoneOffsetString(this.timezone);\n }\n\n /** Display value for the date */\n public get date_string(): string {\n return this.startDateTz.formatDate('dd MMM yyyy');\n }\n\n /**\n * Get the booking durration based on start and end times\n */\n public get duration(): number {\n return Math.abs(this.startDateTz.startOfValue('minute').dateDiff(this.displayEndDateTz, 'minutes'));\n }\n\n /** Unix timestamp of the booking start */\n public get date() { // R--- remove if not necessary\n return this.startDateTz.ms;\n }\n\n /** Whether booking contains external visitors in the attendee list */\n public get has_visitors(): boolean {\n return this.attendees.reduce((a, v) => a || v.external, false);\n }\n\n /** Does the booking have catering orders */\n public get has_catering(): boolean {\n return !!this.catering.length;\n }\n\n /**\n * Unique calendar event ID\n * same as this.id, used to support existing component usage\n */\n public get icaluid(): string {\n return this.id;\n }\n\n /**\n * Get the booking room id\n */\n public get room_id(): string {\n return this.room.id;\n }\n\n /** Legacy getter of room, aka space */\n public get space(): Space {\n return this.room;\n }\n\n /** Status of the booking */\n public get timeBasedStatusLabel(): 'future' | 'upcoming' | 'done' | 'started' | 'in_progress' | 'expired_yesterday' {\n const buildingTzDt = DateNow(new Date()).toZone(this.timezone) ; // building time\n\n if (DateNow(new Date()).isBeforeDate(this.startDateTz.subtractValue({ minutes: 15 }))) {\n return 'future';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz)) {\n return 'upcoming';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: 15 }))) {\n return 'started';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: this.duration }))) {\n return 'in_progress';\n }\n // if current time is 12 AM (as per timezone) and booking expired yesterday\n else if(buildingTzDt.startOfValue('day').addValue({ minutes: 1 }).isAfterDate(this.startDateTz, 'day') ) {\n return 'expired_yesterday'\n }\n\n return 'done';\n }\n\n /** Whether booking is tentative */\n public get tentative(): boolean {\n if (\n this.status &&\n this.status.indexOf('tentative') >= 0\n ) {\n return true;\n }\n\n return false;\n }\n\n /** Display valuie for the start and end times of the booking */\n public get time_period(): string {\n return `${this.startDateTz.formatDate('h:mma')} - ${this.displayEndDateTz.formatDate('h:mma')}`;\n }\n\n /** Display value for the start time of the booking */\n public get start_time(): string {\n return this.startDateTz.formatDate('h:mma');\n }\n\n /** Display value for the end time of the booking */\n public get end_time(): string {\n return this.endDateTz.formatDate('h:mma');\n }\n\n /** Display value for the duration of the booking */\n public get length_string(): string {\n return humaniseDuration(this.duration);\n }\n\n /** Display value for the location of the booking */\n // public get local_room_name(): string {\n // return this.room?.local_name || 'No location';\n // }\n public get local_room_name(): string {\n if (this.multi_rooms.length === 0) {\n return 'No location';\n } else {\n return this.multi_rooms.map(room => room.local_name).join(', ');\n }\n } \n\n /** Display value for the level of the first space in the booking */\n public get level(): string {\n return this.space.level.name;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Booking {\n return new Booking(this.toJSON());\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(isEdit = false): Booking {\n return new Booking({\n ...this.toJSON(),\n id: isEdit ? this.id : null,\n });\n }\n\n /**\n *\n * @param status\n * @returns void\n */\n public undo(status?: 'accept' | 'decline', opts: { series?: boolean } = {}): Promise {\n return this._service.undo(\n this.id, status || 'accept',\n opts\n );\n }\n\n /**\n * Delete booking from the server\n */\n public delete(opts: { series?: boolean } = {}): Promise {\n if (this.id) {\n return this._service.delete(this.id, { ...opts });\n\n // R-- ask Cam again is he's positive these extra params are not needed for anything\n // return this._service.delete(this.id, {\n // concierge: this.is_concierge,\n // host: this.organiser.email,\n // room_id: this.space?.id,\n // icaluid: this.icaluid,\n // start: json.start,\n // end: json.end\n // });\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Booking): HashMap {\n let data = super.toJSON();\n // Remove the description from the notes\n data.notes = Array.isArray(data.notes) ? data.notes.filter((note) => note.type !== 'description') : data.notes;\n // Encode the nested objects\n data.room = data.room.toJSON();\n\n\n\n data.organiser = data.organiser.toJSON();\n data.creator = data.creator?.toJSON ? data.creator.toJSON(): data.creator;\n // Map the attendees User objects\n data.attendees = data.attendees.map((i: User) => i.toJSON());\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n return data;\n }\n\n /**\n * Convert object into plain object\n */\n public toApiJSON(this: Booking): HashMap {\n let data = super.toJSON();\n\n // Update booking payload contains additional fields\n data.icaluid = \"\";\n if (data.id) {\n data.icaluid = data.id;\n data.location_name = this.multi_rooms.map((item)=>{return item.local_name}).join(', ');\n data.from_room = this.multi_rooms.map((item)=>{return item.email}).join(', ');\n data.building_zone = this.room?.building?.id;\n }\n\n /**\n * These fields are rather in flux\n * According to Cam \"approve\" will be the prefered field\n * and auto_approve and approval_status can be removed.\n */\n data.approve = this.auto_approve; // this value appear incorrect on update\n data.auto_approve = [this.auto_approve]; // Needed to update approval status until BE accepts \"approve\"\n // delete data.approval_status;\n\n // Booking start and end data\n delete data.startDateTz;\n delete data.endDateTz;\n data.start = this.startDateTz.seconds;\n data.end = this.endDateTz.seconds;\n data.old_start = this.startDateTz.seconds; // remove is not necessary\n data.old_end = this.endDateTz.seconds; // remove is not necessary\n\n // Creation date value\n delete data.created_epoch;\n data.creation_date = this.creationDateTz.seconds;\n\n // Catering fields\n // data.catering = data.catering.toJSON();\n data.catering = this.cateringOrders;\n data.has_catering = this.has_catering;\n delete data.cateringOrders\n\n // Attendees appear quite incomplete\n // Map the attendees User objects\n data.attendees = this.allAttendees.map((i: User) => i.toJSON ? i.toJSON() : i);\n\n // Orgainizer and Creator data\n data.organiser = data.organiser.toJSON ? data.organiser.toJSON() : data.organiser;\n data.creator = data.creator.toJSON ? data.creator.toJSON() : data.creator;\n\n // Convert check_ins to checked_in array\n delete data.check_ins;\n data.checked_in = this.checkInsArray;\n\n // edits - edit booking is showing all fields even w/o an edit :(\n\n // Room data\n data.room_ids = this.multi_rooms.map((item)=>{return item.email});\n delete data.room;\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n // Not found in dev data\n delete data.name;\n delete data.email;\n delete data.is_concierge;\n // delete data.building_zone;\n // delete data.status;\n\n return data;\n }\n\n public getType(): string {\n if (!this || this.status?.includes('decline')) {\n return 'cancelled';\n }\n const booking_type = this.booking_type;\n if (booking_type === 'internal' && this.has_visitors) {\n return 'external';\n }\n return booking_type;\n }\n\n /** fallback for a booking when the recurrence_end is null but it's a series booking */\n public recurrenEndFromOcurrences(occurrence_details: { id: string, start_epoch: number }[]): DateTZ {\n const date = occurrence_details?.map(occurence => occurence)\n .sort((a, b) => new Date(a.start_epoch * 1000).getTime() - new Date(b.start_epoch * 1000).getTime())\n .reverse()\n .shift()\n .start_epoch * 1000\n return new DateTZ({date, is_local_tz: false, building_tz: this.timezone});\n }\n\n public get dateString() {\n return shorterLocalDateFormatString(this.startDateTz);\n }\n public get dateBuildingString() {\n return shorterBuildingDateFormatString(this.startDateTz);\n }\n\n public get endDateString(): string {\n return shorterLocalDateFormatString(this.recurrenEndFromOcurrences(this.occurrence_details));\n }\n}\n\n/**\n * Merge catering orders with same time and location\n * @param order_list List of catering orders\n */\nexport function mergeCateringOrders(order_list: CateringOrder[]) {\n // R--- investigate when this is used. Staff doesn't use it when adding catering orders.\n for (let i = 0; i < order_list.length; i++) {\n const orders = order_list.filter(\n (order) =>\n order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time\n );\n if (orders.length > 1) {\n const new_list = order_list.filter(\n (order) =>\n !(order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time)\n );\n new_list.push(new CateringOrder({\n ...order_list[i],\n items: flatten(orders.map(order => order.items)),\n booking_date: this.startDateTz.ms,\n booking_timezone: this.booking_timezone,\n }));\n order_list = new_list;\n i = 0;\n }\n }\n return order_list;\n}\n","import { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport interface SpaceRules {\n auto_approve: boolean; // if false sapce is requestable else bookable\n hide: boolean;\n max_length?: number;\n min_length?: number;\n reason?: string // specially for non-bookable rooms\n}\n\nexport interface BookingNote {\n /** Type of note */\n type: 'equipment' | 'catering' | 'description' | 'private' | 'other' | 'catering-private';\n /** Name of the note's author */\n author: string;\n /** Contents of the note */\n message: string;\n /** Time the note was added to the booking */\n date: number;\n /** Display value for the time */\n time?: string;\n /** ID of the space associated with the note */\n space?: string;\n /** ID of the catering order associated with the note */\n order_id?: string;\n}\n\nexport interface DateDurationData {\n dateTz: DateTZ,\n duration: number,\n mobile: boolean,\n save?: boolean,\n}\n\nexport enum BOOKING_STATUS {\n approved = 'approved',\n declined = 'declined',\n tentative = 'tentative',\n unavailable = 'unavailable'\n}","import {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AvailableBookingFields } from '../settings.interfaces';\nimport {\n HashMap,\n humaniseDuration,\n mockDate as mockDateBase,\n resetDate as resetDateBase,\n timeFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { CateringOrder } from '../catering/catering-order.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { User } from '../users/user.class';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport {\n BookingRule,\n SpaceStatus\n} from './space.types';\nimport { validateEndTime } from '../validation.utilities';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\nimport { Space } from '../spaces';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\nconst MINUTE = 1;\nconst HOUR = 60;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\nconst MONTH = 30 * DAY;\n\nconst DURATION_MAP: { [duration: string]: number } = {\n month: MONTH,\n months: MONTH,\n week: WEEK,\n weeks: WEEK,\n day: DAY,\n days: DAY,\n hour: HOUR,\n hours: HOUR,\n minute: MINUTE,\n minutes: MINUTE\n};\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const mockDate = mockDateBase;\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const resetDate = resetDateBase;\n\nexport interface IBookingSlot {\n start: number;\n end: number;\n}\n\n\nexport function bookingOptionsToQuery(options: IBookingQueryOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n delete query.type;\n if (options.filters) {\n delete query.filters;\n for (const property in options.filters) {\n if (!query[property]) {\n query[property] = options.filters[property]\n }\n }\n }\n\n // id?: string;\n // cancelled?: boolean;\n if (options.until) {\n query.to = options.until;\n delete query.until;\n }\n \n }\n return query;\n}\n\n\n/**\n * Generate a list of free time slots between the given bookings\n * @param list List of bookings to find slots between\n * @param min_size Minimum length of a free slot in minutes\n */\nexport function getFreeBookingSlots(list: Booking[]=[], min_size: number = 30, dateTzMs: number = DateNow(new Date()).ms,): IBookingSlot[] {\n /* istanbul ignore else */\n if (!list.length) {\n return [\n {\n start: 0,\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n }\n ];\n }\n const slots: IBookingSlot[] = [];\n let start = new DateTZ({ date: dateTzMs });\n list.sort((a, b) => a.date - b.date);\n for (const booking of list) {\n const bkn_start = booking.startDateTz;\n const bkn_end = booking.endDateTz;\n if (bkn_start.isAfterDate(start)) {\n const diff = Math.abs(bkn_start.dateDiff(start, 'minutes'));\n /* istanbul ignore else */\n if (diff >= min_size) {\n slots.push({ start: start.ms, end: bkn_start.ms });\n }\n start = bkn_end;\n } else if (start.startOfValue('minute').ms === bkn_start.startOfValue('minute').ms) {\n start = bkn_end;\n }\n }\n slots.push({\n start: start.ms,\n // R--- these X 10's make no sense. why not + 2 years?\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n });\n\n return slots;\n}\n\n/**\n * Get the next free time slot from the given bookings\n * @param list List of bookings to find the next slot\n * @param date Date to find next slot after in ms since UTC epoch\n * @param min_size Minimum length of the free slot in minutes\n * \n * R--- Possibly depreciate, I don't see it used anywhere except for its own test\n */\nexport function getNextFreeBookingSlot(\n list: Booking[],\n date: number = DateNow(new Date()).ms,\n min_size: number = 15\n): IBookingSlot {\n const slots = getFreeBookingSlots(list, min_size, date);\n const date_ = new DateTZ({date})\n const time = date_.startOfValue('minute').setValue({ second: 1 });\n for (const block of slots) {\n const start = new DateTZ({date: block.start});\n const end = new DateTZ({date: block.end});\n if (start.startOfValue('minute').isAfterDate(time)) {\n return block;\n } else if (time.isBeforeDate(end.startOfValue('minute'))) {\n const duration = end.startOfValue('minute').dateDiff(time, 'minutes');\n /* istanbul ignore else */\n if (duration >= min_size) {\n return block;\n }\n }\n }\n return slots[slots.length - 1];\n}\n\n/**\n * Generate form fields for the given booking\n * @param booking Booking to generate form for\n * @param current_user Current user of the system to default as the host\n */\nexport function generateBookingForm(\n booking: Booking,\n use_fields: AvailableBookingFields[],\n isConcierge: boolean = false,\n manualTimezone?: string,\n action?: SeriesAction | BookingAction | null\n ): FormGroup {\n if (!booking) {\n throw Error('No booking passed');\n }\n\n const user_service = ServiceManager.serviceFor(User);\n const current_user =\n user_service.current ||\n new User({ id: 'local-user', name: 'Local User', email: 'local@place.tech' });\n\n const fields: HashMap = {\n id: new FormControl(booking.id || ''),\n space_list: new FormControl( booking.is_multiroom? booking.multi_rooms : [booking.room], []),\n room: new FormControl(booking.room, {}),\n dateTz: new FormControl({ value: booking.startDateTz || DateNow(), disabled: false }, [Validators.required]),\n duration: new FormControl({ value: booking.duration, disabled: false }),\n organiser: new FormControl(booking.organiser || current_user, [Validators.required]),\n attendees: new FormControl(booking.attendees, []),\n title: new FormControl(booking.title || '', { validators: [ Validators.required, Validators.minLength(1) ], updateOn: 'blur' }), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n booking_type: new FormControl(booking.booking_type),\n body: new FormControl(booking.body),\n notes: new FormControl(booking.notes),\n equipment_codes: new FormControl(booking.equipment_codes),\n expected_attendees: new FormControl(booking.expected_attendees),\n company: new FormControl(booking.company),\n is_multiroom: new FormControl(booking.is_multiroom),\n merged: new FormControl({value: booking?.merged, disabled: true}),\n catering: new FormControl(\n booking.cateringOrders.map(\n (order) => new CateringOrder({\n ...order,\n booking_date: booking.startDateTz.ms,\n booking_timezone: booking.timezone,\n })\n )\n ),\n all_day: new FormControl(!!booking.all_day),\n has_catering: new FormControl(!!booking.has_catering),\n needs_space: new FormControl(true),\n action: new FormControl(''),\n timezone: new FormControl(manualTimezone || \"\"),\n is_before_date: new FormControl(false)\n };\n if (!isConcierge) {\n fields.duration.setValidators([Validators.required, validateEndTime(fields.dateTz)]);\n }\n /* istanbul ignore else */\n if (booking.id && booking.id !== 'ad-hoc') {\n fields.organiser.disable();\n /* istanbul ignore else */\n if (booking.endDateTz.ms < DateNow(new Date()).ms) {\n fields.dateTz.disable();\n }\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n fields.dateTz.setValidators(dateValidators);\n fields.dateTz.updateValueAndValidity();\n }\n let list_length = -1;\n fields.space_list.valueChanges.subscribe((list) => {\n const expected = fields.expected_attendees.value || {};\n const matches = Object.keys(expected).filter((key) =>\n list?.find((space) => space.email === key)\n ).length;\n if (list && list.length && matches === 0) {\n const codes = fields.equipment_codes.value || {};\n if (Object.keys(expected).length >= 0 || Object.keys(codes).length >= 0) {\n const key = Object.keys(expected)[0] || Object.keys(codes)[0];\n const new_expected = {};\n const new_codes = {};\n const notes = fields.notes.value;\n notes.forEach((note) => (note.space === key ? (note.space = list[0].email) : ''));\n new_expected[list[0].email] = expected[key];\n new_codes[list[0].email] = codes[key];\n fields.expected_attendees.setValue(new_expected);\n fields.equipment_codes.setValue(new_codes);\n }\n }\n list_length = list?.length;\n });\n fields.dateTz.valueChanges.subscribe((_) => {\n fields.duration.updateValueAndValidity();\n });\n fields.needs_space.valueChanges.subscribe((space_needed) => {\n if (!space_needed) {\n fields.space_list.setValue([]);\n }\n });\n fields.has_catering.valueChanges.subscribe((has_catering) => {\n if (!has_catering) {\n fields.catering.setValue([]);\n }\n });\n const simplified_fields: HashMap = [\n 'id',\n 'space_list',\n 'space_ids',\n 'notes',\n 'dateTz',\n 'booking_type',\n 'equipment_codes',\n 'expected_attendees',\n 'timezone',\n 'is_before_date',\n ...use_fields\n ].reduce((map, key) => {\n /* istanbul ignore else */\n if (fields[key]) {\n map[key] = fields[key];\n }\n return map;\n }, {});\n \n if (simplified_fields.all_day) {\n const handleAllDay = (value) => {\n if (value) {\n let startOfDay = simplified_fields.dateTz.value.clone();\n // When the booking space isn't set we still need a way to determine midnight\n // and here we use the current concierge building selection's timezone.\n if (manualTimezone) {\n startOfDay = startOfDay.toZone(manualTimezone);\n }\n\n simplified_fields.dateTz.setValidators([Validators.required]);\n simplified_fields.dateTz.setValue(simplified_fields.all_day.value\n ? startOfDay.startOfValue('day')\n : simplified_fields.dateTz.value);\n simplified_fields.duration.setValue(simplified_fields.all_day.value\n ? 24 * 60\n : simplified_fields.duration.value);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.disable();\n // simplified_fields.dateTz.disable();\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n simplified_fields.dateTz.setValidators(dateValidators);\n simplified_fields.duration.setValue(booking.duration || 30);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.enable();\n simplified_fields.dateTz.enable();\n }\n };\n simplified_fields.all_day.valueChanges.subscribe(handleAllDay);\n handleAllDay(simplified_fields.all_day.value);\n }\n\n const occurrences = booking.occurrence_details || [];\n\n //Add recurrence fields\n if(action && booking.recurrence_period === RecurrencePeriod.LIST){\n booking.recurrence_starts = occurrences\n .filter(occurrence => occurrence.id !== booking.recurrence_master_id)\n .map((occurrence) => new DateTZ({date: occurrence.start_epoch * 1000, is_local_tz: false, building_tz: booking.timezone})\n ) \n }\n /**If series exists then set the start and end dates from the first and last bookings in the occurrences array\n * this prevents prefilled form errors due to individual edits\n */\n if(action && action !== SeriesAction.CLONE && action !== BookingAction.CLONE && occurrences && occurrences.length && !booking.id){\n const start_dateTz = new DateTZ({\n date: occurrences.sort((d1, d2) => d1.start_epoch - d2.start_epoch)[0].start_epoch * 1000, \n is_local_tz: false, building_tz: booking.timezone\n })\n simplified_fields.dateTz.setValue(start_dateTz)\n const end = occurrences.sort((d1, d2) => d2.start_epoch - d1.start_epoch)[0].start_epoch * 1000\n booking.recurrence_endTz = new DateTZ({date: end, is_local_tz: false, building_tz: booking.timezone}) \n }\n\n // R-- needs TZ aware fields\n const _recurr_end = simplified_fields.dateTz?.value || new DateTZ({ date: 1 }); // new DateTZ({date: simplified_fields.date?.value}) \n const fields_with_recurrence = {\n ...simplified_fields,\n recurrence_period: new FormControl(booking.recurrence_period || RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl(booking.recurrence_interval || 1),\n recurrence_endTz: new FormControl(booking.recurrence_endTz || _recurr_end.addValue({days: 1})),\n recurrence_count: new FormControl(booking.recurrence_count || 0),\n is_recurrent: new FormControl(booking.is_recurrent),\n recurrence_starts: new FormControl(booking.recurrence_starts || []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl(booking.recurrence_days || [])\n }\n\n if(booking.is_recurrent && action !== BookingAction.CLONE){\n fields_with_recurrence.recurrence_starts.setValidators([arrayWithValues])\n fields_with_recurrence.recurrence_starts.updateValueAndValidity()\n fields_with_recurrence.recurrence_endTz.setValidators([Validators.required, validDateTZ]);\n }\n // Generate form group for booking item\n const form = new FormGroup(fields_with_recurrence);\n return form;\n}\n\n/**\n * Validate whether date is in the future\n * @param control Control to check value\n */\nexport function isFuture(control: AbstractControl) {\n const dateTz = control.value; // new DateTZ({date: control.value});\n return dateTz.isBeforeDate(DateNow(new Date()).subtractValue({ minutes: 5 }))\n ? { dateTz: 'Date needs to be in the future' }\n : null;\n}\n\n/**\n * Validate whether an array has values\n * @param control Control to check value\n */\nexport function arrayWithValues (control: AbstractControl) {\n return control.value.length !== 0 ? null : { field: 'Needs at least one value'}\n}\n\n/**\n * Validate whether a date has a valid value (future or current date)\n * @param control Control to check value\n */\n export function validDate (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = new DateTZ({date: control.value})\n const now = DateNow(new Date())\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Validate whether a date has a valid DateTZ value (future or current date)\n * @param control Control to check value\n */\n export function validDateTZ (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = DateNow(control.value.JSDate);\n const now = DateNow(new Date());\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Get minimum duration from ruleset in minutes\n * Default to 5min\n */\nexport function getMinLength(rule_list: HashMap): number {\n return Object.values(rule_list).reduce((min, block) => {\n const min_block = block.reduce((min_length, el) => {\n if (el.conditions.min_length && stringToMinutes(el.conditions.min_length) > min) {\n return stringToMinutes(el.conditions.min_length);\n } else {\n return min_length;\n }\n }, 5);\n if (min_block > min) {\n return min_block;\n } else {\n return min;\n }\n }, 5) as number;\n}\n\n/**\n * Whether the first input is greater than the last. Converts duration strings into minutes\n * @param duration_1 First input can be a number in minutes or a duration string e.g. `1 hour`\n * @param duration_2 Second input can be a number in minutes or a duration string e.g. `30 minutes`\n */\nexport function durationGreaterThanOrEqual(\n duration_1: string | number,\n duration_2: string | number\n) {\n const first: number = typeof duration_1 === 'string' ? stringToMinutes(duration_1) : duration_1;\n const second: number =\n typeof duration_2 === 'string' ? stringToMinutes(duration_2) : duration_2;\n return first >= second;\n}\n\n/**\n * Conver time string into minutes\n * @param str timestring e.g. `'1 day'`, `'15 minutes'`, `'2 weeks'`\n */\nexport function stringToMinutes(str: string): number {\n const parts = str.split(' ');\n return +parts[0] * DURATION_MAP[parts[1]];\n}\n\n/**\n * Get current status within bookings\n * @param bookings List of bookings\n * @param host Host of the new event\n * @param date Datetime of the new event\n */\nexport function statusFromBookings(\n bookings: Booking[] = [],\n bookable: boolean = true,\n requestable: boolean = false,\n dateTz: DateTZ = DateNow(),\n space?: Space\n) {\n const free_slots = getFreeBookingSlots(bookings.filter((bkn) => !bkn.declined));\n const now = DateNow() // new DateTZ({date}); // now should be now\n // commeted bellow piece as correct way to get next free booking slot is at line- 488\n // const next_free_slot = free_slots.find((slot) => {\n // return slot && (slot.start > now.ms || now.ms > slot.start - slot.start % 1000 || now.ms < slot.end - slot.end % 60 * 1000);\n // // const start = new DateTZ({date: slot?.start || 0 });\n // // const end = new DateTZ({date: slot?.end || 0}); // slot end isn't late enough? or after now/\n // // return start.isAfterDate(now) || (now.isAfterDate(start.startOfValue('second')) && now.isBeforeDate(end.startOfValue('minute')))\n // });\n\n const next_free_slot = getNextFreeBookingSlot(bookings.filter((bkn) => !bkn.declined), dateTz.ms);\n \n const start = new DateTZ({date: next_free_slot?.start || 0});\n const end = new DateTZ({date: next_free_slot?.end || 0});\n const currently_free = dateTz.isAfterDate(start.startOfValue('second')) && dateTz.isBeforeDate(end.startOfValue('minute'));\n const time_until_next_block = humaniseDuration(\n currently_free ? end.dateDiff(dateTz, 'minutes') : start.dateDiff(dateTz, 'minutes'),\n 'short'\n );\n\n const free_tomorrow = !currently_free && !start.isSameDate(dateTz, 'day');\n const free_today = currently_free && !end.isSameDate(dateTz, 'day');\n \n return {\n status: (!bookable\n ? SpaceStatus.NotBookable\n : currently_free\n ? requestable\n ? SpaceStatus.Requestable\n : SpaceStatus.Available\n : SpaceStatus.InProgress) as SpaceStatus,\n available_until: free_today\n ? 'No meetings today'\n : currently_free\n ? `Free until ${end.formatDate(timeFormatString())}(${time_until_next_block})`\n : free_tomorrow\n ? 'Unavailable today'\n : `Free at ${start.formatDate(timeFormatString())}(${time_until_next_block})`\n };\n}\n\n/**\n * V1 version display.\n */\nexport const spaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'Unavailable';\n case SpaceStatus.InProgress:\n return 'Meeting in Progress';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nexport function replaceBookings(\n list: Booking[],\n new_bookings: Booking[],\n filter_options: { room_email: string; fromTz: DateTZ; toTz: DateTZ }\n) {\n const filtered_list = list.filter((booking) => {\n return (\n !(booking.multi_rooms.some(room => room?.email === filter_options.room_email)) ||\n !timePeriodsIntersect(filter_options.fromTz.ms, filter_options.toTz.ms, booking.startDateTz.ms, booking.endDateTz.ms)\n );\n });\n const updated_list = filtered_list.concat(new_bookings);\n updated_list.sort((a, b) => a.date - b.date);\n return unique(updated_list, 'icaluid');\n}\n\nexport function timePeriodsIntersect(\n start1: number,\n end1: number,\n start2: number,\n end2: number,\n type = ''\n) {\n return (\n (start1 >= start2 && start1 < end2) ||\n (end1 > start2 && end1 <= end2) ||\n (start2 >= start1 && start2 < end1) ||\n (end2 > start1 && end2 <= end1)\n );\n}\n\nexport function formatWhen({\n all_day,\n startTZ,\n endTZ,\n displayEndTZ\n}): string {\n if (all_day) {\n return `${startTZ.formatDate('dd MMM yyyy')} - All Day`;\n } else {\n if (startTZ.isSameDate(endTZ, 'day')) {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('h:mma')}`;\n } else {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('dd MMM yyyy, h:mma')}`;\n }\n }\n}\n\nexport const isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\nexport function searchRoomsAndBookings(allItems: (Space | Booking)[], searchValue: string, isConcierge:boolean = false) {\n\n let relevantItems: (Space | Booking)[] = [];\n\n if(isConcierge) {\n relevantItems = allItems.filter( (item: any ) => \n isIncludes(item, 'title', searchValue) ||\n isIncludes(item.creator, 'name', searchValue) ||\n isIncludes(item.organiser, 'name', searchValue) ||\n isIncludes(item, 'simple_name', searchValue) || // search with room name \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n } else {\n relevantItems = allItems.filter( (item: any ) => \n this.isIncludes(item.creator, 'name', searchValue) ||\n this.isIncludes(item.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'simple_name', searchValue) \n );\n }\n\n const filteredItems = this.duplicateMultiroomEntriesIfAny(relevantItems);\n \n return filteredItems;\n} \n\nexport function duplicateMultiroomEntriesIfAny(bookings) {\n // Initialize an array to hold the original and duplicated entries \n const updatedBookings = [...bookings];\n\n // Loop through the original bookings array \n [...bookings].forEach(booking => {\n if(booking?.is_multiroom) {\n // calculate the number of times to duplicates the booking\n const duplicatesCount = booking.multi_rooms.filter(el => el.id !== booking.space.id);\n\n // Create the duplicate and add them to the updatedBookings array.\n for(let i = 0; i < duplicatesCount.length; i++) {\n // Deep copy the booking to ensure references are not copied\n const duplicatedBooking = cloneDeep(booking); \n duplicatedBooking.room = duplicatesCount[i]; \n updatedBookings.push(duplicatedBooking);\n }\n }\n });\n\n // Return the array with duplicated entries \n return updatedBookings;\n\n}\n \n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { DateNow } from \"@mckinsey-converge/date-tz\";\nimport { Observable } from 'rxjs/internal/Observable';\nimport { forkJoin } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n const now = DateNow(new Date())\n if (!options.from) {\n options.from = now\n .startOfValue('day')\n .subtractValue({ days: 2 })\n .ms;\n }\n if (!options.until) {\n options.until = null;\n }\n\n const key = `bookings|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Booking[]) => {\n delete this._promises[key];\n resolve(list);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking, series?: boolean): Promise {\n const body = booking.toApiJSON()\n if(series){\n body.series = true\n }\n return booking.id ? this.update(booking.id, body) : this.add(body);\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n public checkinIndividualVisitor(id: string, fields: BookingCheckinParams) {\n return this.taskObsr(id, 'checkin', fields); \n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n public declineMultiple(bookings: Booking[]): Observable {\n const requests = [];\n bookings.forEach(bkg => {\n const booking = bkg.toJSON();\n const id = booking.id;\n const fields = {\n booking_id: booking.id,\n organiser: booking.organiser.email,\n room_email: booking.space?.email,\n icaluid: booking.icaluid,\n start: booking.startDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n end: booking.endDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n };\n if (bkg.is_recurrent && bkg.recurrence_type === 'master') {\n // Add series=true for recurrent bookings\n fields['series'] = true;\n } \n requests.push(this.taskObsr(id, 'concierge_decline', fields) ); \n });\n return forkJoin(requests);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { PaginatedAPIService } from '../paginated.service';\nimport { Booking, IBookingQueryOptions, } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { Observable } from 'rxjs';\n\nexport interface PaginatedBooking {\n results: Booking[];\n total: number;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsPaginatedService extends PaginatedAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n\n const key = `bookingsPaginated|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (response: any) => {\n delete this._promises[key];\n resolve(response);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking): Promise {\n return booking.id ? this.update(booking.id, booking.toJSON()) : this.add(booking.toJSON());\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n // public getHoldingBay(query: IBookingQueryOptions): Promise {\n // const key = `bookingsPaginated|holding-bay`;\n // if (!this._promises[key]) {\n // this._promises[key] = new Promise((resolve, reject) => {\n // const respond = (response: any) => {\n // delete this._promises[key];\n // resolve(response);\n // };\n // const error = e => {\n // reject(e);\n // delete this._promises[key];\n // }; \n // this.query(query, { url: '/api/staff/bookings/holding_bay' }).then(respond, error);\n // });\n // }\n\n // return this._promises[key];\n // }\n\n public getHoldingBay = (query: IBookingQueryOptions): Observable => this.queryHoldingBay(query, { url: '/api/staff/bookings/holding_bay' });\n}\n","export * from './booking.class'\nexport * from './space.types'\nexport * from './bookings.service'\nexport * from './bookingsPaginated.service'\nexport * from './booking.utilities'\nexport * from './booking-state.service'\nexport * from './space.utilities'\nexport * from './booking.types'\n","import { SpaceRules } from './booking.types';\n\nimport {\n durationGreaterThanOrEqual,\n stringToMinutes\n} from './booking.utilities';\nimport {\n SpaceCheckOptions,\n SpaceRuleOptions\n} from './space.types';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * Get booking rules for the given user and space\n * @param options\n */\nexport function rulesForSpace(options: SpaceRuleOptions): SpaceRules {\n if (!options) {\n throw Error('Options are needed to check for rule matches');\n }\n const space_rules_for_user: SpaceRules = {\n auto_approve: true,\n hide: true,\n reason: ''\n };\n let match = false;\n /* istanbul ignore else */\n if (options.space) {\n for (const type in options.rules) {\n if (\n options.rules.hasOwnProperty(type) &&\n options.rules[type] instanceof Array &&\n options.space.zones.find((zone) => zone === type)\n ) {\n for (const rule_block of options.rules[type]) {\n /* istanbul ignore else */\n if (\n checkRules({\n user: options.user,\n space: options.space,\n time: options.time,\n duration: options.duration,\n rules: rule_block.conditions\n })\n ) {\n const ruleset = rule_block.rules;\n const conditions = rule_block.conditions;\n space_rules_for_user.hide = false;\n /* istanbul ignore else */\n if (conditions.max_length) {\n space_rules_for_user.max_length = stringToMinutes(\n conditions.max_length as string\n );\n }\n /* istanbul ignore else */\n if (conditions.min_length) {\n space_rules_for_user.min_length = stringToMinutes(\n conditions.min_length as string\n );\n }\n // NOTE: use max_length in conditions instead of book_length in rules\n // if (ruleset.book_length) {\n // space_rules_for_user.max_length = stringToMinutes(ruleset.book_length as string);\n // }\n /* istanbul ignore else */\n if (ruleset.auto_approve !== undefined) {\n space_rules_for_user.auto_approve = ruleset.auto_approve;\n }\n match = true;\n space_rules_for_user.reason = '';\n break;\n }\n else {\n space_rules_for_user.reason = 'OfficeRules';\n }\n }\n }\n \n /* istanbul ignore else */\n if (!space_rules_for_user.hide) {\n break;\n }\n }\n }\n if (!match) {\n space_rules_for_user.hide = true;\n }\n return space_rules_for_user;\n}\n\n\n/**\n * Check if user matches the given ruleset\n * @param options\n */\nfunction checkRules(options: SpaceCheckOptions): boolean {\n /* istanbul ignore else */\n if (options.rules) {\n const time = new DateTZ({date: options.time});\n const count = Object.keys(options.rules).length;\n let matches = 0;\n Object.keys(options.rules).forEach((key) => {\n let counter = 0;\n const condition: string[] =\n options.rules[key] instanceof Array\n ? (options.rules[key] as [])\n : [options.rules[key] as string];\n switch (key) {\n case 'groups':\n /* istanbul ignore else */\n if (options.user && options.user.groups) {\n counter = 0;\n condition.forEach((i) =>\n options.user.groups.find((j) => j === i) ? counter++ : null\n );\n /* istanbul ignore else */\n if (counter > 0) {\n matches++;\n }\n }\n break;\n case 'locations':\n /* istanbul ignore else */\n if (options.user && options.user.location) {\n counter = 0;\n condition.forEach((i) =>\n (options.user.last_location.name || '').indexOf(i) >= 0\n ? counter++\n : null\n );\n /* istanbul ignore else */\n if (counter >= options.rules[key].length) {\n matches++;\n }\n }\n break;\n case 'is_before':\n /* istanbul ignore else */\n if (options.time) {\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date()).addValue({ minutes: duration });\n let match = time.isBeforeDate(check);\n /* istanbul ignore else */\n matches += match ? 1 : 0;\n }\n break;\n case 'is_after':\n /* istanbul ignore else */\n if (options.time) {\n\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date());\n time.isAfterDate(check.addValue({ minutes: duration })) ? matches++ : '';\n }\n break;\n case 'min_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(options.duration, condition[0])\n ) {\n matches++;\n }\n break;\n case 'max_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(condition[0], options.duration)\n ) {\n matches++;\n }\n break;\n }\n });\n return matches >= count;\n }\n return false;\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringCategoriesService extends BaseAPIService {\n\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringCategory, this);\n this._name = 'catering category/group';\n this._api_route = 'catering/category';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering categories. Use catering menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering categories. Use catering menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringCategory(raw_item);\n }\n\n public format(item: CateringCategory) {\n return { ...item };\n }\n}\n","import { CateringItem } from \"./catering-item.class\";\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport class CateringCategory extends CateringItem {\n /** Whether item is a category */\n public is_category = true;\n public admin_only: boolean;\n public restricted_from: number;\n\n constructor(data: HashMap) {\n super(data);\n this.is_category = true;\n (this as any).must_select = this.must_select || 0;\n (this as any).order_anytime = !!data.order_anytime && this.package;\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj = super.toJSON();\n obj.order_anytime = !!obj.order_anytime && obj.package;\n return obj;\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport interface CateringAvailability {\n /** Month of the year that the item starts being available */\n readonly from_month: number;\n /** Month of the year that the item ends being available */\n readonly to_month: number;\n}\n\nexport class CateringItem {\n /** Unique ID of the catering item */\n public readonly id: string;\n /** Display name of the catering item */\n public readonly name: string;\n /** Description of the item */\n public readonly description: string;\n /** URL to the image associated with the item */\n public readonly image_path: string;\n /** Type of catering item */\n public readonly catering_type: string;\n /** Availability of the item */\n public readonly available: CateringAvailability;\n /** Time in hours that is needed to prepare the item beforehand */\n public readonly prior_notice: number;\n /** Cost of the item without decimals */\n private unit_price: number;\n /** Cost of the item without decimals */\n public readonly supplier_cost: number;\n /** Minimum number this item allowed in an order */\n public readonly minimum_quantity: number;\n /** Maximum number this item allowed in an order */\n public readonly maximum_quantity: number;\n /** List of categories that the item is contained in */\n public readonly parent_categories: readonly string[];\n /** Allegen information associated with the item */\n public readonly allergy: string;\n /** Whether the supply of this item has run out */\n public out_of_stock: boolean;\n /** Whether item can be ordered within the time limit set by the building */\n public readonly order_anytime: boolean;\n /** Number of child items that must be selected as part of the package */\n public readonly must_select: number;\n /** List of associated items */\n public readonly items: CateringItem[];\n public readonly availableItems: CateringItem[];\n /** Whether child items are part of a package */\n public readonly package: boolean;\n /** List of zone ids associated with the category */\n public readonly zones: readonly string[];\n /** Number of this item in the assoicated order */\n private _amount = 0;\n /** Unique ID of the catering item */\n private instance_id: string;\n /** Whether item is a category */\n public is_category: boolean = false;\n /** Whether item is disabled in Staff App */\n public admin_only: boolean;\n /** restricted_from indicates category restriction from hours ahead of delivery time */\n public restricted_from: number;\n\n public get can_order_anytime(): boolean {\n return (\n this.order_anytime ||\n !this.package && this.items.reduce(\n (anytime, item) => anytime || item.can_order_anytime,\n false,\n )\n );\n }\n\n /** Number of this item in the assoicated order */\n public get amount(): number {\n return this._amount || 0;\n }\n\n /** Unit price in the assoicated order */\n public get price(): number {\n return this.unit_price || 0;\n }\n\n /** Total cost of the amount of items set */\n public get total(): number {\n return (this._amount * this.unit_price) || 0;\n }\n\n constructor(data: HashMap) {\n this.instance_id = `item-${Math.floor(Math.random() * 999_999_999)}`;\n this.id = data.id || '';\n this.name = data.name || '';\n this.is_category = this.id.includes('category-');\n this.available = {\n from_month: (data.available ? data.available.from_month : data.available_from) || -1,\n to_month: (data.available ? data.available.to_month : data.available_to) || -1,\n };\n this.description = data.description || '';\n this.prior_notice = data.prior_notice || data.notice;\n this.unit_price = data.unit_price || data.price || 0;\n this.supplier_cost = data.supplier_cost;\n this.minimum_quantity = Math.max(0, data.minimum_quantity || 0);\n this.maximum_quantity = Math.max(1, data.maximum_quantity || 999);\n this.parent_categories = data.category_ids || data.parent_categories || data.categories;\n this.order_anytime = !!data.order_anytime;\n this.image_path = data.image_path || '';\n this.admin_only = data.admin_only;\n this.restricted_from = data.restricted_from || data?.root_category_restricted_from || 0;\n \n this.catering_type = data.catering_type;\n this.must_select = data.must_select ?? 0;\n this._amount = data._amount || data.amount || 0;\n this.allergy = data.allergy || '';\n const cateringItems: CateringItem[] = (data.items || []).map(item => new CateringItem(item));\n this.items = cateringItems;\n const filteredCateringItems = cateringItems.filter(c => !c.out_of_stock);\n this.availableItems = filteredCateringItems;\n this.out_of_stock = !!data.out_of_stock ||\n // if original items are empty, we hit the bottom, so if we filter out items then its out of stock.\n (cateringItems.length > 0 && filteredCateringItems.length === 0);\n this.package = data.package === 'true' || data.package === true;\n this.zones = data.zones && data.zones.length ? [...data.zones] : [];\n }\n\n public setAmount(amount: number = 0): void {\n if (amount <= this._amount) {\n if (amount < this.minimum_quantity) {\n amount = 0;\n }\n } else {\n if (amount < this.minimum_quantity) {\n amount = this.minimum_quantity;\n }\n }\n this._amount = Math.max(0, Math.min(this.maximum_quantity, amount));\n }\n\n /**\n * Updates the unit_price in the assoicated order if necessary\n * @param price value to compare to unit_price\n */\n public setPrice(price: number = 0): void {\n if(this.unit_price !== price) this.unit_price = price;\n }\n\n /**\n * Increase amount of the item the order\n * @param amount Amount to increase by\n */\n public addToOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount += amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = this.minimum_quantity;\n } else if (this._amount > this.maximum_quantity) {\n this._amount = this.maximum_quantity;\n }\n }\n\n /**\n * Decrease amount of the item the order\n * @param amount Amount to decrease by\n */\n public removeFromOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount -= amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = 0;\n }\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._changes;\n delete obj._server_names;\n // Convert remaining members to be public\n obj.price = obj.unit_price;\n obj.categories = obj.parent_categories;\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n return obj;\n }\n\n\n\n public within_category_restricted_time(dateTz): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!this?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: this?.restricted_from }).startOfValue('minute');\n return dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { CateringItem } from './catering-item.class';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringItemsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringItem, this);\n this._name = 'Catering Menu';\n this._api_route = 'catering/item';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering items. Use menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering items. Use menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringItem(raw_item);\n }\n\n public format(item: CateringItem) {\n return item instanceof CateringItem ? item.toJSON() : item;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { CateringItem } from './catering-item.class';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringMenuService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Catering Menu';\n this._api_route = 'menu';\n }\n\n /**\n * Convert user data to local format\n * @param user User data\n */\n protected processItem(item: HashMap) {\n return item.items ? new CateringCategory(item) : new CateringItem(item);\n }\n}\n","\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringNotesService {\n\n public cateringNotes = [];\n\n \n public setNotes(notes) {\n this.cateringNotes = notes;\n }\n\n public getNotes() {\n return this.cateringNotes;\n }\n}","import { CateringItem } from './catering-item.class';\nimport { HashMap } from '@mckinsey-converge/base';\n\nimport { CateringCategory } from './catering-category.class';\nimport { Booking } from '../bookings';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport type CateringOrderMutableProperties =\n | 'items'\n | 'location_id'\n | 'location'\n | 'delivery_time'\n | 'charge_code'\n | 'notes'\n | 'status';\n\nexport type CateringOrderStatus = 'accepted' | 'preparing' | 'ready' | 'delivered' | 'cancelled';\n\nconst now = DateNow(new Date());\n\n// R--- refactor booking date to be dateTz\nexport class CateringOrder {\n /**\n * Booking fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Unique Booking ID for the catering order */\n readonly booking_id: string;\n /** \n * Timestamp based booking time of the booking associated with the order\n * \n * Must be provide as the true Booking startDateTz or as a new DateTZ with \n * the correct date: timestamp, local_tz = false and bulding_tz values\n */\n readonly booking_date: number;\n /**\n * Timezone of the booking associated with the order\n */\n readonly booking_timezone: string;\n /** ID of the location to deliver the items to */\n location_id: string = '';\n /** Display text for the location to deliver the items to */\n location: string = '';\n /**\n * Smart timezone aware catering datetime with timezone\n */\n readonly bookingDateTz: DateTZ;\n\n /** \n * Booking associated with the order \n * \n * The booking attached to the CateringOrder is a special case used \n * mainly on the Concierge catering reports because someone created \n * a bad pattern to save catering changes to the booking. \n * \n * Avoid when possible.\n */\n public booking: Booking = null;\n\n /**\n * Catering specific fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Whether the order status change is loading */\n public loading: boolean;\n /** Unique ID for the catering order */\n readonly id: string;\n /** Number of minutes after the start of the associated meeting to delivery the order */\n readonly delivery_time: number = 0;\n /** Status of the catering order */\n readonly status: CateringOrderStatus;\n /** Whether items in the order need to be prepared in the kitchen */\n readonly kitchen: boolean;\n /** Whether items in the order are in the pantry */\n readonly pantry: boolean;\n /** List of items */\n readonly items: readonly (CateringItem | CateringCategory)[] = [];\n /** Creation time of the order */\n readonly created_at: number;\n /** Charge code associated with the order */\n readonly charge_code: string;\n /** Notes associated with the order */\n readonly notes: string;\n // /** Mapping of properties to their changes */\n // private _changes: HashMap = {};\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n /** Currency code for the location of the order */\n public symbol: string;\n /** Whether the is an error with the order */\n public error: boolean;\n\n\n constructor(data: HashMap) {\n /** \n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = DateNow(new Date());\n // now rounded to the next 5 minute increment\n const defaultStartTz = nowTz.setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n\n this.id = data.id || `order-${Math.floor(Math.random() * 999_999_999)}`;\n\n // If the booking is provided default the booking values to the true booking values\n this.booking = data.booking || null;\n\n \n // Has a booking so init with those values\n if (this.hasBookingAttached) {\n this.booking_date = this.booking.startDateTz.ms;\n this.booking_timezone = this.booking.timezone;\n this.bookingDateTz = this.booking.startDateTz;\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n } else {\n this.booking_date = data.booking_date || defaultStartTz.ms;\n this.booking_timezone = data.booking_timezone || defaultLocalTimezone;\n this.bookingDateTz = new DateTZ({ date: this.booking_date, is_local_tz: false, building_tz: this.booking_timezone });\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n }\n \n this.delivery_time = typeof data.delivery_time === 'number' ? data.delivery_time : 0;\n this.status = data.status || 'accepted';\n this.charge_code = data.charge_code || data.code;\n this.notes = data.notes;\n this.kitchen = data.kitchen instanceof Array ? !!data.kitchen.length : data.kitchen;\n this.pantry = data.pantry instanceof Array ? !!data.pantry.length : data.pantry;\n this.symbol = data.symbol || 'USD';\n this.items = (data.items || [])\n .map(item => (item.items ? new CateringCategory(item) : new CateringItem(item)))\n .filter(item => !!item.amount);\n }\n\n /** Special Case, check if a full booking is attached */\n public get hasBookingAttached(): boolean {\n return !!this.booking;\n }\n\n /** Display string for the types of items in the order */\n public get type(): string {\n let type = '';\n /* istanbul ignore else */\n if (this.kitchen) type += 'Kitchen';\n /* istanbul ignore else */\n if (this.pantry) {\n /* istanbul ignore else */\n if (type) type += ' + ';\n type += 'Pantry';\n }\n return type;\n }\n\n /** Total cost of the order */\n public get total(): number {\n return this.items.reduce((total, item) => total + (item.total || 0), 0);\n }\n\n /** Total number of items in the order */\n public get item_count(): number {\n return this.items.reduce((total, item) => total + (item.amount || 0), 0);\n }\n\n public get deliver_date(): DateTZ {\n return (this.bookingDateTz || this.booking?.startDateTz).addValue({ minutes: this.delivery_time })\n }\n\n /** Display string for the delivery time of the order (short version) */\n public get deliver_at(): string {\n return this.deliver_date.formatDate('h:mm a');\n }\n\n /** Display string for the delivery time of the order */\n public get deliver_at_time(): string {\n return this.deliver_date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Display string for the delivery date of the order */\n public get deliver_on_date(): string {\n return this.deliver_date.formatDate('dd MMM yyyy');\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): CateringOrder {\n return new CateringOrder(this.toJSON());\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringOrder): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._server_names;\n // Remove local public members\n delete obj.booking;\n delete obj.loading;\n delete obj.bookingDateTz;\n\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substr(1)] || key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n\n return obj;\n }\n}\n","import { CateringItem } from './catering-item.class';\n\nexport const mergeCateringItemWithFormData = (existing: CateringItem, override: any) =>\n new CateringItem({\n ...(existing instanceof CateringItem ? existing.toJSON() : existing),\n ...override\n });\n","export * from './catering-item.class';\nexport * from './catering-category.class';\nexport * from './catering-menu.service';\nexport * from './catering-order.class';\nexport * from './catering-categories.service';\nexport * from './catering-items.service';\nexport * from './catering.utilities';\nexport * from './catering-notes.service';\n","import { Injectable } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CloseDialogService {\n private dialogRefMap = new Map>();\n\n constructor() { }\n\n // Register a dialog with its ID\n registerDialog(id: string, dialogRef: MatDialogRef): void {\n this.dialogRefMap.set(id, dialogRef);\n }\n\n // Close a specific dialog by ID\n closeDialog(id: string): void {\n const dialogRef = this.dialogRefMap.get(id);\n if (dialogRef) {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n }\n }\n\n // Optional: Close all dialogs\n closeAllDialogs(): void {\n this.dialogRefMap.forEach((dialogRef, id) => {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n });\n }\n}\n\nexport enum DialogIds {\n MeetingDetails = 'meetingDetailsDialogId',\n BookingConfirmation = 'bookingConfirmationDialogId',\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapseService {\n private collapseSubject = new BehaviorSubject(false);\n collapse$ = this.collapseSubject.asObservable();\n\n collapsePanel() {\n this.collapseSubject.next(false);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class DataCommonModule {}\n","import { Injectable } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n Subscription\n} from 'rxjs';\n\nimport {\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\n/** List of keys that cannot be in a combination by themselves or with each other */\nconst INVALID_STANDALONE_KEYS: string[] = ['control', 'shift', 'alt', 'meta', 'os'];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class HotkeysService {\n /** Map of subjects which store press states of keys */\n private keydown_states: HashMap> = {};\n /** Map of obserers for key state subjects */\n private keydown_observers: HashMap> = {};\n /** List of keys at the end of a combination */\n private combo_end: string[] = [];\n /** List of registered hotkey combinations */\n private registered_combos: string[][] = [];\n /** Counter for the number of keydown events. Used for checking order of key presses */\n private counter: number = 0;\n /** Last key code to be pressed */\n private last_down: string;\n\n constructor() {\n window.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.last_down !== code) {\n /* istanbul ignore else */\n if (!this.keydown_states[code]) {\n this.keydown_states[code] = new BehaviorSubject(null);\n this.keydown_observers[code] = this.keydown_states[code].asObservable();\n }\n this.keydown_states[code].next(++this.counter);\n /* istanbul ignore else */\n if (this.combo_end.indexOf(code) >= 0) {\n event.preventDefault();\n }\n this.last_down = code;\n }\n });\n\n window.addEventListener('keyup', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.keydown_states[code]) {\n this.keydown_states[code].next(null);\n }\n /* istanbul ignore else */\n if (this.last_down === code) {\n this.last_down = null;\n }\n });\n }\n\n /**\n * Listen to the given key combination\n * @param combo Array of key codes to listen to or a hotkey string e.g. `Alt+Shift+KeyK`\n * @param next Callback for combination presses\n */\n public listen(combo: string | string[], next: () => void): Subscription {\n combo = (combo instanceof Array ? combo : combo.split('+'));\n const combination: string[] = combo.map(i => this.mapKey(i.toLowerCase()));\n /* istanbul ignore else */\n if (combination.length > 0 && this.validCombination(combination)) {\n this.registered_combos.push(combination);\n const last_key = combination[combination.length - 1];\n /* istanbul ignore else */\n if (!this.keydown_states[last_key]) {\n this.keydown_states[last_key] = new BehaviorSubject(null);\n this.keydown_observers[last_key] = this.keydown_states[last_key].asObservable();\n }\n this.updateCombinationEndList();\n return this.keydown_observers[last_key].subscribe((count) => {\n /* istanbul ignore else */\n if (count) {\n const presses: number[] = [];\n /* istanbul ignore else */\n if (combination.length > 0) {\n // Check that keys are pressed\n for (const key of combination) {\n const state = this.keydown_states[key];\n presses.push(state ? state.getValue() || -1 : -1);\n }\n // Check that keys are pressed in the correct order\n for (let i = 0; i < combination.length - 1; i++) {\n if (presses[i] > presses[i + 1]) {\n return;\n }\n }\n }\n const total = presses.reduce((a, v) => a + (v > 0 ? 1 : -1), 0);\n /* istanbul ignore else */\n if (total >= combination.length) {\n next();\n }\n }\n });\n }\n return null;\n }\n\n /**\n * Map key codes with multiple versions to simple form\n * @param code Code to transform\n */\n private mapKey(code: string): string {\n /* istanbul ignore else */\n if (code.indexOf('alt') >= 0 || code.indexOf('shift') >= 0 || code.indexOf('control') >= 0) {\n return code.replace('left', '').replace('right', '');\n }\n return code;\n }\n\n /**\n * Update the list of the last keys in combinations to allow for prevent default actions on pre-existing hotkeys\n */\n private updateCombinationEndList(): void {\n const key_list = [];\n for (const combo of this.registered_combos) {\n this.combo_end.push(combo[combo.length - 1]);\n }\n this.combo_end = unique(key_list);\n }\n\n /**\n * Checks if the given hotkey combination is allowed and valid\n * @param combo Array of key codes\n */\n private validCombination(combo: string[]): boolean {\n let non_meta = 0;\n for (const key of combo) {\n /* istanbul ignore else */\n if (INVALID_STANDALONE_KEYS.indexOf(key) < 0) {\n non_meta++;\n }\n }\n return non_meta > 0;\n }\n}\n","export * from './location.class';\nexport * from './location.service';\n","import { HashMap } from '@mckinsey-converge/base';\n\nimport { Organisation } from '../organisation/organisation.class';\nimport {\n ServiceLike,\n ServiceManager\n} from '../service-manager.class';\nimport { BuildingLevel } from '../organisation/level.class';\n\nexport class MapLocation {\n /** ID of the element on the associated map */\n public readonly id?: string;\n /** Name of the location */\n public readonly name?: string;\n /** X coordinate of the location */\n public readonly x?: number;\n /** Y coordinate of the location */\n public readonly y?: number;\n /** Level details for the location */\n public readonly level: BuildingLevel;\n /** Whether the position is fixed */\n public readonly fixed: boolean;\n /** Accuracy of the location when not fixed */\n public readonly confidence?: number;\n /** Whether location is at a desk */\n public readonly at_desk?: boolean;\n /** Whether location is set */\n public readonly empty: boolean;\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(MapLocation);\n }\n\n /** Display string for the building and level of the location */\n public get display(): string {\n const service = ServiceManager.serviceFor(Organisation);\n if (!service) {\n return this.level.name;\n }\n const bld = service.buildings.find((bld) => bld.id === this.level.building_id);\n return bld ? `${bld.name}, ${this.level.name}` : this.level.name;\n }\n\n /** Whether location is in a different building from the active one */\n public get in_another_building(): boolean {\n const service = ServiceManager.serviceFor(Organisation);\n return service && service.building.id !== this.level.building_id;\n }\n\n constructor(raw_data: HashMap) {\n this.id = raw_data.id || raw_data.map_id || raw_data.desk_id;\n this.name = raw_data.name || '';\n this.x = raw_data.x\n ? Math.floor(this.normalise(raw_data.x, raw_data.x_max || 10000) * 10000)\n : null;\n this.y = raw_data.y\n ? Math.floor(this.normalise(raw_data.y, raw_data.x_max || 10000) * 10000)\n : null;\n const service = ServiceManager.serviceFor(Organisation);\n this.level =\n raw_data.level instanceof BuildingLevel\n ? raw_data.level\n : service\n ? service.levelWithID(raw_data.level)\n : new BuildingLevel(raw_data.level);\n this.fixed = this.x === null && this.y === null;\n this.confidence = Math.max(5, Math.min(15, raw_data.confidence || 0));\n this.at_desk = this.id && this.id.indexOf('area-') === 0;\n this.empty = !(this.name && this.level && (this.id || this.x || this.y));\n }\n\n /** Normalise the given value within the max */\n private normalise(value: number, max: number): number {\n return value / (max * 1.0);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { MapLocation } from './location.class';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(MapLocation, this);\n this._name = 'Location';\n this._api_route = 'people';\n }\n\n public add(...args): never {\n throw new Error('Create not allowed for location service')\n }\n\n public update(...args): never {\n throw new Error('Update not allowed for location service')\n }\n\n public delete(...args): never {\n throw new Error('Delete not allowed for location service')\n }\n\n public process(item: HashMap) {\n return new MapLocation(item) as any;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { BookingRule } from '../bookings';\nimport { ServiceManager } from '../service-manager.class';\n\nexport interface BuildingCity {\n timezone: string\n name: string\n}\n\nexport interface IBuildingRoleUser {\n name: string;\n email: string;\n phone: string;\n}\n\nexport interface LockerMap {\n [zone: string]: {\n [area: string]: {\n [type: string]: (string | boolean)[][];\n };\n };\n}\n\nexport interface ICoordinates {\n longitude: number;\n latitude: number;\n}\n\nexport interface LevelFeature {\n id: string;\n level_id: string;\n name: string;\n}\n\nexport interface BookingRuleDetails {\n /** List of booking rules details for the building */\n readonly rules: readonly string[];\n /** Custom booking rules for the map */\n readonly map_rules?: readonly string[];\n /** Custom booking rules for the map */\n readonly other_rules?: readonly string[];\n /** Contact email address for the building */\n readonly contact?: string;\n /** Information string to display before the rule listings */\n readonly info?: string;\n /** Link for more details */\n readonly link?: { url?: string, name?: string };\n /**\n * Allow buildings to define their own rules formats where needed or for special messages.\n */\n readonly custom_html?: string;\n}\n\nexport class Building extends BaseDataClass {\n /** Service for managing buildings */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Engine Zone ID for the building */\n public readonly zone_id: string;\n /** Organisation Code for the building */\n public readonly code: string;\n /** Geographical address of the building */\n public readonly address: string;\n /** Details about the booking rules for the building */\n public readonly booking_details: BookingRuleDetails;\n /** Details about the booking rules for the building */\n public readonly booking_rules: HashMap;\n /** Number of hour before a booking catering is restricted */\n public readonly catering_restricted_from: number;\n /** Currency code for the country assoicated with the building */\n public readonly currency: string;\n /** Map of fields that are required on the form */\n public readonly required: HashMap;\n /** IANA timezone database string for the location the building resides */\n public readonly timezone: string;\n /** Whether catering is available in this building */\n public readonly has_catering: boolean;\n /** ID of the system used for the holding bay */\n public readonly holding_bay: string;\n /** ID of the system used for standalone visitors bookings */\n public readonly visitor_space: string;\n /** List of zones to determine sort order spaces */\n public readonly sort_order: readonly string[];\n /** Searchable map features */\n public readonly searchables: readonly LevelFeature[];\n /** List of available extras for the building */\n public readonly extras: readonly Identity[];\n /** List of available extra equipment for loan at the building */\n public readonly loan_items: readonly Identity[];\n /** List of available levels for the building */\n public readonly levels: readonly BuildingLevel[];\n /** The city the building belongs in **/\n public readonly city: string;\n\n public readonly catering_hours: { readonly start: number, readonly end: number };\n /** Map of custom settings for the building */\n private _settings: HashMap;\n /** Map of roles and list of the associated users */\n private _roles: HashMap;\n /** Map of the locker ID arrays */\n private _lockers: LockerMap;\n /** Map of important system ids for the building */\n private _systems: HashMap;\n /** Map of important phone numbers for the building */\n private _phone_numbers: HashMap;\n /** Globe coordiates for the build */\n private _location: ICoordinates;\n /** List of zones associated with the building */\n public readonly zones: readonly string[];\n\n constructor(raw_data: HashMap) {\n super(raw_data);\n const settings = raw_data.settings || {};\n const disc_info = settings.discovery_info || {};\n this.zone_id = raw_data.zone_id || raw_data.zone;\n this.extras = (raw_data.extras || disc_info.extras || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.loan_items = (raw_data.loan_items || disc_info.loan_items || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.levels = (raw_data.levels || disc_info.levels || []).map(i => new BuildingLevel({\n ...i,\n building_id: this.id\n }));\n this._roles = raw_data.roles || disc_info.roles || {};\n this._lockers = raw_data.lockers || raw_data.locker_structure || disc_info.locker_structure || {};\n this._systems = raw_data.systems || disc_info.systems || {};\n this._settings = settings;\n this._phone_numbers = raw_data.phone_numbers || disc_info.phone_numbers || {};\n this._location = raw_data.location || disc_info.location || { longitude: null, latitude: null };\n this.catering_hours = raw_data.catering_hours || disc_info.catering_hours || settings.catering_hours || {\n start: 7,\n end: 20\n };\n const searchables = [];\n if (raw_data.neighbourhoods) {\n for (const lvl in raw_data.neighbourhoods) {\n if (raw_data.neighbourhoods.hasOwnProperty(lvl)) {\n const lvl_features = raw_data.neighbourhoods[lvl] || {};\n for (const feature in lvl_features) {\n if (lvl_features.hasOwnProperty(feature)) {\n searchables.push({\n id: lvl_features[feature],\n name: feature,\n level_id: lvl\n });\n }\n }\n }\n }\n }\n this.searchables = searchables;\n this.code = raw_data.code || disc_info.code || settings.code || '';\n this.address = raw_data.address || disc_info.address || settings.address || '';\n this.booking_details = raw_data.booking_details || disc_info.booking_details || settings.booking_details || {};\n this.booking_rules = raw_data.booking_rules || disc_info.booking_rules || settings.booking_rules || {};\n this.catering_restricted_from = raw_data.catering_restricted_from || disc_info.catering_restricted_from || settings.catering_restricted_from || 0;\n this.currency = raw_data.currency || disc_info.currency || settings.currency || 'USD';\n this.required = raw_data.required || disc_info.required || settings.required || {};\n if (disc_info.requires_equipment_code) {\n this.required.equipment_code = true;\n }\n if (disc_info.requires_expected_attendees) {\n this.required.expected_attendees = true;\n }\n this.timezone = raw_data.timezone || disc_info.timezone || settings.timezone || '';\n this.has_catering = raw_data.has_catering || disc_info.has_catering || settings.has_catering || false;\n this.holding_bay = raw_data.holding_bay || disc_info.holding_bay || settings.holding_bay || '';\n this.visitor_space = raw_data.visitor_space || disc_info.visitor_space || settings.visitor_space || '';\n this.sort_order = raw_data.sort_order || disc_info.sort_order || settings.sort_order || [];\n this.city = raw_data.city || disc_info.city || 'No City';\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings) || getItemWithKeys(['discovery_info', ...keys], this._settings);\n return value;\n }\n\n /**\n * Get list of users with the associated role\n * @param name Role to find users for\n */\n public role(name: string): IBuildingRoleUser[] {\n return [...(this._roles[name] || [])];\n }\n\n /**\n * Get list of the names of available user role lists\n */\n public get role_names(): string[] {\n return Object.keys(this._roles).filter(i => this._roles.hasOwnProperty(i));\n }\n\n /** Map of the locker ID arrays */\n public get lockers(): LockerMap {\n return { ...(this._lockers || {}) };\n }\n\n /** Map of important system ids for the building */\n public get systems(): HashMap {\n return { ...(this._systems || {}) };\n }\n\n /** Map of important phone numbers for the building */\n public get phone_numbers(): HashMap {\n return { ...(this._phone_numbers || {}) };\n }\n\n /** Real coordinates */\n public get location(): ICoordinates {\n return { ...this._location };\n }\n\n /**\n * Get search map feature for the given level ID\n * @param level_id ID of level to grab features for\n */\n public featuresForLevel(level_id: string): LevelFeature[] {\n return (this.searchables || []).filter(i => i.level_id === level_id);\n }\n\n /**\n * Building objects are readonly and cannot be changed\n */\n public async save(): Promise {\n throw new Error('Building objects are readonly and cannot be changed');\n }\n\n /**\n * Building objects are readonly and cannot be deleted\n */\n public async delete(): Promise {\n throw new Error('Building objects are readonly and cannot be deleted');\n }\n}\n","export * from './building.class';\nexport * from './level.class';\nexport * from './organisation.class';\nexport * from './organisation.service';\n","import { HashMap } from 'libs/base/src/lib/types.utilities';\n\n/** Building Level data */\nexport class BuildingLevel {\n /** ID of the building level zone */\n readonly id: string;\n /** ID of the building zone associated with the level */\n readonly building_id: string;\n /** Name of the level */\n readonly name: string;\n /** Number or short identifier of the level */\n readonly short_name: string;\n /** Map URL for the level */\n readonly map_url: string;\n /** Usage type for the level */\n readonly type: 'staff' | 'client' | 'any';\n /** Setting for the level */\n readonly settings: HashMap;\n\n constructor(_data: HashMap = {}) {\n this.id = _data.id || _data.level_id || '';\n this.building_id = _data.bld_id || _data.building_id || '';\n this.name = _data.name || _data.level_name || '';\n const lower_name = this.name.toLowerCase();\n const num = lower_name.indexOf('level') >= 0 ? lower_name.replace(/ ?level ?/gi, '') : lower_name.substr(0, 1).toUpperCase();\n this.short_name = _data.short_name || num || '';\n this.map_url = _data.map_url || '';\n this.type = _data.type || _data.floor_type || 'any';\n this.settings = _data.settings;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap\n} from '@mckinsey-converge/base';\n\n/* istanbul ignore next */\n\nexport class Organisation extends BaseDataClass {\n /** List of available building zone ids for the organisation */\n public readonly available_buildings: readonly string[];\n /** Map of custom settings for the building */\n private _settings: HashMap;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this._settings = raw_data.settings || {};\n this.available_buildings = (raw_data.settings?.discovery_info?.buildings || []).map(\n (bld) => bld.zone_id\n );\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings);\n return value;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { Organisation } from './organisation.class';\nimport { Building } from './building.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { first } from 'rxjs/operators';\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { UsersService } from '../users';\nimport { SettingsService } from '../settings.service';\nimport { Observable, Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OrganisationService extends BaseAPIService {\n /** Organisation data for the application */\n private _organisation: Organisation;\n /** Actively displayed building */\n private _active_building: string;\n\n private _spaceTypesSubject: Subject = new Subject();\n\n constructor(\n protected _composer: ComposerService,\n private _service: ApplicationService,\n private _users: UsersService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Organisation, this);\n ServiceManager.setService(Building, this);\n this._name = 'Organisation';\n this._api_route = 'zones';\n this.set('buildings', []);\n this.set('active_building', null);\n this._users.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /**\n * Add is not available on organisation service\n */\n public async add(form_data: HashMap, query_params?: HashMap): Promise {\n throw new Error('Add is not available on the organisation service');\n }\n\n /**\n * Update is not available on organisation service\n */\n public async update(\n id: string,\n form_data: HashMap,\n query_params?: HashMap\n ): Promise {\n throw new Error('Update is not available on the organisation service');\n }\n\n /**\n * Delete is not available on organisation service\n */\n public async delete(id: string): Promise {\n throw new Error('Delete is not available on the organisation service');\n }\n\n /**\n * Get list of levels for the given building ID\n * @param bld_id Building ID\n */\n public levels(bld_id: string): readonly BuildingLevel[] {\n return (this.buildings.find((i) => i.id === bld_id) || ({} as Building)).levels;\n }\n\n /**\n * Get a setting from the organisation or active building\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string) {\n return this.building.setting(key) || this._organisation.setting(key);\n }\n\n /** Active building */\n public get building(): Building {\n return this.buildings.find((i) => i.id === this._active_building);\n }\n\n /** List of types of spaces */\n public get space_types(): Identity[] {\n return this.get('space_types') || [];\n }\n\n public set building(bld: Building) {\n if (bld instanceof Building) {\n this._active_building = bld.id;\n } else {\n this._active_building = bld;\n }\n this.set('active_building', this.building);\n this.loadSpaceTypes();\n localStorage.setItem('PlaceOS.building', this._active_building);\n localStorage.setItem('CONCIERGE.timezone', bld.timezone);\n }\n\n /** List of buildings for the organisation */\n public get buildings(): Building[] {\n return this.get('buildings') || [];\n }\n\n /**\n * Get list of available equipment\n * @param id ID of the building to get the list from. i.e. Defaults to the active building\n */\n public getExtras(id: string, bld_id?: string) {\n const bld = this.buildings.find((i) => i.id === bld_id) || this.building;\n if (bld && id) {\n return bld.extras.filter((i) => `${i.id}`.indexOf(id) >= 0);\n }\n return [];\n }\n\n /**\n * Get the first level matching the list of given IDs\n * @param ids List of ID to search with\n */\n public levelWithID(ids: string | string[]): BuildingLevel {\n const list = ids instanceof Array ? ids : [ids];\n const bld_list = this.buildings;\n for (const id of list) {\n for (const bld of bld_list) {\n for (const lvl of bld.levels) {\n if (lvl.id === id) {\n return lvl;\n }\n }\n }\n }\n return null;\n }\n\n /**\n * Initialise service data\n */\n protected async load(): Promise {\n /* istanbul ignore else */\n if (localStorage) {\n this._active_building = localStorage.getItem(`${this.settingsService.frontend.toUpperCase()}.building`);\n }\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.organisation = { message: 'Loading organisation data', state: 'loading' };\n await this.loadOrganisation();\n loading.organisation = { message: 'Loading organisation data', state: 'complete' };\n loading.buildings = { message: 'Loading building data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadBuildings();\n loading.buildings = { message: 'Loading building data', state: 'complete' };\n loading.levels = { message: 'Loading building floor data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadLevels();\n loading.levels = { message: 'Loading building floor data', state: 'complete' };\n this._service.set('loading', loading);\n loading.space_types = { message: 'Loading space type data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadSpaceTypes();\n loading.space_types = { message: 'Loading space type data', state: 'complete' };\n this._service.set('loading', loading);\n const user = this._users.current;\n\n if (user) {\n const id = localStorage.getItem('PlaceOS.building');\n const building = this.buildings.find(bld => id && bld.id === id) || this.buildings.find((bld) => bld.code === user.location);\n if (building) {\n this._active_building = building.id;\n this.set('active_building', building);\n } else if(this.building) {\n // This conditional solves a problem of infinite loop when user building doesn't exist.\n this._active_building = this.building.id;\n this.set('active_building', this.building);\n }\n }\n }\n\n /**\n * Load organisation data for application\n */\n public async loadOrganisation(): Promise {\n const org_data = await this.query({ tags: 'org', engine: true });\n this._organisation = new Organisation(org_data[0]);\n this.set('organisation', this._organisation);\n return this._organisation;\n }\n\n /**\n * Load building data for the organisation already stored in the service..\n */\n public async loadBuildings(): Promise {\n return this.loadBuildingsWithOrg(this._organisation);\n }\n\n /**\n * Load building data for the organisation passed.\n */\n public async loadBuildingsWithOrg(organisation: Organisation): Promise {\n const bld_data = await this.query({ tags: 'building', engine: true, limit: 1000 });\n const buildings = (bld_data as HashMap[])\n .map((i) => new Building(i))\n .filter((bld) => organisation.available_buildings.includes(bld.id));\n this.set('buildings', buildings);\n /* istanbul ignore else */\n if (!this._active_building && buildings && buildings.length > 0) {\n this._active_building = buildings[0].id;\n }\n return buildings;\n }\n\n /**\n * Load level data for the buildings\n */\n public async loadLevels(): Promise {\n const lvl_data = await this.query({ tags: 'level', engine: true, limit: 1000 });\n const levels = (lvl_data as HashMap[]).map((i) => new BuildingLevel(i));\n this.set('levels', levels);\n return levels;\n }\n\n /**\n * Load space type data for the buildings\n */\n public async loadSpaceTypes(): Promise {\n const type_data = await this.query({ tags: 'room', engine: true, limit: 1000, building_id: this._active_building });\n const types = (type_data as HashMap[]).map((i) => ({ id: i.id, name: i.name }));\n this.set('space_types', types);\n // Emit the updated space_types\n this._spaceTypesSubject.next(types);\n }\n\n /**\n * Observable to listen for changes in space_types\n */\n public get spaceTypesObservable(): Observable {\n return this._spaceTypesSubject.asObservable();\n }\n\n public getOrganizationFiltersByRoomType(key: string) {\n if (!this._organisation) {\n return {}\n }\n const discovery_info = this._organisation.setting('discovery_info')\n\n return discovery_info && discovery_info[key] ? discovery_info[key] : {}\n }\n\n public getRoomTypeSubsetDDOptions(type:string) {\n const filters = this.getOrganizationFiltersByRoomType(type) || {}\n return [...Object.keys(filters).map((key) => {\n const display = filters[key].toString();\n return {\n display,\n value: key,\n meta: {}\n }\n }) ];\n }\n\n\n\n /**\n * The function will generate filter options, excluding London. London has its own set of options as per the request. \n * The filter options pertain to a subset of room type options managed by the room admin module.\n * @returns filterOptions: filter options for day view space type filter\n */\n public getRoomFilterOptionsPerLocation() {\n let internalSubSet = this.getRoomTypeSubsetDDOptions('internal_room_types');\n if(this.building.name.toLowerCase().includes('london')) {\n internalSubSet = internalSubSet.filter(e => !e.value.includes('meeting') && !e.value.includes('partner') );\n }\n const filterOptions = [];\n internalSubSet.forEach(el => filterOptions.push({name: el.display, id: el.value} ) ); \n return filterOptions\n }\n\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseAPIService } from './base.service';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class PaginatedAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}, config: { url?: string } = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = query_params.cache || 1000;\n delete query_params.cache;\n }\n const query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = config && config.url ? `${config.url}${query ? '?' + query : ''}` : `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: IEngineResponse;\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * \n * @param query_params \n * @param config \n * @returns \n */\n queryHoldingBay(query_params: HashMap = {}, config: { url?: string } = {}):Observable {\n const query = toQueryString(query_params);\n const url = `${config.url}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );\n }\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse{\n let result: IEngineResponse;\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n return result;\n }\n \n\n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => {\n result = this.process(d); \n },\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { FormGroup } from \"@angular/forms\";\nimport { HashMap } from \"@mckinsey-converge/base\"\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\"\n\nexport enum RecurrencePeriod {\n LIST = 'list',\n DAILY = 'daily',\n WEEKLY = 'weekly',\n //RELATIVE_MONTHLY = 'relativeMonthly', for the moment we will only support absoluteMonthly\n ABSOLUTE_MONTHLY = 'monthly'\n}\n\nexport enum DaysOfWeek {\n SUNDAY = 'sunday',\n MONDAY = 'monday',\n TUESDAY = 'tuesday',\n WEDNESDAY = 'wednesday',\n THURSDAY = 'thursday',\n FRIDAY = 'friday',\n SATURDAY = 'saturday'\n\n}\n\nexport enum SeriesAction {\n EDIT = 'edit',\n CLONE = 'clone'\n}\n\nexport enum BookingAction {\n CLONE = 'booking_clone',\n EDIT = 'booking_edit'\n}\n\nexport interface WeekDays {\n id: string;\n active: boolean;\n day_index: number;\n full_name: string;\n}\n\nexport interface RepeatPeriod {\n id: RecurrencePeriod;\n label: string\n}\n\nexport enum RepeatsOn {\n PATTERN = 'pattern',\n DATE = 'date'\n}\n\nexport interface RecurrenceType {\n type: RepeatsOn;\n label: string;\n}\n\nexport interface RecurrenceDetails {\n period: RecurrencePeriod,\n end: DateTZ,\n list: Array\n interval: number\n}\n\nexport interface RecurrenceRecurringDetails extends RecurrenceDetails {\n start: number\n}\n\nexport const recurrencePeriodToDurationType = (period: RecurrencePeriod) =>{\n switch (period) {\n case RecurrencePeriod.DAILY:\n return 'days'\n case RecurrencePeriod.WEEKLY:\n return 'weeks' \n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return 'months' \n default:\n return 'days'\n }\n}\n\n/**\n * Generate weekdays from monday to saturday\n */\nexport const generateWeekDays = (date: number, params: { building_tz?: string } = {}): Array=> {\n const { building_tz } = params;\n let start_week = DateNow(new Date()).startOfValue('week').addValue({days : 1}); //set monday as start of week\n const week_days: Array = []\n for (let i = 1; i <= 7; i++) {\n const activeDate = new DateTZ({date, building_tz, is_local_tz: false })\n const active = activeDate.dateWeekday === i\n const full_name = start_week.formatDate('EEEE')\n const day_index = i === 7 ? 0 : i //Sunday must be indexed as day 0\n week_days.push({id: full_name.substring(0, 1), active, day_index, full_name: full_name.toLocaleLowerCase()});\n start_week = start_week.addValue({ days : 1 });\n }\n return week_days\n}\n\nexport const getFirstDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isBeforeDate(b) ? a : b; });\n}\n\nexport const getLastDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isAfterDate(b) ? a : b; });\n}\n\nexport const recurrenceDetails = (recurr: RecurrenceDetails): string => {\n const end = getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `Occurs Every ${period} until ${end}`\n }else{\n return `Occurs Every ${recurr.interval} ${period}s until ${end}`\n }\n } \n \n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `Occurs on Specific Dates until ${getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')}`\n default:\n return ''\n }\n}\n\nexport const recurrenceRecurringDetails = (recurr: RecurrenceRecurringDetails): string => {\n const end = recurr.end\n const start = new DateTZ({ date: recurr.start })\n\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `occurs every ${period} effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }else{\n return `occurs every ${recurr.interval} ${period}s effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }\n }\n\n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `occurs on Specific Dates`\n default:\n return ''\n }\n}\n\nexport const handleRecurrenceFields = (data: HashMap) => {\n if(data.is_recurrent){\n if(data.recurrence_period !== RecurrencePeriod.LIST){\n delete data.recurrence_starts\n delete data.recurrence_endTz\n if(data.recurrence_period !== RecurrencePeriod.WEEKLY){\n delete data.recurrence_days\n }\n } else if(data.recurrence_period){\n data.recurrence_list = [...(data.recurrence_starts || []).map((date: DateTZ) => date.startOfValue('minute').seconds)]\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.recurrence_days\n }\n delete data.is_recurrent\n }else{\n delete data.recurrence_period;\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.is_recurrent\n delete data.recurrence_exceptions\n delete data.recurrence_days\n }\n\n return data\n}\n\n/** Removes expired occurrences and updates start and end dates when cloning a series */\nexport const removeExpiredOcurrences = (form: FormGroup) =>{\n if(form.controls.action?.value === SeriesAction.CLONE ){\n const tz = form.controls.space_list.value[0].timezone\n const date_now = new DateTZ({ is_local_tz: false, building_tz: tz });\n const occurrences = form.controls.recurrence_starts.value.filter((date: DateTZ) =>\n date_now.isBeforeDate(date, 'day') || date_now.isSameDate(date, 'day')\n )\n form.controls.recurrence_starts.setValue(occurrences)\n const { start, end } = setStartAndEndDateFromArray(occurrences, tz)\n form.controls.dateTz.setValue(start)\n form.controls.recurrence_endTz.setValue(end)\n }\n}\n\n/** \n * Returns starts and end dates from an array of dates in milliseconds \n **/\n export const setStartAndEndDateFromArray = (dates: Array, tz: string): {start: DateTZ, end: DateTZ} =>{\n if(dates.length !== 0){\n return {\n start: dates.sort((d1, d2) => d1.ms - d2.ms)[0] ,\n end: dates.sort((d1, d2) => d2.ms - d1.ms)[0]\n }\n }\n //if the dates array is empty set the start and end dates as the current and next day\n const now = DateNow(new Date()).toZone(tz)\n return {start: now, end: now.addValue({days: 1})}\n}\n\nexport const setRecurrenceStartsTime = (form: FormGroup) => {\n const { recurrence_starts, dateTz } = form.value\n const list = (recurrence_starts || []).map((date: DateTZ) => date.setValue({hour: dateTz.dateHour, minute: dateTz.minutes}))\n form.controls.recurrence_starts.setValue(list)\n}","export * from './report.class'\nexport * from './reports.service'\n","import { CurrencyPipe } from '@angular/common';\n\nimport {\n csvToJson,\n downloadFile,\n HashMap,\n humaniseDuration,\n jsonToCsv,\n} from '@mckinsey-converge/base';\n\nimport { ServiceManager } from '../service-manager.class';\nimport { Space } from '../spaces';\nimport { Organisation } from '../organisation';\n\nexport class Report {\n /** Type of report */\n public readonly type: string;\n /** List of data associated with the report */\n public readonly data: T[];\n\n constructor(raw_data: HashMap = {}) {\n this.type = raw_data.type || '';\n this.data = this.cleanData(raw_data.data);\n }\n\n /** Create report data structure from CSV */\n public static fromCSV(type: string, data: string): Report {\n const csv_json = csvToJson(data);\n return new Report({ type, data: csv_json });\n }\n\n /** Download report data as CSV format */\n public downloadCSV(name: string = 'unnamed.csv'): void {\n downloadFile(name, jsonToCsv(this.data));\n }\n\n /** Download report data as JSON format */\n public downloadJSON(name: string = 'unnamed.json'): void {\n downloadFile(name, JSON.stringify(this.data, undefined, 4));\n }\n\n public formatCancelledBy(email: string) {\n if (email !== null && email !== undefined) {\n let name = email.split('@')[0];\n name = name.split('_').join(' '); //get name from email and convert it to title case\n name = name.replace(/\\w\\S*/g, function (txt) {\n return `${txt\n .charAt(0)\n .toUpperCase()}${txt.substr(1).toLowerCase()}`;\n });\n return name;\n } else {\n return email;\n }\n }\n\n public timeConverter( UNIX_timestamp: number ){\n if(!UNIX_timestamp) return '';\n let a = new Date(UNIX_timestamp * 1000);\n let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n let year = a.getFullYear();\n let month = months[a.getMonth()];\n let date = a.getDate();\n let hour = ((a.getHours() + 11) % 12 + 1);\n let suffix = a.getHours() >= 12 ? \"PM\":\"AM\";\n let min = a.getMinutes() === 0 ? '00':a.getMinutes();\n let time = date + ' ' + month + ' ' + year + ' - ' + hour + ':' + min + ' ' + suffix;\n return time;\n }\n\n private cleanData(data: T[] = []) {\n if (data.length > 0 && this.type === 'day') {\n for (let i = 0; i < data.length; i++) {\n data[i]['booker'] = data[i]['booker'].name;\n data[i]['expected_attendees'] = Object.values(data[i]['expected_attendees'])[0];\n }\n } else if (data.length > 0 && this.type === 'audit') {\n for (let i = 0; i < data.length; i++) {\n data[i]['created_at'] = this.timeConverter(data[i]['created_at']);\n }\n } else if (data.length > 0 && this.type === 'catering') {\n for (let i = 0; i < data.length; i++) {\n data[i]['Cancelled By'] = this.formatCancelledBy(\n data[i]['Cancelled By']\n );\n }\n const fields = Object.keys(data[0]);\n const room_field = fields.find(\n (key) =>\n key.toLowerCase().includes('room') &&\n key.toLowerCase().includes('email')\n );\n const price_field = fields.find((key) =>\n key.toLowerCase().includes('price')\n );\n\n for (let row of data) {\n /* istanbul ignore else */\n const space_service = ServiceManager.serviceFor(Space);\n if (room_field && price_field && space_service) {\n const room = space_service.find(\n row[room_field].toLowerCase()\n );\n const org_service = ServiceManager.serviceFor(Organisation);\n const bld = org_service.buildings.find(\n (bld: { id: any }) =>\n bld.id === room?.level?.building_id\n );\n row[price_field] = new CurrencyPipe('en_us').transform(\n row[price_field] / 100,\n bld?.currency\n );\n }\n /* istanbul ignore else */\n for (let field of fields) {\n row[field] =\n typeof row[field] === 'string'\n ? row[field].replace(/\\,/g, '٫')\n : row[field];\n }\n }\n } else if (this.type === 'bookings') {\n data = data.map((i: HashMap) => {\n const booking = i;\n try {\n if (booking.setup instanceof Object) {\n booking.setup = booking.setup[booking.room_email];\n }\n if (booking.breakdown instanceof Object) {\n booking.breakdown =\n booking.breakdown[booking.room_email];\n }\n booking.setup = humaniseDuration((booking.setup || 0) / 60);\n booking.breakdown = humaniseDuration(\n (booking.breakdown || 0) / 60\n );\n booking.description = (booking.description || '')\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ');\n booking['Meeting Host'] =\n booking.organizer?.name || booking.organizer;\n booking['Booked By'] =\n booking.booked_by?.name ||\n booking.booked_by?.email ||\n '';\n booking.charge_code =\n booking.equipment_codes[booking.room_email] || '';\n // booking.expected_attendees = Object.keys(booking.expected_attendees).map(key => booking.expected_attendees[key]).join(', ');\n booking.attendees = (booking.attendees || [])\n .map((person) => person.name || person.email || person)\n .join('٫ ');\n booking.notes = (booking.notes || [])\n .map((note) =>\n note.author &&\n (note.type === 'description' ||\n note.type === 'private')\n ? `[${note.author}|${note.type}]${note.message\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ')}`\n : ''\n )\n .join(' | ');\n booking.cancelled = booking.isCancelled;\n booking.status = booking.status[booking.room_email] || '';\n booking.company = booking.company.join(', ');\n if (booking.cancelled_by) {\n booking.cancelled_by = this.formatCancelledBy(\n booking.cancelled_by\n );\n }\n booking.cancelled_date = this.timeConverter(booking.cancelled_at_epoch);\n\n } catch (e) {}\n const remove_fields = [\n 'id',\n 'icaluid',\n 'accepted_at',\n 'accepted_by',\n 'check_ins',\n 'changeKey',\n 'created',\n 'booking_type',\n 'edit_history',\n 'end_epoch',\n 'old_attendees',\n 'start_epoch',\n 'expected_attendees',\n 'isAllDay',\n 'isCancelled',\n 'body',\n 'is_free',\n 'lastModifiedDateTime',\n 'locationType',\n 'locations',\n 'organizer',\n 'booked_by',\n 'originalEndTimeZone',\n 'originalStartTimeZone',\n 'room_booking_status',\n 'room_email',\n 'room_emails',\n 'room_id',\n 'sensitivity',\n 'seriesMasterId',\n 'show_as',\n 'notes',\n 'subject',\n 'type',\n 'previous_booking',\n 'catering',\n 'responseStatus',\n 'equipment_codes',\n 'cancelled_at_epoch',\n ];\n for (const field of remove_fields) {\n if (booking[field] !== undefined) {\n delete booking[field];\n }\n }\n const output = {};\n const order = [\n 'title',\n 'start',\n 'end',\n 'location',\n 'Meeting Host',\n 'Booked By',\n 'booked_at',\n 'booked_ahead_by',\n 'all_day',\n 'attendees',\n 'company',\n 'description',\n 'cancelled',\n 'cancelled_by',\n 'cancelled_date',\n ];\n const keys = Object.keys(booking);\n keys.sort((a, b) => {\n const idx_a = order.indexOf(a);\n const idx_b = order.indexOf(b);\n return (\n (idx_a === -1 ? keys.length : idx_a) -\n (idx_b === -1 ? keys.length : idx_b)\n );\n });\n for (const key of keys) {\n output[key] = booking[key];\n }\n return output;\n }) as any;\n }\n return data;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { Report } from './report.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ReportsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Reports';\n this._api_route = 'reports';\n }\n\n protected process(raw_data: any): Report {\n return raw_data instanceof Array\n ? new Report({ data: raw_data })\n : Report.fromCSV('', raw_data);\n }\n}\n","import { Type } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { HashMap } from '@mckinsey-converge/base';\n\n\nexport interface ServiceLike extends HashMap {\n parent: any;\n add: (_: HashMap) => Promise;\n update: (id: string, _: HashMap) => Promise;\n delete: (id: string, params?: HashMap) => Promise;\n task: (id: string, name: string, data: HashMap) => Promise;\n listen: (prop: string) => Observable;\n}\n\nexport interface ServiceProvider {\n provideFor: Type;\n useValue: T;\n}\n\nexport class ServiceManager {\n /** Map of available services for child classes */\n private static _service_list: ServiceProvider[] = [];\n\n /** Set the services used to handle data model requests */\n public static setService(type: Type, service: any): void {\n if (window.debug) {\n (window as any).ServiceManager = this._service_list;\n }\n const index = ServiceManager._service_list.findIndex(provider => provider.provideFor === type);\n if (index >= 0) {\n ServiceManager._service_list.splice(index, 1, { provideFor: type, useValue: service });\n } else {\n ServiceManager._service_list.push({ provideFor: type, useValue: service });\n }\n }\n\n /** Get the services used to handle data model requests */\n public static serviceFor(type: Type): ServiceLike {\n const provider = ServiceManager._service_list.find(provider => provider.provideFor === type) || { useValue: null };\n return provider.useValue;\n }\n\n constructor() {\n throw new Error('ServiceMananger is static class');\n }\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\n\nimport { VERSION } from '@mckinsey-converge/environment';\nimport {\n BaseClass,\n getItemWithKeys,\n HashMap,\n log\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from './service-manager.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ndeclare global {\n interface Window {\n debug: boolean;\n }\n}\n\nexport const SETTINGS_TOKEN = 'settings_service_data';\n\ntype SettingsAppData = T & {\n title: string;\n description: string;\n short_name: string;\n logo_light: {\n type: string;\n src: string;\n background: string;\n }\n logo_dark: {\n type: string;\n src: string;\n background: string;\n }\n heap_io: {\n app_id: number;\n force_ssl: boolean;\n secure_cookie: boolean;\n disable_text_capture: boolean;\n cookie_path: string;\n }\n}\n\nexport interface SettingsData {\n debug: boolean;\n mock: boolean;\n frontend: 'staff' | 'concierge' | 'booking';\n composer: {\n domain: string;\n route: string;\n protocol: string;\n port: string;\n use_domain: boolean;\n local_login: boolean;\n }\n app: SettingsAppData;\n}\n\nexport class SettingsObject {\n constructor(public data: SettingsData) {\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SettingsService extends BaseClass {\n /** Name of the application */\n private _app_name = 'Converge';\n /** List of override settings in order of priority */\n private _overrides = new BehaviorSubject([]);\n /** Mapping of behaviour subjects */\n private _subjects: HashMap> = {};\n /** Mapping of observables */\n private _observables: HashMap> = {};\n /** Which frontend we're in. staff, concierge, or bookings **/\n public readonly frontend: string;\n private _bypass_bookings: boolean = false;\n\n /**\n * @hidden\n */\n public set overrides(value: HashMap[]) {\n this._overrides.next(value);\n }\n\n /** Get observable for key */\n public listen(name: string): Observable {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n return this._observables[name];\n }\n\n /** Update observable value for key */\n public post(name: string, value: T): void {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n this._subjects[name].next(value);\n }\n\n public value(name: string): T {\n return !this._observables[name] ? null : this._subjects[name].getValue();\n }\n\n /** Page title */\n public get title() {\n return this._title.getTitle();\n }\n\n public set title(value: string) {\n this._title.setTitle(`${value} | ${this._app_name}`);\n }\n\n constructor(private _title: Title,\n @Inject(SETTINGS_TOKEN)\n private settings: SettingsObject) {\n super();\n ServiceManager.setService(SettingsService, this);\n const time = new DateTZ({date: VERSION.time});\n const built = DateNow(new Date()).isSameDate(time, 'day')\n ? `Today at ${time.formatDate('h:mma')}`\n : time.formatDate('do MMM yyyy, h:mma');\n const frontend = this.get('frontend') || 'Unknown';\n this.frontend = frontend;\n log('CORE', `${VERSION.semver}`, null, 'debug', true, frontend?.toUpperCase());\n log('APP', `${VERSION.hash} | Built: ${built}`, null, 'debug', true, frontend?.toUpperCase());\n this.init();\n }\n\n /**\n * Initialise the settings\n */\n public async init() {\n if (this.get('debug')) {\n window.debug = true;\n }\n if (this.get('app')?.name) {\n this._app_name = this.get('app').name;\n }\n log('Settings', 'Successfully loaded settings');\n this._initialised.next(true);\n }\n\n /** Whether settings service has initialised */\n public get app_name() {\n return this._app_name;\n }\n\n public get concierge() {\n return this.frontend === 'concierge';\n }\n\n public set bypass_bookings(value: boolean) {\n this._bypass_bookings = value;\n }\n\n public get bypass_bookings() {\n return this._bypass_bookings;\n }\n\n /**\n * Get a setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public get(key: string): any {\n const keys = key.split('.');\n if (keys[0] !== 'app') {\n return getItemWithKeys(keys, this.settings.data);\n }\n const override_settings = this._overrides.getValue();\n for (const override of override_settings) {\n const value = getItemWithKeys(keys.slice(1), override);\n if (value != null) {\n return value;\n }\n }\n return getItemWithKeys(keys, this.settings.data);\n }\n}\n","export * from './space.class';\nexport * from './spaces.service';\nexport * from './space.utilities';\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n} from '@mckinsey-converge/base';\nimport {\n Building,\n BuildingLevel,\n Organisation\n} from '../organisation';\nimport { User } from '../users';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { SpaceRules } from '../bookings/booking.types';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { DateTime } from 'luxon';\n\nexport interface ISpaceAvailabilityOptions {\n /** Start date and time of the availability block */\n dateTz?: DateTZ;\n /** Length of the availability block */\n duration: number;\n /** */\n id?: string;\n /** List of spaces to look at the availability for */\n room_ids?: string;\n /** Whether the spaces looked at should be bookable */\n bookable?: boolean;\n /** List of spaces or zones to ignore */\n ignore?: string;\n /** List of zones to look at the availability for */\n zone_ids?: string | string[];\n /** Whether space bookings should not be returned */\n hide_bookings?: boolean;\n /** Min capacity on the room **/\n capacity?: number\n clear?: boolean;\n /** Length of the setup */\n setup?: number;\n /** Length of the breakdown */\n breakdown?: number;\n /** Hide declined bookings */\n hide_declined?: boolean;\n /** Max capacity on the room **/\n capacity_max?: number\n\n diff_capacity?: boolean\n\n /** Fields to include recurrence in the availability search */\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array\n is_recurrent?: boolean\n is_multiroom?: boolean\n merged?: boolean\n recurrence_days?: Array\n}\n\nexport interface SpaceBookingRuleOptions {\n dateTz: DateTZ;\n duration: number;\n host: User;\n}\n\nexport const OPTION_DEFAULTS: ISpaceAvailabilityOptions = {\n duration: 60\n};\n\nexport interface RecurrenceAvailability {\n /** Unix epoch in seconds */\n readonly date: number;\n /** Whetehr space is available at this time */\n readonly available: boolean;\n}\n\n/**\n * Room Settings Type\n *\n * Exmaple:\n * available: true\n * available_until: 1644344999\n * bookings: []\n * catering: false\n * charge_code: false\n * extra_features: \"meeting_room boardroom\"\n * internal_or_external: \"internal\"\n * map_id: \"08.8.15\"\n * natural_light: false\n * room_booking_screen: true\n * room_name: \"8.15 Meeting\"\n * vc: false\n * recurrence_availability: {\n * date: \"1642596300\",\n * available: false,\n * }\n */\nexport interface RoomSettings {\n // Local room name is required.\n room_name?: string\n // TBD if anything else should be required\n available?: boolean\n available_until?: number\n bookings?: HashMap[]\n catering?: boolean\n charge_code?: boolean\n extra_features?: string\n internal_or_external?: string\n map_id?: string\n natural_light?: boolean\n room_booking_screen?: boolean\n vc?: boolean\n recurrence_availability?: RecurrenceAvailability[]\n equipment_code?: boolean\n external?: boolean\n}\n\n/**\n * List of space features that come from settings.\n *\n * Im sure this list will grow. It is not the most comprehensive list.\n */\nexport enum SpaceFeatures {\n BoardRoom = 'boardroom',\n Catering = 'catering',\n CocktailRoom = 'cocktail',\n ConferencePhone = 'conference_phone',\n ConferenceRoom = 'conference',\n ElectronicWhiteboard = 'whiteboard',\n FlipChart = 'flipchart',\n Glassboard = 'glassboard',\n PartnerOffice = 'partner',\n PhoneBooth = 'phone_booth',\n TheatreRoom = 'theatre',\n TeamRoom = 'team_room',\n VideoConference = 'vc',\n NaturalLight = 'natural_light',\n WirelessContentSharing = 'wireless_content_sharing',\n WorkshopRoom = 'workshop',\n UShapeRoom = 'u_shape',\n Miscellaneous = 'miscellaneous'\n}\n\nexport enum SpaceEquipments {\n conference_phone,\n whiteboard,\n vc,\n flipchart,\n glassboard,\n wireless_content_sharing\n}\nexport enum SpaceStyles {\n boardroom,\n cocktail,\n conference,\n partner,\n theatre,\n team_room,\n // natural_light,\n workshop,\n u_shape,\n miscellaneous\n}\n\nconst EMPTY_ARRAY = [];\n\nexport class Space extends BaseDataClass {\n /** Whether space can be booked by users */\n public readonly bookable: boolean;\n /** People capacity of the space */\n public readonly capacity: number;\n /** Index to force order when sorting multiple spaces */\n public readonly sort_priority: number;\n /** Settings has extensive info displayed in the app. */\n public readonly settings: RoomSettings;\n /** URL for the control interface of the space */\n public readonly support_url: string;\n /** Engine zones associated with the space */\n public readonly zones: readonly string[];\n /** Is the Application concierge */\n public is_concierge: boolean = false;\n /** To allow bookings with rooms for staff calendar view only */\n public allowStaffRoomWithBookings: boolean = false;\n\n /** Simple name == local name being using in seeting.room_name\n\t\t *\n\t\t*/\n public simple_name: string;\n\n /** Room style set of all room style one room has\n * [\"boardroom\", \"cocktail\", \"miscellaneous\", \"natural_light\", \"theatre\", \"u-shape\", \"workshop\"] */\n public room_style: string[] = [];\n\n /** Equipment set of all room equipment one room has\n * [\"conference_phone\", \"whiteboard\", \"vc\", \"flipchart\", \"glassboard\", \"whiteboard\", \"wireless_content_sharing\"] */\n public equipment: string[] = [];\n\n /** Filters has charge code settings for booking and catering */\n public filters: RoomSettings;\n\n /** room_type subset of internal or external rooms */\n public room_type: string[] | string;\n /**\n * Features used in identifying room types.\n *\n * Both features and extra_features are space delimited strings.\n *\n * There is a getter featuresArray that returns the\n * combination of the two as an array.\n */\n public readonly features: string;\n public readonly extra_features: string;\n public map_id: string;\n\n\n /** Service for managing spaces */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Return the rooms' building */\n public get building() {\n return this._service?.buildings.find((bld) => {\n return this.zones.includes(bld.id);\n });\n }\n\n /** Return building timezone */\n public get timezone() {\n return this.building?.timezone;\n }\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = !!settingsService?.concierge;\n this.allowStaffRoomWithBookings = settingsService?.bypass_bookings || false;\n\n const defaultGlobalName = raw_data.name || raw_data.email || 'Meeting Room';\n const defaultSettings = {\n room_name: defaultGlobalName\n }\n /**\n * Duplicate of base-api.class just for readability\n * .name is the full, mckinsey standardised name of the room.\n * You can think of it was what people would call the room when\n * considering every office and room globally.\n *\n * this.name = raw_data.name;\n */\n /**\n * Settings has extensive info displayed in the app.\n * setting.room_name is always used when displaying the room name in the applications\n * setting.room_name is the more office-specific room name, you can think of this as\n * the one people in that office would refer to the room as.\n *\n */\n this.settings = raw_data.settings || defaultSettings;\n this.filters = raw_data?.filters;\n // Room fields\n this.bookable = raw_data.bookable || false;\n this.capacity = raw_data.capacity || 0;\n this.support_url = raw_data.support_url;\n this.zones = raw_data.zones instanceof Array ? raw_data.zones : [];\n // Feature fields\n this.features = raw_data.features || '';\n this.extra_features = raw_data.settings?.extra_features || '';\n\n\t\tthis.room_type = raw_data?.room_type;\n this.simple_name = raw_data?.simple_name;\n this.map_id = raw_data?.map_id || raw_data.settings?.map_id || '';\n this.room_style = raw_data?.room_style || [];\n this.equipment = raw_data?.equipment || [];\n\n }\n\n /**\n * Return the global room name\n * IE LDN-4-408-06\n */\n public get global_name(): string {\n return this.name || ''\n }\n\n /**\n * Return the local room name\n * i.e. 4.08\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.room_name\n */\n public get local_name(): string {\n return this.simple_name || this.name || ''; // this.settings?.room_name\n }\n\n public get street_and_city(): string {\n return this.building ? `${this.building.address}, ${this.building.city}` : '';\n }\n\n /**\n * Return the map_id from settings\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.map_id and use map_id from space modal( after testing over prod)\n */\n // public get map_id(): string {\n // return this?.map_id || this.settings?.map_id || '';\n // }\n\n /** Internal / External status */\n public get internal_or_external(): string {\n const external = this.filters?.external;\n return external ? 'external' : 'internal'; // ( external ? 'external' : this.settings?.internal_or_external ) || 'internal';\n }\n\n /**\n * Works in conjunction with available_until.\n *\n * If a room is bookable that only means you can make a booking but not when.\n * Available indicates that it is available to be booked durring the queried times.\n */\n public get available(): boolean {\n return this.settings?.available ?? false;\n }\n\n public get currently_in_use(): boolean {\n const nowMs = new DateTZ({ date: DateTime.now(), is_local_tz: false, building_tz: this.timezone }).ms;\n const runningBookings = this.settings?.bookings?.filter( bks => {\n const startEpoch = new DateTZ({ date: bks.start_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n const endEpoch = new DateTZ({ date: bks.end_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n return startEpoch <= nowMs && endEpoch >= nowMs;\n })\n // console.log(raw_data.settings.room_name+' : '+ nowMs.ms);\n // console.log('IS IN USER CURRENTLY : ', isinUsernow);\n return !!runningBookings.length;\n }\n\n /** Last returned availability time */\n public get available_until(): number {\n return this.settings?.available_until;\n }\n\n /** Bookings associated with the space */\n public get bookings(): HashMap[] {\n // We should need to care if a room as bookings in Staff\n if (!this.is_concierge && !this.allowStaffRoomWithBookings) {\n return EMPTY_ARRAY;\n }\n\n if (this.settings?.bookings?.length) {\n /**\n * When we're dealing with Concierge the API data arriving is rooms, and those rooms contain booking,\n * but those bookings don't contain a room since the room is the root.\n * In order for Concierge to filter bookings by room we need to reattach this room\n * to each of the bookings, with it's own bookings.\n *\n * It's loopy and kooky but correcting for this pattern is beyond the scope of this refactor.\n */\n const spaceWithBookings = new Space(this.toJSON());\n return this.settings?.bookings.map(b => {\n b.room = spaceWithBookings;\n return b;\n });\n }\n return EMPTY_ARRAY;\n }\n\n /**\n\t\t * Whether space has catering\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.catering and use filters?.catering instead\n\t\t */\n public get has_catering(): boolean {\n return this.filters?.catering || this.settings?.catering || false;\n }\n\n /** Returns an array of the space delimited feature and extra_feature strings.\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove features, extra_features\n */\n public get featuresArray(): (SpaceFeatures | string)[] {\n // (this.simple_name === \"Entresol M-06\" ) && console.log('raw_data : ', this)\n const roomType = Array.isArray(this.room_type) ? this.room_type : [this.room_type]\n const features = [\n ...this.features.split(' '),\n ...this.extra_features?.split(' '),\n\n ...roomType, // required to work with staff>result>filters\n ...this?.room_style,\n ...this?.equipment,\n\n (this.filters?.natural_light) && SpaceFeatures.NaturalLight || undefined, // || this.settings?.natural_light\n // this.settings?.natural_light && SpaceFeatures.NaturalLight || undefined,\n // this.settings?.vc && SpaceFeatures.VideoConference || undefined,\n ].filter(f => !!f).map(f => f.toLowerCase());\n //will be an array... new Set() turns it into a set, but [... ] turns it back into an array again\n return [ ...new Set(features) ];\n }\n\n /** Level in which the space is associated */\n public get level(): BuildingLevel {\n const service = ServiceManager.serviceFor(Organisation);\n return (service ? service.levelWithID(this.zones as any) : null) || new BuildingLevel({});\n }\n\n /**\n * Return the new recurrence_availability from settings\n */\n public get recurrence_availability(): RecurrenceAvailability[] {\n return this.settings?.recurrence_availability || [];\n }\n\n public get availableOccurrences(): number {\n if(this?.recurrence_availability) {\n return this?.recurrence_availability?.filter(recurr => recurr.available).length;\n }\n }\n\n public get totalOccurrences(): number {\n return this?.recurrence_availability.length;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Space {\n return new Space(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): Space {\n const space = { ...this };\n space.settings.bookings = []; // clear out bookings\n return new Space({ ...space, id: null, email: null });\n }\n\n /**\n * Generate the booking rules for space with given options\n * @param options Conditions for generating the space rules\n */\n public rulesFor(options: SpaceBookingRuleOptions): SpaceRules {\n if (!this._service || !this.level) {\n return { auto_approve: true, hide: false };\n }\n\n const building = this.is_concierge ? this.level.building_id : this.building\n\n if (!building) {\n return { auto_approve: true, hide: false };\n }\n const { dateTz, duration, host } = options;\n const rules: SpaceRules = rulesForSpace({\n time: dateTz.ms,\n duration,\n space: this,\n user: host,\n rules: building.booking_rules\n });\n return rules;\n }\n\n /**\n * Whether space can only be booked by request\n * @param options Conditions for checking the space rules\n */\n public byRequest(options: SpaceBookingRuleOptions) {\n const rules = this.rulesFor(options);\n return !rules.auto_approve;\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Space): HashMap {\n return { ...super.toJSON(), settings: { ...this.settings, bookings: [] }, filters: { ...this.filters }, equipment: [ ...this.equipment] };\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport {\n ISpaceAvailabilityOptions,\n Space\n} from './space.class';\nimport { Building } from '../organisation/building.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\n\nexport function availabilityOptionsToQuery(options: ISpaceAvailabilityOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n if (options.dateTz) {\n const date = options.dateTz.startOfValue('minute');\n query.available_from = date.seconds; // Add one second or API will not allow end to end booking\n query.available_to = date.addValue({ minutes: options.duration || 60 }).subtractValue({ seconds: 1 }).seconds;\n\n if (options.setup) query.setup = options.setup ;\n if (options.breakdown) query.breakdown = options.breakdown;\n \n delete query.dateTz;\n delete query.duration;\n }\n\n if (!options.capacity_max) delete query.capacity_max\n\n if (options.hide_declined) query.hide_declined = options.hide_declined;\n query = handleRecurrenceFields(query)\n }\n return query;\n}\n\n/**\n * Compare two spaces to determine order\n * @param first\n * @param second\n */\nexport function sort(first: Space, second: Space, blds: Building[] = []) {\n const bld = blds.find(bld => first.zones.includes(bld.id));\n const bld_b = blds.find(bld => second.zones.includes(bld.id));\n if (bld) {\n if (bld !== bld_b) {\n return (bld.name).localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = first.zones.indexOf(zone_id) >= 0;\n const b_has_zone = second.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n }\n return first.name.localeCompare(second.name);\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { BaseAPIService } from '../base.service';\nimport { ISpaceAvailabilityOptions, Space } from './space.class';\nimport { ApplicationLoadingState, HashMap } from '@mckinsey-converge/base';\nimport { availabilityOptionsToQuery } from './space.utilities';\nimport { ServiceManager } from '../service-manager.class';\nimport { OrganisationService } from '../organisation';\nimport { ApplicationService } from '../app.service';\nimport { SettingsService } from '../settings.service';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\n\nlet SPACE_LIST = [];\n\nexport function findSpace(id: string) {\n return SPACE_LIST.find((_) => _.id === id || _.email === id);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SpacesService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n private _org: OrganisationService,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n \n super(_composer, settingsService);\n ServiceManager.setService(Space, this);\n this._name = 'Space';\n this._api_route = 'rooms';\n this._compare = (a, b) =>\n !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this._list_filter = (a: Space) => {\n const bld = this._org.building;\n return a.level.building_id === bld.id;\n };\n this._org.initialised\n .pipe(first((_) => _))\n .subscribe(() => this.init());\n }\n\n public async query(query: HashMap = {}, setList:boolean = false) {\n const list = await super.query(query);\n if ( (query.hasOwnProperty('cache') && query.cache === false) || !Object.keys(query).length || setList) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n return list;\n }\n\n public filterAvailableSpaces(list: Space[]) {\n return list.filter((i) => {\n if (i.recurrence_availability?.length) return i; //if recurrence, send the space regardless of availability (needed for edit and cloning series)\n return i.available;\n });\n }\n\n /**\n * Get available spaces\n * @param options\n */\n public available(\n options: ISpaceAvailabilityOptions,\n uniqueId?: string,\n filter: boolean = true\n ): Promise {\n if (!options) {\n throw new Error('Space avilability requires request options');\n }\n\n const now = DateNow(new Date());\n if (!options.dateTz) {\n options.dateTz = now.startOfValue('minute');\n }\n\n if (options.hide_declined === undefined) {\n options.hide_declined = true;\n }\n\n const key = `available|${options.id ? options.id : ''}|${\n uniqueId ?? ''\n }`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Space[]) => {\n delete this._promises[key];\n resolve(filter ? this.filterAvailableSpaces(list) : list);\n };\n const error = (e) => {\n reject(e);\n delete this._promises[key];\n };\n const query = availabilityOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(\n (i) => respond([i]),\n error\n );\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n const loading: ApplicationLoadingState =\n this._service.get('loading') || {};\n if (!loading.spaces) {\n loading.spaces = {\n message: 'Loading space data',\n state: 'loading',\n };\n this._service.set('loading', loading);\n }\n // Adjusted the query by incorporating the \"zone_ids\" option to filter rooms based on specific zone IDs instead of considering all thousands of rooms.\n const option = {\n zone_ids: this._org.building.id\n }\n await this.query(option, true).catch(() => {\n loading.spaces = { message: 'Loading space data', state: 'failed' };\n this._service.set('loading', loading);\n });\n loading.spaces = { message: 'Loading space data', state: 'complete' };\n this._service.set('loading', loading);\n }\n\n /**\n * Convert raw data into API object\n * @param raw_data Raw API data\n */\n public process(raw_data: HashMap): Space {\n return new Space(raw_data);\n }\n /**\n * \n * Special observable function to make http call for rooms\n * @param query \n * @returns observable\n */\n public queryRooms = (query: HashMap = {}): Observable => super.queryRoomsForQR(query);\n\n public setSpaceList(list) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n\n public queryBooking = (query: HashMap = {}) : Observable | Observable => super.queryObsr(query);\n public updateSpace = (id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.updateObsr(id, form_data, should_inject_concierge, query_params);\n public uploadSpacePhotos = (apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.uploadSpacePhotos(apiSubRoute, form_data, should_inject_concierge, query_params);\n \n public updateRoomList() {\n this.load().then((_) => null)\n }\n}\n","import {\n BehaviorSubject,\n of\n} from 'rxjs';\nimport {\n Building,\n Organisation\n} from './organisation';\nimport { BaseDataClass } from './base-api.class';\nimport { MapLocation } from './location';\nimport { User } from './users';\nimport { Booking } from './bookings';\nimport {\n RoomSettings,\n Space,\n SpaceFeatures\n} from './spaces';\nimport { ServiceManager } from './service-manager.class';\nimport {\n CateringCategory,\n CateringItem\n} from './catering';\nimport {\n HashMap,\n padZero,\n predictableRandomInt,\n unique\n} from '@mckinsey-converge/base';\n\nimport * as faker from 'faker';\n\nimport {\n SETTINGS_TOKEN,\n SettingsData,\n SettingsObject,\n SettingsService\n} from './settings.service';\nimport { Report } from './reports';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nfaker.seed(2560);\n\nlet SERVICE: any;\n\ndeclare global {\n interface Jest {\n fn: () => any\n }\n}\n\n\ndeclare let jest: Jest;\n\n/* istanbul ignore file */\n\nexport function generateMockOrganisationService(): HashMap {\n return {\n levelWithID: jest.fn(),\n listen: jest.fn(),\n loadOrganisation: jest.fn(),\n initialised: of(true),\n building: new Building(generateMockBuilding({ id: 'bld-01' })),\n loadBuildingsWithOrg: jest.fn(),\n getOrganizationFiltersByRoomType: jest.fn(),\n getRoomTypeSubsetDDOptions: jest.fn(),\n getRoomFilterOptionsPerLocation: jest.fn(),\n ...generateMockDataService('OrganisationService')\n };\n}\n\nexport const generateMockSpacesService = (): HashMap => ({\n available: jest.fn(),\n ...generateMockDataService('SpacesService')\n});\n\nexport const generateMockUsersService = (): HashMap => ({\n loadCurrentUser: jest.fn(),\n ...generateMockDataService('UsersService')\n});\n\nexport const bookingState = () => ({\n bookings: of([]),\n filtered: of([]),\n filtered_week: of([]),\n filtered_month: of([]),\n setZone: jest.fn(),\n setDate: jest.fn(),\n setFilters: jest.fn(),\n add: jest.fn(),\n replace: jest.fn(),\n remove: jest.fn(),\n startPolling: jest.fn(),\n startPollingMonth: jest.fn(),\n startPollingWeek: jest.fn(),\n startPollingEveryFiveMin: jest.fn(),\n _noOfMeetings: of([])\n});\n\nconst test_app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n }\n};\n\nexport const TEST_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/test',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app: test_app,\n mock: false,\n frontend: 'staff'\n};\n\nexport const generateMockSettingsService = (overrides: Partial> = {}) => new SettingsService({ getTitle: () => jest.fn() } as any,\n new SettingsObject({\n ...TEST_SETTINGS,\n ...overrides\n }));\n\n/**\n * Provides an injectable instance for settings.\n */\nexport const provideMockSettingsObject = (settings: Partial> = {}) => ({\n provide: SETTINGS_TOKEN,\n useValue: new SettingsObject({\n ...TEST_SETTINGS,\n ...settings\n })\n});\n\n/**\n * Generate a mocked version of the application service\n */\nexport function generateMockAppService(settingsOverrides: Partial> = {}) {\n SERVICE = {\n setting: jest.fn(),\n notify: jest.fn(),\n notifyInfo: jest.fn(),\n notifyWarn: jest.fn(),\n notifySuccess: jest.fn(),\n notifyError: jest.fn(),\n log: jest.fn(),\n navigate: jest.fn(),\n navigateBack: jest.fn(),\n get: jest.fn(),\n listen: jest.fn(),\n set: jest.fn(),\n Composer: { auth: { token: 'test' } },\n Hotkeys: { listen: jest.fn() },\n Users: generateMockUsersService(),\n Organisation: generateMockOrganisationService(),\n Locations: generateMockDataService('LocationsService'),\n Base: generateMockDataService('BaseService'),\n Menu: generateMockDataService('CateringMenuService'),\n Spaces: generateMockSpacesService(),\n Bookings: generateMockDataService('BookingsService'),\n Reports: generateMockDataService('ReportsService'),\n CateringItems: generateMockDataService('CateringItemsService'),\n CateringCategories: generateMockDataService('CateringCategoriesService'),\n Settings: generateMockSettingsService(settingsOverrides),\n initialised: of(true)\n };\n ServiceManager.setService(BaseDataClass, SERVICE.Base);\n ServiceManager.setService(Organisation, SERVICE.Organisation);\n ServiceManager.setService(Building, SERVICE.Organisation);\n ServiceManager.setService(User, SERVICE.Users);\n ServiceManager.setService(Booking, SERVICE.Bookings);\n ServiceManager.setService(Space, SERVICE.Spaces);\n ServiceManager.setService(MapLocation, SERVICE.Locations);\n ServiceManager.setService(Report, SERVICE.Reports);\n ServiceManager.setService(CateringItem, SERVICE.CateringItems);\n ServiceManager.setService(CateringCategory, SERVICE.CateringCategories);\n SERVICE.Organisation.buildings = [SERVICE.Organisation.building];\n SERVICE.Users.current = new User(generateMockUser());\n SERVICE.Users.initialised = of(true);\n SERVICE.Bookings.booking_list = new BehaviorSubject(new Array(10).fill(0).map(_ => new Booking(generateMockBooking())));\n SERVICE.listen.mockReturnValue(of(null, []));\n return SERVICE;\n}\n\nexport function generateMockDataService(name: string) {\n const service = {\n find: jest.fn(),\n filter: jest.fn(),\n listen: jest.fn(),\n get: jest.fn(),\n set: jest.fn(),\n setting: jest.fn(),\n query: jest.fn(),\n show: jest.fn(),\n add: jest.fn(),\n save: jest.fn(),\n remove: jest.fn(),\n delete: jest.fn(),\n update: jest.fn(),\n addFrom: jest.fn(),\n removeFrom: jest.fn(),\n task: jest.fn(),\n available: jest.fn(),\n process: jest.fn(),\n updateList: jest.fn(),\n clearList: jest.fn(),\n removeFromList: jest.fn(),\n accept: jest.fn(),\n decline: jest.fn(),\n checkin: jest.fn(),\n is_logged_in: false,\n initialised: of(true),\n getHoldingBay: jest.fn(),\n name,\n queryRooms: of(true),\n queryRoomsForQR: of([]),\n queryObsr: of([]),\n queryBooking: of(true),\n checkinIndividualVisitor: jest.fn(),\n taskObsr: of(true),\n updateSpace: jest.fn(),\n updateObsr: of([]),\n uploadSpacePhotos: of([])\n\n };\n\n service.getHoldingBay.mockImplementation(_ => Promise.resolve([new Booking({})]));\n service.save.mockImplementation(_ => Promise.resolve(new Booking({})));\n\n service.listen.mockReturnValue(of(null));\n service.filter.mockReturnValue([]);\n return service;\n}\n\nlet SPACE_COUNT: number = 0;\n\nexport function generateMinimalRoomDetails(count: number) {\n return {\n name: `space-0${count}`,\n email: `space-0${count}@test.com`,\n settings: {\n name: `localname-0${count}`,\n catering: true\n }\n }\n}\n\nexport function generateMockSpace(overrides: HashMap = {}, space_id: number = null, recurring_search: boolean = false ): Space {\n const id = `space-${space_id || SPACE_COUNT++}`;\n const name = overrides.name || `${faker.name} ${faker.name.lastName()} Space`;\n const startOfDay = DateNow(new Date()).startOfValue('day');\n let settings: RoomSettings = {\n available: true,\n available_until: startOfDay.addValue({ days: 1 }).seconds, // (Date.now() / 1000) + (60 * 60 * 24), // now plus 24 hrs\n bookings: Array(10).fill(0).map(i => generateMockBooking()),\n catering: true,\n charge_code: true,\n extra_features: \"meeting_room boardroom\",\n internal_or_external: \"internal\",\n map_id: \"1\",\n natural_light: false,\n room_booking_screen: true,\n room_name: `${name} - Local Name`,\n vc: false,\n }\n if (overrides.settings) {\n settings = { ...settings, ...overrides.settings };\n delete overrides.settings;\n }\n if (recurring_search) {\n settings.recurrence_availability = [\n {\n date: startOfDay.seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 1 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 2 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 3 }).seconds,\n available: false,\n },\n ]\n }\n\n const linked = Math.floor(predictableRandomInt(99999)) % 2 === 0 && SPACE_COUNT > 1;\n return new Space({\n id,\n name: `${name} - Global Name`,\n map_id: `${space_id || SPACE_COUNT}`,\n type: faker.commerce.productName(),\n searchable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n controlable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n hourly_rate: Math.floor(predictableRandomInt(300)) * 100,\n bookable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n capacity: 15,\n sort_priority: 0,\n setup: Math.floor(predictableRandomInt(6)) * 5,\n breakdown: Math.floor(predictableRandomInt(6)) * 5,\n support_url: `/control/#/${id}`,\n image: faker.image.business(),\n zones: ['zone_lvl-0'],\n features: `${SpaceFeatures.BoardRoom} ${SpaceFeatures.ElectronicWhiteboard}`,\n email: `${name.toLowerCase().split(' ').join('.')}@${USER_DOMAIN}`,\n settings,\n ...overrides\n });\n}\n\nlet BOOKING_COUNT = 0;\nlet BOOKING_DATE = DateNow(new Date()).setValue({ hour: 6 }).setValue({minute: 0}).subtractValue({ days: 10 }).startOfValue('minute');\n\n/**\n * Set the initial time used for generating mock bookings\n * @param time New initial time as ms from UTC epoch\n */\nexport function setMockBookingStartDatetime(time: number) {\n const date = new DateTZ({date: time})\n BOOKING_DATE = date.startOfValue('minute');\n}\n\n/**\n * Create mock raw API data for a booking\n * @param override Overrides the properties of the generated booking with it's own\n */\nexport function generateMockBooking(override: HashMap = {}) {\n const id = `booking-${BOOKING_COUNT++}`;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4) + 2) * 15 });\n const start = BOOKING_DATE.ms;\n const duration = Math.floor(predictableRandomInt(4) + 2) * 15;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4)) * 15 });\n const organiser = generateMockUser({ external: false, visitor: false });\n const orders = Array(Math.floor(predictableRandomInt(5)))\n .fill(0)\n .map(_ => generateMockCateringOrder({ booking_date: start }, override.room_ids, override.menu));\n const hasCatering = Math.floor(predictableRandomInt(34567)) % 3 === 0;\n const date_start = new DateTZ({date: start})\n return {\n id,\n title: `${faker.commerce.productName()} Meeting`,\n attendees: Array(Math.floor(predictableRandomInt(5) + 2))\n .fill(0)\n .map((_, i) => generateMockUser(override.users)),\n organiser,\n start_epoch: date_start.seconds,\n end_epoch: date_start.addValue({ minutes: duration }).seconds,\n body: faker.lorem.paragraph(),\n notes: [{ type: 'other', message: faker.lorem.paragraph() }],\n location: faker.address.city(),\n // Mckinsey only has internal or external meetings\n booking_type: ['internal', 'external'][predictableRandomInt(2)],\n setup: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n breakdown: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n status: 'accepted',\n catering: hasCatering ? orders : [],\n room: new Space(generateMinimalRoomDetails(1)), // returns space-01 type values\n equipment_codes: {},\n company:[],\n ...override\n };\n}\n\nlet BLD_COUNT = 0;\nlet LVL_COUNT = 0;\n\n/**\n * Generate raw mock data for creating a building\n * @param id Forced ID for the mock\n * @param overrides Supply object value overrides in place. Supports a levelGenerator function\n * to stabilize level ids for testing.\n */\nexport function generateMockBuilding(overrides: HashMap = {}): HashMap {\n const id = `zone_bld-${BLD_COUNT++}`;\n const levels = Array(10)\n .fill(0)\n .map((_, i) => generateMockLevel(undefined, overrides.levelGenerator?.(i)));\n const features: any = {};\n for (const lvl of levels) {\n const count = Math.floor(predictableRandomInt(3) + 2);\n features[lvl.level_id] = {};\n for (let i = 0; i < count; i++) {\n features[lvl.level_id][faker.commerce.productName()] = `feature-${i + 1}`;\n }\n }\n return {\n id,\n zone_id: id,\n extras: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n code: 'NYO',\n name: faker.name.firstName(),\n address: 'building address field',\n city: 'building city',\n loan_items: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n levels,\n roles: {\n 'first-aiders': Array(10)\n .fill(0)\n .map(i => generateMockUser())\n },\n neighbourhoods: features,\n settings: {\n test: {\n nested: {\n level2: true,\n org: false\n }\n },\n city: faker.address.city()\n },\n timezone: 'America/Chicago',\n ...overrides\n };\n}\n\n/**\n * Generate raw mock data for a building level\n * @param id Forced ID for the mock\n * @param overrides value overrides\n */\nexport function generateMockLevel(id?: string, overrides: HashMap = {}): HashMap {\n if (!id) {\n id = `zone_lvl-${LVL_COUNT++}`;\n }\n return {\n id,\n level_id: id,\n level_name: `Level ${LVL_COUNT}`,\n short_name: `L ${LVL_COUNT}`,\n ...overrides\n };\n}\n\nlet USER_COUNT = 0;\n\nexport let USER_DOMAIN = 'acaprojects.com';\n\nconst USER_EMAILS: string[] = [];\n\n/**\n * Generate raw mock data for a user\n * @param id Forced ID for the mock\n * @param name Forced name for the user\n * @param external Whether user is external of the organisation\n */\nexport function generateMockUser(override: HashMap = {}): HashMap {\n const id = `user-${USER_COUNT++}`;\n const name = `${faker.name.firstName()} ${faker.name.lastName()}`;\n const external = override.external || !(predictableRandomInt(99999) % 2);\n const organisation = external ? faker.company.companyName() : USER_DOMAIN.split('.')[0];\n let delegates: {email: string, opt_out: boolean}[] = [];\n const delegate_count = Math.min(predictableRandomInt(4) + 1, USER_EMAILS.length);\n for (let i = 0; i < delegate_count; i++) {\n delegates.push({email: USER_EMAILS[Math.floor(predictableRandomInt(USER_EMAILS.length))], opt_out: false});\n }\n delegates = unique(delegates);\n const email = `${name\n .split(' ')\n .join('.')\n .toLowerCase()}@${external ? 'not-' : ''}${USER_DOMAIN}`;\n USER_EMAILS.push(email);\n return {\n id,\n name,\n first_name: name.split(' ')[0],\n last_name: name.split(' ')[1],\n email,\n phone: faker.phone.phoneNumber(),\n visitor: external,\n organisation: {\n id: organisation\n .split(' ')\n .join('.')\n .toLowerCase(),\n name: organisation\n },\n department: faker.commerce.department(),\n staff_code: padZero(Math.floor(predictableRandomInt(99999)), 5),\n delegates,\n image: faker.image.avatar(),\n ...override\n };\n}\n\nexport function generateMockCateringOrder(overrides: HashMap = {}, room_id: string = '', menu: HashMap = {}) {\n return {\n id: `order-${predictableRandomInt(9999_9999)}`,\n delivery_time: predictableRandomInt(6) * 5,\n location_id: room_id, // R--- could be undefined\n items: new Array(predictableRandomInt(5, 1)).fill(0).map(i => pickMenuItem(menu)),\n ...overrides\n };\n}\n\nfunction pickMenuItem(menu_map: HashMap = {}) {\n const zones = Object.keys(menu_map);\n const menu = menu_map[zones[predictableRandomInt(zones.length)]] || [];\n const category = menu[predictableRandomInt(menu.length)] || { items: [] };\n const group = { ...(category.items[predictableRandomInt(category.items.length)] || {}) };\n if (!group.package && group.items?.length) {\n const item = { ...group.items[predictableRandomInt(group.items.length)] };\n item.amount = predictableRandomInt(5, 1);\n return item;\n }\n group.amount = predictableRandomInt(5, 1);\n return group;\n}\n\nexport function generateMockLocation(overrides: HashMap, fixed_locations: string[], maps: string[]): HashMap {\n const fixed = predictableRandomInt(999_999_999) % 2 === 0;\n if (fixed && (!overrides || overrides.fixed)) {\n return {\n map_id: fixed_locations[predictableRandomInt(fixed_locations.length)],\n level: maps[predictableRandomInt(maps.length)],\n ...overrides\n };\n } else {\n return {\n x: predictableRandomInt(900, 100),\n x_max: 1000,\n y: predictableRandomInt(500, 100),\n level: maps[predictableRandomInt(maps.length)],\n confidence: predictableRandomInt(30),\n ...overrides\n };\n }\n}\n\nlet ORG_COUNT = 0;\n\nexport function generateMockOrganisation(): HashMap {\n const buildings = Array(3).fill(0).map(i => generateMockBuilding());\n return {\n id: `zone_org-${ORG_COUNT++}`,\n name: `Organisation ${ORG_COUNT}`,\n buildings,\n settings: {\n discovery_info: {\n buildings\n },\n test: {\n nested: {\n org: true\n }\n }\n }\n };\n}\n\n\nexport const generateMockBuildingSetByCity = () => {\n const buildings: Building[] = Array(10).fill(0)\n .map(() => new Building(generateMockBuilding()));\n buildings.push(...Array(2).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'Auckland'\n },\n city: 'Auckland'\n }))));\n buildings.push(...Array(5).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'NYC'\n },\n city: 'NYC'\n }))));\n return buildings;\n};\n\nexport function generateMockModalData(data: HashMap = null) : HashMap {\n if (data) {\n return data;\n }\n return {\n pendingDate: new Date(1603087100 + (1000 * 60 * 15)),\n pendingDuration: 60,\n date: 1603087100,\n duration: 30,\n }\n}\n\nexport const mockDateToBuildingTz = (date?: number) =>{\n return new DateTZ({date, building_tz: 'America/Chicago', is_local_tz: false})\n}","export * from './user.class'\nexport * from './user.utilities'\nexport * from './users.service'\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { MapLocation } from '../location';\nimport { ServiceManager } from '../service-manager.class';\n\nexport class User extends BaseDataClass {\n \n /** Currently logged in user */\n public static get active_user(): User {\n const service = ServiceManager.serviceFor(User);\n return service ? service.current : null;\n }\n\n /** First name of the user */\n public readonly first_name: string;\n /** Last name of the user */\n public readonly last_name: string;\n /** Windows user ID */\n public readonly windows_id: string;\n /** FMNO */\n public readonly fmno: string;\n /** Type of user */\n public readonly type: 'partner' | 'external' | 'internal';\n /** Contact phone number of the user */\n public readonly phone: string;\n /** Organisational department the user is part of */\n public readonly business_unit: string;\n /** Whether user is external from the application's organisation */\n public readonly external: boolean;\n /** Whether user is a visitor */\n public readonly visitor: boolean;\n /** Organisational Identifier for the user */\n public readonly staff_code: string;\n /** Basic location descriptor for the user */\n public readonly location: string;\n /** List of users that this user can act on behalf */\n public readonly delegates: readonly {email: string, opt_out: boolean}[];\n /** URL of the user's avatar image */\n public readonly image: string;\n /** List of user groups associated with this user */\n public readonly groups: readonly string[];\n /** Organisation the user is associated with */\n private _organisation: Identity;\n\n /** Map location of the user */\n private _location: MapLocation;\n /** List of desk bookings */\n // private _desk_bookings: HashMap = {}; // R--- can't explain why this is here.\n /** Host/Organisawe email notification opt out/in setting */\n public opt_out: boolean;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this.first_name = raw_data.first_name || '';\n this.last_name = raw_data.last_name || '';\n this.windows_id = raw_data.email || '';\n this.fmno = raw_data.fmno;\n this.external = raw_data.external || false;\n this.visitor = raw_data.visitor || false;\n\n\n this.type = this.visitor ? 'external' : 'internal';\n this.phone = raw_data.phone || raw_data.mobile || '';\n this.business_unit = raw_data.business_unit || raw_data.department || '';\n this._organisation = raw_data.organisation || {\n id: raw_data.organisation_id,\n name: raw_data.organisation_name\n };\n\n this._location = null;\n this.image = raw_data.image || '';\n this.staff_code = raw_data.staff_code || raw_data.fmno || '';\n this.delegates = raw_data.delegates || [];\n this._location = new MapLocation(\n raw_data.location && raw_data.location instanceof Object\n ? raw_data.location\n : { name: raw_data.location }\n );\n this.groups = raw_data.groups || [];\n this.location = raw_data.location || raw_data.officeLocation || '';\n this.opt_out = raw_data.opt_out;\n }\n\n /** Organisation the user is associated with */\n public get organisation() {\n return this._organisation;\n }\n\n /** Map location of the user */\n public get last_location(): MapLocation {\n return new MapLocation(this._location || {});\n }\n\n /**\n * Ask the server for the users current location\n */\n public locate(): Promise {\n const service: any = ServiceManager.serviceFor(MapLocation);\n return new Promise((resolve, reject) => {\n if (service) {\n service.show(this.id, { desk: this.email }).then(\n l => {\n this._location = l;\n resolve(l);\n },\n e => reject(e)\n );\n } else {\n resolve(null);\n }\n });\n }\n\n /**\n * Whether user is available during the given period\n * @param start Start time as a unix timestamp with milliseconds\n * @param end End time as a unix timestamp with milliseconds\n */\n public available(start?: number, end?: number): Promise {\n return new Promise(resolve => {\n this._service.query({ email: this.email, start, end }).then(\n l => resolve(l && l.length > 0),\n _ => resolve(false)\n );\n });\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): User {\n return new User(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): User {\n return new User({ ...this, id: null, email: null });\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: User): HashMap {\n const data = super.toJSON();\n delete data.location;\n return data;\n }\n}\n\n// R--- Might need an toApiJSON due to visitor field.","import {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { HashMap } from '@mckinsey-converge/base';\nimport { User } from './user.class';\n\n/**\n * Generate form fields for the given user\n * @param user User to generate form for\n */\nexport function generateUserForm(user: User): FormGroup {\n if (!user) {\n throw Error('No user passed');\n }\n const fields: HashMap = {\n id: new FormControl(user.id || ''),\n name: new FormControl(user.name || ''),\n first_name: new FormControl(user.first_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n last_name: new FormControl(user.last_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n email: new FormControl(user.email || '', [Validators.email])\n };\n // Generate form group for booking item\n return new FormGroup(fields);\n}\n","import { Injectable } from '@angular/core';\nimport { Location } from '@angular/common';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { Md5 } from 'ts-md5/dist/md5';\n\nimport { BaseAPIService } from '../base.service';\nimport { User } from './user.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface ILoginOptions {\n /** URL to post login request to */\n url?: string;\n /** Whether form data is passed in the body of the request */\n form?: boolean;\n /** Custom headers to pass into the post request */\n headers?: HashMap;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UsersService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n protected uhttp: HttpClient,\n protected location: Location,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(User, this);\n this._name = 'Users';\n this._api_route = 'users';\n this._compare = (a, b) => !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this.set('list', []);\n this.set('current_user', new User({ id: 'local_user', name: 'Local User' }));\n this.set('delegates', null);\n this._composer.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /** Currently logged in user */\n public get current(): User {\n return this.get('current_user');\n }\n\n /** Whether the user has properly logged in */\n public get is_logged_in(): boolean {\n return this.current && this.current.id !== 'local_user';\n }\n\n /* istanbul ignore next */\n /**\n * Sets the access token and expiry for the user\n * @param token OAuth bearer token\n * @param expiry Expiry epoch timestamp in ms\n * @param reload Whether to reload the page after setting tokens\n */\n public setToken(token: string, expiry?: number, reload: boolean = true) {\n if (!expiry) {\n const now = DateNow(new Date())\n expiry = now.addValue({ days: 7 }).endOfValue('day').ms;\n }\n const path = `${location.origin}${\n this._service.setting('composer.route') || ''\n }/oauth-resp.html`;\n const client_id = Md5.hashStr(path);\n if (sessionStorage) {\n sessionStorage.setItem(`${client_id}_access_token`, token);\n sessionStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (localStorage) {\n localStorage.setItem(`${client_id}_access_token`, token);\n localStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (reload) {\n this.location.go(this.location.path());\n }\n return path;\n }\n\n /**\n * Post login request to the API\n * @param query_params Key value pairs to pass into\n * @param options Options for the login request\n */\n public async login(query_params: HashMap, options: ILoginOptions = {}): Promise {\n if (this.settingsService.concierge) {\n if (!this._promises['login']) {\n this._promises['login'] = new Promise((resolve, reject) => {\n this.set('status', 'loading');\n let headers = new HttpHeaders();\n if (!options || options.form !== false) {\n headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');\n }\n const url = (options ? options.url : '') || '/auth/signin';\n this.uhttp.post(url, query_params, { headers }).subscribe(\n (_) => null,\n (e) => reject(e),\n () => {\n this._composer.auth.authorise();\n resolve();\n }\n );\n });\n }\n return this._promises['login'];\n }\n }\n\n\n /**\n * Logout of user and redirect to logout URL\n */\n public logout() {\n this._composer.auth.logout();\n }\n\n /**\n * Loads current user from API. This diverges from {@link load} in order to simply return\n * the user object instead of setting it on the service.\n */\n public async loadCurrentUser(): Promise {\n return this.show('current')\n }\n\n /**\n * Load initial data for the service\n */\n protected load(tries: number = 0): Promise {\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.user = { message: 'Loading user credentials', state: 'loading' };\n this._service.set('loading', loading);\n this.set('status', 'loading');\n return new Promise((resolve) => {\n // this is due to unclear nature of the merge between concierge and staff\n // concierge has the retries enabled, while staff continuously retries.\n if (this.settingsService.concierge && tries > 4) {\n this.set('status', 'invalid');\n loading.user = { message: 'Loading user credentials', state: 'failed' };\n this._service.set('loading', loading);\n return resolve();\n }\n this.show('current').then(\n async (current_user) => {\n this.set('status', 'available');\n this.set('current_user', current_user);\n this._initialised.next(true);\n if (this._service && this._service.setting('app.user.grab_api_details')) {\n this.show(current_user.email).then(\n async (user) => {\n this.set('current_user', user);\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = {\n message: 'Loading user credentials',\n state: 'complete'\n };\n this._service.set('loading', loading);\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n } else {\n \n // is after process\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => current_user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = { message: 'Loading user credentials', state: 'complete' };\n this._service.set('loading', loading);\n }\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n });\n }\n\n private async loadDelegates() {\n const delegates = this.current.delegates;\n if (!delegates || !delegates.length) {\n return [];\n }\n const promises: Promise[] = [];\n for (const del of delegates) {\n promises.push(this.show(del.email));\n }\n const list = await Promise.all(promises);\n this.set('delegates', list);\n this.set('list', unique((this.get('list') || []).concat(list)));\n return list;\n }\n\n /**\n * Convert raw API data into a valid User Object\n * @param raw_item Raw API data\n */\n protected process(raw_data: any): User {\n return new User(raw_data);\n }\n}","import { AbstractControl } from '@angular/forms';\n\nimport { User } from './users';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n\nconst HAS_ERROR = true;\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n */\nexport function buildValidateDate(date?: number) {\n const from = new DateTZ({ date });\n return (c) => validateDate(c, date);\n}\n\n/**\n * Check that control value is a date that is the same or after from date\n * @param control Angular form control\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateDate(control: AbstractControl, is_from?: number) {\n const from = new DateTZ({date: is_from})\n const date = new DateTZ({date: control.value})\n return date.isBeforeDate(from) ? { date: HAS_ERROR, message: 'Booking needs to be made in the future' } : null;\n}\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function buildValidateStartTime(date: number, is_from?: number) {\n const from = new DateTZ({date: is_from})\n return (c) => validateStartTime(c, date, from.ms);\n}\n\n/**\n * Check that control value time is after the comparison date time\n * @param control Angular form control\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateStartTime(control: AbstractControl, date: number, is_from?: number) {\n const now = new DateTZ({date: is_from});\n const parts = control.value.split(':');\n const date_obj = new DateTZ({date});\n return date_obj.setValue({ hour: +parts[0], minute: +parts[1] }).isBeforeDate(now) ? {\n start: HAS_ERROR,\n message: 'Booking time needs to be made in the future'\n } : null;\n}\n\nexport function buildValidateDuration(min: number = 30, max: number = 240) {\n return (c) => validateDuration(c, min, max);\n}\n\nexport function validateDuration(control: AbstractControl, min: number = 30, max: number = 240) {\n if (control.value < (min || 30)) {\n return { duration: HAS_ERROR, message: `Minimum booking duration is ${min} minute${min === 1 ? 's' : ''}` };\n } else if (control.value > (max || 480)) {\n return { length: HAS_ERROR, message: `Maximum booking duration is ${max} minute${max === 1 ? 's' : ''}` };\n }\n return null;\n}\n\nexport function buildValidateAttendees(host: User, min: number = 0) {\n return (c) => validateAttendees(c, host, min);\n}\n\nexport function validateAttendees(control: AbstractControl, host: User, min: number = 0) {\n if (!control || !(control.value instanceof Array)) {\n return min > 0\n ? { invalid: true, message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you` }\n : null;\n }\n const list: User[] = control.value;\n if (host) {\n const result = list.find(a => a.email === host.email);\n if (result) {\n list.splice(list.indexOf(result), 1);\n }\n }\n return list.length >= min ? null : {\n count: true,\n message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you`\n };\n}\n\nexport function validateEndTime(dateControlTz: AbstractControl) {\n return (control: AbstractControl) => {\n // const date = new DateTZ({date: date_control ? date_control.value : undefined})\n const now = DateNow(new Date())\n return dateControlTz.value.addValue({ minutes: control.value || 60 }).isBeforeDate(now)? { end_time: true } : null;\n };\n}\n\nexport function noWhitespaceValidator(control: AbstractControl) {\n const value = control?.value;\n if ( value === '') {\n return null; // Return null if control value is undefined or null\n }\n const isWhitespace = value.trim().length === 0;\n // const isValid = !isWhitespace;\n return !isWhitespace ? null : { whitespace: true };\n}\n\n","export * from './lib/date-tz.class'","import { DateObjectUnits, DateTime, DateTimeUnit, DurationLike, DurationUnits } from 'luxon';\nimport { getTimezoneOffset } from 'date-fns-tz';\n\nfunction padZero(value: number, length: number): string {\n let str = `${value}`;\n while (str.length < length) str = `0${str}`;\n return str;\n}\n\ninterface DateTZParams {\n date?: number | DateTime\n building_tz?: string\n is_local_tz?: boolean\n all_day?: boolean\n}\n\nconst now = new Date()\n\nexport class DateTZ {\n date: DateTime\n date_org: DateTime\n building_tz: string\n is_local_tz: boolean = true\n all_day: boolean\n local_tz: string\n valid: boolean\n\n constructor(data?: DateTZParams) { \n this.date_org = typeof data?.date === 'number' ? DateTime.fromMillis(data?.date) : data?.date ? data?.date : DateTime.fromMillis(now.valueOf())\n this.is_local_tz = data?.is_local_tz === false ? data?.is_local_tz : true\n this.all_day = data?.all_day || false\n this.local_tz = DateTime.now().zoneName\n this.building_tz = data?.building_tz || this.local_tz\n this.date = !this.is_local_tz ? this.date_org.setZone(this.building_tz) : this.date_org\n this.valid = this.date.isValid\n }\n\n //get epoch milliseconds\n public get ms(): number {\n return this.date.valueOf()\n }\n\n //get epoch seconds\n public get seconds(): number {\n return Math.trunc(this.date.toSeconds())\n }\n\n //get the second of the minute\n public get second(): number {\n return this.date.second\n }\n\n //get the minutes of the hour\n public get minutes(): number {\n return this.date.minute\n }\n\n //get the minutes of the hour\n public get hours(): number {\n return this.date.hour\n }\n\n public get utc(): number {\n const newDate = new DateTZ({...this, date: this.date.toUTC()})\n return newDate.seconds\n }\n\n public get dateDay(): number {\n return this.date.day\n }\n\n public get dateHour(): number {\n return this.date.hour\n }\n\n public get dateYear(): number {\n return this.date.year\n }\n\n public get dateWeekday(): number {\n try {\n return this.date.weekday;\n } catch (e) {\n return this.date.toJSDate().getDay();\n }\n }\n\n public get dateMonth(): number {\n return this.date.month\n }\n\n public dateDiff (compare_to: DateTZ, unit: DurationUnits, ans_unit = 'minutes'): number {\n return this.date.diff(compare_to.date, unit)[ans_unit]\n }\n\n //set the date to the begining of the given unit\n public startOfValue (unit: DateTimeUnit) {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 7) {\n // Don't change, we want sunday as the start of the week even though luxon thinks it is Monday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 1) {\n // If this.date is monday, just subtract one more day to make it Sunday\n const monday = new DateTZ({ ...this, date: this.date })\n newDate = monday.subtractValue({ days: 1 });\n } else {\n // If later than monday, startOfWeek back to monday and then subtact another day to get to Sunday.\n const monday = new DateTZ({...this, date: this.date.startOf(unit)})\n newDate = monday.subtractValue({ days: 1 })\n }\n }\n\n return newDate\n }\n\n //set the date to the end of the given unit\n public endOfValue (unit: DateTimeUnit) : DateTZ {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 6) {\n // Don't change, we want saturday as the end of the week even though luxon thinks it is Sunday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 7) {\n // If this.date is Sunday, this alone is the luxon end of week so add a day\n // to get to monday, then endOfWeek to Sunday, and subtract 1 day to Saturday\n const sunday = new DateTZ({ ...this, date: this.date }).addValue({ days: 1 })\n newDate = sunday.endOfValue(unit).subtractValue({ days: 1 }); // return next saturday\n } else {\n // If not saturday or sunday\n // endOfWeek to Sunday and then subtact a day to get to Saturday.\n const later = new DateTZ({...this, date: this.date.endOf(unit)})\n newDate = later.subtractValue({ days: 1 })\n }\n } else {\n newDate = new DateTZ({...this, date: this.date.endOf(unit)})\n }\n\n return newDate\n }\n \n public startEpoch (): number {\n const org = new DateTZ({date: this.date_org})\n return this.all_day\n ? this.startOfValue('day').ms - this.dateDiff(org, 'minutes')\n : this.ms\n }\n\n //clone the given value and unit to the date\n public clone (): DateTZ {\n // return new DateTZ({...this})\n return this.addValue({ seconds: 0 })\n }\n\n //adds the given value and unit to the date\n public addValue (duration: DurationLike, isLastDayOfMonth?: boolean): DateTZ {\n return new DateTZ({...this, date: isLastDayOfMonth ? this.date.plus(duration).endOf('month') : this.date.plus(duration)});\n }\n\n //subtracts the given value and unit to the date\n public subtractValue (duration: DurationLike): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.minus(duration)})\n return newDate\n }\n\n public setValue (obj: DateObjectUnits): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.set(obj)})\n return newDate\n }\n\n public formatDate (format: string): string {\n // Return new immuatable via \"plus\" to prevent \n // TypeError: Cannot assign to read only property 'weekData' of object\n // https://github.com/moment/luxon/issues/601\n return this.date.plus({ seconds: 0 }).toFormat(format)\n }\n\n public formatLocalDate (format: string): string {\n // setZone already returns new immutable so it doesn't have the formatDate issue.\n return this.date.plus({ seconds: 0 }).setZone(this.local_tz).toFormat(format)\n }\n\n public isSameDate(compare_to: DateTZ, value: DateTimeUnit): boolean {\n return this.date.hasSame(compare_to.date, value)\n }\n\n public isAfterDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear > compare_to.dateYear\n case 'month':\n if(this.isAfterDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth > compare_to.dateMonth\n }\n case 'day':\n if(this.isAfterDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay > compare_to.dateDay\n }\n case 'hour':\n if(this.isAfterDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour > compare_to.dateHour\n }\n case 'minute':\n if(this.isAfterDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes > compare_to.minutes\n }\n default:\n return this.ms > compare_to.ms;\n }\n }\n\n public isBeforeDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear < compare_to.dateYear\n case 'month':\n if(this.isBeforeDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth < compare_to.dateMonth\n }\n case 'day':\n if(this.isBeforeDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay < compare_to.dateDay\n }\n case 'hour':\n if(this.isBeforeDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour < compare_to.dateHour\n }\n case 'minute':\n if(this.isBeforeDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes < compare_to.minutes\n }\n default:\n return this.ms < compare_to.ms;\n }\n }\n\n public toZone(tz: string): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: this.date.setZone(tz), \n building_tz: tz, \n is_local_tz: false\n })\n return newDate\n }\n\n public setTimestamp(timestamp: number): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: timestamp,\n })\n return newDate\n }\n\n public get JSDate(): Date {\n return this.date.toJSDate()\n }\n\n // helper to log out the dateTZ values\n public logDateTz (label: string = ''): void {\n console.log(`${label} local tz/date/time`, this.addValue({ seconds: 0 }).formatLocalDate(\"cccc d MMMM,yyyy h:mma\"), this.local_tz)\n console.log(`${label} building tz/date/time`, this.addValue({ seconds: 0 }).formatDate(\"cccc d MMMM,yyyy h:mma\"), this.building_tz)\n }\n}\n\nexport const DateNow = (date: Date = new Date()) => {\n return new DateTZ({date: date.valueOf()})\n} \n\n// input the local time and the building timezone\nexport const convertLocalTimestampToTimezonedDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const date = new Date(timestamp);\n return new DateTZ({ date: timestamp, building_tz: buildingTimezone, is_local_tz: false }).setValue({\n day: date.getDate(),\n hour: date.getHours(),\n minute: date.getMinutes()\n });\n}\n\n// input the building time and the building timezone\nexport const convertTimezonedTimestampToLocalDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const local_tz = DateTime.now().zoneName;\n const localOffset = getTimezoneOffset(local_tz, new Date(timestamp));\n const desiredOffset = getTimezoneOffset(buildingTimezone, new Date(timestamp));\n if (localOffset > desiredOffset) {\n const eleA = timestamp + (localOffset - desiredOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n } else {\n const eleA = timestamp + (desiredOffset - localOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n }\n}\n\nexport const localTimezone = () => {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n}\n\nexport const getTimezoneOffsetString = (tz: string) => {\n const offset_minutes = Math.floor(getTimezoneOffset(tz) / 1000 / 60);\n const hours = Math.floor(offset_minutes/60);\n const minutes = offset_minutes % 60;\n return `${offset_minutes > 0 ? '+' : '-'}${padZero(Math.abs(hours), 2)}${padZero(minutes, 2)}`;\n}\n\nexport function toMiddayUTC(value: DateTZ = DateNow()) {\n // exclude Auckland from rouding up timezone as it has 12+ hours UTC timezone difference\n return value.building_tz.includes('Auckland') ? value : new DateTZ({\n date: value.setValue({ hour: 12, minute: 0 }).ms,\n is_local_tz: false,\n building_tz: 'UTC',\n }).setValue({ hour: 12, minute: 0 });\n}\n\n/**returns the offset between two timezones in minutes and hours */\nexport function timezoneOffset(tz: string){\n const nowTz = DateNow(new Date())\n const offset = nowTz.date.offset - nowTz.toZone(tz).date.offset\n return {minutes: offset, hours: offset/60}\n}\n\nexport function isToday (date, timezone) {\n\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: timezone\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: timezone,\n }),\n 'day'\n );\n}\n","export * from './lib/environment.module';\nexport * from './lib/version';\nexport * from './lib/environment.service'\nexport * from './lib/types'\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n providers: []\n})\nexport class EnvironmentModule {\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { EnvironmentData } from './types';\n\nexport const ENVIRONMENT_TOKEN = 'environments_service_data';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class EnvironmentService {\n\n public get production(): boolean {\n return this.environment.production;\n }\n\n public get heap_io_id(): number {\n return this.environment.heap_io_id;\n }\n\n constructor(@Inject(ENVIRONMENT_TOKEN) private environment: EnvironmentData) {\n }\n}\n","// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\n/* tslint:disable */\nexport const VERSION = {\n \"dirty\": false,\n \"raw\": \"9bc1456e2\",\n \"hash\": \"9bc1456e2\",\n \"distance\": null,\n \"tag\": null,\n \"semver\": null,\n \"suffix\": \"9bc1456e2\",\n \"semverString\": null,\n \"version\": \"0.0.0\",\n \"time\": 1734038699575\n};\n/* tslint:enable */\n","export * from './lib/legacy-overlays.module';\nexport * from './lib/space-select-modal/space-select-modal.component';\nexport * from './lib/new-user-modal/new-user-modal.component';\nexport * from './lib/confirm-modal/confirm-modal.component';\nexport * from './lib/catering-confirm-modal/catering-confirm-modal.component';\nexport * from './lib/catering-details-modal/catering-details-modal.component';\nexport * from './lib/requirement-details-modal/requirement-details-modal.component';\nexport * from './lib/booking-confirm/booking-confirm.component';\nexport * from './lib/user-form/user-form.component'\nexport * from './lib/booking-form/booking-form.component'\nexport * from './lib/no-catering-modal/no-catering-modal.component'\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n Renderer2,\n ViewChild\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport { Router } from '@angular/router';\n\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n CateringOrder,\n getFirstDateFromList,\n OrganisationService,\n rulesForSpace,\n recurrenceDetails,\n SeriesAction,\n SettingsService,\n Space,\n SpacesService,\n User,\n UsersService,\n formatWhen,\n BOOKING_STATUS,\n CloseDialogService,\n DialogIds\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent,\n HashMap,\n humaniseDuration\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport interface BookingConfirmModalData {\n old_booking: Booking;\n booking: Booking;\n action?: SeriesAction\n}\n\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\n\n@Component({\n selector: 'a-booking-confirm-modal',\n templateUrl: './booking-confirm.component.html',\n styleUrls: ['./booking-confirm.component.scss']\n})\nexport class BookingConfirmComponent extends BaseDirective implements OnInit{\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** Display string for changes are being processed */\n public loading: string;\n /** Whether space availability is being checked */\n public checking_available: boolean;\n /** Whether to show all attendees */\n public show_attendees: boolean = false;\n /** Whether to show all locations */\n public show_locations: boolean;\n /** Whether to show all catering orders */\n public show_orders: boolean;\n /** Whether booking has succeeded */\n public success: boolean;\n /** Whether booking needs to be accepted */\n public readonly is_request: boolean;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n lastMomentConflict: boolean = false;\n \n @ViewChild('attendeesListRef') attendeesListRef: ElementRef;\n @ViewChild('locationsListRef') locationsListRef: ElementRef;\n @ViewChild('cateringListRef') cateringListRef: ElementRef;\n\n /** Booking to confirm changes to */\n public get old_booking(): Booking {\n return this._data.old_booking;\n }\n\n /** Booking to confirm changes to */\n public get booking(): Booking {\n return this._data.booking;\n }\n\n /** Active user */\n public get user(): User {\n return this._users.current;\n }\n\n /** Title of the displayed event */\n public get title(): string {\n return this.booking.title;\n }\n\n /** Comapny names */\n public get company(): string[] {\n return this.booking.company;\n }\n \n\n /** Display string of when the event will occur */\n public get when(): string {\n const duration_value = this.booking.duration;\n const all_day = this.booking.all_day && duration_value < 25 * 60;\n if(this.booking.is_recurrent && this.booking.recurrence_starts && this.booking.recurrence_starts.length){\n return formatWhen({all_day, ...this.recurrenceDates })\n }\n return formatWhen({\n all_day,\n startTZ: this.booking.startDateTz,\n endTZ: this.booking.endDateTz,\n displayEndTZ: this.booking.displayEndDateTz})\n }\n\n public get recurrenceDates(){\n const startTZ = getFirstDateFromList(this.booking.recurrence_starts)\n const endTZ = startTZ.addValue({minutes: this.booking.duration})\n return {startTZ, endTZ, displayEndTZ: endTZ}\n }\n\n /** Display string for the recurrence value of the booking */\n public get recurrence(): string {\n return recurrenceDetails({\n period: this.booking.recurrence_period,\n end: this.booking.recurrence_endTz,\n list: this.booking.recurrence_starts,\n interval: this.booking.recurrence_interval\n });\n }\n\n /** Display string for the event's duration */\n public get duration(): string {\n const duration_value = this.booking.duration;\n return this.booking.all_day ? 'All Day' : humaniseDuration(duration_value);\n }\n\n /** List of spaces associated with the event */\n public get spaces(): Space[] {\n return this.booking.multi_rooms;\n }\n\n /** List of attendees associated with the event not including the host */\n public get attendees(): User[] {\n const attendees = this.booking.attendees;\n return attendees.filter((i) => i.email !== this.organiser.email);\n }\n\n /** Host of the event */\n public get organiser(): User {\n return this.booking.organiser || this._users.current;\n }\n\n /** Host of the event */\n public get equipment_codes(): HashMap {\n return this.booking.equipment_codes || {};\n }\n\n /** Host of the event */\n public get catering_codes(): HashMap {\n const catering = this.catering;\n const codes = {};\n for (const order of this.catering) {\n codes[order.location_id] = order.charge_code;\n }\n return codes;\n }\n\n /** Host of the event */\n public get equipment_notes(): HashMap {\n return this.booking.notes\n .filter((note) => note.type === 'equipment')\n .reduce((map, notes) => {\n map[notes.space] = notes.message;\n return map;\n }, {});\n }\n\n /** Details about the event */\n public get notes(): string {\n return this.booking.body;\n }\n\n /** List of catering orders in the booking */\n public get catering(): CateringOrder[] {\n return (this.booking.catering || []).map((order) => {\n const space: any = this.spaces.find(\n (a_space) => a_space.email === order.location_id\n ) || {\n level: {}\n };\n const building: any =\n this._org.buildings.find((bld) => bld.id === space.level.building_id) || {};\n return new CateringOrder({\n ...order,\n location: space.local_name,\n symbol: building.currency,\n booking_date: this.booking.startDateTz.ms,\n booking_timezone: this.booking.timezone,\n });\n });\n }\n\n /** Map of changes to the booking */\n public get changes(): HashMap {\n return {};\n }\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _org: OrganisationService,\n private _bookings: BookingsService,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private _router: Router,\n private _dialog: MatDialog,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: BookingConfirmModalData,\n public settings: SettingsService,\n private closeDialogService: CloseDialogService, \n private renderer: Renderer2,\n ) {\n super();\n this.booking.time_changed =\n this.old_booking &&\n (this.old_booking.startDateTz.ms !== this.booking.startDateTz.ms ||\n this.old_booking.duration !== this.booking.duration);\n // in concierge, all bookings are acceptable without explicit approval.\n\n const rules = rulesForSpace({ user: this.user, space: this.booking.room, duration: 60 });\n this.is_request = this.settings.concierge ? false : rules.auto_approve;\n }\n\n ngOnInit(): void {\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined; \n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && (booker_concierge !== null && booker_concierge !==undefined ) && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && (booker_concierge['email'] && organiser.email !==booker_concierge['email']) ) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = 'Checking availability of selected spaces';\n this._dialog_ref.disableClose = true;\n this.checkSpaceAvailability().then(\n () => {\n this.loading = 'Processing booking request...';\n // Change the unchanged settings to the selected room\n const newEmail = this.booking.space.email;\n const replaceObjects = ['setup', 'breakdown', 'approval_status']\n replaceObjects.forEach(key => {\n const obj = this.booking[key];\n if (obj && obj.constructor === Object) {\n const keys = Object.keys(obj);\n if (keys.length > 0) {\n const replacement = {};\n keys.forEach(nk => {\n replacement[newEmail] = obj[nk];\n })\n this.booking[key] = replacement;\n }\n }\n });\n\n const buffer = {};\n this.booking.multi_rooms.map(room => room.email).forEach(elem => buffer[elem] = 900);\n\n // // if no setup or breakdown time already added and notes or catering exist? add 15 min buffer setup and breakdown to booking\n // if(this.booking.setup === null || this.booking.breakdown === null){\n // const has_note_buffer = (this.booking.notes && this.booking.notes?.length) || (this.booking.catering && this.booking.catering?.length) ? \n // buffer : null; // 900 seconds = 15 min\n // if (has_note_buffer) {\n // this.booking.setup = has_note_buffer;\n // this.booking.breakdown = has_note_buffer; \n // this.booking.room_setup = has_note_buffer; \n // this.booking.room_breakdown = has_note_buffer; \n // }\n // }\n\n // if no setup time already added and notes or catering exist? add 15 min buffer setup time to booking\n if (this.booking.setup === null || this.booking.setup === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.setup = has_note_buffer;\n this.booking.room_setup = has_note_buffer;\n }\n }\n\n // if no breakdown time already added and notes or catering exist? add 15 min buffer breakdown time to booking\n if (this.booking.breakdown === null || this.booking.breakdown === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.breakdown = has_note_buffer;\n this.booking.room_breakdown = has_note_buffer;\n }\n }\n\n\n this._bookings.save(this.booking, this._data.action === SeriesAction.EDIT).then(\n async (bkn) => {\n this.loading = null;\n this.success = true;\n this._dialog_ref.disableClose = false;\n const updated = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this._booking_state_service.replace(updated);\n \n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(updated.recurrence_master_id !== null)\n { \n const master_booking = await this._bookings.show(updated.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n if (bkn.is_recurrent && bkn.recurrence_type === 'master') {\n this._booking_state_service.pollOnce();\n this.closeDialogService.closeDialog(DialogIds.MeetingDetails);\n }\n\n localStorage.removeItem('ACA_STAFF.booking_form_data');\n this.event.emit({ reason: 'done' });\n this._service.notifySuccess(\n `Successfully ${this.booking.id ? 'updated' : 'created'} booking`\n );\n },\n (err) => {\n\n this._dialog_ref.disableClose = false;\n let erroMessage: string = '';\n switch(err.status){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 400:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 409:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.lastMomentConflict = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n },\n (err) => {\n\n this.lastMomentConflict = true;\n this._dialog_ref.disableClose = false;\n const erroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n }\n\n /**\n * Staff only\n */\n public newBooking() {\n this._router.navigate(['/book', 'spaces']);\n this._dialog_ref.close();\n }\n\n /**\n * Staff only\n */\n public toSchedule() {\n this._router.navigate(['/schedule'], {\n queryParams: { email: this.booking.organiser.email }\n });\n this._dialog_ref.close();\n }\n\n /**\n * Check whether the selected spaces are available for the selected time period\n */\n public checkSpaceAvailability(): Promise {\n const spaces: Space[] = this.spaces;\n if (\n (this.booking.id &&\n (this.booking.startDateTz.ms === this.old_booking.startDateTz.ms &&\n this.booking.duration === this.old_booking.duration)) ||\n (spaces && spaces.length <= 0)\n ) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n // Use of this.booking.timezone is unreliable, use booking space instead.\n const all_day = this.booking.all_day;\n // R--- should be nothing to do with date as a timestamp getter\n this._spaces\n .available({\n room_ids: spaces.map((space) => space.id).join(','),\n dateTz: this.booking.startDateTz,\n duration: all_day ? 24 * 60 : this.booking.duration,\n ignore: this.booking.icaluid,\n recurrence_count: this.booking.recurrence_count,\n recurrence_period: this.booking.recurrence_period,\n recurrence_endTz: this.booking.recurrence_endTz,\n recurrence_interval: this.booking.recurrence_interval,\n recurrence_starts: this.booking.recurrence_starts,\n is_recurrent: this.booking.is_recurrent,\n recurrence_days: this.booking.recurrence_days\n })\n .then(\n (space_list) => {\n for (const space of space_list) {\n if (!space.bookable) {\n this.lastMomentConflict = true;\n return reject(\n `${space.name} is not available at the select time period.`\n );\n }\n }\n if (space_list.length < spaces.length) {\n this.lastMomentConflict = true;\n return reject(\n `${spaces[0].name} is not available at the select time period.`\n );\n }\n resolve();\n },\n (err) => reject(err)\n );\n });\n }\n\n public openConflictsModal(){\n const ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: this.booking.local_room_name,\n conflicts: this.booking.recurrence_exceptions,\n copy_conflicts: true,\n timezone: this.booking.timezone\n }\n });\n\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n if(event.reason === 'close'){\n ref.close();\n }else if(event.reason === 'action'){\n navigator.clipboard.writeText(this.conflictsText)\n }\n \n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public get conflictsText(){\n let text = ''\n this.booking.recurrence_exceptions.map((date)=>{\n const dateTZ = new DateTZ({date: date*1000});\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n text = `${text}\\n${display}${dateTZ.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n })\n return text\n }\n\n public toggleList(listType: 'attendees' | 'locations' | 'catering') {\n if (listType === 'attendees') {\n this.show_attendees ? this.collapseList(this.attendeesListRef) : this.expandList(this.attendeesListRef);\n this.show_attendees = !this.show_attendees;\n } else if (listType === 'locations') {\n this.show_locations ? this.collapseList(this.locationsListRef) : this.expandList(this.locationsListRef);\n this.show_locations = !this.show_locations;\n } else if (listType === 'catering') {\n this.show_orders ? this.collapseList(this.cateringListRef) : this.expandList(this.cateringListRef);\n this.show_orders = !this.show_orders;\n }\n }\n\n public expandList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n const listItems = listElement.getElementsByClassName('list-item');\n let totalHeight = 0;\n\n for (let i = 0; i < listItems.length; i++) {\n totalHeight += listItems[i].offsetHeight;\n }\n\n this.renderer.setStyle(listElement, 'max-height', `${totalHeight}px`);\n this.renderer.addClass(listElement, 'shown');\n }\n\n public collapseList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n this.renderer.setStyle(listElement, 'max-height', '4.5em');\n this.renderer.removeClass(listElement, 'shown');\n }\n}\n","\n
\n \n
\n \n
\n Booking Details\n Confirmed!\n Requested!\n
\n
Please await confirmation of room
\n
\n
\n \n
{{ title || 'No title' }}
\n
\n
\n \n
{{ when }}
\n
\n
\n \n
{{ recurrence }}
\n 0\"\n (click)=\"openConflictsModal()\"\n >\n Conflicts\n
\n \n
\n \n
{{ duration }}
\n
\n
\n Locations({{ spaces.length || '0' }})*:\n
\n
\n
\n
{{ item?.local_name }}
\n \n Notes\n
\n \n Code\n
\n
\n
No Locations
\n
\n 1\"\n (click)=\"toggleList('locations')\"\n >\n {{ show_locations ? 'Hide' : 'Show more' }} Locations\n \n \n \n
\n \n
{{ organiser?.name || organiser?.email }}
\n
\n
\n \n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n
\n\n
\n \n \n \n \n
\n
\n\n
\n
\n
\n \n
\n
\n {{ loading }}\n
\n
\n
\n
\n\n \n \n \n
My Day\n \n\n","import {\n Component,\n Input,\n OnInit, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter \n} from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { MatDialog } from '@angular/material/dialog';\nimport { distinctUntilChanged, first, skip } from 'rxjs/operators';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n arrayWithValues,\n BookingAction,\n CateringOrder,\n SeriesAction,\n SettingsService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\n\nimport { NewUserModalComponent } from '../new-user-modal/new-user-modal.component';\nimport {\n SpaceSelectModalComponent,\n SpaceSelectModalData\n} from '../space-select-modal/space-select-modal.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { MatChipsModule} from '@angular/material/chips';\n\n\n@Component({\n selector: 'a-booking-form',\n templateUrl: './booking-form.component.html',\n styleUrls: ['./booking-form.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingFormComponent extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n /** List of available users to host bookings */\n public user_list: User[] = [];\n public nowTz: DateTZ = DateNow(new Date());\n /** From date input for date field */\n public fromDateTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n /** Last bookable date, concierge only */\n public readonly untilDateTz = DateNow(new Date()).addValue({ days: 365 }).endOfValue('day');\n public isConcierge: boolean;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\";\n // Define an array to store selected company options\n public chipOptions: any[] = [];\n public showTimeCateringWarning: boolean = false;\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _dialog: MatDialog,\n private settingsService: SettingsService,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n this.isConcierge = this.settingsService.concierge;\n }\n\n public ngOnInit(): void {\n // Trim title \n // this.form.get('title').setValue(this.form.get('title').value.trim());\n\n this.chipOptions = [...this.form.controls.company.value];\n\n this.localTimezone = DateNow(new Date()).building_tz;\n const building_tz = (\n this.form.controls.action &&\n (\n this.form.controls.action.value === 'booking_clone' ||\n this.form.controls.action.value === 'clone' ||\n this.form.controls.action.value === 'edit' ||\n this.form.controls.action.value === 'booking_edit'\n ) &&\n this.form.controls.dateTz &&\n this.form.controls.dateTz.value\n ) ? this.form.controls.dateTz.value.building_tz : this.localTimezone;\n\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz });\n this.fromDateTz = closestToTimeSlotTz(this.nowTz, 15);\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map(\n (del) => this._users.find(del.email) || new User({ email: del.email, name: del.email.split('@')[0] })\n );\n this.user_list = [user].concat(delegates);\n });\n\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n this.subscription('formChanges', this.form.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe(() => {\n this.timeout('update_coachmark', () => {\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n }, 500);\n })\n );\n\n this.subscription('isRecurrentChanges', this.form.controls.is_recurrent.valueChanges\n .subscribe(() => {\n const recurrenceStarts = this.form.controls.recurrence_starts\n if(!this.form.controls.is_recurrent.value){\n recurrenceStarts.clearValidators() \n }else{\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n recurrenceStarts.setValidators(arrayValidators);\n }\n recurrenceStarts.updateValueAndValidity()\n })\n ); \n\n /**Disable Inputs */\n this.disableInputs();\n\n /**turn is_recurrent to false if editing or cloning a stand-alone/occurrence */\n if(this.form.controls.id?.value && !this.form.controls.action?.value){\n this.form.controls.is_recurrent.setValue(false)\n }\n\n // Subscribe to changes in dateTz, duration, and has_catering\n this.subscription('dateTz_changes', this.form.controls.dateTz.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n this.subscription('duration_changes', this.form.controls.duration.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // No need to subscribe to catering_changes since we're now handling has_catering\n this.subscription('has_catering_changes', this.form.controls.has_catering.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // Initial check\n this.checkTimeCateringWarning();\n}\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.form.get(key).setValue(this.form.get(key).value.trim());\n }\n\n /** Whether notes and description should use the HTML editor */\n public get use_html(): boolean {\n return this._service.setting('app.booking.html_body') || false;\n }\n\n /** List of available types for bookings */\n public get booking_types(): Identity[] {\n return this._service.setting('app.booking.booking_types') || [];\n }\n\n /** Display string for the list of active spaces */\n public get spaces(): string {\n const spaces = this.form.controls.space_list.value;\n return spaces.length === 1\n ? spaces[0].local_name\n : spaces.length > 1\n ? `${spaces.length} spaces selected`\n : 'No Spaces selected';\n }\n\n public disableInputs() {\n const { id, action, needs_space, is_recurrent } = this.form.value;\n const has_id = !!id;\n const is_edit = action === BookingAction.EDIT;\n if (has_id) {\n this.form.get('is_recurrent')?.disable();\n }\n\n if(is_edit){\n this.form.get('is_multiroom')?.disable();\n }\n\n if (!this.isConcierge && !needs_space) {\n this.form.get('has_catering')?.disable();\n }\n if(has_id && is_edit && is_recurrent){\n this.form.get('dateTz')?.disable()\n this.form.patchValue({ action: null });\n }\n }\n\n /**\n * Open modal to change the space details for the booking\n */\n public openSpacesModal(): void {\n const ref = this._dialog.open(\n SpaceSelectModalComponent,\n {\n width: 'auto',\n height: 'auto',\n maxWidth: '95vw',\n data: {\n spaces: this.form.controls.space_list.value,\n dateTz: this.form.controls.dateTz.value,\n duration: this.form.controls.duration.value,\n host: this.form.controls.organiser.value,\n multiple: true,\n needsCatering: !!this.form.controls.catering?.value?.length,\n }\n }\n );\n this.subscription(\n 'new_spaces',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n let space_list = this.form.controls.space_list.value;\n space_list = event.metadata;\n this.form.controls.space_list.setValue(unique(space_list, 'id'));\n if (event.noCatering) {\n // Set has_catering to false and clear the catering list\n this.form.controls.has_catering.setValue(false);\n this.form.controls.catering?.setValue([]);\n } else {\n const catering = this.form.controls?.catering?.value.map((order: CateringOrder) => {\n order.location = space_list[0].name;\n order.location_id = space_list[0].email;\n return order;\n });\n this.form.controls.catering?.setValue(catering || []);\n }\n ref.close();\n this.unsub('new_spaces');\n }\n if (event.reason === 'close') {\n ref.close();\n this.unsub('new_spaces');\n }\n })\n );\n }\n\n /**\n * Open modal to change the recurrence details for the booking\n */\n public openNewUserModal() {\n const ref = this._dialog.open(NewUserModalComponent, {\n width: 'auto',\n height: 'auto'\n });\n this.subscription(\n 'new_user',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const attendees = this.form.controls.attendees?.value;\n attendees.push(event.metadata);\n this.form.controls.attendees.setValue(unique(attendees, 'email'));\n ref.close();\n this.unsub('new_user');\n this.cdRef.detectChanges();\n }\n })\n );\n }\n\n // Add & Remove chip and set the value of the form control accordingly\n addCompany(event, company): void {\n if (company) {\n this.chipOptions.push(company);\n this.form.controls.company.setValue(this.chipOptions);\n }\n event.preventDefault();\n }\n\n removeOption(option: any): void {\n const index = this.chipOptions.indexOf(option);\n if (index >= 0) {\n this.chipOptions.splice(index, 1);\n }\n this.form.controls.company.setValue(this.chipOptions);\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (!timezone) timezone = this.localTimezone;\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n const dateTz = this.form.controls.dateTz.value;\n if (dateTz && localTzOffset !== buildingTzOffset) {\n const startDate = dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.form.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n this.cdRef.detectChanges();\n }\n\n public get isSeriesAction(){\n return this.form.value.action === SeriesAction.CLONE || this.form.value.action === SeriesAction.EDIT\n }\n\n onToggleChange(toggledControlName: string, is_multiroom: boolean): void {\n if (toggledControlName === 'is_recurrent') {\n // If the is_recurrent toggle is being activated, deactivate is_multiroom\n if (this.form.controls.is_recurrent?.value) {\n this.form.controls.is_multiroom?.setValue(false);\n this.form.controls.merged?.setValue(false);\n this.form.get('merged')?.disable();\n\n }\n } else if (toggledControlName === 'is_multiroom') {\n // If the is_multiroom toggle is being activated, deactivate is_recurrent\n if (this.form.controls.is_multiroom?.value) {\n this.form.controls.is_recurrent?.setValue(false);\n }\n if(is_multiroom) { \n this.form.get('merged').setValue(false);\n this.form.get('merged')?.enable() \n } else {\n this.form.get('merged').setValue(false); \n this.form.get('merged')?.disable(); }\n }\n }\n \n private checkTimeCateringWarning() {\n const dateTz = this.form.controls.dateTz.value;\n const duration = this.form.controls.duration.value;\n const hasCatering = this.form.controls.has_catering?.value;\n const cateringOrders = this.form.controls.catering?.value;\n \n if (dateTz && duration && hasCatering && cateringOrders && cateringOrders.length > 0) {\n // Create DateTime object for the start time\n const startDateTime = DateTime.fromISO(dateTz.date, { zone: dateTz.building_tz });\n \n // Calculate the end time\n const endDateTime = startDateTime.plus({ minutes: duration });\n \n // Get the date part of the startDateTime\n const bookingDate = startDateTime.startOf('day');\n\n // Define 7 am and 8 pm on the booking date\n const dayStartAt7am = bookingDate.set({ hour: 7 });\n const dayEndAt8pm = bookingDate.set({ hour: 20 });\n\n // Check if booking ends before or at 7 am, or starts at or after 8 pm\n if (endDateTime <= dayStartAt7am || startDateTime >= dayEndAt8pm) {\n // Booking is outside of catering hours and has catering selected\n this.showTimeCateringWarning = true;\n } else {\n this.showTimeCateringWarning = false;\n }\n } else {\n this.showTimeCateringWarning = false;\n }\n\n // Inform Angular that the component needs to be checked\n this.cdRef.markForCheck();\n }\n\n}\n","
\n \n \n \n
\n
\n \n Title*:\n \n \n \n\n \n {{ ( form?.get('title').errors && form?.get('title').hasError('pattern')) \n ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Title is required'}} \n \n \n
\n\n
\n \n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n \n \n
\n \n
\n Duration is invalid. End time must be in the future\n
\n
\n
\n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n Warning: Changing the booking time outside of catering hours will drop your catering order.\n
\n
\n
\n
\n
\n Recurring booking\n
\n \n
\n Multiroom\n
\n
\n \n
\n
Merged
\n
\n \n
\n
\n \n \n
\n \n \n \n \n \n {{ user.name || user.email }}\n \n \n \n
\n
\n \n \n \n {{ form?.get('attendees').errors?.customError }}\n \n
\n
\n \n
\n \n
\n \n
\n \n \n {{ ( form?.get('company').errors && form?.get('company').hasError('pattern'))\n ? 'Some special characters (^=`~@#$%*{};:_\\\",.\\<>) are not allowed' : ''}}\n \n
\n \n
\n \n \n {{ selected }}\n
\n
\n
\n
\n\n
1\">\n \n \n \n \n {{ type.name }}\n \n \n \n
\n
\n Need a meeting space?\n \n
\n
\n \n \n Need catering?\n \n
\n
\n \n \n \n \n \n \n \n
\n\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringItem,\n OrganisationService,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringConfirmModalData {\n all_day: boolean;\n form: FormGroup;\n dateTz: DateTZ;\n}\n\n@Component({\n selector: 'a-catering-confirm-modal',\n templateUrl: './catering-confirm-modal.component.html',\n styleUrls: ['./catering-confirm-modal.component.scss']\n})\nexport class BookingCateringConfirmModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** List of selected items for the order */\n public item_list: CateringItem[] = [];\n\n /** Space selected for delivery */\n public get space(): Space {\n return this._spaces.find(this._data.form?.controls?.location_id?.value);\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n let date = this._data.dateTz;\n if (this._data.form && this._data.form.controls.delivery_time) {\n date = date.addValue({ minutes: this._data.form.controls.delivery_time.value });\n }\n return date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Form field for order items */\n public get item_field(): FormControl {\n return this._data.form.controls.items as any;\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n return this.item_list.reduce((amount, item) => {\n const price = item.price\n return amount + item.amount * price\n }, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.space || !this.space.level) {\n return 'USD';\n }\n const building = this._org.buildings.find(\n (bld) => bld.id === this.space.level.building_id\n ) || { currency: 'USD' };\n return building.currency;\n }\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: CateringConfirmModalData\n ) {\n super();\n if (!this._data.form) {\n this._service.notifyError('No form data for order');\n this._dialog_ref.close();\n }\n }\n\n public ngOnInit(): void {\n /* istanbul ignore else */\n if (this._data.form.controls.items) {\n this.subscription(\n 'item_list',\n this._data.form.controls.items.valueChanges.subscribe((items) => {\n /* istanbul ignore else */\n if (!items || items.length <= 0) {\n this._dialog_ref.close();\n }\n })\n );\n }\n this.item_list = this._data.form.controls.items.value.map((item) => new CateringItem(item.toJSON()));\n }\n}\n","
\n
Confirm Catering Order
\n \n
\n\n
\n
\n Delivering to {{ space?.local_name || space?.simple_name || space?.settings?.room_name }} at {{ delivery_time }}\n
\n
\n \n
\n
\n \n
{{ order_cost / 100 | currency:symbol }}
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n OrganisationService,\n BookingNote,\n CateringOrder,\n Space,\n UsersService,\n CateringNotesService,\n Booking\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n catering: AbstractControl;\n booking: Booking\n}\n\n@Component({\n selector: 'a-catering-details-modal',\n templateUrl: './catering-details-modal.component.html',\n styleUrls: ['./catering-details-modal.component.scss']\n})\nexport class CateringDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: HashMap = {};\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return (this._data.spaces || []).filter((space) =>\n this._data.catering.value.find((order) => order.location_id === space.email)\n );\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.pattern || this.active_form.controls.code.errors?.minlength;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n return this.space_list.reduce(\n (valid, space) => valid && this.form[space.email].valid,\n true\n );\n }\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _cateringNotesService: CateringNotesService,\n @Inject(MAT_DIALOG_DATA) private _data: CateringDetailsModalData\n ) {\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type === 'catering'\n );\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = this._data.catering.value.reduce((map, order: CateringOrder) => {\n map[order.location_id] = order.charge_code;\n return map;\n }, {});\n this.generateFormFields();\n }\n\n public submit(): void {\n this.space_list.forEach((space) => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes\n const notes = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type !== 'catering'\n );\n const new_notes = this.space_list.map(\n (space) =>\n ({\n author: this._data.booking.booked_by ? this._data.booking.booked_by['name'] : this._users.current.name,\n type: 'catering',\n message: this.form[space.email].controls.notes.value,\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote)\n );\n this._cateringNotesService.setNotes(new_notes);\n this._data.notes_field.setValue(notes.concat(new_notes).filter((note) => note.message));\n // Save the notes\n const orders = this._data.catering.value.map(\n (order) =>\n new CateringOrder({\n ...order,\n charge_code: this.form[order.location_id]\n ? this.form[order.location_id].controls.code.value\n : ''\n })\n );\n\n this._data.catering.setValue(orders);\n // This should go to the next\n this.event.emit({ reason: 'done' });\n } else {\n this._scrollToBottom();\n }\n }\n\n /** Generate form fields for each space */\n private generateFormFields(): void {\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space.level.building_id\n );\n \n this.needs_charge_code[space.email] = space?.filters?.charge_code || space?.settings?.charge_code || false;\n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(this.codes[space.email] || '',\n this.needs_charge_code[space.email] ?\n [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4), Validators.required ] : [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4)])\n });\n }\n }\n\n /** Scroll the content container to the bottom */\n private _scrollToBottom(): void {\n this._content_el?.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n}\n","
\n
\n \n \n \n
\n \n
\n\n
\n
\n \n
Please specify any allergies or gluten intolerances
\n
\n
\n
\n \n \n \n \n
\n
\n \n Charge Code\n *\n \n \n \n \n Note: Your booking will be confirmed before you are charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\nexport interface ConfirmModalData {\n /** Title of the modal */\n title: string;\n /** Contents of the modal */\n content: string;\n /** Text displaed on the confirmation button */\n action?: string;\n /** Icon to display on the modal */\n icon: ApplicationIcon;\n}\n\nexport const CONFIRM_METADATA = {\n height: 'auto',\n width: '24em',\n maxHeight: 'calc(100vh - 2em)',\n maxWidth: 'calc(100vw - 2em)'\n};\n\n@Component({\n selector: 'confirm-modal',\n templateUrl: './confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss']\n})\nexport class ConfirmModalComponent extends BaseDirective {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Loading state */\n public loading: string;\n\n /** Title of the confirm modal */\n public get title(): string {\n return (this._data ? this._data.title : null) || 'Confirm';\n }\n\n /** Body of the confirm modal */\n public get content(): string {\n return (this._data ? this._data.content : null) || 'Are you sure?';\n }\n\n /** Display text on the confirm button */\n public get action(): string {\n return (this._data ? this._data.action : null) || 'Ok';\n }\n\n /** Display icon properties */\n public get icon(): ApplicationIcon {\n return (this._data ? this._data.icon : null) || null;\n }\n\n constructor(\n private _dialog: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: ConfirmModalData\n ) {\n super();\n }\n\n /**\n * User confirmation of the content of the modal\n */\n public accept() {\n this.event.emit({ reason: 'done' });\n }\n}\n","
\n

{{ title || 'Confirm' }}

\n
\n\n
\n \n
\n

\n
\n
\n
\n\n
\n \n \n
\n
\n\n
\n
\n
\n \n
\n
{{ loading }}
\n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { LegacyUiModule } from '@mckinsey-converge/legacy-ui';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SpaceSelectModalComponent } from './space-select-modal/space-select-modal.component';\nimport { NewUserModalComponent } from './new-user-modal/new-user-modal.component';\nimport { ConfirmModalComponent } from './confirm-modal/confirm-modal.component';\nimport { NoCateringModalComponent } from './no-catering-modal/no-catering-modal.component';\nimport { BookingCateringConfirmModalComponent } from './catering-confirm-modal/catering-confirm-modal.component';\nimport { CateringDetailsModalComponent } from './catering-details-modal/catering-details-modal.component';\nimport { RequirementDetailsModalComponent } from './requirement-details-modal/requirement-details-modal.component';\nimport { BookingConfirmComponent } from './booking-confirm/booking-confirm.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UserFormComponent } from './user-form/user-form.component';\nimport { BookingFormComponent } from './booking-form/booking-form.component';\nimport { EditorModule } from '@tinymce/tinymce-angular';\n\nconst DECLARATIONS = [\n SpaceSelectModalComponent,\n NewUserModalComponent,\n ConfirmModalComponent,\n NoCateringModalComponent,\n BookingCateringConfirmModalComponent,\n CateringDetailsModalComponent,\n RequirementDetailsModalComponent,\n BookingConfirmComponent,\n UserFormComponent,\n BookingFormComponent,\n];\n\n@NgModule({\n imports: [\n LegacyUiModule,\n FormsModule,\n ReactiveFormsModule,\n CommonModule,\n UiModule,\n BaseModule,\n EditorModule,\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ...DECLARATIONS,\n BaseModule\n ]\n})\nexport class LegacyOverlaysModule {\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\n\nimport { BaseDirective, DialogEvent } from '@mckinsey-converge/base';\nimport { generateUserForm, User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'new-user-modal',\n templateUrl: './new-user-modal.component.html',\n styleUrls: ['./new-user-modal.component.scss'],\n})\nexport class NewUserModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Form fields for the new user */\n public form: FormGroup;\n /** New user data store */\n public user: User;\n /** Whether user details are being saved */\n public loading: boolean;\n\n public ngOnInit(): void {\n this.user = new User();\n this.form = generateUserForm(this.user);\n }\n\n public saveChanges() {\n this.form.markAllAsTouched();\n if (this.form.valid) {\n if (!this.form.controls.email.value) {\n this.form.controls.email.setValue(\n `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`\n );\n }\n const firstName = this.form.value.first_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n const lastName = this.form.value.last_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n \n const new_user = new User({\n ...this.form.value,\n name: `${firstName} ${lastName}`,\n type: 'external',\n external: true,\n visitor: true,\n });\n this.event.emit({ reason: 'done', metadata: new_user });\n }\n }\n}\n","
\n

Add External Attendee

\n \n
\n
\n \n
\n
\n \n \n
\n\n
\n
\n
\n \n
\n
\n Saving attendee...\n
\n
\n
\n
\n\n","import {\n Component,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'no-catering-modal',\n templateUrl: './no-catering-modal.component.html',\n styleUrls: ['./no-catering-modal.component.scss']\n})\nexport class NoCateringModalComponent extends BaseDirective {\n constructor(\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n // /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n\n // Submit the Survey in it's current state.\n public confirm() {\n this.event.emit({ reason: 'done', noCatering: true });\n this._dialog_ref.close();\n }\n\n // Close the modal\n public cancel() {\n this.event.emit({ reason: 'close' });\n this._dialog_ref.close();\n }\n}\n","
\n \n
\n
\n
\n \n

Catering is not available for your new room selection. \n
Are you sure you want to drop order and change rooms?

\n
\n
\n \n \n \n
\n
\n
","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n BookingNote,\n OrganisationService,\n SettingsService,\n Space,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface RequirementDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n codes_field: AbstractControl;\n head_counts_field: AbstractControl;\n standalone?: boolean;\n}\n\n@Component({\n selector: 'a-requirement-details-modal',\n templateUrl: './requirement-details-modal.component.html',\n styleUrls: ['./requirement-details-modal.component.scss']\n})\nexport class RequirementDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: boolean;\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return this._data.spaces;\n }\n\n public get has_recurrence(): boolean {\n return false\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.minlength || this.active_form.controls.code.errors?.pattern;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n // return this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n return this.space_list.length > 0 && this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n }\n\n public isConcierge: boolean;\n public frontend: string;\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n @Inject(MAT_DIALOG_DATA) private _data: RequirementDetailsModalData,\n private _settings: SettingsService,\n ) {\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value\n .filter((note: BookingNote) => note.type === 'equipment');\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = { ...this._data.codes_field.value };\n this.head_counts = { ...this._data.head_counts_field.value };\n this.generateFormFields();\n }\n\n public submit(): void {\n // Get the email of the first space\n const firstSpaceEmail = this.space_list[0].email;\n\n // Copy values from the first space's form controls to all other spaces\n this.space_list.forEach(space => {\n if (space.email !== firstSpaceEmail) {\n this.form[space.email].controls.notes.setValue(this.form[firstSpaceEmail].controls.notes.value);\n this.form[space.email].controls.code.setValue(this.form[firstSpaceEmail].controls.code.value);\n this.form[space.email].controls.head_count.setValue(this.form[firstSpaceEmail].controls.head_count.value);\n }\n });\n\n this.space_list.forEach(space => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes \n const notes = this._data.notes_field.value\n .filter((note: BookingNote) => note.type !== 'equipment');\n const new_notes = this.space_list.map(space => ({\n author: this._users.current.name,\n type: 'equipment',\n message: this.form[space.email].controls.notes.value.trim(),\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote));\n this._data.notes_field.setValue(notes.concat(new_notes).filter(note => note.message));\n this._data.codes_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.code.value;\n return map;\n }, {}));\n this._data.head_counts_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.head_count.value;\n return map;\n }, {}));\n this.event.emit({ reason: 'done' });\n } else {\n this._content_el.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n }\n\n /** Generate form fields for each space */\n // private generateFormFields(): void {\n // for (const space of this.space_list) {\n // const building = this._org.buildings.find(\n // bld => bld.id === space[0]?.level.building_id\n // );\n // // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n // const { filters, settings } = space;\n // const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n // const officeBasedEqCode = building?.required?.equipment_code;\n // this.needs_charge_code[space.email] = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n\n // this.form[space.email] = new FormGroup({\n // notes: new FormControl(this.notes[space.email] || ''),\n // code: new FormControl(\n // this.codes[space.email] || '',\n // this.needs_charge_code[space.email] ?\n // [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] : [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n // ),\n // head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n // });\n // }\n // }\n \n private generateFormFields(): void {\n // Initialize a variable to determine if any space needs a charge code\n let anySpaceNeedsChargeCode = false;\n \n // First pass to determine if any space needs a charge code\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space?.level.building_id\n );\n const { filters, settings } = space;\n const roomBasedEqCode = filters?.equipment_code;\n const officeBasedEqCode = building?.required?.equipment_code;\n \n // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n if (roomBasedEqCode || officeBasedEqCode) {\n anySpaceNeedsChargeCode = true;\n this.needs_charge_code = true;\n break;\n } else{\n this.needs_charge_code = false;\n }\n }\n \n // Second pass to create form groups with the determined charge code requirement.\n // We show only the first space, but if one of the selected spaces needs a mandatory charge code,\n // then all spaces need a mandatory charge code\n for (const space of this.space_list) { \n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(\n this.codes[space.email] || '',\n anySpaceNeedsChargeCode ?\n [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] :\n [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n ),\n head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n });\n }\n }\n}\n","
\n
\n \n \n \n \n {{\n this.space_list.length > 1 ? this.space_list.length + ' spaces selected' :\n this.space_list[0]?.local_name || 'No spaces selected'\n }}\n \n \n \n \n
\n \n
\n\n
\n
\n \n
\n {{\n has_recurrence && !isConcierge\n ? 'To update headcount information, add equipment or catering, please edit individual meeting occurences in My Day'\n : \"Would you like to add equipment to your booking's spaces?\"\n }}\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n Charge Code*\n \n \n \n \n Note: Your booking will be confirmed before you are\n charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n \n Headcount Estimate*\n \n \n \n \n Note: This estimate is used to calculate catering and/or\n assign rooms. Please keep updated of any changes.\n \n \n Headcount Estimate is required\n \n \n
\n \n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n Building,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n OrganisationService,\n SettingsService,\n Space,\n SpaceBookingRuleOptions,\n SpacesService,\n toggleSelectedByGroup,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n DialogEvent,\n HashMap,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport { NoCateringModalComponent } from '../no-catering-modal/no-catering-modal.component'\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport interface SpaceSelectModalData {\n /** List of selected spaces */\n spaces: Space[];\n /** Start time for availability of spaces */\n dateTz: DateTZ;\n /** Duration of the availability block to look for */\n duration: number;\n /** Host of the booking being made */\n host: User;\n /** Whether multiple spaces can be selected */\n multiple: boolean;\n /** Force zone ids */\n zone_ids?: string;\n /** Booking needs catering */\n needsCatering?: boolean,\n}\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'a-space-select-modal',\n templateUrl: './space-select-modal.component.html',\n styleUrls: ['./space-select-modal.component.scss']\n})\nexport class SpaceSelectModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Whether space list is being loaded */\n public loading: boolean;\n /** List of available spaces to select from */\n public spaces: Space[] = [];\n /** Active building to filter spaces on */\n public active_building: Building;\n /** Active building to filter spaces on */\n public active_type: Identity;\n /** List of items from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public readonly change$ = new Subject();\n /** List of currently selected spaces */\n public selected_spaces: Space[] = [];\n /** Mapping as to whether a space is by request */\n public request_map: HashMap = {};\n /** Whether selected list should be shown on mobile */\n public show_list: boolean;\n\n /** host to load (only in staff) **/\n public host: User;\n\n /** List of available buildings */\n public types: Identity[] = [];\n\n public isConcierge: boolean;\n public frontend: string;\n\n /** List of available buildings */\n public get buildings(): Building[] {\n return this._org.buildings;\n }\n\n /** Whether multiple spaces can be selected */\n public get multiple(): boolean {\n return false;\n }\n\n public get has_zone(): boolean {\n return !!this._data.zone_ids;\n }\n\n public formGroup = new FormGroup({\n location: new FormControl([]),\n });\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n\n public noCateringDialogRef: MatDialogRef;\n\n /** List of zones to filter the spaces on */\n public zone_ids: string[] = [];\n\n\n public get initialBuildingIds(): string[] {\n return this._org.building ? [this._org.building.id] : [];\n }\n\n public savedSelection\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _spaces: SpacesService,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n @Inject(MAT_DIALOG_DATA) private _data: SpaceSelectModalData\n ) {\n super();\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n let request_id = 0;\n // Listen for input changes\n this.search_results$ = this.change$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap((bld) => {\n this.loading = true;\n const zone_ids: string[] = [];\n /* istanbul ignore else */\n if (this.active_building) {\n zone_ids.push(this.active_building.id);\n }\n\n if (bld?.includes('|')) {\n bld = this.savedSelection\n }\n\n const id = request_id;\n return this._spaces.available({\n zone_ids: bld?.length ? bld : this._data.spaces[0].building.id || zone_ids.join(','),\n dateTz: this._data.dateTz,\n duration: this._data.duration\n }).then(async (list) => ({ id, list }));\n }),\n catchError((_) => of({ id: request_id, list: [], error: _ })),\n map((resp: { id: number, list: Space[] }) => {\n this.loading = false;\n const filtered_list = resp.list.filter((space: Space) => {\n // if concierge skip rules check.\n if (this._settings.concierge) {\n return (this.active_type && this.active_type.id ? space.zones.includes(`${this.active_type.id}`) : true) &&\n !this.selected_spaces.find((s) => s.id === space.id);\n }\n\n const rules = space.rulesFor({\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this.host || this._data.host\n });\n return (\n rules.hide !== true &&\n (this.active_type && this.active_type.id\n ? space.zones.includes(`${this.active_type.id}`)\n : true) &&\n !this.selected_spaces.find((_space) => _space.id === space.id)\n );\n });\n return resp.id === request_id ? filtered_list : this.spaces;\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.spaces = list.filter((space) => {\n if (!space.available) {\n return false;\n }\n for (const zone of this.zone_ids) {\n if (space.zones.includes(zone)) {\n return true;\n }\n }\n return !this.zone_ids.length;\n });\n this.spaces.sort((a, b) => this.sort(a, b));\n if (!this.selectedOptions.value.length) {\n this.setDefaultBuilding()\n }\n })\n );\n this.active_building = this._data.spaces?.length\n ? this._org.buildings.find((i) => i.id === this._data.spaces[0].level.building_id)\n : this._org.building;\n this.types = [{ id: '', name: 'Any Space Type' } as any].concat(\n this._org.space_types || []\n );\n this.active_type = this.types[0];\n this.change$.next('');\n });\n\n this.subscription('buildings', this._org.listen('buildings').subscribe((bld_list) => {\n const city = this._org.building.city\n const timezone = this._org.building.timezone\n const grouped_by_city = {\n key: { name: city, timezone },\n value: bld_list?.filter((bld) => bld.city === city) || []\n }\n const city_buildings = grouped_by_city.value.map(\n (bld) => mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n )\n const buildings = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings\n ]\n this.options.next(buildings)\n }));\n\n }\n\n /** Add space to selected list */\n public addSpace(space: Space) {\n this.selected_spaces.push(space);\n this.selected_spaces = unique(this.selected_spaces, 'id');\n }\n\n /** Remove space from selected list */\n public removeSpace(space: Space) {\n this.selected_spaces = this.selected_spaces.filter((a_space) => a_space.id !== space.id);\n }\n\n /** Emit current state of the selected list */\n public save(list: Space[]) {\n if (!this._data.needsCatering) {\n // No catering order to warn about\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // Check if the room has catering \n if (list[0].has_catering) {\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // If not warn that the room doesn't have catering\n this.noCateringDialogRef = this._dialog.open(NoCateringModalComponent, {\n panelClass: 'mck-modal-mini',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.subscription(\n 'no-catering-modal',\n this.noCateringDialogRef.componentInstance.event.subscribe((event) => {\n if (event.reason === 'done') {\n this.event.emit({ reason: 'done', metadata: list, noCatering: event.noCatering });\n }\n if (event.reason === 'close') {\n this.event.emit({ reason: 'close' });\n }\n })\n );\n }\n\n private update() {\n const map = {};\n const options: SpaceBookingRuleOptions = {\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this._data.host\n };\n this.selected_spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.request_map = map;\n }\n\n public setDefaultBuilding() {\n const defaultBld = this.options.value.filter(opt => opt.value === this._org.building.id)\n this.selectedOptions.next(defaultBld)\n }\n\n /**\n * Compare two spaces to determine order\n * @param space_a\n * @param space_b\n */\n public sort(space_a: Space, space_b: Space) {\n const bld = this._org.buildings.find((bld) => space_a.zones.includes(bld.id)) || { name: '', sort_order: [] };\n const bld_b = this._org.buildings.find((bld) => space_b.zones.includes(bld.id));\n if (bld && bld !== bld_b) {\n return bld.name.localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = space_a.zones.indexOf(zone_id) >= 0;\n const b_has_zone = space_b.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n return space_a.name.localeCompare(space_b.name);\n }\n\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n const formData = this.formGroup.value;\n this.formGroup.setValue({\n location: formData.location,\n });\n this.selectedOptions.next(next);\n this.savedSelection = next.map((bld) => bld.value)\n\n });\n }\n\n /**\n * Update the selected space list\n * @param space Space to add/toggle in the selected list\n */\n public selectSpace(space: Space) {\n const list = this.spaces;\n if (list.find((item) => item.id === space.id)) {\n this.spaces = list.filter((item) => item.id !== space.id);\n } else {\n this.spaces = [space];\n }\n }\n\n public clearList() {\n this.spaces = []\n this.savedSelection = []\n }\n\n public triggerSearch = () => {\n if (this.savedSelection.length) {\n this.change$.next(this.savedSelection)\n } else {\n this.spaces = []\n }\n }\n\n}\n","
\n
Select meeting space{{ multiple ? 's' : '' }}
\n \n
\n\n
\n
\n \n \n 1\">Type\n 1\">\n \n \n {{ type?.name }}\n \n \n \n \n
\n \n \n
\n
\n
{{ space.local_name }}
\n
{{ space.level.name }}
\n
\n
\n \n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n {{ (!isConcierge && request_map[space.id]) ? 'Request' : 'Select' }}\n \n
\n
\n
\n
\n
\n
\n
\n

Selected spaces

\n
\n \n
\n \n \n
\n
\n
{{ space.name }}
\n
{{ space.level.name }}
\n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n \n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
Loading available spaces...
\n
\n
\n\n
\n
\n \n
\n
No results available, please select another office.
\n
\n
\n\n
\n
\n \n
\n
No selected spaces
\n
\n
\n","import { Component, Input } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'user-form',\n templateUrl: './user-form.component.html',\n styleUrls: ['./user-form.component.scss']\n})\nexport class UserFormComponent {\n /** Group of form fields used for creating the system */\n @Input() public form: FormGroup;\n}\n","
\n
\n
\n First Name:\n \n \n First name is required\n \n \n
\n
\n Last Name:\n \n \n Last name is required\n \n
\n
\n Email:\n \n \n A valid email is required\n \n
\n
\n
\n","export * from './lib/legacy-ui.module';\nexport * from './lib/custom-fields';\nexport * from './lib/icon/icon.component';\nexport * from './lib/feedback/feedback.component';\nexport * from './lib/action-icon/action-icon.component';\nexport * from './lib/user-avatar/user-avatar.component';\nexport * from './lib/bookings/catering/item/item.component';\nexport * from './lib/cng-search-bar/cng-search-bar.component';\n","import { Component, OnInit, Input } from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'action-icon',\n templateUrl: './action-icon.component.html',\n styleUrls: ['./action-icon.component.scss']\n})\nexport class ActionIconComponent implements OnInit {\n /** Icon to display */\n @Input() public icon: ApplicationIcon;\n /** Whether action is being processed */\n @Input() public loading: boolean;\n /** State of the action */\n @Input() public state: 'success' | 'error' | '' = '';\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","
\n \n
\n \n
\n
\n \n
\n
\n","import {\n Component,\n Input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { FormControl } from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringCategory,\n CateringItem,\n SettingsService\n} from '@mckinsey-converge/data-common';\nimport { ANIMATION_SHOW_CONTRACT_EXPAND } from '@mckinsey-converge/animations';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { PackageOptionsModalComponent } from '../package-options-modal/package-options-modal.component';\n\nfunction hasSelectionRequirements(category: CateringCategory) {\n return (\n category.must_select < category.items.length ||\n (category.must_select === category.items.length &&\n category.items.find((item: any) => item.items && item.must_select < item.items.length))\n );\n}\n\nfunction getActiveList(category: CateringCategory) {\n const items = category.items || [];\n let list = items.filter((item) => item.amount > 0).map((item) => item.id);\n for (const item of items) {\n if ((item as any).items && (item as any).items.length) {\n list = list.concat(getActiveList(item as any));\n }\n }\n return list;\n}\n\n@Component({\n selector: 'a-catering-menu-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss'],\n animations: [ANIMATION_SHOW_CONTRACT_EXPAND]\n})\nexport class CateringMenuItemComponent extends BaseDirective implements OnChanges {\n /** Whether item is a child of another */\n @Input() public subitem: boolean;\n /** Item to display */\n @Input() public item: CateringCategory;\n /** Field for storing items */\n @Input() public field: FormControl;\n /** Current symbol for the selected space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Whether to show children items */\n public show_children: boolean;\n public initial_state = null;\n\n /** List of contents of the package */\n public get contents(): string {\n return this.item.items\n ? this.item.items.reduce((list, item) => {\n /* istanbul ignore else */\n if (list) {\n list += '\\n\\n';\n }\n return (list += `${item.name}${\n (item as any).items\n ? (item as any).items.reduce(\n (a_list, an_item) =>\n (a_list += `\\n ${an_item.amount ? '✓' : '•'} ${an_item.name} `),\n ''\n )\n : ''\n } ${item.amount ? '✓' : ''}`);\n }, '')\n : '';\n }\n\n constructor(private _service: ApplicationService, private _dialog: MatDialog,\n public settings: SettingsService) {\n super();\n // on the item selection set the revert/close state\n this.initial_state = this.item;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.field && this.field) {\n const list = this.field.value;\n // check the category\n let item = list.find((an_cat) => an_cat.id === this.item.id);\n if (item) {\n // update the category level amount\n this.item.setAmount(item ? item.amount : 0);\n } else {\n // find a category item\n for (var cat of list) {\n item = cat?.items.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(item ? item.amount : 0);\n break;\n }\n }; \n } \n\n // On the confirm catering order modal set the revert/close state\n if (!this.initial_state && this.item.amount) {\n this.initial_state = this.item;\n }\n\n this.subscription(\n 'field_change',\n this.field.valueChanges.subscribe((list) => {\n const item = list.find((an_item) => an_item.id === this.item.id);\n this.item.setAmount(item ? item.amount : 0);\n this.updatePackageSelection();\n })\n );\n }\n }\n\n /**\n * Update the amount of the item in the order\n * @param value New amount\n */\n public updateAmount(value: number) {\n /* istanbul ignore else */\n if (this.field) {\n const list: CateringItem[] = this.field.value;\n const item = list.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(value);\n item.setAmount(value);\n // MCK-1550 fix\n const price = this.item.price;\n item.setPrice(price)\n } else {\n const amount = this.item.amount;\n this.item.setAmount(value);\n if (\n this.item.package &&\n amount < value &&\n this.item.items &&\n this.item.items.length &&\n hasSelectionRequirements(this.item)\n ) {\n this.selectPackageOptions().then(\n (confirmed_item) => {\n list.push(new CateringCategory(confirmed_item));\n this.field.setValue(list.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n } else {\n list.push(new CateringItem(this.item));\n }\n }\n this.field.setValue(list.filter((an_item) => an_item.amount));\n }\n }\n\n public updatePackageSelection() {\n const cart_item = this.field.value.find((item) => item.id === this.item.id);\n if (cart_item) {\n const active_items = getActiveList(cart_item);\n this.timeout(\n 'update_package',\n () => {\n this.item.items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n if ((item as any).items) {\n (item as any).items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n });\n }\n });\n },\n 5\n );\n }\n }\n\n /** Reselect package options */\n public updatePackageOptions(): void {\n let updatedList: CateringItem[] = [];\n this.selectPackageOptions().then(\n (confirmed_item) => {\n // Update the existing category package\n this.field.value.forEach((category: CateringCategory) => {\n if (category.id === confirmed_item.id) {\n updatedList.push(new CateringCategory(confirmed_item))\n } else {\n updatedList.push(category)\n }\n })\n this.field.setValue(updatedList.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n }\n\n /**\n * Open modal for user to select package options\n */\n private selectPackageOptions(): Promise {\n return new Promise((resolve, reject) => {\n const ref = this._dialog.open(PackageOptionsModalComponent, {\n maxWidth: '95vw',\n data: {\n item: new CateringCategory(this.item)\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n let done = false;\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n done = true;\n resolve(ref.componentInstance.item);\n this.initial_state = this.item;\n ref.close();\n }\n });\n ref.afterClosed().subscribe(() => {\n /* istanbul ignore else */\n if (!done) {\n if (this.initial_state) {\n resolve(this.initial_state);\n } else {\n reject();\n }\n }\n });\n });\n }\n}\n","\n \n
\n
{{ item.name }}
\n
{{ item.package ? '[Package] ' : '' }}{{ item.description }}
\n
\n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n { item.availableItems.length, plural, =1 { Contains {{ item.availableItems.length }} item } other {\n Contains {{ item.availableItems.length }} items } }\n
\n 0\"\n [matTooltip]=\"contents\"\n >\n {{ item.must_select }}\n \n Selected\n \n
\n 0\"\n (click)=\"updatePackageOptions()\"\n i18n=\"Catering order item options change action\"\n >\n Customise\n \n \n \n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n \n \n \n\n
\n \n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n CateringCategory,\n CateringItem\n} from '@mckinsey-converge/data-common';\n\nexport interface PackageOptionsModalData {\n item: CateringCategory;\n}\n\nexport function checkItemRequirements(category: CateringCategory): boolean {\n const items = category.items || [];\n return category.must_select >= items.length\n ? items.reduce((valid, item) => valid && checkItemRequirements(item as any), true)\n : items.reduce((amount, item) => amount + (item.amount ? 1 : 0), 0) ===\n category.must_select;\n}\n\nexport function getActiveItems(category: CateringCategory): HashMap {\n let map = {};\n if (category.items) {\n const item = category.items.find(item => item.amount > 0);\n if (item) {\n map[category.id] = item.id;\n }\n category.items.forEach(item => map = { ...map, ...getActiveItems(item as any) });\n }\n return map;\n}\n\n@Component({\n selector: 'a-package-options-modal',\n templateUrl: './package-options-modal.component.html',\n styleUrls: ['./package-options-modal.component.scss']\n})\nexport class PackageOptionsModalComponent {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n\n /** Item to select options for */\n public get item(): CateringCategory {\n return this._data.item;\n }\n\n /** Whether package requirements have been met */\n public get requirements_met(): boolean {\n return checkItemRequirements(this.item);\n }\n\n public get active_items(): HashMap {\n return getActiveItems(this.item);\n }\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: PackageOptionsModalData) {\n }\n\n /**\n * Update the list of selected items\n */\n public updateAmount(a_package: CateringCategory, option: CateringItem, state: boolean) {\n if (state) {\n const needed = a_package.must_select;\n const active = a_package.items.filter(an_item => an_item.amount > 0).length;\n if (active >= needed) {\n const item = a_package.items.find(an_item => an_item.amount > 0);\n item.setAmount(0);\n }\n option.setAmount(1);\n } else {\n option.setAmount(0);\n }\n }\n}\n","
\n

Package Options

\n \n
\n\n
\n \n
\n
\n\n
\n \n
\n
\n\n \n \n
\n \n 1\"\n [checked]=\"!!option.amount\"\n (change)=\"updateAmount(package, option, $event.checked)\"\n >\n {{ option.name }}\n \n \n {{ option.name }}\n \n \n = package.items.length || option.must_select\">\n {{ option.name }}\n \n \n
\n
\n
\n
\n","import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n// Interface to define the structure of the configuration object for the search bar\nexport interface SearchBarConfig {\n placeholder?: string;\n totalFoundItem?: number;\n showSrchWarning?: boolean;\n}\n\n@Component({\n selector: 'cng-search-bar',\n templateUrl: './cng-search-bar.component.html',\n styleUrls: ['./cmg-search-bar.component.scss']\n})\nexport class CngSearchBarComponent implements OnChanges {\n // Input property to accept configuration for the search bar\n @Input() config: SearchBarConfig = {\n placeholder: 'Search ...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n // Output event emitter to emit search strings to parent components\n @Output() search = new EventEmitter();\n\n // Local variable to store the search string entered by the user\n searchStr: string = '';\n\n // Lifecycle hook that is called when any data-bound property of a directive changes\n ngOnChanges(changes: SimpleChanges): void {\n // Check if the config property has changed\n if (changes.config) {\n const configChanges = changes.config.currentValue;\n // Update the config with new values or fallback to defaults\n this.config = {\n placeholder: configChanges.placeholder || 'Search ...',\n totalFoundItem: configChanges.totalFoundItem || 0,\n showSrchWarning: configChanges.showSrchWarning || false\n };\n }\n }\n\n // Method to handle the search action\n onSearch(value: string): void {\n // Emit the search string if it's not empty\n if (value) {\n this.search.emit(value);\n } else {\n this.clearSearch();\n }\n }\n\n // Method to clear the search input and reset related configurations\n clearSearch(box: HTMLInputElement | null = null): void {\n this.searchStr = '';\n if (box) {\n box.value = '';\n }\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n this.search.emit('');\n }\n\n // Method to reset the search-related warnings and item count\n resetSearch(): void {\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n }\n}\n","
\n \n \n
{{ config.totalFoundItem }}
\n \n \n \n
\n \n No search found!\n
\n
\n ","import { Directive, ElementRef, HostListener, Input } from '@angular/core';\n\n@Directive({\n selector: '[hover-class]'\n})\nexport class HoverClassDirective {\n @Input('hover-class') hoverClass: string;\n\n constructor(private elementRef: ElementRef) {}\n\n @HostListener('mouseenter') onMouseEnter() {\n this.update('add');\n }\n\n @HostListener('mouseleave') onMouseLeave() {\n this.update('remove');\n }\n\n @HostListener('blur') onBlur() {\n this.update('remove');\n }\n\n private update(action: string): void {\n this.hoverClass.split(' ').forEach(item => this.elementRef.nativeElement.classList[action](item));\n }\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'an-action-field',\n templateUrl: './action-field.component.html',\n styleUrls: ['./action-field.component.scss']\n})\nexport class ActionFieldComponent extends BaseDirective {\n /** Name of the field */\n @Input() public name: string;\n /** Value to display on the field */\n @Input() public placeholder: string;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Emitter for user interaction events */\n @Output('onAction') public on_action = new EventEmitter();\n /** Whether to show tooltip */\n public show_tooltip = false;\n\n /**\n * Emit that the user has performed an action on the field\n */\n public performAction() {\n this.show_tooltip = !this.show_tooltip;\n this.on_action.emit();\n }\n}\n","\n
{{ placeholder }}
\n
\n \n
\n\n","import { Component, forwardRef, Input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'a-counter',\n templateUrl: './counter.component.html',\n styleUrls: ['./counter.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n /* istanbul ignore next */\n useExisting: forwardRef(() => CounterComponent),\n multi: true,\n },\n ],\n})\nexport class CounterComponent implements ControlValueAccessor {\n /** Maximum amount for the counter */\n @Input() public max: number = 10;\n /** Minimum amount for the counter */\n @Input() public min: number = 0;\n\n @Input() public useInput = false;\n\n /** Current value of the counter */\n public value: number;\n public previous_value: number = 0;\n /** Whether shift key is being held by the user */\n public shift_key: boolean;\n /** Whether control key is being held by the user */\n public ctrl_key: boolean;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /**\n * Add the `step` to the current value\n */\n public add() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value += step;\n if (this.value > this.max) {\n this.value = this.max || 10;\n }\n this.setValue(this.value);\n }\n\n /** Remove the `step` from the current value */\n public remove() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value -= step;\n if (this.value < this.min) {\n this.value = this.min || 0;\n }\n this.setValue(this.value);\n }\n\n public handleTimeout = null;\n\n public onInputChange(new_value: string) {\n if (this.handleTimeout) {\n clearTimeout(this.handleTimeout);\n this.handleTimeout = null;\n }\n this.handleTimeout = setTimeout(() => this.changeInput(new_value), 500);\n }\n\n public changeInput(new_value: string) {\n let value = Number(new_value);\n if (isNaN(value)) {\n value = this.previous_value;\n }\n if (value < this.min) {\n value = this.min || 0;\n }\n if (value > this.max) {\n value = this.max || 10;\n }\n this.setValue(value);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.previous_value = new_value;\n this.value = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.value = value;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","\n \n \n
\n {{value || '0'}}\n
\n \n\n","import { Component, OnInit, forwardRef, Input, ViewChild, Output, EventEmitter } from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { MatMenuTrigger } from '@angular/material/menu';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-date-field',\n templateUrl: './date-field.component.html',\n styleUrls: ['./date-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateFieldComponent),\n multi: true\n }\n ]\n})\nexport class DateFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n /** Optional event emitter for changes */\n @Output() public onChange = new EventEmitter();\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Currently selected date */\n public date: number;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n /** Display value for the current date */\n public get date_string(): string {\n // R--- Needs TZ aware inputs\n const date = new DateTZ({date: this.date})\n return date.formatDate('dd MMM yyyy');\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public ngOnInit() {\n this.date = DateNow(new Date()).ms;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = new DateTZ({date: this.date });\n const new_d = new DateTZ({date: new_value})\n let new_date = new_d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n this.date = new_date;\n if (this._onChange) {\n this._onChange(new_date);\n this.onChange.emit(new_date);\n }\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","\n
{{ date_string }}
\n
\n \n
\n\n\n
\n \n
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport {\n humaniseDuration,\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-duration-field',\n templateUrl: './duration-field.component.html',\n styleUrls: ['./duration-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ]\n})\nexport class DurationFieldComponent extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor {\n /** Maximum duration option available */\n @Input() public max: number = 240;\n /** Minimum duration option available */\n @Input() public min: number = 15;\n /** Step value between options */\n @Input() public step: number = 15;\n /** Reference time for displaying next to durations */\n @Input() public time: number;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Special case prepopulation i.e. out of step options */\n @Input() public specialPreprops: Array = [];\n /** Whether form all_day is enabled. */\n @Input() public all_day: boolean = false;\n\n public duration: number = 60;\n /** List of available duration options */\n public duration_options: Identity[];\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n public ngOnInit(): void {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.max || changes.min || changes.step || changes.time || changes.all_day) {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.duration = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(+new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.duration = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n private generateDurationOptions(max: number, min: number, step: number, all_day: boolean = false): Identity[] {\n const blocks: Identity[] = [];\n let time = min;\n // R--- Change input to dateTz\n let date = this.time ? new DateTZ({date: this.time}) : null;\n\n // Add special case for 10min duration/prepropulation\n for (const option of this.specialPreprops) {\n blocks.push({\n id: option,\n name: date\n ? `${date.addValue({ minutes: option }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(option)})`\n : `${humaniseDuration(option)}`\n });\n }\n\n\n while (time <= max) {\n blocks.push({\n id: time,\n name: date\n ? `${date.addValue({ minutes: time }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(time)})`\n : `${humaniseDuration(time)}`\n });\n time += step;\n }\n if (all_day) {\n blocks.push({ id: 24 * 60, name: 'All Day' }); \n }\n blocks.push({ id: 7 * 24 * 60, name: '1 week' });\n return blocks;\n }\n}\n","
\n \n \n \n {{ option.name }}\n \n \n \n
\n","export * from './action-field/action-field.component'\nexport * from './counter/counter.component'\nexport * from './date-field/date-field.component'\nexport * from './duration-field/duration-field.component'\nexport * from './time-field/time-field.component'\nexport * from './user-search-field/user-search-field.component'\nexport * from './user-list-field/user-list-field.component'\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-time-field',\n templateUrl: './time-field.component.html',\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ]\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n /** Time step between each allowed time option */\n @Input() public step: number = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public no_past_times: boolean = true;\n /** String representing the currently set time */\n public date: number = DateNow(new Date()).ms;\n /** String representing the currently set time */\n public time: string = DateNow(new Date()).formatDate('HH:mm');\n /** Available time blocks for the selected date */\n public _time_options: Identity[];\n /** Whether select field should be shown */\n public show_select: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n // R--- This is the form input that needs to be TZ active.\n public ngOnInit(): void {\n this.show_select = true;\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n this.timeout('hide', () => this.show_select = false);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step) {\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n }\n\n public get date_(){\n return new DateTZ({date: this.date})\n }\n\n /** Available time blocks for the selected date */\n public get time_options() {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] });\n if (date.minutes % 15 !== 0 && !this._time_options.find(time => time.id === date.formatDate('HH:mm'))) {\n this._time_options.push({\n name: `${date.formatDate(timeFormatString())}`,\n id: date.formatDate('HH:mm')\n });\n this._time_options.sort((a, b) => `${a.id}`.localeCompare(`${b.id}`));\n }\n return this._time_options;\n }\n\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.time = new_value;\n if (this._onChange) {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] }).startOfValue('minute');\n this._onChange(date.ms);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n if (!value) {\n return;\n }\n this.date = value;\n let date = this.date_.startOfValue('minute');\n date = date.setValue({ minute: Math.ceil(date.minutes / 5) * 5 });\n this.time = date.formatDate('HH:mm');\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Show select field for time options\n */\n public showSelect() {\n this.show_select = true;\n this.timeout('on_shown', () => {\n if (this.select_field) {\n this.select_field.focus();\n this.select_field.open();\n this.subscription('listen_close', this.select_field.openedChange.subscribe((state) => {\n if (!state) {\n this.show_select = false;\n }\n }));\n }\n });\n }\n\n /**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n private generateAvailableTimes(datestamp: number, show_past: boolean, step: number = 15): Identity[] {\n let date = new DateTZ({date: datestamp});\n const blocks = [];\n if (show_past || date.isAfterDate(DateNow(new Date()))) {\n date = date.startOfValue('day');\n } else if (date.isAfterDate(DateNow(new Date()))) {\n date = DateNow(new Date());\n }\n date = date.setValue({ minute: Math.ceil(date.minutes / step) * step });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n name: `${date.formatDate(timeFormatString()).toLocaleLowerCase()}`,\n id: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n }\n}\n","\n
\n \n
\n
\n \n
\n\n\n \n \n {{ option.name }}\n \n \n\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n tap,\n map,\n switchMap,\n finalize\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n csvToJson,\n downloadFile,\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-list-field',\n templateUrl: './user-list-field.component.html',\n styleUrls: ['./user-list-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserListFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserListFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Number of characters needed before a search will start */\n @Input() public limit: number = 3;\n /** Emitter for action to make a new user */\n @Output('newUser') public new_user = new EventEmitter();\n\n /** User list to display */\n public user_list: User[];\n /** List of active selected users on the list */\n public active_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** String */\n public search_str: string;\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User[]) => void;\n /** Form control on touch handler */\n private _onTouch: (_: User[]) => void;\n\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n\n constructor(private _service: ApplicationService, private _users: UsersService, private cdRef: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit() {\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(100),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query.slice(0, Math.max(this.limit, 3)),\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n })\n );\n }\n\n /**\n * Add user to the user list\n * @param user\n */\n public addUser(user: User) {\n /* istanbul ignore else */\n if (!this.active_list) {\n this.active_list = [];\n }\n const index = this.active_list.findIndex((a_user) => a_user.id === user.id);\n /* istanbul ignore else */\n if (index < 0) {\n this.active_list = [...this.active_list, user];\n }\n this.setValue(this.active_list);\n this.search_str = '';\n }\n\n /**\n * Remove user from the user list\n * @param user\n */\n public removeUser(user: User) {\n this.active_list = this.active_list.filter((a_user) => a_user.id !== user.id);\n this.setValue(this.active_list);\n }\n\n /**\n * Load CSV file and populate the user list with the contents\n * @param event File input field event\n */\n public addUsersFromFile(event) {\n /* istanbul ignore else */\n if (event.target) {\n const file = event.target.files[0];\n /* istanbul ignore else */\n if (file) {\n const reader = new FileReader();\n reader.readAsText(file, 'UTF-8');\n reader.addEventListener('load', (evt) => {\n this.processCsvData((evt.srcElement as any).result);\n event.target.value = '';\n this.cdRef.detectChanges();\n });\n reader.addEventListener('error', (_) =>\n this._service.notifyError('Error reading file.')\n );\n }\n }\n }\n\n /**\n * Process raw CSV data and save user data to attendee list\n * @param data CSV data\n */\n private processCsvData(data: string) {\n const list = csvToJson(data) || [];\n const id = this._users.current.staff_code; \n list.forEach((el) => {\n const firstName = el.first_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n const lastName = el.last_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n\n el.name = el.name || `${firstName} ${lastName}`;\n const display = (el.name || `${Math.floor(Math.random() * 9999_9999)}`)\n .split(' ')\n .join('_')\n .toLowerCase();\n /* istanbul ignore else */\n if (!el.email) {\n el.email = `${display}+${id}@guest.mckinsey.com`;\n }\n el.type = 'external';\n el.external = !el.email.endsWith(\"@mckinsey.com\") && !el.email.endsWith(\"@external.mckinsey.com\");\n this.addUser(new User(el));\n });\n }\n\n /* istanbul ignore next */\n /** Download template CSV file */\n public downloadCSVTemplate() {\n const template = `Organisation Name,First Name,Last Name,Email,Phone\\nFake Org,John,Smith,john.smith@example.com,01234567898`;\n downloadFile('template.csv', template);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User[]): void {\n this.active_list = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User[]) {\n this.active_list = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User[]) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: User[]) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n \n \n \n
\n
\n \n \n {{ user.name }}\n \n \n \n
\n
\n\n
No attendees
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n map,\n switchMap\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-search-field',\n templateUrl: './user-search-field.component.html',\n styleUrls: ['./user-search-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserSearchFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserSearchFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Limit available options to these */\n @Input() public options: User[];\n /** Currently selected user */\n public active_user: User;\n /** User list to display */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Current display value of the search input field */\n public search_str: string = '';\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User) => void;\n /** Form control on touch handler */\n private _onTouch: () => void;\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n \n constructor(private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap(query => {\n this.loading = true;\n return this.options && this.options.length > 0\n ? Promise.resolve(this.options)\n : query.length >= 3\n ? (this._users.query({ q: query, cache: 60 * 1000 }) as Promise)\n : Promise.resolve([]);\n }),\n catchError((err) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription('search_results', this.search_results$.subscribe(list => {\n this.user_list = list;\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n }));\n }\n\n /** Handle input changes */\n public onInputChange(value: string): void {\n this.search_str = value;\n this.search$.next(value);\n }\n\n /**\n * Reset the search string back to the name of the active user\n */\n public resetSearchString(): void {\n if (this.active_user) {\n this.search_str = this.active_user.name;\n } else {\n this.search_str = '';\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User): void {\n this.active_user = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n this.resetSearchString();\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User): void {\n this.active_user = value;\n this.search_str = value ? value.name : '';\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: () => void): void {\n this._onTouch = fn;\n }\n\n /** Function to display the user's name in the input field */\n public displayFn(user?: User): string {\n return user ? user.name : '';\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n","import { Component, OnInit } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'feedback',\n templateUrl: './feedback.component.html',\n styleUrls: ['./feedback.component.scss'],\n})\nexport class FeedbackComponent extends BaseDirective implements OnInit {\n /** Name of the currently active page */\n public current_page: string;\n\n constructor(private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title), 1000);\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.current_page = location;\n }\n}\n","\n
\n Feedback\n \n \n \n
\n
\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-icon',\n templateUrl: './icon.component.html',\n styleUrls: ['./icon.component.scss']\n})\nexport class IconComponent extends BaseDirective {\n @Input() public icon: ApplicationIcon;\n}\n","
\n {{ icon.content }}\n \n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n ActionFieldComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserListFieldComponent,\n UserSearchFieldComponent\n} from './custom-fields';\nimport { IconComponent } from './icon/icon.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { ACA_PIPES_MODULE } from '@acaprojects/ngx-pipes';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { FeedbackComponent } from './feedback/feedback.component';\nimport { ActionIconComponent } from './action-icon/action-icon.component';\nimport { PopoutMenuComponent } from './popout-menu/popout-menu.component';\nimport { SearchbarComponent } from './searchbar/searchbar.component';\nimport { UserAvatarComponent } from './user-avatar/user-avatar.component';\nimport { CateringMenuItemComponent } from './bookings/catering/item/item.component';\nimport { PackageOptionsModalComponent } from './bookings/catering/package-options-modal/package-options-modal.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { CngSearchBarComponent } from './cng-search-bar/cng-search-bar.component';\nimport { HoverClassDirective } from './cng-search-bar/hover-class.directive';\n\nconst DECLARATIONS = [\n ActionFieldComponent,\n IconComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserSearchFieldComponent,\n UserListFieldComponent,\n FeedbackComponent,\n ActionIconComponent,\n PopoutMenuComponent,\n SearchbarComponent,\n UserAvatarComponent,\n CateringMenuItemComponent,\n PackageOptionsModalComponent,\n CngSearchBarComponent,\n HoverClassDirective\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\n@NgModule({\n imports: [\n CommonModule,\n ACA_PIPES_MODULE,\n FormsModule,\n ReactiveFormsModule,\n ...MATERIAL_MODULES,\n BaseModule,\n UiModule\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ACA_PIPES_MODULE,\n ...DECLARATIONS,\n ...MATERIAL_MODULES,\n BaseModule,\n ]\n})\nexport class LegacyUiModule {\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nexport interface PopoutAction extends ApplicationIcon {\n /** ID of the action */\n id: string;\n}\n\n@Component({\n selector: 'a-popout-menu',\n templateUrl: './popout-menu.component.html',\n styleUrls: ['./popout-menu.component.scss']\n})\nexport class PopoutMenuComponent extends BaseDirective {\n /** List of available actions */\n @Input() public actions: PopoutAction[] = [];\n /** Emitter for user actions */\n @Output() public action = new EventEmitter();\n /** Whether actions should show */\n public show: boolean;\n\n public close() {\n this.timeout('close', () => {\n this.show = false;\n });\n }\n}\n","\n \n\n\n","import { Component, OnInit, Input, EventEmitter, Output, ViewChild, ElementRef, SimpleChanges, OnChanges } from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'a-searchbar',\n templateUrl: './searchbar.component.html',\n styleUrls: ['./searchbar.component.scss']\n})\nexport class SearchbarComponent extends BaseDirective implements OnChanges {\n /** Current contents of the searchbar input */\n @Input('value') public value: string;\n /** Current contents of the searchbar input */\n @Input() public placeholder: string;\n /** Whether external changes are being processed */\n @Input() public loading: boolean;\n /** Whether external changes are being processed */\n @Input() public autofocus: boolean;\n /** Emitter for changes to the searchbar value */\n @Output() public valueChange = new EventEmitter();\n /** Input field reference */\n @ViewChild('input', { static: true }) private input_field: ElementRef;\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.autofocus && this.autofocus) {\n this.focusField()\n }\n }\n\n public focusField() {\n /* istanbul ignore else */\n if (this.input_field && this.input_field.nativeElement) {\n this.input_field.nativeElement.focus();\n }\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n","import { Component, Input } from '@angular/core';\nimport { User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-user-avatar',\n templateUrl: './user-avatar.component.html',\n styleUrls: ['./user-avatar.component.scss']\n})\nexport class UserAvatarComponent {\n /** User to display avatar for */\n @Input() public user: User;\n\n public get initials(): string {\n if (!this.user) {\n return 'NA';\n }\n const parts = this.user.name.split(' ');\n return parts.length > 1\n ? `${parts[0][0]}${parts[parts.length - 1][0]}`\n : this.user.name.slice(0, 2);\n }\n}\n","
\n
{{ initials }}
\n
\n\n \n\n","export * from './lib/loading.actions'\nexport * from './lib/loading.model'\nexport * from './lib/loading.effects'\nexport * from './lib/loading.selectors'\nexport * from '../testing'\n","import {\n createAction,\n createSelector,\n on,\n On,\n props\n} from '@ngrx/store';\nimport {\n LoadingModel,\n wrapLoading\n} from './loading.model';\nimport {\n selectIsLoading,\n selectOptionalError,\n selectOptionalSuccess,\n selectSuccess\n} from './loading.selectors';\nimport { MemoizedSelector } from '@ngrx/store/src/selector';\nimport {\n ActionCreator,\n NotAllowedCheck,\n TypedAction\n} from '@ngrx/store/src/models';\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport interface Payload {\n payload: T\n}\n\nexport type LoadingAction = T & TypedAction\nexport type LoadingActionCreator = T extends null | undefined ?\n ActionCreator TypedAction>\n : ActionCreator) => LoadingAction>\n\ntype ClearAction = ActionCreator TypedAction>\n\ninterface Selectors {\n success: MemoizedSelector\n optionalSuccess: MemoizedSelector\n error: MemoizedSelector\n loading: MemoizedSelector\n model: (TState) => LoadingModel\n}\n\nexport interface LoadingActionObject {\n request: LoadingActionCreator\n success: LoadingActionCreator>\n error: LoadingActionCreator>\n clear: ClearAction,\n ons: On[],\n selectors: Selectors\n}\n\n/**\n * Creates a {@link LoadingActionObject} that contains a set of ActionCreators\n * for request, success, error, loading, and clear data. Also, it contains\n * the necessary On reducers and selectors in order to properly connect them in\n * a standardized way to data in the application.\n *\n * `TState` is the type of data on your reducer, not global store.\n * `TRequest` is an object type to use in request methods.\n * `TSuccess` is the object type of the T parameter on `LoadingModel`.\n *\n * This assumes you have state represented by:\n * ```typescript\n * interface SomeState {\n * stateKey: LoadingModel\n * }\n * ```\n *\n * To dispatch an action:\n * ```typescript\n *\n * // request parameters depend on the object type used as second type parameter\n * // in createLoadingAction\n * this.store.dispatch(someLoadingAction.request())\n *\n * // action created with createLoadingAction\n * this.store.dispatch(someLoadingAction.request({\n * name: 'Andrew G',\n * age: 24\n * }))\n *\n * ```\n *\n * The generated selectors only select data from its fractured state, not the global\n * store. In order to use them, make sure you {@link select} the global state\n * before using them:\n *\n * ```typescript\n *\n * this.store.pipe(\n * select(selectSomeState),\n * select(someLoadingAction.selectors.success)\n * ).subscribe(next => {\n *\n * })\n *\n * ```\n *\n * @param actionPrefix - Prefixes actions to uniquely identify them.\n * @param stateKey - The field within the reducer state to set data on.\n */\nexport const createLoadingAction = (\n actionPrefix: string,\n stateKey: keyof TState\n): LoadingActionObject => {\n const buildAction = (postfix: string) => `[${actionPrefix}] ${postfix}`;\n // @ts-ignore\n const request = createAction(buildAction('request'), props());\n const success = createAction(buildAction('success'), props>());\n const error = createAction(buildAction('error'), props>());\n const clear = createAction(buildAction('clear'));\n const ons: On[] = [\n on(request, (state: TState & HashMap>, action: LoadingAction) =>\n ({\n ...state,\n [stateKey]: wrapLoading(state[stateKey]).loading()\n })),\n on(success, (state: TState & HashMap>, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.success(action.payload)\n })),\n // some reason specifying state like in success and request does not work.\n on(error, (state: any, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.error(action.payload)\n })),\n on(clear, () => ({\n ...this.state,\n [stateKey]: LoadingModel.empty()\n }))\n ];\n const selectData = (state: TState) => {\n if (!state) {\n console.warn('[LoadingActions] State is empty for key', stateKey);\n }\n return wrapLoading(state?.[stateKey] as unknown as LoadingModel);\n };\n const selSuccess = createSelector, TSuccess>(\n selectData,\n selectSuccess\n );\n const selOptionalSuccess = createSelector(\n selectData,\n selectOptionalSuccess\n );\n const selError = createSelector(\n selectData,\n selectOptionalError\n );\n const selLoading = createSelector(\n selectData,\n selectIsLoading\n );\n return {\n request,\n success,\n error,\n clear,\n ons,\n selectors: {\n success: selSuccess,\n optionalSuccess: selOptionalSuccess,\n error: selError,\n loading: selLoading,\n model: selectData\n }\n };\n};\n","import {\n Actions,\n ofType\n} from '@ngrx/effects';\n\nimport { \n LoadingAction,\n LoadingActionObject\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n catchError,\n flatMap,\n map\n} from 'rxjs/operators';\nimport {\n Observable,\n of\n} from 'rxjs';\nimport { TypedAction } from '@ngrx/store/src/models';\n\n/**\n * This creates an effect to use in Effects classes. This coordinates a simple\n * success and error payload effect.\n * @param actions - The actions object\n * @param actionObject - The created createLoadingAction object.\n * @param caller - Define what API method or asynchronous operation is needed to\n * run this. Return TSuccess.\n */\nexport const createLoadingEffect = (\n actions: Actions, actionObject: LoadingActionObject,\n caller: (action: LoadingAction) => Promise): Observable> => actions.pipe(\n ofType(actionObject.request),\n flatMap((action) => caller(action as LoadingAction)),\n map((response: TSuccess) => actionObject.success({ payload: response })),\n catchError(err => {\n return of(actionObject.error({ payload: err }));\n })\n);\n","/* eslint-disable no-underscore-dangle,no-useless-constructor */\n/**\n * Wraps around the typical data objects we write for success, error, loading, and empty state. This convenience\n * wrapper consolidates all of that logic into a handy wrapper.\n */\nexport class LoadingModel {\n static empty = () => new LoadingModel(false, false, false, undefined);\n\n static success = (success?: T): LoadingModel =>\n new LoadingModel(false, false, true, success);\n\n static error = (error?: Error, optionalSuccess?: T): LoadingModel =>\n new LoadingModel(false, true, false, optionalSuccess, error);\n\n /**\n * Mutates the model with a success state, preserving other state fields.\n * @param success - override success state.\n */\n mutate = (\n success: T2 | null) => new LoadingModel(\n this.isLoading,\n this.hasError,\n !!success,\n !success ? undefined : success\n );\n\n loading = (success: T | null = this.success) =>\n new LoadingModel(\n true,\n false,\n !!success && this.hasSuccess,\n !success ? undefined : success\n );\n\n public get success(): T {\n return this._success as T;\n }\n\n public get optionalSuccess(): T | undefined {\n return this._success;\n }\n\n constructor(\n public isLoading: boolean,\n private hasError: boolean,\n private hasSuccess: boolean,\n private _success?: T,\n public error?: Error\n ) {\n }\n\n isEmpty = () => !this.isSuccess() && !this.isError();\n\n hasLoaded = () => !this.isEmpty() && !this.isLoading;\n\n isSuccess = () => this.hasSuccess;\n\n isError = () => this.hasError;\n\n shouldLoad = () => !this.isSuccess() && !this.isLoading;\n\n public toString = () =>\n `Loading: ${this.isLoading}, Success: ${this.hasSuccess}:**${this._success}**, ` +\n `Error: ${this.hasError}:${this.error}`;\n}\n\n/**\n * Wraps an object that conforms to LoadingModel to restore object loss from\n * hydrating state during development.\n */\nexport const wrapLoading = (loading: any): LoadingModel => {\n if (loading instanceof LoadingModel) {\n return loading;\n } else {\n if (!loading) {\n return LoadingModel.empty();\n } else {\n return new LoadingModel(\n loading.isLoading || false,\n loading.hasError || false,\n loading.hasSuccess || false,\n loading._success,\n loading.error\n );\n }\n }\n};\n","import { LoadingModel, wrapLoading } from './loading.model';\n\nexport const selectSuccess = (state: LoadingModel) =>\n wrapLoading(state).success;\nexport const selectOptionalSuccess = (state: LoadingModel) =>\n wrapLoading(state).optionalSuccess;\nexport const selectIsLoading = (state: LoadingModel) =>\n wrapLoading(state).isLoading;\nexport const selectIsSuccess = (state: LoadingModel) =>\n wrapLoading(state).isSuccess();\nexport const selectOptionalError = (state: LoadingModel) =>\n wrapLoading(state).error;\nexport const selectIsError = (state: LoadingModel) =>\n wrapLoading(state).isError();\nexport const selectHasLoaded = (state: LoadingModel) =>\n wrapLoading(state).hasLoaded();\nexport const selectIsEmpty = (state: LoadingModel) =>\n wrapLoading(state).isEmpty();\n\n","import {\n Observable,\n Subject\n} from 'rxjs';\nimport { Action } from '@ngrx/store';\nimport { Actions } from '@ngrx/effects';\nimport { TypedAction } from '@ngrx/store/src/models';\nimport { take } from 'rxjs/operators';\nimport {\n LoadingActionObject\n} from '../src/lib/loading.actions';\n\nexport const generateMockActions = () => {\n const dispatcher = new Subject();\n return {\n dispatcher,\n actions: new Actions(dispatcher)\n };\n};\n\n/**\n * Simple verifier that checks if the request action results in a success returned.\n */\nexport const verifyActionSuccess = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n data: TSuccess,\n payload?: TRequest,\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.success({ payload: options.data }));\n};\n\n/**\n * Simple verifier that checks if the request action results in a failure returned.\n */\nexport const verifyActionError = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n error: Error,\n payload?: TRequest\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.error({ payload: options.error }));\n};\n","export * from './effects.testing'\n","export * from './lib/organisation.module';\nexport * from './lib/organisation.actions';\n","import { OrganisationState } from './organisation.reducer';\nimport { createLoadingAction } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\n\nexport const organisationStateSelector = (state: { organisation: OrganisationState }) => state.organisation;\n\nexport const loadOrganisations = createLoadingAction('Organisation', 'data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadOrganisations } from './organisation.actions';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\n\n\n@Injectable()\nexport class OrganisationEffects {\n\n constructor(private actions: Actions,\n private organisationService: OrganisationService) {\n }\n\n @Effect()\n public loadOrganisations = createLoadingEffect(this.actions, loadOrganisations,\n () => this.organisationService.loadOrganisation())\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { organisationReducer } from './organisation.reducer';\nimport { OrganisationEffects } from './organisation.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n OrganisationEffects\n ]),\n StoreModule.forFeature('organisation', organisationReducer)\n ]\n})\nexport class OrganisationModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\nimport { createReducer } from '@ngrx/store';\nimport { loadOrganisations } from './organisation.actions';\n\nexport interface OrganisationState {\n data: LoadingModel\n}\n\nconst initialState: OrganisationState = {\n data: LoadingModel.empty()\n};\n\nexport const organisationReducer = createReducer(initialState,\n ...loadOrganisations.ons);\n","export * from './lib/rooms.module';\nexport * from './lib/rooms.actions'\nexport * from './lib/rooms.reducer'\nexport * from './lib/rooms.types'\nexport * from './lib/rooms.utils'\n","import { createLoadingAction } from '../../../loading/src/lib/loading.actions';\nimport { Space } from '../../../data-common/src/lib/spaces/space.class';\nimport {\n RoomQueryOptions,\n RoomState,\n RoomStoreState\n} from './rooms.types';\nimport {\n createAction,\n createSelector,\n props\n} from '@ngrx/store';\n\nexport const roomStateSelector = (state: RoomStoreState) => state.rooms;\n\nexport const loadRoomsWithQuery = createAction('[Rooms] Load Rooms with query', props());\n\nexport const loadRoomsForResults = createLoadingAction('Rooms', 'query');\n\nexport const loadRoomsForResultsMap = createLoadingAction('Rooms for map', 'query');\n\n\nexport const loadLaterThatDayResults = createLoadingAction('Later Rooms', 'later');\n\nexport const loadNextDayResults = createLoadingAction('Next Day Rooms', 'next');\n\nexport const loadByIdResults = createLoadingAction('By Id Rooms', 'byid');\n\nexport const selectRoomResultsSuccess = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.optionalSuccess);\n\nexport const loadDiffSizeResults = createLoadingAction('Different Size Rooms', 'size');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n loadRoomsWithQuery,\n loadByIdResults,\n loadDiffSizeResults\n} from './rooms.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n laterThatDayFromDateTz,\n nextBusinessDay,\n} from './rooms.utils';\nimport {\n RoomQueryOptions,\n roomQueryOptionsToSpaceAvailabilityOptions,\n roomByIdQueryOptionsToSpaceAvailabilityOptions\n} from './rooms.types';\n\n@Injectable()\nexport class RoomsEffects {\n constructor(private actions: Actions,\n private spaceService: SpacesService) {\n }\n\n @Effect()\n public afterRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadRoomsWithQuery),\n mergeMap((action: LoadingAction) => {\n return [\n loadRoomsForResults.request({\n ...action,\n dateTz: action.dateTz\n }),\n // loadRoomsForResultsMap.request({\n // ...action,\n // dateTz: action.dateTz\n // }),\n loadLaterThatDayResults.request({\n ...action,\n dateTz: laterThatDayFromDateTz(action.dateTz)\n }),\n loadNextDayResults.request({\n ...action,\n dateTz: nextBusinessDay(action.dateTz)\n }),\n loadDiffSizeResults.request({\n ...action,\n dateTz: action.dateTz,\n diff_capacity: true\n }),\n ];\n })\n );\n\n @Effect()\n public loadRoomsForResultsEffect = createLoadingEffect(this.actions, loadRoomsForResults,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms'));\n \n @Effect() \n public loadRoomsForResultsMapEffect = createLoadingEffect(this.actions, loadRoomsForResultsMap,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms for maps', false));\n\n @Effect()\n public loadLaterThatDayResultsEffect = createLoadingEffect(this.actions, loadLaterThatDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'laterResults'));\n\n @Effect()\n public loadNextDayResultsEffect = createLoadingEffect(this.actions, loadNextDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'nextDay'));\n\n @Effect()\n public loadDiffSizeResultsEffect = createLoadingEffect(this.actions, loadDiffSizeResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'diffSize'));\n\n @Effect()\n public loadRoomByIdResultsEffect = createLoadingEffect(this.actions, loadByIdResults,\n (action) => \n this.spaceService.available(roomByIdQueryOptionsToSpaceAvailabilityOptions(action), 'byId', false));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { roomsReducer } from './rooms.reducer';\nimport { RoomsEffects } from './rooms.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([RoomsEffects]),\n StoreModule.forFeature('rooms', roomsReducer)\n ]\n})\nexport class RoomsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { createReducer } from '@ngrx/store';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from './rooms.actions';\nimport { RoomState } from './rooms.types';\n\nexport const initialRoomsState: RoomState = {\n query: LoadingModel.empty(),\n later: LoadingModel.empty(),\n next: LoadingModel.empty(),\n byid: LoadingModel.empty(),\n size: LoadingModel.empty(),\n};\n\nexport const roomsReducer = createReducer(initialRoomsState,\n ...loadRoomsForResults.ons,\n ...loadRoomsForResultsMap.ons,\n\n ...loadLaterThatDayResults.ons,\n ...loadNextDayResults.ons,\n ...loadByIdResults.ons,\n ...loadDiffSizeResults.ons);\n","import { LoadingModel } from '../../../loading/src/lib/loading.model';\nimport {\n Building,\n DaysOfWeek,\n ISpaceAvailabilityOptions,\n RecurrencePeriod,\n Space\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface RoomStoreState {\n rooms: RoomState;\n}\n\nexport interface RoomState {\n query: LoadingModel\n later: LoadingModel\n next: LoadingModel\n byid: LoadingModel\n size: LoadingModel\n}\n\nexport interface RoomQueryOptions {\n dateTz: DateTZ;\n duration: number;\n locations: string;\n capacity?: number;\n capacity_max?: number;\n diff_capacity?: boolean;\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n bookable?: boolean;\n ignore?: string;\n}\n\nexport const roomQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n zone_ids: options.locations,\n capacity_max: options.capacity_max,\n diff_capacity: options.diff_capacity,\n /** Fields to include recurrence in the availability search */\n is_recurrent: options?.is_recurrent,\n is_multiroom: options?.is_multiroom,\n merged: options?.merged,\n recurrence_period: options?.recurrence_period,\n recurrence_interval: options?.recurrence_interval,\n recurrence_endTz: options?.recurrence_endTz,\n recurrence_count: options?.recurrence_count,\n recurrence_starts: options?.recurrence_starts,\n recurrence_days: options?.recurrence_days,\n bookable: options?.bookable,\n ignore: options?.ignore\n});\n\nexport const roomByIdQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n room_ids: options.locations,\n capacity_max: options.capacity_max\n});\n","import { Space } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport const todayFromDate = (date: number) => new DateTZ({date});\n\n/**\n * Adds 60 mins.\n */\nexport const laterThatDayFromDateTz = (dateTz: DateTZ) => {\n return dateTz.addValue({ minutes: 60 })\n};\n\n/**\n * Next business day. In most cases 1 day, but on Fridays, it follows to the monday.\n * @param date\n */\nexport const nextBusinessDay = (dateTz: DateTZ) => {\n let retDate = dateTz.addValue({ days: 1 });\n if (retDate.dateWeekday >= 6) {\n retDate = retDate.setValue({ weekday: 8 });\n }\n return retDate;\n};\n\nexport const mapRoomToSelectOption = (room?: Space): SelectOption => room ? ({\n value: room.id,\n shortDisplay: room.local_name,\n display: `${room.local_name}, ${room.level?.name}`\n}) : undefined;\n","export * from './lib/rx-utils.module';\nexport * from './lib/operators'\nexport * from './lib/loading-model.utils'\n","import {\n combineLatest,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\n\n/**\n * Generates the results count based on if data has loaded or not. If not, undefined is returned.\n * Otherwise, it'll return the count of the results.\n */\nexport const resultCountObservable = (loadingObservable: Observable>,\n resultsObservable: Observable\n): Observable => combineLatest([\n loadingObservable.pipe(map(r => r.hasLoaded())),\n resultsObservable.pipe(map(v => v?.length))\n]).pipe(map(([isLoading, viewModelLength]) => isLoading ? viewModelLength : undefined));\n","import {\n distinctUntilChanged,\n filter\n} from 'rxjs/operators';\nimport * as deepEqual from 'fast-deep-equal';\n\n/**\n * Useful for nested objects to prevent unnecessary triggers in RX chain.\n */\nexport const deepDistinctUntilChanged = () => distinctUntilChanged(deepEqual);\n\n/**\n * Won't emit if value is undefined.\n */\nexport const filterUndefined = () => filter(f => !!f);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class RxUtilsModule {}\n","export * from './lib/ui.module';\nexport * from './lib/types';\nexport * from './lib/base-template.component';\nexport * from './lib/recurrence-pattern-form/recurrence-pattern-form.component';\nexport * from './lib/recurrence-booking-form/recurrence-booking-form.component';\nexport * from './lib/conflicts-modal/conflicts-modal.component'\nexport * from './lib/override-changes-modal/override-changes-modal.component'\nexport * from './lib/date-tz-calendar-widget/date-tz-calendar-widget.component';\nexport * from './lib/date-tz-date-picker/date-tz-date-picker.component';\nexport * from './lib/date-tz-duration-field/date-tz-duration-field.component';\nexport * from './lib/date-tz-time-field/date-tz-time-field.component';\nexport * from './lib/aca-date-picker/aca-date-picker.component';\nexport * from './lib/conflict-alert-modal/conflict-alert-modal.component';\nexport * from './lib/tooltip/tooltip.enums';\nexport * from './lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nexport * from './lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n","import { Component, OnInit, Input, Output, OnChanges, SimpleChanges, forwardRef, EventEmitter } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDatePickerOptions {\n /** Unix timestamp with millisecond. First selectable date */\n from?: number;\n /** Unix timestamp with millisecond. Last selectable date */\n to?: number;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: number;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'aca-date-picker',\n templateUrl: './aca-date-picker.component.html',\n styleUrls: ['./aca-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AcaDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class AcaDatePickerComponent implements OnInit, OnChanges, ControlValueAccessor {\n /** CSS class to add to the root element of the component */\n @Input() public klass = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDatePickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n /** Display the last selected day as active */\n @Input() public show_last_selection?: boolean = true\n\n public date: number = DateNow(new Date()).ms;\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private from: DateTZ;\n /** Last selectable date */\n private to: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n /** ID of the timer used for changing the month */\n private _change_timer: number;\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.date = item.value;\n if (this._onChange) {\n this._onChange(this.date);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date\n */\n public updateDate(): void {\n \n if (!this.date) {\n return;\n }\n const now = DateNow(new Date()).startOfValue('month');\n const date_ = new DateTZ({date: this.date})\n const date = date_.startOfValue('month');\n if (date.valid) {\n const difference = date.dateDiff(now, 'months', 'months');\n if (this.offset !== difference) {\n this.offset = difference;\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.from) {\n const date_ = new DateTZ({date: this.options.from})\n this.from = date_.startOfValue('day');;\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.from.startOfValue('month');\n this.min_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.from) {\n this.from = null;\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.to) {\n const date_ = new DateTZ({date: this.options.to})\n this.to = date_.startOfValue('day');\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.to.startOfValue('month');\n this.max_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.to) {\n this.to = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n if (!this.date) {\n return;\n }\n const date = DateNow(new Date()).addValue({ months : this.offset });\n const active = new DateTZ({date: this.date});\n let start = date.setValue({ day: 1 }).setValue({ weekday: 7 }).subtractValue({ weeks: 1 });\n const end_ = new DateTZ({date: start.ms})\n const end = end_.addValue({ weeks: 1 }).endOfValue('month').addValue({ days: 2 }).endOfValue('week');\n this.date_list = [];\n while (start.isBeforeDate(end) || start.isSameDate(end, 'day')) {\n this.date_list.push({\n value: start.ms,\n display: start.formatDate('d'),\n active: this.show_last_selection && active.isSameDate(start, 'day'),\n non_month: !date.isSameDate(start, 'month'),\n count: this.counters ? this.counters[start.formatDate('yyyy-MM-dd')] || 0 : 0,\n disabled: (this.from ? start.isBeforeDate(this.from, 'day') : false) || (this.to ? start.isAfterDate(this.to, 'day') : false),\n today: DateNow(new Date()).isSameDate(start, 'day')\n });\n start = start.addValue({ days : 1 });\n }\n this.month_name = date.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = DateNow(new Date()).startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days : 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n if (this._change_timer) {\n clearTimeout(this._change_timer);\n }\n this._change_timer = setTimeout(() => {\n const new_offset = this.offset + value;\n const now = DateNow(new Date())\n const date = now.addValue({ months : new_offset, days: now.dateMonth === 2 ? 2 : 0 }); //add 2 days if month is february to avoid calc errors\n if (this.from && date.isBeforeDate(this.from, 'month')) { return; }\n if (this.to && date.isAfterDate(this.to, 'month')) { return; }\n this.offset = new_offset;\n this.month.emit(this.offset);\n this.generateMonth();\n this._change_timer = null;\n }, 100);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const date = new DateTZ({date: this.date});\n const offset = this.offset;\n this.offset = DateNow(new Date()).dateDiff(date, 'months', 'months');\n if (offset !== this.offset) {\n this.generateMonth();\n }\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.updateDate();\n this.generateMonth();\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n
\n
\n
\n
\n
{{month_name}}
\n
= max_offset\" (click)=\"changeMonth(1)\" (touchend)=\"changeMonth(1)\">\n
\n
\n
\n
\n
{{item}}
\n
\n
\n
\n
\n {{item.display}}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nexport enum AlertMode {\n Warning = 'warning',\n Coachmark = 'coachmark',\n BlueCoachmark = 'blue-coachmark',\n Error = 'error'\n}\n\nexport enum AlertBannerDisplay {\n /**\n * New UI\n */\n V2 = 'v2',\n\n /**\n * Default, legacy ui.\n */\n V1 = 'v1',\n}\n\n@Component({\n selector: 'mck-alert-banner',\n template: `\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n `,\n styleUrls: ['./alert-banner.component.scss']\n})\nexport class AlertBannerComponent implements OnInit, OnChanges {\n\n @Input()\n public mode: AlertMode = AlertMode.Warning;\n\n @Output()\n public close = new EventEmitter();\n\n @Output()\n public action = new EventEmitter();\n\n @Input()\n public message: string;\n\n @Input()\n public buttonText: string;\n\n @Input()\n public showClose = true;\n\n @Input()\n public display: AlertBannerDisplay = AlertBannerDisplay.V1;\n\n public iconPath: string = 'assets/icon/warning-yellow.svg';\n public materialColor: string = 'black';\n public closeIcon: string = 'close_outline.svg';\n\n public ngOnInit(): void {\n this._onModeChange();\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.mode) {\n this._onModeChange();\n }\n }\n\n private _onModeChange() {\n this.iconPath = 'assets/icon/warning-yellow.svg';\n this.closeIcon = 'close_outline.svg';\n switch (this.mode) {\n case AlertMode.Warning:\n this.materialColor = 'black';\n break;\n case AlertMode.Coachmark:\n this.materialColor = 'coachmark';\n this.closeIcon = 'close_outline_coachmark.svg';\n break;\n case AlertMode.BlueCoachmark:\n this.iconPath = 'assets/icon/info-bg-dark.svg'\n this.materialColor = 'blue-coachmark'\n break;\n case AlertMode.Error:\n this.iconPath = 'assets/img/error-icon.svg'\n this.materialColor = 'white'\n break;\n default:\n this.materialColor = 'black';\n }\n }\n\n}\n","import {\n Component,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n Self,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NgControl\n} from '@angular/forms';\nimport { SelectOption } from '../types';\nimport {\n BehaviorSubject,\n combineLatest,\n from,\n Subject\n} from 'rxjs';\nimport {\n COMMA,\n ENTER\n} from '@angular/cdk/keycodes';\nimport { MatChipInputEvent } from '@angular/material/chips';\nimport {\n distinctUntilChanged,\n map,\n take\n} from 'rxjs/operators';\nimport { MatCheckboxChange } from '@angular/material/checkbox';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'mck-autocomplete-chip-select-item',\n template: `\n
\n \n {{label}}\n \n
\n \n
\n
\n \n
\n \n
\n \n
\n
\n
\n \n \n \n \n {{selected.shortDisplay}}\n close\n \n \n \n \n
\n \n \n {{option.dropdownOverride || option.display}}\n \n \n
\n
\n \n Clear\n \n \n Confirm\n \n
\n \n \n {{errorMessage}}\n
\n `,\n styleUrls: ['./auto-complete-chip-select-item.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class AutoCompleteChipSelectItemComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor, OnDestroy {\n\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n @ViewChild('componentInput')\n componentInput: HTMLInputElement;\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n feedbackInput?: boolean;\n\n @Input()\n loading?: boolean;\n\n @Input()\n placeHolder: string;\n\n @Input()\n options: Subject[]>;\n\n @Input()\n selectedOptions: Subject[]>;\n\n @Input()\n useCTAs?: boolean;\n\n @Output()\n optionSelected = new EventEmitter>();\n\n @Output()\n feedbackOutput = new EventEmitter();\n\n @Output()\n chipsCleared: EventEmitter = new EventEmitter();\n\n @Output()\n onClickConfirm: EventEmitter = new EventEmitter();\n\n /**\n * If true, only allow 1 group at a time to get selected. Show others as disabled.\n */\n @Input()\n selectOnlyOneGroup = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input() public localFilter: boolean = true;\n\n /**\n * If error exists, a message.\n */\n @Input()\n errorMessage?: string;\n\n @Input()\n hideDropdownCarret?: boolean;\n\n @Input()\n displayCTA?: boolean;\n\n private selectOnlyOneGroupChange = new BehaviorSubject(false);\n\n separatorKeysCodes = [ENTER, COMMA];\n\n public filterFormControl: FormControl = new FormControl();\n\n public focused = false;\n public mobileFullScreen = false;\n\n public autocompleteOptions = new BehaviorSubject[]>([]);\n public filteredAutocompleteOptions = new BehaviorSubject[]>([]);\n\n /** List shown to user, filters children if a group header is added **/\n public chipOptions = new BehaviorSubject[]>([]);\n\n /** Form control on change handler */\n private _onChange?: (_: SelectOption[]) => void;\n /** Form control on touch handler */\n private _onTouch?: (_: string) => void;\n\n private value = new BehaviorSubject[]>([]);\n\n public enableCTAs: boolean = false\n\n public hasChips: boolean = false;\n\n constructor(@Self() @Optional() private control: NgControl) {\n super();\n if (this.control) {\n this.control.valueAccessor = this;\n }\n }\n\n public get invalid(): boolean {\n return this.control ? this.control.invalid : false;\n }\n\n public get showError(): boolean {\n if (!this.control) {\n return false;\n }\n\n const { dirty, touched } = this.control;\n\n return this.invalid ? (dirty && touched) : false;\n }\n\n public iconFillClass(color?: string): string {\n return color === 'external' ? 'mck-icon-fill-gray' : 'mck-icon-fill-white'\n }\n\n ngOnInit() {\n this.subscription('autoCompleteOptions', combineLatest([\n this.options,\n this.selectedOptions,\n this.selectOnlyOneGroupChange\n ])\n .pipe(\n map(([options, selectedOptions, selectOnlyOneGroup]) => {\n this.hasChips = !!selectedOptions.length;\n return options.map(option => {\n const selected = !!selectedOptions.find(s => s.value === option.value);\n let enabled = true;\n if (selectOnlyOneGroup) {\n // find first group item in selection\n const selectedGroupHeader = selectedOptions.find(s => s.groupHeader || s.groupId === option.groupId);\n\n // if no options chosen, enable it, otherwise only allow selections from other options.\n enabled =\n selectedOptions.length === 0 ||\n (selectedGroupHeader ? selectedGroupHeader.groupId === option.groupId : false);\n this.enableCTAs = selectedOptions.length !== 0\n }\n\n return {\n ...option,\n enabled,\n selected\n } as SelectOption;\n });\n })\n ).subscribe(next => {\n const options = next.sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n this.autocompleteOptions.next(options);\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(this.filterFormControl.value?.trim()));\n }));\n this.subscription('filterFormControlChanges',\n this.filterFormControl.valueChanges.subscribe(value => {\n if (this.localFilter && value.length) {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(value));\n } else {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions());\n }\n }));\n this.subscription('chipOptions', this.selectedOptions\n .pipe(map(selectedOptions => {\n // find group headers and check if children are part of that group.\n // if part of group, filter them out as redundant.\n const groupHeaders = selectedOptions.filter(s => s.groupHeader) || [];\n return selectedOptions.filter(s => s.groupHeader || s.groupChild && !(groupHeaders.find(g => g.groupId === s.groupId)));\n }))\n .subscribe(next => {\n this.chipOptions.next(next);\n }));\n\n this.subscription('formData', this.selectedOptions\n .pipe(map(selected => {\n // group headers always contain children, so only pick out children for data\n return selected;\n }))\n .subscribe(next => {\n this.value.next(next);\n }));\n\n // tie value changes to change.\n this.subscription('valueChanges', this.value\n .pipe(distinctUntilChanged())\n .subscribe(next => {\n if (this._onChange) {\n // rewrote this to avoid read only error\n const values = [];\n next.forEach((v, i) => {\n const value = { ...v };\n if (v.meta?.user) {\n value.display = v.meta.user.name;\n }\n values.push(value);\n });\n this._onChange(values);\n }\n }));\n\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n getFilteredAutocompleteOptions(searchString: string = '') {\n // Exact matches of the groupId or display value\n const exactMatches = this.autocompleteOptions.value.filter(o => {\n if (searchString && searchString.length) {\n return o.groupId.toLowerCase().indexOf(searchString.toLowerCase()) === 0 || o.display.toLowerCase().indexOf(searchString.toLowerCase()) === 0;\n }\n return o.groupId && o.display;\n });\n // Fuzzier search of the dropdownOverride field\n const moreOptions = this.autocompleteOptions.value.filter(o => {\n if (o?.dropdownOverride?.length && searchString) {\n const match = o.dropdownOverride?.toLowerCase().indexOf(searchString.toLowerCase()) > -1;\n // only return found locations that don't exist in exactMatches.\n return match && !exactMatches.find(e => {\n return e.value === o.value\n });\n }\n return false;\n });\n\n // Merge the two result sets\n let joinedOptions = exactMatches.concat(moreOptions).sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n\n // Create a 1D array of the groupId\n const groupIds = joinedOptions.map(o => o.groupId);\n // Get a deduped list of the group parents\n const parents = this.autocompleteOptions.value.filter(o => {\n return o?.groupHeader && groupIds.indexOf(o.groupId) !== -1;\n });\n\n // Remove the parents from the joinedOptions and merge with the reduced parents set, and then sort by groupId.\n // Resulting array sets the parents first in order so the widget renders properly.\n const filteredAutocompleteOptions = parents.concat(joinedOptions.filter(jo => !!jo.dropdownOverride)).sort((a, b) => {\n return b.groupId > a.groupId ? -1 : 1;\n });\n return filteredAutocompleteOptions;\n }\n\n loseFocus(): void {\n this.mobileFullScreen = false;\n this.focused = false;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selectOnlyOneGroup) {\n this.selectOnlyOneGroupChange.next(this.selectOnlyOneGroup);\n }\n }\n\n keyedInput(matInput: string) {\n if (this.feedbackInput) {\n this.feedbackOutput.emit(matInput);\n }\n }\n\n selectOption(value: string) {\n this.options.pipe(\n take(1),\n map((options: SelectOption[]) => options.find(o => o.value === value))\n ).subscribe(next => {\n if (next) {\n this.optionSelected.emit(next);\n }\n });\n }\n\n removeOption(value: SelectOption) {\n this.optionSelected.emit(value);\n if (this.useCTAs) {\n this.onClickConfirm.emit();\n }\n\n }\n\n clearSelections() {\n this.selectedOptions.next([]);\n this.chipsCleared.emit();\n }\n\n onClickArrow() {\n // only close events we allow arrow to close panel.\n if (this.focused) {\n this.onFocus(false);\n }\n }\n\n onPanelFocusChange(focusIn: boolean) {\n this.onFocus(focusIn, true);\n }\n\n onFocus(focusIn: boolean, fromPanel?: boolean) {\n if (!focusIn && this.useCTAs) {\n this.onClickConfirm.emit();\n }\n // Only for location input???\n if (this.localFilter && fromPanel && focusIn) {\n // open on focus, mobile needs a refocus\n this.mobileFullScreen = true;\n this.timeout('showDefaults', () => {\n // All results do not show as expected unless I focus again.\n // Something about the mobile styles.\n this.onFocus(true);\n }, 100)\n }\n\n if (this.feedbackInput && !fromPanel) {\n // clear input when input creates options\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n this.feedbackOutput.emit('');\n }\n\n if (this.focused !== focusIn) {\n this.focused = focusIn;\n // clear on close\n if (!focusIn) {\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n }\n if (!fromPanel) {\n if (focusIn) {\n this.trigger.openPanel();\n } else {\n this.trigger.closePanel();\n // close the mobile full screen\n this.loseFocus();\n }\n }\n }\n }\n\n onChanged(value: SelectOption, event: MatCheckboxChange) {\n this.optionSelected.emit(value);\n }\n\n add(event: MatChipInputEvent) {\n // reset\n if (event.input) {\n event.input.value = '';\n }\n this.filterFormControl.setValue('');\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n // TODO: disabled not implemented yet.\n this.disabled = isDisabled;\n }\n\n writeValue(obj: SelectOption[] | undefined): void {\n // update selected options when this value is written\n this.options?.pipe(\n take(1),\n map((options: SelectOption[]) => {\n return options.filter(o => obj ? !!obj.find(spl => o.value === spl.value) : false );\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null && !event.srcElement.classList.contains('mat-form-field-autofill-control')) {\n this.onFocus(false);\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n}\n\n\n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\nimport { SelectOption } from '../types';\n\n/**\n * Patch orphaned SelectOption children into acting as their own group headers.\n *\n * This intends to help in the common scenario where filters have (for whatever\n * reason) prevented the child's usual group header from appearing.\n */\n@Pipe({\n name: 'groupHeaderPatch',\n})\nexport class GroupHeaderPipe implements PipeTransform {\n transform(items: SelectOption[]): SelectOption[] {\n if (!items) {\n return [];\n }\n\n return items.map(v => {\n const hasHeader = !!items.find(i => i.groupHeader && i.groupId === v.groupId);\n return {\n ...v,\n displayAsHeader: !hasHeader,\n }\n })\n }\n\n}\n","import { Component, Input, Output, forwardRef, SimpleChanges, OnChanges, OnInit, EventEmitter, ViewChild, OnDestroy } from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\nimport {\n BehaviorSubject\n} from 'rxjs';\n\n/**\n * @title Autocomplete filtering select of a single option via text search.\n */\n@Component({\n selector: 'mck-autocomplete-select-option',\n templateUrl: 'auto-complete-select-option.component.html',\n styleUrls: ['auto-complete-select-option.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AutoCompleteSelectOptionComponent),\n multi: true\n }\n ],\n})\nexport class AutoCompleteSelectOptionComponent implements OnInit, OnChanges, ControlValueAccessor, OnDestroy{\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n @Input()\n public resetInput: number | undefined;\n\n @Input()\n public placeholder: string;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Output()\n public filteredOptionsChange = new EventEmitter[]>();\n\n @Output()\n public inputTextChange = new EventEmitter();\n\n @Output() emptyBoxEvent = new EventEmitter();\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n filterFormControl = new FormControl();\n filteredOptions: Observable[]>;\n\n /** The selected value */\n public value = new BehaviorSubject('');\n\n /** Available options to search / select from */\n public _options = new BehaviorSubject[]>(this.options);\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n ngOnInit() {\n this.updateFilteredOptions();\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n // Watch and apply changes from the parent component.\n if (changes.options || changes.selectedValue) {\n if (changes.options && !changes.selectedValue) {\n this.filterFormControl.setValue('')\n }\n this.updateFilteredOptions();\n }\n if (changes.resetInput) {\n this.filterFormControl.setValue('');\n this.updateFilteredOptions();\n }\n \n }\n\n private updateFilteredOptions() {\n this.filteredOptions = this.filterFormControl.valueChanges\n .pipe(\n startWith(''),\n map(value => typeof value === 'string' ? value : value && value?.display ? value.display : ''),\n map(name => name ? this._filter(name) : this.options.slice())\n );\n }\n\n displayFn(data: SelectOption): string {\n return data && data?.display ? data.display : '';\n }\n\n private _filter(display: string): SelectOption[] {\n const filterValue = display.toLowerCase();\n // return all the matches found\n const filtered = this.options.filter(option => {\n // split this input and index both, if both\n // match return true.\n if (filterValue.includes(' ')) {\n const filterValues =filterValue.split(' ');\n let matchesAll = true;\n for (let x = 0; x < filterValues.length; x++) {\n if (option.display.toLowerCase().indexOf(filterValues[x]) === -1) {\n matchesAll = false;\n }\n }\n if (matchesAll) {\n return true;\n }\n }\n // match the whole string\n return option.display.toLowerCase().indexOf(filterValue) > -1;\n });\n this.inputTextChange.emit(filterValue);\n this.filteredOptionsChange.emit(filtered);\n return filtered;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: SelectOption): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value.value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n public onChangeInput() {\n if (this.filterFormControl.value === '') {\n this.emptyBoxEvent.emit(true);\n }\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null ) {\n this.trigger.closePanel();\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n\n}","
\n {{label}}\n \n \n \n \n {{option.shortDisplay || option.display}}\n \n \n \n
","import {\n AfterViewInit,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n/**\n * A helper class for rendering embedded views (ng-template) as standalone components.\n *\n * If the view is lazy and does not render upon initialization,\n * it attempts embedding view again later.\n *\n * When testing a component directly that extends this class, its best to wrap the component\n * in a wrapper component for testing so that it can render itself.\n */\nexport class BaseTemplateComponent extends BaseDirective implements AfterViewInit, OnInit, OnDestroy {\n @ViewChild(TemplateRef, { static: true })\n public template: TemplateRef;\n\n private isRendered = false;\n\n constructor(private vcRef: ViewContainerRef) {\n super();\n }\n\n public ngOnInit(): void {\n // try early rendering\n this.attemptViewEmbed();\n }\n\n public attemptViewEmbed() {\n if (this.template && !this.isRendered) {\n this.isRendered = true;\n this.vcRef.createEmbeddedView(this.template);\n return true;\n }\n return false;\n }\n\n public ngAfterViewInit(): void {\n if (!this.isRendered) {\n console.log('View not rendered yet, attempting to post initialization');\n setTimeout(() => {\n console.log('Timeout ended, trying again', this.template);\n if (!this.attemptViewEmbed()) {\n console.log('Attempting render in after view initialization');\n setTimeout(() => {\n if (!this.attemptViewEmbed()) {\n console.error('FAILED TO LOAD TEMPLATE');\n }\n }, 1000);\n }\n });\n }\n }\n\n public ngOnDestroy(): void {\n super.ngOnDestroy();\n this.isRendered = false;\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'catering-drop-modal',\n templateUrl: './catering-drop-modal.component.html',\n styleUrls: ['./catering-drop-modal.component.scss']\n})\nexport class CateringDropComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onConfirm(): void {\n this.dialogRef.close(true);\n}\n\nonCancel(): void {\n this.dialogRef.close(false);\n}\n}\n","
\n

Catering conflict

\n
\n\n
\n
\n

New proposed meeting time is outside catering hours. Proceed without catering?

\n
\n
\n
\n\n
\n \n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input\n } from \"@angular/core\";\n import { DropdownPanel } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select-options\",\n templateUrl: \"./cng-select-options.component.html\",\n styleUrls: [\"./cng-select-options.component.scss\"]\n })\n export class CngSelectOptionsComponent implements DropdownPanel {\n @ViewChild(TemplateRef) templateRef: TemplateRef;\n @Output() closed = new EventEmitter();\n @Input() ddWidth: string;\n \n constructor() {}\n }\n ","\n
\n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input,\n OnInit\n } from \"@angular/core\";\n import { DropdownPanel, DropdownOpion } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select\",\n templateUrl: \"./cng-select.component.html\",\n styleUrls: [\"./cng-select.component.scss\"]\n })\n export class CngSelectComponent implements OnInit {\n @Input() data: any;\n public isClosed: boolean = false;\n public selected: DropdownOpion;\n constructor() {\n\n }\n ngOnInit(): void {\n this.selected = this.data.defaultSelected;\n }\n\n public optionSelected(item: DropdownOpion) {\n // this.selected = item;\n this.data.defaultSelected = item;\n this.data?.onChangeCallback && this.data?.onChangeCallback(item);\n }\n }\n ","\n\n
\n {{data?.defaultSelected?.display}}\n
\n \n
\n
\n\n
{{item?.display}}
\n
","import {\n AfterViewInit,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n ViewContainerRef\n } from '@angular/core';\n import { DropdownPanel } from './dropdown-panel';\n import { Overlay, OverlayRef } from '@angular/cdk/overlay';\n import { TemplatePortal } from '@angular/cdk/portal';\n import { merge, Observable, Subscription } from 'rxjs';\n \n @Directive({\n selector: '[dropdownTriggerFor]',\n host: {\n '(click)': 'toggleDropdown()'\n }\n })\n export class DropdownTriggerForDirective implements OnDestroy, AfterViewInit, OnInit {\n private isDropdownOpen = false;\n private overlayRef: OverlayRef;\n private dropdownClosingActionsSub = Subscription.EMPTY;\n \n @Input('dropdownTriggerFor') public dropdownPanel: DropdownPanel;\n @Output() isPanelOpened = new EventEmitter();\n constructor(\n private overlay: Overlay,\n private elementRef: ElementRef,\n private viewContainerRef: ViewContainerRef,\n private renderer: Renderer2\n ) {\n \n }\n ngOnInit(): void {\n // const cngSelectEl = this.elementRef.nativeElement.nextElementSibling; \n // const parentWidth = this.elementRef.nativeElement.offsetWidth; \n // this.renderer.setStyle(cngSelectEl, 'width', `${parentWidth}px`);\n }\n ngAfterViewInit(): void {\n \n }\n\n \n toggleDropdown(): void {\n this.isDropdownOpen ? this.destroyDropdown() : this.openDropdown();\n \n }\n \n openDropdown(): void {\n let {ddWidth} = this.dropdownPanel;\n this.dropdownPanel.ddWidth = ddWidth !=='' ? ddWidth : `${this.elementRef.nativeElement.offsetWidth}px`;\n this.isDropdownOpen = true;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.close(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions([\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8\n }\n ])\n });\n \n const templatePortal = new TemplatePortal(\n this.dropdownPanel.templateRef,\n this.viewContainerRef\n );\n this.overlayRef.attach(templatePortal);\n \n this.dropdownClosingActionsSub = this.dropdownClosingActions().subscribe(\n () => this.destroyDropdown()\n );\n }\n \n private dropdownClosingActions(): Observable {\n const backdropClick$ = this.overlayRef.backdropClick();\n const detachment$ = this.overlayRef.detachments();\n const dropdownClosed = this.dropdownPanel.closed;\n \n return merge(backdropClick$, detachment$, dropdownClosed);\n }\n \n private destroyDropdown(): void {\n if (!this.overlayRef || !this.isDropdownOpen) {\n return;\n }\n \n this.dropdownClosingActionsSub.unsubscribe();\n this.isDropdownOpen = false;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef.detach();\n }\n \n ngOnDestroy(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n }\n }\n }\n ","import {\n Component,\n Input,\n OnInit,\n OnDestroy,\n ViewChild,\n AfterViewInit,\n Output,\n EventEmitter\n} from '@angular/core';\nimport { MatExpansionPanel } from '@angular/material/expansion';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { CollapseService } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'mck-collapse-header',\n template: `\n \n \n {{title}} \n
\n
\n \n
\n \n
\n
\n {{description}}\n \n \n \n \n `,\n styleUrls: ['./collapse-header.component.scss'],\n})\nexport class CollapseHeaderComponent implements OnInit, OnDestroy {\n\n @Input() title: string;\n @Input() description: string;\n @Input() isLoading = false;\n @Input() expandedIds: string[] = [];\n @Output() updateSectionIdOnOpen = new EventEmitter<{ status: string, id: string }>(); // Emit the id of the opened result section\n\n @ViewChild('expansionPanel') expansionPanel: MatExpansionPanel;\n\n public isExpanded = new BehaviorSubject(false);\n private collapseSubscription: Subscription;\n\n constructor(private collapseService: CollapseService) {}\n\n ngOnInit(): void {\n this.collapseSubscription = this.collapseService.collapse$.subscribe(() => {\n if (this.expansionPanel) {\n this.expansionPanel.close(); // Close the panel\n }\n });\n }\n\n // Update opened section id and emit the id of the opened result section to the parent component \n public updateOpenedSectionId(isOpen: string) {\n this.updateSectionIdOnOpen.emit({ status: isOpen, id: this.expandedTitleId });\n }\n\n\n \n /**\n * Gets the expanded title as an id by removing parentheses and replacing spaces with underscores.\n * @returns The expanded title.\n */\n public get expandedTitleId(): string {\n return this.title?.split('(')[0]?.split(' ')?.join('_') ;\n }\n\n ngOnDestroy(): void {\n this.collapseSubscription.unsubscribe();\n }\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nexport interface RoomAvaibilityModalData {\n\theaderText: string,\n\tmessage: string,\n\tbuttonLabel: string,\n\tcallback: Function,\n shouldClose: boolean\n}\n\n@Component({\n selector: 'conflict-alert-modal',\n templateUrl: 'conflict-alert-modal.component.html',\n styleUrls: ['./conflict-alert-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConflictAlertModalComponent implements OnInit {\n constructor(public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public dialogData: RoomAvaibilityModalData) {\n }\n ngOnInit(): void {}\n\n public done() {\n this.dialogData?.callback(); this.dialogRef.close()\n }\n}\n","
\n \n
\n\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{dialogData?.headerText}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{dialogData?.message}}
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\t\t \n\t\t\t\n
","import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {DialogEvent} from '@mckinsey-converge/base';\nimport {DateTZ, isToday} from '@mckinsey-converge/date-tz';\n\nexport interface ConflictsModalComponentData {\n room_name: string;\n conflicts: number[];\n copy_conflicts?: boolean;\n timezone: string;\n status?: string;\n}\n\n@Component({\n selector: 'app-conflicts-modal',\n templateUrl: './conflicts-modal.component.html',\n styleUrls: ['./conflicts-modal.component.scss']\n})\nexport class ConflictsModalComponent implements OnInit{\n public room_name: string;\n public conflicts: number[];\n public copy_conflicts: boolean;\n public timezone;\n public status: string;\n\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: ConflictsModalComponentData){\n\n }\n\n public ngOnInit(){\n this.timezone = this._data.timezone;\n this.room_name = this._data.room_name\n this.conflicts = this._data.conflicts\n this.copy_conflicts = this._data.copy_conflicts\n this.status = this._data.status\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone});\n const dateIsToday = isToday(dateTZ, this.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n\n public copy(): void {\n this.event.emit({ reason: 'action' });\n }\n\n\n}\n","
\n \n
\n\n
\n

Conflicts ({{conflicts.length}})

\n
\n The {{room_name}} room is not available on the following dates.\n Do you want to proceed without booking these days?\n
\n
\n The {{room_name}} room is not available on the following dates.\n You need to make individual bookings to cover these days, please.\n
\n
\n
\n
\n Date\n
\n
\n
\n {{formatDate(conflict)}}\n
\n
\n
\n
\n\n \n {{copy_conflicts ? 'Copy to clipboard' : 'Close'}}\n \n \n {{copy_conflicts ? 'Close' : 'Continue'}}\n \n\n","import { Component, OnInit, Inject } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'custom-snackbar',\n templateUrl: './custom-snackbar-component.component.html',\n styleUrls: ['./custom-snackbar-component.component.scss'],\n})\nexport class CustomSnackbarComponent implements OnInit {\n constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any) {\n }\n\n ngOnInit() {}\n\n get getIcon() {\n switch (this.data.snackType) {\n case 'success':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-success.svg',\n };\n case 'error':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-failure.svg',\n };\n case 'warn':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-warning.svg',\n };\n case 'info':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-info.svg',\n };\n default:\n return { type: 'info', iconPath: 'assets/icon/toast-info.svg' };\n }\n }\n\n closeSnackbar() {\n this.data.snackBar.dismiss();\n }\n}\n","
\n
\n
\n \"{{getIcon.type}}\n
\n
\n {{data.message}}\n
\n
\n
\n
close
\n
\n
","import { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { CustomSnackbarComponent } from './custom-snackbar-component.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarService {\n messageText: string[];\n constructor(public snackBar: MatSnackBar) {}\n\n public openSnackBar(\n message,\n type,\n duration?,\n verticalPosition?,\n horizontalPosition?\n ) {\n const _snackType = type !== undefined ? type : 'success';\n this.snackBar.openFromComponent(CustomSnackbarComponent, {\n duration: duration || 4000,\n horizontalPosition: horizontalPosition || 'end',\n verticalPosition: verticalPosition || 'top',\n data: {\n message: message,\n snackType: _snackType,\n snackBar: this.snackBar,\n },\n });\n }\n}\n","import {\n Component,\n OnInit,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n forwardRef,\n EventEmitter,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDateTzPickerOptions {\n /** DateTZ object. First selectable date */\n fromDateTz?: DateTZ;\n /** DateTZ object. Last selectable date */\n untilDateTz?: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: DateTZ;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'date-tz-calendar-widget',\n templateUrl: './date-tz-calendar-widget.component.html',\n styleUrls: ['./date-tz-calendar-widget.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzCalendarWidgetComponent),\n multi: true,\n },\n ],\n})\nexport class DateTzCalendarWidgetComponent\n extends BaseClass\n implements OnInit, OnChanges, ControlValueAccessor\n{\n /** CSS class to add to the root element of the component */\n @Input() public className = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDateTzPickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n\n public readonly weeks = new Array(6).fill(0);\n public selectedDateTz: DateTZ = DateNow();\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private fromTz: DateTZ;\n /** Last selectable date */\n private toTz: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n private _today = DateNow();\n\n public get timezone() {\n return this.selectedDateTz?.building_tz || '';\n }\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.selectedDateTz = item.value;\n if (this._onChange) {\n this._onChange(this.selectedDateTz);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date 2\n */\n public updateDate(): void {\n if (!this.selectedDateTz) {\n return;\n }\n const now = this._today.startOfValue('month');\n const startOfMonthDateTz = this.selectedDateTz.startOfValue('month');\n if (startOfMonthDateTz.valid) {\n const difference = startOfMonthDateTz.dateDiff(\n now,\n 'months',\n 'months'\n );\n if (this.offset !== difference) {\n this.offset = Math.round(difference);\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.fromDateTz) {\n const today = this._today.startOfValue('month');\n this.fromTz = this.options.fromDateTz.startOfValue('day');\n this.min_offset = Math.round(\n this.fromTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months')\n );\n } else if (this.fromTz) {\n this.fromTz = null; // R-- check if ok\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.untilDateTz) {\n const today = this._today.startOfValue('month');\n this.toTz = this.options.untilDateTz.startOfValue('day');\n this.max_offset = this.toTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months');\n } else if (this.toTz) {\n this.toTz = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n this._today = new DateTZ({ date: Date.now(), is_local_tz: !this.timezone, building_tz: this.timezone });\n const startOfMonthDateTz = this._today.addValue({ months: this.offset });\n const active = this.selectedDateTz || DateNow();\n let startDate = startOfMonthDateTz\n .setValue({ day: 1 })\n .setValue({ weekday: 7 })\n .subtractValue({ weeks: 1 });\n this.date_list = [];\n for (let i = 0; i < 42; i++) {\n this.date_list.push({\n value: startDate,\n display: startDate.formatDate('d'),\n active: active.isSameDate(startDate, 'day'),\n non_month: !startOfMonthDateTz.isSameDate(startDate, 'month'),\n count: this.counters\n ? this.counters[startDate.formatDate('yyyy-MM-dd')] || 0\n : 0,\n disabled:\n (this.fromTz ? startDate.ms < this.fromTz.ms : false) ||\n (this.toTz ? startDate.ms > this.toTz.ms : false),\n today: this._today.isSameDate(startDate, 'day'),\n });\n startDate = startDate.addValue({ days: 1 });\n }\n this.month_name = startOfMonthDateTz.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = this._today.startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days: 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n const new_offset = Math.min(\n this.max_offset,\n Math.max(this.min_offset, this.offset + value)\n );\n this.offset = Math.round(new_offset);\n this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const offset = this.offset;\n this.offset = Math.round(\n this._today.dateDiff(this.selectedDateTz, 'months', 'months')\n );\n if (offset !== this.offset) this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: DateTZ) {\n if (value) {\n this.selectedDateTz = value;\n this.updateDate();\n this.generateMonth();\n }\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n}\n","
\n
\n \n
\n \n
{{ month_name }}
\n = max_offset\"\n (click)=\"changeMonth(1)\"\n >\n
\n \n
\n \n \n \n \n \n \n \n \n \n
{{ item }}
\n \n {{ item.display }}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTzCalendarWidgetComponent } from '../date-tz-calendar-widget/date-tz-calendar-widget.component';\n\n@Component({\n selector: 'date-tz-date-picker',\n template: `\n \n {{label}}\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./date-tz-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class DateTzDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n @Input() public label?: string;\n /** Earliest date available the user is allowed to pick */\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n /** Latest date available the user is allowed to pick */\n @Input() public untilDateTz: DateTZ = DateNow(new Date()).endOfValue('day').addValue({ years: 1 });\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n // R-- possible TODO, address all_day that disables this input and displays \"Add Day for the value like the time picker\"\n @Input() public all_day: boolean = false;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public counters: any;\n\n @Input() public initialDateSelectionTz?: DateTZ;\n\n @Output() public onSelect = new EventEmitter();\n\n @Input() public invalid?: boolean;\n\n @Input() public timezone?: string;\n\n @Input() public can_pick_today: boolean = true;\n\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n\n public ngOnInit(): void {\n if (this.initialDateSelectionTz) {\n this.writeValue(this.initialDateSelectionTz)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(DateTzCalendarWidgetComponent, {static: true }) private _acaDatePicker: DateTzCalendarWidgetComponent;\n /** Currently selected date */\n public selectedDateTzValue = new BehaviorSubject(DateNow(new Date()));\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(new DateTZ({ is_local_tz: false, building_tz: d.building_tz }), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n // date\n public get dateTzObservable(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n return d \n }));\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(newValueTz: DateTZ) {\n // Keep hours and minutes of the old date\n const old_date = this.selectedDateTzValue.value;\n let newDateTz = newValueTz.setValue({ hour: old_date.dateHour, minute: old_date.minutes, second: old_date.second });\n\n // Check that new date is before from\n if (newDateTz.ms < this.fromDateTz.ms) {\n newDateTz = this.fromDateTz;\n }\n\n this.selectedDateTzValue.next(newDateTz);\n if (this._onChange) {\n this._onChange(newDateTz);\n }\n\n this.onSelect.emit(newDateTz);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n const building_tz = this.timezone || this.fromDateTz.building_tz\n const is_local_tz = DateNow(new Date()).building_tz === building_tz\n this.setValue(new DateTZ({ is_local_tz, building_tz }));\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(selectedDateTz: DateTZ) {\n this.selectedDateTzValue.next(selectedDateTz);\n this.show_tooltip = false;\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n DurationGroup,\n nearestDurationToInput,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators'; \nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'date-tz-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DateTzDurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input() public label?: string;\n @Input() public required: boolean;\n @Input() max_length?: number;\n\n // /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDateTz: DateTZ;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Whether form all_day is enabled. */\n // R-- need to address all_day that disables this input and displays \"Add Day for the value\"\n @Input() public all_day: boolean = false;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** Component will return a number of minutes */\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDateTz = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDateTz]).pipe(\n \n map(([value, currentStartDate]) => { \n /**\n * convert current start date/time to building time zone first\n * \n */\n const ms = convertTimezonedTimestampToLocalDateTz(currentStartDate.ms, currentStartDate.building_tz).ms;\n return nearestDurationToInput(this.durationGroups, ms, value); \n }\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDateTz.pipe(\n map(d => generateDurationOptionsFromGroups(d, this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDateTz.value, this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDateTz) {\n this.currentStartDateTz.next(changes.startDateTz.currentValue);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n nearestStepToInput,\n timeWithGmtOffsetFormatString,\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n generateAvailableTimes,\n generateAvailableTimesTz,\n} from '../utils/time.utils';\nimport { BehaviorSubject, combineLatest } from 'rxjs';\nimport { filter, map, withLatestFrom } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'date-tz-time-field',\n template: `\n
\n {{\n label\n }}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzTimeFieldComponent),\n multi: true,\n },\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DateTzTimeFieldComponent\n extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor\n{\n @Input() public label?: string;\n @Input() public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the DateTZ object datetime to start time options from **/\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n // Disables this input and displays R--- \"All Day\" for the value\n @Input() public all_day: boolean = false;\n @Input() public show_current: boolean = false;\n @Input() public startFromDateTz: boolean = false;\n\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n /** DateTZ object representing the currently set datetime */\n public selectedDateTz = new BehaviorSubject(\n closestToTimeSlotTz(DateNow(new Date()), this.step)\n );\n\n /** string representing the currently set datetime display value, needed for the input to display the slected value */\n public selectedTimeString = new BehaviorSubject(\n timeWithGmtOffsetFormatString(this.selectedDateTz.value)\n );\n\n public filterFormControl: FormControl = new FormControl();\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(\n generateAvailableTimesTz(\n DateNow(),\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(DateNow())]\n : [],\n this.startFromDateTz\n )\n );\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // Subscribe to selected option changes\n this.subscription(\n 'dateTimeChanges',\n combineLatest([this.selectedDateTz])\n .pipe(\n map(([selectedDateTz]) => {\n /**\n * The selectedDateTz should already be pegged to the closest time slot, but\n * if the selected time rolls into the past this can correct it. // R--- verify this statement\n */\n return closestToTimeSlotTz(selectedDateTz, this.step);\n }),\n withLatestFrom(this.options),\n filter(\n ([date, timeOptions]: [\n DateTZ,\n SelectOption[]\n ]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(\n (t) => t.value === date.formatDate('HH:mm')\n );\n }\n ),\n map(([dateTz, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz,\n });\n\n // Sort the time options\n timeOptions.sort((a, b) =>\n `${a.value}`.localeCompare(`${b.value}`)\n );\n return timeOptions;\n })\n )\n .subscribe((next) => {\n return this.options.next(next);\n })\n );\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (\n changes.no_past_times ||\n changes.step ||\n changes.fromDateTz ||\n changes.all_day\n ) {\n // If there's a new date value then update the time options\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // If today and all day goes from on to off the selected value isn't going to be available.\n if (\n changes.all_day &&\n !changes.all_day.currentValue &&\n changes.all_day.previousValue\n ) {\n this.setValue(this.options.value[0].display);\n }\n }\n }\n\n /**\n * Getter if the time picker options are visiable or not\n */\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n /**\n * Getter to return the current form timestamp from the from date object\n */\n public get timezone(): string {\n return this.fromDateTz.building_tz;\n }\n\n /**\n * A filter for finding a matching value when using the input text search\n */\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.selectedDateTz,\n ]).pipe(\n map(([value, selectedDateTz]) => {\n return nearestStepToInput(\n this.step,\n value,\n DateTime.now().valueOf()\n );\n })\n );\n\n /**\n * Default text displayed in the search field when the component initializes\n */\n public placeHolderOption = this.options.pipe(\n map((os) => os.length > 0 && os[0])\n );\n\n /**\n * Returns the selected option object by matching the selectedDateTz formated string with the option.display string\n */\n public selectedOption = combineLatest([\n this.options,\n this.selectedDateTz,\n ]).pipe(\n map(([options, selectedDateTz]) =>\n options.find(\n (o) =>\n o.display === timeWithGmtOffsetFormatString(selectedDateTz)\n )\n )\n );\n\n /**\n * Determines the visually selected value when the options list is visible.\n *\n * @param option DateTZ\n * @returns boolean\n */\n public isSelected(option: SelectOption) {\n return this.selectedTimeString.value === option.display;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: DateTZ) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: DateTZ) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Method just used in unit tests to test disabling the input\n * @param disabled\n */\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Update the selected values\n * @param dateTz the DateTz object for the new time\n */\n public setSelectedValues(dateTz: DateTZ) {\n // Update the selected DateTz and string representations\n this.selectedTimeString.next(timeWithGmtOffsetFormatString(dateTz));\n this.selectedDateTz.next(dateTz);\n if (this._onChange) {\n this._onChange(dateTz);\n }\n }\n\n /**\n * Update the form field value\n * @param displayString The \"display\" value of this.options set by the time picker\n */\n public setValue(displayString: string): void {\n // Convert the display time string to the actual option object via an array find.\n const newTimeTz = this.options.value.find(\n (opt) => opt.display === displayString\n ).value;\n // Update the selected DateTz and string representations\n this.setSelectedValues(newTimeTz);\n // Send the\n if (newTimeTz) {\n if (this._onChange) {\n this._onChange(newTimeTz);\n }\n }\n }\n\n /**\n * Fires when the form control value is changed\n * @param dateTz The new value for the component\n */\n public writeValue(dateTz: DateTZ | null) {\n // Init is null ?\n if (dateTz != null) {\n // Update the selected DateTz and string representations\n this.setSelectedValues(dateTz);\n // Update the available options\n this.options.next(\n generateAvailableTimesTz(\n dateTz,\n !this.noPastTimes,\n this.step,\n dateTz.building_tz,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(dateTz)]\n : [],\n this.startFromDateTz\n )\n );\n }\n }\n}\n\nfunction generateOptionForDateTz(dateTz: DateTZ): SelectOption {\n return {\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n nearestDurationToInput,\n DurationGroup,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map\n} from 'rxjs/operators';\nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'mck-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n @Input() max_length?: number;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDate: number;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDate = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDate]).pipe(\n map(([value, currentStartDate]) => nearestDurationToInput(this.durationGroups, currentStartDate.ms, value)\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDate.pipe(\n map(d => generateDurationOptionsFromGroups(d.toZone(this.timezone), this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDate.value.toZone(this.timezone), this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDate) {\n // R--- refactor input param\n const date = new DateTZ({date: this.startDate})\n this.currentStartDate.next(date);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'mck-error-message',\n template: `\n
\n
\n
\n \n \n \n
\n
\n `,\n styleUrls: ['./error-message.component.scss']\n})\nexport class ErrorMessageComponent {\n\n constructor() {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-calendar-icon',\n template: `\n \n \n \n \n \n `,\n})\nexport class CalendarIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-chevron-icon',\n template: `\n \n \n
\n \n \n \n
\n
\n \n
\n `\n})\nexport class ChevronIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n @Input()\n up?: boolean;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit\n} from '@angular/core';\n\n@Component({\n selector: 'mck-close-icon',\n template: `\n \n \n \n \n `\n})\nexport class CloseIconComponent implements OnInit {\n\n @Input()\n fillClass?: string;\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component(\n {\n selector: 'mck-informational-image',\n template: `\n \n
\n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./informational-image.component.scss'],\n encapsulation: ViewEncapsulation.None\n }\n)\nexport class InformationalImageComponent extends BaseTemplateComponent {\n\n @Input()\n public src: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-label',\n template: `\n \n \n \n *\n \n \n `,\n styleUrls: ['./label.component.scss']\n})\nexport class LabelComponent extends BaseTemplateComponent implements OnInit {\n\n @Input()\n required = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { MatSelect } from '@angular/material/select';\nimport { SelectOption } from '../options/select-option';\n\n@Component({\n selector: 'mck-legend-dropdown',\n template: `\n
\n \n \n \n \n
\n \n \n \n {{ buildPlaceholder() }}\n \n
\n \n
\n \n
\n `,\n styleUrls: ['./legend-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class LegendDropdownComponent {\n\n @Input()\n public placeholder: string;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public placeholderOpen?: string\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public buildPlaceholder(){\n return this.isOpen && this.placeholderOpen ? this.placeholderOpen : this.placeholder\n }\n}\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { AcaDatePickerComponent } from '../aca-date-picker/aca-date-picker.component';\n\n@Component({\n selector: 'mck-date-picker',\n template: `\n \n Date\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./mck-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MckDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class MckDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public initialDateSelection?: number;\n\n @Input() public invalid?: boolean;\n\n @Output() public onSelect = new EventEmitter();\n\n // R--- or is this the date picker to refactor. too tired.\n public ngOnInit(): void {\n if (this.initialDateSelection) {\n this.writeValue(this.initialDateSelection)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(AcaDatePickerComponent, {static: true }) private _acaDatePicker: AcaDatePickerComponent;\n\n /** Currently selected date */\n public dateValue = new BehaviorSubject(DateNow(new Date()));\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.dateValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public get date(): Observable {\n return this.dateValue;\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = this.dateValue.value;\n const d = new DateTZ({date: new_value})\n let new_date = d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n const new_d = new DateTZ({ date: new_date })\n this.dateValue.next(new_d);\n if (this._onChange) {\n this._onChange(new_date);\n }\n this.onSelect.emit(new_date);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n this.setValue(DateNow(new Date()).ms);\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n const date = new DateTZ({date: value})\n this.dateValue.next(date);\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-modal-button-row',\n template: `\n \n \n \n \n
\n \n {{secondaryLabel}}\n \n \n {{primaryLabel}}\n\n \n
\n \n
\n `,\n styleUrls: ['./modal-button-row.component.scss']\n})\nexport class ModalButtonRowComponent extends BaseTemplateComponent {\n\n @Input()\n primaryLabel?: string;\n\n /**\n * Specify if you want to disable the primary button\n */\n @Input()\n primaryDisabled?: boolean = false;\n\n /**\n * Used only if primaryLabel is specified.\n */\n @Output()\n public primarySubmit = new EventEmitter();\n\n /**\n * Specify if you want to show a secondary label button\n */\n @Input()\n secondaryLabel?: string;\n\n @Input()\n disableFixed: boolean = false;\n\n /**\n * Specify if you want to disable the secondary button\n */\n @Input()\n secondaryDisabled?: boolean = false;\n\n /**\n * Used only if secondaryLabel is specified.\n */\n @Output()\n public secondarySubmit = new EventEmitter();\n\n @Input()\n smallButtons?: boolean = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-modal',\n template: `\n \n
\n
\n \n
\n
\n

{{header}}

\n
\n
\n \n
\n `,\n styleUrls: ['./modal.component.scss']\n})\nexport class ModalComponent {\n\n @Input()\n header?: string;\n @Input() shouldClose?: boolean = true;\n\n constructor(private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n}\n","import { Component, EventEmitter, Inject, OnInit, Output } from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\nimport { DateTZ, isToday } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'override-changes-modal',\n templateUrl: './override-changes-modal.component.html',\n styleUrls: ['./override-changes-modal.component.scss']\n})\nexport class OverrideChangesModalComponent implements OnInit{\n\n public edits;\n public timezone;\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: OverrideChangesModalComponent){\n\n }\n\n public ngOnInit(){\n // this.edits = this._data.edits.sort((a, b) => a - b);\n\n // Function to convert epoch to 'YYYY-MM-DD' format\n const getDateString = (epoch) => {\n return new Date(epoch * 1000).toISOString().split('T')[0];\n };\n\n // Set to store unique date strings\n const uniqueDates = new Set();\n\n // Filter the edits array\n const filteredEdits = this._data.edits.filter(epoch => {\n const dateString = getDateString(epoch);\n if (!uniqueDates.has(dateString)) {\n uniqueDates.add(dateString);\n return true;\n }\n return false;\n });\n\n this.edits = filteredEdits;\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone });\n const dateIsToday = isToday(dateTZ, this._data.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n}","
\n \n \n
\n\n \n \n \n\n

Overriding Changes

\n

Editing the series here will override all previous changes made to individual occurrences. Are you sure you want to proceed?

\n\n \n \n \n \n \n \n \n \n \n \n \n
Dates
{{formatDate(edit)}}
\n
\n\n\n \n \n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\n\n/**\n * Transforms input by returning a subset of items based on if the\n * any items include the search text based on passed objectKey.\n *\n * objectKey can be pipe separated keys. e.g: 'name|age'. Then it will check against all.\n */\n@Pipe({\n name: 'filter'\n})\nexport class FilterPipe implements PipeTransform {\n transform(items: any[], searchText: string, objectKey?: string): any[] {\n if (!items) return [];\n if (!searchText) return items;\n searchText = searchText.toLowerCase();\n const splitKeys = objectKey?.split('|') ?? [];\n return items.filter(it => {\n let included = false;\n splitKeys.forEach((key) => {\n if (it[key]?.toLowerCase().includes(searchText)) {\n included = true;\n }\n });\n if (splitKeys.length === 0) {\n return it.toLowerCase().includes(searchText);\n }\n return included;\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport {\n DomSanitizer,\n SafeHtml,\n SafeResourceUrl,\n SafeScript,\n SafeStyle,\n} from '@angular/platform-browser';\n\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n@Pipe({\n name: 'sanitize',\n})\nexport class SanitizePipe implements PipeTransform {\n constructor(private sanitizer: DomSanitizer) {}\n\n transform(\n value: string,\n type: 'resource' | 'url' | 'script' | 'style' | 'html' = 'html'\n ): SafeHtml | SafeResourceUrl | SafeScript | SafeStyle {\n switch (type) {\n case 'resource':\n return (\n this.sanitizer.sanitize(\n SecurityContext.RESOURCE_URL,\n value\n ) || ''\n );\n case 'url':\n return (\n this.sanitizer.sanitize(SecurityContext.URL, value) || ''\n );\n case 'script':\n return (\n this.sanitizer.sanitize(SecurityContext.SCRIPT, value) || ''\n );\n case 'style':\n return (\n this.sanitizer.sanitize(SecurityContext.STYLE, value) || ''\n );\n }\n return this.sanitizer.sanitize(SecurityContext.HTML, value) || '';\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { SelectOption } from '../types';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'mck-radio-select',\n template: `\n \n
\n {{label}}\n \n {{option.display}}\n \n
\n
\n `,\n styleUrls: ['./radio-select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioSelectComponent),\n multi: true\n }\n ]\n})\nexport class RadioSelectComponent extends BaseTemplateComponent implements OnInit, ControlValueAccessor {\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n options: SelectOption[];\n\n public value = new BehaviorSubject | undefined>(undefined);\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public setValue(value: string) {\n const obj = this.options.find(o => o.value === value);\n this.writeValue(obj);\n if (this._onChange) {\n this._onChange(obj)\n }\n }\n\n writeValue(obj: SelectOption): void {\n this.value.next(obj);\n }\n}\n","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { OrganisationService, RecurrencePeriod, RecurrenceType, removeExpiredOcurrences, RepeatsOn } from \"@mckinsey-converge/data-common\";\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { first } from \"rxjs/operators\";\nimport { RecurrencePatternForm } from \"../recurrence-pattern-form/recurrence-pattern-form.component\";\n\n@Component({\n selector: 'recurrence-booking-form',\n templateUrl: './recurrence-booking-form.component.html',\n styleUrls: ['./recurrence-booking-form.component.scss']\n})\n\nexport class RecurringBookingForm implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n\n public current_type: RecurrenceType; \n public recurrence_types: Array = [\n {type: RepeatsOn.PATTERN, label: 'Repeats on'},\n {type: RepeatsOn.DATE, label: 'Repeats on specific date'}\n ]\n\n public building_tz = \"\";\n\n @ViewChild(RecurrencePatternForm) pattern_form: RecurrencePatternForm;\n\n constructor(\n private _org: OrganisationService,\n ) {}\n\n public get recurrencePeriod(){\n return this.form.get('recurrence_period')\n }\n\n public ngOnInit(): void {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.building_tz = this._org?.building?.timezone || 'America/Chicago';\n })\n if(this.recurrencePeriod.value === RecurrencePeriod.LIST){\n this.current_type = this.recurrence_types[1];\n removeExpiredOcurrences(this.form)\n }else{\n this.current_type = this.recurrence_types[0];\n }\n }\n\n public onChangeType(value: string) {\n this.current_type = this.recurrence_types.filter((type) => type.type === value)[0]\n if(this.current_type.type === RepeatsOn.PATTERN){\n this.recurrencePeriod.setValue(this.pattern_form.recurrencePatternFormControl.value)\n }else{\n this.recurrencePeriod.setValue(RecurrencePeriod.LIST)\n }\n }\n\n public dateToBuildingTz(date?: number){\n return new DateTZ({date, building_tz: this.building_tz, is_local_tz: false})\n }\n\n public get error(){\n const recurrence_starts = this.form.controls.recurrence_starts\n const recurrence_days = this.form.controls.recurrence_days\n return recurrence_starts.invalid || recurrence_days.invalid\n }\n\n}\n","
\n \n
\n \n \n {{recurrence_types[0].label}}\n \n \n \n
\n
\n \n \n {{recurrence_types[1].label}}\n \n \n \n
\n
\n
\nThe recurrence pattern is not valid.","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { MatMenuTrigger } from \"@angular/material/menu\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { OrganisationService } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ,toMiddayUTC } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-date-form',\n templateUrl: './recurrence-date-form.component.html',\n styleUrls: ['./recurrence-date-form.component.scss']\n})\n\nexport class RecurrenceDateForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n public selected_dates: Array = []\n public timezone: string = '';\n public nowTz: DateTZ = DateNow(new Date());\n public fromDateTz: DateTZ = this.nowTz.clone();\n public untilDateTz: DateTZ = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n public dateTz: DateTZ = DateNow(new Date());\n\n public get recurrenceStarts(){\n return this.form.get('recurrence_starts');\n }\n\n public get formDateTz(){\n return this.form.get('dateTz');\n }\n\n constructor (private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The fromDateTz is curious, would it make sense to be based on the form dateTz?\n this.fromDateTz = this.nowTz.clone()\n this.untilDateTz = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n\n if(this.recurrenceStarts.value){\n const tempForSort = [...this.recurrenceStarts.value]; // due to cannot assign to read only property '0' of object '[object Array]'\n this.selected_dates = tempForSort.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n this.subscription('ocurrenceChanges', this.recurrenceStarts.valueChanges\n .subscribe(() => {\n this.selected_dates = [...this.recurrenceStarts.value]\n })\n ); \n }\n\n /**\n * Add value to the list of selected dates\n * @param newDateTz\n */\n public addDate(newDateTz: DateTZ) {\n const d = newDateTz.clone();\n const start_date = this.formDateTz.value;\n let new_date = d.setValue({hour: start_date.dateHour, minute: start_date.minutes})\n \n /** Prevent user from selecting past dates */\n if (new_date.isBeforeDate(this.fromDateTz)) {\n new_date = this.fromDateTz;\n }\n\n /** Prevent user from selecting the same date more than once */\n const is_selected = this.selected_dates.filter((date: DateTZ)=> new_date.isSameDate(date, 'day'))\n if(is_selected.length){\n return\n }\n \n this.selected_dates.push(new_date);\n this.recurrenceStarts.setValue(this.selected_dates.sort((d1, d2) => d1.ms - d2.ms));\n this.setDateTzForm();\n }\n\n /**\n * \n * @param dateMsValue: number\n * @returns \n */\n public setPickerToGivenDate(dateTsValue: DateTZ) {\n this.fromDateTz = dateTsValue.clone();\n }\n\n /**\n * Function calls on close of date picker without date selection\n */\n public onDatePickerClose = () => {\n this.setPickerToGivenDate(this.nowTz)\n };\n\n public goToToday() {\n this.addDate(this.nowTz);\n this.setPickerToGivenDate(this.nowTz);\n }\n\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n public openDatePicker() {\n this._trigger.openMenu();\n }\n\n public deleteDate(date: DateTZ) {\n const index = this.selected_dates.map((d: DateTZ) => d.ms).indexOf(date.ms)\n this.selected_dates.splice(index, 1)\n this.recurrenceStarts.setValue(this.selected_dates)\n this.setDateTzForm()\n }\n\n public isToday(date) {\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: this.timezone,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone,\n }),\n 'day'\n );\n }\n\n public formatDate(date: DateTZ){\n const isToday = this.isToday(date);\n const display = date.formatDate('ccc dd MMM yyyy');\n\n return `${display}${isToday ? ' (Today)' : ''}`;\n }\n\n private setDateTzForm(): void {\n if (this.selected_dates.length === 0)\n return;\n\n const tz = this._org.building.timezone;\n const date_now = DateNow(new Date()).toZone(tz);\n let dateTz = this.selected_dates[0].clone();\n\n dateTz = dateTz.setValue({\n hour: (this.formDateTz.value as DateTZ).hours,\n minute: (this.formDateTz.value as DateTZ).minutes\n });\n\n if (this.selected_dates[0].isSameDate(this.nowTz, \"day\") && dateTz.hours < date_now.hours) {\n const { minutes: minute, hours: hour } = closestToTimeSlotTz(this.nowTz, 15);\n dateTz = dateTz.setValue({ minute, hour, second: 0 });\n }\n\n this.formDateTz.setValue(dateTz);\n }\n}\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
DateAction
{{formatDate(date)}}Delete
\n
[+] Add another date
\n \n
\n \n Today\n \n
\n
\n
\n
","import { Component, Input, OnInit } from \"@angular/core\";\nimport { FormGroup, Validators } from \"@angular/forms\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { arrayWithValues, generateWeekDays, RecurrencePeriod, recurrencePeriodToDurationType, RepeatPeriod, validDateTZ, WeekDays } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-pattern-form',\n templateUrl: './recurrence-pattern-form.component.html',\n styleUrls: ['./recurrence-pattern-form.component.scss']\n})\n\nexport class RecurrencePatternForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n\n /** Range of dates for the Start Date Picker*/\n public nowTz: DateTZ = DateNow(new Date());\n public fromStartTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n public untilTz: DateTZ = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n public timezone: string = '';\n \n\n /** Range of dates for the End Date Picker*/\n public fromEndTz: DateTZ;\n\n public repeat_period_options: Array = [\n {label: 'Day', id: RecurrencePeriod.DAILY},\n {label: 'Week',id: RecurrencePeriod.WEEKLY},\n {label: 'Month', id: RecurrencePeriod.ABSOLUTE_MONTHLY}\n ]\n public week_days: Array = []\n\n public repeat_every_options\n\n\n public get recurrenceDateStartTzFormControl() {\n return this.form.get('dateTz')\n }\n\n public get recurrenceEndFormControl(){\n return this.form.get('recurrence_endTz')\n }\n\n public get recurrencePeriodFormControl(){\n return this.form.get('recurrence_period')\n }\n\n public get recurrenceIntervalFormControl(){\n return this.form.get('recurrence_interval')\n }\n\n public get recurrencePatternFormControl(){\n return this.form.get('recurrence_pattern')\n }\n\n public get recurrenceDaysFormControl(){\n return this.form.get('recurrence_days')\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The from date is curious, why isn't it based on the form dateTz?\n this.repeat_every_options = new Array(1)\n this.fromStartTz = closestToTimeSlotTz(this.nowTz, 15)\n this.untilTz = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n this.fromEndTz = this.fromStartTz.addValue({days: 1})\n\n this.setEndDateFromStartDate(this.recurrenceDateStartTzFormControl.value) //make sure end date is after start date\n\n if(!this.recurrencePeriodFormControl.value){\n this.recurrencePeriodFormControl.setValue(RecurrencePeriod.WEEKLY)\n }\n\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.recurrencePatternFormControl.setValue(this.recurrencePeriodFormControl.value)\n }\n\n this.week_days = generateWeekDays(this.recurrenceDateStartTzFormControl.value.ms, { building_tz: this.fromStartTz.building_tz })\n this.generateMaxIntervals()\n\n if(this.recurrenceDaysFormControl.value.length > 0){\n this.week_days = this.week_days.map((day) => \n ({...day, active: this.recurrenceDaysFormControl.value.includes(day.full_name)})\n )\n }\n\n if(!this.recurrenceDaysFormControl.value.length && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n const current_days = this.week_days.filter((day) => day.active).map((day)=>day.full_name)\n this.recurrenceDaysFormControl.setValue(current_days)\n }\n\n this.generateOcurrenceList()\n\n this.subscription('startTimeChanges', this.recurrenceDateStartTzFormControl.valueChanges\n .subscribe((next) => {\n this.setEndDateFromStartDate(next) \n })\n );\n\n this.subscription('endTimeChanges', this.recurrenceEndFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n );\n \n this.subscription('recurrencePeriodFormControlChanges', this.recurrencePeriodFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n ); \n }\n\n public setEndDateFromStartDate(startDateTz: DateTZ){\n let end_date = this.recurrenceEndFormControl.value.setValue({hour: startDateTz.dateHour, minute: startDateTz.minutes})\n\n /**Update the End date picker range */\n this.fromEndTz = startDateTz.isSameDate(this.untilTz,'day') ? startDateTz : startDateTz.addValue({days: 1})\n\n if(end_date.isBeforeDate(this.fromEndTz)){\n end_date = this.fromEndTz\n }\n\n this.recurrenceEndFormControl.setValue(end_date)\n\n this.generateMaxIntervals()\n this.updateActiveWeekday() \n }\n\n public setRepeatPeriod(value: RecurrencePeriod){\n this.updateValidators(value)\n this.recurrencePeriodFormControl.setValue(value);\n this.recurrencePatternFormControl.setValue(value);\n this.recurrenceIntervalFormControl.setValue(1)\n this.generateOcurrenceList();\n }\n\n public setRepeatEvery(value: number){\n this.recurrenceIntervalFormControl.setValue(value)\n this.generateOcurrenceList()\n }\n\n public repeatTimeString(value: string){\n return this.recurrenceIntervalFormControl.value !== 1 ? `${value}(s)` : value\n }\n\n public get displayWeekdays(){\n return this.recurrencePatternFormControl.value === RecurrencePeriod.WEEKLY\n }\n\n /* Check if selected interval is valid and reset to 1 if not*/\n private validateRecurrenceInterval = () => {\n if(this.repeat_every_options.length < this.recurrenceIntervalFormControl.value){\n this.recurrenceIntervalFormControl.setValue(1)\n } \n };\n\n /**\n * Generate max value for dorpdown interval\n */\n public generateMaxIntervals(){\n const start = this.recurrenceDateStartTzFormControl.value;\n const date_diff = this.recurrenceEndFormControl.value.dateDiff(start, this.periodToDurationType, this.periodToDurationType)\n //If no diff default to 1\n this.repeat_every_options = new Array(Math.round(date_diff) || 1)\n this.validateRecurrenceInterval();\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.generateOcurrenceList()\n }\n }\n\n /**\n * Generate ocurrence list base on the selected interval\n */\n public generateOcurrenceList() {\n\n /**If selected period is list then we don't want \n * to generate a list based on the repeats on selections*/\n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.LIST){\n return\n }\n\n const occurrence = []\n const first_date = this.recurrenceDateStartTzFormControl.value;\n let start = first_date\n const end = this.recurrenceEndFormControl.value;\n const interval = this.recurrenceIntervalFormControl.value\n const recurr_days = this.week_days.filter(day => day.active)\n /**\n * isLastDayOfMonth : Boolean\n * flag - to generate last day of every month in case of day or month reccuring booking if start date is last day of month\n */\n // const isLastDayOfMonth = first_date.date.day === first_date.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY;\n const isLastDayOfMonth = first_date.dateDay === 31 && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY ;\n \n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n start = start.startOfValue('week')\n }\n\n while (end.dateDiff(start.startOfValue('day'), this.periodToDurationType, this.periodToDurationType) >= 0) {\n \n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n occurrence.push(start) \n start = start.addValue({[this.periodToDurationType]: interval}, isLastDayOfMonth);\n /**\n * IF - should only consider resetting start under mentioned condition of ticket - https://acaprojects.atlassian.net/browse/MCK-2085\n * In summery - If user select any date except 31st, other months in the series (no matter 30 or 31 day month) should have same date select as start date.\n * If user select 31st as an start date, other month in the seleries should have select last day of the month (30th/31st/28th/29th).\n * Exception for February - February should select 28th or 29th If in above both selection includes date between 28th - 31st.\n * \n */\n if(start.dateDay !== first_date.dateDay && start.dateDay !== start.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY) {\n start = start.setValue({day: first_date.dateDay});\n } \n }else {\n recurr_days.forEach((day)=>{\n const date = start.addValue({days: day.day_index})\n if((date.isAfterDate(first_date) || date.isSameDate(first_date, 'day')) && \n (date.isBeforeDate(end) || date.isSameDate(end, 'day'))){\n occurrence.push(date)\n }\n })\n start = start.addValue({[this.periodToDurationType]: interval})\n }\n }\n\n this.form.controls.recurrence_count.setValue(occurrence.length)\n this.form.controls.recurrence_starts.setValue(occurrence.sort((d1, d2) => d1.ms - d2.ms))\n \n }\n\n public get periodToDurationType(){\n const period = this.recurrencePeriodFormControl.value\n return recurrencePeriodToDurationType(period)\n }\n\n /**\n * Update active weekday in the weekdays array\n */\n private updateActiveWeekday() {\n const _week_days = this.week_days.map((day)=>{\n if(this.recurrenceDaysFormControl.value.includes(day.full_name)){\n return {...day, active: true}\n }else{\n return {...day, active: false}\n }\n })\n this.week_days = [..._week_days] \n }\n\n public setWeekDays(new_day: WeekDays){\n const days = this.recurrenceDaysFormControl.value\n if(this.disabled){\n return\n }\n\n if(!new_day.active){\n days.push(new_day.full_name)\n }else{\n const current_index = days.indexOf(new_day.full_name)\n days.splice(current_index,1)\n }\n this.recurrenceDaysFormControl.setValue([...days])\n this.updateActiveWeekday()\n this.generateOcurrenceList()\n }\n\n /**Update the recurrence days validator if period changes */\n public updateValidators(value: RecurrencePeriod){\n if(value === RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n this.recurrenceDaysFormControl.setValidators(arrayValidators);\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }else if(value !== RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n this.recurrenceDaysFormControl.clearValidators();\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }\n }\n}\n","
\n
\n \n \n \n Date and time must be in the future\n
\n
\n \n \n \n Date and time must be in the future\n
\n
\n
\n \n
\n \n \n \n {{ i + 1}}\n \n \n \n \n \n \n {{ repeatTimeString(option.label) }}\n \n \n \n
\n
\n
\n \n
\n
\n {{day.id}}\n
\n
\n
\n
\n
","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { SelectOption } from '../types';\n\n@Component({\n selector: 'mck-select-option',\n template: `\n \n \n \n \n {{ option.display }}\n \n \n `,\n styleUrls: ['./select-option.component.css']\n})\nexport class SelectOptionComponent extends BaseTemplateComponent {\n\n @Input()\n option: SelectOption;\n\n @Input()\n selected: boolean;\n\n /**\n * If true, we still display as if it wasn't disabled.\n */\n @Input()\n ignoreDisabled = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators';\nimport { MatSelect } from '@angular/material/select';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\n@Component({\n selector: 'mck-select',\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class SelectComponent implements OnInit, OnChanges, ControlValueAccessor {\n\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n /**\n * When true, can filter by searching on the input.\n */\n @Input()\n public searchEnabled = false;\n\n @Input()\n public splitDisplay = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Input()\n public showDivider: boolean = false\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n public filterFormControl: FormControl = new FormControl();\n\n public value = new BehaviorSubject(this.selectedValue || this.options[0]?.value);\n\n /** Available time blocks for the selected date */\n public _options = new BehaviorSubject[]>(this.options);\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public selectedOption = combineLatest([this._options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this._options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n\n constructor() {\n }\n\n public ngOnInit(): void {\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this._options.next(this.options);\n this.value.next(this.selectedValue || this.options?.[0]?.value);\n }\n if (changes.selectedValue) {\n this.value.next(this.selectedValue?.value);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n}\n","
\n {{label}}\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\n@Component({\n selector: 'mck-selected-chip-count',\n template: `\n \n {{count}}\n \n \n `,\n styleUrls: ['./selected-chip-count.component.scss']\n})\nexport class SelectedChipCountComponent {\n\n @Input()\n count: number;\n\n @Output()\n close = new EventEmitter();\n\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\nexport enum SpacerMode {\n /**\n * If vertical, it expands in the vertical direction. Size is width.\n */\n Vertical = 'vertical',\n /**\n * If horizontal, it expands in the horizontal direction. Size is height.\n */\n Horizontal = 'horizontal',\n}\n\n@Component({\n selector: 'mck-spacer',\n template: `\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./spacer.component.css'],\n})\nexport class SpacerComponent extends BaseTemplateComponent implements OnInit {\n SpacerMode = SpacerMode;\n\n @Input()\n size: string;\n\n @Input()\n mode: SpacerMode = SpacerMode.Horizontal;\n\n @Input()\n autoSize?: boolean;\n\n @Input()\n spacerClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-switch-group',\n template: `\n
\n {{title}}\n {{option.display}}\n
\n `,\n styleUrls: ['./switch-group.component.scss']\n})\nexport class SwitchGroupComponent implements OnInit {\n\n @Input()\n title: string;\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selectedOptions: SelectOption[] = [];\n\n @Output()\n optionChecked = new EventEmitter>();\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n public onCheckedChange(option: SelectOption) {\n this.optionChecked.emit(option);\n }\n\n public isSelected(option: SelectOption) {\n return !!this.selectedOptions.find(s => s.value === option.value);\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlot,\n nearestStepToInput,\n timeWithGmtOffsetFormatString\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { generateAvailableTimes } from '../utils/time.utils';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport {\n filter,\n map,\n withLatestFrom\n} from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'mck-time-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n `,\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the date from start **/\n @Input() public from: number;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n // R-- Which time field is going to be used, there's too many\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** String representing the currently set date */\n public date = new BehaviorSubject(DateNow(new Date()).ms);\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.date]).pipe(\n map(([value, date]) => nearestStepToInput(this.step, value, DateTime.now().valueOf()))\n );\n\n /** String representing the currently set time */\n public value = new BehaviorSubject(closestToTimeSlot(DateTime.now(), this.step).toFormat('HH:mm'));\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(generateAvailableTimes(DateNow(new Date()).ms, !this.noPastTimes, this.step, this.timezone));\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this.options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n\n // Subscribe to selected option changes\n this.subscription('dateTimeChanges',\n combineLatest([\n this.date\n ]).pipe(\n map(([date]) => {\n // R--- The time input needing to be TZ aware.\n const closestTimeSlot = closestToTimeSlot(DateTime.fromMillis(date.valueOf()), this.step);\n // Need to return the date with building timezone or the HH:mm representation will no match the option values\n return new DateTZ({date: closestTimeSlot.valueOf(), is_local_tz:false, building_tz: this.timezone});\n }),\n withLatestFrom(this.options),\n filter(([date, timeOptions]: [DateTZ, SelectOption[]]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(t => t.value === date.formatDate('HH:mm'));\n }),\n map(([date, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(date),\n value: date.formatDate('HH:mm')\n });\n // Sort the time options\n timeOptions.sort((a, b) => `${a.value}`.localeCompare(`${b.value}`));\n return timeOptions;\n })\n ).subscribe(next => this.options.next(next)));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step || changes.timezone) {\n // If there's a new date value then update the time options\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n const buildingDate = new DateTZ({date: this.from, is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.value.next(buildingDate.formatDate('HH:mm'));\n }\n if (changes.from) {\n // When the from input param changes update the date value\n this.date.next(this.from);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n // value comes in as a HH:mm string\n const newTime = (new_value.indexOf(':') > 0 ? new_value : '00:00').split(':');\n // need the date with the building timezone so the hour set is relative to there and not local.\n const d = new DateTZ({ date: this.date.value, is_local_tz: false, building_tz: this.timezone });\n const date = d.setValue({ hour: parseInt(newTime[0]), minute: parseInt(newTime[1]) });\n if (date) {\n if (this._onChange) {\n this._onChange(date.ms);\n }\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number | null) {\n if (value != null) {\n // Time input value in building time milliseconds\n this.date.next(value);\n // Get the closest time to slot in case the browser was idle and elapse the valid times\n const date = closestToTimeSlot(DateTime.fromMillis(value).startOf('minute'), this.step);\n // Need the building time so HH:mm is correct\n const buildingDate = new DateTZ({date: date.valueOf(), is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.options.next(generateAvailableTimes(buildingDate.ms, !this.noPastTimes, this.step, this.timezone));\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-toggle',\n template: `\n
\n \n
\n `,\n styleUrls: ['./toggle.component.scss']\n})\nexport class ToggleComponent {\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selected: SelectOption;\n\n @Output()\n selectedChange = new EventEmitter>();\n\n public onTapOption(option: SelectOption) {\n this.selectedChange.emit(option);\n }\n\n isSelected(option: SelectOption) {\n return this.selected === option;\n }\n}\n","import { Component, Input } from '@angular/core';\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Component({\n selector: 'app-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss']\n})\nexport class TooltipComponent {\n isVisible: boolean = false; // To control the visibility of the tooltip\n position: TooltipPosition = TooltipPosition.DEFAULT;\n theme: TooltipTheme = TooltipTheme.DEFAULT;\n tooltip = '';\n left = 0;\n top = 0;\n visible = false;\n}","
\n
\n
\n {{string}}\n
\n
\n
","import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n HostListener,\n Injector,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport {TooltipComponent} from \"./tooltip.component\";\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Directive({\n selector: '[tooltip]'\n})\nexport class TooltipDirective {\n\n @Input() tooltip = '';\n @Input() position: TooltipPosition = TooltipPosition.DEFAULT;\n @Input() theme: TooltipTheme = TooltipTheme.DEFAULT;\n @Input() trigger: ('hover' | 'click' | 'touch')[] = ['hover']; // Now an array of trigger types\n @Input() showDelay = 0;\n @Input() hideDelay = 0;\n @Input() show: boolean = true;\n\n private componentRef: ComponentRef | null = null;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n\n constructor(\n private elementRef: ElementRef, \n private appRef: ApplicationRef,\n private componentFactoryResolver: ComponentFactoryResolver, \n private injector: Injector) {\n }\n\n // Helper function to check if the tirgger type is present \n private hasTrigger(triggerType: 'hover' | 'click' | 'touch'): boolean {\n return this.trigger.includes(triggerType);\n }\n\n //Mouse and hover events\n @HostListener('mouseenter')\n onMouseEnter(): void {\n if (this.hasTrigger('hover') ) {\n this.initializeTooltip();\n }\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n if (this.hasTrigger('hover') ) {\n this.setHideTooltipTimeout();\n }\n }\n\n // Click event\n @HostListener('click')\n onClick(): void {\n if (this.hasTrigger('click') ) {\n if (this.componentRef === null) {\n this.initializeTooltip();\n } else {\n this.destroy(); // Hide tooltip if it is already shown\n }\n }\n }\n\n // Touch event\n\n\n @HostListener('touchstart', ['$event'])\n onTouchStart($event: TouchEvent): void {\n // Prevent default to avoid click event fire immedieatly \n // $event.preventDefault();\n if(this.hasTrigger('touch')) {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = window.setTimeout(this.initializeTooltip.bind(this), 150); // show the tooltip after short delay\n }\n \n }\n\n @HostListener('touchend')\n onTouchEnd(): void {\n // Hide the tooltip when touch end \n if(this.hasTrigger('touch') ){\n window.clearTimeout(this.touchTimeout);\n // this.setHideTooltipTimeout();\n setTimeout(() => {\n this.setHideTooltipTimeout();\n }, 500); \n }\n \n }\n\n // Initialization of the tooltip\n private initializeTooltip() {\n if (this.componentRef === null) {\n window.clearInterval(this.hideDelay);\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);\n this.componentRef = componentFactory.create(this.injector);\n\n this.appRef.attachView(this.componentRef.hostView);\n const [tooltipDOMElement] = (this.componentRef.hostView as EmbeddedViewRef).rootNodes;\n\n this.setTooltipComponentProperties();\n\n document.body.appendChild(tooltipDOMElement);\n this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);\n }\n }\n\n private setTooltipComponentProperties() {\n if (this.componentRef !== null) {\n this.componentRef.instance.tooltip = this.tooltip;\n this.componentRef.instance.position = this.position;\n this.componentRef.instance.theme = this.theme;\n\n const {left, right, top, bottom} = this.elementRef.nativeElement.getBoundingClientRect();\n\n switch (this.position) {\n case TooltipPosition.BELOW: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(bottom);\n break;\n }\n case TooltipPosition.ABOVE: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(top);\n break;\n }\n case TooltipPosition.RIGHT: {\n this.componentRef.instance.left = Math.round(right);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n case TooltipPosition.LEFT: {\n this.componentRef.instance.left = Math.round(left);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n default: {\n break;\n }\n }\n }\n }\n\n private showTooltip() {\n if (this.componentRef !== null) {\n this.componentRef.instance.visible = this.show ? true : false;\n }\n }\n\n private setHideTooltipTimeout() {\n this.hideTimeout = window.setTimeout(this.destroy.bind(this), this.hideDelay);\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n\n destroy(): void {\n if (this.componentRef !== null) {\n window.clearInterval(this.showTimeout);\n window.clearInterval(this.hideDelay);\n this.appRef.detachView(this.componentRef.hostView);\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","export enum TooltipPosition {\n ABOVE = 'above',\n BELOW = 'below',\n LEFT = 'left',\n RIGHT = 'right',\n DYNAMIC = 'dynamic',\n DEFAULT = 'below'\n}\n\nexport enum TooltipTheme {\n DARK = 'dark',\n LIGHT = 'light',\n DEFAULT = 'dark'\n}\n","export { AlertMode, AlertBannerDisplay } from './alert-banner/alert-banner.component';\nexport { SelectOption } from './options/select-option';\nexport * from './cng-select/dropdown-panel';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatSelectModule } from '@angular/material/select';\nimport { AutoCompleteChipSelectItemComponent } from './auto-complete-chip-select-item/auto-complete-chip-select-item.component';\nimport { AutoCompleteSelectOptionComponent } from './auto-complete-select-option/auto-complete-select-option.component';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { RadioSelectComponent } from './radio-select/radio-select.component';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FilterPipe } from './pipes/filter.pipe';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TimeFieldComponent } from './time-field/time-field.component';\nimport { DateTzTimeFieldComponent } from './date-tz-time-field/date-tz-time-field.component';\nimport { SpacerComponent } from './spacer/spacer.component';\nimport { DurationFieldComponent } from './duration-field/duration-field.component';\nimport { DateTzDurationFieldComponent } from './date-tz-duration-field/date-tz-duration-field.component';\nimport { AcaDatePickerComponent } from './aca-date-picker/aca-date-picker.component'; // the old widget\nimport { MckDatePickerComponent } from './mck-date-picker/mck-date-picker.component'; // the old form field \nimport { DateTzCalendarWidgetComponent } from './date-tz-calendar-widget/date-tz-calendar-widget.component'; // the new widget\nimport { DateTzDatePickerComponent } from './date-tz-date-picker/date-tz-date-picker.component'; // the new form field \nimport { CalendarIconComponent } from './icons/calendar/calendar-icon.component';\nimport { ChevronIconComponent } from './icons/calendar/chevron-icon.component';\nimport { SelectOptionComponent } from './select-option/select-option.component';\nimport { CloseIconComponent } from './icons/close/close-icon.component';\nimport { SelectedChipCountComponent } from './selected-chip-count/selected-chip-count.component';\nimport { AlertBannerComponent } from './alert-banner/alert-banner.component';\nimport { ErrorMessageComponent } from './error-message/error-message.component';\nimport { ToggleComponent } from './toggle/toggle.component';\nimport { LabelComponent } from './label/label.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { CollapseHeaderComponent } from './collapse-header/collapse-header.component';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { SwitchGroupComponent } from './switch-group/switch-group.component';\nimport { ModalButtonRowComponent } from './modal-button-row/modal-button-row.component';\nimport { InformationalImageComponent } from './informational-image/informational-image.component';\nimport { GroupHeaderPipe } from './auto-complete-chip-select-item/groupHeader.pipe';\nimport { SelectComponent } from './select/select.component';\nimport { LegendDropdownComponent } from './legend-dropdown/legend-dropdown.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RecurrencePatternForm } from './recurrence-pattern-form/recurrence-pattern-form.component'; \nimport { RecurrenceDateForm } from './recurrence-date-form/recurrence-date-form.component';\nimport { ConflictsModalComponent } from './conflicts-modal/conflicts-modal.component';\nimport { RecurringBookingForm } from './recurrence-booking-form/recurrence-booking-form.component';\nimport { OverrideChangesModalComponent } from './override-changes-modal/override-changes-modal.component';\nimport { SanitizePipe } from './pipes/sanitise.pipe';\nimport { ConflictAlertModalComponent } from './conflict-alert-modal/conflict-alert-modal.component';\nimport { CngSelectComponent } from './cng-select/cng-select.component';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { DropdownTriggerForDirective } from './cng-select/dropdown-trigger-for.directive';\nimport { CngSelectOptionsComponent } from './cng-select/cng-select-options.component';\nimport { TooltipComponent } from './tooltip/tooltip.component';\nimport { TooltipDirective } from './tooltip/tooltip.directive';\nimport { ZoomWarningComponent } from './zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nimport { CustomSnackbarComponent } from './custom-snackbar-component/custom-snackbar-component.component';\nimport { SnackBarService } from './custom-snackbar-component/custom-snackbar-component.service';\nimport { CateringDropComponent } from './catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n\nexport const MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule,\n MatExpansionModule,\n OverlayModule\n];\n\n@NgModule({\n imports: [CommonModule,\n ...MATERIAL_MODULES,\n ReactiveFormsModule,\n FormsModule,\n NgxMatSelectSearchModule, \n NgxSkeletonLoaderModule,\n MatSnackBarModule],\n declarations: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n GroupHeaderPipe,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n SelectOptionComponent,\n CloseIconComponent,\n SelectedChipCountComponent,\n AlertBannerComponent,\n ErrorMessageComponent,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n CustomSnackbarComponent,\n CateringDropComponent\n ],\n exports: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n AlertBannerComponent,\n ReactiveFormsModule,\n FormsModule,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n ],\n entryComponents: [\n CustomSnackbarComponent,\n CateringDropComponent\n ]\n \n})\nexport class UiModule {\n}\n","/**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n\nimport {\n closestToTimeSlot,\n closestToTimeSlotTz,\n DurationGroup,\n durationHumanized,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../types';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { DateTime } from 'luxon';\n\n// 24 hours\nexport const ALL_DAY_BOOKING_VALUE = 60 * 24;\n\nexport const DEFAULT_DURATION = 30;\n\n// R--- depreciate.\nexport const generateAvailableTimes = (\n datestamp: number,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz\n): SelectOption[] => {\n // R--- refactor to only used dateTz input and drop timezone param.\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let date = new DateTZ({ date: datestamp, is_local_tz: false, building_tz: timezone });\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || date.isAfterDate(now, 'day')) {\n // later than today\n date = date.startOfValue('day');\n } else {\n // today\n date = now;\n }\n // Get the closest timeslot to the start time\n const inputDate = DateTime.fromMillis(date.ms);\n const closestDate = closestToTimeSlot(inputDate, step);\n // Date changed to the closest time\n date = new DateTZ({ date: closestDate.valueOf(), is_local_tz: false, building_tz: timezone });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(date),\n shortDisplay: date.formatDate('hh:mma'),\n value: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n};\n\n\nexport const generateAvailableTimesTz = (\n fromDateTz: DateTZ,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz,\n all_day: boolean = false,\n extras: SelectOption[] = [],\n startFromDateTz: boolean = false\n): SelectOption[] => {\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let dateTz = fromDateTz.clone();\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || dateTz.isAfterDate(now, 'day')) {\n // later than today\n dateTz = dateTz.startOfValue('day');\n } else {\n // today/fromDateTz using the flag\n dateTz = startFromDateTz ? dateTz : now;\n }\n // Get the closest timeslot to the start time\n dateTz = closestToTimeSlotTz(dateTz, step);\n // Date changed to the closest time\n const end = dateTz.endOfValue('day');\n // Add the all day option for today\n if (all_day && dateTz.isSameDate(now, 'day')) {\n const startOfDay = dateTz.startOfValue('day');\n blocks.push({\n display: timeWithGmtOffsetFormatString(startOfDay),\n shortDisplay: startOfDay.formatDate('hh:mma'),\n value: startOfDay\n })\n }\n // Add options for the rest of the day\n while (dateTz.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n });\n \n dateTz = dateTz.addValue({ minutes: step });\n }\n\n return unique(extras.concat(blocks), 'shortDisplay');\n};\n\n/**\n * Generates list of duration options for new booking flow.\n * @param date - The start dateTime\n * @param max - The max number of minutes to go to from the date param.\n * @param min - The min number of minutes to display first time from.\n * @param step - The number of minutes to step up by for timeslots.\n */\nexport const generateDurationOptions = (\n date: DateTZ,\n max: number,\n min: number,\n step: number,\n extended: boolean): SelectOption[] => {\n const blocks: SelectOption[] = [];\n let value = min;\n while (value <= max) {\n let duration: string;\n if (extended) {\n const d = durationHumanized(value - min, true);\n duration = d ? `+${d}` : 'Current';\n } else {\n duration = durationHumanized(value, true);\n }\n\n blocks.push({\n value,\n display: `${date.addValue({ minutes: value }).formatDate(timeFormatString()).toLocaleLowerCase()} (${duration})`,\n });\n value += step;\n }\n return blocks;\n};\n\nexport const allDayOption: SelectOption = ({\n value: ALL_DAY_BOOKING_VALUE,\n display: 'All Day'\n});\n\nexport const oneWeekOption: SelectOption = ({\n value: 60 * 24 * 7, // 1 week\n display: 'One Week'\n});\n\nexport const defaultDurationGroups: DurationGroup[] = [\n {\n start: 15,\n step: 15,\n max: 60 * 24\n }\n // , {\n // start: 60,\n // step: 30,\n // max: (60 * 8) - 1 // 8 hours\n // }, {\n // start: 60 * 8,\n // step: 60,\n // max: 60 * 24 // 24 hours\n // }\n];\n\n/**\n * Maps the {@link DurationGroup} to {@link SelectOption} and appends the default all day and week options.\n */\nexport const generateDurationOptionsFromGroups = (date: DateTZ, durationGroups: DurationGroup[], extended: boolean): SelectOption[] => [\n ...(durationGroups.map(duration => generateDurationOptions(date, duration.max, duration.start, duration.step, extended)).reduce(((previousValue, currentValue) => {\n previousValue.push(...currentValue);\n return previousValue;\n }), [])),\n // allDayOption,\n // oneWeekOption\n ];\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-zoom-warning',\n templateUrl: './zoom-warning.component.html',\n styleUrls: ['./zoom-warning.component.scss']\n})\nexport class ZoomWarningComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onCloseClick(): void {\n this.dialogRef.close();\n }\n}\n","
\n

Excessive zoom warning

\n
\n\n
\n
\n

\n
\n
\n
\n\n
\n \n
\n
","export * from './lib/user.module';\nexport * from './lib/user.actions'\nexport * from './lib/user.types'\nexport * from './lib/user.reducer'\n","import { \n createLoadingAction\n } from '../../../loading/src/lib/loading.actions';\nimport {\n UserState,\n UserStoreState\n} from './user.types';\nimport { User } from '../../../data-common/src/lib/users/user.class';\nimport { createSelector } from '@ngrx/store';\n\nexport const loadUser = createLoadingAction('CurrentUser', 'current');\n\nexport const selectUserState = ({ user }: UserStoreState) => user;\n\nexport const selectHasUserData = createSelector(createSelector(selectUserState, loadUser.selectors.model), (state) => !!state.optionalSuccess);\n\nexport const selectCurrentUser = createSelector(selectUserState, loadUser.selectors.optionalSuccess);\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\nimport { UsersService } from '../../../data-common/src/lib/users/users.service';\n\n\n@Injectable()\nexport class UserEffects {\n\n constructor(private actions: Actions,\n private userService: UsersService) {\n }\n\n @Effect()\n loadUser = createLoadingEffect(this.actions, loadUser, () => this.userService.loadCurrentUser());\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { StoreModule } from '@ngrx/store';\nimport { userReducer } from './user.reducer';\nimport { EffectsModule } from '@ngrx/effects';\nimport { UserEffects } from './user.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n StoreModule.forFeature('user', userReducer),\n EffectsModule.forFeature([UserEffects])\n ]\n})\nexport class UserModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { UserState } from './user.types';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\n\n\nexport const initialUserState: UserState = {\n current: LoadingModel.empty()\n};\n\nexport const userReducer = createReducer(initialUserState,\n ...loadUser.ons);\n","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./$$_lazy_route_resource lazy recursive\";","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { ShellWrapperComponent } from './shell/shell.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: ShellWrapperComponent,\n children: [\n {\n path: 'home',\n loadChildren: () => import('./booking/booking.module').then((m) => m.BookingModule),\n },\n { path: '**', redirectTo: 'home' },\n ],\n },\n { path: '**', redirectTo: 'home' },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, { useHash: true })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective, detectIE } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingsService,\n OrganisationService,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { environment } from 'src/environments/environment';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ZoomWarningComponent } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: [\n './styles/app.component.scss',\n './styles/custom-element.styles.scss',\n './styles/native-element.styles.scss'\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class AppComponent extends BaseDirective implements OnInit {\n constructor(\n private _app: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private _router: Router,\n private _route: ActivatedRoute,\n private _dialog: MatDialog,\n ) {\n super();\n\n // ensure app is trusted in dev mode so we can preserve login.\n if (!environment.production) {\n localStorage.setItem('trusted', 'true');\n }\n\n\n if (detectIE() && detectIE() < 12) {\n location.href = `${location.origin}${location.pathname}assets/not-supported.html`;\n return;\n }\n }\n\n public ngOnInit(): void {\n this._router.events.subscribe((val: NavigationStart) => {\n const bookingForm = JSON.parse(localStorage.getItem('bookingForm'));\n if (val && val.navigationTrigger && val.url) {\n // Redirect everyone who doesn't have an active bookingForm back to the home page.\n const cleanHash = location?.hash.split('?')[0];\n const isLoadBookingUrl = cleanHash.indexOf('#/home/booking/') === 0;\n const isLoadCateringUrl = cleanHash.indexOf('#/home/catering/') === 0;\n if (!isLoadBookingUrl && !isLoadCateringUrl && cleanHash && ['#/home', '#/home/manage', '#/home/create', '#/home/edit'].indexOf(cleanHash) === -1 && bookingForm && !bookingForm?.activeForm) {\n location.href = `${location.origin}`;\n return;\n }\n }\n\n })\n this.adjustZoom();\n }\n\n private adjustZoom() {\n const clientWidth = document.body.clientWidth;\n if (this.isMobileOrTablet()) { // Do not show the warning if it's a mobile or tablet device\n return;\n }\n if (clientWidth < 1300) {\n this._dialog.open(ZoomWarningComponent);\n }\n }\n private isMobileOrTablet(): boolean {\n const userAgent = navigator.userAgent || navigator.vendor;\n const maxTouchPoints = navigator.maxTouchPoints || 0; // Check for touch points \n if (maxTouchPoints > 0 && window.innerWidth <= 1024) {\n return true;\n } // Check for common mobile/tablet user agent strings \n const mobileAgents = ['Android', 'webOS', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'IEMobile', 'Opera Mini'];\n for (const agent of mobileAgents) {\n if (userAgent.indexOf(agent) > -1) {\n return true;\n }\n }\n return false;\n }\n}\n","
\n \n
\n","// remove after trigger build\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { NgModule } from '@angular/core';\nimport { HttpClientModule } from '@angular/common/http';\nimport { FormsModule } from '@angular/forms';\nimport { MAT_LABEL_GLOBAL_OPTIONS } from '@angular/material/core';\n\nimport { ComposerModule } from '@placeos/composer';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { environment } from '../environments/environment';\nimport { SharedContentModule } from './shared/shared.module';\n\nimport { ShellWrapperComponent } from './shell/shell.component';\nimport {\n ActionReducer,\n MetaReducer,\n StoreModule\n} from '@ngrx/store';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport { BookingModule } from 'src/app/booking/booking.module';\nimport { BookingsModule } from '@mckinsey-converge/bookings';\nimport { BuildingsModule } from '@mckinsey-converge/buildings';\nimport { EffectsModule } from '@ngrx/effects';\nimport { DEFAULT_SETTINGS } from 'src/environments/settings';\nimport { provideMockSettingsObject } from '@mckinsey-converge/data-common';\nimport { OrganisationModule } from '@mckinsey-converge/organisation';\nimport { localStorageSync } from 'ngrx-store-localstorage';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { RoomsModule } from '@mckinsey-converge/rooms';\nimport { ENVIRONMENT_TOKEN } from '@mckinsey-converge/environment';\nimport { LegacyOverlaysModule } from '@mckinsey-converge/legacy-overlays';\nimport { UserModule } from '@mckinsey-converge/user';\nimport { MapModule } from 'src/app/map/map.module';\n\n/**\n * Cache some state in local storage. Not for use in production.\n */\nexport function localStorageSyncReducer(reducer: ActionReducer): ActionReducer {\n // Keys needed to fix prod reloading. MCK-1229\n let keys = [\n 'buildings',\n 'bookingForm',\n 'rooms',\n ];\n\n if (!environment.production) {\n keys = [\n 'bookings',\n 'buildings',\n 'organisation',\n 'bookingForm',\n 'rooms',\n 'user'\n ];\n }\n\n return localStorageSync({\n keys,\n rehydrate: true,\n })(reducer);\n}\n\nconst metaReducers: Array> = [localStorageSyncReducer];\n\n\n@NgModule({\n declarations: [\n AppComponent,\n ShellWrapperComponent\n ],\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n AppRoutingModule,\n HttpClientModule,\n FormsModule,\n ComposerModule,\n SharedContentModule,\n LegacyOverlaysModule,\n StoreModule.forRoot({}, { metaReducers }),\n StoreDevtoolsModule.instrument({\n maxAge: 100,\n logOnly: environment.production\n }),\n EffectsModule.forRoot(),\n BookingsModule,\n BookingModule,\n BuildingsModule,\n MapModule,\n OrganisationModule,\n RoomsModule,\n UiModule,\n UserModule\n ],\n providers: [\n { provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: { float: 'nevet' } },\n provideMockSettingsObject(DEFAULT_SETTINGS),\n { provide: ENVIRONMENT_TOKEN, useValue: environment }\n ],\n bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n","import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { BookingStateService, OrganisationService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, getTimezoneOffsetString, toMiddayUTC } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'calendar-date-widget',\n templateUrl: './calendar-date-widget.component.html',\n styleUrls: ['./calendar-date-widget.component.scss'],\n})\nexport class CalendarDateWidgetComponent extends BaseDirective implements OnInit {\n /** Currently selected date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Currently building timezone */\n @Input() public timezone: string;\n /** Currently active zone */\n @Input() public zone: string;\n /** Whether to show new item button */\n @Input() public show_add_item = false;\n /** Whether to show the events for the active month */\n @Input() public show_events: boolean = false;\n /** Preserve last selected date */\n @Input() public retainSelectedDate: boolean = false;\n /** Emitter for changes selected date */\n @Output() public dateChangeTz = new EventEmitter();\n /** Emitter for add item button */\n @Output() public event = new EventEmitter();\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n public event_map: { [date: string]: number };\n\n public fromDateTz = DateNow().subtractValue({ months: 6 });\n\n public get now() {\n return DateNow();\n }\n\n /** Display string for the currently selected date */\n public get tz(): string {\n return getTimezoneOffsetString(this.timezone_value);\n }\n\n public get timezone_value() {\n return localStorage.getItem('CONCIERGE.timezone') || this.timezone || this.now.building_tz;\n }\n\n public get is_today() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone_value,\n }),\n 'day'\n );\n }\n\n constructor(private _bookings: BookingStateService, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // CONCIERGE.date: Get the localstorage date and timezone when changing pages.\n let date: any;\n if(!this.retainSelectedDate) {\n date = +localStorage.getItem('CONCIERGE.date') || this.now.ms;\n } else {\n date = this.now.ms;\n }\n\n \n /* istanbul ignore else */\n if (date && (date !== this.dateTz.ms || this.timezone_value !== this.dateTz.building_tz)) {\n // CONCIERGE.date Reapply the localstorage date and timezone when changing pages.\n this.timeout(\n 'init',\n () => {\n this.dateTz = new DateTZ({\n date,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n this.updateDate();\n },\n 10\n );\n }\n this.subscription(\n 'events',\n this._bookings._noOfMeetings.subscribe((list) => {\n this.event_map = {};\n this.event_map = list[0];\n })\n );\n }\n\n public noOfCount(event) {\n // Disabling bellow until find more reliable way to call as it is been called multiple times on hover/click\n // this._bookings.getDailyMeetingCount();\n // event.stopPropogation();\n }\n\n /**\n * Change the selected date with the arrow controls\n *\n */\n public changeDate(value: number) {\n let date = new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n date = date.addValue({ days: value });\n this.dateTz = date;\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n /**\n * Change the selected date with the calendar widget\n *\n */\n public applyDatePickerValue(dateInputTz: DateTZ) {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(dateInputTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n this.closeDatePicker();\n }\n\n public updateDate() {\n this.timeout('update_date', () => this._bookings.setDate(this.dateTz));\n }\n\n /** Reset date to the current date */\n public resetDate() {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(this.now).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n public closeDatePicker() {\n this.updateDate();\n }\n\n /** New Item button click */\n public newItem(): void {\n this.event.emit('new_item');\n }\n}\n","
\n\n \n
\n
\n \n
\n

Today

\n

{{ dateTz.ms | date: 'mediumDate':tz }}

\n
\n \n
\n
\n \n \n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\n\nconst routes: Routes = [\n { path: '', component: BookingCalendarWrapperComponent },\n { path: ':level', component: BookingCalendarWrapperComponent },\n { path: '**', redirectTo: '' }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingCalendarRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingFormData,\n BookingsService,\n Building,\n OrganisationService,\n SettingsService,\n SpacesService,\n selectActiveForm\n} from '@mckinsey-converge/data-common';\nimport { Store, select } from '@ngrx/store';\nimport { distinctUntilChanged, first } from 'rxjs/operators';\n\nimport { RoutePayload, TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'booking-calendar-wrapper',\n templateUrl: './booking-calendar-wrapper.html',\n styleUrls: ['./booking-calendar.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookingCalendarWrapperComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n orgBuildings: Building[] = [];\n \n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private settingService: SettingsService,\n private store: Store,\n ) {\n super();\n\n \n }\n\n public ngOnInit(): void {\n /** allow booking bypass to receive bookings for staff calendar view only */\n this.settingService.bypass_bookings = true;\n\n this.orgBuildings = this._org.buildings;\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz) {\n localStorage.setItem('CONCIERGE.date', `${next.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${next.timezone}`);\n const building = this._org.buildings.find(\n (_) => _.id === next.location.filter(el => el.groupChild)[0]?.meta?.building?.id\n );\n if(building) {\n this._org.building = building;\n }\n \n }\n }));\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.orgBuildings = this._org.buildings;\n })\n\n \n }\n\n public onBackCallback() {}\n\n public ngOnDestroy(): void {\n /** disallowed booking bypass when you are moving from staff app calendar view*/\n this.settingService.bypass_bookings = false;\n }\n\n}\n","
\n\t
\n\t\t \n\t\t\n\t
\n\t\n\t\n
","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\nimport { StaffCalendarComponent } from './staff-calendar/staff-calendar.component';\nimport { CalendarDateWidgetComponent } from './booking-calendar-date-widget/calendar-date-widget.component';\nimport { DayViewTimelineComponent } from './staff-calendar/timeline/timeline.component';\nimport { DayViewSpaceComponent } from './staff-calendar/space/space.component';\nimport { DayViewSpaceEventComponent } from './staff-calendar/space/event/event.component';\n\n\nimport { BookingCalendarRoutingModule } from './booking-calendar-routing.module';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { UiModule } from '@mckinsey-converge/ui';\n\nimport {CngMenuItemComponent} from './cng-menu-item/cng-menu-item.component';\n\nexport const bookingModuleDeclarations = [\n BookingCalendarWrapperComponent,\n StaffCalendarComponent,\n CalendarDateWidgetComponent,\n DayViewTimelineComponent,\n DayViewSpaceComponent,\n DayViewSpaceEventComponent,\n CngMenuItemComponent\n ];\n\nexport const bookingModuleImports = [\n CommonModule,FormsModule,\n ReactiveFormsModule,\n SharedContentModule,\n UiModule,\n \n \n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingCalendarRoutingModule,\n // StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingCalendarModule {\n}","import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NavItem} from './nav-item';\nimport { MatMenu } from '@angular/material/menu';\n\n@Component({\n selector: 'cng-menu-item',\n templateUrl: './cng-menu-item.component.html',\n styleUrls: ['./cng-menu-item.component.scss']\n})\nexport class CngMenuItemComponent implements OnInit {\n @Input() items: NavItem[];\n @Input() activeOption: string;\n @ViewChild('childMenu', {static: true}) public childMenu: any;\n\n @Output() public onChildSelect = new EventEmitter<{}>();\n \n constructor(public router: Router) {\n }\n\n ngOnInit() {\n }\n\n public notifySelection(node) {\n this.onChildSelect.emit(node);\n }\n}\n","\n \n \n 0\">\n \n \n \n \n \n \n \n \n \n ","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space, BOOKING_STATUS, CloseDialogService, DialogIds, BookingStoreState, User } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { CateringOrder } from '@mckinsey-converge/data-common';\n\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState, selectCurrentUser } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { take } from 'rxjs/operators';\n\n/** Details about the associated event overlapping with other events */\nexport interface IEventOverlap {\n /** Index of this item with the overlapping items */\n index: number;\n /** Total number of items overlapping with this one */\n total: number;\n}\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n \n@Component({\n selector: 'day-view-space-event',\n templateUrl: './event.component.html',\n styleUrls: ['./event.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewSpaceEventComponent extends BaseDirective implements OnInit, OnChanges {\n /** Event to display */\n @Input() public booking: Booking;\n /** Date to display bookings for */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Space associated with the booking */\n @Input() public space: Space;\n /** Whether the item is a fixed size */\n @Input() public fixed: boolean;\n /** Overlap details for the booking */\n @Input() public overlap: IEventOverlap;\n /** Whether an action is being processed for this booking */\n @Input() public loading: boolean;\n /** Emitter for the current position of the booking within the timeline */\n @Output() public position = new EventEmitter<{ top: number; height: number }>();\n\n /** Position of the booking start time in the day */\n public top: number;\n /** Position of the booking relative to overlapping bookings */\n public left: number;\n /** Height based of the duration of the booking */\n public height: number;\n /** Size of the booking when overlapping with other bookings */\n public width: number;\n /** Offset from the booking's top that the setup time starts */\n public overflow_top: number;\n /** Offset from the booking's bottom that the breakdown time ends */\n public overflow_bottom: number;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n currentUser: User;\n constructor(\n private _service: ApplicationService,\n public store: Store,\n private _dialog: MatDialog,\n private _router: Router,\n private cdRef: ChangeDetectorRef,\n private closeDialogService: CloseDialogService\n ) {\n super();\n }\n\n ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n public get local_id(): string {\n return this.booking.icaluid.substr(0, 6);\n }\n\n /** Type of booking */\n public get type(): string {\n const userEmail = this.currentUser.email;\n const { creator, organiser } = this.booking;\n if(userEmail === creator.email || userEmail === organiser.email) \n return this.booking.getType();\n else \n return 'others-booking';\n }\n\n /** Period that the booking will occur during the day */\n public get period(): string {\n // the booking time is being pass in as the local timezone version.\n return this.booking.time_period;\n }\n\n /** Number attendees expected to turn up to the booking */\n public get expected(): number {\n const expected = this.booking.expected_attendees;\n return this.space ? expected[this.space.email] || 0 : 0;\n }\n\n /** Whether the meeting has catering attached */\n public get has_catering(): boolean {\n return !!this.order;\n }\n\n public get order(): CateringOrder {\n return this.booking.catering.find((order) => order.location_id === this.space.email);\n }\n\n /** Whether booking is active */\n public get active(): boolean {\n const booking = this._service.get('CONCIERGE.day_view.viewing');\n return !booking || booking.id === this.booking.id;\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.booking || changes.overlap || changes.dateTz) {\n this.calculatePosition();\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n }\n }\n\n /** Store the order details for viewing in another component */\n public storeOrder(order: CateringOrder) {\n const booking_details = this.booking.toApiJSON();\n localStorage.setItem('CONCIERGE.view_order', JSON.stringify(order.toJSON()));\n localStorage.setItem('CONCIERGE.view_booking', JSON.stringify(booking_details));\n localStorage.setItem('CONCIERGE.date', `${this.booking.startDateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.booking.startDateTz.building_tz}`);\n }\n\n /**\n * View catering order for the booking\n */\n public viewOrder(order: CateringOrder) {\n /* istanbul ignore else */\n if (this.booking && this.booking.catering) {\n /* istanbul ignore else */\n if (localStorage) {\n this.storeOrder(order);\n }\n this._router.navigate(['/catering', 'orders'], {\n queryParams: { booking: this.booking.id, view: order.id },\n });\n }\n }\n\n /** Calculate the position */\n private calculatePosition() {\n /* istanbul ignore else */\n if (this.booking) {\n const overlap = this.overlap || { index: 0, total: 1 };\n const shown_date = this.dateTz.startOfValue('day');\n const date = this.booking.startDateTz.startOfValue('minute');\n const end = this.booking.endDateTz.startOfValue('minute');\n const from_previous_day = !date.isSameDate(shown_date, 'day');\n if (end.isBeforeDate(shown_date, 'day')) { // Hide booking if not on shown date\n this.top = -100;\n this.height = 1;\n return;\n }\n\n //R-- Stragest thing, but one time this was logging bookings form different timezones?\n // this.dateTz.logDateTz('calculatePosition this.dateTz')\n // this.booking.startDateTz.logDateTz('calculatePosition this.booking.startDateTz')\n\n const start = from_previous_day ? 0 : Math.abs(+date.dateDiff(shown_date, 'hours', 'hours').toFixed(3));\n const duration = Math.min(\n this.booking.duration,\n Math.abs(shown_date.dateDiff(date.addValue({ minutes: this.booking.duration }), 'minutes'))\n );\n this.top = Math.max(0, (start / 24) * 100);\n this.height = Math.min(\n 100 - this.top,\n this.fixed ? duration / 60 : (duration / 60 / 24) * 100\n );\n this.position.emit({ top: this.top, height: (duration / 60 / 24) * 100 });\n this.width = Math.min(100, 100 / overlap.total + 5);\n this.left = Math.min(100 - this.width, this.width * overlap.index - 5 * overlap.index);\n this.overflow_top =\n (this.booking.setup[this.space.email]\n ? (this.booking.setup[this.space.email] / 60) / duration\n : -0.1) * 100;\n this.overflow_bottom =\n (this.booking.breakdown[this.space.email]\n ? (this.booking.breakdown[this.space.email] / 60) / duration\n : -0.1) * 100;\n if (this.booking.all_day) {\n this.top = 0;\n this.height = 100;\n }\n }\n }\n\n public get emailURL() {\n const userEmail = this.currentUser.email;\n const userName = this.currentUser.name\n const { creator, organiser } = this.booking;\n\t\treturn `mailto:${encodeURIComponent(organiser.email)}?cc=${encodeURIComponent(userEmail)}&subject=Request%20to%20release%20room%20reservation%20-%20${encodeURIComponent(this.space.simple_name)}`;\n\t}\n\n /** Whether booking has been ended */\n public expired(): boolean {\n return ['started','in_progress','expired_yesterday', 'done'].includes(this.booking.timeBasedStatusLabel);\n }\n}\n","\n \n \n 50 ? ' low' : '')\"\n [style.z-index]=\"(overlap?.index || 0) + 2\"\n \n >\n
\n
{{ booking.all_day ? 'All Day' : period }}
\n
\n \n\n \n \n
\n
\n
\n
\n
Host: 
\n
\n {{ booking.organiser?.name || booking.organiser }}\n
\n
\n \n
Booked by: 
\n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n
\n
{{ booking.title }}
\n
\n
\n
\n {{ booking.attendees ? booking.attendees.length || 'No' : 'No' }} Attendee{{\n booking.attendees?.length === 1 ? '' : 's'\n }}{{ expected ? '(' + expected + ' Expected)' : '' }}\n
\n
\n
0\">\n
\n Company: {{ booking.company.length }}\n
\n
\n
\n
Welcomed by: {{ booking.organiser?.name || booking.organiser }}
\n
\n
\n
Catered
\n
\n
\n \n \n \n \n\n","import {\n Component,\n OnChanges,\n Input,\n SimpleChanges,\n Output,\n EventEmitter,\n ViewChild,\n ElementRef,\n OnInit,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { CdkDragMove, CdkDragDrop } from '@angular/cdk/drag-drop';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first } from 'rxjs/operators';\n\nimport { IEventOverlap } from './event/event.component';\nimport { BaseDirective, closestToTimeSlotTz, Identity } from '@mckinsey-converge/base';\nimport { OrganisationService, Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { ConfirmModalComponent } from '@mckinsey-converge/legacy-overlays';\nimport { DialogEvent, HashMap } from '@mckinsey-converge/base';\nimport { DayViewSettings } from '@mckinsey-converge/data-common';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { BookingsService } from '@mckinsey-converge/data-common';\n\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\n@Component({\n selector: 'day-view-space',\n templateUrl: './space.component.html',\n styleUrls: ['./space.component.scss'],\n})\nexport class DayViewSpaceComponent extends BaseDirective implements OnInit, OnChanges {\n /** List of space dropzones connected to */\n @Input() public space_list: string[];\n /** Date to display events for */\n @Input() public dateTz: DateTZ;\n /** Space to display events for */\n @Input() public space: Space;\n /** Scroll value of the day view */\n @Input() public scroll: number;\n /** Only show events with setup and/or breakdown times */\n @Input() public overflow_only: boolean;\n /** Mapping of whether to show events with a given legend id */\n @Input() public legend: HashMap = {};\n /** Scroll value to add to drop placeholders */\n @Input('scrollTop') public scroll_top: number;\n /** Last update time of the displayed bookings */\n @Input('lastUpdate') public last_update: number;\n\n @Input() public eventMovingLoader : HashMap = {};\n /** Emitter for whether the space column is in view */\n @Output() public inView = new EventEmitter();\n /** Emitter for whether an event is being dragged */\n @Output() public dragging = new EventEmitter();\n /** Emitter for whether an event is being dropped and moving in progress */\n @Output() public moving = new EventEmitter<{}>();\n /** List of bookings for the current date and space */\n public event_list: Booking[] = [];\n /** Mapping of event IDs to overlap details */\n public overlap_details: HashMap = {};\n /** Mapping of positions of event in the day */\n public position_list: HashMap<{ top: number; height: number }> = {};\n /** Override for mapped position */\n public top: number;\n /** Client Rectangle for the container element box */\n public box: ClientRect;\n /** Whether the space list is in view */\n public in_view: boolean;\n /** ID of the booking with an action processing */\n public override_state: string;\n /** Map of bookings to whether they are loading */\n public loading: HashMap = {};\n /** Settings for day view */\n public settings: DayViewSettings = {} as any;\n\n /** Container element for the component contents */\n @ViewChild('view', { static: true }) private view: ElementRef;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _bookings: BookingsService,\n private _dialog: MatDialog,\n private cdr: ChangeDetectorRef,\n private _org: OrganisationService,\n ) {\n super();\n }\n\n /** Events to display for the active date */\n public events: Booking[] = []\n\n public ngOnInit(): void {\n this.events = this.filterEvents();\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.settings = this._service.setting('app.day_view') || {};\n // this.subscription(\n // 'breakdown',\n // this._service\n // .listen('APP.breakdown')\n // .subscribe((state) => {\n // this.overflow_only = state;\n // this.events = [...this.filterEvents()];\n // })\n // );\n // this.subscription(\n // 'legend',\n // this._service\n // .listen('CONCIERGE.legend')\n // .subscribe((state) => (this.legend = state || {}))\n // );\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...list];\n this.events = [...this.filterEvents()];\n this.cdr.detectChanges();\n })\n );\n this.checkInView();\n });\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.scroll) {\n this.checkInView();\n }\n if (changes.space) {\n this.event_list = [...this.event_list];\n this.timeout('in_view', () => this.checkInView(), 100);\n }\n /* istanbul ignore else */\n if (changes.last_update) {\n this.timeout('update_overlaps', () => this.calculateOverlaps(), 1000);\n }\n }\n\n //replace this with concierge space.comp filterEvents\n // private filterEvents(): Booking[] {\n // if (this.space) {\n // const bookings = this.event_list;\n // const list = bookings.filter((event) => {\n // if (this.override_state && this.override_state === event.icaluid) {\n // this.loading[event.id] = true;\n // }\n\n // const ignore = event.is_recurrent && event.recurrence_type === 'master';\n\n // return (\n // !ignore && !event.declined && // filtered declied bookings\n // event.room.email === this.space.email &&\n // (!this.overflow_only ||\n // event.setup[event.room.email] ||\n // event.breakdown[event.room.email])\n // );\n // }).map(e => new Booking({...e.toJSON()}) );\n\n // return list;\n // }\n // return [];\n // }\n\n private filterEvents(): Booking[] {\n if (!this.space) {\n return [];\n }\n \n return this.event_list.filter((event) => {\n // Mark as loading if override state matches.\n if (this.override_state && this.override_state === event.icaluid) {\n this.loading[event.id] = true;\n }\n \n const isRecurrentMaster = event.is_recurrent && event.recurrence_type === 'master';\n const isRoomEmailMatch = event.multi_rooms.some(room => room.email === this.space.email);\n \n // Determine if the event should be included based on setup or breakdown conditions.\n const isIncludedInSetupOrBreakdown = event.multi_rooms.some(room => {\n return event.setup[room.email] || event.breakdown[room.email];\n });\n \n return !isRecurrentMaster && isRoomEmailMatch && (!this.overflow_only || isIncludedInSetupOrBreakdown);\n }).map(event => new Booking({...event.toJSON()}));\n }\n\n /* istanbul ignore next */\n /**\n * Track by function for ngFor optimisation\n * @param index Index of the item\n * @param item Data associated with the item at the given index\n */\n public trackByFn(index: number, item: Booking) {\n return item.id || index;\n }\n\n /**\n * Calculate to overlap details for the booking events on the space\n */\n private calculateOverlaps() {\n const events = this.events.sort(\n (a, b) =>\n a.startDateTz.ms - b.startDateTz.ms ||\n a.duration - b.duration ||\n (a.title || '').localeCompare(b.title || '')\n );\n events.forEach((i) => (this.overlap_details[i.id] = { index: 0, total: 1 }));\n for (const bkn of events) {\n const bkn_start = bkn.startDateTz.startOfValue('minute');\n const bkn_end = bkn.endDateTz.startOfValue('minute');\n let count = 1;\n let index = 0;\n const collisions: Booking[] = [];\n for (const cmp of events) {\n /* istanbul ignore else */\n if (bkn.id !== cmp.id) {\n const cmp_start = cmp.startDateTz.startOfValue('minute');\n const cmp_end = cmp.endDateTz.startOfValue('minute');\n /* istanbul ignore else */\n if (\n bkn_start.isSameDate(cmp_start, 'minute') ||\n (bkn_start.isAfterDate(cmp_start) && bkn_start.isBeforeDate(cmp_end)) ||\n bkn_end.isSameDate(cmp_end, 'minute') ||\n (bkn_end.isAfterDate(cmp_start) && bkn_end.isBeforeDate(cmp_end))\n ) {\n count++;\n collisions.push(bkn);\n /* istanbul ignore else */\n if (\n events.findIndex((i) => i.id === bkn.id) >\n events.findIndex((i) => i.id === cmp.id)\n ) {\n index++;\n }\n }\n }\n }\n this.overlap_details[bkn.id] = { index: Math.max(0, index), total: count };\n }\n }\n\n /**\n * Check whether the space column is with the view of the\n */\n private checkInView() {\n /* istanbul ignore else */\n if (this.view && this.view.nativeElement) {\n const el = this.view.nativeElement;\n this.in_view =\n el.offsetLeft + this.scroll >= -240 &&\n el.offsetLeft + this.scroll <= window.innerWidth;\n this.inView.emit(this.in_view);\n }\n }\n\n /**\n * Initialise drag events\n */\n public initDrag() {\n this.box = this.view.nativeElement.getBoundingClientRect();\n this.dragging.emit(true);\n }\n\n /**\n * Cleanup after drag\n */\n public endDrag() {\n this.timeout('end_drag', () => (this.top = 0), 10);\n this.dragging.emit(false);\n }\n\n /**\n * Update top position of the dragged event placeholder\n * @param booking Booking being dragged\n * @param event Drag event\n */\n public updateDragTop(event: CdkDragMove) {\n /* istanbul ignore else */\n if (event.delta.y) {\n const y = event.pointerPosition.y;\n const top = (y - this.box.top - this.scroll_top) / this.box.height;\n const top_minutes = (Math.round((top * 24 * 60) / 15) * 15) / 60;\n this.top = (top_minutes / 24) * 100;\n\n }\n }\n\n\n\n\n\n public checkAvailabilityOnGivenTime(selectedBlockStart, selectedBlockEnd) {\n const runningBookings =\n this.events?.filter((bks) => {\n const startEpoch = new DateTZ({\n date: bks.start_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const endEpoch = new DateTZ({\n date: bks.end_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const hasValidBreakdown: boolean =\n bks.breakdown &&\n Object.values(bks.breakdown).some((value) => value !== null);\n if (selectedBlockStart.ms === endEpoch && hasValidBreakdown) {\n return true;\n } else\n return (\n (selectedBlockStart.ms >= startEpoch && selectedBlockStart.ms < endEpoch) ||\n (selectedBlockEnd.ms > startEpoch && selectedBlockEnd.ms < endEpoch)\n );\n }) || [];\n return !!runningBookings.length;\n }\n\n\t\t/** Whether booking has been ended */\n public expired(booking): boolean {\n\t\t\treturn booking.timeBasedStatusLabel === 'done';\n\t\t}\n\n\t\t\n}\n","\n\n
\n
\n
\n
\n
\n\n \n \n \n\t\t\n
\n
\n \n
\n
\n
\n \n\n\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first, take } from 'rxjs/operators';\n\nimport { BaseDirective, HashMap, Identity } from '@mckinsey-converge/base';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\nexport interface NavItem {\n\tdisplayName: string;\n\ticonName?: string;\n\troute?: string;\n\tmeta?:{}; \n\tchildren?: NavItem[];\n}\n\n\nimport {\n ApplicationService,\n BookingStateService,\n BookingStoreState,\n BuildingLevel,\n OrganisationService,\n selectBookingByIdResultsFromState,\n User,\n Booking,\n SpacesService,\n Space,\n Building,\n searchRoomsAndBookings\n} from '@mckinsey-converge/data-common';\n\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { BuildingStoreState } from 'libs/buildings/src';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { Subscription } from 'rxjs';\nimport { DropdownOpion } from '@mckinsey-converge/ui';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'staff-calendar',\n templateUrl: './staff-calendar.component.html',\n styleUrls: ['./staff-calendar.component.scss']\n})\nexport class StaffCalendarComponent extends BaseDirective implements OnInit {\n /** Currently selected date, starts out with no timezone data, gets updated later */\n public dateTz: DateTZ = DateNow(new Date());\n\n /** ID of the currently selected level */\n public active_level: string = '';\n /** ID of the currently selected type */\n public active_type: string = '';\n /** List of levels available for the active building */\n public levels: BuildingLevel[] = [];\n /** List of space types available for the active building */\n public space_types: Identity[] = [];\n /** Whether to show only items with a setup and/or breakdown time */\n public only_overflow: boolean;\n \n\n\t\tprivate spaceTypesSubscription: Subscription;\n\n\t\tevent_list: Booking[] = [];\n\t\tsearchStr: any;\n\t\tfoundSearchLength: number = 0;\n\t\tsearchedCounter: any = 1;\n\t\tshowSrchWarning: boolean;\n\t\ttotalFoundItem: number = 0;\n spaces: Space[] = [];\n\t\tbuildingsInSameCity: Building[];\n\t\tbuildingMenuItems: NavItem[];\n\t\tactiveBuildingName: string;\n\t levelsDD: any = [];\n\t roomLevelDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; };\n \n\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _dialog: MatDialog,\n private _router: Router,\n private _route: ActivatedRoute,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this._service.title = 'Day View';\n\n\t\t\t\tthis._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Init dateTz here once the organization data is loaded.\n this.dateTz = new DateTZ({ date: this.dateTz.ms, is_local_tz: false, building_tz: this.timezone });\n this.subscription(\n 'route.params',\n this._route.paramMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('level') && this.active_level !== params.get('level')) {\n const level = this._org.levelWithID(params.get('level'));\n /* istanbul ignore else */\n if (level) {\n const building = this._org.buildings.find(\n (bld) => bld.id === level.building_id\n );\n /* istanbul ignore else */\n if (building) {\n this.active_level = level.id;\n this._org.building = building;\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n }\n }\n }\n })\n );\n this.subscription(\n 'building',\n this._org.listen('active_building').subscribe(() => {\n this._booking_state_service.updateRoomList();\n // Update dateTz here when the building is changed.\n\t\t\t\t\t\t\t\t\t\tthis.dateTz = new DateTZ({\n\t\t\t\t\t\t\t\t\t\t\tdate: this.dateTz.ms,\n\t\t\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\t\t\tbuilding_tz: this.timezone,\n\t\t\t\t\t\t\t\t\t\t});\n const building = this._org.building;\n\n /* istanbul ignore else */\n if (!building.levels.find((lvl) => lvl.id === this.active_level)) {\n this.active_level = building?.levels[0]?.id;\n this.updateLevel();\n }\n\t\t\t\t\t\t\t\t\t\tthis.initSpace();\n\n this.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\t\t\t\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\t\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\t\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.levelsDD = [];\n\t\t\t\t\t\t\t\t\t\tthis.levels.forEach(el => {\n\t\t\t\t\t\t\t\t\t\t\tthis.levelsDD.push({\n\t\t\t\t\t\t\t\t\t\t\t\t display: el.name, value: el.id, meta: {} \n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\tthis.roomLevelDD = {\n\t\t\t\t\t\t\t\t\t\t\tddBoxClass: 'room-level',\n\t\t\t\t\t\t\t\t\t\t\toptions: this.levelsDD,\n\t\t\t\t\t\t\t\t\t\t\tdefaultSelected: this.levelsDD.filter(el => el.value === this.active_level )[0],\n\t\t\t\t\t\t\t\t\t\t\tonChangeCallback: this.onChangeActiveLevel.bind(this)\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\tthis.buildingsInSameCity = this._org.buildings.filter(\n\t\t\t\t\t\t\t\t\t\t\t(_) => _.city === building.city\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.generateBuildingMenu();\n\n \n })\n );\n \n });\n\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...this.filterEvents(list)];\n\n })\n );\n }\n\n private filterEvents(list): Booking[] {\n\t\t\tconst bookings = list;\n\t\t\tconst filterd_booking = bookings.filter((event) => {\n\t\t\t\t\tconst ignore = event.is_recurrent && event.recurrence_type === 'master';\n\t\t\t\t\treturn ( !ignore );\n\t\t\t});\n\n\t\t\treturn filterd_booking || [];\n }\n\n public initSpace() {\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.active_level ? this._org.building.id : this.active_level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0 && _.bookable);\n })\n );\n }\n\n // isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n \n searchBooking(value) {\n\n // Resetting warning flag\n this.showSrchWarning = false;\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = value.toLowerCase().trim();\n \n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.event_list, ...this.spaces];\n // Filtering the combine array to find matching room or booking\n const filteredItems = searchRoomsAndBookings(allItems, searchValue);\n \n // Updating the total number of found items in serach\n this.totalFoundItem = filteredItems.length;\n\n // Setting showSrchWarning flag if no result were found \n this.showSrchWarning = !this.totalFoundItem;\n\n // Updating lenght of found items for later use\n this.foundSearchLength = this.totalFoundItem - 1;\n\n if(this.searchStr !== value) {\n // Setting the first found as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[0]);\n // Resetting the search counter\n this.searchedCounter = 0;\n }\n else {\n // Handling case where seached string is the same as previou one \n // Incrementing search counter, loopoing back to 0 if it exceed the length of found items\n this.searchedCounter = ( this.searchedCounter < this.foundSearchLength ) ? this.searchedCounter + 1 : 0\n // Setting the next found items as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[this.searchedCounter]);\n }\n\n // Storing the current search string for future camparison\n this.searchStr = value;\n }\n\n\n public ngOnDestroy(): void {\n this._service.set('CONCIERGE.day_view.viewing', []);\n }\n\n\n \n\n // that encapsulates the common elements.\n public get timezone() {\n return this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone');\n }\n\n public updateDateTz(dateTz: DateTZ) {\n this.dateTz = dateTz;\n }\n\n public updateLevel() {\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n\t\t\t\tthis.initSpace();\n // this._router?.url?.includes('/booking-calendar') && this._router.navigate(['/home/results/booking-calendar', this.active_level], {relativeTo: this._route});\n }\n\n\t\tpublic generateBuildingMenu() {\n\n\n\t\t\tif(this.buildingsInSameCity.length) {\n\n\t\t\t\tconst menuItem: NavItem[] = [{\n\t\t\t\t\tdisplayName: this._org.building.name,\n\t\t\t\t\ticonName: 'close',\n\t\t\t\t\tchildren:[]\n\t\t\t\t}];\n\n\n\t\t\t\tthis.buildingsInSameCity.forEach(el => {\n\t\t\t\t\tconst buildingLevels: NavItem[] = [];\n\n\t\t\t\t\tel.levels.forEach(lvl => buildingLevels.push({\n\t\t\t\t\t\tdisplayName: lvl.name,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tlevel_id : lvl.id,\n\t\t\t\t\t\t\tbuilding_id: lvl.building_id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tbuildingLevels.push({ displayName: 'All Levels', children: [], meta: {\n\t\t\t\t\t\t\tlevel_id : '',\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t} \n\t\t\t\t\t});\n\n\t\t\t\t\tmenuItem[0].children.push({\n\t\t\t\t\t\tdisplayName: el.name,\n\t\t\t\t\t\tchildren: buildingLevels,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\tthis.buildingMenuItems = menuItem;\n\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\tpublic updateActiveBuilding (node) {\n\t\t\t// console.log(node);\n\t\t\tconst building = this.buildingsInSameCity.filter(bld => bld.id === node.meta.building_id)[0];\n\t\t\tthis._org.building = building;\n\t\t\tthis.activeBuildingName = building.name;\n\n\t\t\n\t\t\t\tthis.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\n\n\t\t\t\tthis.active_level = node.meta.level_id;\n\t\t\t\tthis.roomLevelDD.defaultSelected = this.levelsDD.filter(el => el.value === this.active_level )[0];\n\t\t\t\tthis.updateLevel();\n\t\t}\n\n\t\tonChangeActiveLevel(level:any) {\n\t\t\tthis.active_level = level.value;\n\t\t\t\n\t\t\tthis.updateLevel();\n\n\t\t}\n\n\t\t\n}\n\n","
\n
\n \n
\n \n
\n \n \n 0\">\n
\n {{activeBuildingName || item.displayName}}\n
\n \n
\n
\n \n
\n \n \n
\n
\n \n 1\">\n\n
\n \n \n \n
{{ totalFoundItem }}
\n \n
\n \n No search found!\n
\n
\n
\n\n \n \n \n \n
\n\n
\n \n
\n
\n
\n\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewChild, NgZone, DoCheck, ChangeDetectionStrategy, ChangeDetectorRef\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { filter, first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { HashMap, Identity } from '@mckinsey-converge/base';\n// import { MeetingDetailsModalComponent } from 'src/app/calendar/meeting-details-modal/meeting-details-modal.component';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, toMiddayUTC } from '@mckinsey-converge/date-tz';\nimport { isToday } from 'date-fns';\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n\n\nconst UPDATE_INTERVAL = 10;\n\n@Component({\n selector: 'day-view-timeline',\n templateUrl: './timeline.component.html',\n styleUrls: ['./timeline.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewTimelineComponent\n extends BaseDirective\n implements OnInit, OnChanges, OnDestroy\n{\n /** DateTZ object of the active date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** ID of the active level */\n @Input() public level: string;\n /** ID of the room type to filter displayed spaces by */\n @Input() public space_type: string;\n /** List of shown legend items */\n @Input() public legend: HashMap = {};\n /** Whether to show only items with a setup and/or breakdown time */\n @Input() public overflow_only: boolean;\n /** Whether space bookings are being loaded */\n @Input() public loading: boolean;\n\n @Input() undo_action;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n /** Top value of the content scroll */\n public scroll_top: number = 0;\n /** Left value of the content scroll */\n public scroll_left: number = 0;\n /** Offset of the scroll value when starting a drag */\n public scroll_offset: number = 0;\n /** List of spaces to display for */\n public spaces: Space[] = [];\n /** List of spaces to display for */\n public filtered_spaces: Space[] = [];\n /** Mapping of space ids to whether they are in view */\n public in_view: { [id: string]: boolean } = {};\n /** Percent of the day that is now */\n public now: number;\n /** Currently active hour of the day */\n public active_hour: string;\n /** Mapping of spaces loading booking date */\n public loading_space: { [id: string]: boolean } = {};\n /** Booking ID to open modal for */\n public view_id: string;\n /** Last update time for the space bookings */\n public last_update: number = 0;\n /** Whether an event is being dragged */\n public is_dragging: boolean;\n /** Client rectangle for the scroll area */\n public box: ClientRect;\n /** Whether to show the holding bay */\n // public show_holding_bay: boolean = true;\n\n public space_zones: string[] = [];\n\n public is_today: boolean = this.isToday();\n public modalInitialized = false;\n\n /** Scrollable area of the day view */\n @ViewChild('scroll_area', { static: true }) private scroll_area: ElementRef;\n\n @ViewChild(CdkVirtualScrollViewport) virtualScroll: CdkVirtualScrollViewport;\n isEventMoving: boolean = false;\n bookingEl: any;\n timeoutID: any;\n column: any;\n\n /** Update scroll box when the window is resized */\n @HostListener('window:resize')\n public onResize() {\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n public get is_loading() {\n return this._booking_state_service.loading;\n }\n\n public isToday() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }),\n 'day'\n );\n }\n\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _org: OrganisationService,\n private _route: ActivatedRoute,\n private _renderer: Renderer2,\n private _dialog: MatDialog,\n private _zone: NgZone,\n private cdr: ChangeDetectorRef,\n ) {\n super();\n }\n\n public get holding_bay(): Space {\n const bld = this._org.building;\n /* istanbul ignore else */\n if (bld && bld.holding_bay) {\n return this._spaces.find(bld.holding_bay);\n }\n return null;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this._booking_state_service.startPollingEveryFiveMin();\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n this._zone.runOutsideAngular(() => {\n this.interval('time', () => this.updateTime(), 15 * 1000);\n });\n // R--- return to see if the booking service needs updating\n this.subscription(\n 'dateTz',\n this._booking_state_service.dateTz.subscribe((dateTz) => {\n // const dateTz = new DateTZ({date});\n this.dateTz = dateTz;\n })\n );\n });\n });\n this.is_today = this.isToday();\n\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n })\n );\n\n }\n\n ngAfterViewInit() {\n const d2 = this._renderer.createElement('div');\n this._renderer.addClass(d2, 'adjustable-room-block-2');\n this.virtualScroll.elementRef && this._renderer.appendChild(this.virtualScroll.elementRef.nativeElement, d2);\n }\n\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.level && this._org.building) {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.updateTime();\n this.initSpaces();\n }\n if (changes.space_type) {\n this.initSpaces();\n }\n }\n\n public ngOnDestroy() {\n if (this._booking_state_service?.stopPolling) this._booking_state_service?.stopPolling();\n }\n\n public init() {\n this._service.title = 'Day View';\n this.subscription(\n 'viewing',\n this._service\n .listen('CONCIERGE.day_view.viewing')\n .subscribe((event) => this.scrollIntoView(event) )\n );\n // Subscribe to route query changes\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('view') || localStorage.getItem('CONCIERGE.view_booking')) {\n this.view_id = params.get('view');\n const details = localStorage.getItem('CONCIERGE.view_booking');\n const spaceJson = localStorage.getItem('CONCIERGE.view_booking_space');\n /* istanbul ignore else */\n if (details) {\n const space: Space | undefined = spaceJson\n ? new Space(JSON.parse(spaceJson))\n : undefined;\n const booking = new Booking({ ...JSON.parse(details), room: space });\n if(!this.modalInitialized) {\n this.modalInitialized = true;\n // this.view(booking, space);\n localStorage.removeItem('CONCIERGE.view_booking');\n localStorage.removeItem('CONCIERGE.view_booking_space');\n }\n }\n }\n })\n );\n \n /* istanbul ignore else */\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n /**\n * Update scroll parameters to match the change in the scroll position\n * @param event\n */\n public updateScroll(event) {\n this.scroll_top = event.target.scrollTop;\n this.scroll_left = event.target.scrollLeft;\n }\n\n\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n\n /** Update the now line position */\n private updateTime() {\n const now = new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n });\n this.now = (now.dateHour + now.minutes / 60) / 24;\n this.active_hour = now.startOfValue('hour').formatDate('HH:mm');\n this.is_today = this.isToday();\n this.cdr.detectChanges();\n }\n\n\n /**\n * Scroll booking to the event on the day view\n * @param booking Booking to scroll into view\n */\n private scrollIntoView(searchData: Booking | Space ) {\n if (searchData && this.scroll_area && this.scroll_area['elementRef'].nativeElement) {\n this.column && this._renderer.removeClass(this.column, 'wild');\n\n /** Select space column element using space id in search data - \n * space.id if seach data is space object or data.space.id if search data is booking object\n * \n */\n const spaceId = searchData['space'] ? searchData['space'].id : searchData.id;\n const element: HTMLDivElement = this.scroll_area['elementRef']\n .nativeElement.querySelector(`#space-col-${spaceId}`);\n\n\n this.column = element;\n\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n if(searchData['space'] && searchData['space'].id) \n this.bookingEl = element?.querySelector(`#${searchData.id}`)?.querySelector('.event-container');\n\n\n /* istanbul ignore else */\n if (element) {\n this.timeoutID && clearTimeout(this.timeoutID);\n this._renderer.addClass(element, 'wild');\n this.bookingEl && this._renderer.addClass(this.bookingEl, 'wild');\n const scroll_box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n\n let date_percent;\n if(searchData['space'] && searchData['space'].id) {\n date_percent = Math.abs(\n searchData['startDateTz'].dateDiff(\n searchData['startDateTz'].startOfValue('day'),\n 'minutes'\n )\n ) / (24 * 60);\n }\n \n\n const box = element.getBoundingClientRect();\n const left = box.left - scroll_box.left + this.scroll_area['elementRef'].nativeElement.scrollLeft - 500;\n const top = (searchData['space'] && searchData['space'].id) ? \n this.scroll_area['elementRef'].nativeElement.scrollHeight * date_percent - 10 :\n 0\n\n\n this.scroll_area['elementRef'].nativeElement.scrollTo({\n left: left,\n top: top,\n behavior: 'smooth',\n });\n\n this.timeoutID = setTimeout(()=> {\n element && this._renderer.removeClass(element, 'wild');\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n }, 3000);\n }\n }\n }\n\n /**\n * Setup an auto-scroll for the display view\n * @param x\n * @param y\n */\n public scrollView(x: number, y: number) {\n /* istanbul ignore else */\n if (x || y) {\n this.scroll_area['elementRef'].nativeElement.scrollTop += y || 0;\n this.scroll_area['elementRef'].nativeElement.scrollLeft += x || 0;\n /* istanbul ignore else */\n if (\n (y &&\n this.scroll_area['elementRef'].nativeElement.scrollTop >=\n this.scroll_area['elementRef'].nativeElement.scrollHeight) ||\n (x &&\n this.scroll_area['elementRef'].nativeElement.scrollLeft >=\n this.scroll_area['elementRef'].nativeElement.scrollWidth) ||\n (y && this.scroll_area['elementRef'].nativeElement.scrollTop <= 0) ||\n (x && this.scroll_area['elementRef'].nativeElement.scrollLeft <= 0)\n ) {\n this.clearInterval('auto_scroll');\n }\n // this.updateScroll({ target: this.scroll_area['elementRef'].nativeElement });\n }\n }\n\n public clearSelected() {\n this._service.set('CONCIERGE.day_view.viewing', null);\n }\n\n public cancelScroll() {\n this.clearInterval('auto_scroll');\n }\n\n /** */\n\n // public dragChange(is_dragging: boolean) {\n // if (is_dragging) {\n // this.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop; \n // this.subscription(\n // 'listen_move',\n // this._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n // const position = { x: event.clientX, y: event.clientY };\n // const y = position.y > this.box.bottom - this.box.height * 0.05\n // ? 1\n // : position.y < this.box.top + this.box.height * 0.05\n // ? -1\n // : 0;\n // const x = position.x > this.box.right - this.box.width * 0.05\n // ? 1\n // : position.x < this.box.left + this.box.height * 0.05\n // ? -1\n // : 0;\n // this.scrollView(x * 5, y * 5);\n // this._zone.runOutsideAngular(() => {\n // this.interval('auto_scroll', () => {\n // return this.scrollView(x * 40, y * 40) \n // }, 15);\n // });\n // this.cdr.detectChanges();\n // })\n // );\n // this.clearInterval('bookings');\n // } else {\n // this.cancelScroll();\n // this.unsub('listen_move');\n // }\n // }\n\n private initSpaces() {\n const holding_bay = this.holding_bay;\n this.filtered_spaces = this.spaces.filter(\n (i) =>\n (!this.space_type || i.zones.indexOf(this.space_type) >= 0) &&\n (!holding_bay || i.id !== holding_bay.id) &&\n i.bookable\n );\n this.filtered_spaces.sort((a, b) => a.local_name.localeCompare(b.local_name));\n this.space_zones = this.spaces.map((i) => `space-col-${i.id}`);\n }\n\n\n\n\t// public onEventDragging(isDragging: boolean): void {\n\t// \t\t// Check if dragging is initiated\n\t// \t\tif (isDragging) {\n\t// \t\t\t// Store the current scroll position\n\t// \t\t\tthis.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop;\n\t// \t\t\t// Subscribe to mouse move events\n\t// \t\t\tthis.subscribeToMouseMove();\n\t// \t\t\t// Clear existing interval for bookings\n\t// \t\t\tthis.clearInterval('bookings');\n\t// \t\t} else {\n\t// \t\t\t// Cancel scroll operation\n\t// \t\t\tthis.cancelScroll();\n\t// \t\t\t// Unsubscribe from mouse move events\n\t// \t\t\tthis.unsubscribeFromMouseMove();\n\t// \t\t}\n\t// }\n\n\t// Subscribe to mouse move events and handle scroll logic\n\t// private subscribeToMouseMove(): void {\n\t// \tthis.subscription(\n\t// \t\t'listen_move',\n\t// \t\tthis._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n\t// \t\t\t// Get mouse position\n\t// \t\t\tconst position = { x: event.clientX, y: event.clientY };\n\t// \t\t\t// Calculate scroll direction based on mouse position\n\t// \t\t\tconst [x, y] = this.calculateScrollDirection(position);\n\t// \t\t\t// Scroll the view based on calculated direction\n\t// \t\t\tthis.scrollView(x * 5, y * 5);\n\t// \t\t\t// Run auto-scroll logic\n\t// \t\t\tthis.runAutoScroll(x, y);\n\t// \t\t\t// Detect changes to update the view\n\t// \t\t\tthis.cdr.detectChanges();\n\t// \t\t})\n\t// \t);\n\t// }\n\n\t// Calculate scroll direction based on mouse position\n\t// private calculateScrollDirection(position: { x: number, y: number }): [number, number] {\n\t// \tconst tolerance = 0.05;\n\t// \tconst x = this.calculateDirection(position.x, this.box.left, this.box.right, tolerance);\n\t// \tconst y = this.calculateDirection(position.y, this.box.top, this.box.bottom, tolerance);\n\t// \treturn [x, y];\n\t// }\n\n\t// Calculate direction based on mouse position and element boundaries\n\t// private calculateDirection(pos: number, min: number, max: number, tolerance: number): number {\n\t// \tif (pos > max - this.box.width * tolerance) {\n\t// \t\t\treturn 1; // Scroll right\n\t// \t} else if (pos < min + this.box.width * tolerance) {\n\t// \t\t\treturn -1; // Scroll left\n\t// \t} else {\n\t// \t\t\treturn 0; // Do not scroll\n\t// \t}\n\t// }\n\n\t// Run auto-scroll logic\n\t// private runAutoScroll(x: number, y: number): void {\n\t// \tthis._zone.runOutsideAngular(() => {\n\t// \t\t\tthis.interval('auto_scroll', () => this.scrollView(x * 10, y * 10), 10);\n\t// \t});\n\t// }\n\n\t// Unsubscribe from mouse move events\n\t// private unsubscribeFromMouseMove(): void {\n\t// \tthis.unsub('listen_move');\n\t// }\n\n // public movingEvent(booking) {\n // this.isEventMoving = booking.isMoving;\n // this.loading_space[booking.movingId] = booking.isMoving;\n \n // }\n\n}\n\n","
\n\t
\n\t\t\n\t
\n\n\t
\n\t\t
\n\t\t\t\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Time
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ timeslot.name }}
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ room.local_name }}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tCapacity - {{ room.capacity || '0' }}\n\t\t\t\t\t\t\t{{ room.capacity === 1 ? 'person' : 'people' }}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t
\n
\n
\n
\n\t
\n\t\t
Moving meeting
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n
\n","import {\n Component,\n Input,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n Router\n} from '@angular/router';\nimport {\n BaseDirective, shorterBuildingDateFormatString,\n} from '@mckinsey-converge/base';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n Booking,\n Building,\n BookingStoreState,\n clearBookingFormData,\n cateringAllowed,\n openBookingSurvey,\n roomHasCateringHours\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface statusObject {\n text: string,\n title: string,\n image: string,\n}\n\n@Component({\n selector: 'booking-confirmation',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n \n

{{ data?.isEditSeries || (booking.is_recurrent && booking.recurrence_type === 'master') ? 'Recurring Series' : 'Booking' }} {{data?.status.title}}

\n
\n \n \n \n
\n
\n
\n

{{ booking.title }}

\n

Room is no longer available for your chosen date and time

\n
\n \n
\n
Status: {{data?.status.text}}
\n
Date: {{data?.dateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.typeString}} meeting ({{data?.durationString}})
\n
\n
\n
\n \n {{booking?.recurrence_period === 'list' ? 'Specific dates' : booking?.recurrence_period | titlecase}}\n \n - Conflicts({{data?.isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{data?.dateString}}
\n
End date: {{data?.endDateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.type}} meeting ({{data?.durationString}})
\n
\n\n
\n \n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n Address: {{building.address}},\n {{building.city}}\n
\n
Room: {{booking.space.local_name}}
\n
Room Capacity: {{booking.space.capacity}}
\n
\n \n
\n \n \n \n \n
\n
\n
\n
\n \n
\n \n

{{ data?.status.text }}

\n
\n
\n \n
\n \n

\n \n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n

{{booking.organiser.name}}

\n

{{attendees}}

\n

{{company}}

\n

{{charge_code}}

\n

{{headcount}}

\n

{{notes}}

\n

\n
\n \n

\n

\n

\n

\n

\n

\n \n \n \n

\n
\n
\n
\n
\n

Catering is available for this meeting room

\n Add catering\n\n \n
\n
\n
\n
\n \n

\n

\n

 

\n \n
\n\n
\n
\n
\n

Ooops - we're sorry!

\n

Unfortunately your selected room has been booked by another user

\n

Please try searching for another room.

\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./booking-confirmation.component.scss']\n})\nexport class BookingConfirmationComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n\n @Input() public confirmed: boolean;\n @Input() public loading: boolean;\n\n @Input() public modal: boolean;\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\t\t@Input('dataForConfirmation') public data: any; // consolidated data using for confirmation template\n\n /** Emitter for close events */\n @Output() public callback = new EventEmitter();\n\n public currentPage: string;\n\n\t\tpublic get booking(): Booking {\n\t\t\treturn this.data?.booking\n\t\t};\n\n\n public get building(): Building {\n return this.data?.booking.room.building;\n };\n\n public get disableCateringButton(): boolean {\n return !cateringAllowed(this.data?.booking, this.building);\n }\n\n public get charge_code() {\n return (this.data?.booking.equipment_codes || {})[\n this.data?.booking.room.email\n ] || 'No Charge Code'\n }\n\n public get headcount() {\n return (this.data?.booking.expected_attendees || {})[\n this.data?.booking.room.email\n ] || 0\n }\n\n public get attendees() {\n const a = Array.isArray(this.data?.booking.attendees) ? this.data?.booking.attendees.map(u => u?.name ? u.name : '') : [];\n return a.join(', ');\n }\n\n public get company() {\n return this.data?.booking.company.join(', ');\n }\n\n public get notes() {\n const note = this.data?.booking.notes.find(n => n.type === 'equipment');\n return note ? note.message : '';\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get roomHasCatering() {\n return roomHasCateringHours(this.building, this.data?.booking?.space) && cateringAllowed(this.data?.booking, this.building);\n }\n\n public listItems(order) {\n return order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.data?.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n }\n\n constructor(\n private store: Store,\n private _router: Router,\n ) {\n super();\n }\n\n public getStatusColor (statusText: string): string {\n switch (statusText) {\n case 'confirmed':\n return 'approved'\n case 'unavailable':\n return 'cancelled'\n default:\n return statusText;\n }\n }\n\n public hasData() {\n return (this.confirmed && !this.loading) || this.isUnavailable();\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public async returnHome() {\n \n if (this.modal || this.placeIntoModal) {\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n } else {\n if(!this.isUnavailable()){\n this.store.dispatch(openBookingSurvey());\n // Clear everything out\n this.store.dispatch(clearBookingFormData());\n this._router.navigate(['/', 'home']);\n } else {\n await this._router.navigate(['/home', 'results'], { queryParams: { display: 'list' }});\n }\n }\n }\n\n public async startCatering() {\n this.store.dispatch(clearBookingFormData());\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n await this._router.navigate(['/', 'home', 'catering', this.data?.booking.id]);\n }\n\n public isUnavailable() {\n return this.data?.status.text.toLowerCase() === 'unavailable'\n }\n\n getTooltipText() { \n return this.data.booking.occurrence_details?.filter(ocurrence => ocurrence.id !== this.data.booking.id).map((item)=>{\n let date = item.start_epoch * 1000;\n let specificDates = new DateTZ({date, is_local_tz: false, building_tz: this.data.booking.timezone});\n return shorterBuildingDateFormatString(specificDates).slice(3);\n })\n }\n\n \n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n Booking,\n BookingFormData,\n selectActiveForm,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n\t\tSpace,\n\t\tgetLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent, shorterLocalDateFormatString } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-booking-create',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingCreateComponent extends BookingFormBaseComponent implements OnInit {\n\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.booking = this.bookingFormToBooking(next);\n }\n }));\n\n\t\t\t\t// in the parent component\n\t\t\t\tthis.updateConfimatinModal();\n }\n\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n this.booking = this.bookingFormToBooking(this.data.value);\n // const booking_form_data = this.data.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n if (!bookable) {\n // Refactored for\n //\thttps://acaprojects.atlassian.net/browse/MCK-1498\n //\thttps://mckinsey.atlassian.net/browse/CNG-97\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n\t\t\t\t\t\t\t\t\t// update template properties and booking\n\t\t\t\t\t\t\t\t\tthis.handleBookingSuccessResponse(bkn);\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n\t\t\t\t\t\t\t\t\t\t\tthis.loading = false;\n \tthis.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n },(err) => {\n this.timeout('error', () => {\n\t\t\t\t\t\t\t\t\tthis.handleBookingErrorMessage();\n }, 500);\n }\n );\n }\n\n}\n","
\n
\n \n

{{ warningMessage }}

\n \n
\n
\n \n \n \n \n
\n
\n
\n
\n
\n
\n

Book {{booking?.space?.local_name}}

\n
\n
\n \n
\n
\n
\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Details

\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
{{type}} meeting ({{durationString}})
\n
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' : data?.value?.recurrence_period | titlecase}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t - Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Start date: {{dateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
End date: {{endDateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Time: {{timeString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{type}} meeting ({{durationString}})
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\n
\n
Address: {{building?.address}},\n {{building?.city}}
\n
Room: {{booking?.space?.local_name}}
\n
Capacity: {{booking?.space?.capacity}}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n","import {Component,OnInit,Input,Output,EventEmitter,\n } from '@angular/core';\n import {\n Booking,\n selectActiveForm,\n BookingFormData,\n\t\tBookingStoreState,\n } from '@mckinsey-converge/data-common';\n import {\n\t\tStore,\n select,\n } from '@ngrx/store';\n import {\n distinctUntilChanged, take,\n } from 'rxjs/operators';\n import { BaseDirective } from '@mckinsey-converge/base';\n\timport {\n\t\tRoomStoreState,\n\t} from '@mckinsey-converge/rooms';\n\timport {\n\t\tBuildingStoreState\n\t} from '@mckinsey-converge/buildings';\n\timport { UserStoreState } from '@mckinsey-converge/user';\n\n\texport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n\n @Component({\n selector: 'app-booking-edit-wrapper',\n template: `
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
`,\n styleUrls: ['./booking-create.component.scss']\n })\n export class BookingEditWrapperComponent extends BaseDirective implements OnInit {\n\n\t\tpublic booking: Booking;\n\t\tpublic loading: boolean = true;\n\n constructor(\n public store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n this.subscription('activeForm',\n this.store.pipe(take(1),\n\t\t\t\t\tselect(selectActiveForm),\n \tdistinctUntilChanged()\n\t\t\t\t\t).subscribe((next: BookingFormData | undefined) => {\n\t\t\t\t\t\tthis.loading = false;\n \t\tif (next && next?.dateTz) {\n \t\tthis.booking = new Booking(next);\n \t\t}\n }));\n\n }\n\n }\n","import {\n Component,\n OnInit,\n Input,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport {\n Booking,\n selectActiveForm,\n storeBookingFormData,\n BookingFormData,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n getLastDateFromList,\n Space,\n SeriesAction\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\n@Component({\n selector: 'app-booking-edit',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingEditComponent extends BookingFormBaseComponent implements OnInit {\n @Input() public booking: Booking;\n @Output() public updateCallback = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n public roomEmail: string;\n\n public ngOnInit(): void {\n super.ngOnInit();\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n\n this.modal = !this.isEditSeries && !this.placeIntoModal;\n this.roomEmail = this.booking.space.email;\n const attendees = (this.data?.value?.attendees?.length && this.data?.value?.attendees[0]?.meta)\n ? this.data.value.attendees\n : this.booking.attendees.filter(bk => bk.name !== '' && bk.email !=='').map(u => {\n return {\n value: u.email,\n display: u.name,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: u.name,\n meta: { external: u.external, user: u, color: u.email.toLowerCase().includes('mckinsey.') ? 'internal' : 'external' },\n }\n });\n\n const company = (this.data?.value?.company?.length && this.data?.value?.company[0]?.groupId)\n ? this.data?.value?.company\n : this.booking.company.map(u => {\n return {\n value: u,\n display: u,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: u,\n }\n });\n\n const head_count = this.booking?.expected_attendees[this.roomEmail] ? this.booking?.expected_attendees[this.roomEmail] : 0;\n const code = this.booking?.equipment_codes[this.roomEmail] ? this.booking?.equipment_codes[this.roomEmail] : '';\n const organiser = (this.data?.value?.organiser && this.data?.value?.organiser?.meta)\n ? this.data?.value?.organiser\n : {\n display: this.booking.organiser.name,\n value: this.booking.organiser.email,\n meta: { user: this.booking.organiser }\n };\n const notes = Array.isArray(this.booking.notes) ? this.booking.notes.find(n => n.type === 'equipment')?.message : this.booking.notes;\n const selectedRoom = this.data?.value?.selectedRoom\n ?\n this.data?.value?.selectedRoom\n :\n {\n space: this.booking.room, // this.building,\n };\n\n const payload = {\n ...this.booking.toJSON(),\n attendees,\n code,\n head_count,\n notes,\n organiser,\n selectedRoom,\n company\n };\n this.store.dispatch(storeBookingFormData({\n payload: payload\n }));\n \n if(this.isEditSeries) {\n this.booking = this.bookingFormToBooking(this.data.value, this.isEditSeries); \n }\n // in parent component\n this.updateConfimatinModal();\n\n\n }\n\n public updateNotes(booking, note, room) {\n const notes = [];\n const cateringNotes = this._cateringNotesService.getNotes();\n const isEquipmentNote = booking.notes.find(note => note.type === 'equipment');\n const isCateringNote = booking.notes.find(note => note.type === 'catering');\n\n if (cateringNotes.length && !isCateringNote) {\n notes.push(cateringNotes[0]);\n }\n\n if (isEquipmentNote) {\n booking.notes.map(item => {\n const message = cateringNotes.length && item.type === 'catering' ? cateringNotes[0].message : item.message;\n\n notes.push({\n ...item,\n author : this.currentUser.name,\n message : item.type === 'equipment' ? note : message,\n space: item.type === 'equipment' ? room : item.space,\n date: item.type === 'equipment' ? new Date().getTime() : item.date\n })\n });\n } else {\n if (note) {\n notes.push({\n author: this.currentUser.name,\n type: \"equipment\",\n message: note,\n space: room,\n date: new Date().getTime()\n })\n }\n }\n return notes;\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n const booking_form_data = this.data.value;\n\n if(!this.isEditSeries) {\n\t\t\t // clone booking to allow editing\n const booking = cloneDeep(this.booking);\n \n\t\t\tbooking.title = booking_form_data.title;\n\t\t\tbooking.attendees = this.formToAttendees(booking_form_data.attendees);\n\t\t\tbooking.company = this.formToCompany(booking_form_data.company);\n\t\t\tbooking.notes = this.updateNotes(this.booking, booking_form_data.notes, this.roomEmail);;\n\t\t\tbooking.equipment_codes = { [this.roomEmail]: booking_form_data.code };\n\t\t\tbooking.expected_attendees = { [this.roomEmail]: booking_form_data.head_count };\n\t\t\tbooking.organiser = booking_form_data.organiser?.meta.user;\n\t\t\tconst has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom?.space?.email || booking?.space?.email]: 900} : null; // 900 seconds = 15 min\n\t\t\t// Removing the note does not remove the existing setup / breakdown\n\t\t\tif (has_note_buffer) {\n\t\t\t booking.setup = has_note_buffer;\n\t\t\t booking.breakdown = has_note_buffer;\n\t\t\t}\n booking.opt_out = booking_form_data.opt_out;\n // booking.outlook_opt_out = booking_form_data.outlook_opt_out;\n\t\t\tthis.booking = booking;\n\t\t }\n\t\t else {\n\t\t\tthis.booking = this.bookingFormToBooking(booking_form_data, this.isEditSeries);\n\t\t }\n\n\n this.loading = true;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n // We expect the current booking to be returned form this api call,\n if (bookable) {\n\n this._bookings_service.save(this.booking, this.isEditSeries).then(\n (bkn) => {\n // update template properties and booking\n this.handleBookingSuccessResponse(bkn);\n // update callback in case of standard booking edit\n this.updateCallback && this.updateCallback.emit(this.booking);\n\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n this.loading = false;\n this.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n } else {\n this.handleBookingErrorMessage();\n return;\n }\n },\n (err) => {\n this.handleBookingErrorMessage();\n }\n );\n }\n\n public callback() {\n this.closeCallback.emit(true);\n }\n\n}\n","import {\n Component,\n OnInit,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport { TopBarHeaderMode, RoutePayload } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n dateLocalFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase,\n dateBuildingFormatString,\n shorterLocalDateFormatString,\n DialogEvent,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n Space,\n SpacesService,\n User,\n BookingNote,\n BookingFormData,\n BookingStoreState,\n storeBookingFormData,\n bookingStatusDetails,\n clearBookingFormData,\n CateringNotesService,\n getLastDateFromList,\n BOOKING_STATUS,\n DataForConfirmation,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n take,\n} from 'rxjs/operators';\nimport {\n BuildingStoreState\n} from '@mckinsey-converge/buildings';\nimport {\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport {\n Router\n} from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-booking-base',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingFormBaseComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results', 'room'],\n queryParams: {}\n };\n\n @Output() public closeCallback = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n public placeIntoModal = false;\n // Eliminate selectedRoom (room building capacity )\n public modal = false;\n public data = new BehaviorSubject(undefined);\n public submitTimestamp: number;\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public updated: boolean;\n /** Display loading template */\n public loading: boolean= false;\n public booking: Booking = new Booking({});\n /** Current User */\n public currentUser: User;\n public invalidForm: boolean = true;\n public showWarningBanner: boolean = false;\n public warningMessage: string;\n\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n\n constructor(\n public _service: ApplicationService,\n public store: Store,\n public router: Router,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _spaces: SpacesService,\n public _cateringNotesService: CateringNotesService,\n public dialog: MatDialog,\n private _users: UsersService\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n\n }\n\n public get building(){\n return this.booking.room.building;\n }\n\n public get type() {\n return this.booking.bookingTypeLabel;\n }\n\n public get internal_external_type() {\n return this.booking.room?.[0].filters.external === true? \"External\" : \"Internal\";\n }\n\n public get date(){\n // R--- remove if no longer used.\n return this.booking.startDateTz;\n }\n\n public get dateString() {\n return this.booking.startDateTz.formatDate('ccc d MMM yyyy'); //shorterLocalDateFormatString(this.booking.startDateTz);\n \n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n public async goToBackRoute() {\n await this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n /**\n * Continue to Booking Form\n */\n public createBooking() { // todo change links based on usage\n // trigger the booking form submit\n this.submitTimestamp = new Date().getTime();\n }\n\n // submit the booking form\n public submitForm(formGroup: any) {\n let creator: User;\n if (formGroup.has_delegate) {\n if (formGroup.organiser.value !== this.currentUser.email) {\n creator = this.currentUser;\n }\n }\n\n // Combines booking with selected form fields and not the entire formGroup like other places.\n // to combine booking with selected form fields on submit - WHY IS THIS NEEDED TO DISPACH TO STORE BOOKING FORM DATA ???\n // THIS ISSUE IS SPILLING INTO - libs/data-common/src/lib/booking/booking.selectors.ts lno: 70\n // - due to .toJSON recurrence_starts becomes Array ?!?\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...this.booking.toJSON(),\n attendees: formGroup.attendees,\n code: formGroup.code,\n head_count: formGroup.head_count,\n notes: formGroup.notes,\n organiser: formGroup.organiser,\n creator,\n title: formGroup.title,\n company: formGroup.company,\n opt_out: formGroup.opt_out,\n outlook_opt_out: formGroup.outlook_opt_out\n }\n }));\n this.saveChanges();\n }\n\n // submit the booking form\n public validateForm(valid: boolean) {\n this.invalidForm = !valid;\n }\n\n public setupNotes(note: string, roomEmail: string) {\n if (note && note.length ) {\n // this note was required to update setup and breakdown\n return [{\n author: this.currentUser.name,\n type: \"equipment\",\n message: !Array.isArray(note) ? note : note[0].message,\n space: roomEmail,\n date: new Date().getTime()\n }] as BookingNote[];\n }\n\n return [];\n }\n\n public formToAttendees(attendees: any[]) {\n return !attendees ? [] : attendees.map(a => {\n let raw_user = {\n first_name: '',\n last_name: '',\n email: '',\n name: '',\n type: 'internal',\n external: false,\n visitor: false,\n };\n if (a.meta?.external) {\n // External users get assigned a random email\n const nameParts = a.display.split(' ');\n const length = nameParts.length;\n if (length) {\n raw_user.first_name = nameParts[0];\n raw_user.name = nameParts.join(' ');\n }\n if (length > 1) {\n nameParts.shift();\n raw_user.last_name = nameParts.join(' ');\n }\n raw_user.email = a.value ?? `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n raw_user.type = 'external'; // retain external identity\n raw_user.external = true;\n raw_user.visitor = true;\n } else if (a.meta?.user) {\n raw_user = a.meta.user;\n }\n else {\n raw_user = a;\n }\n return new User(raw_user);\n });\n }\n\n public formToCompany(companies: any[]) {\n return !companies ? [] : companies.map(a => {\n return a.value;\n });\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n const booking_form_data = this.data.value;\n // override in child class\n }\n\n public callback() {\n // mock interface\n }\n\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n return space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser\n });\n }\n\n public displayWarningBanner(custom: string) {\n this.warningMessage = custom;\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n\n public discardChanges() {\n this.store.dispatch(clearBookingFormData());\n this.closeCallback.emit(true)\n }\n\n\n\n setupOrganiser(booking_form_data: BookingFormData) {\n if(booking_form_data.organiser?.meta?.user){\n return booking_form_data.organiser?.meta?.user;\n }\n else{\n booking_form_data.organiser = {...booking_form_data.organiser, meta: {user: this.currentUser}}\n return booking_form_data.organiser?.meta.user;\n }\n }\n\n public bookingFormToBooking(bookingData, isEditSeries: boolean = false): Booking {\n let booking_form_data = bookingData;\n const has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom.space.email]: 900} : {}; // 900 seconds = 15 min\n const attendees = this.formToAttendees(booking_form_data.attendees);\n const company = this.formToCompany(booking_form_data.company);\n const start_epoch = booking_form_data?.dateTz?.seconds;\n const end_epoch = booking_form_data.dateTz.addValue({ minutes: booking_form_data.duration }).seconds;\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = booking_form_data?.nextBusinessDay || false\n\n const raw_data = {\n id: isEditSeries ? booking_form_data.id : '',\n all_day: booking_form_data.all_day || false,\n attendees,\n booking_type: booking_form_data.bookingType.value,\n catering: booking_form_data.catering || [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data.timezone,\n equipment_codes: {[booking_form_data.selectedRoom.space.email]: booking_form_data.code},\n expected_attendees: {[booking_form_data.selectedRoom.space.email]: booking_form_data.head_count},\n has_catering: booking_form_data.has_catering || false,\n needs_space: booking_form_data.needs_space || false,\n organiser: this.setupOrganiser(booking_form_data),\n notes: this.setupNotes(booking_form_data.notes, booking_form_data.selectedRoom.space.email),\n creator: booking_form_data.creator,\n room: booking_form_data.selectedRoom.space,\n title: booking_form_data.title,\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n /* Staff Recurring form fields */\n is_recurrent: booking_form_data.is_recurrent,\n recurrence_count: booking_form_data.recurrence_count,\n recurrence_days: booking_form_data.recurrence_days,\n recurrence_endTz: booking_form_data.recurrence_endTz,\n recurrence_exceptions: booking_form_data.recurrence_exceptions,\n recurrence_interval: booking_form_data.recurrence_interval,\n recurrence_period: booking_form_data.recurrence_period,\n recurrence_starts: booking_form_data.recurrence_starts,\n\n occurrence_details: booking_form_data.occurrence_details,\n // occurrence_edits: booking_form_data.occurrence_edits || null,\n // occurrence_ids: booking_form_data.occurrence_ids || null,\n recurrence_type: booking_form_data.recurrence_type || null,\n recurrence_master_id: booking_form_data.recurrence_master_id,\n edits: booking_form_data?.edits,\n ignore: booking_form_data?.ignore,\n\n opt_out: bookingData.opt_out,\n \n //outlook_opt_out: true //bookingData.outlook_opt_out keeping always true for now (will never send outlook invite) until feature fully tested and released to prod \n\n\n };\n\n return new Booking(raw_data);\n }\n\n\n public async handleBookingSuccessResponse(bkn) {\n\n // const user: User = this._users.current;\n // if(this._users.current.email === bkn.organiser.email) {\n // this._users.current.opt_out = true;\n // }else {\n // this._users.current.delegates.map(el => { \n // if(el.email === bkn.organiser.email) {\n // el.opt_out = true;\n // }\n // return el;\n // })\n // }\n \n\n //const responceBkn = new Booking({...bkn}); // \n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this.updateConfimatinModal();\n this._booking_state_service.replace(this.booking);\n\n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(this.booking.recurrence_master_id !== null && this.isEditSeries)\n {\n const master_booking = await this._bookings_service.show(this.booking.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n\n // Heap track event\n this._service.analytics.track('update', {\n booking_id: this.booking.id,\n office: this.booking.room.building.name, // this.building.name,\n room: this.booking.room.simple_name,\n start_time: this.booking.startDateTz.ms,\n end_time: this.booking.endDateTz.ms,\n catering: !!this.booking.catering.length,\n headcount: this.data.value.head_count,\n });\n\n }\n\n\n public handleBookingErrorMessage() {\n this.loading = false;\n this.booking.status = BOOKING_STATUS.unavailable\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n this.updateConfimatinModal();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n\n if (this.booking.multi_rooms && this.booking.multi_rooms.length > 0) {\n this.booking.multi_rooms.forEach((room) => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n } \n if (this.booking.room) {\n totalConflicts =\n this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n }\n\n const result = {\n is_conflict: totalConflicts > 0,\n total_Conflicts: totalConflicts,\n };\n return result;\n}\n\n\n/**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details?.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n const requestedEndDateTz = getLastDateFromList(recurrenceStart); //shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n \n // add one day if user room selection from next business day section on result page\n const endDatestring = this.nextBusinessDay ? requestedEndDateTz.addValue({ minutes: this.data?.value.offset }) : requestedEndDateTz;\n\n return endDatestring.formatDate('ccc d MMM yyyy');\n }\n\n /**\n * Opens a modal to display recurrence conflicts for a given room.\n *\n * @param {Space} room - The room for which recurrence conflicts are being displayed.\n *\n * This function opens a modal dialog to show recurrence exceptions (conflicts)\n * for the specified room.\n *\n * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n * and mckinsey-converge/apps/staff/src/app/booking/catering/catering.component.ts\n */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n status: 'confirmed'\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\n}\n","import {BehaviorSubject,fromEvent,\n} from 'rxjs';\nimport {take,throttleTime,tap,distinctUntilChanged,map\n} from 'rxjs/operators';\nimport {select,Store\n} from '@ngrx/store';\nimport {Component,Inject,OnInit,\n} from '@angular/core';\nimport { BaseDirective, dateBuildingFormatString, startEndTimeWithZoneFormatString, humaniseDuration, toTitleCase, closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { User,\n\tApplicationService,\n\tAvailableBookingFields,\n\tBooking,\n\tBookingFormData,\n\tBookingFlowSettings,\n\tSpacesService,\n\tstoreBookingFormData,\n\tDateDurationData,\n\tselectFilteredByIdResults,\n\tgenerateBookingForm,\n\tcateringAllowed,\n\trulesForSpace,\n\tgetStatusErrorMessage,\n\troomHasCateringHours,\n\tBookingsService,\n\tSpaceConflictAlertModalData,\n\tSpaceFilterReason,\n\tBuilding,\n\tBuildingCity,\n\tflattenDisplayOffices,\n\troomSizeOptions,\n\tDEFAULT_BOOKING_DURATION,\n\tbookingTypeOptions,\n\troomFormDataToQuery,\n\tclearBookingFormData,\n\tBookingStateService,\n\tRecurrencePeriod,\n\tselectActiveForm,\n\tSeriesAction\n} from '@mckinsey-converge/data-common';\nimport { first } from 'rxjs/operators';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { CancelBookingModalComponent } from '../cancel-booking-modal/cancel-booking-modal.component';\nimport { BookingDurationModalComponent } from '../booking-duration-modal/booking-duration-modal.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport {\n\tloadByIdResults, loadRoomsForResults, loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { FormGroup } from '@angular/forms';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictAlertModalComponent, SelectOption } from '@mckinsey-converge/ui';\nimport { buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { RoomBookingModalComponent } from '../room-booking-modal/room-booking-modal.component';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { CateringDropComponent } from '@mckinsey-converge/ui';\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n\tselector: 'app-booking-details-modal',\n\ttemplateUrl: 'booking-details-modal.component.html',\n\tstyleUrls: ['./booking-details-modal.component.scss']\n})\nexport class BookingDetailsModalComponent extends BaseDirective implements OnInit {\n\tpublic TopBarHeaderMode = TopBarHeaderMode;\n\tpublic title: string;\n\tpublic roomName: string;\n\tpublic roomLocation: string;\n\tpublic host: string;\n\tpublic hostEmail: string;\n\tpublic type: string;\n\tpublic status: string;\n\tpublic statusText: string = '';\n\tpublic statusImage: string;\n\tpublic durationString: string;\n\tpublic dateString: string;\n\tpublic timeString: string;\n\tpublic capacity: number;\n\tpublic attendeesString: string;\n\tpublic chargeCode: string;\n\tpublic headcount: number;\n\tpublic requirements: string;\n\tpublic showDetails: boolean;\n\tpublic warningMessage: string;\n\tpublic mapUrl: string;\n\tpublic focusedRoom: string;\n\tpublic expandedLocation = false;\n\tpublic isRecurrentBooking = false;\n\tpublic isMultiroomBooking:boolean = false;\n\n\tpublic checkingExtendable: boolean;\n\tpublic extendableMaximum: number;\n\n\tpublic receiptionEmail: string;\n\n\tpublic data = new BehaviorSubject(undefined);\n\tpublic byIdResults = new BehaviorSubject(undefined);\n\n\t// Track event date changes in the UI in this param\n\tpublic alternativeWeekStartDateTz: DateTZ;\n\t/** Current User */\n\tpublic currentUser: User;\n\tpublic expandedAvailability: boolean = false;\n\t// Set in the room availablity callback\n\tpublic mobile: boolean = false;\n\tpublic loading: boolean = false;\n\tpublic showInfoBanner: boolean = false;\n\tpublic showWarningBanner: boolean = false;\n\tpublic showCatering: boolean = false;\n\t/** Application settings for bookings */\n\tpublic settings: BookingFlowSettings;\n\tpublic form: FormGroup;\n\tpublic companyString: string;\n\n\tinvalidDueToOfficeRule: boolean;\n\tbuildings: SelectOption[];\n\tmaster_booking: Booking;\n\n\tprivate recurrence_period: RecurrencePeriod;\n\tprivate recurrence_interval: number;\n\toccurrence_details: { start_epoch: number; dateTz: DateTZ; id: string; }[];\n\tdisableSeriesEditButton: boolean = false;\n\topt_out: boolean;\n\toutlook_opt_out: boolean;\n\t/** List of available booking fields for the form */\n\tpublic get available_fields(): AvailableBookingFields[] {\n\t\treturn this.settings?.show_fields || [];\n\t}\n\n\tpublic get emailURL() {\n\t\treturn `mailto:${encodeURIComponent(this.receiptionEmail)}?cc=${encodeURIComponent(this.hostEmail)}&subject=Enquiry%3A%20${encodeURIComponent(this.roomName)}&body=Details%3A%0ADate%3A%20${encodeURIComponent(this.dateString)}%0ATime%3A%20${encodeURIComponent(this.timeString)}%0A${encodeURIComponent(this.type)}%20meeting%20(${encodeURIComponent(this.durationString)})%0AAddress%3A%20${encodeURIComponent(this.roomLocation)}%0ARoom%3A%20${encodeURIComponent(this.roomName)}%0ACapacity%3A%20${encodeURIComponent(this.capacity)}%20people%0A%0ANeeding%20assistance%20with%3A%0A`;\n\t}\n\n\tpublic disableCancelButton: boolean = false;\n\tpublic disableEditTimeButton: boolean = false;\n\tpublic disableUpdateDetailsButton: boolean = false;\n\n\tprivate _specific_dates = false;\n\n\n\tconstructor(\n\t\t private router: Router,\n private route: ActivatedRoute,\n\t\t@Inject(MAT_DIALOG_DATA) public _data: any,\n\t\tprivate dialogRef: MatDialogRef,\n\t\tprivate store: Store,\n\t\tpublic _bookings: BookingsService,\n\t\tprivate _service: ApplicationService,\n\t\tprivate _spaces: SpacesService,\n\t\tprivate dialog: MatDialog,\n\t) {\n\t\tsuper();\n\t\tthis.roomLocation = this._data.booking.room.street_and_city;\n\t\tthis.initDisplayValues(this._data.booking);\n\t\tthis.timeout('slowinit', () => {\n\t\t\tthis.initDisplayValues(this._data.booking);\n\t\t\tif (this._data.cancel && this.displayCancelModal()) {\n\t\t\t\tthis.cancelBooking();\n\t\t\t}\n\t\t\tif (this._data.addCatering && this.roomHasCatering) {\n\t\t\t\tthis.addCatering();\n\t\t\t}\n\t\t\t// Close up the loader panel\n\t\t\tthis.timeout('hide modal mask', () => {\n\t\t\t\tthis._data.hasLoaderUrl = false;\n\t\t\t}, 300);\n\t\t}, 1000);\n\t}\n\n\n\tpublic ngOnInit() {\n\n\t\t/**\n\t\t * Update booking recurrence and occurrence details based on master booking data.\n\t\t *\n\t\t * This code block checks if there is a master booking available in the data.\n\t\t * If a master booking exists, it extracts recurrence period and interval information,\n\t\t * and processes occurrence details, excluding the current booking itself. Occurrence\n\t\t * start epochs are converted to milliseconds and date-time strings are created in the\n\t\t * building's timezone.\n\t\t */\n\t\tif(this._data?.master_booking !== null) {\n\t\t\tthis.recurrence_period = this._data?.master_booking?.recurrence_period;\n\t\t\tthis.recurrence_interval = this._data?.master_booking?.recurrence_interval;\n\n\t\t\tconst bookingData = this._data?.master_booking || this._data?.booking;\n\n\t\t\tthis.occurrence_details = bookingData.occurrence_details && bookingData.occurrence_details\n\t\t\t\t.filter(ocurrence => ocurrence.id !== bookingData.id)\n\t\t\t\t.map(ocurrence => ({\n\t\t\t\t\t...ocurrence,\n\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000, // Convert start epoch to milliseconds\n\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000, // Create a DateTZ object with the converted epoch\n\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\tbuilding_tz: bookingData.timezone\n\t\t\t\t\t})\n\t\t\t\t}));\n\t\t}\n\n\n\t\tthis.subscription('currentUser', this.store.select(selectCurrentUser)\n\t\t\t.pipe(take(1))\n\t\t\t.subscribe((user: User | undefined) => {\n\t\t\t\t// Once we know we have the user loaded.\n\t\t\t\tthis.currentUser = new User(user);\n\t\t\t})\n\t\t);\n\n\t\tthis.subscription('byId', this.store.pipe(\n\t\t\tselect(selectFilteredByIdResults)\n\t\t).subscribe(next => {\n\t\t\t// Should be fired when loading by ID in URL\n\t\t\tthis.byIdResults.next(next.success?.spaces?.length ? next.success.spaces[0].settings.bookings : EMPTY_ARRAY);\n\t\t}));\n\n\t\tthis._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n\t\t\tthis.settings = this._service.setting('app.booking');\n\t\t\tthis.form = generateBookingForm(this._data.booking, this.available_fields);\n\t\t});\n\n\t\tconst breakpoint = 450;\n\t\tif (window) {\n\t\t\tthis.mobile = window.innerWidth < breakpoint;\n\t\t}\n\n\t\tfromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n\t\t\tnext: val => {\n\t\t\t\tconst target = val.target as Window;\n\t\t\t\tthis.mobile = target.innerWidth < breakpoint;\n\t\t\t}\n\t\t})).subscribe();\n\n\n\t\tthis.subscription('buildings', this.store.pipe(\n\t\t\tselect(buildingStateSelector),\n\t\t\tselect(selectBuildingOptionsGroupedByCity),\n\t\t\tmap((grouped: Map) => {\n\t\t\t\treturn flattenDisplayOffices(grouped);\n\t\t\t}),\n\t\t\tdistinctUntilChanged()\n\t\t).subscribe(next => {\n\t\t\tthis.buildings = next;\n\t\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t\t}));\n\n\n\t}\n\n\t// public get isCateringAdded()\n\n\tpublic get disableCateringButton() {\n\t\tswitch (this.status) {\n\t\t\tcase 'cancelled':\n\t\t\tcase 'declined':\n\t\t\tcase 'expired':\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\treturn !cateringAllowed(this._data?.booking, this._data.booking.room.building);\n\t\t}\n\t}\n\n\tpublic get roomHasCatering() {\n\t\treturn roomHasCateringHours(this._data.booking.room.building, this._data.booking?.room);\n\t}\n\n\tpublic get catering() {\n\t\treturn this._data.booking?.catering || [];\n\t}\n\n\tpublic formatDeliveryTime(order) {\n\t\treturn this._data.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n\t}\n\n\tpublic initDisplayValues(booking: Booking) {\n\t\tconst roomEmail = booking.room.email || '';\n\t\tthis.dateString = dateBuildingFormatString(booking.startDateTz, true);\n\t\tthis.timeString = startEndTimeWithZoneFormatString(booking.startDateTz, booking.displayEndDateTz);\n\t\tthis.host = booking.organiser.name;\n\t\tthis.opt_out = booking.opt_out;\n\t\tthis.outlook_opt_out = booking.outlook_opt_out;\n\t\tthis.hostEmail = booking.organiser.email;\n\t\tthis.title = booking.title;\n\t\tthis.type = toTitleCase(booking.booking_type);\n\t\tthis.roomName = booking.local_room_name || '';\n\t\tthis.durationString = humaniseDuration(booking.duration);\n\t\tthis.capacity = booking.room.capacity; // in case of multiroom booking should we sum the capacity for all the rooms?\n\t\tthis.attendeesString = booking.attendees.map(a => a.name).join(', ');\n\t\tthis.chargeCode = booking.equipment_codes[roomEmail];\n\t\tthis.headcount = booking.expected_attendees[roomEmail];\n\t\tthis.mapUrl = booking.room.level.map_url;\n\t\tthis.extendableMaximum = 0;\n\t\tthis.focusedRoom = `area-${booking.room.map_id}-status`;\n\t\tthis.checkingExtendable = false;\n\t\tthis.receiptionEmail = this._data.booking.room.building?._settings?.discovery_info?.reception_email || '';\n\t\tthis.companyString = booking.company.join(', ');\n\t\t// UI button availability\n\t\tthis.disableCancelButton = true; // CSS hide disabled\n\t\tthis.disableEditTimeButton = true;\n\t\tthis.disableUpdateDetailsButton = true;\n\t\tthis.isRecurrentBooking = (booking.recurrence_type !== null || booking.recurrence_type === '') && booking.recurrence_period !== null ? true : false;\n\t\tthis.isMultiroomBooking = booking.is_multiroom ? true : false\n\n\t\t// Room Availability modal start date\n\t\tthis.setAlternativeWeekStartDate(booking.startDateTz);\n\n\t\t// Get the equiptment notes\n\t\tconst requirements = booking.notes.find(n => {\n\t\t\tif (n.type === 'equipment') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\tthis.requirements = requirements ? requirements.message : '';\n\n\t\t// Setup the UI status based on the booking approval status\n\t\tif (booking.status) {\n\t\t\t// mark bookings before today expired\n\t\t\tconst orgStatus = booking.status;\n\t\t\tthis.status = booking.status;\n\t\t\tconst recentlyExpired = DateNow(new Date()).subtractValue({ minutes: 5 }).isBeforeDate(booking.startDateTz.addValue({ minutes: booking.duration }));\n\t\t\tif (!['declined', 'cancelled'].includes(booking.status)) {\n\t\t\t\tthis.status = DateNow(new Date()).isAfterDate(booking.startDateTz.addValue({ minutes: booking.duration })) ? 'expired' : booking.status;\n\t\t\t}\n\n\t\t\tif(this._data.master_booking && this._data.master_booking.status === 'tentative' ) {\n\t\t\t\tthis.disableSeriesEditButton = true;\n\t\t\t}\n\n\t\t\tswitch (this.status) {\n\t\t\t\tcase 'tentative':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_pending.svg';\n\t\t\t\t\tthis.statusText = 'Pending';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accepted':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on but returns to tenative on save\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'approved':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false; // BLOCKED: API doesn't update 'approval_status' on save.\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on, back to pending on change.\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'declined':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\t// you can edit time and go back to pending\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cancelled':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'expired':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\n\t\t\t\t\tif (recentlyExpired && ['accepted', 'approved'].includes(orgStatus)) {\n\t\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // TODO What is an appropriate default ? And refactor where else this is common.\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic listItems(order) {\n\t\treturn order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n\t}\n\n\tpublic expandLocation() {\n\t\tthis.expandedLocation = true;\n\t}\n\n\tpublic handleClose(fetchRooms: boolean = false) {\n\t\tthis.expandedLocation = false;\n\t\tthis.expandedAvailability = false;\n\t\tif (fetchRooms) {\n\t\t\tthis.fetchRooms(false);\n\t\t\tthis.invalidDueToOfficeRule && this.alertIfItHasConflict(false, true);\n\t\t\tthis.invalidDueToOfficeRule = false;\n\t\t}\n\t}\n\n\tpublic close(flag: string = '') {\n\t\tthis.dialogRef.close(flag);\n\t}\n\n\t/**\n\t * Check if there are any booking collisions with the new booking time\n\t * @param room_id 'sys-' id of room in question\n\t * @param date proposed booking time\n\t * @param duration proposed booking length (in minutes)\n\t */\n\tprivate async findMaxExtension(): Promise {\n\t\tconst setupInSeconds = this._data.booking.setup[this._data.booking.room.email] || 0;\n\t\tconst breakdownInMinutes = this._data.booking.breakdown[this._data.booking.room.email] ? this._data.booking.breakdown[this._data.booking.room.email] / 60 : 0;\n\n\t\t// Add a seconds, since the end time ends in :59, and add the setup time\n\t\tconst endTz = this._data.booking.endDateTz.addValue({ seconds: setupInSeconds + 1 });// (this._data.booking.date + this._data.booking.duration*60000)*0.001 -1\n\t\tconst params = {\n\t\t\troom_ids: this._data.booking.room.id,\n\t\t\tdateTz: endTz, // (((end + 60 + setupSeconds) * 1000)),\n\t\t\tduration: 60 + breakdownInMinutes,\n\t\t\thide_bookings: true,\n\t\t};\n\n\t\treturn await this._spaces\n\t\t\t.available(params, null, false)\n\t\t\t.then(\n\t\t\t\t(list) => {\n\t\t\t\t\t// measure gap in booking instead and have options\n\t\t\t\t\tconst gapInMinutes = ((list[0].available_until - (endTz.seconds - 60)) / 60);\n\t\t\t\t\tconst value = Math.min(60, gapInMinutes);\n\t\t\t\t\treturn value >= 15 ? value : 0;\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t);\n\t}\n\n\tpublic toggleUpdateView() {\n\t\tthis.showDetails = !this.showDetails;\n\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t}\n\n\n\n\n\tpublic getLocation(booking: Booking): any {\n\n\t\tif (this.buildings && booking.building_zone) {\n\t\t\treturn this.buildings.find(b => booking.building_zone === b.value);\n\t\t}\n\t\treturn [];\n\t}\n\n\n\t/**\n * Dispatches data for getting the current status of the booking floor.\n *\n * This function prepares and dispatches necessary data to retrieve the current status\n * of the booking floor.\n *\n * @param {Object} booking - The booking details object, containing room, date, duration, etc.\n * @param {boolean} editingSeries - A boolean indicating whether the booking is part of a series and being edited.\n\n */\n\tpublic dispatchToGetFloorCurrentStatus(booking, editingSeries: boolean = false) {\n\t\tconst timezone = booking.timezone;\n\t\tconst { capacity, internal_or_external } = booking.room;\n\t\tconst roomOption = capacity < 3 ? 0 : (capacity > 2 && capacity < 10) ? 1 : 2;\n\t\tconst roomSize = roomSizeOptions[roomOption];\n\n\t\t// Process recurrence data if the booking is part of a series being edited\n\t\tlet recurringBookingData = {};\n\t\tlet recurrenceStart = [];\n\t\tif(booking.is_recurrent && editingSeries) {\n\n\t\t\tthis._data.master_booking.occurrence_details.forEach(element => {\n\t\t\t\trecurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n\t\t\t});\n\t\t\trecurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n\n\t\t\tconst {\n\t\t\t\tid,\n\t\t\t\trecurrence_period,\n\t\t\t\trecurrence_interval,\n\t\t\t\trecurrence_count,\n\t\t\t\tis_recurrent,\n\t\t\t\trecurrence_exceptions,\n\t\t\t\trecurrence_pattern,\n\t\t\t\trecurrence_days,\n\t\t\t\trecurrenEndFromOcurrences,\n\t\t\t\toccurrence_details,\n\t\t\t\toccurrence_edits,\n\t\t\t\toccurrence_ids,\n\t\t\t\trecurrence_type,\n\t\t\t\trecurrence_master_id,\n\t\t\t\tedits } = this._data.master_booking\n\n\t\t\tconst rec_endTz = recurrenEndFromOcurrences.bind(this._data.master_booking);\n\t\t\tconst recurrence_endTz = rec_endTz(occurrence_details)\n\n\n\n\n\t\t\trecurringBookingData = {\n\t\t\t\tid:id,\n\t\t\t\trecurrence_period: recurrence_period,\n\t\t\t\trecurrence_interval: recurrence_interval || 1,\n\t\t\t\trecurrence_endTz: recurrence_endTz, //this._data.master_booking.recurrence_endTz,\n\t\t\t\trecurrence_count: recurrence_count || 1,\n\t\t\t\tis_recurrent: is_recurrent,\n\t\t\t\trecurrence_starts: recurrenceStart,\n\t\t\t\trecurrence_exceptions: recurrence_exceptions || [],\n\t\t\t\trecurrence_pattern: recurrence_pattern || \"weekly\", //Helper value to store the last selected pattern (daily, weekly, monthly),\n\t\t\t\trecurrence_days: recurrence_days || [],\n\n\t\t\t\toccurrence_details: occurrence_details,\n occurrence_edits: occurrence_edits || null,\n occurrence_ids: occurrence_ids || null,\n recurrence_type: recurrence_type || null,\n recurrence_master_id: recurrence_master_id,\n\t\t\t\tedits: edits\n\t\t\t}\n\t\t};\n\n\n\t\tconst formGroup: BookingFormData = {\n\t\t\tlocation: [this.getLocation(booking)],\n\t\t\t//date: booking.date,\n\t\t\t// dateTz: recurrenceStart[0], //building_tz: timezone\n\t\t\tdateTz: recurrenceStart.length >=1 ? recurrenceStart[0] : closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }),\t15\t).toZone(timezone),\n\t\t\tduration: booking.duration,\n\t\t\tbookingType: internal_or_external === 'internal' ? bookingTypeOptions[0] : bookingTypeOptions[1],\n\t\t\troomSize: roomSize,\n\t\t\tselectedRoom: null,\n\t\t\ttimezone: timezone,\n\t\t\t// buildings: buildings,\n\t\t\t...this._data?.master_booking?.toJSON(),\n\t\t\t...recurringBookingData,\n\t\t\topt_out:booking.opt_out,\n\t\t\toutlook_opt_out: booking.outlook_opt_out,\n\t\t\taction: 'edit_booking'\n\n\t\t};\n\n\t\t// Clear existing form and result data, then dispatch the updated form data\n\t\tthis.clearFormAndResultData();\n\t\tthis.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n\t\t// Dispatch a request to load available rooms based on the updated form data\n\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(formGroup)))\n\t}\n\n\t/**\n * Opens a modal for editing a recurring series of bookings.\n */\n\tpublic editRecurringSeries() {\n\t\t// Dispatch the current status of the booking floor for editing the recurring series\n\t\tthis.dispatchToGetFloorCurrentStatus(this._data.booking, true);\n\n\t\tconst dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n\t\t\t\tpanelClass: 'mck-modal',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdata: {\n\t\t\t\t\tnavigateTo: this.navigateT0Search.bind(this),\n\t\t\t\t\taction: SeriesAction.EDIT, // Indicates the action type (editing a series)\n\t\t\t\t}\n\t\t});\n\n\t\t// Subscribe to the modal's closed event to handle the result\n\t\tdialog_ref.afterClosed().subscribe((flag) => {\n\t\t\t// Close the modal if the operation was successful (flag is truthy)\n\t\t\tflag && this.close(flag); //console.log('ROOM MODAL CLOSED')\n\t\t});\n\n\t}\n\n\tnavigateT0Search() {\n\t\tthis.router.navigate(['../home/results'], { relativeTo: this.route });\n\t}\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n\n\tpublic toggleEditView() {\n\t\tthis.fetchRooms(true);\n\t\tthis.expandedAvailability = true;\n\t}\n\n\tpublic updateBookingState(booking: Booking) {\n\t\tthis._data.booking = booking;\n\t\tthis.initDisplayValues(booking);\n\t\tthis.store.dispatch(loadBookingsWithQuery({ 'id': booking.id, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n\t\t// reload all booking for user from - apps/staff/src/app/booking/room-booking/room-booking.component.ts\n\t\tthis._data.refresh(); //\n\t}\n\n\tpublic cancelBooking(opts: { series?: boolean } = {}) {\n\t\t// Open the cancel booking modal\n\t\tthis.dialog.open(CancelBookingModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\t...this._data,\n\t\t\t\t...opts,\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst booking = this._data.booking.clone();\n\t\t\t\t\tthis._data.booking.delete(opts).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tthis.close();\n\t\t\t\t\t\t\t// @TODO:API The deleted record is still being returned for quite some time regardless of timeout.\n\t\t\t\t\t\t\tthis._data.refresh()\n\t\t\t\t\t\t\t// this.timeout('refresh', () => this._data.refresh(), 1000);\n\t\t\t\t\t\t\t// Heap track event\n\t\t\t\t\t\t\tthis._service.analytics.track('delete', {\n\t\t\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\t\t\troom: booking.room.name,\n\t\t\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\t\t\tcatering: !!booking.catering.legth,\n\t\t\t\t\t\t\t\theadcount: booking?.expected_attendees[booking.room.email],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err) => {\n\t\t\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\t}\n\n\tpublic extendBooking() {\n\t\t// open the extend booking modal\n\t\tconst dialogRefX = this.dialog.open(BookingDurationModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\tbooking: this._data.booking,\n\t\t\t\tmaximum: this.extendableMaximum,\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\n\t\tdialogRefX.afterClosed().subscribe((booking?: Booking) => {\n\t\t\tif (booking) {\n\t\t\t\tthis.updateBookingState(booking);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic displayCancelModal() {\n\t\t// Can the display cancel modal open? If it isn't one of these statuses\n\t\treturn !['cancelled', 'expired', 'declined'].includes(this.status);\n\t}\n\n\n\tpublic confirmChanges(data: DateDurationData) {\n\t\t// Confirm the changes returned from the room availability modal.\n\t\tthis.mobile = data.mobile;\n\t\tthis.setAlternativeWeekStartDate(data.dateTz);\n\n\t\t// New booking flow has this.data\n\t\tif (this.data.value) {\n\t\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t\t\t// submit\n\t\t\tthis.store.dispatch(storeBookingFormData({\n\t\t\t\tpayload: {\n\t\t\t\t\t...this.data.value,\n\t\t\t\t\tdateTz: data.dateTz,\n\t\t\t\t\tduration: data.duration,\n\t\t\t\t}\n\t\t\t}));\n\t\t} else if (data.save) {\n\t\t\t// update booking date/duration\n\t\t\tconst booking = this._data.booking.clone();\n\t\t\tconst pendingChanges = booking.duration !== data.duration || booking.startDateTz.ms !== data.dateTz.ms;\n\t\t\t// booking.duration = data.duration;\n\t\t\tbooking.startDateTz = data.dateTz; // date = data.dateTz.ms;\n\t\t\tbooking.endDateTz = data.dateTz.addValue({ minutes: data.duration });\n\t\t\tthis.loading = true;\n\n\t\t\tconst roomRules = rulesForSpace({\n\t\t\t\ttime: booking.date,\n\t\t\t\tduration: booking.duration,\n\t\t\t\tuser: this.currentUser,\n\t\t\t\trules: this._data.booking.room.building?.booking_rules,\n\t\t\t\tspace: booking.room\n\t\t\t});\n\n\t\t\t// Rooms requiring approval are reset to tentative when the time changes.\n\t\t\tif (pendingChanges && !roomRules?.auto_approve) {\n\t\t\t\t// https://acaprojects.atlassian.net/browse/MCK-1481\n\t\t\t\t/**\n\t\t\t\t * Having 2 ways of containing the status is icky but until PlaceOS\n\t\t\t\t * depreciates approval_status it's necessry.\n\t\t\t\t */\n\t\t\t\t// booking.approval_status[booking.room.email] = \"tentative\";\n\t\t\t\tbooking.status = \"tentative\";\n\t\t\t\tbooking.time_changed = true;\n\t\t\t}\n\t\t\telse if (roomRules.reason === SpaceFilterReason.OfficeRules) {\n\t\t\t\t// this.alertIfItHasConflict(false, true);\n\t\t\t\tthis.invalidDueToOfficeRule = true;\n\t\t\t\tthis.loading = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// -----------------------------------------------------------\n\t\t\t// Check if catering is outside allowed hours before saving\n\t\t\t// -----------------------------------------------------------\n\t\t\tif (this.hasCateringOutsideHours(booking)) {\n\t\t\t\tthis.dialog.open(CateringDropComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-mini',\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\t})\n\t\t\t\t.afterClosed().subscribe((confirm_drop: boolean) => {\n\t\t\t\t\tif (confirm_drop) {\n\t\t\t\t\t\t// User chose to drop catering and proceed\n\t\t\t\t\t\tbooking.catering = [];\n\t\t\t\t\t\tthis.saveBooking(booking);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// User cancelled - do not save, just stop here\n\t\t\t\t\t\tthis.loading = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// If catering is within hours or no catering issue, just save\n\t\t\t\tthis.saveBooking(booking);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate saveBooking(booking: Booking) {\n\t\t\t// booking.save() won't use the toAPIJSON conversion so use the booking service.\n\t\t\tthis._bookings.save(booking).then(\n\t\t\t\t(bkn) => {\n\t\t\t\t\t// update booking\n\t\t\t\t\tthis.updateBookingState(booking);\n\t\t\t\t\tthis.form = generateBookingForm(booking, this.available_fields);\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.displayInfoBanner();\n\t\t\t\t\tbooking.room.building.name\n\t\t\t\t\tthis._service.analytics.track('update', {\n\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\troom: booking.room.global_name,\n\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\tcatering: !!booking.catering.length,\n\t\t\t\t\t\theadcount: booking.headcount,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.expandedAvailability = false;\n\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\n\t/**\n\t * Check if the booking has catering and if it's outside allowed hours.\n\t */\n\tprivate hasCateringOutsideHours(booking: Booking): boolean {\n\t\tif (!booking?.catering || !booking.catering.length) return false;\n\t\n\t\t// Extract the hour from startDateTz\n\t\tconst hour = booking.startDateTz.date.hour;\n\t\t// Check if hour is outside 7 AM - 8 PM\n\t\treturn hour < 7 || hour >= 20;\n\t}\n\n\t/**\n\t * Open dialog if booking date and time is out of office rule\n\t * TO DO : Redundant code - same validaiton been applied over room detail while creating new booking - need to handle more graceful way. better if user been prohibited from choose future date if out of office rule on show avaialability calender itself\n\t * related to - https://acaprojects.atlassian.net/browse/MCK-2419\n\t */\n\n\talertIfItHasConflict(isBookable, isAvailable) {\n\t\t// this.isAlertDisplayed = true;\n\t\tconst data = {\n\t\t\theaderText: !isBookable ? SpaceConflictAlertModalData.NotBookableHeaderText : !isAvailable ? SpaceConflictAlertModalData.NotAvailableHeaderText : '',\n\t\t\tmessage: SpaceConflictAlertModalData.NotBookableDueToOfficeRule,\n\t\t\tbuttonLabel: 'Close',\n\t\t\tcallback: () => null,\n\t\t\tshouldClose: false\n\t\t};\n\t\tconst dialog = this.dialog.open(ConflictAlertModalComponent,\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tpanelClass: 'mck-alert',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdisableClose: !isBookable\n\t\t\t});\n\t}\n\n\n\n\tpublic displayInfoBanner() {\n\t\tthis.showInfoBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showInfoBanner = false;\n\t\t}, 3000);\n\t}\n\n\tpublic displayWarningBanner(custom: string) {\n\t\tthis.warningMessage = custom;\n\t\tthis.showWarningBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showWarningBanner = false;\n\t\t}, 10000);\n\t}\n\n\tpublic hideInfoBanner() {\n\t\tthis.showInfoBanner = false;\n\t}\n\n\tpublic hideWarningBanner() {\n\t\tthis.showWarningBanner = false;\n\t}\n\n\tpublic setAlternativeWeekStartDate(bookingDate: DateTZ) {\n\t\tif (!bookingDate) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mobile) {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone();\n\t\t} else {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone().startOfValue('week').startOfValue('day');\n\t\t}\n\t}\n\n\tpublic updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n\t\tthis.alternativeWeekStartDateTz = alternativeWeekStartDateTz.clone();\n\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t}\n\n\tpublic fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n\t\tif (!this._data?.booking?.space?.id) {\n\t\t\treturn\n\t\t}\n\n\t\tconst day = 24 * 60;\n\t\tconst week = day * 7;\n\t\tconst date = (alternativeWeekStartDateTz || this._data?.booking?.startDateTz).clone(); // new DateTZ({date: alternativeWeekStartDateTz || this._data?.booking?.date});\n\t\tconst startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n\t\tconst startOfWeek = date.startOfValue('week');\n\n\t\t// Query for the entire day for this room\n\t\tconst query = {\n\t\t\tdateTz: allWeek ? startOfWeek : startOfDay,\n\t\t\tduration: allWeek ? week : day,\n\t\t\tlocations: this._data?.booking?.space?.id,\n\t\t\tcapacity: this._data?.booking?.space?.capacity,\n\t\t};\n\t\tthis.store.dispatch(loadByIdResults.request(query));\n\t}\n\n\tpublic addCatering() {\n\t\t// For the Add Catering button\n\t\tthis.showCatering = true;\n\t}\n\n\tpublic saveBookingWithCatering(form: FormGroup) {\n\t\t// Response from the catering modal closing\n\t\t// Close catering and confirmation modals and just show booking details modal\n\t\tif (!form) {\n\t\t\tthis.showCatering = false;\n\t\t\tthis.showDetails = false;\n\t\t\treturn;\n\t\t}\n\t\t// Update the booking state.\n\t\tconst booking = this._data.booking.clone();\n\t\tbooking.catering = form.controls.catering.value;\n\n\t\tif (booking.catering.length) {\n\t\t\tconst setup = {};\n\t\t\tsetup[booking.room.email] = booking.setup[booking.room.email] || 900;\n\t\t\tconst breakdown = {};\n\t\t\tbreakdown[booking.room.email] = booking.breakdown[booking.room.email] || 900;\n\n\t\t\tbooking.setup = setup\n\t\t\tbooking.breakdown = breakdown\n\t\t}\n\n\t\tthis.updateBookingState(booking);\n\t}\n\n\tpublic set specific_dates(val: boolean) {\n\t\tthis._specific_dates = val;\n\t}\n\n\tpublic get specific_dates(): boolean {\n\t\treturn this._specific_dates;\n\t}\n\n\n\tpublic toggleSpecificDates() {\n\t\tthis.specific_dates = !this.specific_dates;\n\t}\n\n\n}\n","\n
\n
\n
 
\n
\n \n

Your booking date and/or time was successfully updated

\n \n
\n
\n \n

{{ warningMessage }}

\n \n
\n \n \n
\n
\n
\n
\n \n Recurring booking status: {{ statusText }} \n
\n
\n \n
\n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Days' : 'Day'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Weeks' : 'Week'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Months' : 'Month'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs on Specific Dates effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}\n
\n
\n
\n
{{ occurrence.dateTz.formatDate('dd MMM yyyy') }}
\n
\n
\n
\n
\n
\n
\n
\n \n Edit series\n \n \n \n
\n
\n\n
\n
\n

{{statusText}}

\n {{timeString}} \n
\n
\n
\n \n
\n

This is a multiroom booking. To request edits, please contact your local backoffice team.

\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n \n
\n\n
\n
\n {{roomName}}\n
\n
\n {{roomLocation}}\n
\n
\n Capacity: {{capacity}}\n
\n \n
\n\n\n\n
\n\n \n
\n \n Reception\n \n
\n
\n \n Cancel booking\n \n
\n \n
\n\n\n
\n \n\n
\n \n
\n \n
\n
\n
\n

\n \n Schedule\n

\n \n \n
\n\n

\n Date: {{dateString}}
\n Time: {{timeString}}
\n {{type}} meeting ({{durationString}})\n

\n \n {{ checkingExtendable ? 'Checking availability...' : 'Extend booking duration'}}\n \n
\n \n
\n
\n

\n \n

\n

\n \n \n \n

\n
\n \n\n \n
\n
\n
\n

\n Meeting\n

\n \n \n
\n \n
\n
Meeting title:   {{ title}}
\n
Host:   {{ host}}
\n
Attendees:   {{attendeesString}}\n
\n
Company:   {{companyString}}
\n
Charge code:   {{chargeCode}}
\n
Headcount estimate:   {{headcount}}
\n
Additional requirements:   {{requirements}}
\n
Email notification for this booking has been opt out.
\n
Outlook calendar invite for this booking has been opted out of.
\n \n
\n \n
\n
\n\n
\n
\n

\n \n

\n \n \n \n \n \n \n
\n
\n \n\n
\n
\n
\n \n
\n
\n \n
\n\n \n
\n\n \n
\n
\n \n \n \n

\n \n \n \n

\n \n \n
\n\n
\n
\n \n
\n

\n \n Catering\n

\n \n \n
\n Catering available for this room\n
\n \n \n
\n
\n\n \n
\n \n
\n

\n \n

\n

\n \n

\n \n
\n
\n
\n\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n \n
\n
\n\n
\n \n
\n \n \n
\n
\n
\n\n
\n \n
\n\n
\n \n
\n \n
\n
\n
\n\n
\n\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n } from '@mckinsey-converge/base';\nimport {\n Booking,\n BookingsService,\n DEFAULT_BOOKING_DURATION,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\ninterface extendData {\n booking: Booking;\n maximum: number\n}\n\n@Component({\n selector: 'app-booking-duration-modal',\n template: `\n \n
\n \n

Your booking failed to update, please try again

\n \n
\n
\n \n
Extend booking duration
\n
\n
\n \n \n
\n
\n \n
\n
\n `,\n styleUrls: ['./booking-duration-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class BookingDurationModalComponent extends BaseDirective implements OnInit {\n\n public loading: string;\n public showWarningBanner: boolean = false;\n\n public get durationGroups() {\n const step = 15;\n const steps = Math.floor(this.data.maximum / step);\n const max = (steps * step) + this.data.booking.duration;\n\n return [{\n start: this.data.booking.duration,\n step,\n max\n }];\n }\n\n public formGroup = new FormGroup({\n date: new FormControl(this.data.booking.date, [Validators.required]),\n dateTz: new FormControl(this.data.booking.startDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n });\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: extendData,\n private dialogRef: MatDialogRef,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n ngOnInit() {\n this.formGroup.setValue({\n date: this.data.booking.date,\n dateTz: this.data.booking.startDateTz,\n duration: this.data.booking.duration,\n });\n }\n\n public closeModal(booking?: Booking) {\n this.dialogRef.close(booking);\n }\n\n public updateBookingDuration() {\n const formData = this.formGroup.getRawValue();\n this.loading = 'Saving...';\n\n // clone booking to allow editing\n // const booking = this.data.booking.clone(); // this line commented for bug appearing in CNG-352. Used cloneDeep instead\n const booking = cloneDeep(this.data?.booking);\n booking.endDateTz = booking.startDateTz.addValue({ minutes: formData.duration });\n this._bookings.save(booking).then(\n () => {\n this.loading = null;\n this.closeModal(booking);\n },\n (err) => {\n this.loading = null;\n this.displayWarningBanner()\n }\n );\n }\n\n\n public displayWarningBanner() {\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { BookingResultsViewModel } from '../manage-bookings/manage-bookings.viewmodel';\nimport {\n BaseDirective,\n shorterLocalDateFormatString,\n timeWithZoneFormatString,\n startEndTimeFormatString,\n humaniseDuration,\n closestToTimeSlotTz,\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ, localTimezone } from \"@mckinsey-converge/date-tz\";\nimport { Booking, BookingFormData, BookingStoreState, bookingTypeOptions, Building, BuildingCity, clearBookingFormData, defaultRoomSizeOption, DEFAULT_BOOKING_DURATION, flattenDisplayOffices, roomFormDataToQuery, roomSizeOptions, storeBookingFormData } from '@mckinsey-converge/data-common';\nimport { buildingStateSelector, BuildingStoreState, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BehaviorSubject,\n} from 'rxjs';\n\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n@Component({\n selector: 'app-booking-result-item',\n templateUrl: './booking-result-item.component.html',\n styleUrls: ['./booking-result-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingResultItemComponent extends BaseDirective implements OnInit {\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: BookingResultsViewModel | undefined;\n \n @Input()\n public bookings: BookingResultsViewModel[];\n\n @Input()\n public list: string;\n\n @Input() public index: number;\n\n @Input() public small: boolean = false;\n\n @Output()\n public bookingSelect = new EventEmitter();\n\n public buildings = new BehaviorSubject[]>([]);\n\n public roomName: string;\n public roomLocation: string;\n public host: string;\n public status: string;\n public timeStringParts: string[] = [' ', ' '];\n public localTimeStringParts: string[] = [' ', ' '];\n public isAnotherTimezone: boolean = false;\n public statusText: string;\n public statusImage: string;\n public durationString: string;\n public timeRangeString: string;\n public building: any;\n public get dateString() {\n if (!this.bookings || !this.bookings.length) return '';\n const bkn1 = this.bookings[this.index].booking;\n const d1 = new DateTZ({ date: bkn1.startDateTz.ms, is_local_tz: false, building_tz: bkn1.startDateTz.building_tz });\n if (this.index === 0) {\n return shorterLocalDateFormatString(d1);\n }\n const bkn2 = this.bookings[this.index - 1].booking;\n const d2 = new DateTZ({ date: bkn2.startDateTz.ms, is_local_tz: false, building_tz: bkn2.startDateTz.building_tz });\n if (!d1.isSameDate(d2, 'day')) {\n return shorterLocalDateFormatString(d1);\n }\n return '';\n }\n public get todayString() {\n if (!this.bookings || !this.bookings.length) {\n return '';\n }\n \n // Strip the booking of it's timezone infomation so isSameDate is just based on timestamp and local time.\n const d1 = new DateTZ({ date: this.bookings[this.index].booking.startDateTz.ms });\n return DateNow(new Date()).isSameDate(d1, 'day') ? '(Today)' : '';\n }\n\n public get attendeesCount(): number {\n // allAttendees is booking.attendees + 1 (booking.organizer)\n return this.viewModel.booking?.allAttendees.length; \n }\n\n public get has_catering(): number {\n return this.viewModel.booking?.has_catering && this.viewModel.booking?.catering?.length;\n }\n\n public get upcoming() {\n return ['tentative', 'accepted', 'approved'].includes(this.status);\n }\n\n constructor(private store: Store,\n private cdRef: ChangeDetectorRef) {\n super();\n }\n\n public ngOnInit(): void {\n this.setupDisplayFields();\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n }));\n this.cdRef.detectChanges();\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public getTooltipText(){\n return this.viewModel.booking.local_room_name.split(',');\n }\n\n public setupDisplayFields() { \n if (!this.viewModel?.booking) {\n return;\n }\n this.timeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz).split(' ');\n this.timeRangeString = startEndTimeFormatString(this.viewModel.booking.startDateTz, this.viewModel.booking.displayEndDateTz);\n this.isAnotherTimezone = !this.viewModel.booking.startDateTz.is_local_tz;\n this.localTimeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz.toZone(localTimezone())).split(' ');\n this.host = this.viewModel.booking.organiser.name;\n this.roomName = this.viewModel.booking.local_room_name.split(',')[0];\n this.roomLocation = this.viewModel.booking.room.street_and_city;\n this.durationString = humaniseDuration(this.viewModel.booking.duration, 'medium');\n\n if (this.viewModel.booking.status) {\n // mark bookings before today expired\n this.status = (DateNow(new Date()).isAfterDate(this.viewModel.booking.endDateTz) && this.list !== 'cancelled') ? 'expired' : this.viewModel.booking.status;\n switch(this.status) {\n case 'tentative':\n this.statusImage = 'assets/icon/booking_pending.svg';\n this.statusText = 'Pending';\n break;\n case 'accepted':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'approved':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'declined':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'cancelled':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'expired':\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n default: // TODO\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n }\n }\n this.cdRef.detectChanges();\n return;\n }\n\n}\n","

\n {{ dateString }} {{ todayString }}\n

\n
\n
\n
\n
\n
\n {{ timeStringParts[0] }} ({{ timeStringParts[1] }}) ({{\n durationString\n }})\n
\n
\n {{ localTimeStringParts[0] }} ({{ localTimeStringParts[1] }}) in your\n local timezone\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
{{ statusText }}
\n
\n {{ timeRangeString }}\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
{{ viewModel.booking.title }}
\n {{\n viewModel.booking.bookingTypeLabel\n }}\n \n {{viewModel.booking?.merged ? 'Merged' : 'Multiroom'}} \n \n \n
\n \n \n \n
\n
\n \n {{ roomName }}\n {{ roomLocation }}\n Host: {{ host }}\n {{ attendeesCount }}pp\n Catered\n \n \n \n \n \n \n \n \n
\n
\n
\n\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { RoomBookingComponent } from 'src/app/booking/room-booking/room-booking.component';\nimport { RoomResultsComponent } from 'src/app/booking/room-results/room-results.component';\nimport { RoomDetailsComponent } from 'src/app/booking/room-details/room-details.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { OfficeFloorComponent } from './office-floor/office-floor/office-floor.component';\n\nconst routes: Routes = [\n {\n path: 'results',\n component: RoomResultsComponent,\n },\n {\n path: 'results/filter',\n component: RoomFiltersModalComponent,\n },\n {\n path: 'results/room',\n component: RoomDetailsComponent,\n },\n {\n path: 'create',\n component: BookingCreateComponent,\n },\n {\n path: 'edit',\n component: BookingEditWrapperComponent,\n },\n {\n path: 'manage',\n component: ManageBookingsComponent,\n },\n {\n path: 'catering/:id',\n data: { hasCatering: true },\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id/:verb',\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id',\n component: ManageBookingsComponent,\n },\n {\n path: 'floor-map',\n component: OfficeFloorComponent,\n },\n {\n path: 'results/booking-calendar',\n loadChildren: () => import('./booking-calendar/booking-calendar.module').then((m) => m.BookingCalendarModule),\n },\n {\n path: '**',\n component: RoomBookingComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingRoutingModule {}\n","import {\n createReducer,\n on\n} from '@ngrx/store';\nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\nimport { closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n};\n\nexport const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: \n {\n location: state?.activeForm?.location,\n timezone: state?.activeForm?.timezone,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: state?.activeForm?.timezone, }), 15)\n \n }\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { BookingRoutingModule } from './booking-routing.module';\nimport { BookingsListingComponent } from './bookings-listing/bookings-listing.component'\nimport { RoomBookingComponent } from './room-booking/room-booking.component';\nimport { RoomDetailsComponent } from './room-details/room-details.component';\nimport { BookingFormBaseComponent } from './booking-create/booking-form-base.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditComponent } from './booking-create/booking-edit.component';\nimport { BookingConfirmationComponent } from './booking-confirmation/booking-confirmation.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule } from '@angular/material/select';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { MatButtonModule } from '@angular/material/button';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingFormReducer } from 'src/app/booking/booking.form.reducer';\nimport { BookingResultItemComponent } from './booking-result-item/booking-result-item.component';\nimport { BookingDetailsModalComponent } from './booking-details-modal/booking-details-modal.component';\nimport { BookingDurationModalComponent } from './booking-duration-modal/booking-duration-modal.component';\nimport { CancelBookingModalComponent } from './cancel-booking-modal/cancel-booking-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { RoomResultsComponent } from './room-results/room-results.component';\nimport { SearchedLocationComponent } from './searched-location/searched-location.component';\nimport { ResultsHeaderComponent } from './results-header/results-header.component';\nimport { RoomAvailabilityPreviewComponent } from './room-availability-preview/room-availability-preview.component';\nimport { RoomLocationPreviewComponent } from './room-location-preview/room-location-preview.component';\nimport { RoomResultItemComponent } from './room-result-item/room-result-item.component';\nimport { RoomBookingFormComponent } from './room-booking-form/room-booking-form.component';\nimport { RoomBookingDetailsFormComponent } from './room-booking-details-form/room-booking-details-form.component';\nimport { RoomBookingModalComponent } from './room-booking-modal/room-booking-modal.component';\nimport { RoomResultsPaginatedComponent } from './room-results-paginated/room-results-paginated.component';\nimport { RoomFiltersModalComponent } from './room-filters-modal/room-filters-modal.component';\nimport { RoomFiltersFormComponent } from './room-filters-form/room-filters-form.component';\nimport { RoomAvailabilityPreviewModalComponent } from './room-availability-preview-modal/room-availability-preview-modal.component';\nimport { MapModule } from 'src/app/map/map.module';\nimport { OfficeFloorMapModule } from 'src/app/booking/office-floor/office-floor-map.module';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RoomResultsSectionComponent } from './room-results-section/room-results-section.component';\nimport { CalendarModule, DateAdapter } from 'angular-calendar';\nimport { adapterFactory } from 'angular-calendar/date-adapters/date-fns';\nimport { BookingCateringComponent } from './catering/catering.component';\nimport { OrderTableComponent } from './catering/order-table/order-table.component';\nimport { BookingCateringOrderDetailsComponent } from './catering/order-details/order-details.component';\nimport { BookingCateringOrderListComponent } from './catering/order-list/order-list.component';\nimport { CateringOrderListItemComponent } from './catering/order-list/item/item.component';\nimport { CateringMenuCategoryComponent } from './catering/order-details/category/category.component';\nimport { SurveyModalComponent } from '../components/survey-modal/survey-modal.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\n\nexport const bookingModuleDeclarations = [\n BookingFormBaseComponent,\n BookingCreateComponent,\n BookingEditComponent,\n BookingConfirmationComponent,\n BookingDetailsModalComponent,\n BookingDurationModalComponent,\n BookingsListingComponent,\n BookingResultItemComponent,\n CancelBookingModalComponent,\n ManageBookingsComponent,\n BookingCateringComponent,\n BookingCateringOrderDetailsComponent,\n BookingCateringOrderListComponent,\n CateringMenuCategoryComponent,\n CateringOrderListItemComponent,\n RoomBookingComponent,\n RoomDetailsComponent,\n RoomResultsComponent,\n SearchedLocationComponent,\n ResultsHeaderComponent,\n RoomAvailabilityPreviewComponent,\n RoomLocationPreviewComponent,\n RoomResultItemComponent,\n RoomBookingModalComponent,\n RoomBookingFormComponent,\n RoomBookingDetailsFormComponent,\n RoomResultsPaginatedComponent,\n RoomFiltersModalComponent,\n RoomFiltersFormComponent,\n RoomResultsSectionComponent,\n RoomAvailabilityPreviewModalComponent,\n CateringMenuCategoryComponent,\n OrderTableComponent,\n SurveyModalComponent,\n BookingEditWrapperComponent\n];\n\nexport const bookingModuleImports = [\n CommonModule,\n UiModule,\n MatSelectModule,\n MatButtonModule,\n NgxMatSelectSearchModule,\n ReactiveFormsModule,\n SharedContentModule,\n FormsModule,\n NgxSkeletonLoaderModule,\n MapModule,\n CalendarModule.forRoot({\n provide: DateAdapter,\n useFactory: adapterFactory,\n }),\n OfficeFloorMapModule\n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingRoutingModule,\n StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingModule {\n}","import { Component, Input, OnInit, OnChanges, ChangeDetectionStrategy, ChangeDetectorRef, NgZone } from '@angular/core';\nimport { throttleTime, tap, first, distinctUntilChanged, map } from 'rxjs/operators';\nimport { fromEvent } from 'rxjs';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BuildingStoreState, buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Booking, User, IEngineResponse, BookingStoreState, clearBookingFormData, BookingsService, UsersService, flattenDisplayOffices, BuildingCity, Building } from '@mckinsey-converge/data-common';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { loadBookingsWithQuery, loadUpcomingBookingsResults, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel,\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { BookingPagination } from '@mckinsey-converge/bookings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nexport type ManageBookingsStoreState = BookingStoreState &\n BuildingStoreState &\n MyBookingsStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-bookings-listing',\n templateUrl: './bookings-listing.component.html',\n styleUrls: ['./bookings-listing.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingsListingComponent extends BaseDirective implements OnInit, OnChanges {\n @Input() public config: any;\n @Input() public buildings: BehaviorSubject[]>;\n @Input() public searchBookingBy: string;\n @Input() public selectedHost: string;\n @Input() public activeTab: string;\n\n public bookingResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public bookings: BookingResultsViewModel[];\n public showBookings = false;\n public reloading = false;\n public TopBarHeaderMode = TopBarHeaderMode;\n public mobile: boolean = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n public pagination: BookingPagination = {\n currentPage: 1,\n totalRecords: 0,\n pageLimit: 10,\n };\n bookingPerPage: any[] = [];\n filteredByHost: any[] = [];\n\n public get lastPage() {\n return this.pages.total === this.pagination.currentPage;\n }\n\n public get pages() {\n const p = this.pagination;\n const total = Math.ceil(p.totalRecords / p.pageLimit) ;\n const group = Math.ceil(p.currentPage / 5);\n const startPosition = Math.max(\n 1,\n Math.min(group > 1 ? (group - 1) * (p.pageLimit + 1) : 1, total - 4)\n );\n let pages = [];\n for (let x = startPosition; x <= Math.min(startPosition + 4, total); x++) {\n pages.push(x);\n }\n if (!pages.length) {\n pages.push(1);\n }\n const maxed = () => {\n if (total <= 5 || p.currentPage >= total) {\n return false;\n }\n return true;\n };\n const mined = () => {\n if (total <= 5 || p.currentPage < 6) {\n return false;\n }\n return true;\n };\n const start = p.currentPage > 5;\n const end = !(p.currentPage >= total);\n return {\n total,\n pages,\n min: mined(),\n max: maxed(),\n start,\n end,\n };\n }\n\n constructor(\n private store: Store,\n private _route: ActivatedRoute,\n private _router: Router,\n private dialog: MatDialog,\n private _bookings: BookingsService,\n private _zone: NgZone,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 450;\n const selector = this.config.selector;\n const target = this.config.type;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n \n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n // this.buildings.next(next);\n if(this.activeTab === this.config.type) {\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target,\n offset: 0,\n })\n );\n }\n\n // start the timer at the top of the minute;\n const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n setTimeout(() => {\n this.refresh(target);\n this._zone.runOutsideAngular(() => {\n this.interval('refreshBookings', () => this.refresh(target, true), 60 * 1000);\n });\n\n }, offset + 5000);\n\n \n }));\n\n\n\n const sort_asc = (a, b) => a.date - b.date;\n const sort_desc = (a, b) => b.date - a.date;\n\n this.subscription(\n 'bookingResults',\n this.store.pipe(select(selector)).subscribe((next) => {\n this.bookingResults.next(next);\n if (!next.isEmpty() && Array.isArray(next?.success?.results)) {\n let results = [...next?.success?.results].sort(\n this.config.reverse_sort ? sort_desc : sort_asc\n );\n this.showBookings = !!results.length;\n this.reloading = false;\n // save all bookings to reuse later \n this.allBookings = results;\n \n /** Filter all booings of active tab by selected host if any */\n this.filterBySelectedHost(true);\n\n } else {\n this.showBookings = false;\n this.reloading = false;\n this.bookings = [];\n this.pagination.totalRecords = 0;\n this.cdRef.detectChanges();\n }\n })\n );\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n ).subscribe();\n \n this.timeout('query', () =>\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n if (params.has('page')) this.setPage(+params.get('page'), false);\n })\n )\n );\n }\n\n //For each result from results, it find its level and building from the lists and map with BookingResultsViewModel but filter all master from list.\n public getViewModel = (results) => mapResultsToViewModels(results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n\n\n public splitArrayIntoSubarrays(originalArray, subarrayLength) {\n var newArray = [];\n for (var i = 0; i < originalArray.length; i += subarrayLength) {\n newArray.push(originalArray.slice(i, i + subarrayLength));\n }\n return newArray;\n }\n\n\n public ngOnChanges($change: any) {\n \n if ($change?.buildings?.currentValue !== $change?.buildings?.previousValue || $change?.activeTab?.currentValue !== $change?.activeTab?.previousValue) {\n this.refresh(this.config.type);\n }\n if ($change?.selectedHost?.currentValue !== $change?.selectedHost?.previousValue) {\n this.filterBySelectedHost(true);\n } else\n if ($change?.searchBookingBy?.currentValue !== $change?.searchBookingBy?.previousValue) {\n this.filterBySelectedHost(false);\n }\n }\n\n\n\n public filterBySelectedHost(isHostChanged: boolean) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchHost = this.selectedHost.toLowerCase().trim();\n // this.filteredByHost = [];\n\n if(this.allBookings) {\n\n if(searchHost) {\n if(isHostChanged) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.allBookings];\n // Filtering the combine array to find matching host email \n this.filteredByHost = allItems.filter( (item: any ) => \n this.isIncludes(item?.host, 'email', searchHost) ||\n this.isIncludes(item?.organiser, 'email', searchHost)\n );\n }\n else {\n this.filteredByHost = [...this.filteredByHost];\n }\n \n }\n else {\n this.filteredByHost = [...this.allBookings];\n }\n\n //Now send filtered booking by host to filter further by search input given in the field\n this.filterBookingsBySearchValue([...this.filteredByHost]);\n\n \n }\n }\n\n \n public isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\n public filterBookingsBySearchValue(filteredByHost) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = this.searchBookingBy.toLowerCase().trim();\n let filteredItems = [];\n\n if(filteredByHost) {\n\n if(searchValue) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...filteredByHost];\n // Filtering the combine array to find matching room or booking \n filteredItems = allItems.filter( (item: any ) => \n this.isIncludes(item, 'title', searchValue) ||\n this.isIncludes(item?.creator, 'name', searchValue) ||\n this.isIncludes(item?.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'local_room_name', searchValue) || // search with room name \n this.isIncludes(item, 'simple_name', searchValue) || \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n }\n else {\n filteredItems = [...filteredByHost];\n }\n\n const filteredBookings = this.getViewModel(filteredItems);\n \n this.pagination.totalRecords = filteredBookings.length;\n this.pagination.currentPage = !this.lastPage ? 1 : this.pagination.currentPage;\n this.bookingPerPage = this.splitArrayIntoSubarrays(filteredBookings, this.pagination.pageLimit);\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n }\n \n }\n\n \n\n\n\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return this.reloading; // || !this.bookingResults?.value?.isLoading;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find((b) => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // From the Manage Bookings page\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n if(viewModel.booking.is_recurrent) {\n let booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n if (!booking) {\n booking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n }\n this.master_booking = mapResultsToViewModels([booking])[0];\n }\n this.cdRef.detectChanges();\n\n // real booking.room here.\n const dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking: viewModel.booking,\n refresh: () => {\n this.refresh('all');\n },\n\n building: this.getBuilding(viewModel.booking),\n master_booking: this.master_booking?.booking || null,\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRefX.afterClosed().subscribe((flag) => {\n flag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n this.cdRef.detectChanges();\n // this.timeout('refreshBookings', () => this.refresh('all'), 1000);\n // this.timeout('refreshBookings', () => this.refresh('all'), 5000);\n });\n }\n\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n this.cdRef.detectChanges();\n }\n\n public readonly prevPage = () => this.setPage(this.pagination.currentPage - 1);\n public readonly nextPage = () => this.setPage(this.pagination.currentPage + 1);\n public readonly prevGroup = () => this.setPage(this.pages.pages.length);\n public readonly nextGroup = () => this.setPage(this.pages.pages.length + 1);\n public readonly gotoPage = (page: number) => this.setPage(page);\n\n public setPage(page_idx: number, route: boolean = true) {\n if (!this.pages.total) return;\n const page = Math.max(1, Math.min(page_idx, this.pages.total));\n if (route) this._router.navigate([], { relativeTo: this._route, queryParams: { page } });\n this.pagination.currentPage = page;\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n // this.refresh();\n }\n\n public refresh(target: string = this.activeTab, dontShowReloading = false) {\n if (!this.currentUser?.email) {\n return;\n }\n\n \n const offset = 0 ; //(this.pagination.currentPage - 1) * this.pagination.pageLimit;\n // fetch it on one minute interval now that there is room data.\n if(this.activeTab === this.config.type) {\n\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target:this.activeTab,\n offset,\n })\n );\n this.reloading = !dontShowReloading;\n this.cdRef.detectChanges();\n }\n \n\n \n\n \n }\n\n identify(index, item) {\n return item.booking.id;\n }\n}\n","
\n \n \n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n \n

End of list. You have no upcoming bookings

\n
\n
\n \n

End of list. Past meetings are saved for up to 48 hours.

\n
\n
\n \n

End of list. Cancelled meetings are saved for up to 48 hours.

\n
\n
\n
\n \n \n \n \n
\n
\n
\n
    \n
  • \n
  • 1
  • \n
  • ...
  • \n
  • \n {{p}}\n
  • \n
  • ...
  • \n
  • \n {{pages.total}}\n
  • \n
  • \n
\n
","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { Booking, Building, RecurrencePeriod } from '@mckinsey-converge/data-common';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface data {\n booking: Booking;\n building: Building;\n callback: Function;\n master_booking?: Booking;\n hasLoaderUrl?: boolean;\n refresh?: Function;\n\t\tseries?:{};\n}\n\n@Component({\n selector: 'app-cancel-booking-modal',\n template: `\n \n
\n \n
\n
\n \n
{{ subtitle }}
\n
\n
\n

{{ data.booking.title }}

\n\n \n

\n Daily from \n \n

\n weekly on {{ data?.master_booking?.recurrence_days[0] | titlecase }}\n

\n

from

\n \n Monthly on \n\n {{ data?.master_booking?.dateString }} until\n {{ data?.master_booking?.endDateString }}\n

\n \n \n Specific Dates: \n
\n
\n
Date
\n
\n
\n {{ occurrence.dateTz.formatDate('dd MMM yyyy') }}\n
\n
\n
\n
\n
\n
\n\n

{{ dateString }}

\n

{{ timeString }}

\n

{{ buildingAddress }}

\n

{{ data.booking.room.local_room_name }}

\n \n
\n \n
\n
\n `,\n styleUrls: ['./cancel-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CancelBookingModalComponent extends BaseClass {\n public title: string;\n public roomName: string;\n public buildingAddress: string;\n public dateString: string;\n public timeString: string;\n public canceled = false;\n private _specific_dates = false;\n private recurrence_period: RecurrencePeriod;\n public occurrence_details: { start_epoch: number; dateTz: DateTZ; id: string }[];\n private recurrence_interval: number;\n\n public get subtitle() {\n return this.canceled\n ? `${this.title} booking cancelled`\n : this.data?.series\n ? 'Are you sure you want to cancel this recurring series?'\n : 'Are you sure you want to cancel this booking?';\n }\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: data,\n private dialogRef: MatDialogRef\n ) {\n super();\n this.dateString = dateBuildingFormatString(this.data.booking.startDateTz, true);\n this.timeString = startEndTimeWithZoneFormatString(this.data.booking.startDateTz, this.data.booking.displayEndDateTz);\n this.title = this.data.booking.title;\n this.buildingAddress = this.data.booking.room.street_and_city;\n\n\n\t\t\t\tif(this.data?.master_booking !== null) {\n\n\t\t\t\t\tthis.recurrence_period = this.data?.master_booking?.recurrence_period;\n\t\t\t\t\tthis.recurrence_interval = this.data?.master_booking?.recurrence_interval;\n\n\t\t\t\t\tthis.occurrence_details = this.data?.master_booking?.occurrence_details &&\n\t\t\t\t\t\tthis.data?.master_booking?.occurrence_details\n\t\t\t\t\t\t\t.filter((ocurrence) => ocurrence.id !== this.data?.master_booking?.id)\n\t\t\t\t\t\t\t.map((ocurrence) => ({\n\t\t\t\t\t\t\t\t...ocurrence,\n\t\t\t\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\tbuilding_tz: this.data.master_booking.timezone,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t}));\n\t\t\t\t}\n\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public cancelBooking() {\n this.canceled = true;\n this.data.callback();\n this.timeout('closeModal', () => this.closeModal(), 2000);\n }\n\n public set specific_dates(val: boolean) {\n this._specific_dates = val;\n }\n\n public get specific_dates(): boolean {\n return this._specific_dates;\n }\n\n public toggleSpecificDates() {\n this.specific_dates = !this.specific_dates;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n Booking,\n Building,\n CateringOrder,\n Space,\n bookingStatusDetails,\n ApplicationService,\n CateringCategory,\n BookingsService,\n DataForConfirmation,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap,\n shorterLocalDateFormatString\n} from '@mckinsey-converge/base';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase\n} from '@mckinsey-converge/base';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n CateringDetailsModalComponent,\n CateringDetailsModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface BookingFlowEvent {\n /** Type of flow event */\n type: 'previous' | 'next' | 'reset' | 'close' | 'error';\n /** Step which the event was emitted from */\n step: string;\n /** Additional metadata for the event */\n metadata?: HashMap;\n}\n\n@Component({\n selector: 'booking-catering',\n templateUrl: './catering.component.html',\n styleUrls: ['./catering.component.scss']\n})\nexport class BookingCateringComponent extends BaseDirective implements OnInit {\n /** Form fields for the booking */\n @Input() public form: FormGroup;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n @Input() public booking: Booking;\n @Input() public isOccurence: boolean;\n /** Emitter for open catering */\n @Output() public showCatering = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n\n constructor(\n private _dialog: MatDialog,\n public _service: ApplicationService,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.updateConfimatinModal();\n }\n\n /** Active order to display details for */\n public active_order: CateringOrder;\n public TopBarHeaderMode = TopBarHeaderMode;\n public confirmed: boolean = false;\n public next_disabled: boolean = true;\n\n public loading: boolean = false;\n\n\n public get building(): Building[] {\n return this.booking.room.building;\n };\n\n /** Field for storing catering details */\n public get catering_field() {\n return this.form && this.form.controls.catering ? this.form.controls.catering : null;\n }\n\n /** List of spaces selected for the booking */\n public get space_list(): Space[] {\n return this.form && this.form?.controls?.space_list?.value.length\n ? this.form.controls.space_list.value\n : [];\n }\n\n /** Date of the booking */\n public get dateTz(): number {\n return this.form && this.form.controls.dateTz\n ? this.form.controls.dateTz.value\n : DateNow(new Date()).startOfValue('minute');\n }\n\n /** Duration of the booking */\n public get duration(): number {\n return this.form && this.form.controls.duration ? this.form.controls.duration.value : 60;\n }\n\n /** Whether booking is all day */\n public get all_day(): boolean {\n return this.form && this.form.controls.all_day && this.form.controls.all_day.value;\n }\n\n\n public get type() {\n return toTitleCase(this.booking?.class);\n }\n\n public get dateString() {\n return dateBuildingFormatString(this.booking.startDateTz);\n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n /** Create a new catering order */\n public newOrder(): void {\n const order = new CateringOrder({ booking_timezone: this.booking?.timezone });\n this.active_order = order;\n }\n\n // Combine the same items for the same timeslot into the same order item\n public combineItems = (newItems: CateringCategory[], oldItems: CateringCategory[]) => {\n // Group and Sum the items in an Item ID keyed object\n const itemsObj = {};\n oldItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n });\n newItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n })\n // Convert the object to an array\n const items = [];\n for (const item in itemsObj) {\n items.push(itemsObj[item]);\n }\n // return the items consolidated by item ID.\n return items;\n }\n\n /** Handle changes to catering order */\n public handleOrderEvent(order: CateringOrder) {\n /* istanbul ignore else */\n if (order) {\n this.next_disabled = false;\n const orders = this.form.controls.catering.value;\n // When the order edit button is clicked we are editing an existing order\n const index = orders.findIndex((an_order) => {\n return order.id === an_order.id\n });\n\n // If editing an existing order row it will have an index, if not create a new row\n if (index < 0) {\n // Add the new order\n orders.push(order);\n } else {\n // Replace the existing order with the edited order\n orders.splice(index, 1, order);\n }\n\n // Setup the \"reduced\" data containers\n const reduceItems = {};\n const reduceOrders = {};\n orders.forEach((o) => {\n if (reduceItems[o.delivery_time]) {\n // An order for this timeslot already exists, combine the same items to dedupe rows\n reduceItems[o.delivery_time] = this.combineItems(o.items, reduceItems[o.delivery_time]);\n } else {\n // Since this is a new timeslot, use the existing items\n reduceItems[o.delivery_time] = o.items;\n // Copy the order and clear its item contents, placeholder for the updated items\n reduceOrders[o.delivery_time] = o;\n reduceOrders[o.delivery_time].items = [];\n }\n });\n\n // Add the reduced items to the reduced orders\n let consolidatedOrders = [];\n for (const deliveryTime in reduceOrders) {\n const order = reduceOrders[deliveryTime];\n order.items = reduceItems[deliveryTime]\n consolidatedOrders.push(order);\n }\n\n this.form.controls.catering.setValue(consolidatedOrders);\n }\n this.active_order = null;\n }\n\n public closeCallback() {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n\n public closeConfirmation() {\n this.event.emit();\n }\n\n /** Open modal for adding equipment requirements to booking */\n private openCateringDetailsModal() {\n const ref = this._dialog.open(\n CateringDetailsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n spaces: this.form.controls.space_list.value,\n notes_field: this.form.controls.notes,\n catering: this.form.controls.catering,\n booking: this.booking\n }\n }\n );\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n // Catering requirements and charge code modal closed event\n /* istanbul ignore else */\n if (event.reason === 'done') {\n // Closed with the reason done\n ref.close();\n\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n\n this.saveBooking();\n }\n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public saveBooking() {\n // Clone and append the catering and note data to the booking\n let booking = this.booking.clone();\n booking.catering = this.form.controls.catering.value;\n booking.notes = this.form.controls.notes.value;\n if(booking.notes.length || booking.catering.length) {\n\n const setup = { ...booking.setup };\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n booking.setup = setup;\n\n const breakdown = { ...booking.breakdown };\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n booking.breakdown = breakdown;\n }\n\n\n // Save to the API and respond. && !this.isOccurence\n this._bookings.save(booking, booking.is_recurrent ).then(\n (bkn) => {\n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() }); \n // Stop the loading animation and show the booking confirmation component.\n this.updateConfimatinModal();\n\n this.loading = false;\n this.confirmed = true;\n this.event.emit(this.form)\n },\n (err) => {\n // Stop the loading animation and return to the catering flow with an error.\n this.loading = false;\n this.confirmed = false;\n this._service.notifyError(\n `Error updating booking.`\n );\n }\n )\n }\n\n public handleOrderListEvent($event: any) {\n const orders = this.form.controls.catering.value;\n // Handle the Previous and Next buttons\n if ($event.type === 'previous') {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n if ($event.type === 'next') {\n // Move on to the catering details modal\n this.next_disabled = false;\n if (orders.length) {\n this.openCateringDetailsModal();\n } else {\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n this.saveBooking();\n }\n }\n }\n\n public openCatering() {\n // Start catering from the Booking Confirmation page Add Catering button\n this.confirmed = false;\n this.next_disabled = true;\n this.showCatering.emit();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n // openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n \n this.booking.multi_rooms.forEach(room => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n \n\n const result = {\n is_conflict: totalConflicts > 0, \n total_Conflicts: totalConflicts \n };\n return result;\n }\n\n /**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n return shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n }\n\n}\n","
\n
\n \n \n
\n
\n
\n
\n \n \n \n
\n \n \n \n
\n
\n \n
\n
\n
","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport { CateringCategory } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-category-display',\n templateUrl: './category.component.html',\n styleUrls: ['./category.component.scss']\n})\nexport class CateringMenuCategoryComponent {\n /** Category to display details for */\n @Input() public category: CateringCategory;\n /** Form control for the list of order items */\n @Input() public items: FormControl;\n /** Currency symbol for the active space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for close events */\n @Output() public close = new EventEmitter();\n}\n","
\n
\n \n
{{ category?.name }}
\n
\n
\n\n
\n \n
\n
\n\n
\n
\n \n
\n
\n Category contains no available items\n
\n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\nimport { BehaviorSubject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n Building,\n CateringCategory,\n CateringItem,\n CateringMenuService,\n CateringOrder,\n OrganisationService,\n Space\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n Identity\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n BookingCateringConfirmModalComponent,\n CateringConfirmModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface StartEndResponse {\n timezone: string,\n start: DateTZ;\n end: DateTZ\n}\n\n@Component({\n selector: 'a-catering-order-details',\n templateUrl: './order-details.component.html',\n styleUrls: ['./order-details.component.scss']\n})\nexport class BookingCateringOrderDetailsComponent extends BaseDirective implements OnInit {\n /** Catering order to edit details of */\n @Input() public order: CateringOrder;\n /** Booking date */\n @Input() public dateTz: DateTZ;\n /** Booking duration */\n @Input() public duration: number;\n /** Booking duration */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether top header details should be shown */\n @Input() public hide_details: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for changes to the catering order */\n @Output() public event = new EventEmitter();\n /** Form controls for order */\n public form: FormGroup;\n /** List of available catering item categories */\n public category_list: CateringCategory[] = [];\n /** Active category to display details for */\n public active_category: CateringCategory;\n /** List of available times for delivering catering */\n public available_times: Identity[] = [];\n /** Whether the menu is loading */\n public loading: boolean;\n /** Whether the search input should be shown */\n public show_search: boolean;\n /** Current search string for filtering */\n public readonly search$ = new BehaviorSubject('');\n /** List of menu items that match the search string */\n public matched_items: CateringItem[] = [];\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n @ViewChild('input') private _input_el: ElementRef;\n\n /** Whether user is able to order from the currently selected space */\n public get can_order(): boolean {\n return (\n (this.active_building.has_catering || this.category_list.length) &&\n (!this.within_restricted_time || this.has_available_items) &&\n !this.out_of_hours\n );\n }\n\n /** Building associated with the selected space */\n public get active_building(): Building {\n const form_controls = (this.form || { controls: { location_id: { value: '' } } }).controls;\n const space: Space =\n this.space_list.find((space) => space.email == form_controls.location_id.value) ||\n ({ level: {} } as any);\n return (\n this._org.buildings.find((bld) => space.level?.building_id === bld.id) ||\n ({ catering_restricted_from: 0 } as any)\n );\n }\n\n /** Currency code for the active building */\n public get symbol(): string {\n return this.active_building.currency || 'USD';\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n return this.form\n ? this.form.controls.items.value.reduce((total, item) => total + item.amount, 0)\n : 0;\n }\n\n /* istanbul ignore next */\n /** Whether booking time is outside of catering hours */\n public get out_of_hours(): boolean {\n return this.form.controls.delivery_time.value < 0;\n }\n\n /** Whether booking is with the restricted ordering period */\n public get within_restricted_time(): boolean {\n const expired = DateNow(new Date()).addValue({ hours: this.active_building.catering_restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n }\n\n /** Whether booking is with the restricted ordering period */\n public within_category_restricted_time(item?: CateringItem ): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!item?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: item?.restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n /** Whether items are available for order at anytime */\n public get has_available_items(): boolean {\n return this.category_list.reduce(\n (available, category) => available || category.can_order_anytime,\n false\n );\n }\n\n constructor(\n private _menu: CateringMenuService,\n private _org: OrganisationService,\n private _dialog: MatDialog\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.generateAvailableTimes();\n this.subscription('search', this.search$.pipe(map((str) => {\n const search = str.toLowerCase();\n const items = [];\n const available_categories = this.category_list.filter(item => !item.within_category_restricted_time(this.dateTz) )\n\n for (const category of available_categories) {\n if (category.items) {\n for (const group of category.items) {\n if ((group as any).items.length) {\n if (\n (group as any).package &&\n (group.name.toLowerCase().includes(search) ||\n (group as any).items.find((item) =>\n item.name.toLowerCase().includes(search)\n ))\n ) {\n items.push(group);\n } else {\n for (const item of (group as any).items) {\n if (item.name.toLowerCase().includes(search)) {\n items.push(item);\n }\n }\n }\n } else {\n if (group.name.toLowerCase().includes(search)) {\n items.push(group);\n }\n }\n }\n }\n }\n \n return items;\n })).subscribe((items) => this.matched_items = items));\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.date || changes.duration) {\n this.generateAvailableTimes();\n /* istanbul ignore else */\n if (\n this.form &&\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n /* istanbul ignore else */\n if (changes.space_list) {\n /* istanbul ignore else */\n if (this.form && this.space_list && !this.form.controls.location_id.value) {\n this.form.controls.location_id.setValue(this.space_list[0].email);\n }\n }\n /* istanbul ignore else */\n if (changes.order && this.order) {\n this.initForm();\n }\n }\n\n public focusSearch() {\n if (this._input_el && this.show_search) {\n this._input_el.nativeElement.focus();\n }\n }\n\n public initForm() {\n this.form = new FormGroup({\n id: new FormControl(this.order.id),\n booking_date: new FormControl(\n this.all_day ? this.dateTz.startOfValue('day').ms : this.dateTz.ms\n ),\n location_id: new FormControl(this.order.location_id || this.space_list[0]?.email),\n delivery_time: new FormControl(this.order.delivery_time || this.available_times[0].id),\n items: new FormControl(this.order.items.map((item) => new CateringItem(item)))\n });\n this.subscription(\n 'space_change',\n this.form.controls.location_id.valueChanges.subscribe((space) => {\n this.generateAvailableTimes();\n if (\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n this.form.controls.items.setValue([]);\n this.loadMenu();\n })\n );\n this.loadMenu();\n this.generateAvailableTimes();\n if (\n this.form &&\n !this.available_times.find((time) => time.id === this.form.controls.delivery_time.value)\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n\n public confirmOrder() {\n const ref = this._dialog.open(BookingCateringConfirmModalComponent, {\n maxWidth: '95vw',\n data: {\n all_day: this.all_day,\n dateTz: this.dateTz,\n form: this.form\n }\n });\n this.subscription(\n 'confirm_event',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const order = new CateringOrder({ ...this.order, ...this.form.value });\n // order is emited but who is receiving?\n this.event.emit(order);\n ref.close();\n }\n })\n );\n ref.afterClosed().subscribe(() => {\n this.unsub('confirm_event');\n });\n }\n\n private loadMenu() {\n const space = this.space_list.find(\n (space) => space.email === this.form.controls.location_id.value\n );\n\n this.loading = true;\n this._menu\n .query({ zone_id: this._org.buildings.find((bld) => space?.zones.includes(bld.id))?.id })\n .then(\n (list) => {\n this.loading = false;\n this.category_list = list.map((i) => new CateringCategory(i))\n .filter(c => !c.out_of_stock);\n },\n () => (this.loading = false)\n );\n }\n\n /** Generate a list of available delivery times for the given booking time */\n private generateAvailableTimes() {\n let { timezone, start, end } = this.generateStartAndEndTimes();\n start = start.setValue({ minute: Math.ceil(start.minutes / 5) * 5 });\n // will be different from staff in these commonly named methods.\n const start_date = this.dateTz;\n this.available_times = [];\n while (start.isBeforeDate(end)) {\n this.available_times.push({\n id: Math.abs(start_date.dateDiff(start, 'minutes')),\n name: start.formatDate('h:mma').toLocaleLowerCase(),\n });\n start = start.addValue({ minutes: 5 });\n }\n /* istanbul ignore else */\n if (this.available_times.length === 0) {\n this.available_times.push({ id: -1, name: 'Out of hours' });\n }\n }\n\n private generateStartAndEndTimes(): StartEndResponse {\n const now = DateNow(new Date())\n let timezone = now.local_tz;\n const space_email = this.form ? this.form.controls.location_id.value : null;\n let catering_hours = { start: 7, end: 20 };\n let building_time = this.dateTz.startOfValue('day');\n let cat_start_time = building_time.addValue({ hours: catering_hours.start });\n let cat_end_time = building_time.addValue({ hours: catering_hours.end });\n\n if (space_email) {\n // Fetch the Space and Building\n const space = this.space_list.find((space) => space.email === space_email);\n const building = this._org.buildings.find((bld) => space?.zones.includes(bld.id));\n if (building.timezone) {\n // Update to the building timezone if defined.\n timezone = building.timezone;\n building_time = this.dateTz.toZone(timezone).startOfValue('day');\n }\n if (building?.catering_hours) {\n // Update to the building catering hours if defined.\n catering_hours = building?.catering_hours;\n }\n // Update the hours with the currently defined timezone.\n cat_start_time = building_time.addValue({ hours: catering_hours.start });\n cat_end_time = building_time.addValue({ hours: catering_hours.end });\n }\n\n // Start Time of the Booking\n let start = this.dateTz.toZone(timezone);\n let end = this.dateTz.toZone(timezone).addValue({ minutes: this.duration });\n\n // Do the booking start and end time coincide with the catering hours?\n if (start.isBeforeDate(cat_start_time)) {\n // booking start before catering opens'\n if (cat_end_time.isAfterDate(start)) {\n // catering closes after booking starts'\n start = cat_start_time.addValue({});\n } else {\n // were just closed, catering closes before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking starts after catering is open'\n if (cat_end_time.isBeforeDate(start)) {\n // were just closed, catering closed before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n }\n\n if (end.isBeforeDate(cat_end_time)) {\n // booking ends before catering closes'\n if (cat_start_time.isAfterDate(end)) {\n // were just closed, catering opens is after booking ends'\n start = cat_start_time.addValue({});\n end = cat_start_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking ends after catering closes'\n // set the booking end to the catering close time.'\n end = cat_end_time.addValue({});\n }\n\n return { timezone, start, end };\n }\n}\n\n","
\n
\n
\n
\n
Deliver to:
\n \n \n \n {{ space.local_name }}\n \n \n \n
\n
\n
At:
\n \n \n \n {{ time.name }}\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n \n
\n \n
\n
{{ item.name }}
\n \n
\n
\n
\n
\n
\n
\n \n Back\n \n \n Confirm Order({{ item_count || '0' }})\n \n
\n
\n
\n\n
\n
\n \"No\n
\n

\n Catering is not available for this booking.
\n Catering must be ordered within business hours at {{ active_building?.name }}.\n

\n
\n
\n\n
\n
\n
\n \n
\n
\n Loading menu for {{ active_building?.name }}...\n
\n
\n
\n
\n\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\n\nimport {\n CateringOrder,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { DateNow } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'catering-order-list-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss']\n})\nexport class CateringOrderListItemComponent implements OnInit {\n /** Catering order to display */\n @Input() order: CateringOrder;\n /** */\n @Input() public space_list: Space[];\n /** Selected datetime */\n @Input() date: number = DateNow(new Date()).ms;\n /** Emitter for edit events */\n @Output() public edit = new EventEmitter();\n /** Emitter for delete events */\n @Output() public delete = new EventEmitter();\n\n public room: Space;\n\n public ngOnInit(): void {\n this.room = (this.space_list || []).find(space => space.email === this.order.location_id);\n }\n\n public get space_in_booking(): boolean {\n return !!this.room;\n }\n\n /** Space selected for delivery */\n public get local_space_name(): string {\n return this.room?.local_name || '';\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n /* istanbul ignore else */\n if (!this.order) {\n return '';\n }\n\n // R--- there's probably a helper for this calculation on the Catering Order \n return this.order.bookingDateTz.addValue({ minutes: this.order.delivery_time || 0 }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount * item.unit_price, 0);\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.room || !this.room.level) {\n return 'USD';\n }\n\n return this.room?.building?.currency || 'USD';\n }\n\n constructor(private _spaces: SpacesService) {\n }\n}\n","
\n Deliver to {{ local_space_name }} at {{ delivery_time }}\n
\n
\n
\n {{ item_count }}\n { item_count, plural, =1 { item } other { items } }\n
\n
{{ order_cost / 100 | currency: symbol }}
\n
\n
\n \n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport {\n CateringOrder,\n Space\n} from '@mckinsey-converge/data-common';\nimport { BookingFlowEvent } from '../../catering/catering.component';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'a-catering-order-list',\n templateUrl: './order-list.component.html',\n styleUrls: ['./order-list.component.scss']\n})\nexport class BookingCateringOrderListComponent {\n /** Form field for storing catering orders */\n @Input() public catering: FormControl;\n /** Selected datetime for the booking */\n @Input() public date: number;\n /** */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether booking is all day */\n @Input() public next_disabled: boolean;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n /** Emiiter for order events */\n @Output() public order = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n \n public delete: boolean = false;\n\n /** List of orders in the booking */\n public get orders(): CateringOrder[] {\n /* istanbul ignore else */\n if (!this.catering) {\n return [];\n }\n let orders = [];\n const date_ = new DateTZ({date: this.date})\n this.catering.value.forEach(\n order => {\n const newOrder = order;\n newOrder.booking_date = this.all_day\n ? date_.startOfValue('day').ms\n : this.date;\n orders.push(newOrder);\n }\n \n );\n return orders;\n }\n\n /** Emit event for a new catering order */\n public newOrder() {\n this.order.emit();\n }\n\n /** Emit event for editing existing order */\n public editOrder(order: CateringOrder) {\n this.order.emit(order);\n }\n\n /** Remove order from the list */\n public deleteOrder(order: CateringOrder) {\n const orders = this.orders;\n const index = orders.findIndex(an_order => order.id === an_order.id);\n /* istanbul ignore else */\n if (index >= 0) {\n orders.splice(index, 1);\n this.catering.setValue(orders);\n this.delete = true;\n }\n }\n\n /**\n * Proceed to the next step in the space booking flow\n */\n public next(): void {\n // Open the confirmation modal\n this.event.emit({ type: 'next', step: 'catering' });\n }\n\n /** Move flow to previous step */\n public previous(): void {\n this.event.emit({ type: 'previous', step: 'catering' });\n }\n}\n","
\n
\n

Catering Orders

\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n Back\n \n \n Next\n \n
\n
\n
\n\n
\n
\n \n
\n
No catering orders
\n \n
\n
\n","import {\n Component,\n Input,\n} from '@angular/core';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'catering-order-table',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n Delivery\n Charge CodeOrder
\n {{formatDeliveryTime(order)}}\n \n {{order?.charge_code}} \n \n {{listItems(order)}}\n
\n
\n `,\n styleUrls: ['./order-table.component.scss']\n})\nexport class OrderTableComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public booking: Booking;\n\n public listItems(order) {\n return order.items.map(i => `${i.name}${i.amount > 1 ? ` (${i.amount})` : ''}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n public oddEvenClass(x) {\n return x % 2 === 0 ? 'odd' : 'even';\n }\n}\n","import {\n Component,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnInit\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n User,\n Booking,\n Building,\n BuildingCity,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectUpcomingBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n selectBookingByIdResultsFromState,\n UsersService,\n} from '@mckinsey-converge/data-common';\nimport {\n clearBookingByIdResults,\n} from '@mckinsey-converge/bookings';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n first,\n map,\n take,\n} from 'rxjs/operators';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport {\n SelectOption\n} from '@mckinsey-converge/ui';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { RoomBookingStoreState } from '../room-booking/room-booking.component';\nimport { MatTabChangeEvent } from '@angular/material/tabs';\nimport { SearchBarConfig } from 'libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component';\n\n\n@Component({\n selector: 'app-manage-bookings',\n template: `\n
\n
 
\n
\n \n
\n
\n
\n
\n

Manage Bookings

\n\n
\n \n \n
\n \n
\n \n
\n\n\n \n \n
\n \n \n \n
\n
\n\n
\n
\n
\n
\n `,\n styleUrls: ['./manage-bookings.component.scss']\n})\nexport class ManageBookingsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public buildings = new BehaviorSubject[]>([]);\n public bookingTypes = [\n {\n type: 'upcoming',\n display: 'Upcoming',\n selector: selectUpcomingBookingsResultsFromState\n },\n {\n type: 'past',\n display: 'Past',\n selector: selectPastBookingsResultsFromState\n },\n {\n type: 'cancelled',\n display: 'Cancelled',\n reverse_sort: true,\n selector: selectCancelledBookingsResultsFromState\n },\n ];\n\n /** Current User */\n public currentUser: User;\n public dialogRef: MatDialogRef;\n public modalInitialized = false;\n public hasLoaderUrl = true;\n\n public activeTab = 'upcoming';\n\n /**\n * Configs for delegate dropdown\n */\n /* if user has no delegates, hide the dropdown */\n public has_delegate: boolean = false; \n /* Holds list of all host/delegates */\n public host_list: User[];\n public hostOptions: { display: string; value: string; meta: { user: User; }; }[];\n public delegateDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; ddOptionBoxWidth: string };\n public selectedHost: string = '';\n\n public searchBookingBy: any = '';\n\n\n searchBarConfig: SearchBarConfig = {\n placeholder: 'Search by title, room name, attendees...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n constructor(\n private dialog: MatDialog,\n private store: Store,\n private route: ActivatedRoute,\n private _router: Router,\n private _users: UsersService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Get the router params\n const bookingId = this.route.snapshot.paramMap.get('id');\n const verb = this.route.snapshot.paramMap.get('verb');\n // Load the buildings data\n this.store.dispatch(loadOrganisations.request());\n this.route.data.subscribe(initData => {\n // Determine if the cancel or booking submodal is loading\n const cancel = verb === 'cancel';\n const addCatering = initData.hasCatering;\n /**\n * When using the catering or cancel URLs,\n * Users reported the modals loading after one another was\n * jarring so, so the UI is masked out until the modal is loaded.\n */\n this.hasLoaderUrl = addCatering || cancel;\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n if (bookingId && !this.modalInitialized) {\n this.store.dispatch(clearBookingByIdResults())\n this.modalInitialized = true;\n // Once the data loads viewBooking\n this.subscription('bookingResults', this.store.pipe(\n select(selectBookingByIdResultsFromState)\n ).subscribe(next => {\n const booking = next.success ? next.success?.[0] : null;\n if (booking && booking.room) {\n // Modal Madness, close the existing booking details modals.\n if (this.dialogRef) {\n this.dialogRef.close();\n }\n if (this.dialog) {\n this.dialog.closeAll();\n }\n // Call viewBookingFromEmailLink with cancel = true to trigger the cancel modal\n // Call viewBookingFromEmailLink with addCatering = true to trigger the add Catering modal\n this.viewBookingFromEmailLink(booking, cancel, addCatering);\n\n // Remove the \"loader\" url from view\n this.timeout('rewrite url',() => {\n this._router.navigate(['/home','manage'], { replaceUrl: true });\n })\n }\n }));\n }\n }));\n\n })\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n if (bookingId) {\n // If there's a booking ID loadBookingById\n this.store.dispatch(loadBookingsWithQuery({ 'id': bookingId, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n }\n }));\n\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n\n const delegates = user.delegates.map((del) => {\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n });\n\n if (delegates.length) {\n this.has_delegate = true;\n\n this.host_list = [user].concat(delegates);\n const options = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }))\n \n this.hostOptions = [{ display: 'All', value: '', meta: { user: null } }].concat(options);\n this.selectedHost = this.hostOptions[0].value;\n this.delegateDD = {\n ddBoxClass: '',\n options: this.hostOptions,\n defaultSelected: this.hostOptions[0],\n onChangeCallback: this.onChangeDelegates.bind(this),\n ddOptionBoxWidth: '200px'\n }\n }\n \n });\n }\n\n public onChangeDelegates(del) {\n this.selectedHost = del.value;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // Only fires from an email link\n public viewBookingFromEmailLink(booking: Booking, cancel: boolean = false, addCatering: boolean = false) {\n if (this.modalInitialized && this.dialogRef) {\n this.dialogRef.close();\n this.dialogRef = null;\n }\n // R--- Verify the email links are working.\n // Open the booking details modal\n if (!this.dialogRef && booking.room) {\n this.dialogRef = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking,\n building: this.getBuilding(booking),\n cancel,\n addCatering,\n hasLoaderUrl: this.hasLoaderUrl,\n refresh: () => null\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n // Close up the loader panel\n setTimeout(() => {\n this.hasLoaderUrl = false;\n }, 1000);\n }\n }\n\n public clearPage(event : MatTabChangeEvent) {\n this.activeTab = this.bookingTypes[event.index].type;\n this._router.navigate([], { relativeTo: this.route, queryParams: { page: 1 } });\n }\n\n\n searchBooking(value) {\n this.searchBookingBy = value;\n }\n\n}\n","import {\n Booking\n} from '@mckinsey-converge/data-common';\n\n\nexport class BookingResultsViewModel {\n constructor(public booking: Booking) {\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Booking[]): BookingResultsViewModel[] => {\n if (!results || !results[0]?.space) {\n return [];\n }\n return results.map((booking: Booking) => {\n return new BookingResultsViewModel(\n booking,\n );\n }); \n}\n\n","import { Component, Inject, OnInit, ViewEncapsulation, ElementRef, Input, ViewChild, ChangeDetectorRef } from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n BookingStoreState,\n User,\n Booking,\n BookingFormData,\n BOOKING_STATUS,\n checkCollisions,\n SpacesService,\n BookingsService,\n BookingStateService,\n clearBookingFormData,\n ApplicationService,\n selectFilteredByIdResults,\n FilteredSpaces,\n selectActiveForm,\n roomFormDataToQuery,\n storeBookingFormData,\n getNextFreeBookingSlot,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\nimport { DateTime } from 'luxon';\nimport { Point, BaseDirective, closestToTimeSlot, HashMap, closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { BehaviorSubject, Observable, interval, timer, of } from 'rxjs';\nimport { CENTER_POINT, MIN_ZOOM_LEVEL } from 'src/app/map/map.utils';\nimport { Store, select } from '@ngrx/store';\nimport { RoomStoreState, loadByIdResults, loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { delay, map, take } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { WAITING_TIME } from '../floor-map.utils'; // commented and re declare below due to circular dependency overlay > util > overlay\n\nexport const WAITING_TIME = 15;\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel;\n parentComponent?: any;\n roomObs?: Observable\n}\n\ninterface InProgressRoomBookingTimeInfo {\n\tcurrentStatus: string,\n\tactiveBookings: Booking[],\n\ttimeUntilNextBooking: number,\n\ttimeRemainingInActiveBooking : number,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'foor-map-overlay',\n template: `\n
\n
\n\n
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \t\n
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tThis room is available\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tRoom {{ data.simple_name || data.name || '' }} is available for booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tBook now for:\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tUntil next booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Available if you book in the next {{minutesRemaining}}:{{secondsRemaining}} minutes\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tRefresing availability ...\n\t\t\t\t\t\t\t
\n \t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tThis room is booked\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Apologies, this room has been booked recently by another user, please try another one. \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n
\n
\n
\n `,\n styleUrls: ['./floor-map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class FloorMapOverlayComponent extends BaseDirective implements OnInit {\n public selectedRoomId = this.data.id;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public center = new BehaviorSubject(CENTER_POINT);\n\n public date = DateTime.now().valueOf();\n /** Current User */\n public currentUser: User;\n\n public availableUntil = parseInt(this.data?.settings?.available_until.toString()) * 1000;\n public diff: any;\n\n public latestBooking: any[];\n public latestBookingStartTime: string;\n public diffInHours: number;\n public diffInMinutes: number;\n public booking: Booking = new Booking({});\n public loading: boolean;\n public bookingData = new BehaviorSubject(undefined);\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public diffInMs: number;\n public futureBookingsForTheDay: HashMap[];\n public untilNextBookingFlag: boolean = false;\n public start_epoch: any;\n public end_epoch_15: any;\n public end_epoch_30: any;\n\n public userSelectedRoom: RoomResultsViewModel;\n\n // @ViewChild('time', { static: false }) public time: ElementRef;\n public isTimerActive: boolean = true;\n minutesRemaining: number | string;\n secondsRemaining: number | string;\n isAvailable: boolean = true;\n intervalCall_15: any;\n intervalCall_1: any ;\n\t\ttimerIndex = 0;\n\t\tpublic currentMin;\n\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n private elementRef: ElementRef,\n public store: Store,\n public _spaces: SpacesService,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _service: ApplicationService,\n // public cdRef: ChangeDetectorRef,\n ) {\n super();\n }\n\n public updateRoomData(space) {\n\n\t\t\t\t\t\t// get all booking of selected room\n this.fetchRoomWithBookings(false);\n\n\t\t\t\t\t\t// subscrip selected room detail with all bookings for the day\n this.subscription(\n 'bookingSpaceResults',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n if (next.success.spaces) {\n\n space.space = next.success.spaces[0];\n this.userSelectedRoom = space;\n\n this.isTimerActive = true;\n\n this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n\n\t\t\t\t\t\t\t\t\t\t\t\t//Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t\t\t\t\t\t\t\t\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t\t\t\t\t\t\t\t\t\tthis.diff = timeUntilNextBooking\n // inform user if space has been booked by other\n if( currentStatus !== 'available') {\n if(activeBookings.length && timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 ) {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n } else {\n this.isAvailable = false;\n this.intervalCall_1?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n }else {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n }\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Determine available time until next booking start time\n this.determineNextBookingStartTime();\n }\n })\n );\n\n }\n\n\t\t/**\n\t\t * Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t * @returns\n\t\t */\n\t\tpublic calculateRoomBookingTimeInfo(): InProgressRoomBookingTimeInfo {\n\n\t\t\tconst now: any = DateNow(new Date()); // current date time\n\n\t\t\t// Retirive a list of bookings and map them to booking objects\n\t\t\tconst bookings = this.userSelectedRoom.space.settings.bookings.map(b => new Booking(b));\n\n\t\t\t// Filter active/in-progress bookings based on the current time\n\t\t\tconst activeBookings = bookings.filter(booking =>\n\t\t\t\t\t\tnow.isAfterDate(booking.startDateTz.startOfValue('second')) &&\n\t\t\t\t\t\tnow.isBeforeDate(booking.endDateTz.startOfValue('second') )\n\t\t\t);\n\n\t\t\t// Retrive the status of the selected room from parent component data\n\t\t\tconst currentStatus = this.data.parentComponent.roomStatus.statusMap[this.selectedRoomId]; // \" 'available' / 'in-use'\"\"\n\n\t\t\t// Initialize the variable to track time-related information\n\t\t\tlet timeRemainingInActiveBooking = 0; // The remaining time in the active booking in milliseconds\n\t\t\tlet timeUntilNextBooking = 30; // Time until the start of the next booking minutes\n\n\t\t\t// Check if ther are active bookings (room is 'in-use')\n\t\t\tif(activeBookings.length) {\n\t\t\t\tconst nowTime: any = DateTime.now()\n\t\t\t\t// Calculate the time remaining in the active booking in minutes\n\t\t\t\ttimeRemainingInActiveBooking = Math.abs(Math.round((activeBookings[0].end_epoch * 1000 - nowTime.ts) / 60000));\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n\t\t\t\tconst addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// calculate the start time of the next booking in the same time slot\n\t\t\t\tconst nextBookingStartTime: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n\n\t\t\t\t// Filter futute booking for the day to find the next booking\n\t\t\t\tconst futureBookingsForTheDay = this.userSelectedRoom.space?.settings?.bookings.filter((item) =>\n\t\t\t\t\titem.start_epoch * 1000 >= nextBookingStartTime.ts\n\t\t\t\t);\n\n\t\t\t\t// Check if there is an futute booking for the day\n\t\t\t\tif(futureBookingsForTheDay.length) {\n\t\t\t\t\t// calculate the time until start of the next booking in minutes\n\t\t\t\t\tconst nextBookingStartTimeMs = futureBookingsForTheDay[0].start_epoch * 1000;\n\t\t\t\t\ttimeUntilNextBooking = Math.floor((nextBookingStartTimeMs - nowTime.ts) / (1000 * 60));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t\t\t\tcurrentStatus: currentStatus,\n\t\t\t\t\t\t\tactiveBookings: activeBookings,\n\t\t\t\t\t\t\ttimeUntilNextBooking: timeUntilNextBooking,\n\t\t\t\t\t\t\ttimeRemainingInActiveBooking : timeRemainingInActiveBooking,\n\t\t\t\t\t\t};\n\n\t\t}\n\n public setup15MinTimer() {\n //interval for 15 min\n !this.timerIndex && setTimeout(()=>this.setUpTime(), 1100 ) ;\n this.timerIndex++\n this.intervalCall_15 = window.setInterval(\n () => { this.intervalCall_1?.unsubscribe(); setTimeout(()=>this.setUpTime(), 1100 ) }\n , ( 1000 * 60 * WAITING_TIME ) );\n\n\n }\n\n public setUpTime() {\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute'));\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME)\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second'))\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n let start:any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n start = start.toLocaleString(DateTime.TIME_SIMPLE);\n if(start !== this.start_epoch ) {\n\n this.start_epoch = start;\n\n // this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(this.availableUntil);\n // this.diff = Math.abs(Math.round((endTime.getTime() - currentTime.getTime()) / 60000));\n\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n\n }\n\n\t\t\t\t\t\t//update up start and end epoch times for a booking button options\n\t\t\t\t\t\tthis.updateSchedulingEpochs()\n\n // let end_15: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 15 });\n // end_15 = end_15.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_15 !== this.end_epoch_15) {\n // this.end_epoch_15 = end_15\n // }\n\n // let end_30: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 30 });\n // end_30 = end_30.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_30 !== this.end_epoch_30) {\n // this.end_epoch_30 = end_30;\n // }\n }\n\n public ngOnInit(): void {\n this.fetchRoomWithBookings(false);\n\n this.data.parentComponent.childCallback = this.updateRoomData.bind(this);\n this.userSelectedRoom = this.data?.room;\n\t\t\t\tthis.updateSchedulingEpochs();\n this.updateRoomData(this.userSelectedRoom);\n\t\t\t\t// Determine available time until next booking start time\n // this.determineNextBookingStartTime();\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n //update up start and end epoch times for a booking button options\n // this.updateSchedulingEpochs();\n this.data.parentComponent.isOverlayOpened = true;\n }\n\n /**\n * This function sets up start and end epoch times for a booking scheduling system.\n * It calculates and assigns various epoch times based on the current time,\n * available until time, and user-selected room's timezone.\n */\n public updateSchedulingEpochs() {\n\n\t\t\tconst now: any = DateTime.now();\n\n\t\t\t// Calculate the time difference in minutes between current and available until time\n\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t// this.diff = Math.abs(Math.round((this.availableUntil - now.ts) / 60000)); // recheck\n\t\t\tthis.diff = timeUntilNextBooking;\n\n\t\t\t// Determine system availability based on time difference\n\t\t\tthis.isAvailable = timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 // this.diff >= 15;\n\n\t\t\t// Calculate the next time slot for scheduling\n\t\t\tconst addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\t\t\tconst adjustedTime = now.plus({ minutes: addMin, seconds: 0 }).setZone(this.userSelectedRoom?.building?.timezone);\n\n\t\t\t// Calculate and assign the start and end epoch times with 15 and 30-minute intervals\n\t\t\tconst timeSlot = closestToTimeSlot(adjustedTime, WAITING_TIME);\n\t\t\tthis.start_epoch = timeSlot.toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_15 = timeSlot.plus({ minutes: 15 }).toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_30 = timeSlot.plus({ minutes: 30 }).toLocaleString(DateTime.TIME_SIMPLE);\n }\n\n ngAfterViewInit() {\n this.setupTimer();\n }\n\n public setupTimer() {\n console.log(DateTime.now().get('second'))\n const addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n }\n\n\n // countdown timer for coachmark\n public startTimer(display = 0, addSeconds = 0) {\n\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n // const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n // let timer = availableTimeToBook; //(this.diff -35) * 60;\n // let minutes;\n // let seconds;\n let timer = 0 ;\n if(timer >= 0){\n this.intervalCall_1 = interval(1000).subscribe(x => {\n\n const currentTime = new Date(DateTime.now().valueOf());\n const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n let timer = availableTimeToBook; //(this.diff -35) * 60;\n\n this.isTimerActive = true;\n this.minutesRemaining = Math.floor(timer / 60);\n this.secondsRemaining = Math.floor(timer % 60);\n\n this.minutesRemaining = this.minutesRemaining < 10 ? \"0\" + this.minutesRemaining : this.minutesRemaining;\n this.secondsRemaining = this.secondsRemaining < 10 ? \"0\" + this.secondsRemaining : this.secondsRemaining;\n\n --timer;\n\n if (timer <= 0) {\n timer = 0\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n this.isTimerActive = false;\n !this.timerIndex && this.setup15MinTimer();\n\n\t\t\t\t\t\t\t\t\t\tthis.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t\t\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addSeconds = 60 - DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second');\n\t\t\t\t\t\t\t\t\t\t\t\t\tform['date'] = closestToTimeSlot(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).plus({ minutes: addMin, seconds:0 }), WAITING_TIME).valueOf(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tform.dateTz = closestToTimeSlotTz(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew DateTZ({ date: DateTime.now().plus({ minutes: addMin, seconds:0 }), is_local_tz: false, building_tz: form.timezone }),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWAITING_TIME\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n\n\t\t\t\t\t\t\t\t\t\t\t});\n\n }\n }) //, 1000, endTime)\n }\n }\n\n\t\t/**\n\t\t * This function updates information related to the lates booking in the selected room\n\t\t */\n public determineNextBookingStartTime() {\n\n\t\t\t\t// Get the current time using DateTime library\n const now = DateTime.now();\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n const addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// Adjust the current time by adding the calculated minutes adna setting the timezone based on the selected room's building\n const addjustedTime: any = closestToTimeSlot(\n now.plus({ minutes: addMin, seconds:0 })\n .setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME\n );\n\n\t\t\t\t\t\t// Check if room is selected and has bookings settings\n if (this.userSelectedRoom?.space) {\n\t\t\t\t\t// Returive the list of future bookings or initializem it as an empaty array\n const futureBookings = this.userSelectedRoom?.space?.settings?.bookings || [];\n\n\t\t\t\t\t\t// Calculate the end time for a 30-minute interval from the addjested time\n const endEpoch30 = addjustedTime.plus({ minutes: 30 }).ts;\n\n\t\t\t\t\t\t// Filter future booking that start after end_epoch_30\n\t\t\t\t\t\tconst futureBookingsForTheDay = futureBookings.filter(item => item.start_epoch * 1000 >= endEpoch30);\n\n\t\t\t\t\t\t// Check if there are futute bookings found\n\t\t\t\t\t\tif(futureBookingsForTheDay.length > 0) {\n\t\t\t\t\t\t\t//Extract the start time of latest booking\n\t\t\t\t\t\t\tconst latestBookingStartTime = new Date(futureBookingsForTheDay[0].start_epoch * 1000);\n\n\t\t\t\t\t\t\t// Calculate the time difference between the latest booking start time and the current time in milliseconds\n\t\t\t\t\t\t\tconst timeDiffMs = latestBookingStartTime.getTime() - now.valueOf();\n\t\t\t\t\t\t\tthis.diffInMs = timeDiffMs;\n\t\t\t\t\t\t\t// Calculate the timne differenc in hours and minutes\n\t\t\t\t\t\t\tthis.diffInHours = Math.floor(timeDiffMs / (1000 * 60 * 60));\n \tthis.diffInMinutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));\n\n\t\t\t\t\t\t\t// Set flag to indicate the wether the difference is NaN (no future booking)\n \tthis.untilNextBookingFlag = !isNaN(timeDiffMs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.untilNextBookingFlag = false;\n\t\t\t\t\t\t}\n }\n\n }\n\n //fetch all the bookings for selected room for the day to the store\n public fetchRoomWithBookings(allWeek: boolean = true) {\n const day = 24 * 60;\n const week = day * 7;\n const date = (this.booking?.startDateTz).clone();\n const startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = date.startOfValue('week');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.data?.id,\n capacity: this.booking?.space?.capacity,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public closeModal() {\n const modal = this.elementRef.nativeElement.querySelector('.map-overlay-container');\n modal.classList.add('hide');\n this.data.parentComponent.isOverlayOpened = false;\n this.timerIndex = 0;\n this.isAvailable = false;\n\t\t\t\tthis.untilNextBookingFlag = false;\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n // this.intervalCall_15?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.userSelectedRoom) {\n this.data.parentComponent.roomSelected(this.userSelectedRoom);\n }\n }\n\n public onBook(minutes: number) {\n minutes = Math.round(minutes);\n const {filters, settings} = this.userSelectedRoom.space;\n if ( (filters && filters?.equipment_code ) || (settings && settings?.equipment_code) ) {\n this.roomDataCallback();\n } else {\n this.saveChanges(minutes);\n }\n }\n\n public bookingFormToBooking(minutes): Booking {\n const booking_form_data = this.bookingData.value;\n const has_note_buffer =\n booking_form_data?.notes && booking_form_data.notes?.length\n ? { [booking_form_data.selectedRoom.space.email]: 900 }\n : {}; // 900 seconds = 15 min\n const attendees = this.booking.attendees;\n const company = this.booking.company;\n const start_epoch = closestToTimeSlot(DateTime.now(), 15).valueOf() / 1000;\n const end_epoch =\n closestToTimeSlot(DateTime.now(), 15).plus({ minutes: minutes }).valueOf() / 1000;\n\n const raw_data = {\n space: { id: this.selectedRoomId },\n all_day: false,\n attendees,\n // booking_type: booking_form_data?.bookingType.value,\n booking_type: this.userSelectedRoom.space.filters.external === true? \"External\" : \"Internal\",\n catering: [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data?.timezone,\n equipment_codes: {\n [booking_form_data?.selectedRoom.space.email]: booking_form_data?.code,\n },\n expected_attendees: {\n [this.data.email]: 1,\n },\n has_catering: false,\n needs_space: false,\n notes: this.booking.notes,\n organiser: this.currentUser,\n creator: this.currentUser,\n room: this.userSelectedRoom.space,\n title: 'Ad hoc meeting',\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n };\n console.log(new Booking(raw_data));\n return new Booking(raw_data);\n }\n\n //function for sending final booking request\n public saveChanges(minutes) {\n this.loading = true;\n this.booking = this.bookingFormToBooking(minutes);\n // const booking_form_data = this.bookingData.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(this._spaces, this.booking).then(\n (bookable: boolean) => {\n if (!bookable) {\n // TODO - Refactor for https://acaprojects.atlassian.net/browse/MCK-1498\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n this._booking_state_service.replace(bkn);\n\n // When saved, the returned booking has a null room.\n // Correct this so the rest of the code doesn't flake out.\n this.booking = new Booking({ ...bkn.toJSON(), room: this.booking.room });\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n // Heap track event\n this._service.analytics.track('create', {\n booking_id: bkn.id,\n office: this.booking.room.building.name,\n room: this.booking.local_room_name,\n start_time: bkn.startDateTz.ms,\n end_time: bkn.endDateTz.ms,\n catering: !!bkn.catering.length,\n headcount: 1,\n });\n this.data.parentComponent.confirmBooking(this.booking);\n },\n (err) => {\n this.loading = false;\n this.confirmed = false;\n if (err.status === 409) {\n // Unavailable Confirmation\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n } else {\n console.log(err);\n }\n }\n );\n },\n (err) => {\n // Unavailable Confirmation\n this.loading = false;\n this.timeout(\n 'error',\n () => {\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n },\n 500\n );\n }\n );\n }\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nexport const WAITING_TIME = 15;\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 1\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room\n }\n});\n\n// service account for office floor map view - read only\nexport const SERVICE_ACCOUNT = 'svc_kiosk_converge@mckinsey.onmicrosoft.com';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OfficeFloorComponent } from './office-floor/office-floor.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapModule } from 'src/app/map/map.module';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n MapModule,\n];\n\nexport const mapModuleDeclarations = [\n OfficeFloorComponent,\n FloorMapOverlayComponent,\n // MapControlsComponent,\n // MapFiltersComponent,\n // OfficeInformationModalComponent,\n // MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations,\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class OfficeFloorMapModule {\n}\n","import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, closestToTimeSlot, closestToTimeSlotTz, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults,\n User,\n selectMapFilteredResults,\n ApplicationService,\n clearRoomFilters,\n\t\tbookingTypeOptions,\n defaultRoomSizeOption,\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\n\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n SERVICE_ACCOUNT,\n WAITING_TIME,\n} from '../floor-map.utils';\nimport {\n loadDiffSizeResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router, RouterStateSnapshot } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-office-floor',\n templateUrl: './office-floor.component.html',\n styleUrls: ['./office-floor.component.scss'],\n})\nexport class OfficeFloorComponent extends BaseDirective implements OnInit, OnChanges {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n\n public roomStatus: any;\n public payload: any;\n /** Current User */\n public currentUser: User;\n public bookingConfirmed = false;\n public bookingData: {};\n serviceAccount: boolean;\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private route: ActivatedRoute,\n public _service: ApplicationService,\n private location: Location\n ) {\n super();\n this.payload = location.getState();\n this.payload.floorMap = false;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n throw new Error('Method not implemented.');\n }\n\n public ngOnInit(): void {\n //clear filters first if any applied previously \n this.store.dispatch(clearRoomFilters());\n\n const selection = { value: this.payload?.payload, display: '' };\n this.payload.building.value = this.payload.building[0].id;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n this.serviceAccount = this.currentUser.email === SERVICE_ACCOUNT\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n next.duration = 30;\n this.bookingFormData.next(next); /// <---- timezone setting can be done here\n }\n })\n );\n\n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n this.roomStatus = filteredSpaces;\n\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) =>\n !!s.map_id &&\n s.zones.includes(building.id) &&\n s.zones.includes(this.payload?.payload)\n );\n\n this.resultSpaces.next(cloneDeep(spacesFromSelection));\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n () => {\n if(!this.serviceAccount) {\n this.activeSpace.next(space);\n this.focusOnRoom();\n }\n \n }\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n this.isOverlayOpened && this.focusOnRoom();\n })\n );\n\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'setActiveSpace',\n this.resultSpaces\n .subscribe((next) => {\n // console.log(this.focusedRoom?.value?.space?.id);\n const space = next.find((s) => s.id === this.focusedRoom?.value?.space?.id)\n space && this.activeSpace.next(space);\n })\n );\n\n\n \n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(this.payload.building);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n \n form['date'] = closestToTimeSlot(DateTime.now().plus({ minutes: 1 }), WAITING_TIME).valueOf(),\n form.dateTz = closestToTimeSlotTz(\n new DateTZ({ date: DateTime.now().plus({ minutes: 1 }), is_local_tz: false, building_tz: form.timezone }),\n WAITING_TIME\n )\n this.store.dispatch(storeBookingFormData({ payload: form }));\n this.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n })\n );\n\n this.selectActiveBuilding(this.payload.building);\n this.selectBuildingLevel(selection);\n\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeLevel.next(next);\n });\n }\n\n public selectActiveSpace(selection?: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === this.focusedRoom?.value.space.id)),\n // take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom() {\n // this.selectedSpace = space;\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n // this.focusedRoom.next(null);\n \n this.focusedRoom.next(cloneDeep(focusedRoom[0]));\n this.isOverlayOpened && this.childCallback( cloneDeep(focusedRoom[0]) );\n\n\t\t\t\t\tconst { filters, settings } = this.focusedRoom?.value?.space; // use of new data structure fields\n if ( this.roomStatus.statusMap[this.focusedRoom.value.space.id] === 'requestable' || (filters?.equipment_code || settings?.equipment_code) ) {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.bookingFormData.value,\n selectedRoom: this.focusedRoom.value,\n },\n })\n );\n this.roomSelected(this.focusedRoom.value);\n }\n !this.isOverlayOpened && this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this));\n this.zoom.next(6);\n },\n delay\n );\n });\n }\n\n public isOverlayOpened = false;\n public childCallback;\n\n public exitFullscreen(route: string): void {\n this.store.dispatch(clearRoomFilters());\n\n this.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\tform.bookingType = bookingTypeOptions[0],\n form.roomSize = defaultRoomSizeOption,\n\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\t\t\t\t\t});\n\n const navigationExtras = {\n state: { payload: this.activeLevel.value },\n relativeTo: this.route,\n queryParams: {\n display: 'map',\n },\n };\n this._service.kioskFormFilter = true;\n this.router.navigate([route], navigationExtras);\n }\n\n // public triggerRefresh(){\n // this.subscription(\n // 'activeForm',\n // this.store\n // .pipe(select(selectActiveForm), distinctUntilChanged())\n // .subscribe((next: BookingFormData | undefined) => {\n // if (next) {\n // next.duration = 35;\n // this.bookingFormData.next(next);\n // }\n // })\n // );\n\n // this.subscription(\n // 'bookingSpaceResults',\n // combineLatest([\n // this.store.pipe(\n // select(selectMapFilteredResults),\n // map((r: LoadingModel) => r.success)\n // ),\n // this.activeBuilding.pipe(filterUndefined()),\n // this.activeLevel.pipe(filterUndefined()),\n // ]).subscribe(([filteredSpaces, building, level]) => {\n // this.roomStatus = filteredSpaces;\n\n // const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n // (s) =>\n // !!s.map_id &&\n // s.zones.includes(building.id) &&\n // s.zones.includes(this.payload?.payload)\n // );\n\n // this.resultSpaces.next(spacesFromSelection);\n\n // const listeners: MapListener[] = [];\n // const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach((space) => {\n // const status = filteredSpaces.statusMap[space.id];\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // listeners.push(\n // ...generateMapListenersForSpace(\n // space,\n // () => {},\n // () => {},\n // () => {\n // this.activeSpace.next(space);\n // this.focusOnRoom();\n // }\n // )\n // );\n // });\n // this.style_map.next(styles);\n // this.listeners.next(listeners);\n // })\n // );\n\n // this.subscription(\n // 'bookingResults',\n // this.resultSpaces\n // .pipe(withLatestFrom(this.activeSpace))\n // .subscribe(([resultSpaces, activeSpace]) => {\n // this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n // })\n // );\n // }\n\n public roomSelected(room: RoomResultsViewModel) {\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n let organiser = { display: this.currentUser.name, value: this.currentUser.email };\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n organiser: organiser,\n title: 'Ad hoc meeting',\n // attendees: [this.currentUser],\n code: '',\n notes: '',\n head_count: 1,\n selectedRoom: room,\n },\n })\n );\n\n this.router.navigate(['../create'], { relativeTo: this.route });\n }\n\n public getDayOfWeek(date: string | number | Date) {\n const dayOfWeek = new Date(date).getDay();\n return isNaN(dayOfWeek)\n ? null\n : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][\n dayOfWeek\n ];\n }\n\n public confirmBooking = (bookingData: {}) => {\n this.bookingConfirmed = true;\n this.bookingData = bookingData;\n };\n}\n","
\n
\n
\n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
Booking Confirmed
\n
\n
\n \n
Confirmed
\n
\n
\n
Status: Confirmed
\n
Date: {{this.getDayOfWeek(this.bookingData?.date_string)}}, {{this.bookingData?.date_string}}
\n
Time: {{this.bookingData?.time_period}} GMT{{this.bookingData?.tz_offset}}
\n
{{this.bookingData?.booking_type}} meeting ({{this.bookingData?.duration}} minutes)
\n
Address: {{this.activeBuilding?.value.address}}, {{this.activeBuilding?.value.city}}
\n
Room: {{this.focusedRoom.value.title}}
\n
Room {{this.focusedRoom.value.capacity}}
\n
\n
\n
\n
\n
\n
\n
Host: {{this.currentUser?.name}}
\n
Attendees: {{this.currentUser?.name}}
\n
Charge Code: {{this.focusedRoom?.value.space.filters.charge_code === false ? \"No charge code\" : \"\"}}
\n
Headcount Estimate: {{this.bookingData?.attendees.length}}
\n
Additional Requirements: {{this.bookingData?.notes[0]}}
\n
\n
\n
\n
\n \n Close\n \n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n ActivatedRoute,\n ParamMap,\n Router\n} from '@angular/router';\nimport { deepDistinctUntilChanged } from '@mckinsey-converge/rx-utils';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-results-header',\n template: `\n
\n
\n

Results

\n Matching your search criteria {{resultsCount>=0 ? '('+resultsCount+')' : ''}} \n
\n \n \n
\n `,\n styleUrls: ['./results-header.component.scss']\n})\nexport class ResultsHeaderComponent extends BaseDirective implements OnInit {\n\n public toggleOptions: SelectOption[] = [\n {\n value: 0,\n display: 'List',\n meta: { \n mobile: true\n }\n },\n {\n value: 1,\n display: 'Map',\n meta: { \n mobile: true\n }\n },\n {\n value: 2,\n display: 'Calendar',\n meta: { \n route: 'booking-calendar',\n mobile: false\n }\n }\n ];\n\n public selectedToggle = new BehaviorSubject>(this.toggleOptions[0]);\n\n @Input()\n public resultsCount: number | undefined;\n\n @Output()\n public selectedToggleChange = new EventEmitter>();\n\n constructor(private router: Router,\n private route: ActivatedRoute) {\n super();\n }\n\n public ngOnInit(): void {\n this.selectedToggleChange.next(this.selectedToggle.value);\n\n this.subscription('paramsToUI', this.route.queryParamMap\n .pipe(deepDistinctUntilChanged())\n .subscribe((next: ParamMap) => {\n const retrievedOption = this.toggleOptions.find(o => o.display.toLowerCase() === next.get('display'));\n this.onSelectedChange(retrievedOption ?? this.toggleOptions[0]);\n }));\n }\n\n public onSelectedChange(option: SelectOption) {\n this.selectedToggle.next(option);\n this.selectedToggleChange.next(option);\n\n if(option.meta?.route) {\n this.router.navigate(['booking-calendar'], { relativeTo: this.route });\n }\n else {\n // toggle route.\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n display: option.display.toLowerCase()\n },\n queryParamsHandling: 'merge'\n });\n }\n \n\n }\n\n}\n","import {\n Component,\n Inject,\n OnInit,\n Output,\n EventEmitter,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport {\n Space,\n SpacesService,\n DEFAULT_BOOKING_DURATION,\n checkCollisions,\n Booking\n} from '@mckinsey-converge/data-common';\nimport { DateTZ, convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow } from '@mckinsey-converge/date-tz';\n\ninterface ModalData {\n dateTz: DateTZ,\n duration: number,\n pendingDateTz: DateTZ,\n pendingDuration: number,\n space?: Space,\n rules?: any,\n bookingId?: string,\n currentBooking?: Booking,\n}\n\n@Component({\n selector: 'app-room-availability-preview-modal',\n template: `\n
\n \n
\n \n
New Booking Date/Time
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n

\n Room is available for selected date/time.\n \n But the following items\n \n \n \" {{ item.name }} {{ i === category.items.length - 1 ? '' : ', ' }} \"\n \n \n are restricted due to catering unavailability. Please select another time or remove these items.\n \n\n

\n

Room is unavailable for selected date/time.

\n

Checking availability for selected date/time...

\n

\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n

\n
\n
\n
\n
\n

Old

\n

Date: {{dateString}}

\n

Time: {{timeString}}

\n

({{durationString}})

\n \n
\n
\n

New

\n

Date: {{pendingDateString}}

\n

Time: {{pendingTimeString}}

\n

({{pendingDurationString}})

\n
\n
\n
\n
\n \n 0\"\n primaryLabel=\"Confirm\" (primarySubmit)=\"confirm()\"\n secondaryLabel=\"Cancel\" (secondarySubmit)=\"closeModal()\"\n >\n \n
\n `,\n styleUrls: ['./room-availability-preview-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class RoomAvailabilityPreviewModalComponent implements OnInit {\n @Output() public submitForm = new EventEmitter();\n public dateString: string;\n public timeString: string;\n public durationString: string;\n public pendingDateString: string;\n public pendingTimeString: string;\n public pendingDurationString: string;\n public mapBookingRules: readonly string[];\n public mapBookingSubtitle: string;\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ(), 15);\n public available: boolean = null;\n public formGroup = new FormGroup({\n dateTz: new FormControl(this.fromDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required])\n });\n public localTimezone = \"\";\n public buildingTimezone = \"\";\n public localStart = \"\";\n public localEnd = \"\";\n\n // Declare the restrictedDueToCatering property\n public restrictedDueToCatering: any[] = [];\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: ModalData,\n private dialogRef: MatDialogRef,\n private _spaces: SpacesService,\n ) {}\n\n public get pending_date(){\n return this.data.pendingDateTz; // new DateTZ({ date: this.data.pendingDate.valueOf(), is_local_tz: false, building_tz: this.data?.space?.timezone })\n }\n\n public ngOnInit(): void {\n this.formGroup.setValue({\n dateTz: this.data.pendingDateTz,\n duration: this.data.pendingDuration,\n });\n this.updateDisplay();\n }\n\n // Method run when the confirming the modal.\n public applyChanges(changes: any): void {\n this.data.pendingDateTz = changes.pendingDateTz; // new Date(changes.pendingDate.valueOf());\n this.data.pendingDuration = changes.pendingDuration;\n this.updateDisplay();\n }\n\n public updateDisplay() {\n // this.data.dateTz is the existing time in building time\n // this.data.pendingDateTz is the new time in building time\n const dateTz = this.data.dateTz;\n this.dateString = dateBuildingFormatString(dateTz);\n this.timeString = startEndTimeWithZoneFormatString(dateTz, dateTz.addValue({ minutes: this.data.duration }));\n this.durationString = humaniseDuration(this.data.duration);\n\n const pendingDateTz = this.data.pendingDateTz;\n this.pendingDateString = dateBuildingFormatString(pendingDateTz);\n this.pendingTimeString = startEndTimeWithZoneFormatString(pendingDateTz, pendingDateTz.addValue({ minutes: this.data.pendingDuration }));\n this.pendingDurationString = humaniseDuration(this.data.pendingDuration);\n this.fromDateTz = closestToTimeSlotTz(pendingDateTz, 15); // building value\n\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n this.updateCoachmarkTimes(this.data?.space?.timezone);\n\n // Check if any restricted catering category included \n \n\n this.restrictedDueToCatering = this.data.currentBooking?.catering.filter(order => order.items.filter(category => category.within_category_restricted_time(this.data.pendingDateTz)).length )\n\n\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: this.data.pendingDateTz.seconds,\n end_epoch: this.data.pendingDateTz.addValue({ minutes: this.data.pendingDuration }).seconds,\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n }).catch(() => {\n this.available = false;\n });\n }\n\n public closeModal() {\n this.dialogRef.close(null);\n }\n\n public updateDatePickerValue(dateTz: DateTZ) {\n const pending_date: DateTZ = this.formGroup.value.dateTz\n const day = pending_date.setValue({ \n day: dateTz.dateDay,\n month: dateTz.dateMonth,\n year: dateTz.dateYear\n });\n this.setValue(day, this.formGroup.controls.dateTz);\n }\n\n public setValue($value, formControl: AbstractControl) {\n // valid options are in building time\n formControl.setValue($value); // bulding time\n this.submitForm.emit(this.formGroup.value);\n }\n\n public confirm() {\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n const buildingDate = convertLocalTimestampToTimezonedDateTz(this.data.pendingDateTz.ms, this.data?.currentBooking?.timezone);\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: buildingDate.seconds,\n end_epoch: buildingDate.addValue({ minutes: this.data.pendingDuration }),\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n this.dialogRef.close({\n ...this.formGroup.value,\n }); \n }).catch(() => {\n this.available = false;\n });\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (timezone) {\n this.buildingTimezone = timezone;\n const localizedStartDate = this.formGroup.value.dateTz;\n const localizedEndDate = localizedStartDate.addValue({ minutes: this.formGroup.value.duration });\n this.localStart = localizedStartDate.formatLocalDate(\"h:mma\");\n this.localEnd = localizedEndDate.formatLocalDate(\"h:mma\");\n } else {\n this.buildingTimezone = this.localTimezone.slice(0);\n this.localStart = \"\";\n this.localEnd = \"\";\n } \n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n Input,\n OnInit,\n OnChanges,\n ElementRef,\n ViewChild,\n EventEmitter,\n Output,\n SimpleChanges,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { fromEvent, Subject, BehaviorSubject, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { CalendarEvent, CalendarEventTimesChangedEvent } from 'angular-calendar';\nimport { BaseClass, durationHumanized, isLessThanBreakpoint } from '@mckinsey-converge/base';\nimport {\n Booking,\n Building,\n BuildingLevel,\n Space,\n User,\n rulesForSpace,\n SpaceRules,\n} from '@mckinsey-converge/data-common';\nimport { generateFeedbackUrl, Urls } from '../../utilities/urls';\nimport { TopBarHeaderMode } from '../room-location-preview/room-location-preview.component';\nimport { RoomAvailabilityPreviewModalComponent } from '../room-availability-preview-modal/room-availability-preview-modal.component';\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n convertTimezonedTimestampToLocalDateTz,\n timezoneOffset,\n} from '@mckinsey-converge/date-tz';\nimport { utcToZonedTime } from 'date-fns-tz';\nimport { FormControl } from '@angular/forms';\nimport { DateTime } from 'luxon';\n\nconst WEEKEND_DAYS = [6, 7];\nconst colors = {\n grey: {\n secondary: '#D2D2D2',\n primary: '#A19F9F',\n },\n blue: {\n secondary: '#C0DBF5',\n primary: '#00A9F4',\n },\n red: {\n secondary: '#EB5757',\n primary: '#EB5757',\n },\n};\n\ninterface CalendarClickEvent {\n date: Date;\n}\n\nexport interface BookingBumper {\n top?: string;\n bottom?: string;\n height: string;\n backgroundColor: string;\n}\nexport interface BookingBumpers {\n top: BookingBumper;\n bottom: BookingBumper;\n}\n\nexport type BookingPlus = Booking & { start: number; end: number }; // R--- why again?\nexport type CalendarEventPlus = CalendarEvent & { bumper?: BookingBumpers; booking?: Booking };\n\n@Component({\n selector: 'room-availability-preview',\n templateUrl: './room-availability-preview.component.html',\n styleUrls: ['./room-availability-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RoomAvailabilityPreviewComponent extends BaseClass implements OnInit, OnChanges {\n @ViewChild('scrollContainer') scrollContainer: ElementRef;\n\n @Input() public alternativeWeekStartDateTz: DateTZ;\n // Used when editing a booking\n @Input() public bookingId?: string;\n @Input() public bookings: BookingPlus[];\n /** retain as mutable */\n @Input() public building: Building;\n // R--- could probably use the currentBooking ID edit,\n // The bookingId was an after thought\n @Input() public currentBooking: Booking;\n @Input() public currentUser: User;\n @Input() public dateTz: DateTZ;\n @Input() public duration: number;\n @Input() public expanded: boolean;\n @Input() public level: BuildingLevel;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n @Input() public space: Space;\n // @Input() public timezone: string;\n\n @Output() public confirmChanges: EventEmitter = new EventEmitter();\n @Output() public handleExpand: EventEmitter = new EventEmitter();\n @Output() public updateCalendarWeekView: EventEmitter = new EventEmitter();\n @Output() public warnIfItHasConflict: EventEmitter = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n constructor(public dialog: MatDialog) {\n super();\n }\n\n public breakpoint = 768;\n public mobile = false;\n public showDatePicker = false;\n public events: CalendarEventPlus[] = [];\n public dayStartHour: number;\n public dayEndHour: number;\n public viewDateTz: DateTZ;\n public weekViewDateTz: DateTZ;\n public weekViewRangeText: string;\n public showWeekend: boolean = false;\n public currentPage: string;\n public calendarPopupValue = new BehaviorSubject(DateNow(new Date()));\n public pendingChange: boolean = false;\n public pendingDateTz: DateTZ;\n public pendingDuration: number;\n public eventSnapSize: number = 15;\n public dayRefresh: Subject = new Subject();\n public weekRefresh: Subject = new Subject();\n public addMarginOnConflict: boolean = false; // helps to add html class to adjust margin top in case of QR code scan conflict\n public event: CalendarEventPlus = {\n start: new Date(),\n end: new Date(),\n title: '',\n color: colors.blue,\n cssClass: 'selected',\n actions: null,\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n };\n\n public get timezone(): string {\n return this.dateTz.building_tz;\n }\n\n public get one_day_in_millis() {\n return 86400000;\n }\n\n public get thirty_minutes_in_millis() {\n return 1800000;\n }\n public rules: SpaceRules;\n public modal_data: any = {};\n public scrollFired: boolean = false;\n\n // Values to display a span on the date picker, but the date picker doesn't support this.\n public date_span = {\n start: 0,\n end: 0,\n };\n\n // I can't think of any reason the calendar widget needs to go back further than 2 years, if even that.\n public fromDateTz = DateNow(new Date()).subtractValue({ years: 2 });\n\n public dateControl = new FormControl(new Date().valueOf());\n\n public isEventDate(d: CalendarClickEvent) {\n const date = new DateTZ({ date: d.date.valueOf() }); // local time I think.. problem TODO\n return this.pendingDateTz.isSameDate(date, 'day');\n }\n\n public get inputDate(): Observable {\n return this.calendarPopupValue.pipe(map((d) => d));\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public ngOnInit(): void {\n // R--- retrun to document\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.pendingDateTz = this.dateTz.clone();\n const date = this.dateTz.clone();\n const currentBookingStartDate = this.currentBooking\n ? this.currentBooking.startDateTz.addValue({ seconds: 0 })\n : date;\n this.alternativeWeekStartDateTz = date.startOfValue('week').startOfValue('day');\n\n // Not sure if this is correct\n this.weekViewDateTz = this.alternativeWeekStartDateTz.clone();\n\n this.calendarCenter();\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.pendingDateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 });\n this.setCalendarValue(this.pendingDateTz);\n this.showWeekend =\n WEEKEND_DAYS.includes(currentBookingStartDate.dateWeekday) ||\n WEEKEND_DAYS.includes(date.dateWeekday);\n this.setupEventName();\n this.transformBookings();\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < this.breakpoint;\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n },\n })\n )\n .subscribe();\n\n this.rules = rulesForSpace({\n time: this.dateTz.ms,\n duration: this.duration,\n user: this.currentUser,\n rules: this.building?.booking_rules,\n space: this.space,\n });\n\n // Update the display when the screen resizes.\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.calendarCenter();\n this.setDislayValues();\n },\n })\n )\n .subscribe();\n this.dateControl.setValue(this.dateTz);\n this.transformBookings();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.expanded) {\n // set if the event is editable\n this.event.draggable = this.expanded;\n this.event.resizable = {\n beforeStart: this.expanded,\n afterEnd: this.expanded,\n };\n const date = this.dateTz;\n this.setCalendarValue(date);\n }\n\n if (this.dayStartHour) this.scrollTo();\n\n if (!this.pendingDateTz) return;\n\n if (changes.bookings || changes.expanded) {\n this.transformBookings();\n }\n if (changes.alternativeWeekStartDateTz) {\n this.setDislayValues();\n }\n if (changes.expanded) {\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n }\n\n public setDislayValues() {\n const tz_offset = timezoneOffset(this.alternativeWeekStartDateTz.building_tz).hours\n const week_start_date = this.alternativeWeekStartDateTz.subtractValue({hours: tz_offset}).clone(); // Operation needed to trick the mwl-calendar-week-view to display the correct day if the day changes between timezones \n this.weekViewDateTz = this.weekViewDateTz || this.alternativeWeekStartDateTz.clone();\n let week_view_date = this.weekViewDateTz.startOfValue('week'); // new DateTZ({date: this.weekViewDate?.valueOf()}).startOfValue('week')\n if (!this.showWeekend) {\n // Advance from Sunday to Monday\n week_view_date = week_view_date.addValue({ days: 1 });\n }\n\n if (this.mobile) {\n this.weekViewDateTz = week_start_date\n this.weekViewRangeText = `${this.weekViewDateTz.formatDate('d MMMM')}`;\n this.calendarPopupValue.next(this.weekViewDateTz);\n } else {\n this.weekViewDateTz = week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }); // new Date(week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }).ms);\n this.weekViewRangeText = `${week_view_date.formatDate('d MMMM')} - ${week_view_date\n .addValue({ days: this.showWeekend ? 6 : 4 })\n .formatDate('d MMMM yyyy')}`;\n this.calendarPopupValue.next(week_view_date);\n }\n }\n\n public getBumpers(booking: Booking, selected: boolean = false) {\n const email = booking.space.email || this.space.email;\n const setup = booking.setup[email] ? booking.setup[email] / 60 : 0;\n const breakdown = booking.breakdown[email] ? booking.breakdown[email] / 60 : 0;\n\n return {\n top: {\n top: `-${setup - 1}px`,\n height: `${setup}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n bottom: {\n bottom: `-${breakdown - 1}px`,\n height: `${breakdown}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n };\n }\n\n public setupEventName() {\n this.setDislayValues();\n const pending_date = this.pendingDateTz.clone();\n const start_date = pending_date.setValue({ second: 0, millisecond: 0 });\n this.event.start = start_date.JSDate;\n this.event.end = start_date.addValue({ minutes: this.pendingDuration }).JSDate;\n const startHour = parseInt(pending_date.formatDate('H'), 10);\n\n if (startHour === 0) {\n this.dayStartHour = startHour;\n } else if (startHour < 6) {\n const offset = startHour > 3 ? startHour - 2 : startHour;\n this.dayStartHour = startHour - offset;\n } else {\n // The min of 18 is needed so start times after 6pm\n // don't push the calendar view beyond midnight.\n const offset = Math.min(18, startHour - 3);\n this.dayStartHour = offset;\n }\n\n if (!this.scrollFired && this.dayStartHour) {\n this.scrollTo();\n }\n\n this.dayEndHour = Math.max(24, this.dayStartHour + 6);\n this.event.title = `${pending_date\n .formatDate('h:mma')\n .toLocaleLowerCase()} (${durationHumanized(this.pendingDuration, true)})`;\n this.event.cssClass = `selected ${this.showWeekend ? 'show-weekend' : ''} ${\n this.mobile && this.expanded ? 'mobile' : ''\n } `;\n\n if (this.currentBooking) {\n this.event.bumper = this.getBumpers(this.currentBooking);\n this.event.booking = this.currentBooking;\n }\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n\n public transformBookings() {\n this.calendarSpan();\n const events = [];\n if (Array.isArray(this.bookings)) {\n this.bookings.forEach((raw_booking) => {\n const booking = new Booking(raw_booking);\n const { mode, duration } = this.displayClass(\n booking.startDateTz.ms,\n booking.endDateTz.ms\n );\n\n // back off a ms when end of day to avoid all day wrapping to next day.\n let end = booking.endDateTz;\n const endTime = booking.endDateTz;\n if (endTime.minutes === 0 && endTime.seconds === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n end = booking.endDateTz.subtractValue({ seconds: 1 });\n }\n\n // When editing skip over the current booking\n if (booking.id === this.bookingId) return;\n\n const utcStart = booking.startDateTz; // building time\n const utcEnd = end; // building time\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n const adjustedStartDate = utcToZonedTime(utcStart.ms, booking.timezone); // return local time\n const adjustedEndDate = utcToZonedTime(utcEnd.ms, booking.timezone); // return local time\n\n events.push({\n start: adjustedStartDate,\n end: adjustedEndDate,\n title: `Booked by ${booking.booker['name']}`,\n color: colors.grey,\n actions: null,\n cssClass: `booked ${this.mobile && 'mobile'} ${\n this.showWeekend ? 'show-weekend' : ''\n } ${mode}`,\n bumper: this.getBumpers(booking),\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n booking,\n });\n });\n }\n\n const { mode, duration } = this.displayClass(\n this.event.start.getTime(),\n this.event.end.getTime()\n );\n const event = Object.assign({}, this.event);\n const endTime = new DateTZ({ date: this.event.start.valueOf() }).addValue({\n minutes: this.pendingDuration,\n }); // building time\n if (endTime.minutes === 0 && endTime.second === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n event.end = endTime.subtractValue({ milliseconds: 1 }).JSDate; // building time\n }\n\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n // will need to adjust the other way with drag and drop and click actions.\n event.start = utcToZonedTime(event.start, this.timezone); // local time\n event.end = utcToZonedTime(event.end, this.timezone); // local time\n\n event.cssClass = `selected ${this.mobile && this.expanded ? 'mobile' : ''} ${mode}`;\n if (this.currentBooking) {\n event.bumper = this.getBumpers(this.currentBooking, true);\n event.booking = this.currentBooking;\n }\n\n events.push(event);\n this.events = events.slice();\n this.updateTileColor();\n }\n\n public updateTileColor() {\n const pending_date = this.pendingDateTz.clone();\n const start = pending_date.setValue({ second: 0, millisecond: 0 });\n const end = start.addValue({ minutes: this.pendingDuration });\n const booked = this.events.filter((e) => !e.draggable); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n const isEvents = this.events.filter((e) => e.draggable);\n if(isEvents.length ) {\n isEvents[0].color = conflict ? colors.red : colors.blue;\n this.addMarginOnConflict = conflict ? true : false;\n \n } \n !this.expanded && this.warnIfItHasConflict.emit({room: this.space, hasConflict: conflict});\n }\n public displayClass(start: number, end: number) {\n const duration = end - start;\n return {\n duration,\n mode: duration > this.thirty_minutes_in_millis ? 'extended' : 'minimal',\n };\n }\n\n public setCalendarValue(dateTz: DateTZ) {\n let toDate = DateNow().startOfValue('minute');\n if (dateTz) {\n toDate = dateTz.startOfValue('minute');\n }\n if (!this.mobile && toDate.dateWeekday !== 7) {\n toDate = toDate.startOfValue('week');\n }\n this.updateCalendarWeekView.emit(toDate);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = toDate;\n this.setDislayValues();\n }\n\n /**\n * Convert the true bulding based time object to a timestamp skewed to the local time\n *\n * @param buildingTz - DateTZ object of time in bulding timezone\n * @returns number - timestamp in local time skewed from bulding time\n */\n public convertTimezonedValueForCalendar(buildingTz: DateTZ) {\n return convertTimezonedTimestampToLocalDateTz(buildingTz.ms, this.timezone).ms;\n }\n\n public hasConflict(startTz, endTz, booked) {\n // Convert the start and end building times to the local timezone for comparison with the localized bookings.\n const localizedStartTime = startTz.ms;\n const localizedEndTime = endTz.ms;\n let email = this.space?.email || this.currentBooking?.room?.email;\n return booked.some((b) => {\n email = email || b.booking?.room?.email;\n // Booking here are local time to render on the calendar correctly\n const setup = b.booking?.setup[email] || 0;\n // R--- This weird augmented booking with start and end needs to be with DateTZ and a getter when ms is needed.\n const bookingStartTime = new DateTZ({ date: b.start.valueOf() }); // local times\n const bookingEndTime = new DateTZ({ date: b.end.valueOf() }); // local times\n const bstart = bookingStartTime.subtractValue({ seconds: setup }).ms;\n const breakdown = b.booking?.breakdown[email] || 0;\n const bend = bookingEndTime.addValue({ seconds: breakdown }).ms;\n\n if (\n (localizedStartTime >= bstart && localizedStartTime < bend) || // booking starts durring a meeting\n (localizedStartTime <= bstart && localizedEndTime > bstart) || // booking ends durring meeting\n (localizedStartTime >= bstart && localizedEndTime <= bend) || // booking starts and ends durring a meeting\n (localizedStartTime <= bstart && localizedEndTime >= bend) // booking overlaps entire meeting\n ) {\n return b.booking?.id !== this.currentBooking?.id;\n }\n return false;\n });\n }\n\n public eventTimesChanged({ event, newStart, newEnd }: CalendarEventTimesChangedEvent): void {\n const s = convertLocalTimestampToTimezonedDateTz(\n newStart.valueOf(),\n this.timezone\n );\n if (s.ms < Date.now()) return;\n // newStart and newEnd are local times from the calendar component\n // merging in with localized bookings in this.events\n this.events = this.events.map((iEvent) => {\n if (event.id && iEvent.id === event.id) {\n return {\n ...event,\n start: newStart,\n end: newEnd,\n };\n }\n return iEvent;\n }); // local times\n\n let buildingStartDateTz = new DateTZ(\n { date: newStart.valueOf()}\n );\n let buildingEndDateTz = new DateTZ(\n { date: Math.ceil(newEnd.valueOf()/900000)*900000 } //For latest bug in CNG-309, make sure end time follows a 15-min interval\n );\n\n // Clear out the seconds and miliseconds to avoid collision by seconds.\n buildingStartDateTz.setValue({ millisecond: 0, second: 0 });\n\n if (buildingStartDateTz < DateNow(new Date())) {\n // compare building time to now\n // Abandon updates if the past\n this.transformBookings();\n return;\n }\n\n let pendingDuration = Math.floor(\n (buildingEndDateTz.ms - buildingStartDateTz.ms) / 60 / 1000\n );\n // Make adjustments to the time and duration so the snap to behavior aligns\n // with the Mckinsey time and duration rules.\n const new_start = buildingStartDateTz.clone(); //new DateTZ({date: buildingNewStart.getTime()}); // building time\n if (pendingDuration >= 60) {\n // check that duration is inc of 1/2 hr\n const d = pendingDuration % 30;\n // if (d) {\n // pendingDuration = Math.floor(pendingDuration + (30 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // check that the start time is 1/2 hr\n const m = parseInt(new_start.formatDate('m'), 10);\n const md = m % 30;\n // if (md) {\n // buildingStartDateTz = new_start.addValue({ minutes: md }); // building time\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // Update snap to rules\n // this.eventSnapSize = 30; //done for CNG-309\n } else {\n // check that duration is inc of 1/4 hr\n const d = pendingDuration % 15;\n if (d) {\n // pendingDuration = Math.floor(pendingDuration + (15 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n }\n this.eventSnapSize = 15;\n }\n\n // Drag and Drop / Resize duration\n const dnd_duration = buildingEndDateTz.ms - buildingStartDateTz.ms;\n if (dnd_duration >= this.one_day_in_millis - 1) {\n // Add that millisecond back in so the angular calender drag and drop snapping still works.\n buildingEndDateTz = buildingEndDateTz.addValue({ milliseconds: 1 });\n }\n\n if (this.rules?.max_length) {\n if (dnd_duration / 60000 > this.rules?.max_length) {\n // Abandon updates if exceeeds max duration\n this.transformBookings();\n return;\n }\n }\n\n // Setup values for conflict checking, add on the setup and breakdown times form comparison\n let conflictCheckStartTime = buildingStartDateTz.clone();\n let conflictCheckEndTime = buildingEndDateTz.clone();\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n const start = buildingStartDateTz.clone();\n conflictCheckStartTime = start.subtractValue({ seconds: setup });\n }\n const breakdown = this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n const end = buildingEndDateTz.subtractValue({ seconds: 1 });\n conflictCheckEndTime = end.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const start = conflictCheckStartTime;\n const end = conflictCheckEndTime;\n const booked = this.events.filter((e) => e.draggable === false); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n this.dateControl.setValue(start);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n // check if the time or duration has changed\n if (this.pendingDateTz !== buildingStartDateTz) {\n this.pendingChange = true;\n } else if (this.pendingDuration !== pendingDuration) {\n this.pendingChange = true;\n }\n\n // set the new Pending Date\n this.pendingDateTz = convertLocalTimestampToTimezonedDateTz(buildingStartDateTz.ms, this.timezone); // building time\n this.pendingDuration = pendingDuration;\n\n this.setupEventName();\n this.transformBookings();\n }\n\n public hourClicked(event: CalendarClickEvent) {\n // convert the calender local input to the building times\n const buildingStartDate = convertLocalTimestampToTimezonedDateTz(\n event.date.valueOf(),\n this.timezone\n ); // return building time\n let startTz = buildingStartDate.clone();\n let endTz = startTz.addValue({ minutes: this.pendingDuration });\n\n if (buildingStartDate.ms < Date.now()) {\n // compare building time to now\n // Abandon past events\n return;\n }\n\n // this.pendingDate is in building time\n if (this.pendingDateTz.ms !== startTz.ms) {\n // comparing building to building\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n startTz = startTz.subtractValue({ seconds: setup });\n }\n const breakdown =\n this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n endTz = endTz.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const booked = this.events.filter((e) => e.draggable === false);\n // building start and end time but localized bookings\n const conflict = this.hasConflict(startTz, endTz, booked);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n this.pendingChange = true;\n this.pendingDateTz = buildingStartDate; // building time\n\n this.setupEventName();\n this.transformBookings();\n }\n }\n\n public displayConfirmationModal() {\n this.modal_data = {\n pendingDateTz: this.pendingDateTz, // building time , new time\n pendingDuration: this.pendingDuration,\n dateTz: this.dateTz, // building time, existing time\n duration: this.duration,\n space: new Space(this.space),\n rules: this.rules,\n bookingId: this.bookingId,\n currentBooking: this.currentBooking,\n };\n\n const dialogRef = this.dialog.open(RoomAvailabilityPreviewModalComponent, {\n data: this.modal_data,\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRef.componentInstance.submitForm.subscribe((d: any) => {\n // Apply the confirmed changes\n this.pendingChange = true;\n this.pendingDateTz = d.dateTz;\n this.pendingDuration = d.duration;\n\n dialogRef.componentInstance.applyChanges({\n dateTz: d.dateTz,\n duration: this.pendingDuration,\n pendingDateTz: this.pendingDateTz,\n pendingDuration: this.pendingDuration,\n });\n this.setupEventName();\n this.transformBookings();\n // Change View\n this.setCalendarValue(d.dateTz);\n });\n\n dialogRef.afterClosed().subscribe((d) => {\n // Update the current with pending record\n if (d) {\n // convert the local input values returned into the same time in the building timezone\n const buildingDate = convertLocalTimestampToTimezonedDateTz(\n d.dateTz.ms,\n this.timezone\n );\n this.dateTz = buildingDate;\n this.duration = d.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(buildingDate.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.confirmChanges.emit({ ...d, mobile: this.mobile, save: true });\n } else {\n // this is ok\n const md = this.modal_data;\n this.dateTz = md.dateTz;\n this.duration = md.duration;\n this.pendingDateTz = md.dateTz;\n this.pendingDuration = md.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(md.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n // This is reverting the changes\n this.confirmChanges.emit({\n dateTz: md.dateTz,\n duration: this.duration,\n mobile: this.mobile,\n save: !!d,\n });\n this.setupEventName();\n this.transformBookings();\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = this.viewDateTz;\n this.setDislayValues();\n }\n });\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public scrollTo() {\n if (this.scrollFired) return;\n this.timeout(\n 'scroll_to',\n () => {\n const ele = document.getElementById('calendarScrollContainer');\n if (ele) {\n ele.scrollTo({\n top: this.dayStartHour * 64,\n left: 0,\n behavior: 'smooth',\n });\n this.scrollFired = true;\n }\n },\n 500\n );\n }\n\n public toggleDatePicker() {\n this.showDatePicker = !this.showDatePicker;\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n // Reset to the initial view\n this.pendingDateTz = this.dateTz; // = new Date(this.date);\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.setupEventName();\n this.transformBookings();\n this.dayRefresh.next();\n }\n\n public calendarBack() {\n let today = this.alternativeWeekStartDateTz; // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.subtractValue({ days: 1 });\n } else {\n today = today.subtractValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarSpan() {\n let today = this.pendingDateTz; // new DateTZ({date: this.pendingDate.valueOf()});\n if (this.mobile || !this.expanded) {\n this.date_span.start = today.startOfValue('day').ms;\n this.date_span.end = today.endOfValue('day').ms;\n } else {\n this.date_span.start = today.startOfValue('week').ms;\n this.date_span.end = today.endOfValue('week').ms;\n }\n }\n\n public calendarCenter() {\n let today = this.pendingDateTz.startOfValue('day');\n if (!this.mobile) {\n today = today.startOfValue('week');\n }\n\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarForward() {\n let today = this.alternativeWeekStartDateTz // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.addValue({ days: 1 });\n } else {\n today = today.addValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public toggleWeekend() {\n this.showWeekend = !this.showWeekend;\n this.setupEventName();\n }\n}\n","
\n
\n \n \n
\n
\n \n \n
\n
\n
\n

Room Availability

\n

{{space.local_name}}

\n

{{building?.name}}, {{level?.name}}, {{building?.address}}

\n
\n
\n
\n
\n \n \n \n
\n
\n {{weekViewRangeText}}\n \n \n
\n \n Show Weekend\n \n
\n
\n
\n \n\n \n
\n \n {{ day.date | calendarDate:'weekViewColumnHeader':locale }} {{ day.date | calendarDate:'weekViewColumnSubHeader':locale }}\n

{{ isEventDate(day) ? '(Current Selection)' : '' }}

\n
\n
\n \n\n \n \n
\n
\n
\n
\n \n \n &ngsp;\n \n \n
\n \n
\n
\n
\n\n
\n
\n \n \n
\n
\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom,\n} from 'rxjs/operators';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n checkCollisions,\n Booking,\n User,\n UsersService,\n BookingFormData,\n selectActiveForm,\n SpacesService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n matchToHighlight\n} from '@mckinsey-converge/base';\n\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'app-room-booking-details-form',\n templateUrl: './room-booking-details-form.component.html',\n styleUrls: ['./room-booking-details-form.component.scss']\n})\nexport class RoomBookingDetailsFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n public formRef: FormGroupDirective;\n /** Number of characters needed before a search will start */\n @Input() public limit = 3;\n /** When the value changes, the form is submitted */\n @Input() public triggerSubmit = '';\n /** Need booking details */\n @Input() public booking: Booking = null;\n /** Data returned to parent */\n @Output() public submitForm = new EventEmitter();\n /** Data returned to parent */\n @Output() public validateForm = new EventEmitter();\n /** Current User */\n public currentUser: User;\n /** Host list to display */\n public host_list: User[];\n /** User list to display from the Attendees search */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Whether to show the attendees hint */\n public showHint = false;\n /** Attendee Input / Search String */\n public searchString: string;\n /** List of users from an API search */\n public searchResults: Observable;\n /** Subject holding the value of the search */\n public searchSubject = new Subject();\n /** Host field options */\n public hostOptions = [];\n /** Attendees options */\n public options = new BehaviorSubject[]>([]);\n /** Selected Attendees */\n public selectedOptions = new BehaviorSubject[]>([]);\n public selectedUsers = new BehaviorSubject[]>([]);\n public needs_charge_code = false;\n public has_delegate = false;\n public available: boolean = null;\n public notesHandle = null;\n public noteValidationClass = '';\n public selectedCompanies = new BehaviorSubject[]>([]);\n public companyOptions = new BehaviorSubject[]>([]);\n\n /** Data collected on this form */\n public bookingFormGroup = new FormGroup({\n organiser: new FormControl(),\n title: new FormControl('', [ Validators.minLength(1)]), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n attendees: new FormControl(),\n code: new FormControl('', [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]),\n notes: new FormControl(),\n head_count: new FormControl(1, [Validators.required, Validators.min(1)]),\n user_list: new FormControl(),\n host_list: new FormControl(),\n company: new FormControl(),\n opt_out: new FormControl(),\n outlook_opt_out: new FormControl(),\n\n });\n action: string;\n // Indecates that processing request to check availability of breakdown if special requirement being added by user\n checkingBreakdown: boolean = false;\n\n public get invalid_charge_error(): string {\n if (this.bookingFormGroup.controls.code.errors?.required) {\n return 'Charge Code is required';\n }\n if (this.bookingFormGroup.controls.code.errors?.minlength) {\n return 'Charge Code must be at least four characters';\n }\n if (this.bookingFormGroup.controls.code.errors?.pattern) {\n return 'Charge Code cannot contain spaces or special characters';\n }\n return '';\n }\n\n public get headCountControl(): AbstractControl {\n return this.bookingFormGroup.get('head_count');\n }\n\n constructor(\n private _spaces: SpacesService,\n private _snackBar: MatSnackBar,\n private store: Store,\n vcRef: ViewContainerRef,\n private _service: ApplicationService,\n private _users: UsersService) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map((del) => {\n // the kludgy or new User is for when the user service isn't ready.\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n\n // (del) => new User({ email: del.email, name: del.email.split('@')[0].split('_').join(' '), opt_out: del.opt_out })\n });\n if (delegates.length) {\n this.has_delegate = true;\n }\n this.host_list = [user].concat(delegates);\n this.hostOptions = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }));\n });\n\n // if we have an active form, refill the information here once.\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // Get the Equipment charge code mandatory requirement\n const { filters, settings } = next.selectedRoom?.space;\n const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n const officeBasedEqCode = next.selectedRoom?.building?.required?.equipment_code;\n this.needs_charge_code = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n \n\n if (this.needs_charge_code) {\n this.bookingFormGroup.controls.code.setValidators([Validators.required, Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]);\n }\n // build the initial options\n const options = [];\n const attendees = next?.attendees || [];\n const organiser = next?.organiser || { display: this.currentUser.name , value: this.currentUser.email, meta: { external: false, user: this.currentUser }};\n const company = next?.company || [];\n\n const opt_out = next?.opt_out || false;\n const outlook_opt_out = next?.outlook_opt_out || false;\n this.action = next.action || 'new';\n // Load the saved form\n this.bookingFormGroup.setValue({\n organiser,\n title: next.title || '',\n attendees, // options will display current user\n code: next.code || '',\n notes: next.notes || '',\n head_count: next.head_count || '',\n user_list: [],\n host_list: [],\n company,\n opt_out: opt_out,\n outlook_opt_out\n });\n this.selectedOptions.next(attendees);\n this.options.next(attendees);\n this.selectedCompanies.next(company);\n this.companyOptions.next(company);\n }\n })\n );\n\n // Listen for input changes\n this.searchResults = this.searchSubject.pipe(\n debounceTime(500),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query,\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return list;\n })\n );\n\n // Process API results\n this.subscription(\n 'search_results',\n this.searchResults.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n\n // Build options from returned users\n const options = this.user_list.map(u => {\n return {\n value: u.email,\n display: `${u.name} ${u.email}`,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: `${u.name}`,\n meta: { external: false, user: u },\n };\n });\n // Add the manual option to the beginning of the array\n options.unshift({\n value: this.searchString,\n display: this.searchString,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: this.searchString,\n meta: { external: true, user: null },\n });\n // this.loading = false;\n this.options.next(options);\n })\n );\n\n this.bookingFormGroup.valueChanges.subscribe(val => {\n\n clearTimeout(this.notesHandle);\n if (val?.notes?.length) {\n this.checkingBreakdown = true;\n \n // Check for conflicts if adding a note and default setup and breakdown times.\n this.notesHandle = setTimeout(() => {\n this.validateForm.emit(false);\n const booking = this.booking.clone();\n const setup = {};\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n const breakdown = {};\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n\n const mockBooking = new Booking({\n id: booking.id,\n room: booking.space,\n start_epoch: booking.startDateTz.seconds,\n end_epoch: booking.endDateTz.seconds,\n setup,\n breakdown,\n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.checkingBreakdown = false;\n this.available = bookable;\n // this.validateForm.emit(true);\n this.validateForm.emit(this.bookingFormGroup.valid);\n this.noteValidationClass = bookable === false ? 'booked' : 'available';\n // this.loading = false;\n }).catch(() => {\n this.checkingBreakdown = false;\n this.available = false;\n this.validateForm.emit(false);\n this.noteValidationClass = 'booked';\n // this.loading = false;\n\n return;\n });\n }, 200);\n } else {\n this.checkingBreakdown = false;\n this.available = null;\n this.noteValidationClass = '';\n this.validateForm.emit(this.bookingFormGroup.valid);\n }\n\n });\n }\n\n public setOrganiserOptOut(opt_out) {\n this.bookingFormGroup.controls.opt_out.setValue(opt_out);\n }\n\n public updateOrganiser(user) {\n console.log(user);\n }\n\n /** Listen for changes */\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.bookingFormGroup.get(key).setValue(this.bookingFormGroup.get(key).value.trim());\n }\n\n /** Toggle an attendee on/off */\n public toggle(option: SelectOption) {\n const inputValue = option.value\n .split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n let inputValueEmail = '';\n // Check if inputValue is a valid email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(inputValue)) {\n // If not, replace all spaces with underscores and append a random guest email string\n inputValueEmail = inputValue.replace(/\\s+/g, '_') + `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n }\n\n // Check for character limit\n if (\n // this.selectedOptions.value.some((option: SelectOption) => option.value === inputValue) ||\n inputValue.length > 50\n ) {\n this._service.notifyWarn('Attendee name cannot exceed 50 characters');\n return;\n }\n\n this.selectedOptions\n .pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n let opts = selectedOptions.slice();\n const found = opts.some((v) => inputValue === v.value);\n if (found) {\n opts = opts.filter((v) => inputValue !== v.value);\n } else {\n const color = inputValue.toLowerCase().includes('mckinsey.')\n ? 'internal'\n : 'external';\n opts.push({\n ...option,\n value: inputValueEmail,\n display: inputValue,\n shortDisplay: inputValue,\n meta: {\n ...option.meta,\n color,\n },\n });\n }\n\n return opts;\n })\n )\n .subscribe((next) => {\n if (!this.bookingFormGroup.controls.head_count.touched) {\n this.bookingFormGroup.controls.head_count.setValue(next.length + 1);\n }\n this.selectedOptions.next(next);\n });\n }\n\n public clearHeadcount() {\n this.headCountControl.setValue(1);\n }\n\n /** Return the data to the listening parent */\n public onSubmitForm() {\n this.bookingFormGroup.markAllAsTouched();\n // a bit of an issue that the form state isn't saved unless valid\n if (this.bookingFormGroup.valid) {\n const form_data = this.bookingFormGroup.value;\n form_data.user_list = this.user_list;\n form_data.host_list = this.host_list;\n form_data.has_delegate = this.has_delegate;\n this.submitForm.emit(form_data);\n }\n }\n\n /** Take the input and feed it back to the parent to add to attendees array */\n public updateAttendeeOptionsFromUserInput(v: string) {\n const l = v.length;\n const options = this.selectedOptions.value.slice();\n if (!l) {\n this.options.next([]);\n return;\n }\n if (l > 2) {\n // Triggers the API call to search for the user input\n this.searchSubject.next(v);\n }\n\n options.unshift({\n value: v,\n display: v,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: v,\n meta: { external: true },\n });\n this.searchString = v;\n this.options.next(options);\n }\n\n public toggleAttendeesHint() {\n this.showHint = !this.showHint;\n }\n\n public updateCompanyOptionsFromUserInput(v: string) {\n if (!v.length) {\n this.companyOptions.next([]);\n return;\n }\n this.companyOptions.next([{\n value: v,\n display: v,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: v,\n }]);\n }\n\n public toggleCompany(option: SelectOption) {\n this.selectedCompanies.pipe(\n take(1),\n withLatestFrom(this.companyOptions),\n map(([selectedCompanies, options]) => {\n let opts = selectedCompanies.slice();\n const found = opts.some(v => option.value === v.value);\n if (found) {\n opts = opts.filter(v => option.value !== v.value);\n } else {\n opts.push(option);\n }\n\n return opts;\n })\n ).subscribe(next => {\n this.selectedCompanies.next(next);\n });\n }\n}\n","\n
\n
\n
\n \n Meeting Title*\n \n \n \n \n
\n \n {{ ( bookingFormGroup?.get('title').errors && bookingFormGroup?.get('title').hasError('pattern')) ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Meeting Title is required'}}\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n Opt out email notification \n
\n \n
\n\n\n \n\n
\n \n \n \n Why do we need this?\n
\n
\n Attendee emails are used for visitor management purposes.\n Converge won't send any emails to attendees.\n
\n \n
\n\n
\n
\n \n \n
\n
\n \n Charge Code{{ needs_charge_code ? '*' : '' }}\n \n \n \n \n
\n \n {{ invalid_charge_error }}\n \n
\n
\n
\n
\n \n Headcount estimate*\n \n \n \n \n
\n \n Headcount is required\n \n
\n
\n
\n
\n\n
\n
\n \n Additional requirements (e.g room setup, equipment...)\n \n \n \n \n \n \n

Checking breakdown availability for selected date/time...

\n

\n \n A set up and breakdown time of 15 mins was added to either side\n of your booking to cater for these additional requirements.\n

\n

\n \n A set up and break down time of 15mins was added to either side of your booking to cater for these additional requirements. This has resulted in a conflict with another booking. Please adjust your booking accordingly.\n

\n
\n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\nimport { closestToTimeSlot, closestToTimeSlotTz, resetSecondsOnTimestamp } from '@mckinsey-converge/base';\n\nimport {\n distinctUntilChanged,\n map,\n skip,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingCity,\n flattenDisplayOffices,\n toggleSelectedByGroup,\n storeBookingFormData,\n BookingFormData,\n bookingTypeOptions,\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption,\n roomSizeOptions,\n selectActiveForm,\n ApplicationService,\n roomSizeOptionsKiosk,\n\t\tRecurrencePeriod,\n generateBookingForm,\n SeriesAction,\n setRecurrenceStartsTime\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Booking } from '../../../../../../libs/data-common/src';\nimport * as cloneDeep from 'lodash/cloneDeep';\n@Component({\n selector: 'app-room-booking-form',\n templateUrl: './room-booking-form.component.html',\n styleUrls: ['./room-booking-form.component.scss']\n})\nexport class RoomBookingFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n formRef: FormGroupDirective;\n\n @Output()\n public submitForm = new EventEmitter();\n\n @Input()\n public showCancel = false;\n\n @Input()\n public triggerSubmit: number;\n\n /**\n * Used only if showCancel is true.\n */\n @Output()\n public cancelSubmit = new EventEmitter();\n\n // fromDate is the selected date\n public fromDate: number = closestToTimeSlot(DateTime.now(), 15).valueOf(); // R--- depreciate\n /** DateTZ object of the date and time that the date and time picker will begin it's options from */\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15);\n public bookingTypeOptions = bookingTypeOptions;\n public roomSizeOptions = roomSizeOptions;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\"\n\n public formGroup: FormGroup = new FormGroup({\n id: new FormControl('', []), // used in case of recurring series edit\n location: new FormControl([], [Validators.required]),\n date: new FormControl(this.fromDate, [Validators.required]),\n dateTz: new FormControl(this.fromDateTz, [Validators.required]), // starts out as the next closest available time interval\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n bookingType: new FormControl(internalBookingTypeOption),\n roomSize: new FormControl(defaultRoomSizeOption),\n selectedRoom: new FormControl({}),\n timezone: new FormControl(\"\"),\n offset: new FormControl(\"\"),\n\n\t\trecurrence_period: new FormControl(RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl( 1),\n recurrence_endTz: new FormControl( new DateTZ({ date: 1 }).addValue({days: 1})),\n recurrence_count: new FormControl( 0),\n is_recurrent: new FormControl(null),\n recurrence_starts: new FormControl( []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl( []),\n\n ignore: new FormControl('', []), // used in case of recurring series edit\n // TODO, there's a few missing from interface BookingFormData, libs/data-common/src/lib/booking/booking.form.data.ts\n });\n\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n constructor(private store: Store,\n // private _service: ApplicationService,\n vcRef: ViewContainerRef, \n private _snackBar: MatSnackBar,\n private _service: ApplicationService,\n ) {\n super(vcRef);\n // if(this._service?.kioskFormFilter) {\n // this.formGroup.setValue({\n // roomSize: roomSizeOptions[3]\n // })\n // }\n }\n\n public ngOnInit(): void {\n\n\n super.ngOnInit();\n // R--- Complicated, need the TZ aware inputs and to not init those inputs until the building timezone is available.\n // R--- See if there's any way to make the timezone retrieval less fragile.\n\n // if we have an active form, refill the information here once.\n // Doesn't run on initial steps, only if you go back to the home page\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set the fromDate correctly\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15); // R--- shouldn't this actually be the current date start of day to make all the options available?\n\n const form = cloneDeep(next);\n this.formGroup.patchValue({\n ...form,\n }, { emitEvent: true });\n\n // this.formGroup.markAllAsTouched();\n // this.formGroup.updateValueAndValidity();\n\n }\n })\n );\n\n // R--- I only see this fire when the modal opens or going to the home page\n this.subscription('formChanges', this.formGroup.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe((next) => {\n const timezone = next.timezone || this.localTimezone\n /**\n * When the selected date changes update the time picker's start time\n * to the nearest available slot of the current day\n */\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15);\n\n /**\n * When the new selected date arrives, update the coachmark displayed below the date time picker\n */\n this.updateCoachmarkTimes(timezone);\n\n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n )\n .subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n public onSubmitForm() {\n if(this.formGroup.controls?.is_recurrent?.value){\n setRecurrenceStartsTime(this.formGroup)\n }\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const is_past = this._checkDateInPast();\n if (is_past) {\n this._service.notifyWarn('Start Time updated to after current time, please click search again.');\n return;\n } else {\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(formGroupData.dateTz.ms),\n dateTz: formGroupData.dateTz.setValue({ millisecond: 0, second: 0 })\n });\n }\n this.formGroup.markAllAsTouched();\n if (this.formGroup.valid) {\n this.submitForm.emit(this.formGroup.value);\n }\n }\n\n // public openSnackBar(message: string, action: string) {\n // this._snackBar.open(message, action, {\n // duration: 5000,\n // panelClass: ['yellow-snackbar']\n // });\n // }\n\n // Fires when the location selector value is changed\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n // deselecting the location option sets the timezone to local so convert.\n const formGroupDate = this.formGroup.value;\n if (!next.length) {\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: this.localTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(this.localTimezone)\n });\n } else {\n const buildingTimezone = next[0]?.meta?.building?.timezone || next[0]?.meta?.city?.timezone;\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: buildingTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(buildingTimezone)\n });\n }\n this._checkDateInPast();\n // Must fire last or location picker will be buggy.\n this.selectedOptions.next(next);\n });\n }\n\n private _checkDateInPast() {\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const date = new DateTZ({ date: this.formGroup.value.dateTz.ms, building_tz: formGroupData.timezone, is_local_tz:false }).addValue({ seconds: 30 })\n const now = DateNow(new Date())\n if (now.isAfterDate(date)) {\n // Reset the start time if in the past\n const closestTz = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: formGroupData.timezone }).addValue({ minutes: 1 }), 15)\n const prevClosestTz = closestTz.subtractValue({minutes: 15})\n const prevDateTz = prevClosestTz.addValue({ seconds: 30 });\n // R-- why do I do this on submit? move to a another method.\n if(now.isAfterDate(prevDateTz)){\n this.fromDateTz = closestTz;\n }else{\n this.fromDateTz = prevClosestTz;\n }\n\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(this.fromDateTz.ms),\n dateTz: this.fromDateTz.setValue({ millisecond: 0, second: 0 })\n });\n return true;\n }\n return false;\n }\n\n private updateCoachmarkTimes(timezone: string) {\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n\n this.fromDateTz = new DateTZ({ date: this.fromDateTz.ms, is_local_tz: false, building_tz: timezone });\n\n if (localTzOffset !== buildingTzOffset) {\n const startDate = this.formGroup.value.dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.formGroup.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n }\n}\n","\n
\n \n\n\n
\n \n\n \n \n \n \n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n\n
\n
\n Recurring booking\n
\n \n \n\n
\n\n \n\n \n \n \n \n \n
","import { Component, ViewEncapsulation, Inject } from '@angular/core';\nimport { BookingFormData, storeBookingFormData, SeriesAction} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Store } from '@ngrx/store';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n// import { Router, ActivatedRoute } from '@angular/router';\n\n@Component({\n selector: 'app-room-booking-modal',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomBookingModalComponent extends BaseDirective {\n public trigger = Date();\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: any ) {\n super();\n }\n\n public triggerSubmit() {\n this.trigger = Date();\n }\n\n public submitForm(next: BookingFormData) {\n /// submit\n\n const ignore = this._data?.action === SeriesAction.EDIT ? next.id : null;\n const bookable = this._data?.action === SeriesAction.EDIT || null;\n\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next,\n ignore, // ignore id in case of recurring edit series\n bookable, // true in case of recurring edit series\n action: this._data?.action || '' // 'edit' in case of recurring edit series\n }\n }));\n this.close('DoNotClearActiveForm'); // do not clear active form if for submit as form need forther in result module\n this._data && this._data.navigateTo && this._data.navigateTo(); // navigate to result in case of staff recurring edit\n\n }\n\n public close(flag: string = '') {\n this.dialogRef.close(flag);\n }\n}\n","import {\n Component,\n OnInit,\n OnDestroy\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n AlertMode,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BaseDirective,\n dateBuildingFormatString,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n User,\n Building,\n BuildingCity,\n IEngineResponse,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectHomepageBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n BookingStoreState,\n BookingFormData,\n clearBookingFormData,\n storeBookingFormData,\n BookingsService\n} from '@mckinsey-converge/data-common';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { Urls } from 'src/app/utilities/urls';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { loadBookingsWithQuery, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n elementAt,\n map,\n take,\n} from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'app-room-booking',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n

Meeting Room Booking

\n
\n \"Booking\n
\n
\n
\n
\n
\n \n \n \n \n
\n
\n
\n

Your Bookings

\n
\n
\n \n
You have no upcoming bookings
\n
\n
\n \n \n
\n
\n \n \n \n \n
\n
\n \n Manage\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-booking.component.scss']\n})\nexport class RoomBookingComponent extends BaseDirective implements OnInit, OnDestroy {\n public TopBarHeaderMode = TopBarHeaderMode;\n public AlertMode = AlertMode;\n\n public width = 16;\n\n // public showBanner = true;\n public showBookings = false;\n public showManageButtonA = false;\n public showManageButtonB = false;\n public showManageButtonC = false;\n public dateString: string;\n\n public homepageBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public pastBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public upcomingBookings: BookingResultsViewModel[];\n public buildings = new BehaviorSubject[]>([]);\n public reloading = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n constructor(private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _bookings: BookingsService,\n private dialog: MatDialog) {\n super();\n this.dateString = dateBuildingFormatString(DateNow(new Date()));\n }\n\n public ngOnDestroy() {\n if (typeof window === 'object') {\n window.onbeforeunload = undefined;\n }\n\t\t\t\t// clear interval\n\t\t\t\tthis.clearInterval('refreshBookings');\n }\n\n public ngOnInit(): void {\n // only run on window onload\n if (typeof window === 'object') {\n window.onbeforeunload = (event) => {\n const e = event || window.event;\n this.store.dispatch(clearBookingFormData())\n return e;\n };\n }\n\n this.store.dispatch(loadOrganisations.request());\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n // console.log('on buildings ')\n // this.refresh('homepage');\n }));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded\n this.currentUser = new User(user);\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, 'target': 'homepage' }));\n // start the timer at the top of the minute;\n // const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n // setTimeout(() => {\n // console.log('on setTimeout ')\n // this.refresh('homepage')\n this.interval('refreshBookings', () => {\n\t\t\t\t\t\t\t\t\t\t\tthis.refresh('homepage')\n\t\t\t\t\t\t\t\t\t\t}, 60 * 1000);\n // }, offset + 5000)\n\n })\n );\n\n this.reloading = true;\n this.subscription('homepageResults', this.store.pipe(\n select(selectHomepageBookingsResultsFromState)\n ).subscribe(next => {\n // this.reloading = true;\n this.homepageBookingResults.next(next);\n if (!next.isEmpty() && next.success && Array.isArray(next.success.results) && next.success.total) {\n this.reloading = false;\n this.showManageButtonA = true;\n this.upcomingBookings = mapResultsToViewModels(next.success.results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n this.allBookings = next.success.results;\n\n if (this.upcomingBookings.length) {\n this.showBookings = true;\n }\n } else {\n this.reloading = false;\n this.showManageButtonA = false;\n this.upcomingBookings = [];\n this.showBookings = false;\n }\n }));\n\n this.subscription('pastResults', this.store.pipe(\n select(selectPastBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonB = true;\n }\n }));\n\n this.subscription('cancelledResults', this.store.pipe(\n select(selectCancelledBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonC = true;\n }\n }));\n }\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return !this.reloading; //|| this.homepageBookingResults.value.hasLoaded();\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return '';\n }\n\n // public hideBanner() {\n // this.showBanner = false;\n // }\n\n public learnMore() {\n window.open(Urls.LearnMore);\n }\n\n public routeToResults(next: BookingFormData) {\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next\n }\n }));\n this.store.dispatch(loadRoomsForResults.clear());\n this.router.navigate(['results'], { relativeTo: this.route });\n }\n\n public routeToManageBookings() {\n this.router.navigate(['manage'], { relativeTo: this.route });\n }\n\n public refresh(target: string) {\n if (!this.currentUser?.email) {\n return;\n }\n\n // tslint:disable-next-line: max-line-length\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, target }));\n }\n\n\n\t\t/**\n\t\t * Displays detailed information about a booking in a modal dialog.\n\t\t * If the booking is part of a recurring series, it retrieves the master booking\n\t\t * details and displays them along with the selected booking. The modal allows\n\t\t * users to view and interact with the booking details. After the modal is closed,\n\t\t * it checks for special flags to determine if the active form and result data should be cleared.\n\t\t *\n\t\t * @param {BookingResultsViewModel} viewModel - The view model containing booking information to display.\n\t\t */\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n\t\t\t// Handle logic for recurring bookings to fetch the master booking details\n \t// and set the master_booking property for displaying in the modal\n\t\t\tif(viewModel.booking.is_recurrent) {\n\t\t\t\t\tlet booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n\t\t\t\t\tif (!booking) {\n\t\t\t\t\t\t\tbooking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n\t\t\t\t\t}\n\t\t\t\t\tthis.master_booking = mapResultsToViewModels([booking])[0];\n\t\t\t}\n\n\t\t\t// Open a modal dialog to display the booking details along with master booking (if applicable)\n\t\t\tconst dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-wide-manage-booking',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tbooking: viewModel.booking,\t// Selected booking information\n\t\t\t\t\t\t\tbuilding: this.getBuilding(viewModel.booking),\t// Building information for the booking\n\t\t\t\t\t\t\tmaster_booking: this.master_booking?.booking || null,\t// Master booking details (if available)\n\t\t\t\t\t\t\trefresh: () => {\n\t\t\t\t\t\t\t\t\tthis.refresh('homepage');\t// Function to refresh the homepage after modal closure\n\t\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t});\n\n\t\t\tdialogRefX.afterClosed().subscribe((flag) => {\n\t\t\t\t// Clear form and result data if the flag indicates it's necessary\n\t\t\t\t\tflag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n\t\t\t});\n }\n\n\t\t/**\n\t\t * Clears active form and result data from the store.\n\t\t *\n\t\t * This function dispatches actions to clear the active form data and the loaded\n\t\t * rooms data from the store. It is typically used after a modal interaction or\n\t\t * a specific user action to reset the form state and loaded room information.\n\t\t */\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n }\n\n\n}\n","import { Component, OnInit } from '@angular/core';\nimport {\n TopBarHeaderMode,\n RoutePayload,\n} from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n Booking,\n User,\n Space,\n BookingFormData,\n selectActiveForm,\n selectFilteredByIdResults,\n BookingStoreState,\n storeBookingFormData,\n DateDurationData,\n OrganisationService,\n SpaceConflictAlertModalData,\n SpaceStatus,\n filterSpacesByAppliedFilters,\n FilteredSpaces,\n Building,\n SpaceFilterReason,\n getLastDateFromList,\n RoomResultsViewModel,\n stringToMinutes,\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n DialogEvent,\n shorterLocalDateFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { distinctUntilChanged, take, throttleTime, tap, filter } from 'rxjs/operators';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { RoomStoreState, loadByIdResults } from '@mckinsey-converge/rooms';\nimport { Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n ConflictAlertModalComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n} from '@mckinsey-converge/ui';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n selector: 'app-room-details',\n templateUrl: './room-details.component.html',\n styleUrls: ['./room-details.component.scss'],\n})\nexport class RoomDetailsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public booking: Booking;\n // @TODO get this from current settings.\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n\n public data = new BehaviorSubject(undefined);\n public byIdResults = new BehaviorSubject(undefined);\n public open: boolean = true;\n // Set to a config once we know where the files are hosted.\n public rootFolderURL = 'assets/img/rooms/';\n // Set in the room availablity callback\n public mobile: boolean = false;\n public expandedLocation: boolean = false;\n public expandedAvailability: boolean = false;\n // Track event date changes in the UI in this param\n public alternativeWeekStartDateTz: DateTZ = new DateTZ();\n /** Current User */\n public currentUser: User;\n /** Display warning banner by default */\n public showInfoBanner: boolean = true;\n /** Space class created from subscribed active form room data */\n public room: Space;\n /** Requested booking start time from subscribed active form data */\n public requestedDateTz: DateTZ;\n /** Requested booking end time from subscribed active form data */\n public requestedEndDateTz: DateTZ;\n\n /** Track alert dialog should display's only once for not bookable or unavailable */\n private isAlertDisplayed: boolean = false;\n /** Update availability status of current rooom */\n public availabilityStatus: string;\n /** Space validity per rule */\n public isSpaceValidAsPerRule: FilteredSpaces;\n\n public orgBuildings: Building[] = [];\n /** Subtype of a room or space. */\n public roomSubtype: string = '';\n\n /* recurrence booking - occurence availability */\n public occurenceAvailability: string = '';\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n constructor(\n private store: Store,\n private router: Router,\n private _org: OrganisationService,\n public dialog: MatDialog\n ) {\n super();\n /**\n * Router extras expecting from\n * On navigation from result or home page after QR code scan\n */\n if ( this.router.getCurrentNavigation() !== null && this.router.getCurrentNavigation().extras?.state?.payload ) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = this.router.getCurrentNavigation().extras.state.payload?.nextBusinessDay\n this.store.dispatch(storeBookingFormData({\n payload: this.router.getCurrentNavigation().extras.state.payload,\n })\n );\n }\n }\n\n public ngOnInit(): void {\n this.availabilityStatus = 'unavailable';\n this.orgBuildings = this._org.buildings;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = next?.nextBusinessDay || false;\n\n this.data.next(next);\n // R--- selectedRoom could sure use some clarity, why is everything but the kitchen sink in there?\n if (!this.data.value?.selectedRoom || !this.data.value?.dateTz.ms) {\n return;\n }\n // Create a full fledged Space object since the selectedRoom.space is just JSON\n this.room = new Space(this.data.value?.selectedRoom?.space);\n\n // Check room validtion of selected room to maintain status on detail page\n this.checkAvailabiltyAsPerRule();\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n\n // Query for the entire day for this room\n this.fetchRooms(false);\n this.setRoomSubType();\n\n this.requestedDateTz = this.data.value?.dateTz;\n if (next.is_recurrent) {\n const { is_local_tz, building_tz} = this?.data?.value?.dateTz;\n const endDateTz = getLastDateFromList( this?.data?.value?.recurrence_starts );\n const endDate = new DateTZ({ date: endDateTz.date.valueOf(), is_local_tz, building_tz }) \n // add one day if user room selection from next business day section on result page\n this.requestedEndDateTz = this.nextBusinessDay ? endDate.addValue({ minutes: this.data?.value.offset }) : endDate;\n\n this.occurenceAvailability = `${this?.room?.availableOccurrences} out of ${this?.room?.totalOccurrences}`;\n }\n }\n })\n );\n\n this.subscription(\n 'byId',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n this.byIdResults.next(\n next.success?.spaces?.length\n ? next.success.spaces[0].settings.bookings\n : EMPTY_ARRAY\n );\n })\n );\n\n const breakpoint = 450;\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n )\n .subscribe();\n }\n\n public setRoomSubType() {\n //test\n const room_type = `${this?.room.internal_or_external}_room_types`;\n const temp: string = Array.isArray(this?.room?.room_type)\n ? this?.room?.room_type[0]\n : this?.room?.room_type;\n const type = this?._org?.getOrganizationFiltersByRoomType(room_type)[temp];\n this.roomSubtype = type !== undefined ? `( ${type} Room )` : '';\n }\n\n public isConflictWithOccurences() {\n const conflicts = this?.room?.totalOccurrences - this?.room?.availableOccurrences;\n return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n }\n\n /**\n\t\t * Opens a modal to display recurrence conflicts for a given room.\n\t\t *\n\t\t * @param {Space} room - The room for which recurrence conflicts are being displayed.\n\t\t *\n\t\t * This function opens a modal dialog to show recurrence exceptions (conflicts)\n\t\t * for the specified room.\n\t\t *\n\t\t * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n\t\t */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(\n ConflictsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n },\n }\n );\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t\t/**\n\t\t * Retrieves the end date string for the booking, considering recurrence if applicable.\n\t\t * If the booking is recurrent.\n\t\t *\n\t\t * @returns {string} The formatted end date string in a shorter local date format.\n\t\t */\n\t\t public get endDateString(): string {\n\t\t\t// if this.requestedEndDateTz is not in use anywhere here in this file than remove that property and use const here\n\t\t\tif(!this.requestedEndDateTz) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn this.requestedEndDateTz.formatDate('ccc d MMM yyyy'); // shorterLocalDateFormatString(this.requestedEndDateTz);\n\t\t}\n\n /**\n * Functino to check if room is available as per room/user rules\n */\n public checkAvailabiltyAsPerRule() {\n this.orgBuildings =\n !this.orgBuildings.length && this.data.value?.buildings\n ? this.data.value?.buildings\n : this.orgBuildings;\n this.isSpaceValidAsPerRule = filterSpacesByAppliedFilters(\n [],\n [this.room],\n this.data.value,\n this.orgBuildings,\n this.currentUser\n );\n }\n\n /**\n * Function popup advise alert dialog if scanned (QR code) room details found conflicts with other booking/s\n * @param room\n */\n alertIfItHasConflict(isBookable, isAvailable) {\n this.isAlertDisplayed = true;\n const data = {\n headerText: !isBookable\n ? SpaceConflictAlertModalData.NotBookableHeaderText\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableHeaderText\n : '',\n message:\n this.isSpaceValidAsPerRule.specificReason === SpaceFilterReason.OfficeRules\n ? SpaceConflictAlertModalData.NotBookableDueToOfficeRule\n : !isBookable\n ? SpaceConflictAlertModalData.NotBookableMessage\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableMessage\n : '',\n buttonLabel: !isBookable\n ? SpaceConflictAlertModalData.NotBookableButtonLabel\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableButtonLabel\n : '',\n callback: !isBookable\n ? this.goToBackRoute.bind(this)\n : !isAvailable\n ? this.expandAvailability.bind(this, true)\n : null,\n shouldClose: isBookable,\n };\n const dialog = this.dialog.open(ConflictAlertModalComponent, {\n data: data,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n disableClose: !isBookable,\n });\n }\n\n public warnIfItHasConflict({ room: room, hasConflict: hasConflict }) {\n if (\n (!room.bookable || !this.isSpaceValidAsPerRule.spaces.length) &&\n !this.isAlertDisplayed\n ) {\n // room is not bookable(not available to book) and no warning dialog displayed yet\n this.alertIfItHasConflict(false, true);\n this.updateAvailabilityStatus(SpaceStatus.Unavailable);\n } else if (!room.available && hasConflict && !this.isAlertDisplayed) {\n //room is not available AT THIS TIME to book (booked) and has conflict with other booking and no warning dialog displayed yet\n this.alertIfItHasConflict(room.bookable, !hasConflict); // (true, true/false)\n this.updateAvailabilityStatus(SpaceStatus.Booked);\n } else {\n /**\n * Update status of availability - Uavailable/Booked/Requestable/Bookable\n * If room is not bookable(not available to book) and warning dialog dispalyed once\n * If room is bookable but not available to boot AT THIS TIME (or and has conflict with other booking) and warning dialog displayed once\n * If room is bookable and availanle to book AT THIS TIME then check the type of room Requestable? or Bookable\n */\n const status =\n !room.bookable || !this.isSpaceValidAsPerRule.spaces.length\n ? SpaceStatus.Unavailable\n : !room.available && hasConflict\n ? SpaceStatus.Booked\n : this.is_request\n ? SpaceStatus.Requestable\n : SpaceStatus.Bookable;\n this.updateAvailabilityStatus(status);\n }\n }\n\n public updateAvailabilityStatus(primaryCheck: string, secondaryCheck?: string) {\n this.availabilityStatus =\n primaryCheck !== ''\n ? primaryCheck\n : this.data.value.is_recurrent ||\n ['unavailable', 'booked'].indexOf(this.availabilityStatus) === -1\n ? secondaryCheck\n : this.availabilityStatus;\n }\n\n public get catering(): string {\n return (\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.start })\n .formatDate('ha')\n .toLocaleLowerCase() +\n ' - ' +\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.end })\n .formatDate('ha')\n .toLocaleLowerCase()\n );\n }\n\n public get dateString(): string {\n\t\t\t\tif(!this.requestedDateTz) return '';\n return this.requestedDateTz.formatDate('ccc d MMM yyyy');; //shorterLocalDateFormatString(this.requestedDateTz);\n \n }\n\n public get focusedRoomMapKey(): string {\n return `area-${this.room?.map_id}-status`;\n }\n\n /** Whether we are only allowed to 'request' the selected space */\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n const isRequest = space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser,\n });\n this.updateAvailabilityStatus(\n '',\n isRequest ? SpaceStatus.Requestable : SpaceStatus.Bookable\n );\n return isRequest;\n }\n\n public get roomFeatures(): string[] {\n // const room_type = `${this.room.internal_or_external}_room_types`\n const combinedFeatures = {\n // ...this._org.getOrganizationFiltersByRoomType(room_type),\n ...this._org.getOrganizationFiltersByRoomType('equipment_types'),\n };\n const features = this.room !== undefined ? this.room?.featuresArray.map(\n (feature: string) => combinedFeatures[feature]\n ) : [];\n\n return [...new Set(features)].filter((f) => !!f);\n }\n\n public get roomHasCatering() {\n // Building scope catering available is true or false\n const building = this.data.value?.selectedRoom?.building;\n let hasCatering = building ? building.has_catering : false;\n // but if Room catering is false it overrides the building\n if (this.room?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n }\n\n public get roomImagesFileSlug(): string {\n return this.room?.email.split('@')[0];\n }\n\n public get mapUrl(): string {\n return this.room?.level?.map_url;\n }\n\n public get timeString(): string {\n\t\t\tif(!this.requestedDateTz) return '';\n\t\t\treturn startEndTimeWithZoneFormatString(\n\t\t\t\t\tthis.requestedDateTz,\n\t\t\t\t\tthis.requestedDateTz.addValue({ minutes: this.data.value?.duration })\n\t\t\t);\n }\n\n /**\n * Get the timezone form the subscribed activeForm\n */\n public get timezone(): string {\n // R--- this.room.timezone wasn't reliable enough on page refresh, something to look into\n return this.data.value.selectedRoom?.building.timezone;\n }\n\n public setAlternativeWeekStartDate(bookingDate: DateTZ) {\n if (!bookingDate) {\n return;\n }\n\n const booking_date = bookingDate.clone();\n if (this.mobile) {\n this.alternativeWeekStartDateTz = booking_date;\n } else {\n this.alternativeWeekStartDateTz = booking_date.startOfValue('week');\n }\n }\n\n public updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n this.alternativeWeekStartDateTz = alternativeWeekStartDateTz;\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n }\n\n public confirmChanges(data: DateDurationData) {\n // R-- refactor room-availability-preview to return DateTZ so setAlternativeWeekStartDate can use it.\n this.mobile = data.mobile;\n this.setAlternativeWeekStartDate(data.dateTz);\n\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n dateTz: data.dateTz,\n duration: data.duration,\n },\n })\n );\n }\n\n public fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n if (!this.room?.id) {\n return;\n }\n\n const day = 24 * 60;\n const week = day * 7;\n\n let start_date = (alternativeWeekStartDateTz || this.data.value.dateTz).clone();\n if (allWeek && start_date.dateWeekday !== 7) {\n start_date = start_date.startOfValue('week');\n }\n\n const startOfDay = start_date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = start_date.setValue({ second: 0, millisecond: 0 }).startOfValue('day');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.room?.id,\n capacity: this.data.value?.roomSize.value,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public removeDateOffset() {\n const data = this.data.value;\n let { dateTz, offset } = data;\n dateTz = dateTz.subtractValue({ minutes: ((typeof offset === 'string' && offset == '') || (typeof offset === 'undefined')) ? 0 : Number(offset) });\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...data,\n dateTz: dateTz,\n offset: 0,\n },\n })\n );\n }\n\n public goToBackRoute() {\n this.removeDateOffset();\n this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n public expandMap(open: boolean) {\n this.expandedLocation = open;\n }\n\n public expandAvailability(open: boolean) {\n this.fetchRooms(!this.mobile);\n this.expandedAvailability = open;\n }\n\n public handleClose() {\n this.expandedLocation = false;\n this.expandedAvailability = false;\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n this.fetchRooms(false);\n }\n\n /**\n * Continue to Booking Form\n */\n public bookRoom() {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n },\n })\n );\n\n const bookingRoute = this.data.value.id ? 'edit' : 'create';\n this.router.navigate(['/home', bookingRoute]);\n }\n\n public hideInfoBanner() {\n this.showInfoBanner = false;\n }\n}\n","
\n
\n \n \n
\n
\n \n

This room is not guaranteed until booking confirmation is received.

\n \n
\n
\n \n

This time slot is not available, drag or choose a diferent date or time.

\n
\n
\n
\n \n
\n
\n
\n {{ availabilityStatus | titlecase }} {{ occurenceAvailability }}\n
\n
\n

{{room?.local_name}}

{{data.value?.bookingType.display}}
\n \n
\n
\n \n Equipment\n
    \n
  • \n {{feature}}\n
  • \n
\n
\n
\n
\n \n Catering Available\n
    \n
  • {{catering}}
  • \n
  • (specified in the last booking step)
  • \n
\n
\n
\n
\n
\n
\n

Room Availability:

\n

{{dateString}}

\n \n
\n \n
\n
\n
\n

Room Location:

\n

{{room?.building?.name}}, {{room?.level?.name}}

\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n {{ open ? '(tap to close)' : '(tap to open)'}}\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Detail

\n
\n\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
\n
\n
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' :\n data?.value?.recurrence_period | titlecase}}\n -\n Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{dateString}}
\n
End date: {{endDateString}}
\n
Time: {{timeString}}
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n instantBookOptions,\n roomDetailsRequired,\n roomEquipmentRequiredOptions,\n selectFormFilters,\n selectIsInternal,\n roomCateringAvailable,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map,\n take\n} from 'rxjs/operators';\n\n@Component({\n selector: 'app-room-filters-form',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-form.component.scss']\n})\nexport class RoomFiltersFormComponent extends BaseDirective implements OnInit {\n\n public instantBookOptions = instantBookOptions;\n public roomEquipmentRequiredOptions = roomEquipmentRequiredOptions;\n public roomDetailsRequired = roomDetailsRequired;\n public roomCateringAvailable = roomCateringAvailable;\n public internalRoomTypeRequiredOptions = [];\n public externalRoomTypeRequiredOptions = [];\n public isInternal = false;\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n @Output()\n public cancelSubmit = new EventEmitter();\n\n @Output()\n public filtersSubmit = new EventEmitter[]>();\n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('bookingType',\n this.store.pipe(\n select(selectIsInternal)\n ).subscribe(next => {\n this.isInternal = next;\n }));\n this.subscription('filters',\n this.store.pipe(\n select(selectFormFilters)\n ).subscribe(next => {\n this.selectedOptions.next(next);\n }));\n\n this.externalRoomTypeRequiredOptions = this.getFilters('external_room_types')\n this.internalRoomTypeRequiredOptions = this.getFilters('internal_room_types')\n }\n\n public toggleOptionChecked(selectOption: SelectOption) {\n this.selectedOptions.pipe(\n take(1),\n map(options => {\n const found = options.find(o => o.value === selectOption.value);\n if (found) {\n // remove\n return options.filter(o => o.value !== selectOption.value);\n }\n // add\n return [...options, selectOption];\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n public submitFilters() {\n this.selectedOptions.pipe(\n take(1)\n ).subscribe(options => {\n this.filtersSubmit.emit(options);\n });\n }\n\n public getFilters(type:string) {\n const filters = this._org.getOrganizationFiltersByRoomType(type) || {}\n return Object.keys(filters).map((key) => {\n const display = filters[key]\n return {\n value: key,\n display,\n shortDisplay: display\n }\n })\n }\n}\n","import {\n Component,\n ViewChild\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { Store } from '@ngrx/store';\nimport { storeRoomFilters } from '@mckinsey-converge/data-common';\nimport { RoomFiltersFormComponent } from 'src/app/booking/room-filters-form/room-filters-form.component';\n\n@Component({\n selector: 'app-room-filters',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-modal.component.scss']\n})\nexport class RoomFiltersModalComponent {\n\n @ViewChild(RoomFiltersFormComponent)\n public form: RoomFiltersFormComponent;\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n\n public submitFilters(filters: SelectOption[]) {\n this.store.dispatch(storeRoomFilters({\n payload: filters\n }));\n this.close();\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n OnChanges,\n EventEmitter,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n combineLatest,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n CENTER_POINT,\n generateMapStyleForSpace,\n legendOptions,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n spaceToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n SpaceStatus,\n selectMapFilteredResults,\n FilteredSpaces\n} from '@mckinsey-converge/data-common';\nimport {\n Point,\n HashMap,\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport { MapSearchStoreState } from '../../map/map-search/map-search.component';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\n@Component({\n selector: 'room-location-preview',\n template: `\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n {{building.name}}, {{level.name}}\n
\n \n
\n
The pinpoint indicates your selected room's location on the floor. No futher interaction is available.
\n \n
\n
\n \n
\n \n \n
\n \n
\n
\n\n\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./room-location-preview.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomLocationPreviewComponent extends BaseDirective implements OnInit, OnChanges {\n public legendOptions = legendOptions();\n\n @Input()\n public mapUrl: string;\n\n @Input()\n public focus: any; // @todo fix\n\n @Input()\n public expanded: boolean;\n\n @Input()\n public building: Building;\n\n @Input()\n public space: Space;\n\n @Input()\n public level: any; // @todo fix\n\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n\n // Use \"booking_preview\" to show smaller height with zoom icon\n @Input() public viewMode: String = null;\n\n @Output()\n public handleExpand: EventEmitter = new EventEmitter();\n\n public currentPage: string;\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get zoomLevel() {\n return this.expanded ? this.minZoom.value : this.zoom.value;\n }\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService) {\n super();\n }\n\n public focusedRoom = new BehaviorSubject(undefined);\n public featuresRoom = new BehaviorSubject(undefined);\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public minZoom = new BehaviorSubject(MAX_ZOOM_LEVEL / 3);\n public features = combineLatest([this.featuresRoom]).pipe(map(items => items.filter(i => !!i)));\n public setIntervalHandle: any = null;\n public count = 0;\n public center = new BehaviorSubject(CENTER_POINT);\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n public ngOnChanges(changes: any): void {\n if (changes.expanded && changes.expanded.currentValue) {\n this.activeSpace.pipe(\n take(1),\n filterUndefined(),\n map(spaceToMapFeature)\n ).subscribe(next => {\n this.featuresRoom.next(next);\n });\n } else if (changes.expanded && changes.expanded.previousValue && !changes.expanded.currentValue) {\n this.featuresRoom.next(undefined);\n }\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n\n // MCK-1850 And it's even slower when loading form scratch via an email link, so 10 second interval.\n this.timeout('Zoom to Room', () => this.initMapZoom(), 2000);\n this.activeSpace.next(this.space);\n this.activeBuilding.next(this.building);\n this.activeLevel.next(this.level);\n\n this.subscription('bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined())\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || [])\n .filter(s => !!s.map_id && s.zones.includes(building.id) && s.zones.includes(level.id));\n\n const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach(space => {\n // const status = filteredSpaces.statusMap[space.id] || SpaceStatus.Available;\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // });\n this.style_map.next(styles);\n \n })\n );\n\n }\n\n public initMapZoom() {\n const self = this;\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n // But this alone is not enough when loading from an email link due to how slow the loading is. See the ngOnInit\n this.setIntervalHandle = setInterval(() => {\n if (!this.focus) {\n return;\n }\n \n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 1000);\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public zoomToRoom(): void {\n this.focusedRoom.next(this.focus);\n this.zoom.next(MAX_ZOOM_LEVEL);\n }\n\n public zoomIn() {\n if (this.minZoom.value < MAX_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.minZoom.value > MIN_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value - 1);\n }\n }\n\n public resetZoomLevels() {\n this.minZoom.next(MIN_ZOOM_LEVEL);\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n const self = this;\n self.count = 0;\n\n this.zoom.next(MAX_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n this.setIntervalHandle = setInterval(() => {\n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 200);\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent,\n {\n data: this.building,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport { ApplicationService, BookingFormData, RoomResultsViewModel, setupRoomImages, User } from '@mckinsey-converge/data-common';\nimport { ImageDirective, SpaceImageObject } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-room-result-item',\n template: `\n
\n
\n
\n
\n {{ availability === 'requestable' ? 'Requestable' : 'Bookable'}}\n {{ viewModel?.space?.availableOccurrences }} out of {{ viewModel?.space?.totalOccurrences }} \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n
\n \n {{viewModel.levelDisplay}}, {{viewModel.title}}\n {{type}}\n {{viewModel.office}}\n {{viewModel.capacity}}\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-result-item.component.scss']\n})\nexport class RoomResultItemComponent extends ImageDirective implements OnInit, OnChanges {\n\n public rootFolderURL: string = 'assets/img/rooms/';\n public fileSlug: string = '';\n public type: string = '';\n\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: RoomResultsViewModel | undefined;\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public user: User;\n\n @Output()\n public roomSelect = new EventEmitter();\n\n public availability: \"requestable\" | \"bookable\" | \"booked\" | \"non-bookable\" | null;\n\n public foundImages: SpaceImageObject[] = [1,2].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n constructor(\n private _appService: ApplicationService) {\n super();\n }\n\n public ngOnInit(): void {\n if (this.viewModel && this.viewModel.space) {\n this.fileSlug = this.viewModel.space.email.split('@')[0];\n setupRoomImages(this, [1,2], this.rootFolderURL, this.fileSlug);\n const t = this.viewModel.space.internal_or_external;// || 'internal';\n this.type = `${t[0]?.toUpperCase()}${t.toLocaleLowerCase().substring(1)}`\n\n // Set the viewing space in the app service so that the staff result page can receive event on loading previously selected room card \n // which will help to scroll to the selected room\n if(this.viewModel.space.id === this.data.selectedRoom?.space?.id) {\n this._appService.set('STAFF.result.card.viewing', this.viewModel.space.id);\n }\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (this.availability !== null && (\n changes.data &&\n changes.data.firstChange === true &&\n changes.data.currentValue &&\n changes.data.currentValue.dateTz &&\n changes.data.currentValue.duration\n )) {\n this.availability = this.viewModel.space.byRequest({\n dateTz: this.data.dateTz,\n duration: this.data.duration,\n host: this.user\n }) === false ? \"bookable\" : \"requestable\";\n\n }\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public get typeClass() {\n return this.type.toLocaleLowerCase();\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n }\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n NgZone,\n OnInit,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable\n} from 'rxjs';\nimport {\n RoomResultsViewModel,\n BookingFormData,\n BookingStoreState,\n selectActiveForm,\n storeBookingFormData,\n SpaceFilterReason,\n User,\n OrganisationService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n map,\n take,\n distinctUntilChanged\n} from 'rxjs/operators';\nimport {\n AlertBannerDisplay,\n AlertMode,\n BaseTemplateComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n\t\tOverrideChangesModalComponent\n} from '@mckinsey-converge/ui';\nimport { RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n RoomStoreState\n} from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-room-results-paginated',\n template: `\n \n
\n
\n \n \n \n \n \n \n \n \n \n\n
\n \n
\n
\n \n \n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-results-paginated.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RoomResultsPaginatedComponent extends BaseTemplateComponent implements OnInit {\n public ROOM_DISPLAY_STEP = 10;\n public ROOM_DISPLAY_START = 3;\n public AlertMode = AlertMode;\n public AlertBannerDisplay = AlertBannerDisplay;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n @Input()\n public viewModels: Observable;\n\n @Input()\n public coachMark: Observable | undefined;\n\n /**\n * If true, show skeleton.\n */\n @Input()\n public isLoading: Observable;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay = false;\n\n @Input() public expanded_section_ids: string[] = [];\n @Input() public headerTitle: string = '';\n\n public displayCount = new BehaviorSubject(this.ROOM_DISPLAY_START);\n\n /**\n * Fake pagination since API does not support it.\n */\n public displayViewModels: Observable;\n\n public showLoadMore: Observable;\n\n public remainingResults: Observable;\n\n public data = new BehaviorSubject(undefined);\n public currentUser: User;\n noOfResultLoaded: number;\n\n constructor(vcRef: ViewContainerRef,\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _appService: ApplicationService,\n private cdRef: ChangeDetectorRef,\n private _dialog: MatDialog) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n //test commet for to trigger build again\n this.displayViewModels = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => { this.cdRef.markForCheck(); return vm?.slice(0, displayCount) } ));\n\n this.showLoadMore = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => {\n return ((vm?.length ?? 0) > displayCount);\n })\n );\n this.remainingResults = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => vm && (vm.length - displayCount) || 0));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.data.next(next);\n this.cdRef.detectChanges();\n\n }\n }));\n\n\n\n // Load more results if the section is expanded previously and the data is loaded \n const shouldLoadMore = this.data?.value?.expanded_section_ids?.includes(this?.headerTitle?.split('(')[0].split(' ').join('_'));\n if( this.showLoadMore && this?.data?.value?.resultLoaded && shouldLoadMore) {\n this.loadMore();\n } \n \n // Scroll to the selected room card if the user has selected a room from section previously \n this.subscription(\n 'viewing',\n this._appService\n ?.listen('STAFF.result.card.viewing')\n ?.subscribe((event) => {\n // Scroll to the selected room card \n if(event === this.data?.value?.selectedRoom?.space.id) {\n const spaceId = this.data?.value?.selectedRoom?.space.id;\n document.querySelectorAll(`[space-name=\"${spaceId}\"]`)[0].scrollIntoView();\n }\n \n })\n );\n\n this.cdRef.detectChanges();\n }\n\n public loadMore(isDom: boolean = false) {\n // fake pagination\n const previouslyLoadedCount = this.data.value.resultLoaded || 0; // previously loaded results count\n this.displayCount.pipe(\n take(1),\n // if the data is loaded from the dom then do not reset the count to previously loaded count\n map(v => (previouslyLoadedCount && !isDom) ? previouslyLoadedCount : v + this.ROOM_DISPLAY_STEP)\n ).subscribe(next => {\n this.displayCount.next(next);\n this.noOfResultLoaded = next;\n this.cdRef.detectChanges();\n });\n }\n\n\n public trackViewModelById(index: number, item: RoomResultsViewModel) {\n return item.space.id;\n }\n\n\n\t\t/**\n\t\t * Handles the selection of a room from the search results.\n\t\t * Depending on the room's availability and recurrence conflicts, this function decides\n\t\t * whether to open a modal for recurrence conflicts, override changes, or navigate to the\n\t\t * room details page. It updates the state and user interface accordingly.\n\t\t *\n\t\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t\t * @param {number} availableOccurrences - The number of available occurrences of the room.\n\t\t * @param {number} totalOccurrences - The total number of occurrences of the room.\n\t\t */\n public roomSelected(room: RoomResultsViewModel, availableOccurrences: number, totalOccurrences: number) {\n\n const { is_recurrent } = this.data.value;\n this.data.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.data.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\t\t// Determine the action based on recurrence conflicts, occurrence edits, and room availability\n\t\tif(this.data.value.recurrence_exceptions.length) {\n this.openRecurrenceConflictsModal(room);\t// Open modal for recurrence conflicts\n }\n else if( this.data.value.occurrence_edits && this.data.value.occurrence_edits.length) {\n this.overrideChanges(room);\t// Open modal to override changes\n }\n else {\n this.goToRoomDetail(room);\t// Navigate to the room details page\n }\n\n }\n\n /**\n * Navigates to the room details page for the selected room.\n * It updates the URL and navigates to the room details page with appropriate query parameters.\n *\n * @param {RoomResultsViewModel} room - The selected room from the search results.\n *\n * @remarks\n * The function manages timezone offset and other necessary details to provide accurate room information.\n * The state object is used to pass relevant data for correct page rendering and form population.\n *\n * @private\n */\n private goToRoomDetail(room) {\n this.cdRef.detectChanges();\n\t\t\t// Handle timezone offset for accurate date and time information\n let { dateTz } = this.data.value;\n if (this.offset) {\n dateTz = dateTz.addValue({ minutes: this.offset });\n }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.data.value.booking.room is not and does not contain the timezone\n * this.data.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.data.value,\n buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: this.offset,\n selectedRoom: room,\n nextBusinessDay: this.nextBusinessDay,\n expanded_section_ids: this.expanded_section_ids,\n resultLoaded: this?.expanded_section_ids?.length ? this.noOfResultLoaded : 0\n }\n }});\n }\n\n\n /**\n\t * Opens a modal to display recurrence conflicts for the selected room.\n\t * It shows recurrence conflicts, allowing the user to resolve them before proceeding.\n\t * After the modal is closed, it navigates to the room details page if there are no unresolved conflicts.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private openRecurrenceConflictsModal(room: RoomResultsViewModel) {\n let { recurrence_exceptions } = this.data.value;\n\n\t\t// Open modal for recurrence conflicts\n const recurr_ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.space.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n\n\t\t\t\tif (event.reason === 'done' && !(this.data.value.occurrence_edits && !this.data.value.occurrence_edits.length) ) {\n this.goToRoomDetail(room); \t// Navigate to room details page after resolving conflicts\n\t\t\t\t}\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t/**\n\t * Opens a modal to allow the user to override changes made to the booking.\n\t * It provides options to confirm or cancel the override, depending on user preference.\n\t * After the modal is closed, it navigates to the room details page if the user confirms the override.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private overrideChanges(room: RoomResultsViewModel) {\n\t\t// Open modal for overriding changes made to the booking\n const ref = this._dialog.open(OverrideChangesModalComponent, {\n width: '576px',\n data: {\n edits: this.data.value.occurrence_edits,\n timezone: this.data.value.timezone\n }\n });\n ref.componentInstance.event.subscribe(event => {\n if (event.reason === 'done') {\n this.goToRoomDetail(room);\t// Navigate to room details page after confirming the override\n ref.close();\n } else if (event.reason === 'close') {\n ref.close();\n }\n });\n }\n\n\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, Observable, of, Subject } from 'rxjs';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { distinctUntilChanged, filter, map } from 'rxjs/operators';\nimport { BookingRulesLink, RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n Building,\n BuildingLevel,\n mapResultsToViewModels,\n RoomResultsViewModel,\n FilteredSpaces,\n SpaceFilterReason,\n selectActiveForm,\n BookingStoreState,\n BookingFormData,\n OrganisationService,\n storeBookingFormData,\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { select, Store } from '@ngrx/store';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n\n@Component({\n selector: 'app-room-results-section',\n template: `\n
\n \n
\n\n \n \n \n\n \n \n \n \n `,\n styleUrls: ['./room-results-section.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class RoomResultsSectionComponent extends BaseDirective implements OnInit {\n @Input() public rules_link?: BookingRulesLink;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay : boolean = false\n\n @Input()\n public collapsable: boolean;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseTitle: string;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseDescription: string;\n\n @Input()\n public levelBuildings: Observable<{ flattenedLevels: BuildingLevel[]; buildings: Building[] }>;\n\n @Input()\n public results: BehaviorSubject>;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n public mainResultViewModels = new BehaviorSubject(\n undefined\n );\n\n public editing_form = new BehaviorSubject(false);\n\n public resultsLoading: Observable;\n public coachMarkDisplay: Observable;\n\n public AlternateBuildings = [];\n public location: any;\n\n public activeForm: BookingFormData; // active form data\n public expanded_section_ids: string[] = []; // expanded section ids\n\n\n private subscribeResultsToViewModels = (\n subName: string,\n resultsObservable: Observable>,\n flattenLevelBuildings: Observable<{ flattenedLevels: any; buildings: Building[] }>,\n viewModelSubject: Subject\n ) => {\n this.subscription(\n subName,\n combineLatest([\n resultsObservable.pipe(map((r) => r.optionalSuccess?.spaces || [])),\n flattenLevelBuildings,\n ])\n .pipe(\n map(([results, { flattenedLevels, buildings }]) =>\n mapResultsToViewModels(\n results?.length && results[0]?.building ? results : [],\n flattenedLevels,\n buildings\n )\n )\n )\n .subscribe((next) => {\n viewModelSubject.next(next);\n })\n );\n };\n \n \n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.resultsLoading = this.results.pipe(map((m) => m.isLoading));\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.location = next.location;\n this.updateCoachMark();\n this.activeForm = next;\n } else {\n }\n })\n );\n\n this.subscription(\n 'buildings',\n this._org.listen('buildings').subscribe(() => {\n this.updateCoachMark();\n })\n );\n\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n\n // Update opened section id and send it to child component\n private updateSectionIdOnOpen (event: { status: string; id: string }) {\n // if status is opened, then push to the expanded_section_ids in the store otherwise remove from the store\n if (event.status === 'opened') {\n const ids = this.activeForm?.expanded_section_ids ? this.activeForm?.expanded_section_ids : [];\n // Remove duplicates and add the new id to the list \n this.activeForm.expanded_section_ids = Array.from(new Set([...ids, event.id]));\n \n } else if (event.status === 'closed'){\n // Remove the id from the list \n this.activeForm.expanded_section_ids = this.activeForm?.expanded_section_ids.filter(\n (id) => id !== event.id\n )\n }\n }\n \n\n updateCoachMark() {\n const buildingsInSameCity = this._org.buildings?.filter(_ => {\n // Make sure this.location is populated to pass unit tests -\n if (!this.location || this.location.length === 0) return false;\n // If all offices are selected, city name will be at this.location[0]?.meta?.city.name, otherwise use this.location[0]?.meta?.city \n const cityFromLocation = typeof this.location[0]?.meta?.city === 'object' && this.location[0]?.meta?.city !== null\n ? this.location[0]?.meta?.city.name\n : this.location[0]?.meta?.city;\n return _.city === cityFromLocation;\n });\n const AlternateBuildings = buildingsInSameCity?.filter(\n (building) =>\n !this.location.some(\n (locationItem) => locationItem.meta?.building?.id === building.id\n )\n );\n this.AlternateBuildings = AlternateBuildings;\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.results || changes.levelBuildings || changes.mainResultViewModels) {\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n this.coachMarkAction.emit(reason);\n }\n}\n","import { SpaceFilterReason } from '@mckinsey-converge/data-common';\n\nexport interface BookingRulesLink {\n name: string;\n url: string;\n}\nexport class RoomResultsCoachmarkViewmodel {\n public visible: boolean;\n public title: string;\n public actionButtonText: string;\n\n constructor(public reason: SpaceFilterReason, public rules_link?: BookingRulesLink, alternateBuildings?:any[]) {\n this.visible = true;\n switch (reason) {\n case SpaceFilterReason.DateTime:\n this.title =\n 'There are no available rooms that match your search criteria. ' +\n 'Please adjust your search criteria and try again.';\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.OfficeRules:\n this.title =\n `There are no available rooms that match your search criteria.\n Please adjust your search criteria and try again.`;\n if (alternateBuildings && alternateBuildings.length > 0) {\n this.title += ` Alternatively, you can try ${alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n }\n if (rules_link) {\n this.title +=\n `
For information on booking rules please see ` +\n `${rules_link.name}`;\n }\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.Filters:\n this.title =\n 'No rooms available for your filter criteria. ' +\n 'Try to clear the filter please.';\n this.actionButtonText = 'Clear filter';\n break;\n case SpaceFilterReason.AlternateBuildingsFound:\n this.title = `There are no available rooms that match your search criteria. Please try ${\n alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.None:\n this.visible = false;\n this.title = '';\n this.actionButtonText = '';\n break;\n }\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n laterThatDayFromDateTz,\n loadRoomsWithQuery,\n RoomStoreState,\n mapRoomToSelectOption,\n loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { BaseDirective, timeWithZoneFormatString } from '@mckinsey-converge/base';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport {\n Building,\n BuildingLevel,\n flattenBuildingsWithLevels,\n BookingStoreState,\n FilteredSpaces,\n SpaceFilterReason,\n clearRoomFilters,\n selectActiveForm,\n selectFilteredLaterDayResults,\n selectFilteredNextDayResults,\n selectFilteredResults,\n selectFormFilters,\n BookingFormData,\n roomFormDataToQuery,\n selectFilteredDiffSizeResults,\n OrganisationService,\n CollapseService\n} from '@mckinsey-converge/data-common';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { debounceTime, distinctUntilChanged, filter, map, shareReplay } from 'rxjs/operators';\nimport {\n buildingStateSelector,\n BuildingStoreState,\n loadBuildings,\n} from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport { filterUndefined, resultCountObservable } from '@mckinsey-converge/rx-utils';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { RoomBookingModalComponent } from 'src/app/booking/room-booking-modal/room-booking-modal.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\nimport {\n BookingRulesLink,\n RoomResultsCoachmarkViewmodel,\n} from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { FormControl } from '@angular/forms';\nimport { Location } from '@angular/common';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-room-results',\n template: `\n \n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n {{ open ? '(tap to close)' : '(tap to open)' }}\n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n `,\n styleUrls: ['./room-results.component.scss'],\n animations: [\n trigger('collapseHeight', [\n state(\n 'open',\n style({\n height: '*',\n opacity: 1,\n })\n ),\n state(\n 'closed',\n style({\n overflow: 'hidden',\n opacity: 0,\n height: '0px',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n trigger('expandWidth', [\n state(\n 'open',\n style({\n maxWidth: '1024px',\n })\n ),\n state(\n 'closed',\n style({\n maxWidth: '96%',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class RoomResultsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public day_offset = 1;\n\n public data = new BehaviorSubject(undefined);\n public filters = new BehaviorSubject[]>([]);\n\n public mainResults = new BehaviorSubject>(LoadingModel.empty());\n public mainResultsFiltered = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public laterThatDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public nextBusinessDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public diffSizeResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public mainResultsSpaces: SelectOption[];\n\n public laterThatDayDisplay = new BehaviorSubject(undefined);\n\n public mainCoachMarkDisplay = this.mainResults.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map((r) => new RoomResultsCoachmarkViewmodel(r, this.rules_link))\n );\n\n public rules_link?: BookingRulesLink;\n\n public mainResultsCount = resultCountObservable(\n this.mainResultsFiltered,\n this.mainResultsFiltered.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public laterThatDayCount = resultCountObservable(\n this.laterThatDayResults,\n this.laterThatDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public nextBusinessDayCount = resultCountObservable(\n this.nextBusinessDayResults,\n this.nextBusinessDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public diffSizeCount = resultCountObservable(\n this.diffSizeResults,\n this.diffSizeResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n\n public selectedToggle = new BehaviorSubject(0);\n\n public flattenLevelBuildings: Observable<{\n flattenedLevels: BuildingLevel[];\n buildings: Building[];\n }>;\n\n public open: boolean = true;\n public editing_form = new BehaviorSubject(false);\n\n public spaceControl = new FormControl();\n\n public selectedSpace: SelectOption;\n public resetInput: number;\n\n public searchStringPresent = false;\n public payload: any = {\n payload: { name: 'test', id: 'test-id' },\n building: {},\n floorMap: true,\n };\n\n public isOpen = true;\n\n public toggle() {\n this.isOpen = !this.isOpen;\n }\n\n constructor(\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private dialog: MatDialog,\n private _org: OrganisationService,\n private location: Location,\n private collapseService: CollapseService\n ) {\n super();\n this.payload = location.getState();\n }\n\n public ngOnInit(): void {\n this.subscription(\n 'filters',\n this.store.pipe(select(selectFormFilters), distinctUntilChanged()).subscribe((next) => {\n return this.filters.next(next);\n })\n );\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n const day = next.dateTz.dateWeekday - 1;\n this.day_offset = day >= 4 ? 7 - day : 1;\n const building = this._org.buildings.find(\n (_) => _.id === next.location[0]?.meta?.building?.id\n );\n this.rules_link =\n building?.setting('booking.rules_link') ||\n next.location.find(\n office => office?.meta?.building?._settings?.discovery_info?.booking?.rules_link\n )?.meta?.building?._settings?.discovery_info?.booking?.rules_link;\n // next.location[0]?.meta?.building?.settings?.discovery_info?.booking\n // ?.rules_link;\n const nday = laterThatDayFromDateTz(next.dateTz);\n this.laterThatDayDisplay.next(`at ${timeWithZoneFormatString(nday)}`);\n // this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(next)));\n this.data.next(next);\n \n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n\n // this.data.next(next);\n } else {\n // no form data, likely visiting directly. navigate back to start\n this.router.navigate(['../'], {\n replaceUrl: true,\n relativeTo: this.route,\n });\n }\n })\n );\n\n this.subscription(\n 'results',\n this.store.pipe(select(selectFilteredResults)).subscribe((next) => {\n this.mainResults.next(next);\n this.mainResultsFiltered.next(next);\n // Populate results for Search\n this.mainResultsSpaces = next.success?.spaces\n ? next.success?.spaces?.map(mapRoomToSelectOption)\n : [];\n })\n );\n\n this.subscription(\n 'laterResults',\n this.store.pipe(select(selectFilteredLaterDayResults)).subscribe((next) => {\n this.laterThatDayResults.next(next);\n })\n );\n\n this.subscription(\n 'nextDayResults',\n this.store.pipe(select(selectFilteredNextDayResults)).subscribe((next) => {\n this.nextBusinessDayResults.next(next);\n })\n );\n\n this.subscription(\n 'diffSize',\n this.store.pipe(select(selectFilteredDiffSizeResults)).subscribe((next) => {\n this.diffSizeResults.next(next);\n })\n );\n\n this.flattenLevelBuildings = this.store.pipe(\n select(buildingStateSelector),\n select(loadBuildings.selectors.optionalSuccess),\n filterUndefined(),\n map(flattenBuildingsWithLevels),\n shareReplay(1)\n );\n\n this.subscription(\n 'spaceChanges',\n this.spaceControl.valueChanges.subscribe((value) => {\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults.value.success?.spaces?.filter((s) => {\n if (s.id === value.value) {\n return true;\n }\n return false;\n });\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n })\n );\n\n // if coming from kiosk map url, route there\n if (this.payload?.floorMap) {\n this.router.navigate([`../home/floor-map`], {\n state: { ...this.payload },\n queryParams: {\n display: '',\n },\n });\n }\n\n this.subscription(\n 'spaceChanges',\n this.selectedToggle.subscribe((value) => {\n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n })\n );\n }\n\n /**\n * Dispatches actions to load rooms based on the provided value.\n * @param {number} value - The value indicating the mode of operation.\n * 0: Load rooms for regular view.\n * 1: Load rooms for results map view.\n */\n public despatchLoadRooms() {\n const selectedMenuIndex = this.selectedToggle.value; // List/Map/Calendar\n const isForFloorMap = this.payload?.floorMap;\n // If value is 0 and floorMap is not present in payload\n if(selectedMenuIndex === 0 && !isForFloorMap) {\n // Dispatch action to load rooms with query generated from form data\n this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(this.data.value)));\n }\n \n // If value is 1 or floorMap is present in payload\n if(selectedMenuIndex === 1 || isForFloorMap) {\n // Dispatch action to load rooms for results map view with query generated from form data\n this.store.dispatch( loadRoomsForResultsMap.request(roomFormDataToQuery(this.data.value)));\n }\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n const mainResults = cloneDeep(this.mainResults.value);\n this.mainResultsFiltered.next(mainResults);\n this.searchStringPresent = false;\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n\n public changeInput(event) {\n if (event) {\n this.clearRoomSearch();\n }\n }\n\n public filteredRoomsChange(event: SelectOption[]) {\n const roomIds = event.map((o) => o.value);\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults?.value?.success?.spaces\n ? this.mainResults?.value?.success?.spaces?.filter((s) => {\n if (roomIds.includes(s.id)) {\n return true;\n }\n return false;\n })\n : [];\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n }\n\n public changeSearchResults() {\n this.editing_form.next(true);\n const dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n dialog_ref.afterClosed().subscribe(() => {\n this.editing_form.next(false);\n this.collapseService.collapsePanel();\n });\n }\n\n public filterResults() {\n this.dialog.open(RoomFiltersModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n switch (reason) {\n case SpaceFilterReason.Filters:\n this.store.dispatch(clearRoomFilters());\n break;\n case SpaceFilterReason.OfficeRules:\n case SpaceFilterReason.DateTime:\n this.changeSearchResults();\n break;\n }\n }\n\n public selectedToggleChange(event: SelectOption) {\n this.selectedToggle.next(event.value);\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n humaniseDuration,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n weekDayMonthYearFormat\n} from '@mckinsey-converge/base';\nimport {\n truncateLocationList,\n BookingFormData,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\nimport { Store } from '@ngrx/store';\nimport { clearRoomFilters } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'app-searched-location',\n template: `\n
\n
\n {{name}}\n {{date}}\n {{timing}}\n {{types}}\n No filters applied\n Filtering unavailable for this view\n {{filterDisplay}}\n
\n \n
\n `,\n styleUrls: ['./searched-location.component.scss']\n})\nexport class SearchedLocationComponent implements OnInit, OnChanges {\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public filters: SelectOption[] = [];\n\n @Output()\n public changeClick = new EventEmitter();\n\n @Output()\n public filterClick = new EventEmitter();\n\n @Input()\n public canFilter = true;\n\n public name = '';\n public date = '';\n public timing = '';\n public types = '';\n public filterDisplay = '';\n public filterCount = '';\n\n constructor(private store: Store) {}\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.data || changes.filters) {\n this.computeDisplay();\n }\n }\n\n public ngOnInit(): void {\n this.computeDisplay();\n }\n\n\n public computeDisplay() {\n if (!this.data) {\n return;\n }\n const { duration, dateTz, location, roomSize, bookingType, is_recurrent, recurrence_endTz } = this.data;\n\n \n // this.requestedEndDateTz = new DateTZ({ date: endDate.date.valueOf(), is_local_tz, building_tz })\n\n const group = location.find(l => l.groupHeader);\n if (group) {\n this.name = group.shortDisplay;\n } else {\n this.name = truncateLocationList(location);\n }\n\n // R--- blocked until TZ booking form inputs\n const building_tz = location[0]?.meta?.building?.timezone || location[0]?.meta?.city?.timezone;\n const startDate = new DateTZ({date: dateTz.ms, is_local_tz: false, building_tz })\n\n if(is_recurrent) {\n const occEndDate = getLastDateFromList( this?.data?.recurrence_starts );\n \tconst endRecDate = new DateTZ({date: occEndDate.ms, is_local_tz: false, building_tz });\n this.date = `From ${weekDayMonthYearFormat(startDate)} until ${weekDayMonthYearFormat(endRecDate)}` ;\n }\n else {\n this.date = weekDayMonthYearFormat(startDate);\n }\n\n const startDisplay = startDate.formatDate(`${timeFormatString()}`).toLocaleLowerCase();\n const endDate = startDate.addValue({ minutes: duration });\n const endDisplay = timeWithGmtOffsetFormatString(endDate);\n this.timing = `${startDisplay}-${endDisplay}`; // - TODO correct for DST?\n\n const durationDisplay = humaniseDuration(duration, 'short');\n this.types = `${durationDisplay}, ${bookingType.display}, ${roomSize.display}`;\n\n this.filterDisplay = this.filters.map(f => f.shortDisplay).join(', ');\n this.filterCount = this.filters.length > 0 ? `(${this.filters.length})` : '';\n }\n\n public clearAllFilters() {\n this.store.dispatch(clearRoomFilters());\n } \n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-footer-menu',\n templateUrl: './footer-menu.component.html',\n styleUrls: ['./footer-menu.component.scss']\n})\nexport class FooterMenuComponent extends BaseDirective implements OnInit {\n\n /** Tiles to display on the home page */\n public tiles: ApplicationLink[] = [];\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Angular Component initialisation lifecycle hook */\n public ngOnInit(): void {\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.tiles = this._service.setting('app.home.tiles') || [];\n });\n }\n}\n","\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Building,\n BuildingLevel,\n OrganisationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-map-controls',\n templateUrl: './map-controls.component.html',\n styleUrls: ['./map-controls.component.scss']\n})\nexport class MapControlsComponent extends BaseDirective implements OnInit {\n /** ID of the active building */\n @Input() public building: string;\n /** ID of the active level */\n @Input() public level: string;\n /** Emitter for changes to the active level */\n @Output() public levelChange = new EventEmitter();\n /** Details of the active building */\n public building_details: Building = this._org.building;\n /** List of available buildings */\n public building_list: Building[] = [];\n /** List of available levels */\n public level_list: readonly BuildingLevel[] = [];\n\n public get can_select_building(): boolean {\n return !!this._service.setting('app.explore.can_select_building');\n }\n\n constructor(\n private _route: ActivatedRoute,\n private _router: Router,\n private _service: ApplicationService,\n private _org: OrganisationService\n ) {\n super();\n }\n\n public ngOnInit() {\n this._org.listen('buildings').pipe(first(_ => !!_ && !!_.length)).subscribe(() => {\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe(params => {\n /* istanbul ignore else */\n if (params.has('level')) {\n const level_id = params.get('level');\n const level = this._org.levelWithID(level_id);\n this.level = level.id;\n this.setBuilding(level.building_id);\n this.levelChange.emit(this.level);\n this.clearTimeout('check_building');\n }\n })\n );\n this.building_list = this._org.buildings;\n this.timeout('check_building', () => {\n /* istanbul ignore else */\n if (!this.building) {\n this.setBuilding(this._org.building.id);\n }\n this.levelChange.emit(this.level);\n });\n });\n }\n\n public setBuilding(bld_id: string) {\n const building = this._org.buildings.find(bld => bld.id === bld_id);\n /* istanbul ignore else */\n if (building) {\n this.building_details = building;\n this.building = bld_id;\n this._org.building = building;\n this.level_list = building.levels;\n /* istanbul ignore else */\n if (this.level_list.length && !this.level_list.find(lvl => lvl.id === this.level)) {\n this.updateLevel(this.level_list[0].id);\n }\n }\n }\n\n public updateLevel(lvl_id: string) {\n this.level = lvl_id;\n this.levelChange.emit(this.level);\n this._router.navigate([], {\n relativeTo: this._route,\n queryParams: { level: lvl_id }\n });\n }\n}\n","
\n 1\"\n >\n \n {{ building_details?.code }} - {{ building_details?.name }} \n \n
\n
{{ bld.code }}
\n
{{ bld.name }}
\n
{{ bld.address }}
\n
\n
\n
\n \n \n \n \n {{ level.name }}\n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'a-overlay-menu',\n templateUrl: './overlay-menu.component.html',\n styleUrls: ['./overlay-menu.component.scss']\n})\nexport class OverlayMenuComponent extends BaseDirective {\n /** Whether to show the menu */\n @Input() public show: boolean;\n /** Emitter for changes to show */\n @Output() public showChange = new EventEmitter();\n\n /** List of links to display on the menu */\n public get menu_items(): ApplicationLink[] {\n const settings = this._service.setting('app.general.menu') || { items: [] };\n return settings.items || [];\n }\n\n /** Copyright details for the application */\n public get copyright(): string {\n return (this._service.setting('app.general.menu') || {}).copyright || '';\n }\n\n public get settings() {\n const settings = this._service.setting('app.general.menu') || { position: '' };\n return settings;\n }\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Current year to display for copyright */\n public get year(): number {\n return DateNow(new Date()).dateYear;\n }\n\n /** Close the overlay menu */\n public close() {\n this.show = false;\n this.showChange.emit(this.show);\n }\n\n public delayedClose() {\n this.timeout('close', () => this.close(), 50);\n }\n\n public cancelClose() {\n this.timeout('cancel_close', () => this.clearTimeout('close'), 10);\n }\n}\n","\n
\n
\n
\n \n
\n
\n \n
\n
\n Copyright © {{ year }} {{ copyright }}\n
\n
\n\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { ImageDirective } from '@mckinsey-converge/base';\nimport { setupRoomImages } from '@mckinsey-converge/data-common';\nimport { SpaceImageObject } from 'libs/base/src/lib/types.utilities'\n\n@Component({\n selector: 'mck-responsive-inline-images',\n template: `\n
\n
\n \n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n
\n
\n `,\n styleUrls: ['./responsive-inline-images.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ResponsiveInlineImagesComponent extends ImageDirective implements OnInit {\n\n /** Input array of images */\n @Input() public rootFolderURL: string;\n @Input() public fileSlug: string;\n\n /** Ignore this param, it's only use is to bypass the image onload event in testing */\n @Input() public imagesLoaded: boolean;\n public loadImages = new BehaviorSubject([]);\n\n public foundImages: SpaceImageObject[] = [1,2,3].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n public mobile = false;\n\n constructor(private cdRef: ChangeDetectorRef,) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 768;\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n next: val => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n }\n })).subscribe();\n setupRoomImages(this, [1,2,3], this.rootFolderURL, this.fileSlug, this.imagesLoaded);\n this.subscription(\n\t\t\t\t\t\t'found_images',\n\t\t\t\t\t\tthis.loadImages.subscribe((imgArr: SpaceImageObject[]) => {\n\t\t\t\t\t\t\tif(imgArr.length) this.foundImages = imgArr;\n\t\t\t\t\t\t\tthis.cdRef.detectChanges();\n\t\t\t\t\t\t}));\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n } \n\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n MatDialogRef,\n MAT_DIALOG_DATA\n} from '@angular/material/dialog';\nimport {\n BaseClass\n} from '@mckinsey-converge/base';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'a-survey-modal',\n templateUrl: './survey-modal.component.html',\n styleUrls: ['./survey-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SurveyModalComponent extends BaseClass implements OnInit {\n constructor(\n @Inject(MAT_DIALOG_DATA) public _data: any,\n private _composer: ComposerService,\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n /* present experience question by default */\n public token = '';\n public phase = 'intro';\n public baseUrl = '';\n\n public questions = {\n created_at: 0,\n updated_at: 0,\n header_question: \"What went wrong?\",\n header_subtext: \"Select one or several options\",\n options: [],\n id: \"\"\n }\n\n public answers = {\n questions_id: \"\",\n positive: true, // Experience is positive until the questions are displayed\n option_responses: [],\n comments: \"\"\n };\n\n // Show the questions and mark the experience negative. (false positive)\n public showQuestions(): void {\n this.answers.positive = false;\n this.phase = 'questions';\n }\n\n public ngOnInit(): void {\n /* fetch the question options once composer is initialized */\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n const token = this._composer.auth.token;\n this.token = token;\n this.baseUrl = this._composer.auth.api_endpoint.replace(this._composer.auth.route, '/api/staff/feedback')\n this.getFeedbackQuestionsFromApi(token, this._data)\n });\n }\n\n public getFeedbackQuestionsFromApi(token: string, questionID: string) {\n new Promise((resolve, reject) => {\n const url = `${this.baseUrl}/questions/${questionID}`;\n let result: any = null;\n this._composer.http.get(url).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.questions = d;\n this.answers = {\n questions_id: this.questions.id,\n positive: true,\n option_responses: this.questions.options.map(q => ({ // map the questions to default answers.\n id: q.id,\n checked: false,\n })),\n comments: \"\"\n };\n }).catch(e => {\n console.log('error', e)\n });\n }\n\n // Handle the checkbox changes\n public handleChange(value: any) {\n this.answers.option_responses.some((o, i) => {\n if (o.id === value.id) {\n this.answers.option_responses[i].checked = !this.answers.option_responses[i].checked;\n return true;\n }\n });\n }\n\n // Handle the comment input changes\n public handleComment($evemt: any) {\n this.answers.comments = $evemt.target.value;\n }\n\n // Submit the Survey in it's current state.\n public confirm() {\n new Promise((resolve, reject) => {\n let result: any = null;\n this._composer.http.post(this.baseUrl, this.answers).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.phase = 'exit';\n this.closeModal(true);\n }).catch(e => {\n console.log('error', e)\n this.phase = 'exit';\n this.closeModal(true);\n });\n \n }\n\n // Close the modal\n public closeModal(delayed: boolean = false) {\n if (delayed) {\n this.timeout('closeModal', () => {\n this._dialog_ref.close();\n }, 2000);\n } else {\n this._dialog_ref.close();\n }\n }\n}\n","
\n \n
\n
\n \n
\n How was your booking experience?\n
\n
\n
\n \n \n
\n
\n\n\n
\n
\n \n
\n \n What went wrong?\n

Select one or several options

\n
\n
\n
\n
\n {{question.option}}\n
\n
\n \n \n \n \n
\n
\n \n \n \n
\n\n
\n
\n \n
\n\n \n
\n Thank you!\n
\n \n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n distinctUntilChanged,\n first,\n} from 'rxjs/operators';\nimport {\n ApplicationIcon,\n BookingFormState,\n SettingsService,\n openBookingSurvey,\n clearBookingFormData,\n BookingFormData,\n SeriesAction,\n selectActiveForm,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport {\n NavigationEnd,\n Router,\n ActivatedRoute\n} from '@angular/router';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport { SurveyModalComponent } from '../survey-modal/survey-modal.component';\nimport {\n Store, select\n} from '@ngrx/store';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface RoutePayload {\n /** IE ['/home', 'results'] */\n route: string[];\n /** IE { display: '/list' } */\n queryParams?: object;\n}\n\nexport type RoomBookingStoreState = BookingFormState & BuildingStoreState;\n\n@Component({\n selector: 'a-topbar-header',\n template: `\n
\n
\n \n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n
\n `,\n styleUrls: ['./topbar-header.component.scss'],\n // encapsulation: ViewEncapsulation.None,\n})\nexport class TopbarHeaderComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether to show menu */\n @Input() public menu: boolean;\n /** Whether to show modal close icon */\n @Input() public modal: boolean = false;\n /** Whether t show modal back icon */\n @Input() public backModal: boolean = false;\n /** Whether to disable the survey triggers */\n @Input() public noSurvey: boolean = false;\n /** Name of the page being rendered */\n @Input() public page: string;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n /** Override the home route. **/\n @Input() public homeOverride: string | undefined;\n /** Show history back instead of logo block */\n @Input() public back: RoutePayload;\n /** Emitter for changes to menu state */\n @Output() public menuChange = new EventEmitter();\n /** Emitter for the close button */\n @Output() public closeCallback = new EventEmitter();\n /** Emitter for the back button */\n @Output() public onBack = new EventEmitter();\n /** Name of the currently active page */\n public currentPage: string;\n /** Survey modal state */\n public modalOpen: boolean = false;\n isEditSeries: boolean = false;\n\n public get feedback() {\n const feedback_url = this._org.getOrganizationFiltersByRoomType('feedback_url');\n return `${feedback_url}${this.currentPage}`;\n // return generateFeedbackUrl(this.currentPage);\n }\n\n public surveyDialogRef: MatDialogRef = null;\n\n public bookingCompleted: Date = new Date();\n public feedbackId: string = null;\n\n constructor(private store: Store,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.store.dispatch(loadOrganisations.request());\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => {\n this.logo = this._settings.get(`app.logo_${this.mode}`) || { type: 'icon' };\n });\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n\n // if the survey is allowed (don't in modals! due to duplicate appearances)\n if (!this.noSurvey) {\n // get the active form values\n this.subscription('openSurveyModal', this.store.pipe(\n distinctUntilChanged()\n ).subscribe((next: any | undefined) => {\n const feedbackId = next.organisation?.data?.success?._settings?.discovery_info?.feedback_id;\n if (feedbackId && this.feedbackId !== feedbackId) {\n this.feedbackId = feedbackId;\n }\n if (next.bookingForm?.bookingCompleted && this.bookingCompleted.getTime() < next.bookingForm.bookingCompleted.getTime()) {\n this.bookingCompleted = new Date(next.bookingForm.bookingCompleted.getTime());\n this.openFeedbackModal();\n }\n }));\n }\n\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n /** Set menu state to `true` */\n public showMenu() {\n this.menu = true;\n this.menuChange.emit(this.menu);\n }\n\n public async goToHome() {\n // this.isEditSeries && this.clearFormAndResultData();\n // Clear the form and result data before navigating to home for a fresh start for all type of bookings\n this.clearFormAndResultData();\n await this._router.navigate([this.homeOverride ?? '/']);\n // await this._router.navigate(['/', 'home'], { relativeTo: this.route });\n this._dialog.closeAll();\n }\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n public goToHelp() {\n const help_url = this._org.getOrganizationFiltersByRoomType('help_url');\n window.open(help_url || Urls.Help);\n }\n\n public goToFeedback() {\n // Over-engineered button action to mimic/test booking confirmation event.\n this.store.dispatch(openBookingSurvey());\n }\n\n public openFeedbackModal() {\n if (!this.modalOpen && !this.surveyDialogRef) {\n this.modalOpen = true;\n this.surveyDialogRef = this._dialog.open(SurveyModalComponent, {\n disableClose: true,\n panelClass: 'mck-modal-survey',\n data: this.feedbackId,\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.surveyDialogRef.afterClosed().subscribe(() => {\n this.modalOpen = false;\n this.surveyDialogRef = null;\n });\n }\n\n }\n\n public async goToBackRoute() {\n this.onBack.emit();\n await this._router.navigate(this.back.route, { queryParams: this.back.queryParams });\n }\n\n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { first } from 'rxjs/operators';\n\nimport {\n ApplicationIcon,\n ApplicationService,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-login',\n templateUrl: './login.component.html',\n styleUrls: ['./login.component.scss']\n})\nexport class LoginComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether the user credentials are being checked */\n public loading: boolean;\n /** Form fields for the login form */\n public form: FormGroup;\n\n constructor(private _service: ApplicationService, private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n this.loading = true;\n this.form = new FormGroup({\n username: new FormControl('', [Validators.required]),\n password: new FormControl('', [Validators.required])\n });\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.loading = false;\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n }\n\n /** Perform user login */\n public login() {\n this.loading = true;\n const form = this.form.value;\n this._users.login({\n username: form.username,\n password: form.password\n }, { form: true }).then(() => {\n this.loading = false;\n }, () => {\n this.loading = false;\n this.form.controls.password.setErrors({ check: true });\n });\n }\n\n}\n","
\n
\n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n \n Username:\n \n \n \n Username is required\n \n
\n
\n \n Password:\n \n \n \n Invalid username or password\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n
\n \n
\n
Converge is loading
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\n@Component({\n selector: 'app-map-controls',\n template: `\n
\n
\n \n
\n \n \n
\n \n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-controls.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class MapControlsComponent implements OnInit {\n @Output()\n public zoomOutClick = new EventEmitter();\n\n @Output()\n public zoomInClick = new EventEmitter();\n\n @Output()\n public refreshClick = new EventEmitter();\n\n @Output()\n public infoClick = new EventEmitter();\n\n @Output() toggleEvent = new EventEmitter();\n\n public isClosed = true;\n\n toggle() {\n this.toggleEvent.emit();\n this.isClosed = !this.isClosed;\n }\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { FormControl } from '@angular/forms';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { legendOptions } from '../map.utils';\n\n@Component({\n selector: 'app-map-filters',\n template: `\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-filters.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapFiltersComponent extends BaseDirective implements OnInit {\n\n public legendOptions = legendOptions();\n\n @Input()\n public buildings: SelectOption[];\n\n @Input()\n public selectedBuilding: SelectOption;\n\n @Output()\n public selectedBuildingChange = new EventEmitter>();\n\n @Input()\n public levels: SelectOption[];\n\n @Input()\n public selectedLevel: SelectOption;\n\n @Output()\n public selectedLevelChange = new EventEmitter>();\n\n @Input()\n public spaces: SelectOption[];\n\n @Output()\n public selectedSpaceChange = new EventEmitter>();\n\n @Input()\n public selectedSpace: SelectOption;\n\n @Output()\n public searchClick = new EventEmitter();\n\n public buildingControl = new FormControl();\n\n public levelControl = new FormControl();\n\n public spaceControl = new FormControl();\n\n public resetInput: number;\n\n public searchStringPresent = false;\n\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('buildingChanges',\n this.buildingControl.valueChanges.subscribe(value => this.selectedBuildingChange.emit(value)));\n this.subscription('levelChanges',\n this.levelControl.valueChanges.subscribe(value => this.selectedLevelChange.emit(value)));\n this.subscription('spaceChanges',\n this.spaceControl.valueChanges.subscribe(value => {\n this.selectedSpaceChange.emit(value);\n this.searchClick.emit();\n }));\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n this.searchStringPresent = false;\n // TODO, reset the focused room if required?\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\n\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel,\n parentComponent?: any,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'app-map-overlay',\n template: `\n
\n \n
\n
\n
\n \n
\n
\n
\n {{data.simple_name || 'No Label'}}\n \n \n
{{ data.status === 'requestable' ? 'Requestable' : 'Bookable'}} {{ data?.room?.space?.availableOccurrences }} out of {{ data?.room?.space?.totalOccurrences }}
\n
\n
\n
\n\n
\n `,\n styleUrls: ['./map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapOverlayComponent implements OnInit {\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n ) {\n }\n public ngOnInit(): void {\n }\n\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.data.room) {\n this.data.parentComponent.roomSelected(this.data.room)\n }\n }\n\n public get is_recurrent () {\n return this.data.parentComponent?.bookingFormData?.value?.is_recurrent || false;\n }\n\n public closeOverlay() {\n this.data.parentComponent?.closeMapOverlayOutlet();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectMapFilteredResults,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-map-search',\n template: `\n
\n
\n \n \n
\n
\n
\n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-search.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n animations: [\n trigger('expandHeight', [\n state(\n 'open',\n style({\n height: '470px',\n })\n ),\n state(\n 'closed',\n style({\n height: 'calc(100vh - 270px)',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class MapSearchComponent extends BaseDirective implements OnInit {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n // public resultSpaces = new BehaviorSubject>(\n // LoadingModel.empty()\n // );\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n public floorData: any;\n public floorDataParam: any;\n @Output() toggleEvent = new EventEmitter();\n\n //to capture state for toggling expandHeight animation\n public isOpen = true;\n resultsLoading: any;\n\n propagateToggle() {\n this.toggleEvent.emit();\n this.isOpen = !this.isOpen;\n }\n \n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private location: Location,\n private route: ActivatedRoute\n ) {\n super();\n this.floorData = location.getState();\n }\n\n public ngOnInit(): void {\n // this.resultsLoading = this.resultSpaces.pipe(map((m) => m.isLoading));\n \n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => { \n this.resultsLoading = r.isLoading;\n return r.success;})\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) => !!s.map_id && s.zones.includes(building.id)\n );\n this.resultSpaces.next(spacesFromSelection);\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n status !== 'in-use' ? \n () => {\n this.activeSpace.next(space);\n this.focusOnRoom(status);\n } \n : ()=> {}\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n })\n );\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(buildings);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n \n if(this.activeLevel.value){\n this.floorDataParam = {\n display: this.activeLevel.value.name,\n value: this.activeLevel.value.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n \n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n this.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(form) ));\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.bookingFormData.next(next);\n }\n })\n );\n\n if (this.floorData?.payload) {\n this.floorDataParam = {\n display: this.floorData?.payload.name,\n value: this.floorData?.payload.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n }\n\n public refreshFloorNumber(): void {\n this.activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n // this.focusedMapSpace.next(undefined);\n }\n\n public closeMapOverlayOutlet = () => {\n this.focusedMapSpace.next(undefined)\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n };\n \n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n\t\t\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(this.bookingFormData.value) ));\n this.activeLevel.next(next);\n\n /**\n * update mapUrl as per active level on change of filter search\n */\n this.mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''))\n });\n }\n\n public selectActiveSpace(selection: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom(status?:string) {\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n this.focusedRoom.next(focusedRoom[0]);\n this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this, status));\n this.zoom.next(MAX_ZOOM_LEVEL);\n },\n delay\n );\n });\n }\n\n public roomSelected(room: RoomResultsViewModel) {\n\n\n const { is_recurrent } = this.bookingFormData.value;\n this.bookingFormData.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.bookingFormData.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\n // Handle timezone offset for accurate date and time information\n let { dateTz } = this.bookingFormData.value;\n // if (this.offset) {\n dateTz = dateTz.addValue({ minutes: 0 });\n // }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.bookingFormData.value.booking.room is not and does not contain the timezone\n * this.bookingFormData.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.bookingFormData.value,\n // buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: 0,\n selectedRoom: room\n }\n }});\n\n\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n // this.router.navigate(['room'], { relativeTo: this.route });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MapSearchComponent } from './map-search/map-search.component';\nimport { MapControlsComponent } from './map-controls/map-controls.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MapFiltersComponent } from './map-filters/map-filters.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { OfficeInformationModalComponent } from './office-information-modal/office-information-modal.component';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapOverlayComponent } from './map-overlay/map-overlay.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n NgxSkeletonLoaderModule\n];\n\nexport const mapModuleDeclarations = [\n MapSearchComponent,\n MapControlsComponent,\n MapFiltersComponent,\n OfficeInformationModalComponent,\n MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class MapModule {\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { MapOverlayComponent } from 'src/app/map/map-overlay/map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 0.99\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any, status?: string): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room,\n status:status\n }\n});","import {\n Component,\n Inject,\n ViewEncapsulation\n} from '@angular/core';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { \n BookingRuleDetails,\n Building,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n defaultMapBookingRules,\n defaultMapBookingSubtitle\n} from 'src/app/map/map.utils';\n\n@Component({\n selector: 'app-office-information-modal',\n template: `\n \n
\n
Booking in {{building?.name}}
\n
{{targetLinks(info)}}
\n
\n
\n
    \n \n
\n
\n
\n {{group.title}}\n
    \n \n
\n
\n
\n When booking from maps:\n
    \n \n
\n \n

\n For more info email: {{contact}}\n

\n

\n
\n
\n
\n \n
\n
\n `,\n styleUrls: ['./office-information-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OfficeInformationModalComponent {\n constructor(@Inject(MAT_DIALOG_DATA) public building: Building,\n private dialogRef: MatDialogRef) {\n }\n\n\n /** Booking rule details */\n public get rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.rules || [] as any;\n }\n\n /** Booking rule details */\n public get info(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.info || defaultMapBookingSubtitle;\n }\n\n public get customHtml(): string | undefined {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.custom_html;\n }\n\n /** Booking map rule details */\n public get map_rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.map_rules || defaultMapBookingRules as any;\n }\n\n /** Other special booking rules */\n public get other_rules(): { title: string, rules: string[] }[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n const rules: HashMap = (details as any)?.other_rules || {};\n return Object.keys(rules).reduce((a, v) => {\n \n a.push({ title: v, rules: rules[v] || [] });\n return a;\n }, []);\n }\n\n public get contact(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.contact || '';\n }\n\n public get link(): { url?: string, name?: string } {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.link || {};\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public targetLinks(info: string) {\n const regex = /[] = [\n BaseDirective,\n LoginComponent,\n TopbarHeaderComponent,\n ResponsiveInlineImagesComponent,\n OverlayMenuComponent,\n FooterMenuComponent,\n MapControlsComponent\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\nconst CDK_MODULES: any[] = [\n ScrollingModule,\n DragDropModule,\n CdkTableModule\n];\n\n\n@NgModule({\n declarations: [\n ...COMPONENTS\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n RouterModule,\n EditorModule,\n ComposerModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n IvyCarouselModule,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ],\n exports: [\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n ...COMPONENTS,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ]\n})\nexport class SharedContentModule {\n}\n","import { Component, OnInit } from '@angular/core';\nimport { filter, first, map, distinctUntilChanged, shareReplay } from 'rxjs/operators';\nimport {\n ApplicationLoadingState,\n BaseDirective,\n closestToTimeSlot,\n closestToTimeSlotTz,\n LoadingState,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationIcon,\n ApplicationService,\n Building,\n BuildingCity,\n defaultRoomSizeOption,\n DEFAULT_BOOKING_DURATION,\n flattenDisplayOffices,\n internalBookingTypeOption,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n mapResultsToViewModels,\n OrganisationService,\n SpacesService,\n storeBookingFormData,\n availabilityOptionsToQuery,\n bookingTypeOptions,\n selectFilteredDiffSizeResults,\n flattenBuildingsWithLevels,\n clearRoomFilters,\n allBookingTypeOption,\n roomSizeOptions,\n roomSizeOptionsKiosk,\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport { select, Store } from '@ngrx/store';\nimport { loadUser, selectHasUserData, UserStoreState } from '@mckinsey-converge/user';\nimport { ComposerService } from '@placeos/composer';\nimport { ActivatedRoute, Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\n\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n} from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n buildingStateSelector,\n loadBuildings,\n selectBuildingOptionsGroupedByCity,\n} from '@mckinsey-converge/buildings';\nimport { loadDiffSizeResults, loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { timeStamp } from 'console';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\n\n@Component({\n selector: 'app-shell-wrapper',\n templateUrl: './shell.component.html',\n styleUrls: ['./shell.component.scss'],\n})\nexport class ShellWrapperComponent extends BaseDirective implements OnInit {\n /** Loading state of the application */\n public loading_state: ApplicationLoadingState;\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n\n private userLoading = new BehaviorSubject(true);\n public isQRCode = new BehaviorSubject(true);\n public buildingOptions = new BehaviorSubject[]>([]);\n public zone_id: any;\n public floor: any;\n\n constructor(\n private _service: ApplicationService,\n private placeOs: ComposerService,\n private _org: OrganisationService,\n private activatedRoute: ActivatedRoute,\n private _spaces: SpacesService,\n private router: Router,\n private store: Store\n ) {\n super();\n\n // Initialize roomID\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n // roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n\n // Initialize zoneID\n let zone_id = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('zone_id')) {\n zone_id = this.activatedRoute.snapshot.queryParamMap.get('zone_id');\n } else if (\n localStorage.oauth_redirect &&\n localStorage.oauth_redirect.includes('?zone_id=')\n ) {\n zone_id = localStorage.oauth_redirect.split('=')[1];\n if (zone_id.includes('&')) {\n zone_id = zone_id.split('&')[0];\n }\n }\n\n this.zone_id = zone_id;\n\n // Initialize floor number\n let floor = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('floor')) {\n floor = this.activatedRoute.snapshot.queryParamMap.get('floor');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('&floor=')) {\n floor = localStorage.oauth_redirect.split('&floor=')[1];\n }\n this.floor = floor;\n (floor && zone_id) || roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n }\n\n /** Whether the user needs to login */\n public get show_login(): Observable {\n return this.userLoading;\n }\n\n /** Whether a module is still loading data */\n public get is_loading(): Observable {\n return this.userLoading;\n }\n\n /** List of modules with a loading state */\n public get loading_state_list(): LoadingState[] {\n const list: LoadingState[] = [];\n for (const mod in this.loading_state) {\n if (this.loading_state[mod]) {\n list.push(this.loading_state[mod]);\n }\n }\n return list;\n }\n\n /**\n * Function: To check and fetch room details if available for the scanned roomId\n * @param buildings\n * @param roomId\n */\n public checkRoomId(buildings: Building[], roomId: string) {\n let formGroup = {\n location: [],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: true }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType: bookingTypeOptions[0],\n roomSize: defaultRoomSizeOption,\n selectedRoom: null,\n timezone: null,\n buildings: buildings,\n };\n\n const params = {\n room_ids: roomId,\n };\n\n const availibityParams = {\n room_ids: roomId,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n hide_declined: true,\n };\n const query = availabilityOptionsToQuery(availibityParams);\n this._spaces.queryRooms(query).subscribe(\n (res) => {\n //Convert raw data into API object\n const list = res.map((i) => this._spaces.process(i));\n this._spaces.setSpaceList(list);\n /**\n * Building form data to resue to navigate to result page if room is not available!\n */\n const bookingRoom = mapResultsToViewModels(\n list,\n list[0].building.levels,\n buildings\n );\n const city = list[0].building.city;\n const timezone = list[0].timezone;\n const grouped_by_city = {\n key: { name: city, timezone },\n value: buildings?.filter((bld) => bld.city === city) || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [mapCityToAllSelectOption(grouped_by_city.key), ...city_buildings];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === list[0].building.id\n )[0];\n const buildingTimezone = list[0].timezone;\n // form group data\n formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({ date: Date.now(), is_local_tz: false }),\n 15\n ).toZone(buildingTimezone),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType:\n list[0].internal_or_external === 'internal'\n ? bookingTypeOptions[0]\n : bookingTypeOptions[1],\n roomSize: defaultRoomSizeOption,\n selectedRoom: bookingRoom[0],\n timezone: buildingTimezone,\n buildings: buildings,\n };\n\n this.store.dispatch(\n storeBookingFormData({\n payload: formGroup,\n })\n );\n this.router.navigate([`../home/results/room`], {\n state: { payload: { ...formGroup, offset: 0 } },\n });\n localStorage.oauth_redirect = localStorage.oauth_redirect.split('?')[0];\n this.isQRCode.next(true);\n },\n (error) => {\n // console.log(error);\n this.isQRCode.next(true);\n // this.router.navigate([`home/`]); // to navigate to default route if room dont exists\n /**\n * Navigate to room result page if no room/id exist in the db/ removed from the db in future -\n */\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n this.router.navigate([`../home/results`], {\n state: { payload: { ...formGroup, offset: 0 } },\n queryParams: { display: 'list' },\n });\n }\n );\n }\n\n public ngOnInit(): void {\n // when qr code lands on a url for the second time, reload it (to compensate for different browser/device combination default behaviors)\n this.subscription(\n 'navigationEventShell',\n this.router.events\n .pipe(filter((event) => event instanceof NavigationStart))\n .subscribe((event: NavigationEvent) => {\n if (event instanceof NavigationStart) {\n if (\n event.navigationTrigger === 'popstate' &&\n (event.url.includes('home?zone_id=') || event.url.includes('home?id='))\n ) {\n this.userLoading.next(true);\n window.location.reload();\n }\n }\n })\n );\n\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n\n if (roomId) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n this.checkRoomId(bld_list, roomId);\n })\n );\n }\n\n if (this.zone_id && this.floor) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n const building = bld_list.filter((el) => el.id === this.zone_id);\n\n const city = building[0].city;\n const timezone = building[0].timezone;\n\n const grouped_by_city = {\n key: { name: city, timezone },\n value: building || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings,\n ];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === building[0].id\n )[0];\n const buildingTimezone = building[0].timezone;\n // form group data\n const addMin = DateTime.now().get('minute') % 5 === 0 ? 1 : 0;\n const formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(\n DateTime.now().plus({ minutes: addMin }),\n 15\n ).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n bookingType: allBookingTypeOption, // all rooms (including internal and external both)\n roomSize: roomSizeOptionsKiosk[3],\n selectedRoom: null,\n timezone: buildingTimezone,\n buildings: bld_list,\n };\n\n const query2 = {\n // capacity: 3,\n locations: this.zone_id,\n // capacity_max: 9,\n // diff_capacity: true,\n hide_declined: true,\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n };\n\n //clear search filters first if any applied previously\n this.store.dispatch(clearRoomFilters());\n\n this.store.dispatch(loadRoomsForResults.clear());\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n this.store.dispatch(loadRoomsForResults.request(query2));\n localStorage.oauth_redirect = '';\n // To do: navigate to floor-map route\n this.router.navigate([`../home/results`], {\n state: {\n payload: this.floor,\n building: building,\n floorMap: true,\n url: window.location.href,\n },\n queryParams: { display: '' },\n });\n this.isQRCode.next(true);\n })\n );\n }\n\n this.subscription(\n 'loading',\n this._service.listen('loading').subscribe((loading) => {\n this.loading_state = loading;\n })\n );\n\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n\n /**\n * Load current user into redux. this is meant to remove old way of loading user from user's service.\n */\n this.subscription(\n 'currentUser',\n combineLatest([\n this.store.pipe(select(selectHasUserData)),\n this.placeOs.initialised,\n this.isQRCode, // added to track room details if QR code used to open app\n ])\n .pipe(\n filter(([_, initialized, isQRCodeScanedAndReady]) => {\n console.log(_);\n return initialized && isQRCodeScanedAndReady;\n })\n )\n .subscribe(([next]) => {\n this.userLoading.next(!next);\n if (!next) {\n this.store.dispatch(loadUser.request());\n }\n })\n );\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
Converge is loading
\n
\n
\n
\n","export enum Urls {\n LearnMore = 'https://our-firm.intranet.mckinsey.com/covid-portal/travel',\n Feedback = 'mailto:converge_feedback@mckinsey.com?subject=Feedback for page: ',\n Help = 'https://mckinsey.service-now.com/ghd?id=topic_simple&topic_id=54e8eb091bea3d1831b17449cd4bcbed',\n OfficeContacts = 'https://our-firm.intranet.mckinsey.com/ourfirm/geographies',\n}\n\nexport const generateFeedbackUrl = (page: string) => {\n return `${Urls.Feedback}${page}`;\n};\n","import { EnvironmentData } from '@mckinsey-converge/environment';\n\nexport const environment: EnvironmentData = {\n production: true,\n hmr: false,\n heap_io_id: 91016686,\n};\n","import { SettingsData } from '@mckinsey-converge/data-common';\n\n;\n/**\n * GENERAL APPLICATION SETTINGS\n */\nconst general = {\n menu: {\n items: [],\n copyright: 'McKinsey & Company',\n position: 'left'\n }\n};\n\n/**\n * HOME PAGE SETTINGS\n */\nconst home = {\n background: 'assets/img/skyline.jpg',\n tiles: [\n {\n name: 'Book',\n route: '/book/spaces',\n icon: {\n type: 'icon',\n class: 'custom-book'\n }\n },\n {\n name: 'Maps',\n route: '/explore/space',\n icon: {\n type: 'icon',\n class: 'custom-spaces'\n }\n },\n {\n name: 'My Day',\n route: '/schedule',\n icon: {\n type: 'icon',\n class: 'custom-schedule'\n }\n }\n ]\n};\n/**\n * HELP/SUPPORT SETTINGS\n */\nconst help = {\n tiles: [],\n columns: 2\n};\n/**\n * BOOKING FLOW SETTINGS\n */\nconst booking = {\n booking_types: [\n { name: 'Internal', id: 'internal' },\n { name: 'External', id: 'external' },\n ],\n show_fields: [\n 'attendees',\n 'body',\n 'catering',\n 'dateTz',\n 'duration',\n 'organiser',\n 'title',\n 'type',\n 'all_day',\n 'needs_space',\n 'has_catering'\n ],\n html_body: false,\n multiple_spaces: true,\n desk_start: 9\n};\n/*===========================*\\\n|| SPACE LISTING SETTINGS ||\n\\*===========================*/\nconst space_display = {\n show_images: false\n};\n/*===========================*\\\n|| USER DIRECTORY SETTINGS ||\n\\*===========================*/\nconst directory = {\n show_avatars: true,\n min_search_length: 3\n};\n/*===========================*\\\n|| EXPLORE MAP SETTINGS ||\n\\*===========================*/\nconst explore = {\n colors: {\n 'space-available': '#43a047',\n 'space-requestable': '#ffb300',\n 'space-unavailable': '#e53935',\n 'space-in-use': '#d4483e',\n 'space-not-bookable': '#ccc',\n 'desk-available': '#43a047',\n 'desk-available-stroke': '#1b5e20',\n 'desk-unavailable': '#e53935',\n 'desk-unavailable-stroke': '#b71c1c',\n 'desk-reserved': '#ffb300',\n 'desk-reserved-stroke': '#ff6f00',\n 'desk-not-bookable': '#fff',\n 'desk-not-bookable-stroke': '#ccc',\n 'zone-low': '#43a047',\n 'zone-medium': '#ffb300',\n 'zone-high': '#e53935'\n },\n can_select_building: true,\n show_legend_group_names: false,\n show_timeline: true,\n legend: {\n General: [\n { key: 'space-available', name: 'Available' },\n { key: 'space-requestable', name: 'Available by request' },\n { key: 'space-unavailable', name: 'In use' },\n { key: 'space-not-bookable', name: 'Not Bookable' }\n ]\n }\n};\n\n/*=========================*\\\n|| DAY VIEW SETTINGS ||\n\\*=========================*/\nconst day_view = {\n dragdrop: false,\n};\n\n\n/**\n * ROOT APPLICATION SETTINGS\n */\nconst app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n },\n general,\n home,\n help,\n booking,\n space_display,\n directory,\n explore,\n day_view\n}\n\n\n/**\n * ROOT SETTIGNS\n */\nexport const DEFAULT_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/staff',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app,\n mock: false,\n frontend: 'staff',\n};\n","import { ApplicationRef, NgModuleRef } from '@angular/core';\nimport { createNewHosts } from '@angularclass/hmr';\n\nexport const hmrBootstrap = (\n module: any,\n bootstrap: () => Promise>,\n) => {\n let ngModule: NgModuleRef;\n module.hot.accept();\n bootstrap().then(mod => (ngModule = mod));\n module.hot.dispose(() => {\n const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef);\n const elements = appRef.components.map(c => c.location.nativeElement);\n const makeVisible = createNewHosts(elements);\n ngModule.destroy();\n makeVisible();\n });\n};\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\nimport { environment } from './environments/environment';\nimport { hmrBootstrap } from './hmr';\nimport { AppModule } from './app/app.module';\n\nif (environment.production) {\n enableProdMode();\n}\n\nconst bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);\n\n// comes from https://medium.com/wizardnet972/hot-module-replacement-with-angular-cli-5fc7a3ae4a9c\nif (environment.hmr) {\n if ((module as any).hot) {\n hmrBootstrap(module, bootstrap);\n } else {\n console.error('HMR is not enabled for webpack-dev-server!');\n console.log('Are you using the --hmr flag for ng serve?');\n }\n} else {\n bootstrap().catch(err => console.log(err));\n}\n"],"sourceRoot":"webpack:///"} \ No newline at end of file +{"version":3,"sources":["/home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/lib/angular-animations.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/lib/animations.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/cdk-drop-list-scroll-container.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/date.spec-helpers.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/date.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/general.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/image.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/numbers-only.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/replace.pipe.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.effects.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.reducer.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.effects.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.reducer.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/api.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/app.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/base-api.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/base.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking-filter.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.data.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.spec-helpers.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.selectors.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/room-results/room-results.viewmodel.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking-state.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.types.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/bookings.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/bookingsPaginated.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/space.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-categories.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-category.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-item.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-items.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-menu.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-notes.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-order.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/close-modal-dialog-service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/collapse-accordion-service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/data-common.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/hotkeys.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/location.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/location.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/building.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/level.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/organisation.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/organisation.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/paginated.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/recurrence/recurrence.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/report.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/reports.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/service-manager.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/settings.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/space.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/space.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/spaces.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spec-helpers.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/user.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/user.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/users.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/validation.utilities.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/date-tz/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/date-tz/src/lib/date-tz.class.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/environment.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/environment.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/version.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-confirm/booking-confirm.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-confirm/booking-confirm.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-form/booking-form.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-form/booking-form.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-confirm-modal/catering-confirm-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-confirm-modal/catering-confirm-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-details-modal/catering-details-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-details-modal/catering-details-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/confirm-modal/confirm-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/confirm-modal/confirm-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/legacy-overlays.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/new-user-modal/new-user-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/new-user-modal/new-user-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/no-catering-modal/no-catering-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/no-catering-modal/no-catering-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/requirement-details-modal/requirement-details-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/requirement-details-modal/requirement-details-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/space-select-modal/space-select-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/space-select-modal/space-select-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/user-form/user-form.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/user-form/user-form.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/action-icon/action-icon.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/action-icon/action-icon.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/item/item.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/item/item.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/package-options-modal/package-options-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/package-options-modal/package-options-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/hover-class.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/action-field/action-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/action-field/action-field.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/counter/counter.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/counter/counter.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/date-field/date-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/date-field/date-field.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/duration-field/duration-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/duration-field/duration-field.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/time-field/time-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/time-field/time-field.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-list-field/user-list-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-list-field/user-list-field.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-search-field/user-search-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-search-field/user-search-field.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/feedback/feedback.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/feedback/feedback.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/icon/icon.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/icon/icon.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/legacy-ui.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/popout-menu/popout-menu.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/popout-menu/popout-menu.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/searchbar/searchbar.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/searchbar/searchbar.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/user-avatar/user-avatar.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/user-avatar/user-avatar.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.effects.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.model.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.selectors.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/testing/effects.testing.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/testing/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.effects.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.reducer.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.effects.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.reducer.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.types.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/loading-model.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/operators.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/rx-utils.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/aca-date-picker/aca-date-picker.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/aca-date-picker/aca-date-picker.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/alert-banner/alert-banner.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-chip-select-item/auto-complete-chip-select-item.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-chip-select-item/groupHeader.pipe.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-select-option/auto-complete-select-option.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-select-option/auto-complete-select-option.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/base-template.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select-options.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select-options.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/dropdown-trigger-for.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/collapse-header/collapse-header.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflict-alert-modal/conflict-alert-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflict-alert-modal/conflict-alert-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflicts-modal/conflicts-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflicts-modal/conflicts-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.service.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-calendar-widget/date-tz-calendar-widget.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-calendar-widget/date-tz-calendar-widget.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-date-picker/date-tz-date-picker.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-duration-field/date-tz-duration-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-time-field/date-tz-time-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/duration-field/duration-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/error-message/error-message.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/calendar/calendar-icon.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/calendar/chevron-icon.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/close/close-icon.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/informational-image/informational-image.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/label/label.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/legend-dropdown/legend-dropdown.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/mck-date-picker/mck-date-picker.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/modal-button-row/modal-button-row.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/modal/modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/override-changes-modal/override-changes-modal.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/override-changes-modal/override-changes-modal.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/pipes/filter.pipe.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/pipes/sanitise.pipe.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/radio-select/radio-select.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-booking-form/recurrence-booking-form.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-booking-form/recurrence-booking-form.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-date-form/recurrence-date-form.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-date-form/recurrence-date-form.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-pattern-form/recurrence-pattern-form.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-pattern-form/recurrence-pattern-form.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select-option/select-option.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select/select.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select/select.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/selected-chip-count/selected-chip-count.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/spacer/spacer.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/switch-group/switch-group.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/time-field/time-field.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/toggle/toggle.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.directive.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.enums.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/types.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/ui.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/utils/time.utils.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component.html","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/index.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.actions.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.effects.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.module.ts","/home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.reducer.ts","./$_lazy_route_resource lazy namespace object","./src/app/app-routing.module.ts","./src/app/app.component.ts","./src/app/app.component.html","./src/app/app.module.ts","./src/app/booking/booking-calendar/booking-calendar-date-widget/calendar-date-widget.component.ts","./src/app/booking/booking-calendar/booking-calendar-date-widget/calendar-date-widget.component.html","./src/app/booking/booking-calendar/booking-calendar-routing.module.ts","./src/app/booking/booking-calendar/booking-calendar-wrapper.component.ts","./src/app/booking/booking-calendar/booking-calendar-wrapper.html","./src/app/booking/booking-calendar/booking-calendar.module.ts","./src/app/booking/booking-calendar/cng-menu-item/cng-menu-item.component.ts","./src/app/booking/booking-calendar/cng-menu-item/cng-menu-item.component.html","./src/app/booking/booking-calendar/staff-calendar/space/event/event.component.ts","./src/app/booking/booking-calendar/staff-calendar/space/event/event.component.html","./src/app/booking/booking-calendar/staff-calendar/space/space.component.ts","./src/app/booking/booking-calendar/staff-calendar/space/space.component.html","./src/app/booking/booking-calendar/staff-calendar/staff-calendar.component.ts","./src/app/booking/booking-calendar/staff-calendar/staff-calendar.component.html","./src/app/booking/booking-calendar/staff-calendar/timeline/timeline.component.ts","./src/app/booking/booking-calendar/staff-calendar/timeline/timeline.component.html","./src/app/booking/booking-confirmation/booking-confirmation.component.ts","./src/app/booking/booking-create/booking-create.component.ts","./src/app/booking/booking-create/booking-form-base.component.html","./src/app/booking/booking-create/booking-edit-wrapper.component.ts","./src/app/booking/booking-create/booking-edit.component.ts","./src/app/booking/booking-create/booking-form-base.component.ts","./src/app/booking/booking-details-modal/booking-details-modal.component.ts","./src/app/booking/booking-details-modal/booking-details-modal.component.html","./src/app/booking/booking-duration-modal/booking-duration-modal.component.ts","./src/app/booking/booking-result-item/booking-result-item.component.ts","./src/app/booking/booking-result-item/booking-result-item.component.html","./src/app/booking/booking-routing.module.ts","./src/app/booking/booking.form.reducer.ts","./src/app/booking/booking.module.ts","./src/app/booking/bookings-listing/bookings-listing.component.ts","./src/app/booking/bookings-listing/bookings-listing.component.html","./src/app/booking/cancel-booking-modal/cancel-booking-modal.component.ts","./src/app/booking/catering/catering.component.ts","./src/app/booking/catering/catering.component.html","./src/app/booking/catering/order-details/category/category.component.ts","./src/app/booking/catering/order-details/category/category.component.html","./src/app/booking/catering/order-details/order-details.component.ts","./src/app/booking/catering/order-details/order-details.component.html","./src/app/booking/catering/order-list/item/item.component.ts","./src/app/booking/catering/order-list/item/item.component.html","./src/app/booking/catering/order-list/order-list.component.ts","./src/app/booking/catering/order-list/order-list.component.html","./src/app/booking/catering/order-table/order-table.component.ts","./src/app/booking/manage-bookings/manage-bookings.component.ts","./src/app/booking/manage-bookings/manage-bookings.viewmodel.ts","./src/app/booking/office-floor/floor-map-overlay/floor-map-overlay.component.ts","./src/app/booking/office-floor/floor-map.utils.ts","./src/app/booking/office-floor/office-floor-map.module.ts","./src/app/booking/office-floor/office-floor/office-floor.component.ts","./src/app/booking/office-floor/office-floor/office-floor.component.html","./src/app/booking/results-header/results-header.component.ts","./src/app/booking/room-availability-preview-modal/room-availability-preview-modal.component.ts","./src/app/booking/room-availability-preview/room-availability-preview.component.ts","./src/app/booking/room-availability-preview/room-availability-preview.component.html","./src/app/booking/room-booking-details-form/room-booking-details-form.component.ts","./src/app/booking/room-booking-details-form/room-booking-details-form.component.html","./src/app/booking/room-booking-form/room-booking-form.component.ts","./src/app/booking/room-booking-form/room-booking-form.component.html","./src/app/booking/room-booking-modal/room-booking-modal.component.ts","./src/app/booking/room-booking/room-booking.component.ts","./src/app/booking/room-details/room-details.component.ts","./src/app/booking/room-details/room-details.component.html","./src/app/booking/room-filters-form/room-filters-form.component.ts","./src/app/booking/room-filters-modal/room-filters-modal.component.ts","./src/app/booking/room-location-preview/room-location-preview.component.ts","./src/app/booking/room-result-item/room-result-item.component.ts","./src/app/booking/room-results-paginated/room-results-paginated.component.ts","./src/app/booking/room-results-section/room-results-section.component.ts","./src/app/booking/room-results/room-results-coachmark.viewmodel.ts","./src/app/booking/room-results/room-results.component.ts","./src/app/booking/searched-location/searched-location.component.ts","./src/app/components/footer-menu/footer-menu.component.ts","./src/app/components/footer-menu/footer-menu.component.html","./src/app/components/map-controls/map-controls.component.ts","./src/app/components/map-controls/map-controls.component.html","./src/app/components/overlay-menu/overlay-menu.component.ts","./src/app/components/overlay-menu/overlay-menu.component.html","./src/app/components/responsive-inline-images/responsive-inline-images.component.ts","./src/app/components/survey-modal/survey-modal.component.ts","./src/app/components/survey-modal/survey-modal.component.html","./src/app/components/topbar-header/topbar-header.component.ts","./src/app/login/login.component.ts","./src/app/login/login.component.html","./src/app/map/map-controls/map-controls.component.ts","./src/app/map/map-filters/map-filters.component.ts","./src/app/map/map-overlay/map-overlay.component.ts","./src/app/map/map-search/map-search.component.ts","./src/app/map/map.module.ts","./src/app/map/map.utils.ts","./src/app/map/office-information-modal/office-information-modal.component.ts","./src/app/shared/shared.module.ts","./src/app/shell/shell.component.ts","./src/app/shell/shell.component.html","./src/app/utilities/urls.ts","./src/environments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AAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE;QACpB,MAAM,MAAM,GAAmB,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAc,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,oBAAc,CAAC,QAAQ,CAAC,CAAC;QAC7C,QAAQ,CAAC,OAAO,EAAE,CAAC;QACnB,WAAW,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;;;;;;;;;;;;;;;ACjBF,0HAA+C;AAE/C,iHAAyD;AACzD,+DAAqC;;;AAGrC,IAAI,yBAAW,CAAC,UAAU,EAAE;IACxB,qBAAc,EAAE,CAAC;CACpB;AAED,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,qCAAwB,gBAAgB,+BAAW,CAAC;AAE5E,kGAAkG;AAClG,IAAI,yBAAW,CAAC,GAAG,EAAE;IACjB,IAAK,KAAkB,EAAE,EAExB;SAAM;QACH,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;KAC7D;CACJ;KAAM;IACH,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9C","file":"main-es2015.js","sourcesContent":["export * from './lib/animations.module';\nexport * from './lib/angular-animations'\n","import { trigger, transition, style, animate, state } from '@angular/animations';\n\nexport const ANIMATION_SHOW_ENTER_LEAVE = trigger('show', [\n transition(':enter', [\n style({ opacity: 0, height: 0 }),\n animate(300, style({ opacity: 1, height: '*' }))\n ]),\n transition(':leave', [\n style({ opacity: 1, height: '*' }),\n animate(300, style({ opacity: 0, height: 0 }))\n ])\n]);\n\nexport const ANIMATION_SHOW_CONTRACT_EXPAND = trigger('show', [\n state('show', style({ opacity: 1, height: '*' })),\n state('hide', style({ opacity: 0, height: 0 })),\n transition('show <=> hide', animate('200ms ease-in'))\n]);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class AnimationsModule {}\n","export * from './lib/base.module';\nexport * from './lib/types.utilities';\nexport * from './lib/general.utilities';\nexport * from './lib/base.class';\nexport * from './lib/base.directive';\nexport * from './lib/date.utils'\nexport * from './lib/date.spec-helpers'\nexport * from './lib/replace.pipe'\nexport * from './lib/cdk-drop-list-scroll-container.directive'\nexport * from './lib/image.directive';\n","import { Subscription, BehaviorSubject } from \"rxjs\";\n\nexport class BaseClass {\n /** Store for named timers */\n protected _timers: { [name: string]: number } = {};\n /** Store for named intervals */\n protected _intervals: { [name: string]: number } = {};\n /** Store for named subscription unsub callbacks */\n protected _subscriptions: { [name: string]: (Subscription | (() => void)) } = {};\n /** Subject which stores the initialised state of the object */\n protected readonly _initialised = new BehaviorSubject(false);\n\n /** Observable of the initialised state of the object */\n public get initialised(): BehaviorSubject {\n return this._initialised;\n }\n /** Whether the object has been initialised */\n public get is_initialised(): boolean {\n return this._initialised.getValue();\n }\n\n protected destroy() {\n for (const key in this._timers) {\n if (this._timers.hasOwnProperty(key)) {\n this.clearTimeout(key);\n }\n }\n for (const key in this._intervals) {\n if (this._intervals.hasOwnProperty(key)) {\n this.clearInterval(key);\n }\n }\n for (const key in this._subscriptions) {\n if (this._subscriptions.hasOwnProperty(key)) {\n this.unsub(key);\n }\n }\n }\n\n /**\n * Creates a named timer\n * @param name Name of the timer\n * @param fn Callback function for the timer\n * @param delay Callback delay\n */\n protected timeout(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearTimeout(name);\n this._timers[name] = setTimeout(() => {\n fn();\n this._timers[name] = null;\n }, delay);\n } else {\n throw new Error(\n name ? 'Cannot create named timeout without a name' : 'Cannot create a timeout without a callback'\n );\n }\n }\n\n /**\n * Clears the named timer\n * @param name Timer name\n */\n protected clearTimeout(name: string) {\n if (this._timers[name]) {\n clearTimeout(this._timers[name]);\n this._timers[name] = null;\n }\n }\n\n /**\n * Creates a named interval\n * @param name Name of the interval\n * @param fn Callback function for the interval\n * @param delay Callback delay\n */\n protected interval(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearInterval(name);\n this._intervals[name] = setInterval(() => fn(), delay);\n } else {\n throw new Error(\n name ? 'Cannot create named interval without a name' : 'Cannot create a interval without a callback'\n );\n }\n }\n\n /**\n * Clears the named interval\n * @param name Timer name\n */\n protected clearInterval(name: string) {\n if (this._intervals[name]) {\n clearInterval(this._intervals[name]);\n this._intervals[name] = null;\n }\n }\n\n /**\n * Store named subscription\n * @param name Name of the subscription\n * @param unsub Unsubscribe callback or Subscription object\n */\n protected subscription(name: string, unsub: Subscription | (() => void)) {\n this.unsub(name);\n this._subscriptions[name] = unsub\n }\n\n /**\n * Call unsubscribe callback with the given name\n * @param name\n */\n protected unsub(name: string) {\n if (this._subscriptions && this._subscriptions[name]) {\n this._subscriptions[name] instanceof Subscription\n ? (this._subscriptions[name] as Subscription).unsubscribe()\n : (this._subscriptions[name] as any)();\n this._subscriptions[name] = null;\n }\n }\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\n\n@Directive({\n selector: 'a-very-basic-component-base-that-should-not-be-used'\n})\nexport class BaseDirective extends BaseClass implements OnDestroy {\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NumbersOnlyDirective } from './numbers-only.directive';\n\n@NgModule({\n imports: [CommonModule,],\n declarations: [\n NumbersOnlyDirective\n ],\n exports: [\n NumbersOnlyDirective\n ]\n})\nexport class BaseModule {\n}\n","import {\n Directive,\n Input,\n Renderer2,\n SimpleChanges,\n OnChanges,\n ContentChildren,\n QueryList,\n AfterContentInit\n} from '@angular/core';\nimport { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';\nimport { BaseDirective } from './base.directive';\n\nexport enum ScrollDirection {\n NONE,\n X,\n Y,\n BOTH\n}\n\n@Directive({\n selector: '[cdkDropList][scrollContainer]'\n})\nexport class CdkDropListScrollContainer extends BaseDirective\n implements OnChanges, AfterContentInit {\n /** Direction of scroll to determine updating the position of the drop list */\n @Input() direction: ScrollDirection = ScrollDirection.X;\n /** Name of the scroll container for the list */\n @Input() scrollContainer: string;\n /** Scroll container element */\n public element: HTMLElement;\n /** Last scroll position */\n public last_scroll: { x: number; y: number } = { x: 0, y: 0 };\n\n /** Draggable children elements */\n @ContentChildren(CdkDrag) private items: QueryList;\n\n constructor(private _cdkDropList: CdkDropList, private _renderer: Renderer2) {\n super();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.scrollContainer && this.scrollContainer) {\n this.element = this._cdkDropList.element.nativeElement.closest(\n this.scrollContainer\n ) as HTMLElement;\n }\n }\n\n public ngAfterContentInit(): void {\n this.subscription(\n 'drag_items',\n this.items.changes.subscribe((items: QueryList) => {\n const list = items.toArray();\n list.forEach((i, index) => {\n this.subscription(\n `list-item-${index}`,\n this._renderer.listen(i.element.nativeElement, 'mousedown', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'mouseup', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n this.subscription(\n `list-item-touch-${index}`,\n this._renderer.listen(i.element.nativeElement, 'touchstart', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'touchend', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n });\n })\n );\n }\n\n /** Start listing for scroll events on the container */\n public onDrag() {\n if (this.element) {\n this.subscription(\n 'scroll',\n this._renderer.listen(this.element, 'scroll', () => this.updateListPosition())\n );\n }\n }\n\n /** Stop listening for scroll events on the container */\n public onDrop() {\n this.unsub('scroll');\n }\n\n /**\n * Forcefully update the position data of the drop list\n */\n private updateListPosition() {\n this.timeout(\n 'update_positions',\n () => {\n const scroll = { x: this.element.scrollLeft, y: this.element.scrollTop };\n if (\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.Y) &&\n scroll.y !== this.last_scroll.y) ||\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.X) &&\n scroll.x !== this.last_scroll.x)\n ) {\n (this._cdkDropList._dropListRef as any)._cacheOwnPosition();\n (this._cdkDropList._dropListRef as any)._siblings.forEach(i =>\n i.isReceiving() ? i._cacheOwnPosition() : null\n );\n }\n this.last_scroll = scroll;\n },\n 50\n );\n }\n}\n","import MockDate from 'mockdate';\n\n/**\n * August 13, 2020 at 7:22:12 UTC\n */\nconst initialTime = 1597346532 * 1000;\n\nexport const mockDate = (timeOverride = initialTime) => MockDate.set(new Date(timeOverride));\n\nexport const resetDate = () => MockDate.reset();\n","import { DateNow, DateTZ } from '@mckinsey-converge/date-tz'\nimport { DateTime } from 'luxon';\nimport * as dayjs from 'dayjs';\nimport {\n dayJsHoursMinutes,\n dayJsTimeFormatString,\n} from './general.utilities';\n\n/**\n * Allows you to split up durations into a group.\n */\nexport interface DurationGroup {\n /**\n * Step amount to generate between start and max.\n */\n step: number;\n /**\n * Where to start in minutes.\n */\n start: number;\n /**\n * Where to end in minutes.\n */\n max: number;\n}\n\n/**\n * Find the multiple of `stepMinute` which is closest to the 'minutes' property of the given date.\n * @param date - Any Lexon date.\n * @param stepMinute - The number of minutes between one timeslot and the next. Integer value\n * 1 to 59, inclusive.\n */\n// R--- depreciate this one\nexport const closestToTimeSlot = (date: DateTime, stepMinute: number, start: number = 0) : DateTime => {\n return date.set({ millisecond: 0, second: 0, minute: Math.ceil(date.minute / stepMinute) * stepMinute })\n .plus({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\nexport const closestToTimeSlotTz = (dateTz: DateTZ, stepMinute: number, start: number = 0) : DateTZ => {\n return dateTz.setValue({ millisecond: 0, second: 0, minute: Math.ceil(dateTz.minutes / stepMinute) * stepMinute })\n .addValue({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as hrs, or minutes as mins\n */\nexport function durationHumanized(duration: number, short: boolean = false): string {\n if (!duration || duration < 0) {\n return '';\n }\n const h = Math.floor(duration / 60);\n let d = `${h >= 1 ? h + (short ? ' hr' : ' hour' + (h === 1 ? '' : 's')) : ''}`;\n if (duration % 60 !== 0) {\n if (d) {\n d += short ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${m >= 1 ? m + (short ? ' min' : ' minute' + (m === 1 ? '' : 's')) : ''}`;\n }\n return d;\n}\n\nexport const weekDayMonthYearFormat = (date: DateTZ): string => date.formatDate('ccc dd MMM yyyy');\n\n/**\n * Tries to extract best-fit input\n * @return undefined if not valid. otherwise if good\n */\nexport const extractDateFromInput = (input: string,\n checkHour,\n startDate: dayjs.Dayjs): dayjs.Dayjs | undefined => {\n // check if input has am/pm or normal 24 hour time.\n // let date = dayjs(input, 'HH:mm');\n // let date = dayjs(input, 'h:mma');\n let date = dayjs(input, dayJsTimeFormatString());\n if (!date.isValid()) {\n // patch if time is in format xx:x to assume you meant xx:x0\n let cleanedInput = input;\n const times = input.split(':');\n if(!input){\n return undefined\n }\n if (times.length === 2) {\n if (times[1].length === 1) {\n cleanedInput = `${times[0]}:${times[1]}0`;\n }\n }\n // may be other input, lets try next value (without am/pm)\n date = dayjs(cleanedInput, dayJsHoursMinutes());\n // might be just purely an hour\n if (!date.isValid() && checkHour) {\n date = dayjs(input, 'H');\n }\n }\n // We expect input times to be in the future. If now is in the afternoon, this\n // simple block will ensure the returned date is also in the afternoon.\n //\n // NB: dayjs parses times as morning by default.\n if (date.isValid()) {\n // Move to the selected start date\n date = date.month(startDate.month()).date(startDate.date()).year(startDate.year());\n if (startDate.hour() > date.hour() && date.date() === startDate.date()) {\n date = date.set('hour', date.hour() + 12);\n }\n }\n\n return date.isValid() ? date : undefined;\n};\n\n\n/**\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 3. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n * @param step The step between time slots.\n * @param input The input text.\n */\nexport const nearestStepToInput = (\n step: number,\n input: string,\n currentStartDate: number,\n start: number = 0\n): string => {\n let date = extractDateFromInput(input, false, dayjs(currentStartDate));\n if (date) {\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, step, start);\n return closestDate.toFormat(dayJsHoursMinutes());\n } else {\n return input;\n }\n};\n/**\n * Similiar to {@link nearestStepToInput} instead:\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds which duration group is closest to the currentStartDate. If not found\n * return vanilla text.\n * 3. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 4. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n */\nexport const nearestDurationToInput = (durationGroups: DurationGroup[],\n currentStartDate: number,\n value: string): string => {\n\n let date = extractDateFromInput(value, false, dayjs(currentStartDate));\n\n if (!date) {\n // Check if the input is a duration \n const duration = parseInt(value);\n if (typeof (duration) === 'number' && value.indexOf(':') === -1 && duration > 12) {\n date = dayjs(currentStartDate).add(duration, 'm');\n }\n }\n\n if (date) {\n const minutes = date.diff(currentStartDate, 'minute');\n const closestDurationGroup = durationGroups.find(d => {\n return (minutes <= d.max);\n });\n if (closestDurationGroup) {\n const offset = [closestDurationGroup].reduce((previousValue, currentValue) => {\n return previousValue + currentValue.start;\n }, 0);\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, closestDurationGroup.step, 0);\n return closestDate.toFormat(dayJsHoursMinutes());\n }\n }\n\n return value;\n};\n\nexport const resetSecondsOnTimestamp = (timestamp: number) => {\n return DateTime.fromMillis(timestamp).set({ second: 0, millisecond: 0 }).toMillis();\n}\n\nexport const formatDateWithSuffix = (date: string): string => {\n const dateObj = new Date(date);\n const day = dateObj.getDate();\n const month = dateObj.toLocaleString(\"default\", { month: \"short\" });\n const year = dateObj.getFullYear();\n return `${day}${nthNumber(day)} ${month} ${year}`; //this.event.date_string;\n}\n\nconst nthNumber = (number) => {\n return number > 0\n ? [\"th\", \"st\", \"nd\", \"rd\"][\n (number > 3 && number < 21) || number % 10 > 3 ? 0 : number % 10\n ]\n : \"\";\n};\n\nexport const getListOfDateFormat = () => {\n return [\t\n 'MMMM dd y', \t//March 07 2023\n 'MMM dd, y',\t//Mar 07 2023\n 'MMMM dd',\t\t//March 07\n 'MMM dd', \t\t//Mar 07\n 'MM dd', \t\t//03 07\n\n 'MM-dd-yy',\t\t//03-07-23\n 'MM-dd-yyyy',\t//03-07-2023\n 'MMMM-dd-yyyy', //March-07-2023\n 'MMMM-dd-yy',\t//March-07-23\n\n 'MMMM-dd',\t\t//March-07\n 'MMM-dd',\t\t//Mar-07\n \n 'MMM-dd-y',\t\t//Mar-07-2023\n\n 'MM/dd',\t\t//03/07\n 'MM/dd/yy',\t\t//03/07/23\n 'MM/dd/yyyy',\t//03/07/2023\n \n 'dd/MM',\t\t//07/03\n 'dd/MM/yy',\t\t//07/03/23\n 'dd/MM/yyyy',\t//07/03/2023\n \n 'dd-MMMM',\t\t//07-March\n 'dd MMMM',\t\t//07 March\n 'dd-MMM',\t\t//07-Mar\n 'dd MMM',\t\t//07 Mar\n\n 'dd-MM-y',\t\t//07-03-23\n 'dd MMMM yy',\t//07 March 23\n \n 'dd/MMM/y',\t //07/Mar/2023\n 'dd/MMMM/y', //07/March/2023\n 'dd/MMM/yy', //07/Mar/23\n 'dd/MMMM/yy', //07/March/23\n \n\n 'dd-MMMM-yy',\t//07-March-23\n 'dd-MMM-yy',\t//07-Mar-23\n 'dd-MM-yy',\t\t//07-03-23\n 'MMMM-dd-yy',\t//March-07-23\n 'MMM-dd-yy',\t//Mar-07-23\n\n 'MMMM dd yy',\t//March 07 23\n 'MMM dd, yy',\t//Mar 07 23\n 'MM dd, yy',\t//03 07 23\n\n 'dd MMMM y',\t//07 March 2023\n 'dd MMM, y',\t//07 Mar 2023\n 'dd MM, yy',\t//07 03, 23\n 'dd-MMM-y',\t//07-Mar-2023\n\n 'h:mm a', // 3:30 pm\n 'h:mma' // 3:30 pm\n\n ];\n}","import { HashMap, Point } from './types.utilities';\n\nimport * as dayjs from 'dayjs';\nimport * as utc from 'dayjs/plugin/utc';\nimport * as timezone from 'dayjs/plugin/timezone';\nimport * as isToday from 'dayjs/plugin/isToday';\nimport * as weekday from 'dayjs/plugin/weekday';\nimport * as customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n// TODO: this is not the best place to import this timezone addition\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isToday);\ndayjs.extend(weekday);\ndayjs.extend(customParseFormat);\n\n/** Available console output streams. */\nexport type ConsoleStream = 'debug' | 'warn' | 'log' | 'error' | 'info';\n\n/**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\nexport function log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false,\n app_name: string = 'STAFF'\n) {\n if ((window as any).debug || force) {\n const colors: string[] = [\n 'color: #E91E63',\n 'color: #3F51B5',\n 'color: default',\n ];\n if (args) {\n console[stream](\n `%c[${app_name}]%c[${type}] %c${msg}`,\n ...colors,\n args\n );\n } else {\n console[stream](`%c[${app_name}]%c[${type}] %c${msg}`, ...colors);\n }\n }\n}\n\n/**\n * Get item from the nested object\n * @param keys List of sub-keys to search for\n * @param map Object to search\n */\n export function getItemWithKeys(keys: string[], map: HashMap) {\n const key = keys[0];\n if (map && key in map) {\n return keys.length > 1\n ? getItemWithKeys(keys.slice(1), map[key] || {})\n : map[key];\n }\n return null;\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the platform is a mobile device.\n */\nexport function isMobileDevice(): boolean {\n const r = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n return !!navigator.userAgent.match(r);\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Mobile Safari.\n */\nexport function isMobileSafari(): boolean {\n const agent = navigator.userAgent;\n return !!(\n agent.match(/iPhone|iPad|iPod/) &&\n agent.match(/AppleWebKit/) &&\n !agent.match('CriOS')\n );\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Android Chrome.\n */\nexport function isAndroidChrome(): boolean {\n const agent = navigator.userAgent;\n return !!(agent.match(/Android/) && agent.match(/Chrome/));\n}\n\n/**\n * Generate string representation of a number with zeros padding the length\n * @param value Number to pad with zeros\n * @param length Length of the resulting string\n */\nexport function padZero(value: number, length: number): string {\n let str = value.toString();\n while (str.length < length) {\n str = '0' + str;\n }\n return str;\n}\n\n/**\n * Remove duplicates from the given array\n * @param array List of items to remove duplicates from\n * @param key Key on array objects to compare for uniqueness\n */\nexport function unique(array: T[], key: keyof T | undefined = undefined) {\n return array.filter(\n (el, pos, arr) =>\n el &&\n arr.indexOf(\n key\n ? arr.find((i) => i && i[key] === el[key])\n : arr.find((i) => i === el)\n ) === pos\n );\n}\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as h\n */\nexport function humaniseDuration(durationInput: number, size: string = 'long') {\n const duration = Math.floor(durationInput);\n if (!duration || duration < 0) {\n return '';\n }\n let singular = false;\n let format = { hours: ' hour', minutes: ' minute' };\n switch (size) {\n case 'medium':\n format = { hours: 'hr', minutes: 'min' };\n break;\n case 'short':\n format = { hours: 'h', minutes: 'm' };\n singular = true;\n break;\n }\n const h = Math.floor(duration / 60);\n let d = `${\n h >= 1\n ? h +\n (singular ? format.hours : format.hours + (h === 1 ? '' : 's'))\n : ''\n }`;\n if (duration % 60 !== 0) {\n if (d) {\n d += singular ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${\n m >= 1\n ? m +\n (singular\n ? format.minutes\n : format.minutes + (m === 1 ? '' : 's'))\n : ''\n }`;\n }\n return d;\n}\n\n/**\n * Get a filtered list of items\n * @param filter Value to filter on\n * @param items List of results to filter\n * @param fields Fields to check for matches on each item\n */\nexport function filterList(\n filter: string,\n items?: T[],\n fields: string[] = ['id']\n): T[] {\n let results: any[];\n // Tokenise filter string\n const filters = (filter || '').toLowerCase().split(' ');\n const list = {};\n for (const f of filters) {\n /* istanbul ignore else */\n if (f) {\n /* istanbul ignore else */\n if (!list[f]) {\n list[f] = 0;\n }\n list[f]++;\n }\n }\n // Group similar tokens\n const parts = [];\n for (const f in list) {\n /* istanbul ignore else */\n if (list.hasOwnProperty(f)) {\n parts.push({ word: f, count: list[f], regex: new RegExp(f, 'gi') });\n }\n }\n parts.sort(\n (a, b) => b.word.length - a.word.length || a.word.localeCompare(b.word)\n );\n const item_list = JSON.parse(JSON.stringify(items || []));\n /* istanbul ignore else */\n if (filter) {\n results = item_list.filter((item) => {\n let match_count = 0;\n item.match_index = 65535;\n item.match = '';\n const field_list = {};\n // Initialise field match variables\n for (const f of fields) {\n field_list[f] = {\n value: (item[f] || '').toLowerCase(),\n index: 65536,\n matched: 0,\n };\n }\n // Search for matches with the tokenised filter string\n for (const i of parts) {\n /* istanbul ignore else */\n if (i.word) {\n // Check fields for matches\n for (const f of fields) {\n const field = field_list[f];\n const index = field.value.indexOf(i.word);\n field.index = index < field.index ? index : field.index;\n field.matches = (\n field.value.match(i.regex) || []\n ).length;\n field.value = field.value.replace(i.regex, ' ');\n }\n // Update token match count\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.matches >= i.count) {\n match_count++;\n // Update field matches\n let changed = 0;\n const tokens = (\n item[`match_${f}`] ||\n item[f] ||\n ''\n ).split(' ');\n for (const k of tokens) {\n /* istanbul ignore else */\n if (changed >= i.count) {\n break;\n }\n /* istanbul ignore else */\n if (\n k.toLowerCase().indexOf(i.word) >= 0 &&\n k.indexOf('`') < 0\n ) {\n tokens[tokens.indexOf(k)] = k.replace(\n i.regex,\n '`$&`'\n );\n changed++;\n }\n }\n item[`match_${f}`] = tokens.join(' ');\n break;\n }\n }\n }\n }\n // Get field with the most relevent match\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.index < item.match_index && field.index >= 0) {\n item.match_index = field.index;\n item.match = f;\n }\n }\n return (\n item.match_index >= 0 &&\n item.match &&\n match_count >= parts.length\n );\n });\n } else {\n results = item_list;\n }\n // Sort by order of relevence then name\n results.sort((a, b) => {\n const diff = a.match_index - b.match_index;\n return diff === 0 ? a.name.localeCompare(b.name) : diff;\n });\n return results;\n}\n\n/**\n * Convert a match string from `filterList` to renderable HTML\n * @param str Match string to change\n */\nexport function matchToHighlight(str: string): string {\n /* istanbul ignore else */\n if (str) {\n str = str.replace(\n /\\`[a-zA-Z0-9\\@\\.\\_]*\\`/g,\n '$&'\n );\n str = str.replace(/\\`/g, '');\n }\n return str;\n}\n\n/**\n * Convert time string to ms from UTC epoch for today\n * @param time Time string in the format `HH:mm`\n */\nexport function timeToDate(time: string): number {\n const parts = time.split(':');\n const date = DateNow(new Date())\n .setValue({\n hour: +parts[0],\n minute: +parts[1],\n })\n .startOfValue('minute');\n return date.ms;\n}\n\n/**\n * Generate a random number\n * @param ceil Biggest value to generate not inclusive\n * @param floor Smallest value to generate. Defaults to 0\n */\nexport function randomInt(ceil: number, floor: number = 0) {\n return Math.floor(Math.random() * (ceil - floor)) + floor;\n}\n\n/**\n * Get time format string for locale\n * @param isLowerCaseAmPm - if true, we use lowercase for am/pm.\n */\nexport function timeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const hoursMinutes = (): string => (is24HourTime() ? 'HH:mm' : 'h:mma');\n\nexport function dayJsTimeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const dayJsHoursMinutes = (): string =>\n is24HourTime() ? 'HH:mm' : 'h:mm';\n\n/**\n * Converts a timeZone name into a date object.\n * @param timeZoneName - name of timezone\n */\nexport const timezoneNameToDate = (\n timeZoneName: string | undefined\n): DateTZ | undefined => {\n let zone: DateTZ | undefined;\n if (timeZoneName) {\n try {\n zone = DateNow(new Date()).toZone(timeZoneName);\n } catch (e) {\n // invalid timezone. Suppress logs here.\n // console.error(e);\n }\n }\n return zone;\n};\n\nexport const timezoneDisplay = (date: DateTZ) =>\n !!date ? `${date.formatDate('ZZZZ')}` : '';\nexport const gmtOffsetDisplay = (date: DateTZ) =>\n !!date ? `(GMT${date.formatDate('ZZ')})` : '';\n\n/**\n * Returns a full time with timezone.\n * @param date\n */\nexport function timeWithZoneFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${timezoneDisplay(date)}`;\n}\n\nexport function timeWithGmtOffsetFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(date)}`;\n}\n\n/**\n * Returns a full start end range.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}`;\n}\n\n/**\n * Returns a full start end range with timezone.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeWithZoneFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(startDateTz)}`;\n}\n\n/**\n * Returns a full date with weekday day month year.\n * @param date\n * @param comma optional boolean to display a comma after the month\n */\nexport function dateLocalFormatString(date: DateTZ, comma?: boolean): string {\n if (comma) {\n return date.formatLocalDate('cccc d MMMM, yyyy');\n }\n return date.formatLocalDate('cccc d MMMM yyyy');\n}\n\nexport function dateBuildingFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('cccc d MMMM, yyyy');\n }\n return date.formatDate('cccc d MMMM yyyy');\n}\n\nexport function shorterLocalDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatLocalDate('ccc d MMM, yyyy');\n }\n return date.formatLocalDate('ccc d MMM yyyy');\n}\n\nexport function shorterBuildingDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('ccc d MMM, yyyy');\n }\n return date.formatDate('ccc d MMM yyyy');\n}\n\n/** Whether locale string is displayed in 24 hour time */\nexport function is24HourTime(): boolean {\n const date = new Date();\n const localeString = date\n .toLocaleTimeString(\n document.querySelector('html').getAttribute('lang') ||\n navigator.language\n )\n .toLowerCase();\n return localeString.indexOf('am') < 0 && localeString.indexOf('pm') < 0;\n}\n\n/* istanbul ignore next */\n/**\n * Downloads a file to the users computer with the given filename and contents\n * @param filename Name of the file to download\n * @param contents Contents of the file to download\n */\nexport function downloadFile(filename: string, contents: string) {\n const element = document.createElement('a');\n element.setAttribute(\n 'href',\n 'data:text/plain;charset=utf-8,' +\n encodeURIComponent('\\uFEFF' + contents)\n );\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n}\n\n/**\n * Parse raw CSV data into a JSON object\n * @param csv CSV data to parse\n */\nexport function csvToJson(csv: string) {\n const lines = csv.split('\\n');\n let fields = lines.splice(0, 1)[0].split(',');\n fields = fields.map((v) => v.replace('\\r', ''));\n const list: any[] = [];\n for (const line of lines) {\n let parts = line.split(',');\n parts = parts.map((v) => v.replace('\\r', ''));\n /* istanbul ignore else */\n if (parts.length >= fields.length) {\n const item: any = {};\n for (let i = 0; i <= parts.length; i++) {\n let part = null;\n part = parts[i];\n /* istanbul ignore else */\n if (part !== undefined) {\n item[(fields[i] || '').split(' ').join('_').toLowerCase()] =\n part;\n }\n }\n list.push(item);\n }\n }\n\n return list;\n}\n\n/**\n * Convert javascript array to CSV string\n * @param json Javascript array to convert\n */\nexport function jsonToCsv(json: HashMap[]) {\n /* istanbul ignore else */\n if (json instanceof Array && json.length > 0) {\n const keys = Object.keys(json[0]);\n const valid_keys = keys.filter((key) => json[0].hasOwnProperty(key));\n return `${valid_keys.join(',')}\\n${json\n .map((item) =>\n valid_keys\n .map((key) => {\n return typeof item[key] !== 'boolean'\n ? `\"${item[key] || ''}\"`\n : item[key];\n })\n .join(',')\n )\n .join('\\n')}`;\n }\n return '';\n}\n\n/* istanbul ignore next */\n/**\n * detect IE\n * returns version of IE or false, if browser is not Internet Explorer\n */\nexport function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n/**\n * Grab point details from mouse or touch event\n * @param event Event to grab details from\n */\nexport function eventToPoint(event: MouseEvent | TouchEvent): Point {\n if (!event) {\n return { x: -1, y: -1 };\n }\n if (event instanceof MouseEvent) {\n return { x: event.clientX, y: event.clientY };\n } else {\n return event.touches && event.touches.length > 0\n ? { x: event.touches[0].clientX, y: event.touches[0].clientY }\n : { x: -1, y: -1 };\n }\n}\n\n/* istanbul ignore next */\n/**\n * Flatten nested array\n * @param an_array Array to flatten\n */\nexport function flatten(an_array: T[]) {\n const stack = [...an_array];\n const res = [];\n while (stack.length) {\n // pop value from stack\n const next = stack.pop();\n if (Array.isArray(next)) {\n // push back array items, won't modify the original input\n stack.push(...next);\n } else {\n res.push(next);\n }\n }\n // reverse to restore input order\n return res.reverse();\n}\n\nconst seed = xmur3('PlaceOS');\nconst rand = sfc32(0x9e3779b9, 0x243f6a88, 0xb7e15162, seed());\n\nexport function predictableRandomInt(ceil: number = 100, floor: number = 0) {\n return Math.floor(rand() * (ceil - floor)) + floor;\n}\n\n// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript\nfunction xmur3(str) {\n for (var i = 0, h = 1779033703 ^ str.length; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)),\n (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n var t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n\nexport function isLessThanBreakpoint(breakpoint: number): boolean {\n if (window) {\n return window.innerWidth < breakpoint;\n }\n return false;\n}\n\nexport function toTitleCase(str: string): string {\n return typeof str === 'string'\n ? str\n .toLowerCase()\n .split(' ')\n .map(function (word) {\n return word.replace(word[0], word[0].toUpperCase());\n })\n .join(' ')\n : '';\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\nimport { SpaceImageObject } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\n\n@Directive({\n selector: 'a-very-basic-component-image-that-should-not-be-used'\n})\nexport class ImageDirective extends BaseClass implements OnDestroy {\n public foundImages?: SpaceImageObject[];\n public loadImages?: BehaviorSubject\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import {\n Directive,\n ElementRef,\n HostListener\n} from '@angular/core';\n\n@Directive({\n selector: 'input[type=number], input[numbersOnly]'\n})\nexport class NumbersOnlyDirective {\n\n constructor(private _el: ElementRef) {\n }\n\n @HostListener('input', ['$event']) onInputChange(event) {\n const initalValue = this._el.nativeElement.value;\n this._el.nativeElement.value = initalValue.replace(/[^0-9]*/g, '');\n if (initalValue !== this._el.nativeElement.value) {\n event.stopPropagation();\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'replace'\n})\nexport class ReplacePipe implements PipeTransform {\n\n transform(value: string, from: string = '_', to: string = ' '): string {\n return (value|| '').split(from).join(to);\n }\n}\n","export * from './lib/bookings.module';\nexport * from './lib/bookings.actions'\nexport * from './lib/bookings.reducer'\nexport * from './lib/bookings.types'\nexport * from './lib/bookings.utils'\n","\nimport { IBookingQueryOptions, PaginatedBooking } from '@mckinsey-converge/data-common';\nimport { \n createLoadingAction\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n MyBookingsState,\n MyBookingsStoreState,\n} from './bookings.types';\nimport {\n createAction,\n props\n} from '@ngrx/store';\n\nexport const bookingStateSelector = (state: MyBookingsStoreState) => state.bookings;\n\nexport const loadBookingsWithQuery = createAction('[Bookings] Load Bookings with query', props());\n\nexport const loadHomepageBookingsResults = createLoadingAction('HomepageBookings', 'homepage');\n\nexport const loadUpcomingBookingsResults = createLoadingAction('UpcomingBookings', 'upcoming');\n\nexport const loadPastBookingsResults = createLoadingAction('PastBookings', 'past');\n\nexport const loadCancelledBookingsResults = createLoadingAction('CancelledBookings', 'cancelled');\n\nexport const loadBookingByIdResults = createLoadingAction('BookingById', 'bookingById');\n\nexport const clearBookingByIdResults = createAction('[BookingById] Clear Booking Data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n IBookingQueryOptions,\n BookingsPaginatedService\n} from '../../../data-common/src/lib/bookings';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadHomepageBookingsResults,\n loadPastBookingsResults,\n loadUpcomingBookingsResults,\n loadCancelledBookingsResults,\n loadBookingsWithQuery,\n loadBookingByIdResults\n} from './bookings.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n\n} from './bookings.utils';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Injectable()\nexport class BookingsEffects {\n constructor(private actions: Actions,\n private bookingService: BookingsPaginatedService) {\n }\n\n @Effect()\n public afterBookingsRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadBookingsWithQuery),\n mergeMap((action: LoadingAction) => {\n const date = new DateTZ({date: action.from})\n const yourBookingsRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.subtractValue({ minutes: 5 }).seconds}`,\n },\n include_rooms: true\n };\n const upcomingRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.seconds}`,\n },\n include_rooms: true\n };\n const pastRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n end_epoch: `<${date.seconds}`,\n },\n include_rooms: true\n };\n const cancelledRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: true,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n },\n include_rooms: true\n };\n const byIdRequest = {\n email: action.email,\n id: action.id,\n pagination: true,\n limit: 1,\n include_rooms: true\n };\n\n const effects = [];\n switch(action.target) {\n case 'upcoming':\n effects.push(loadUpcomingBookingsResults.request(upcomingRequest));\n break;\n case 'past':\n effects.push(loadPastBookingsResults.request(pastRequest));\n break;\n case 'cancelled':\n effects.push(loadCancelledBookingsResults.request(cancelledRequest));\n break;\n case 'bookingById':\n effects.push(loadBookingByIdResults.request(byIdRequest));\n break\n case 'homepage':\n effects.push(loadHomepageBookingsResults.request(yourBookingsRequest));\n // effects.push(loadPastBookingsResults.request(pastRequest));\n break\n default:\n }\n return effects;\n })\n );\n\n @Effect()\n public loadHomepageBookingsResultsEffect = createLoadingEffect(this.actions, loadHomepageBookingsResults,\n (action) => this.bookingService.userBookings(action, `homepage-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadUpcomingBookingsResultsEffect = createLoadingEffect(this.actions, loadUpcomingBookingsResults,\n (action) => this.bookingService.userBookings(action, `upcoming-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n \n @Effect()\n public loadPastBookingsResultsEffect = createLoadingEffect(this.actions, loadPastBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `past-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadCancelledBookingsResultsEffect = createLoadingEffect(this.actions, loadCancelledBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `cancelled-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadBookingByIdResultsEffect = createLoadingEffect(this.actions, loadBookingByIdResults,\n (action) => \n this.bookingService.userBookings(action, `bookingById-${action.id}`));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingsReducer } from './bookings.reducer';\nimport { BookingsEffects } from './bookings.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([BookingsEffects]),\n StoreModule.forFeature('bookings', bookingsReducer)\n ]\n})\nexport class BookingsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n createReducer,\n on\n} from '@ngrx/store';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n clearBookingByIdResults,\n} from './bookings.actions';\nimport { MyBookingsState } from './bookings.types';\n \nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\n\n\nexport const initialBookingsState: MyBookingsState = {\n query: LoadingModel.empty(),\n homepage: LoadingModel.empty(),\n upcoming: LoadingModel.empty(),\n past: LoadingModel.empty(),\n cancelled: LoadingModel.empty(),\n bookingById: LoadingModel.empty(),\n};\n\nexport const bookingsReducer = createReducer(initialBookingsState,\n on(clearBookingByIdResults, (state: MyBookingsState) => ({\n ...state,\n bookingById: LoadingModel.empty(),\n }) as MyBookingsState),\n ...loadHomepageBookingsResults.ons,\n ...loadUpcomingBookingsResults.ons,\n ...loadPastBookingsResults.ons,\n ...loadCancelledBookingsResults.ons,\n ...loadBookingByIdResults.ons,\n );\n\n\n\n export const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n };\n \n export const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: undefined\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n );\n \n","import { Booking } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport const mapBookingToSelectOption = (booking?: Booking): SelectOption => booking ? ({\n value: booking.id,\n display: booking.name\n}) : undefined;\n","export * from './lib/buildings.module';\nexport * from './lib/buildings.actions'\nexport * from './lib/buildings.types'\nexport * from './lib/buildings.reducer'\n","import { \n createLoadingAction,\n} from '../../../loading/src/lib/loading.actions';\nimport {\n Building,\n BuildingCity,\n} from '../../../data-common/src/lib/organisation/building.class';\nimport {\n BuildingLevel,\n} from '../../../data-common/src/lib/organisation/level.class'\nimport {\n Organisation,\n} from '../../../data-common/src/lib/organisation/organisation.class'\nimport { createSelector } from '@ngrx/store';\nimport {\n BuildingState,\n BuildingStoreState\n} from './buildings.types';\n\nexport const loadBuildings = createLoadingAction('Buildings', 'data');\n\nexport const buildingStateSelector = (state: BuildingStoreState) => state.buildings;\n\nexport const selectLoadBuildingsSuccess = createSelector(buildingStateSelector, loadBuildings.selectors.optionalSuccess);\n\n/**\n * Groups buildings by city\n */\nexport const selectBuildingOptionsGroupedByCity = createSelector(loadBuildings.selectors.optionalSuccess, (success) => {\n if (success) {\n const mapped = new Map();\n success.forEach(s => {\n const found = Array.from(mapped.keys()).find(c => c.name === s.city);\n let list = found ? mapped.get(found) : undefined;\n if (!list) {\n list = [];\n mapped.set({\n name: s.city,\n timezone: s.timezone\n }, list);\n }\n list.push(s);\n });\n return mapped;\n }\n return new Map();\n});\n\nexport const selectLevelByZoneId = createSelector(selectLoadBuildingsSuccess,\n (buildings, param: string) => {\n if (buildings) {\n return buildings.map(b => b.levels.find((l: BuildingLevel) => l.id === param))\n ?.[0] ?? undefined;\n }\n return undefined;\n });\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n Organisation,\n OrganisationService\n} from '../../../data-common/src/lib/organisation';\nimport { loadBuildings } from './buildings.actions';\nimport {\n createLoadingEffect,\n LoadingAction,\n Payload\n} from '@mckinsey-converge/loading';\nimport { loadOrganisations } from '../../../organisation/src/lib/organisation.actions';\nimport { map } from 'rxjs/operators';\n\n\n@Injectable()\nexport class BuildingsEffects {\n\n constructor(private actions: Actions,\n private organizationService: OrganisationService) {\n\n }\n\n @Effect()\n public loadBuildings = createLoadingEffect(this.actions, loadBuildings,\n (action) => this.organizationService.loadBuildingsWithOrg(action));\n\n @Effect()\n public loadBuildingsAfterOrg = this.actions.pipe(\n ofType(loadOrganisations.success),\n map((action: LoadingAction>) => loadBuildings.request(action.payload)));\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { BuildingsEffects } from './buildings.effects';\nimport { StoreModule } from '@ngrx/store';\nimport { buildingsReducer } from './buildings.reducer';\n\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n BuildingsEffects\n ]),\n StoreModule.forFeature('buildings', buildingsReducer)\n ]\n})\nexport class BuildingsModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadBuildings } from './buildings.actions';\nimport { BuildingState } from './buildings.types';\n\nexport const initialBuildingState: BuildingState = {\n data: LoadingModel.empty()\n};\n\nexport const buildingsReducer = createReducer(initialBuildingState,\n ...loadBuildings.ons\n);\n","export * from './lib/data-common.module';\nexport * from './lib/booking';\nexport * from './lib/bookings';\nexport * from './lib/catering';\nexport * from './lib/location';\nexport * from './lib/organisation';\nexport * from './lib/spaces';\nexport * from './lib/users';\nexport * from './lib/app.service';\nexport * from './lib/hotkeys.service';\nexport * from './lib/base.service';\nexport * from './lib/base-api.class';\nexport * from './lib/reports'\nexport * from './lib/service-manager.class';\nexport * from './lib/settings.service';\nexport * from './lib/spec-helpers';\nexport * from './lib/settings.interfaces';\nexport * from './lib/validation.utilities';\nexport * from './lib/status.interfaces';\nexport * from './lib/recurrence/recurrence.utils';\nexport * from './lib/close-modal-dialog-service';\nexport * from './lib/validation.utilities';\nexport * from './lib/collapse-accordion-service';","import { HashMap } from '@mckinsey-converge/base';\n\n/**\n * Convert map into a query string\n * @param map Key value pairs to convert\n */\nexport function toQueryString(map: HashMap) {\n let str = '';\n if (map) {\n for (const key in map) {\n if (map.hasOwnProperty(key) && map[key] !== undefined && map[key] !== null) {\n str += `${(str ? '&' : '')}${key}=${map[key]}`;\n }\n }\n }\n return str;\n}\n","import {\n ApplicationRef,\n Injectable,\n NgZone,\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { take, first } from 'rxjs/operators';\n\nimport { ComposerService } from '@placeos/composer';\nimport { PlaceOSOptions } from '@placeos/ts-client';\nimport { HeapIoService } from '@acaprojects/ngx-heap-io';\n\nimport {\n BehaviorSubject,\n Observable,\n Subject\n} from 'rxjs';\n\nimport {\n ApplicationLoadingState,\n BaseClass,\n ConsoleStream,\n log\n} from '@mckinsey-converge/base';\nimport { SettingsService } from './settings.service';\n\nimport { HotkeysService } from './hotkeys.service';\nimport {\n ApplicationIcon,\n ComposerSettings\n} from './settings.interfaces';\nimport { EnvironmentService } from '../../../environment/src/lib/environment.service'; // '@mckinsey-converge/environment';\nimport {\n Store\n} from '@ngrx/store';\nimport { selectCurrentUser } from '../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../user/src/lib/user.types';\nimport { Booking } from './bookings';\nimport { filter } from 'rxjs/operators';\nimport { SnackBarService } from '../../../ui/src/lib/custom-snackbar-component/custom-snackbar-component.service';\n\ndeclare global {\n interface Window {\n application: ApplicationService;\n mock: {\n enabled: boolean;\n backend: any;\n };\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationService extends BaseClass {\n /** Map of state variables for Service */\n protected _subjects: {\n [key: string]: BehaviorSubject | Subject;\n } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n _kioskFormFilter: boolean;\n\n constructor(\n public store: Store,\n public analytics: HeapIoService,\n private _app_ref: ApplicationRef,\n private _zone: NgZone,\n private _title: Title,\n private _settings: SettingsService,\n private _hotkeys: HotkeysService,\n private _composer: ComposerService,\n private _snackbar: MatSnackBar,\n private _environment: EnvironmentService,\n private snack: SnackBarService\n\n ) {\n super();\n this.set('system', null);\n this.set('title', 'Home');\n this.set('loading', {});\n this.set('CONCIERGE.day_view.viewing', null);\n this.set('undo', new BehaviorSubject<{\n action: 'series' | 'booking',\n booking: Booking\n } | null>(null));\n\n this.set('APP.breakdown', false);\n\n this._app_ref.isStable.pipe(first(_ => _)).subscribe(() => {\n this._zone.run(() => {\n this.log('APP', `Application has stablised.`);\n this.waitForSettings();\n });\n });\n }\n\n public set kioskFormFilter(isIt: boolean) {\n this._kioskFormFilter = isIt;\n }\n\n public get kioskFormFilter():boolean {\n return this._kioskFormFilter \n }\n\n /** Analytics service */\n public get Analytics() {\n return {};\n }\n\n /** Hotkeys service */\n public get Hotkeys() {\n return this._hotkeys;\n }\n\n /**\n * Get a setting from the settings service\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n return this._settings.get(key);\n }\n\n /**\n * Title of the page\n */\n public set title(value: string) {\n const title_suffix = this.setting('app.title');\n this.set('title', value);\n this._title.setTitle(`${value ? value + ' | ' : ''}${title_suffix}`);\n }\n\n /**\n * Title of the page\n */\n public get title(): string {\n return this._title.getTitle();\n }\n\n /** Root API Endpoint */\n public get endpoint() {\n return `/api/staff/`;\n }\n\n /** Root API Endpoint for engine */\n public get engine_endpoint() {\n return this._composer.auth.api_endpoint + '/';\n }\n\n /** Whether settings has been loaded */\n public get has_settings(): boolean {\n return this._settings.is_initialised;\n }\n\n /**\n * Create notification popup\n * @param type CSS Class to add to the notification\n * @param message Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n * @param icon Icon to render to the left of the notification message\n */\n public notify(\n type: string,\n message: string,\n action: string = 'OK',\n on_action?: () => void,\n icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'info'\n }\n ): void {\n this.openSnack(message, type);\n // const snackbar_ref = this._snackbar.open(message, action, {\n // panelClass: [type],\n // duration: 5000\n // });\n // this.subscription(\n // 'snackbar_close',\n // snackbar_ref.afterDismissed().subscribe(() => {\n // this.unsub('snackbar_close');\n // this.unsub('notify');\n // })\n // );\n // if (action) {\n // on_action = on_action || (() => snackbar_ref.dismiss());\n // this.subscription(\n // 'notify',\n // snackbar_ref.onAction().subscribe(() => on_action())\n // );\n // }\n }\n\n public openSnack(message, type) {\n this.snack.openSnackBar(message, type, 5000);\n }\n \n /**\n * Create success notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifySuccess(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'done'\n };\n this.notify('success', msg, action, on_action, icon);\n }\n\n /**\n * Create error notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyError(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'error'\n };\n this.notify('error', msg, action, on_action, icon);\n }\n\n /**\n * Create warning notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyWarn(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'warning'\n };\n this.notify('warn', msg, action, on_action, icon);\n }\n\n /**\n * Create info notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyInfo(msg: string, action?: string, on_action?: () => void): void {\n this.notify('info', msg, action, on_action);\n }\n\n /**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\n public log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false\n ): void {\n log(type, msg, args, stream, force);\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n return this._subjects[name] && this._subjects[name] instanceof BehaviorSubject\n ? (this._subjects[name] as BehaviorSubject).getValue()\n : null;\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n public set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /** Wait for settings to be initialised before setting up the application */\n private waitForSettings() {\n // Wait until the settings have loaded before initialising\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => this.init());\n }\n\n /**\n * Initialise application services\n */\n private init(): void {\n this.setupComposer();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe( filter(user => user !== undefined) )\n .pipe(take(1))\n .subscribe((user: any) => {\n // Once we know we have the user loaded.\n this.setupAnalytics(user?.fmno);\n })\n );\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n this._initialised.next(true);\n });\n // Add service to window if in debug mode\n if (window.debug) {\n window.application = this;\n }\n }\n\n /**\n * Initialise the composer library comms\n */\n private setupComposer(): void {\n this.log('SYSTEM', 'Setup up composer...');\n const loading: ApplicationLoadingState = this.get('loading');\n loading.composer = {\n message: 'Initialising service connection',\n state: 'loading'\n };\n this.set('loading', loading);\n // Get application settings\n const settings: ComposerSettings = this._settings.get('composer') || {};\n const protocol = settings.protocol || location.protocol;\n const host = settings.domain || location.hostname;\n const port = settings.port || location.port;\n const url = settings.use_domain ? `${protocol}//${host}:${port}` : location.origin;\n const route = host.includes('localhost') && port === '4200' ? '' : settings.route || '';\n const mock =\n this._settings.get('mock') ||\n location.href.includes('mock=true') ||\n localStorage.getItem('mock') === 'true';\n // Generate configuration object\n const config: PlaceOSOptions = {\n scope: 'public',\n host: `${host}:${port}`,\n auth_uri: `${url}/auth/oauth/authorize`,\n token_uri: `${url}/auth/token`,\n redirect_uri: `${location.origin}${route}/oauth-resp.html`,\n handle_login: !settings.local_login,\n mock\n };\n this._composer.setup(config);\n loading.composer = {\n message: 'Initialising service connection',\n state: 'complete'\n };\n this.set('loading', loading);\n }\n\n private setupAnalytics(fmno: string) {\n this.log('HEAP', `Loading heap ${this._environment?.heap_io_id}`);\n // Default Heap app ID via the default setting\n const heapIo = this._settings.get('app.heap_io');\n if (this._environment?.heap_io_id) {\n // Apply Heap app ID via the environmental setting\n heapIo.app_id = this._environment.heap_io_id;\n }\n if (heapIo) {\n this.analytics.load(heapIo);\n if (fmno) {\n this.analytics.identify(fmno);\n }\n } else {\n this.log('HEAP', `Heap could not be found for the current frontend ${this._settings.frontend}`);\n }\n }\n\n}\n","import { Subject } from 'rxjs';\n\nimport {\n BaseClass,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n ServiceLike,\n ServiceManager\n} from './service-manager.class';\n\nexport type ApiEventType = 'value_change' | 'item_saved' | 'reset' | 'other';\n\nexport interface ApiEvent {\n type: ApiEventType;\n metadata: T;\n}\n\n\nexport class BaseDataClass extends BaseClass {\n /** Subject for emitting events on the object */\n protected readonly event_subject = new Subject();\n /** Observable for events on this object */\n public readonly events = this.event_subject.asObservable();\n /** Unique Identifier of the object */\n public readonly id: string;\n /** Human readable name of the object */\n public readonly name: string;\n /** Email address associated with the object */\n public readonly email: string;\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(BaseDataClass);\n }\n\n constructor(raw_data: HashMap) {\n super();\n this.id = raw_data.id || raw_data.zone_id || raw_data.email || '';\n this.name = raw_data.name || '';\n this.email = `${raw_data.email || ''}`.toLowerCase();\n }\n\n /**\n * Save pending changes to server\n */\n public save(): Promise {\n if (this._service) {\n const form = this.toJSON();\n return new Promise((resolve, reject) => {\n const promise = this.id\n ? this._service.update(this.id, form)\n : this._service.add(form);\n promise.then(\n (d) => {\n this.event_subject.next({ type: 'item_saved', metadata: d });\n resolve(d);\n },\n (_) => reject(_)\n );\n });\n } else {\n Promise.reject('No service to process request');\n }\n }\n\n /**\n * Delete this item from the server\n */\n public delete(): Promise {\n if (this.id) {\n return this._service.delete(this.id);\n }\n }\n\n /**\n * Run task for this item on the service\n * @param task_name Name of the task\n * @param parameters Parameters to pass to the task request\n */\n public runTask(task_name: string, parameters: HashMap): Promise {\n if (this.id) {\n return this._service.task(this.id, task_name, parameters);\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: BaseDataClass): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._service;\n delete obj._changes;\n delete obj.event_subject;\n delete obj.events;\n // Remove parent private members\n delete obj._timers;\n delete obj._intervals;\n delete obj._subscriptions;\n delete obj._server_names;\n delete obj._initialised;\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substring(1)] || key.substring(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): BaseDataClass {\n return new BaseDataClass(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): BaseDataClass {\n return new BaseDataClass({ ...this, id: null, email: null });\n }\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseDataClass } from './base-api.class';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class BaseAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = typeof query_params.cache !== 'boolean' ? query_params.cache || 1000 : 1000;\n typeof query_params.cache !== 'boolean' && delete query_params.cache;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n // Bring back once implemented in the API\n // if (this.settingsService.concierge) {\n // query = query + '&check_access=true';\n // }\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: T[] | HashMap[] = [];\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n result =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryObsr(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );;\n }\n\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse | HashMap[]{\n let result: IEngineResponse | HashMap[] =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n return result;\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryRoomsForQR(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url);\n }\n \n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public \n task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * V-2\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public taskObsr( \n id: string, \n task_name: string, \n form_data: HashMap = {}, \n method: 'post' | 'get' = 'post' ):Observable{\n const query = toQueryString(this.injectConcierge(form_data));\n let engine = false;\n let cache = 1000;\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n\n const request = method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n \n return request;\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param id url id with respect to update api\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public updateObsr(id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n \n return this.http.put(url, body)\n .pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) \n ),\n catchError((error: any, result?: T) => {\n console.log(error);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n return of(error as T);\n })\n );\n\n }\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public uploadSpacePhotos(apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${apiSubRoute}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n\n const token = sessionStorage.length ? JSON.parse(sessionStorage.getItem('OAUTH.params')).access_token : '';\n\n const headers = new HttpHeaders({\n 'Authorization': `Bearer ${token}`,\n });\n \n const requestOptions = { headers: headers };\n\n // return this.httpClient.post(url, body, {\n // ...requestOptions \n // });\n\n return this.http.post(url, body);\n\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { Building } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { User } from '../users';\nimport { Space } from '../spaces';\nimport { SpaceBookingRuleOptions } from '../spaces/space.class';\nimport {\n BookingFormData,\n} from './booking.form.data';\nimport { statusFromBookings } from '../bookings/booking.utilities';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { SpaceStatus } from '../bookings/space.types';\nimport { SpaceFeatures } from '../spaces/space.class';\nimport { HashMap } from 'libs/base/src/lib/types.utilities';\n\nexport const spaceExtraFeatureToDisplayName = (feature: SpaceFeatures) => {\n switch (feature) {\n case SpaceFeatures.VideoConference:\n return 'Video conference (VC)';\n case SpaceFeatures.ConferencePhone:\n return 'Conference phone';\n case SpaceFeatures.WirelessContentSharing:\n return 'Wireless content sharing';\n case SpaceFeatures.FlipChart:\n return 'Flip chart';\n case SpaceFeatures.Glassboard:\n return 'Glassboard';\n case SpaceFeatures.ElectronicWhiteboard:\n return 'Whiteboard';\n case SpaceFeatures.ConferenceRoom:\n return 'Conference';\n case SpaceFeatures.TeamRoom:\n return 'Team';\n case SpaceFeatures.PartnerOffice:\n return 'Partner';\n case SpaceFeatures.PhoneBooth:\n return 'Phone booth';\n case SpaceFeatures.NaturalLight:\n return 'Room with window only (natural light)';\n case SpaceFeatures.BoardRoom:\n return 'Boardroom room style';\n case SpaceFeatures.CocktailRoom:\n return 'Cocktail room style';\n case SpaceFeatures.TheatreRoom:\n return 'Theatre room style';\n case SpaceFeatures.WorkshopRoom:\n return 'Workshop room style';\n case SpaceFeatures.UShapeRoom:\n return 'U Shape room style';\n case SpaceFeatures.Miscellaneous:\n return 'Miscellaneous room style'\n case SpaceFeatures.Catering:\n return 'Rooms with catering';\n // TODO: add any special display handling here.\n default:\n return feature;\n }\n};\n\n\nexport const instantBookOption: SelectOption = {\n value: 'instant-book',\n display: 'Listing you can book without waiting for a host approval',\n shortDisplay: 'Instant book'\n};\nexport const instantBookOptions: SelectOption[] = [\n instantBookOption\n];\n\nexport const mapSpaceFeaturesToSelectOption = (f: SpaceFeatures): SelectOption => {\n const display = spaceExtraFeatureToDisplayName(f);\n return ({\n value: f,\n display,\n // Useful for long text, like that of the instant-book\n // option.\n //\n // We do not expect this option object to be modified\n // at any further point before it appears on screen -\n // although that may change in future releases.\n shortDisplay: display\n });\n};\n\nexport const roomEquipmentRequiredOptions: SelectOption[] = [\n SpaceFeatures.VideoConference,\n SpaceFeatures.ConferencePhone,\n SpaceFeatures.WirelessContentSharing,\n SpaceFeatures.FlipChart,\n SpaceFeatures.Glassboard,\n SpaceFeatures.ElectronicWhiteboard\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const internalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.PartnerOffice,\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom,\n SpaceFeatures.PhoneBooth\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const externalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomDetailsRequired: SelectOption[] = [\n SpaceFeatures.NaturalLight,\n SpaceFeatures.BoardRoom,\n SpaceFeatures.CocktailRoom,\n SpaceFeatures.TheatreRoom,\n SpaceFeatures.WorkshopRoom,\n SpaceFeatures.UShapeRoom,\n SpaceFeatures.Miscellaneous\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomCateringAvailable: SelectOption[] = [\n SpaceFeatures.Catering,\n].map(mapSpaceFeaturesToSelectOption);\n\n/**\n * Defines the reason by which spaces are filtered out / missing.\n */\nexport enum SpaceFilterReason {\n /**\n * Spaces were shown and not all filtered out.\n */\n None = 'None',\n\n /**\n * If room filters are applied to the set of rooms,\n * and rooms are available if not applied by filtering.\n */\n Filters = 'Filters',\n\n /**\n * We check office rules first to determine if its been filtered.\n */\n OfficeRules = 'OfficeRules',\n\n /**\n * Fallback as the end case if no results are found.\n */\n DateTime = 'DateTime',\n\n /**\n * In case there are no results for a buiding but there are other office buidings in the same city.\n */\n AlternateBuildingsFound = 'AlternateBuildingsFound',\n\n /**\n * If room is non-bookable in the system\n */\n NonBookable = 'NonBookable'\n}\n\nexport interface FilteredSpaces {\n spaces: Space[] | undefined;\n reason: SpaceFilterReason;\n statusMap: HashMap;\n specificReason?: SpaceFilterReason;\n}\n\n/**\n * Filter spaces by filters locally. TBD in the future for real API pagination.\n *\n * @param formFilters - the set of filters to apply on the list of spaces.\n * @param spaces - the list of spaces to filter\n * @param activeForm - the landing page set of filters.\n * @param buildings - the list of buildings loaded, used to retrieve building-specific booking rules.\n * @param currentUser - the current user\n */\nexport const filterSpacesByAppliedFilters = (\n formFilters: SelectOption[],\n spaces: Space[] | undefined, // the resultshere are raw JSON Spaces, not an array of the Space class\n activeForm: BookingFormData,\n buildings: Building[] = [],\n currentUser: User | undefined,\n isStaffMap: boolean = false): FilteredSpaces => {\n const instantBook: boolean = formFilters.some(f => f.value === instantBookOption.value);\n const onlyCatering: boolean = formFilters.some(f => f.value === SpaceFeatures.Catering);\n // Drop incompatible spaces. If no filters were given, just return the array unchanged.\n const featureFilters = formFilters.filter(filter => ![instantBookOption.value, SpaceFeatures.Catering].includes(filter.value));\n const formFiltersEmpty = featureFilters.length === 0;\n\n // R--- refactor activeForm? Only after forms can handle dateTz\n // Blocked by date time input refactor\n const options: SpaceBookingRuleOptions = {\n duration: activeForm.duration,\n host: currentUser,\n dateTz: activeForm.dateTz,\n };\n let rulesCount = 0;\n let ruleReason = '';\n let excludedByFiltersCount = 0;\n const statusMap: HashMap = {};\n // console.group();\n const filteredSpaces = spaces?.map(space => space instanceof Space ? space : new Space(space)).filter(raw_space => {\n const space = new Space(raw_space); // Construct the full fledged space\n const building = buildings.find(b => space.zones.includes(b.id));\n const rules = rulesForSpace({\n time: options?.dateTz?.ms,\n duration: options.duration,\n user: options.host,\n rules: building?.booking_rules,\n space\n });\n ruleReason = rules.reason;\n let valid = !rules.hide;\n if (!valid) {\n rulesCount++;\n return false;\n }\n\n\n // Check for all the form filters ( except 'catering' )\n let hasAllFeatures: boolean;\n const internalRoomTypeFilters = [\n 'conference',\n 'meeting_room',\n 'partner',\n 'phone_booth',\n 'team_room',\n ];\n\n if (featureFilters.length === 0) {\n hasAllFeatures = true;\n } else if(featureFilters.every(f => internalRoomTypeFilters.includes(f.value))) { // If all featureFilters(selected filters) are present in internalRoomTypeFilters, make the filtering inclusive(return on first true) \n hasAllFeatures = featureFilters.some(f => space.featuresArray.includes(f.value));\n } else { // If any featureFilters(selected filters) are not present in internalRoomTypeFilters, make the filtering exclusive(return on first false)\n hasAllFeatures = featureFilters.every(f => space.featuresArray.includes(f.value));\n }\n\n const canBook = instantBook ? space.bookable : true;\n const matchesType = activeForm?.bookingType?.value === 'allRooms'\n ? true\n : space?.internal_or_external?.length\n ? space.internal_or_external === activeForm?.bookingType?.value\n : true;\n valid = valid && matchesType && (formFiltersEmpty || hasAllFeatures) && canBook;\n let hasCatering = building?.has_catering;\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n // need the room catering to override.\n if (onlyCatering && !hasCatering) {\n valid = false;\n // console.log('Excluded by Catering');\n }\n\n // count this space if the only reason it can't be shown is because one of the filters excluded it\n if (!hasAllFeatures) {\n valid = false;\n // console.log('Excluded by Status');\n }\n\n const status = statusFromBookings(\n space.bookings.length ? space.bookings.map(b => new Booking(b)) : space.settings.bookings.map(b => new Booking(b)),\n space.bookable && !rules.hide,\n !rules.auto_approve,\n activeForm.dateTz,\n space\n );\n\n // only compute room availability here right now if instant book option is chosen and room still valid.\n if (instantBook && valid) {\n valid = status.status === SpaceStatus.Available;\n if (!valid) console.group('Excluded by Status');\n \n }\n\n\n /** \n * If there are rooms that are recurring but not available at all during the queried times, we filter them out from the results displayed on the page.\n * The \"Available\" status indicates whether a room can be booked during the queried times.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\n if(activeForm.is_recurrent && !space.availableOccurrences && !isStaffMap) {\n valid = false;\n }\n /** */\n\n // cache space status\n if (valid) {\n if(activeForm.is_recurrent && space.availableOccurrences && space.availableOccurrences<= space.totalOccurrences) {\n // space is available and requested for recurrence booking and few occurences are available to book then let the space select/bookable from map with limited availability\n statusMap[space.id] = !rules.auto_approve ? SpaceStatus.Requestable : SpaceStatus.Available;\n }else\n {\n statusMap[space.id] = status.status;\n }\n \n } else {\n excludedByFiltersCount++;\n }\n // console.log('Valid:', valid);\n return valid;\n });\n\n const buildingsInSameCity = buildings.filter(\n (_) =>activeForm?.location!==undefined && activeForm?.location?.length && _.city === activeForm?.location[0]?.meta?.building?.city\n ) || [];\n const alternateBuildings = buildingsInSameCity.filter(building =>\n !activeForm.location.some(locationItem =>\n locationItem.meta?.building?.id === building.id\n )\n );\n\n // console.groupEnd();\n let reason, specificReason = SpaceFilterReason.None;\n // console.log('Spaces:', filteredSpaces?.length, excludedByFiltersCount, rulesCount, ruleReason)\n if (filteredSpaces?.length === 0) {\n if (excludedByFiltersCount > 0 && (!formFiltersEmpty || onlyCatering)) {\n reason = SpaceFilterReason.Filters;\n } else if (rulesCount > 0) {\n reason = SpaceFilterReason.OfficeRules;\n } else if(alternateBuildings){\n reason = SpaceFilterReason.AlternateBuildingsFound;\n }\n else {\n reason = SpaceFilterReason.DateTime;\n }\n\n if (ruleReason === SpaceFilterReason.OfficeRules) {\n specificReason = SpaceFilterReason.OfficeRules;\n }\n }\n\n return { spaces: filteredSpaces, reason, statusMap, specificReason };\n};\n","import { BookingFormData } from './booking.form.data';\nimport {\n createAction,\n props\n} from '@ngrx/store';\nimport { Payload } from '../../../../loading/src/lib/loading.actions';;\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\n\nexport const storeBookingFormData = createAction('[BookingForm] Store Form Data',\n props>>());\n\nexport const clearBookingFormData = createAction('[BookingForm] Clear Form Data');\n\nexport const storeRoomFilters = createAction('[BookingForm] Store Room Filters',\n props[]>>());\n\nexport const clearRoomFilters = createAction('[BookingForm] Clear Room Filters');\n\nexport const openBookingSurvey = createAction('[BookingSurvey] Open Survey Modal');\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { RoomQueryOptions } from '../../../../rooms/src/lib/rooms.types';\nimport { User } from '../users/user.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { Building } from '../organisation';\n\nexport const DEFAULT_BOOKING_DURATION = 30;\n\nexport const internalBookingTypeOption = {\n value: 'internal',\n display: 'Internal',\n};\n\nexport const allBookingTypeOption = {\n value: 'allRooms',\n display: 'All Rooms',\n};\n\nexport const bookingTypeOptions: SelectOption[] = [\n internalBookingTypeOption,\n {\n value: 'external',\n display: 'External',\n }\n];\n\nexport const defaultRoomSizeOption = {\n value: '2',\n display: '3-9 People',\n};\n\nexport const roomSizeOptions: SelectOption[] = [\n {\n value: '1',\n display: '1-2 People',\n },\n defaultRoomSizeOption,\n {\n value: '3',\n display: '10+ People',\n }\n];\n\nexport const roomSizeOptionsKiosk: SelectOption[] = [\n ...roomSizeOptions,\n {\n value: '4',\n display: 'All Rooms',\n },\n];\n\nexport const roomCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 1;\n case '2':\n return 3;\n case '3':\n return 10;\n case '4':\n return null;\n }\n};\n\nexport const roomMaxCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 2;\n case '2':\n return 9;\n default:\n return null;\n }\n};\n\nexport interface BookingFormData {\n // R--- off the rails, define these \"any's\"\n id?: string;\n location: SelectOption[];\n dateTz: DateTZ;\n /**\n * Duration, in minutes.\n */\n duration: number;\n bookingType: SelectOption;\n roomSize: SelectOption;\n selectedRoom?: any;\n organiser?: SelectOption;\n title?: string;\n attendees?: any[];\n code?: string;\n notes?: string;\n head_count?: number;\n creator?: User;\n company?: any[];\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n action?: string; // helping to set staff app recurring action flag for edit/clone in the active form\n ignore?: string; // helping while editing - recurring series rooms search api call\n bookable?: boolean; // set while editing - recurring series rooms search api call\n occurrence_edits?: string[];\n opt_out?:boolean;\n nextBusinessDay?: boolean; // set property if user room selection from next business day section on result page\n outlook_opt_out?:boolean;\n expanded_section_ids?: string[]; // set property if user room selection from next business day section on result page\n resultLoaded?: number; // set property if user room selection from any section on result page after clicking load more button\n}\n\n/**\n * Converts form data into API query parameters.\n */\nexport const roomFormDataToQuery = (\n data: BookingFormData\n): RoomQueryOptions => {\n // remove all buildings chip from query\n const filteredLocationIds = data?.location\n .filter((l) => l.groupChild)\n .map((l) => l.value)\n .join(',');\n return {\n dateTz: data?.dateTz,\n duration: data?.duration,\n locations: filteredLocationIds,\n capacity: roomCapacityToValue(data?.roomSize?.value),\n capacity_max: roomMaxCapacityToValue(data?.roomSize?.value),\n\n is_recurrent: data?.is_recurrent,\n is_multiroom: data?.is_multiroom,\n merged: data?.merged,\n recurrence_period: data?.recurrence_period,\n recurrence_interval: data?.recurrence_interval,\n recurrence_endTz: data?.recurrence_endTz,\n recurrence_count: data?.recurrence_count,\n recurrence_starts: data?.recurrence_starts,\n recurrence_exceptions: data?.recurrence_exceptions, //SHOULD BE DATETZ\n recurrence_days: data?.recurrence_days,\n timezone: data?.timezone,\n offset: data?.offset,\n buildings: data?.buildings,\n bookable: data?.bookable,\n ignore: data?.ignore\n };\n};\n","import { BookingFormState } from './booking.form.types';\nimport {\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption\n} from './booking.form.data';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nconst now = DateNow(new Date())\n\nexport const defaultTestBookingForm = (): BookingFormState => ({\n activeForm: {\n dateTz: now,\n duration: 2 * DEFAULT_BOOKING_DURATION,\n location: [],\n bookingType: internalBookingTypeOption,\n roomSize: defaultRoomSizeOption\n },\n activeFormFilters: []\n});\n","import { createSelector } from '@ngrx/store';\nimport {\n RoomStoreState\n} from '../../../../rooms/src/lib/rooms.types';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n roomStateSelector,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from '../../../../rooms/src/lib/rooms.actions';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n bookingStateSelector\n} from '../../../../bookings/src/lib/bookings.actions';\nimport { Building } from '../organisation/building.class';\nimport { BuildingStoreState } from '../../../../buildings/src/lib/buildings.types';\nimport { selectLoadBuildingsSuccess } from '../../../../buildings/src/lib/buildings.actions';\nimport { Space } from '../spaces/space.class';\nimport { User } from '../users/user.class';\nimport { selectCurrentUser } from '../../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../../user/src/lib/user.types';\nimport { LoadingModel } from '../../../../loading/src/lib/loading.model';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\nimport {\n SpaceFilterReason,\n filterSpacesByAppliedFilters,\n FilteredSpaces\n} from './booking-filter.utils';\nimport {\n BookingFormData,\n internalBookingTypeOption,\n} from './booking.form.data';\nimport {\n BookingFormState,\n BookingStoreState,\n} from './booking.form.types';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\n\n\nexport const selectBookingFormsData =\n (state: BookingStoreState | RoomStoreState | BuildingStoreState | UserStoreState) =>\n (state as any).bookingForm as BookingFormState;\n\nexport const selectActiveForm = createSelector(selectBookingFormsData, state => {\n // Recreate because serialized form dateTz doesn't have DateTZ class methods\n if (!state.activeForm?.dateTz) {\n return state.activeForm\n }\n const { date, is_local_tz, building_tz} = state.activeForm?.dateTz;\n const endTzDate = state.activeForm?.recurrence_endTz?.date;\n const recurrence_endTz = endTzDate ? {\n recurrence_endTz : new DateTZ({ date: endTzDate.valueOf(), is_local_tz, building_tz })\n } : {};\n\n const recurrence_starts = state.activeForm?.recurrence_starts\n\t\t\t? {\n\t\t\t\t\trecurrence_starts: state.activeForm?.recurrence_starts.map( el =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// at final step of booking creation process recurrence_start becomes Array which need to be Array\n\t\t\t\t\t\t\t// To Do: Refactor - apps/staff/src/app/booking/booking-create/booking-form-base.component.ts lno: 186\n\t\t\t\t\t\t\treturn new DateTZ({ date: typeof el === 'number' ? el * 1000 : el.date.valueOf(), is_local_tz, building_tz })\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\n\n const recEditingSearchPayload = (state.activeForm.action === SeriesAction.EDIT && state.activeForm.is_recurrent)\n\t\t\t?\n\t\t {\n\t\t\t\tid: state.activeForm.id,\n\t\t\t\tignore: state.activeForm.ignore,\n\t\t\t\tbookable: state.activeForm.bookable\n\t\t\t}\n\t\t\t: {};\n\n\n\n\n return {\n ...state.activeForm,\n dateTz: new DateTZ({ date: date.valueOf(), is_local_tz, building_tz }),\n ...recurrence_endTz,\n ...recurrence_starts,\n\t\t\t\t...recEditingSearchPayload\n }\n});\n\nexport const selectBookingType = createSelector(selectActiveForm,\n (form) => form?.bookingType);\n\nexport const selectBookingLocations = createSelector(selectActiveForm,\n (form) => (form?.location || []).filter(f => !f.groupHeader));\n\nexport const selectIsInternal = createSelector(selectBookingType,\n (type) => type?.value === internalBookingTypeOption.value);\n\nexport const selectFormFilters = createSelector(selectBookingFormsData,\n (state) => state.activeFormFilters || []);\n\nconst selectRoomResultsFromState = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.model);\n\nconst selectRoomResultsFromState_map = createSelector(roomStateSelector,\n loadRoomsForResultsMap.selectors.model);\n\nconst selectLaterThatDayResultsFromState = createSelector(roomStateSelector,\n loadLaterThatDayResults.selectors.model);\nconst selectNextDayResultsFromState = createSelector(roomStateSelector,\n loadNextDayResults.selectors.model);\nconst selectByIdResultsFromState = createSelector(roomStateSelector,\n loadByIdResults.selectors.model);\nconst selectDiffSizeResultsFromState = createSelector(roomStateSelector,\n loadDiffSizeResults.selectors.model);\n\nexport const selectHomepageBookingsResultsFromState = createSelector(bookingStateSelector,\n loadHomepageBookingsResults.selectors.model);\nexport const selectUpcomingBookingsResultsFromState = createSelector(bookingStateSelector,\n loadUpcomingBookingsResults.selectors.model);\nexport const selectPastBookingsResultsFromState = createSelector(bookingStateSelector,\n loadPastBookingsResults.selectors.model);\nexport const selectCancelledBookingsResultsFromState = createSelector(bookingStateSelector,\n loadCancelledBookingsResults.selectors.model);\nexport const selectBookingByIdResultsFromState = createSelector(bookingStateSelector,\n loadBookingByIdResults.selectors.model);\n\n/**\n * Wraps {@link filterSpacesByAppliedFilters} with {@link LoadingModel} interop.\n * This will only filter data if there is data to filter, and returns a success {@link LoadingModel}.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\nconst filterSpacesByAppliedFiltersIfSuccess = (\n results: LoadingModel,\n formFilters: SelectOption[],\n activeForm: BookingFormData,\n buildings: Building[] | undefined,\n currentUser: User | undefined,\n isStaffMap: boolean = false): LoadingModel => {\n const data = results.optionalSuccess;\n\n // don't filter model if no success found\n return !activeForm ? results.mutate({\n spaces: data, // the result here is a raw JSON Space, not the Space class\n reason: SpaceFilterReason.None,\n statusMap: {}\n }) : results.mutate(\n filterSpacesByAppliedFilters(formFilters, data, activeForm, buildings || activeForm.buildings, currentUser, isStaffMap));\n};\n\nexport const selectFilteredResults = createSelector(selectRoomResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectMapFilteredResults = createSelector(selectRoomResultsFromState_map,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser, isStaffMap) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser, true));\n\nexport const selectFilteredLaterDayResults = createSelector(selectLaterThatDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectFilteredNextDayResults = createSelector(selectNextDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n\nexport const selectFilteredByIdResults = createSelector(selectByIdResultsFromState,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser));\n\nexport const selectFilteredDiffSizeResults = createSelector(selectDiffSizeResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n/**\n * Maps selected options by loaded buildings.\n */\nexport const selectSelectedBuildingOptions = createSelector(\n selectBookingLocations,\n selectLoadBuildingsSuccess,\n (locations, buildings) => (locations\n .map(l => buildings?.find(b => b.id === l.value))\n .filter(f => !!f) as Building[])\n);\n\n","import { Building, BuildingCity } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { BuildingLevel } from '../organisation/level.class';\nimport { Space } from '../spaces/space.class';\nimport { SpacesService } from '../spaces/spaces.service';\nimport {\n timezoneDisplay,\n timezoneNameToDate,\n unique,\n ImageDirective,\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * If more than 3 are selected, we truncate location display.\n */\nconst MAX_ABBREV_LOCATIONS = 3;\n\nexport const mapBuildingToSelectOption = (\n city: string,\n building: Building\n): SelectOption => ({\n display: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n dropdownOverride: `${building.code}-${building.name}, ${building.address}`,\n value: building.id,\n groupId: city,\n groupChild: true,\n shortDisplay: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n meta: { building, city },\n});\n\nexport const mapCityToAllSelectOption = (\n city: BuildingCity\n): SelectOption => ({\n display: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n value: city.name,\n groupHeader: true,\n groupId: city.name,\n shortDisplay: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n meta: { city },\n});\n\n/**\n * Flattens a map of {@link BuildingCity} to {@link Building} array into a list of {@link SelectOption}.\n * @param grouped The grouping\n */\nexport const flattenDisplayOffices = (\n grouped: Map\n) => {\n const options: SelectOption[] = [];\n grouped.forEach((value, key) => {\n options.push(mapCityToAllSelectOption(key));\n value.forEach((b) =>\n options.push(mapBuildingToSelectOption(key.name, b))\n );\n });\n return options;\n};\n\n/**\n * This method will either add or remove a selected option from the selectedOptions list based on\n * these conditions:\n * 1. If the option EXISTS in the list AND is a groupHeader, de-select all of its children.\n * 2. If the option EXISTS in the list AND is a groupChild, remove it and its associated header from the list.\n * 3. If the option does NOT EXIST in the list AND is a groupHeader, select all other children.\n * 4. If the option does NOT EXIST in the list AND is a groupChild, add it to the list.\n *\n * Special note regarding item 4:\n * 4a. If that selection completes the children selection, select its associated header as well.\n */\nexport const toggleSelectedByGroup = (\n options: SelectOption[],\n selectedOptions: SelectOption[],\n option: SelectOption\n) => {\n if (selectedOptions.find((s) => s.value === option.value)) {\n return selectedOptions.filter((s) => {\n let filter = s.value !== option.value;\n // if group header, also remove any option that is the child of it.\n if (option.groupHeader) {\n filter =\n filter &&\n (!s.groupChild ||\n (s.groupChild && s.groupId !== option.groupId));\n } else if (option.groupChild) {\n // if child removing, remove the associated header.\n filter =\n filter &&\n (!s.groupHeader ||\n (s.groupHeader && s.groupId !== option.groupId));\n }\n return filter;\n });\n }\n // option does NOT EXIST\n // if adding header, add the other children to the selected list, ensuring no dupes.\n if (option.groupHeader) {\n const toSelect = options.filter(\n (v) =>\n v.groupChild &&\n v.groupId === option.value &&\n !selectedOptions.find((selected) => selected.value === v.value)\n );\n return [...selectedOptions, option, ...toSelect];\n }\n // add group child, add the group header if all satisfied\n const newGroup = [...selectedOptions, option];\n\n // check if we have selected all children from options by filtering down by city and checking if\n // they're in the selected options list.\n const remainingChildrenInGroup = options.filter(\n (o) =>\n o.groupChild &&\n o.groupId === option.groupId &&\n !newGroup.find((ng) => ng.value === o.value)\n );\n // if we dont have remaining children, add the group\n if (remainingChildrenInGroup.length === 0) {\n return [\n ...newGroup,\n options.find((o) => o.groupHeader && o.groupId === option.groupId),\n ];\n }\n return newGroup;\n};\n\n/**\n * If the list of locations are larger than {@link MAX_ABBREV_LOCATIONS}, then truncate\n * and display the remaining count.\n */\nexport const truncateLocationList = (\n locations: readonly SelectOption[]\n): string => {\n // comma separate the locations\n let truncatedLocations = [...locations];\n const shouldTruncate = locations.length > MAX_ABBREV_LOCATIONS;\n if (shouldTruncate) {\n truncatedLocations = truncatedLocations.splice(0, MAX_ABBREV_LOCATIONS);\n }\n let display = truncatedLocations\n .map((l) => l.shortDisplay || l.display)\n .join(', ');\n if (shouldTruncate) {\n display += `...(${locations.length})`;\n }\n return display;\n};\n\nexport const mapBuildingLevelToOption = (\n level?: BuildingLevel\n): SelectOption =>\n level\n ? {\n value: level.id,\n display: level.name,\n }\n : undefined;\n\n/**\n * Returns all levels included with the building, deduped.\n * @param buildings\n */\nexport const flattenBuildingsWithLevels = (buildings: Building[]) => {\n const flattenedLevels = unique(\n buildings.reduce((next: BuildingLevel[], building: Building) => {\n next.push(...building.levels);\n return next;\n }, []),\n 'id'\n );\n return {\n flattenedLevels,\n buildings,\n };\n};\n\n/** Gets route to image placeholder if room image isn't found */\n\nexport const placeholderRoute = (num: number): string => {\n let index: number;\n if (num <= 3) {\n index = num;\n } else if (num % 3 === 0) {\n index = 3;\n } else {\n index = 1;\n }\n return `assets/img/rooms/placeholder-${index}.png`;\n};\n\n/**\n * Method takes the rootFolderURL and fileSlug to create an array of three images\n * that should exist. If a room image exists, it replaces the placehoder image.\n */\nexport const setupRoomImages = (\n componentReference: ImageDirective,\n image_positions: number[],\n rootFolderURL: string,\n fileSlug: string,\n imagesLoaded: boolean = false\n): void => {\n let foundImages: any[] = image_positions.map((i) =>\n i ? { path: placeholderRoute(i) } : false\n );\n image_positions.forEach((n) => {\n const desiredImageName = `${rootFolderURL}${fileSlug}-part-${n}.png`;\n const desiredImage = location.pathname.includes('concierge') ? `${location.origin}/staff/${desiredImageName}` : desiredImageName;\n if (!imagesLoaded) {\n const tester = new Image();\n tester.onload = () => {\n // Will never run on unit test\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = [...foundImages.slice()];\n componentReference?.loadImages && componentReference?.loadImages.next([...foundImages.slice()]);\n };\n tester.src = desiredImage;\n }\n\n // Force valid image output on unit test\n if (imagesLoaded) {\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = foundImages.slice();\n }\n });\n};\n\nexport const bookingStatusDetails = (booking: Booking) => {\n const now = DateNow(new Date());\n let image = '';\n let text = '';\n let title = '';\n\n if (booking?.status) {\n const status = now > booking.endDateTz ? 'expired' : booking.status;\n switch (status) {\n case 'unavailable':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Unavailable';\n text = 'Unavailable';\n break;\n case 'declined':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'cancelled':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'expired':\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n case 'tentative':\n image = 'assets/icon/booking_pending.svg';\n title = 'Requested';\n text = 'Pending';\n break;\n case 'accepted':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n case 'approved':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n default:\n // TODO\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n }\n }\n return { text, title, image };\n};\n\nexport const roomHasCateringHours = (building: Building, space: Space) => {\n let hasCatering = building\n ? building.has_catering && building.catering_hours\n : false;\n // Room catering status as false overrides building status\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n};\n\nexport const cateringAllowed = (booking: Booking, building: Building) => {\n const status = bookingStatusDetails(booking);\n const disallowedStatus = ['declined', 'cancelled', 'expired'].includes(\n status.text\n );\n const opens = building?.catering_hours?.start;\n const closed = building?.catering_hours?.end;\n\n if (disallowedStatus) {\n return false;\n }\n\n if (typeof opens === 'undefined' || typeof closed === 'undefined') {\n return false;\n }\n\n // Catering time could be a decimal so convert to a date\n const openMinutes = opens * 60;\n const closeMinutes = closed * 60;\n\n const startOfDay = booking.startDateTz.startOfValue('day');\n const cateringOpenTime = startOfDay.addValue({ minutes: openMinutes });\n const cateringCloseTime = startOfDay.addValue({ minutes: closeMinutes });\n\n if (\n cateringOpenTime.ms <= booking.startDateTz.ms ||\n cateringCloseTime.ms > booking.startDateTz.ms\n ) {\n // Booking ends before catering opens\n if (booking.endDateTz.ms <= cateringOpenTime.ms) {\n return false;\n }\n // Booking starts after catering closes\n if (booking.startDateTz.ms > cateringCloseTime.ms) {\n return false;\n }\n\n // Start time is OK\n if (booking.startDateTz.ms > DateNow(new Date()).ms) {\n // Due to COVID, no orders are available once a meeting begins.\n return true;\n }\n }\n\n return false;\n};\n\nexport const checkCollisions = (\n service: SpacesService,\n booking: Booking\n): Promise => {\n return new Promise((resolve, reject) => {\n\n let availabilityParams: {\n room_ids: string;\n dateTz: DateTZ;\n duration: number;\n setup: number;\n breakdown: number;\n hide_bookings: boolean;\n [key: string]: any;\n } = {\n room_ids: booking.space.id,\n dateTz: booking.startDateTz,\n duration: booking.duration,\n setup: booking.setup[booking.space.email],\n breakdown: booking.breakdown[booking.space.email],\n hide_bookings: false,\n };\n\n if (booking.recurrence_type === \"master\" || booking.recurrence_type === null) {\n availabilityParams = {\n ...availabilityParams,\n ignore: booking?.icaluid,\n recurrence_count: booking?.recurrence_count,\n recurrence_period: booking?.recurrence_period,\n recurrence_endTz: booking?.recurrence_endTz,\n recurrence_interval: booking?.recurrence_interval,\n recurrence_starts: booking?.recurrence_starts,\n is_recurrent: booking?.is_recurrent,\n recurrence_days: booking?.recurrence_days\n } as typeof availabilityParams;\n }\n\n service\n .available(\n availabilityParams,\n null,\n false\n )\n .then(\n (list) => {\n const space = list.length ? list[0] : null;\n if (space) {\n if (!space.bookable) return reject('Has conflict');\n const setup = booking?.setup[space?.email] || 0;\n const breakdown = booking?.breakdown[space?.email] || 0;\n const start_time = booking?.startDateTz.seconds - setup;\n const end_time = booking.endDateTz.seconds + breakdown;\n\n const bookings = space.settings.bookings;\n // console.log('Bookings:', bookings);\n // Compare the existing bookings to see if any truely conflict.\n if (bookings.length) {\n const has_conflict = bookings.find(bkn => {\n const b_setup = bkn.setup[space.email] || 0;\n const b_breakdown = bkn.setup[space.email] || 0;\n const start = (bkn.start_epoch || bkn.start) - b_setup;\n const end = (bkn.end_epoch || bkn.end) + b_breakdown;\n return (\n (end_time > start && end_time <= end) || // Booking ends during the meeting\n (start_time >= start && start_time < end) || // Booking starts during a meeting\n (start_time <= start && end_time >= end) // Booking overlaps entire meeting\n ) && \n ( \n bkn.id !== booking.id \n || \n ( !!booking.is_recurrent && (booking.recurrence_type === \"master\" || booking.recurrence_type === null ) ) \n ?\n bkn.recurrence_master_id !== booking.id\n :\n false\n \n )\n\n\n\n });\n // Conflicts found, reject\n if (has_conflict) return reject('has booking conflict');\n }\n return resolve(space.bookable);\n }\n reject('space not found');\n },\n () => reject('available error')\n );\n });\n};\n\nexport const getStatusErrorMessage = (status?: number) => {\n let msg = '';\n switch (status) {\n\t\t\tcase 400:\n\t\t\t\tmsg = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\tbreak;\n\t\t\tcase 403:\n\t\t\t\tmsg = 'Your do not have permission to update this booking.';\n\t\t\t\tbreak;\n\t\t\tcase 409:\n\t\t\t\tmsg = 'Sorry, your booking time conflicts with another booking.';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmsg = 'Your booking failed to update, please try again';\n }\n return msg;\n};\n","export * from './room-results/room-results.viewmodel'\nexport * from './booking-filter.utils'\nexport * from './booking.form.actions'\nexport * from './booking.form.data'\nexport * from './booking.form.spec-helpers'\nexport * from './booking.form.types'\nexport * from './booking.selectors'\nexport * from './booking.utils'","import { Space } from '../../spaces/space.class';\nimport { BuildingLevel } from '../../organisation/level.class';\nimport { Building } from '../../organisation/building.class';\n\nexport class RoomResultsViewModel {\n\n public levelDisplay: string;\n public title: string;\n public office: string;\n public capacity: string;\n\n constructor(public space: Space,\n public level?: BuildingLevel,\n public building?: Building) {\n\n this.levelDisplay = `Level ${this.space?.level?.short_name}`;\n this.title = this.space.local_name;\n this.office = this.building ? `(${this.building?.code}) ${this.building?.name}` : '';\n this.capacity = `Capacity: ${this.space.capacity} people`;\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Space[],\n flattenedLevels: BuildingLevel[],\n buildings: Building[]): RoomResultsViewModel[] =>\n results.map((r: Space) => {\n const level = flattenedLevels.find(l => r.zones.includes(l.id));\n const building = buildings.find(b => r.zones.includes(b.id));\n return new RoomResultsViewModel(\n r,\n level,\n building\n );\n });\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, combineLatest, of, Observable } from 'rxjs';\nimport {\n catchError,\n debounceTime,\n filter,\n first,\n map,\n shareReplay,\n switchMap,\n} from 'rxjs/operators';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { replaceBookings, timePeriodsIntersect } from './booking.utilities';\nimport { SpacesService } from '../spaces/spaces.service';\nimport { Booking } from '../bookings/booking.class';\nimport { Space } from '../spaces/space.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { OrganisationService } from '../organisation/organisation.service';\n\nexport type BookingType =\n | 'internal'\n | 'client'\n | 'external'\n | 'setup'\n | 'training'\n | 'interview'\n | 'declined';\n\nexport interface BookingFilters {\n /** List of zone ids to get bookings for */\n zone_ids?: string[];\n space_emails?: string[];\n hide_type?: BookingType[];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class BookingStateService extends BaseClass {\n /** List of bookings */\n private _poll = new BehaviorSubject(false);\n /** List of bookings */\n private _long_poll = new BehaviorSubject<'month' | ''>('');\n private _long_poll_week = new BehaviorSubject<'week' | ''>('');\n /** List of bookings */\n private _bookings = new BehaviorSubject([]);\n /** List of meeting count per date */\n public _noOfMeetings = new BehaviorSubject<{}>({});\n /** Filter details for bookings */\n private _filters = new BehaviorSubject({});\n /** Currently active date */\n private _dateTz = new BehaviorSubject(DateNow(new Date()));\n /** Currently displayed zone */\n private _zone = new BehaviorSubject(' ');\n /** Whether booking data is being loaded */\n private _loading = new BehaviorSubject(false);\n /** Observable for filter and booking list changes */\n private _state = combineLatest(\n this._bookings,\n this._filters,\n this._dateTz,\n this._zone\n );\n\n /** Observable for list of bookings */\n public readonly bookings = this._bookings.asObservable();\n /** Observable for active date */\n public readonly dateTz = this._dateTz.asObservable();\n /** Observable for active zone */ // R-- zone was this._date.asObservable(); this looks like a mistake but it exists from the beginning of time\n public readonly zone = this._dateTz.asObservable();\n /** Observable for loading state of bookings */\n public readonly loading = this._loading.asObservable();\n\n public get booking_date() {\n // When this class is initialized this._dateTz is local timezone\n return this._dateTz.value;\n }\n\n public get timezone() {\n return localStorage.getItem('CONCIERGE.timezone');\n }\n\n /** Obsevable for filtered list of bookings */\n public readonly filtered = this._state.pipe(\n map((state) => {\n const bdTz = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const startTz = bdTz.startOfValue('day');\n const endTz = startTz.addValue({}).endOfValue('day');\n return this.filterBookings(startTz, endTz);\n }),\n shareReplay(1)\n );\n\n /** Obsevable for filtered list of bookings of the active week */\n public readonly filtered_week = this._state.pipe(\n map(() => {\n // Tested to be valid in building time now.\n const bd = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const start = bd.startOfValue('week').startOfValue('day');\n const end = this.getEndOfWeek(bd);\n return this.filterBookings(start, end);\n })\n );\n\n /** Obsevable for filtered list of bookings for active month */\n public readonly filtered_month = this._state.pipe(\n map(() => {\n const start = this.booking_date.startOfValue('month');\n const end = this.booking_date.endOfValue('month');\n return this.filterBookings(start, end);\n })\n );\n\n /** Active filters */\n public get filters() {\n return this._filters.getValue();\n }\n\n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private ngZone: NgZone,\n ) {\n super();\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Just to get the timezone correct\n this._dateTz.next(\n new DateTZ({\n date: this._dateTz.value.ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone,\n })\n );\n });\n\n /** Generate observable for updating bookings */\n const search = combineLatest(this._poll, this._zone, this._dateTz).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap(() => {\n const fzone = this._zone.getValue();\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n const start = this.booking_date.startOfValue('day');\n const end = start.endOfValue('day');\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start.seconds,\n available_to: end.seconds,\n });\n }),\n catchError(() => of([]))\n );\n\n const search_long_week = combineLatest(\n this._long_poll_week,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, false);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n\n //TO DO: make sure both spaces have same booking\n /** Subscribe to update observable */\n search.subscribe((space_list) => {\n this.processBookings(space_list);\n this._loading.next(false);\n });\n search_long_week.subscribe((space_list) => {\n this.processBookings(space_list, this._long_poll_week.getValue() as any);\n this._loading.next(false);\n });\n }\n\n /**\n * Function to build\n */\n private buildSpaceLongQuery(dailyCount: boolean = false): Observable {\n return combineLatest(\n this._long_poll,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = dailyCount ? this._org.building.id : props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, dailyCount);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n }\n\n private querySpace(type: string, fzone: string, dateTz: DateTZ, dailyCount: boolean = false) : Observable | Observable{\n const start = () => {\n const s = dateTz;\n if (type === 'week') {\n return s.startOfValue('week');\n } else {\n return s.startOfValue('month');\n }\n };\n\n const end = () => {\n const e = start();\n if (type === 'week') {\n /**\n * To Do: date-tz.class.ts endOfValue subtracts 1 day from end of week for 7 days a week type which returns Friday instead of Saturday\n * below is the adjustment -\n */\n return e.addValue({ days: 1 }).endOfValue('week');\n } else {\n return e.endOfValue('month');\n }\n /**\n * R--- when testing March 2022 London offices, the month is an hour short.\n * Is this a Luxon bug or London DST?\n */\n };\n\n // dates here are ok\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start().seconds,\n available_to: end().seconds,\n ...(dailyCount) ? { daily_count: true } : ''\n });\n }\n\n\n public getDailyMeetingCount() : void {\n this._long_poll.next('month');\n this.buildSpaceLongQuery(true).subscribe((counts) => {\n this._noOfMeetings.next(counts);\n this._loading.next(false);\n });\n }\n\n /**\n * Update the booking filters\n * @param details\n */\n public setFilters(details: BookingFilters) {\n this._filters.next(details);\n }\n\n /**\n * Update the booking date\n * @param details\n */\n public setDate(dateTz: DateTZ) {\n this._dateTz.next(dateTz);\n }\n\n /**\n * Update the booking's zone\n * @param details\n */\n public setZone(zone: string) {\n this._zone.next(zone);\n }\n\n /**\n * update day view once\n */\n public pollOnce(){\n this._poll.next(true);\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPolling(delay: number = 30 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingWeek(delay: number = 4 * 30 * 1000 ) {\n this._long_poll_week.next('week');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll_week.next('week'),\n delay\n );\n });\n }\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingEveryFiveMin(delay: number = 60 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingMonth(delay: number = 5 * 60 * 1000) {\n this._long_poll.next('month');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll.next('month'),\n delay\n );\n });\n }\n\n\n /**\n * Stop polling to update bookings;\n */\n public stopPolling() {\n this._poll.next(false);\n this.clearInterval('polling');\n this._long_poll.next('');\n this.clearInterval('polling_long');\n }\n\n public updateRoomList() {\n this._spaces.updateRoomList();\n }\n\n /**\n * Add booking to bookings listing\n * @param booking\n */\n public add(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Update booking in the bookings list\n * @param booking\n */\n public replace(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings\n .filter(\n (bkn) =>\n bkn.icaluid !== booking.icaluid && bkn.id !== booking.id\n )\n .concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Remove booking in the bookings list\n * @param booking\n */\n public remove(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.filter(\n (bkn) => bkn.icaluid !== booking.icaluid\n );\n this._bookings.next(new_bookings);\n }\n\n public attentToDelete(\n booking: Booking,\n action: 'series' | 'booking' = 'booking',\n undo: boolean = false\n ) {\n const bookings = this._bookings.getValue();\n const attempted_to_delete = ((action) => {\n return (bkg: Booking) => {\n switch (action) {\n case 'booking': {\n const booking_master = bookings.find(\n (bkn) => bkn.icaluid === booking.icaluid\n );\n if (!booking_master) return false;\n return bkg.id === booking.id;\n }\n case 'series': {\n const booking_master = bookings.find(\n (bkg) =>\n bkg.id ===\n (booking.recurrence_type === 'occurrence'\n ? booking.recurrence_master_id\n : booking.id)\n );\n if (!booking_master) return false;\n return (\n booking_master.id === bkg.id ||\n bkg.recurrence_master_id === booking_master.id\n );\n }\n default:\n false;\n }\n };\n })(action);\n\n const new_bookings = [...bookings].map((bkg) => {\n if (!undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = action;\n }\n\n if (undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = null;\n }\n\n return bkg;\n });\n\n this._bookings.next(new_bookings);\n }\n\n private processBookings(\n space_list: Space[],\n period: 'day' | 'week' | 'month' = 'day'\n ) {\n const start = () => {\n switch (period) {\n case 'month':\n return this.booking_date.startOfValue('month');\n case 'week':\n return this.booking_date.startOfValue('week');\n default:\n return this.booking_date.startOfValue('day');\n }\n };\n const end = () => {\n const s = start();\n switch (period) {\n case 'month':\n return s.endOfValue('month');\n case 'week':\n return s.endOfValue('week');\n default:\n return s.endOfValue('day');\n }\n };\n\n let bookings = this._bookings.getValue();\n space_list.forEach((space) => {\n return (bookings = replaceBookings(\n bookings,\n space.bookings.map((bkn) => new Booking(bkn)),\n {\n room_email: space.email,\n fromTz: start(),\n toTz: end(),\n }\n ));\n });\n this._bookings.next(bookings);\n }\n\n // private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n // const filters = this._filters.getValue();\n // const bookings = this._bookings.getValue();\n // const fzone = this._zone.getValue();\n // return bookings.filter((bkn) => {\n // const intersects = timePeriodsIntersect(\n // startTz.ms,\n // endTz.ms,\n // bkn.startDateTz.ms,\n // bkn.endDateTz.ms\n // );\n // const in_zone = bkn.room.zones.includes(fzone);\n // const has_space =\n // !filters.space_emails?.length ||\n // filters.space_emails.includes(bkn.room.email);\n // const in_zones =\n // !filters.zone_ids?.length ||\n // !!bkn.room.zones.find((zone) =>\n // filters.zone_ids.includes(zone)\n // );\n // const type = bkn.declined ? 'declined' : bkn.getType();\n\n // const show =\n // !filters.hide_type?.length ||\n // !filters.hide_type.includes(type as any);\n // return intersects && has_space && in_zone && in_zones && show;\n // });\n // }\n\n private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n const filters = this._filters.getValue();\n const bookings = this._bookings.getValue();\n const fzone = this._zone.getValue();\n return bookings.filter((bkn) => {\n const intersects = timePeriodsIntersect(\n startTz.ms,\n endTz.ms,\n bkn.startDateTz.ms,\n bkn.endDateTz.ms\n );\n // Check if any room in the booking satisfies the conditions\n const roomSatisfiesConditions = bkn.multi_rooms.some((room) => {\n const in_zone = room.zones.includes(fzone);\n const has_space =\n !filters.space_emails?.length ||\n filters.space_emails.includes(room.email);\n const in_zones =\n !filters.zone_ids?.length ||\n !!room.zones.find((zone) => filters.zone_ids.includes(zone));\n return in_zone && has_space && in_zones;\n });\n \n const type = bkn.declined ? 'declined' : bkn.getType();\n \n const show =\n !filters.hide_type?.length ||\n !filters.hide_type.includes(type as any);\n return intersects && roomSatisfiesConditions && show;\n });\n } \n\n /**If Sunday add one day to get Saturday as end of week */\n private getEndOfWeek(date: DateTZ): DateTZ {\n return date.dateWeekday === 7\n ? date.addValue({ days: 1 }).endOfValue('week').endOfValue('day')\n : date.endOfValue('week').endOfValue('day');\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport { CateringOrder } from '../catering';\nimport { User } from '../users';\nimport {\n flatten,\n HashMap,\n humaniseDuration,\n shorterBuildingDateFormatString,\n shorterLocalDateFormatString,\n toTitleCase,\n unique\n} from '@mckinsey-converge/base';\nimport { Space } from '../spaces/space.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport {\n BookingNote,\n} from './booking.types';\nimport { convertLocalTimestampToTimezonedDateTz, DateNow, DateTZ, getTimezoneOffsetString } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, getLastDateFromList, handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { findSpace } from '../spaces';\nimport { DateTime } from 'luxon';\n\n\nexport interface IBookingQueryOptions {\n /** booking ID */\n id?: string;\n email?: string;\n target?: string;\n from?: number; // R--- depreciate\n until?: number; // R--- depreciate\n fromTz?: DateTZ;\n untilTz?: DateTZ;\n show_cancelled?: boolean;\n pagination?: boolean;\n limit?: number;\n offset?: number;\n sort?: string,\n filters?: any;\n include_rooms?: boolean;\n building_zone?: string;\n}\n\nexport class Booking extends BaseDataClass {\n /** Unique calendar event ID */\n // public readonly icaluid: string;\n /** Subject or title of the booking */\n public title: string;\n /** Luxon based date class of the booking start time */\n public startDateTz: DateTZ;\n /** Luxon based date class of the booking start time */\n public endDateTz: DateTZ;\n /** Description or details of the booking */\n public readonly body: string;\n /** Type of booking */\n public readonly booking_type: string;\n /** List of catering orders for the booking */\n public catering: readonly CateringOrder[];\n /** Whether booking's duration covers all day */\n public readonly all_day: boolean;\n /** Mapping of emails to approval statuses */\n public approval_status: HashMap;\n /**\n * New booking approval status set in constructor\n *\n * timeBasedStatusLabel is a getter calculated via current time, some parts of the application\n * may use status when it should use timeBasedStatusLabel\n */\n public status: 'tentative' | 'accepted' | 'approved' | 'declined' | 'cancelled' | 'expired' | 'unavailable';\n /** Host/Organiser of the booking */\n public organiser: User;\n /** List of people invited to attend the booking */\n public attendees: User[];\n /** Author of the booking */\n public readonly creator: User;\n\n /** List of notes associated with the booking */\n public notes: readonly BookingNote[];\n /** Mapping of spaces to equipment charge codes */\n public equipment_codes: HashMap;\n /** Mapping of spaces to expected number of attendees */\n public expected_attendees: HashMap;\n /** Map of space emails to the setup time before the meeting in minutes */\n public setup: HashMap;\n /** List of checked in attendees */\n public check_ins: object;\n /** Map of space emails to the breakdown time before the meeting in minutes */\n public breakdown: HashMap;\n /** List of fields edited since creation */\n public readonly edits: string[];\n /** List of users to be notified on visitor arrivals */\n public readonly notify_users: readonly string[];\n /** Whether the time or duration has changed */\n public time_changed = false;\n /**\n * Booking Space\n * Bookings only have one room on MCK\n */\n public room: Space;\n /** building_zone */\n public building_zone: string;\n /** Initialized Timezone */\n public timezone: string;\n /** Array of company names */\n public company?: string[];\n /** Flag for multiroom booking */\n public is_multiroom: boolean;\n /** Multiroom booking ID */\n public multiroom_master_id: string; \n /** Merged - field holds flag for merged-multiroom booking which tightly coupled with multiroom booking only */\n public merged: boolean;\n /** Type of recurrence, Shows whether this is a master or an occurence in the series. */\n public readonly recurrence_type: string;\n /** The frequency of the recurring booking. */\n public readonly recurrence_period: RecurrencePeriod;\n /** The interval time between each period. Defaults to 1. For example, with a period of \"weekly\" and an interval of 2, the recurrencd happen every 2 weeks. */\n public readonly recurrence_interval: number;\n /** Unix epoch in seconds of the recurrence end date */\n private _recurrence_endTz: DateTZ;\n /** The number of times to repeat the recurring booking. */\n public readonly recurrence_count: number;\n /** ID of the booking considered the master */\n public readonly recurrence_master_id: string;\n /** An array of booking IDs which belong to this recurring series. This INCLUDES the master booking ID. */\n public readonly occurrence_ids: string[];\n /** A list of INDIVIDUAL edits to any of the bookings in the series. This is so we can prompt the user if they are going to override previously updated bookings with a whole-series update. */\n public readonly occurrence_edits: string[];\n /** A list of Ocurrences */\n public readonly occurrence_details: { id: string, start_epoch: number }[];\n /** When the booking was created */\n public created_epoch: number;\n /** Is the Application concierge */\n public is_concierge: boolean;\n /**helper to know if recurring toggle is on */\n public is_recurrent: boolean;\n /**array of start dates of each ocurrence in the series */\n public recurrence_starts: Array\n /**array of conflicting dates not to be included in the recurrence series */\n public recurrence_exceptions: Array\n\n public recurrence_days?: Array\n\n /** Master recurrence start */\n public recurrence_start: number;\n\n /** Start Epoch */\n public start_epoch: number;\n public end_epoch: number;\n public level_zone: string;\n public opt_out: boolean;\n public outlook_opt_out: boolean;\n public multi_rooms: Space[];\n public room_setup: any;\n public room_breakdown: any;\n public headcount: number;\n public equipment_code: string;\n\n /** Currently back-end is not properly setting the recurrence_end property, this is a workaround */\n public get recurrence_endTz(): DateTZ {\n return this._recurrence_endTz;\n }\n\n public set recurrence_endTz(date: DateTZ) {\n this._recurrence_endTz = date;\n }\n\n /** Mark a booking for deleting */\n public attempted_to_delete?: 'series' | 'booking' | null;\n\n // No specific reason to set readonly but canm be change if needed to update in future\n public readonly booked_by : string | { name: string };\n public readonly booker: Object;\n public readonly booker_concierge: Object\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = settingsService.concierge;\n\n /**\n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = new DateTZ();\n\n const defaultTitle = ''; // Blank since the create booking form will init with test values.\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n const defaultBuildingZone = null // R --- no idea, should be a building.id but which and how\n const defaultOrgainiser = User.active_user || new User(); // meh, non American use.\n const defaultBookingType = 'internal';\n\n /**\n * Process the simple raw_data with defaults mixed in\n */\n this.title = raw_data.title || defaultTitle;\n this.timezone = raw_data.timezone || defaultLocalTimezone;\n // Used by components to get the building details\n this.building_zone = raw_data.building_zone || defaultBuildingZone;\n this.body = raw_data.body || '';\n // Provided booking type\n this.booking_type = raw_data.booking_type || defaultBookingType;\n // Attendees provided in API booking data\n this.attendees = (raw_data.attendees || []).map((i) => new User(i));\n // Provided organiser, active user, or empty user?\n this.organiser = raw_data.organiser ? new User(raw_data.organiser) : defaultOrgainiser;\n // Creator is provided or defaults to the organizer\n this.creator = (raw_data.booked_by ? new User(raw_data.booked_by) : defaultOrgainiser) || this.organiser;\n // Setup and breakdown times can conflict but not the true event start and end times\n this.setup = raw_data.setup || {};\n this.breakdown = raw_data.breakdown || {};\n this.room_setup = raw_data.room_setup;\n this.room_breakdown = raw_data.room_breakdown;\n // Notes are assigned by room but we only support a single room\n this.notes = raw_data.notes || [];\n this.equipment_codes = raw_data.equipment_codes || {};\n this.equipment_code = raw_data.equipment_code || '';\n this.expected_attendees = raw_data.expected_attendees || {};\n this.headcount = raw_data.headcount;\n this.check_ins = raw_data.check_ins || {};\n this.notify_users = raw_data.notify_users?.length ? raw_data.notify_users : [this.organiser?.name];\n this.company = raw_data.company || [];\n // retain booked by if there : helps to get correct creator above\n this.booked_by = raw_data.booked_by;\n this.booker = raw_data.booker;\n this.booker_concierge = raw_data.booker_concierge;\n this.level_zone = raw_data.level_zone;\n this.opt_out = raw_data.opt_out;\n this.outlook_opt_out = raw_data.outlook_opt_out;\n\n /**\n * \n */\n this.merged = raw_data?.merged || null;\n\n /**\n * Multiroom fields\n */\n this.is_multiroom = raw_data.is_multiroom || null;\n this.multiroom_master_id = raw_data.multiroom_master_id || null;\n\n /**\n * Setup Defaults when raw_data values are not provided\n *\n * all room_ids and space_list inputs can be refactored into just room like an API booking\n *\n * raw_data.room can be provides as the Space class or JSON object\n */\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n // this.room = raw_data?.room ? (Array.isArray(raw_data?.room) && raw_data.room.length > 0) ? raw_data?.room.map((element) => new Space(element))[0]: [new Space(raw_data.room)][0] : [new Space()][0];\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n\n if (raw_data && raw_data.room) {\n if (Array.isArray(raw_data.room) && raw_data.room.length) {\n this.room = raw_data.room.map((element) => new Space(element))[0];\n } else if (Array.isArray(raw_data.room) && raw_data.room.length === 0) {\n this.room = [new Space()][0];\n } else {\n this.room = [new Space(raw_data.room)][0];\n }\n } else {\n this.room = [new Space()][0];\n }\n\n\n const room_id = raw_data.room_id || raw_data.room_ids // Not sure why we have room_id and room_ids\n if (!this.room?.id && room_id?.length) {\n this.room = findSpace(room_id[0]) || this.room;\n }\n\n const roomsData = raw_data?.multi_rooms || raw_data?.room;\n this.multi_rooms = roomsData\n ? Array.isArray(roomsData)\n ? roomsData.map((element) => new Space(element))\n : [new Space(roomsData)]\n : [new Space()];\n\n \n const room_ids = [...(raw_data?.room_id || []), ...(raw_data?.room_ids || [])];\n\n room_ids.forEach(roomId => {\n const newRoom = findSpace(roomId);\n // Check if the room is found and not already included in this.room\n if (newRoom && !this.multi_rooms.some(room => room.id === newRoom.id)) {\n // Add the new room to this.room\n this.multi_rooms.push(newRoom);\n }\n });\n\n // this.room is sometimes getting set to undefined when raw_data?.room is coming as an object\n if(this.multi_rooms.length && this.room === undefined){\n this.room = this.multi_rooms[0];\n }\n \n /**\n * Setup the booking start and end time\n *\n *\n * Booking defaults to now if start is not defined.\n * Booking durration is now a getter\n */\n // now rounded to the next 5 minute increment\n const defaultStartTz = new DateTZ({ date: nowTz.ms, is_local_tz: false, building_tz: this.timezone }).setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n\n /**\n * When saving a booking the BaseDataClass doens't know to use the toAPIJson\n * so startDateTz isn't being convert to the epoch timestamp\n *\n * I'm not testing for the end time values because we can assume those follow the same pattern.\n */\n const startEpochProvided = !!(raw_data.start_epoch || raw_data.start);\n const startDateTzProvided = !!raw_data.startDateTz;\n\n /**\n * Not trying to be fancy here, just clear.\n */\n if (!startEpochProvided && startDateTzProvided) {\n /**\n * Once a booking is saved the BaseDataClass recreates the Booking\n * but doesn't use the toApiJSON method adapt the class input, mainly the\n * startDateTz isn't converted to the start_epoch timestamp.\n */\n this.startDateTz = raw_data.startDateTz;\n this.endDateTz = raw_data.endDateTz;\n } else if (startEpochProvided) {\n /**\n * A Booking created from the API responses arrives with the booking\n * start_epoch and end_epoch timestamps.\n */\n this.startDateTz = new DateTZ({\n date: ((raw_data.start_epoch || raw_data.start) * 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n this.endDateTz = new DateTZ({\n date: ((raw_data.end_epoch || raw_data.end)* 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n } else {\n /**\n * And there are uses of new Booking where there are no inputs\n * and defaults are necessary.\n */\n this.startDateTz = defaultStartTz;\n this.endDateTz = defaultStartTz.addValue({ minutes: 60 });;\n }\n\n /**\n * End time was by design ending at one minute before, IE 4:00PM is 3:59PM,\n * because of calendar and conflcit checking\n *\n * Check and finesse it.\n * Not sure why but some booking endtime added extra seconds\n */\n if ((this.endDateTz.minutes % 5) !== 0 || this.endDateTz.second > 0) {\n // Not sure of the source but some bookings do not conform.\n this.endDateTz = this.endDateTz.setValue({ second: 0, minute: Math.round(this.endDateTz.minutes / 5) * 5 });\n }\n\n\n\n /**\n * Setup the booking created_date\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n this.created_epoch = raw_data.created_epoch || nowTz.seconds;\n\n\n /**\n * Setup the booking all_day boolean\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n if ('all_day' in raw_data) {\n this.all_day = raw_data.all_day;\n } else {\n this.all_day = !!raw_data.all_day || this.duration > 23 * 60;\n }\n\n\n // R--- TODO Concierge will use startDateTz so i'm not sure if this is needed.\n if (!this.is_concierge && this.all_day && this.timezone) {\n /**\n * Concierge has a all_day form field, I can see it may need this for that, does it really?\n */\n this.startDateTz = this.startDateTz.startOfValue('day')\n }\n\n /**\n * Setup the booking approval status\n */\n let status = raw_data.status;\n // If not provided default to approved.\n if (!raw_data.status) {\n status = 'accepted';\n }\n // \"show_as\" is a special rule to override how the applications display the status\n if (raw_data.show_as && raw_data.show_as === 'cancelled') {\n status = 'declined';\n }\n const approvalStatus = {};\n this.multi_rooms.forEach(room => {\n approvalStatus[room.email] = status;\n });\n // Tracking new \"status\" and legacy \"approval_status\" from raw_data.status.\n this.status = status;\n this.approval_status = raw_data.approval_status || {};\n\n /**\n * Catering setup\n *\n * Bring in and sort the catering order by delivery time\n */\n\n this.catering = (raw_data.catering instanceof Array ? raw_data.catering : []).map(\n (i) => new CateringOrder(i)\n );\n\n\n\n /**\n * Edited fields setup\n *\n * Bring in and sort the catering order by delivery time\n *\n * cateringOrders can return the order sorted\n */\n const edited_fields = Array.isArray(raw_data.edits)\n ? raw_data.edits\n : unique(\n flatten(\n Object.keys(raw_data.edits || {}).map((room) => {\n return flatten(Object.values(raw_data.edits[room]));\n })\n )\n );\n this.edits = edited_fields;\n\n /**\n * New Recurring booking feilds\n *\n * New fields do not match the BookingRecurrenceDetails type\n * and are simpler to manage this way\n */\n this.recurrence_count = raw_data.recurrence_count || null;\n this.recurrence_days = raw_data.recurrence_days || null;\n this.occurrence_edits = raw_data.occurrence_edits || null;\n this.recurrence_endTz = raw_data.recurrence_end ? new DateTZ({date: raw_data.recurrence_end * 1000, is_local_tz: false, building_tz: this.timezone}) : null;\n this.recurrence_exceptions = raw_data.recurrence_exceptions || null;\n this.occurrence_ids = raw_data.occurrence_ids || null;\n this.recurrence_interval = raw_data.recurrence_interval || null;\n this.recurrence_period = raw_data.recurrence_period || null;\n this.recurrence_type = raw_data.recurrence_type || null;\n this.recurrence_master_id = raw_data.recurrence_master_id\n this.occurrence_details = raw_data.occurrence_details\n this.is_recurrent = raw_data.is_recurrent || (!!this.recurrence_type && !!this.recurrence_period) || null;\n this.recurrence_starts = raw_data.recurrence_starts || []\n this.start_epoch = raw_data.start_epoch\n this.end_epoch = raw_data.end_epoch\n\n /**\n * I'm not clear why, but the booking body, aka description is copied into the notes.\n * R--- In concerge data description is only a key when saving, also in the note array?\n */\n if (raw_data.body && !this.notes.find((i) => i.type === 'description')) {\n this.notes = [\n ...this.notes,\n {\n type: 'description',\n date: 0,\n message: raw_data.body,\n author: this.organiser.email\n }\n ];\n }\n\n /**\n * In case there is a cancellation in progress the property attempted_to_delete is set to false\n * And it is persisted until the booking is gone\n */\n this.attempted_to_delete = raw_data.attempted_to_delete || null;\n }\n\n\n /** Service for managing Bookings */\n protected get _service() {\n return ServiceManager.serviceFor(Booking);\n }\n\n /** Alias to approval_status */\n public get auto_approve(): boolean {\n // if concierge we auto_approve always.\n if (this.is_concierge) {\n return true;\n }\n return !this.multi_rooms.some(room => room.byRequest({\n dateTz: this.startDateTz,\n duration: this.duration,\n host: this.organiser\n }));\n }\n\n /** Whether booking has been approved */\n public get approved(): boolean {\n return !this.declined && !this.tentative;\n }\n\n /** All of the booking attendees including the organizer */\n public get allAttendees(): User[] {\n return unique([this.organiser].concat(this.attendees), 'email');\n }\n\n /** Computer format for booking type */\n public get bookingTypeId(): string {\n return this.booking_type.toLowerCase();\n }\n\n /** Human format for booking type */\n public get bookingTypeLabel(): string {\n return toTitleCase(this.booking_type);\n }\n\n /** Get accessor for the check in object, app expect array */\n public get checkInsArray(): string[] {\n return Object.keys(this.check_ins || {})\n }\n\n /** Legacy getter for \"class\" */ // R-- TODO remove\n public get class(): string {\n return this.booking_type;\n }\n\n /** */\n public get displayEndDateTz(): DateTZ {\n if ((this.endDateTz.minutes % 5) !== 0) {\n // All the bookings should end in 59 seconds\n return this.endDateTz.addValue({ seconds: 1 });\n }\n // but if not they return 00\n return this.endDateTz;\n }\n\n /** Whether booking has been declined */\n public get declined(): boolean {\n /**\n * I'm not sure, nor is Cam if this is ever used to decline\n * all booking for a specific room\n */\n const isAnyRoomDeclined = this.multi_rooms.some(room => room.name.toLowerCase().includes('decline'));\n if (isAnyRoomDeclined) {\n return true;\n }\n\n if (this.status.includes('decline')) {\n return true;\n }\n\n return false;\n }\n\n /** Description of the booking purpose */\n public get description(): string {\n const note = (this.notes || []).find((i) => i.type === 'description');\n return note ? note.message : '';\n }\n\n /** Catering getter */\n public get cateringOrders() {\n // Return the catering orders sorted by delivery time\n return this.catering ? this.catering.slice().sort((a, b) => {\n if (a?.delivery_time > b?.delivery_time) return 1;\n if (b?.delivery_time > a?.delivery_time) return -1;\n\n return 0;\n }) : [];\n }\n\n /** Get the created date as DateTz */\n public get creationDateTz() {\n return new DateTZ({ date: this.created_epoch * 1000, is_local_tz: false, building_tz: this.timezone })\n }\n\n public get tz_offset() {\n return getTimezoneOffsetString(this.timezone);\n }\n\n /** Display value for the date */\n public get date_string(): string {\n return this.startDateTz.formatDate('dd MMM yyyy');\n }\n\n /**\n * Get the booking durration based on start and end times\n */\n public get duration(): number {\n return Math.abs(this.startDateTz.startOfValue('minute').dateDiff(this.displayEndDateTz, 'minutes'));\n }\n\n /** Unix timestamp of the booking start */\n public get date() { // R--- remove if not necessary\n return this.startDateTz.ms;\n }\n\n /** Whether booking contains external visitors in the attendee list */\n public get has_visitors(): boolean {\n return this.attendees.reduce((a, v) => a || v.external, false);\n }\n\n /** Does the booking have catering orders */\n public get has_catering(): boolean {\n return !!this.catering.length;\n }\n\n /**\n * Unique calendar event ID\n * same as this.id, used to support existing component usage\n */\n public get icaluid(): string {\n return this.id;\n }\n\n /**\n * Get the booking room id\n */\n public get room_id(): string {\n return this.room.id;\n }\n\n /** Legacy getter of room, aka space */\n public get space(): Space {\n return this.room;\n }\n\n /** Status of the booking */\n public get timeBasedStatusLabel(): 'future' | 'upcoming' | 'done' | 'started' | 'in_progress' | 'expired_yesterday' {\n const buildingTzDt = DateNow(new Date()).toZone(this.timezone) ; // building time\n\n if (DateNow(new Date()).isBeforeDate(this.startDateTz.subtractValue({ minutes: 15 }))) {\n return 'future';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz)) {\n return 'upcoming';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: 15 }))) {\n return 'started';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: this.duration }))) {\n return 'in_progress';\n }\n // if current time is 12 AM (as per timezone) and booking expired yesterday\n else if(buildingTzDt.startOfValue('day').addValue({ minutes: 1 }).isAfterDate(this.startDateTz, 'day') ) {\n return 'expired_yesterday'\n }\n\n return 'done';\n }\n\n /** Whether booking is tentative */\n public get tentative(): boolean {\n if (\n this.status &&\n this.status.indexOf('tentative') >= 0\n ) {\n return true;\n }\n\n return false;\n }\n\n /** Display valuie for the start and end times of the booking */\n public get time_period(): string {\n return `${this.startDateTz.formatDate('h:mma')} - ${this.displayEndDateTz.formatDate('h:mma')}`;\n }\n\n /** Display value for the start time of the booking */\n public get start_time(): string {\n return this.startDateTz.formatDate('h:mma');\n }\n\n /** Display value for the end time of the booking */\n public get end_time(): string {\n return this.endDateTz.formatDate('h:mma');\n }\n\n /** Display value for the duration of the booking */\n public get length_string(): string {\n return humaniseDuration(this.duration);\n }\n\n /** Display value for the location of the booking */\n // public get local_room_name(): string {\n // return this.room?.local_name || 'No location';\n // }\n public get local_room_name(): string {\n if (this.multi_rooms.length === 0) {\n return 'No location';\n } else {\n return this.multi_rooms.map(room => room.local_name).join(', ');\n }\n } \n\n /** Display value for the level of the first space in the booking */\n public get level(): string {\n return this.space.level.name;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Booking {\n return new Booking(this.toJSON());\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(isEdit = false): Booking {\n return new Booking({\n ...this.toJSON(),\n id: isEdit ? this.id : null,\n });\n }\n\n /**\n *\n * @param status\n * @returns void\n */\n public undo(status?: 'accept' | 'decline', opts: { series?: boolean } = {}): Promise {\n return this._service.undo(\n this.id, status || 'accept',\n opts\n );\n }\n\n /**\n * Delete booking from the server\n */\n public delete(opts: { series?: boolean } = {}): Promise {\n if (this.id) {\n return this._service.delete(this.id, { ...opts });\n\n // R-- ask Cam again is he's positive these extra params are not needed for anything\n // return this._service.delete(this.id, {\n // concierge: this.is_concierge,\n // host: this.organiser.email,\n // room_id: this.space?.id,\n // icaluid: this.icaluid,\n // start: json.start,\n // end: json.end\n // });\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Booking): HashMap {\n let data = super.toJSON();\n // Remove the description from the notes\n data.notes = Array.isArray(data.notes) ? data.notes.filter((note) => note.type !== 'description') : data.notes;\n // Encode the nested objects\n data.room = data.room.toJSON();\n\n\n\n data.organiser = data.organiser.toJSON();\n data.creator = data.creator?.toJSON ? data.creator.toJSON(): data.creator;\n // Map the attendees User objects\n data.attendees = data.attendees.map((i: User) => i.toJSON());\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n return data;\n }\n\n /**\n * Convert object into plain object\n */\n public toApiJSON(this: Booking): HashMap {\n let data = super.toJSON();\n\n // Update booking payload contains additional fields\n data.icaluid = \"\";\n if (data.id) {\n data.icaluid = data.id;\n data.location_name = this.multi_rooms.map((item)=>{return item.local_name}).join(', ');\n data.from_room = this.multi_rooms.map((item)=>{return item.email}).join(', ');\n data.building_zone = this.room?.building?.id;\n }\n\n /**\n * These fields are rather in flux\n * According to Cam \"approve\" will be the prefered field\n * and auto_approve and approval_status can be removed.\n */\n data.approve = this.auto_approve; // this value appear incorrect on update\n data.auto_approve = [this.auto_approve]; // Needed to update approval status until BE accepts \"approve\"\n // delete data.approval_status;\n\n // Booking start and end data\n delete data.startDateTz;\n delete data.endDateTz;\n data.start = this.startDateTz.seconds;\n data.end = this.endDateTz.seconds;\n data.old_start = this.startDateTz.seconds; // remove is not necessary\n data.old_end = this.endDateTz.seconds; // remove is not necessary\n\n // Creation date value\n delete data.created_epoch;\n data.creation_date = this.creationDateTz.seconds;\n\n // Catering fields\n // data.catering = data.catering.toJSON();\n data.catering = this.cateringOrders;\n data.has_catering = this.has_catering;\n delete data.cateringOrders\n\n // Attendees appear quite incomplete\n // Map the attendees User objects\n data.attendees = this.allAttendees.map((i: User) => i.toJSON ? i.toJSON() : i);\n\n // Orgainizer and Creator data\n data.organiser = data.organiser.toJSON ? data.organiser.toJSON() : data.organiser;\n data.creator = data.creator.toJSON ? data.creator.toJSON() : data.creator;\n\n // Convert check_ins to checked_in array\n delete data.check_ins;\n data.checked_in = this.checkInsArray;\n\n // edits - edit booking is showing all fields even w/o an edit :(\n\n // Room data\n data.room_ids = this.multi_rooms.map((item)=>{return item.email});\n delete data.room;\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n // Not found in dev data\n delete data.name;\n delete data.email;\n delete data.is_concierge;\n // delete data.building_zone;\n // delete data.status;\n\n return data;\n }\n\n public getType(): string {\n if (!this || this.status?.includes('decline')) {\n return 'cancelled';\n }\n const booking_type = this.booking_type;\n if (booking_type === 'internal' && this.has_visitors) {\n return 'external';\n }\n return booking_type;\n }\n\n /** fallback for a booking when the recurrence_end is null but it's a series booking */\n public recurrenEndFromOcurrences(occurrence_details: { id: string, start_epoch: number }[]): DateTZ {\n const date = occurrence_details?.map(occurence => occurence)\n .sort((a, b) => new Date(a.start_epoch * 1000).getTime() - new Date(b.start_epoch * 1000).getTime())\n .reverse()\n .shift()\n .start_epoch * 1000\n return new DateTZ({date, is_local_tz: false, building_tz: this.timezone});\n }\n\n public get dateString() {\n return shorterLocalDateFormatString(this.startDateTz);\n }\n public get dateBuildingString() {\n return shorterBuildingDateFormatString(this.startDateTz);\n }\n\n public get endDateString(): string {\n return shorterLocalDateFormatString(this.recurrenEndFromOcurrences(this.occurrence_details));\n }\n}\n\n/**\n * Merge catering orders with same time and location\n * @param order_list List of catering orders\n */\nexport function mergeCateringOrders(order_list: CateringOrder[]) {\n // R--- investigate when this is used. Staff doesn't use it when adding catering orders.\n for (let i = 0; i < order_list.length; i++) {\n const orders = order_list.filter(\n (order) =>\n order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time\n );\n if (orders.length > 1) {\n const new_list = order_list.filter(\n (order) =>\n !(order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time)\n );\n new_list.push(new CateringOrder({\n ...order_list[i],\n items: flatten(orders.map(order => order.items)),\n booking_date: this.startDateTz.ms,\n booking_timezone: this.booking_timezone,\n }));\n order_list = new_list;\n i = 0;\n }\n }\n return order_list;\n}\n","import { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport interface SpaceRules {\n auto_approve: boolean; // if false sapce is requestable else bookable\n hide: boolean;\n max_length?: number;\n min_length?: number;\n reason?: string // specially for non-bookable rooms\n}\n\nexport interface BookingNote {\n /** Type of note */\n type: 'equipment' | 'catering' | 'description' | 'private' | 'other' | 'catering-private';\n /** Name of the note's author */\n author: string;\n /** Contents of the note */\n message: string;\n /** Time the note was added to the booking */\n date: number;\n /** Display value for the time */\n time?: string;\n /** ID of the space associated with the note */\n space?: string;\n /** ID of the catering order associated with the note */\n order_id?: string;\n}\n\nexport interface DateDurationData {\n dateTz: DateTZ,\n duration: number,\n mobile: boolean,\n save?: boolean,\n}\n\nexport enum BOOKING_STATUS {\n approved = 'approved',\n declined = 'declined',\n tentative = 'tentative',\n unavailable = 'unavailable'\n}","import {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AvailableBookingFields } from '../settings.interfaces';\nimport {\n HashMap,\n humaniseDuration,\n mockDate as mockDateBase,\n resetDate as resetDateBase,\n timeFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { CateringOrder } from '../catering/catering-order.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { User } from '../users/user.class';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport {\n BookingRule,\n SpaceStatus\n} from './space.types';\nimport { validateEndTime } from '../validation.utilities';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\nimport { Space } from '../spaces';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\nconst MINUTE = 1;\nconst HOUR = 60;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\nconst MONTH = 30 * DAY;\n\nconst DURATION_MAP: { [duration: string]: number } = {\n month: MONTH,\n months: MONTH,\n week: WEEK,\n weeks: WEEK,\n day: DAY,\n days: DAY,\n hour: HOUR,\n hours: HOUR,\n minute: MINUTE,\n minutes: MINUTE\n};\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const mockDate = mockDateBase;\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const resetDate = resetDateBase;\n\nexport interface IBookingSlot {\n start: number;\n end: number;\n}\n\n\nexport function bookingOptionsToQuery(options: IBookingQueryOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n delete query.type;\n if (options.filters) {\n delete query.filters;\n for (const property in options.filters) {\n if (!query[property]) {\n query[property] = options.filters[property]\n }\n }\n }\n\n // id?: string;\n // cancelled?: boolean;\n if (options.until) {\n query.to = options.until;\n delete query.until;\n }\n \n }\n return query;\n}\n\n\n/**\n * Generate a list of free time slots between the given bookings\n * @param list List of bookings to find slots between\n * @param min_size Minimum length of a free slot in minutes\n */\nexport function getFreeBookingSlots(list: Booking[]=[], min_size: number = 30, dateTzMs: number = DateNow(new Date()).ms,): IBookingSlot[] {\n /* istanbul ignore else */\n if (!list.length) {\n return [\n {\n start: 0,\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n }\n ];\n }\n const slots: IBookingSlot[] = [];\n let start = new DateTZ({ date: dateTzMs });\n list.sort((a, b) => a.date - b.date);\n for (const booking of list) {\n const bkn_start = booking.startDateTz;\n const bkn_end = booking.endDateTz;\n if (bkn_start.isAfterDate(start)) {\n const diff = Math.abs(bkn_start.dateDiff(start, 'minutes'));\n /* istanbul ignore else */\n if (diff >= min_size) {\n slots.push({ start: start.ms, end: bkn_start.ms });\n }\n start = bkn_end;\n } else if (start.startOfValue('minute').ms === bkn_start.startOfValue('minute').ms) {\n start = bkn_end;\n }\n }\n slots.push({\n start: start.ms,\n // R--- these X 10's make no sense. why not + 2 years?\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n });\n\n return slots;\n}\n\n/**\n * Get the next free time slot from the given bookings\n * @param list List of bookings to find the next slot\n * @param date Date to find next slot after in ms since UTC epoch\n * @param min_size Minimum length of the free slot in minutes\n * \n * R--- Possibly depreciate, I don't see it used anywhere except for its own test\n */\nexport function getNextFreeBookingSlot(\n list: Booking[],\n date: number = DateNow(new Date()).ms,\n min_size: number = 15\n): IBookingSlot {\n const slots = getFreeBookingSlots(list, min_size, date);\n const date_ = new DateTZ({date})\n const time = date_.startOfValue('minute').setValue({ second: 1 });\n for (const block of slots) {\n const start = new DateTZ({date: block.start});\n const end = new DateTZ({date: block.end});\n if (start.startOfValue('minute').isAfterDate(time)) {\n return block;\n } else if (time.isBeforeDate(end.startOfValue('minute'))) {\n const duration = end.startOfValue('minute').dateDiff(time, 'minutes');\n /* istanbul ignore else */\n if (duration >= min_size) {\n return block;\n }\n }\n }\n return slots[slots.length - 1];\n}\n\n/**\n * Generate form fields for the given booking\n * @param booking Booking to generate form for\n * @param current_user Current user of the system to default as the host\n */\nexport function generateBookingForm(\n booking: Booking,\n use_fields: AvailableBookingFields[],\n isConcierge: boolean = false,\n manualTimezone?: string,\n action?: SeriesAction | BookingAction | null\n ): FormGroup {\n if (!booking) {\n throw Error('No booking passed');\n }\n\n const user_service = ServiceManager.serviceFor(User);\n const current_user =\n user_service.current ||\n new User({ id: 'local-user', name: 'Local User', email: 'local@place.tech' });\n\n const fields: HashMap = {\n id: new FormControl(booking.id || ''),\n space_list: new FormControl( booking.is_multiroom? booking.multi_rooms : [booking.room], []),\n room: new FormControl(booking.room, {}),\n dateTz: new FormControl({ value: booking.startDateTz || DateNow(), disabled: false }, [Validators.required]),\n duration: new FormControl({ value: booking.duration, disabled: false }),\n organiser: new FormControl(booking.organiser || current_user, [Validators.required]),\n attendees: new FormControl(booking.attendees, []),\n title: new FormControl(booking.title || '', { validators: [ Validators.required, Validators.minLength(1) ], updateOn: 'blur' }), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n booking_type: new FormControl(booking.booking_type),\n body: new FormControl(booking.body),\n notes: new FormControl(booking.notes),\n equipment_codes: new FormControl(booking.equipment_codes),\n expected_attendees: new FormControl(booking.expected_attendees),\n company: new FormControl(booking.company),\n is_multiroom: new FormControl(booking.is_multiroom),\n merged: new FormControl({value: booking?.merged, disabled: true}),\n catering: new FormControl(\n booking.cateringOrders.map(\n (order) => new CateringOrder({\n ...order,\n booking_date: booking.startDateTz.ms,\n booking_timezone: booking.timezone,\n })\n )\n ),\n all_day: new FormControl(!!booking.all_day),\n has_catering: new FormControl(!!booking.has_catering),\n needs_space: new FormControl(true),\n action: new FormControl(''),\n timezone: new FormControl(manualTimezone || \"\"),\n is_before_date: new FormControl(false)\n };\n if (!isConcierge) {\n fields.duration.setValidators([Validators.required, validateEndTime(fields.dateTz)]);\n }\n /* istanbul ignore else */\n if (booking.id && booking.id !== 'ad-hoc') {\n fields.organiser.disable();\n /* istanbul ignore else */\n if (booking.endDateTz.ms < DateNow(new Date()).ms) {\n fields.dateTz.disable();\n }\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n fields.dateTz.setValidators(dateValidators);\n fields.dateTz.updateValueAndValidity();\n }\n let list_length = -1;\n fields.space_list.valueChanges.subscribe((list) => {\n const expected = fields.expected_attendees.value || {};\n const matches = Object.keys(expected).filter((key) =>\n list?.find((space) => space.email === key)\n ).length;\n if (list && list.length && matches === 0) {\n const codes = fields.equipment_codes.value || {};\n if (Object.keys(expected).length >= 0 || Object.keys(codes).length >= 0) {\n const key = Object.keys(expected)[0] || Object.keys(codes)[0];\n const new_expected = {};\n const new_codes = {};\n const notes = fields.notes.value;\n notes.forEach((note) => (note.space === key ? (note.space = list[0].email) : ''));\n new_expected[list[0].email] = expected[key];\n new_codes[list[0].email] = codes[key];\n fields.expected_attendees.setValue(new_expected);\n fields.equipment_codes.setValue(new_codes);\n }\n }\n list_length = list?.length;\n });\n fields.dateTz.valueChanges.subscribe((_) => {\n fields.duration.updateValueAndValidity();\n });\n fields.needs_space.valueChanges.subscribe((space_needed) => {\n if (!space_needed) {\n fields.space_list.setValue([]);\n }\n });\n fields.has_catering.valueChanges.subscribe((has_catering) => {\n if (!has_catering) {\n fields.catering.setValue([]);\n }\n });\n const simplified_fields: HashMap = [\n 'id',\n 'space_list',\n 'space_ids',\n 'notes',\n 'dateTz',\n 'booking_type',\n 'equipment_codes',\n 'expected_attendees',\n 'timezone',\n 'is_before_date',\n ...use_fields\n ].reduce((map, key) => {\n /* istanbul ignore else */\n if (fields[key]) {\n map[key] = fields[key];\n }\n return map;\n }, {});\n \n if (simplified_fields.all_day) {\n const handleAllDay = (value) => {\n if (value) {\n let startOfDay = simplified_fields.dateTz.value.clone();\n // When the booking space isn't set we still need a way to determine midnight\n // and here we use the current concierge building selection's timezone.\n if (manualTimezone) {\n startOfDay = startOfDay.toZone(manualTimezone);\n }\n\n simplified_fields.dateTz.setValidators([Validators.required]);\n simplified_fields.dateTz.setValue(simplified_fields.all_day.value\n ? startOfDay.startOfValue('day')\n : simplified_fields.dateTz.value);\n simplified_fields.duration.setValue(simplified_fields.all_day.value\n ? 24 * 60\n : simplified_fields.duration.value);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.disable();\n // simplified_fields.dateTz.disable();\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n simplified_fields.dateTz.setValidators(dateValidators);\n simplified_fields.duration.setValue(booking.duration || 30);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.enable();\n simplified_fields.dateTz.enable();\n }\n };\n simplified_fields.all_day.valueChanges.subscribe(handleAllDay);\n handleAllDay(simplified_fields.all_day.value);\n }\n\n const occurrences = booking.occurrence_details || [];\n\n //Add recurrence fields\n if(action && booking.recurrence_period === RecurrencePeriod.LIST){\n booking.recurrence_starts = occurrences\n .filter(occurrence => occurrence.id !== booking.recurrence_master_id)\n .map((occurrence) => new DateTZ({date: occurrence.start_epoch * 1000, is_local_tz: false, building_tz: booking.timezone})\n ) \n }\n /**If series exists then set the start and end dates from the first and last bookings in the occurrences array\n * this prevents prefilled form errors due to individual edits\n */\n if(action && action !== SeriesAction.CLONE && action !== BookingAction.CLONE && occurrences && occurrences.length && !booking.id){\n const start_dateTz = new DateTZ({\n date: occurrences.sort((d1, d2) => d1.start_epoch - d2.start_epoch)[0].start_epoch * 1000, \n is_local_tz: false, building_tz: booking.timezone\n })\n simplified_fields.dateTz.setValue(start_dateTz)\n const end = occurrences.sort((d1, d2) => d2.start_epoch - d1.start_epoch)[0].start_epoch * 1000\n booking.recurrence_endTz = new DateTZ({date: end, is_local_tz: false, building_tz: booking.timezone}) \n }\n\n // R-- needs TZ aware fields\n const _recurr_end = simplified_fields.dateTz?.value || new DateTZ({ date: 1 }); // new DateTZ({date: simplified_fields.date?.value}) \n const fields_with_recurrence = {\n ...simplified_fields,\n recurrence_period: new FormControl(booking.recurrence_period || RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl(booking.recurrence_interval || 1),\n recurrence_endTz: new FormControl(booking.recurrence_endTz || _recurr_end.addValue({days: 1})),\n recurrence_count: new FormControl(booking.recurrence_count || 0),\n is_recurrent: new FormControl(booking.is_recurrent),\n recurrence_starts: new FormControl(booking.recurrence_starts || []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl(booking.recurrence_days || [])\n }\n\n if(booking.is_recurrent && action !== BookingAction.CLONE){\n fields_with_recurrence.recurrence_starts.setValidators([arrayWithValues])\n fields_with_recurrence.recurrence_starts.updateValueAndValidity()\n fields_with_recurrence.recurrence_endTz.setValidators([Validators.required, validDateTZ]);\n }\n // Generate form group for booking item\n const form = new FormGroup(fields_with_recurrence);\n return form;\n}\n\n/**\n * Validate whether date is in the future\n * @param control Control to check value\n */\nexport function isFuture(control: AbstractControl) {\n const dateTz = control.value; // new DateTZ({date: control.value});\n return dateTz.isBeforeDate(DateNow(new Date()).subtractValue({ minutes: 5 }))\n ? { dateTz: 'Date needs to be in the future' }\n : null;\n}\n\n/**\n * Validate whether an array has values\n * @param control Control to check value\n */\nexport function arrayWithValues (control: AbstractControl) {\n return control.value.length !== 0 ? null : { field: 'Needs at least one value'}\n}\n\n/**\n * Validate whether a date has a valid value (future or current date)\n * @param control Control to check value\n */\n export function validDate (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = new DateTZ({date: control.value})\n const now = DateNow(new Date())\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Validate whether a date has a valid DateTZ value (future or current date)\n * @param control Control to check value\n */\n export function validDateTZ (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = DateNow(control.value.JSDate);\n const now = DateNow(new Date());\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Get minimum duration from ruleset in minutes\n * Default to 5min\n */\nexport function getMinLength(rule_list: HashMap): number {\n return Object.values(rule_list).reduce((min, block) => {\n const min_block = block.reduce((min_length, el) => {\n if (el.conditions.min_length && stringToMinutes(el.conditions.min_length) > min) {\n return stringToMinutes(el.conditions.min_length);\n } else {\n return min_length;\n }\n }, 5);\n if (min_block > min) {\n return min_block;\n } else {\n return min;\n }\n }, 5) as number;\n}\n\n/**\n * Whether the first input is greater than the last. Converts duration strings into minutes\n * @param duration_1 First input can be a number in minutes or a duration string e.g. `1 hour`\n * @param duration_2 Second input can be a number in minutes or a duration string e.g. `30 minutes`\n */\nexport function durationGreaterThanOrEqual(\n duration_1: string | number,\n duration_2: string | number\n) {\n const first: number = typeof duration_1 === 'string' ? stringToMinutes(duration_1) : duration_1;\n const second: number =\n typeof duration_2 === 'string' ? stringToMinutes(duration_2) : duration_2;\n return first >= second;\n}\n\n/**\n * Conver time string into minutes\n * @param str timestring e.g. `'1 day'`, `'15 minutes'`, `'2 weeks'`\n */\nexport function stringToMinutes(str: string): number {\n const parts = str.split(' ');\n return +parts[0] * DURATION_MAP[parts[1]];\n}\n\n/**\n * Get current status within bookings\n * @param bookings List of bookings\n * @param host Host of the new event\n * @param date Datetime of the new event\n */\nexport function statusFromBookings(\n bookings: Booking[] = [],\n bookable: boolean = true,\n requestable: boolean = false,\n dateTz: DateTZ = DateNow(),\n space?: Space\n) {\n const free_slots = getFreeBookingSlots(bookings.filter((bkn) => !bkn.declined));\n const now = DateNow() // new DateTZ({date}); // now should be now\n // commeted bellow piece as correct way to get next free booking slot is at line- 488\n // const next_free_slot = free_slots.find((slot) => {\n // return slot && (slot.start > now.ms || now.ms > slot.start - slot.start % 1000 || now.ms < slot.end - slot.end % 60 * 1000);\n // // const start = new DateTZ({date: slot?.start || 0 });\n // // const end = new DateTZ({date: slot?.end || 0}); // slot end isn't late enough? or after now/\n // // return start.isAfterDate(now) || (now.isAfterDate(start.startOfValue('second')) && now.isBeforeDate(end.startOfValue('minute')))\n // });\n\n const next_free_slot = getNextFreeBookingSlot(bookings.filter((bkn) => !bkn.declined), dateTz.ms);\n \n const start = new DateTZ({date: next_free_slot?.start || 0});\n const end = new DateTZ({date: next_free_slot?.end || 0});\n const currently_free = dateTz.isAfterDate(start.startOfValue('second')) && dateTz.isBeforeDate(end.startOfValue('minute'));\n const time_until_next_block = humaniseDuration(\n currently_free ? end.dateDiff(dateTz, 'minutes') : start.dateDiff(dateTz, 'minutes'),\n 'short'\n );\n\n const free_tomorrow = !currently_free && !start.isSameDate(dateTz, 'day');\n const free_today = currently_free && !end.isSameDate(dateTz, 'day');\n \n return {\n status: (!bookable\n ? SpaceStatus.NotBookable\n : currently_free\n ? requestable\n ? SpaceStatus.Requestable\n : SpaceStatus.Available\n : SpaceStatus.InProgress) as SpaceStatus,\n available_until: free_today\n ? 'No meetings today'\n : currently_free\n ? `Free until ${end.formatDate(timeFormatString())}(${time_until_next_block})`\n : free_tomorrow\n ? 'Unavailable today'\n : `Free at ${start.formatDate(timeFormatString())}(${time_until_next_block})`\n };\n}\n\n/**\n * V1 version display.\n */\nexport const spaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'Unavailable';\n case SpaceStatus.InProgress:\n return 'Meeting in Progress';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nexport function replaceBookings(\n list: Booking[],\n new_bookings: Booking[],\n filter_options: { room_email: string; fromTz: DateTZ; toTz: DateTZ }\n) {\n const filtered_list = list.filter((booking) => {\n return (\n !(booking.multi_rooms.some(room => room?.email === filter_options.room_email)) ||\n !timePeriodsIntersect(filter_options.fromTz.ms, filter_options.toTz.ms, booking.startDateTz.ms, booking.endDateTz.ms)\n );\n });\n const updated_list = filtered_list.concat(new_bookings);\n updated_list.sort((a, b) => a.date - b.date);\n return unique(updated_list, 'icaluid');\n}\n\nexport function timePeriodsIntersect(\n start1: number,\n end1: number,\n start2: number,\n end2: number,\n type = ''\n) {\n return (\n (start1 >= start2 && start1 < end2) ||\n (end1 > start2 && end1 <= end2) ||\n (start2 >= start1 && start2 < end1) ||\n (end2 > start1 && end2 <= end1)\n );\n}\n\nexport function formatWhen({\n all_day,\n startTZ,\n endTZ,\n displayEndTZ\n}): string {\n if (all_day) {\n return `${startTZ.formatDate('dd MMM yyyy')} - All Day`;\n } else {\n if (startTZ.isSameDate(endTZ, 'day')) {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('h:mma')}`;\n } else {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('dd MMM yyyy, h:mma')}`;\n }\n }\n}\n\nexport const isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\nexport function searchRoomsAndBookings(allItems: (Space | Booking)[], searchValue: string, isConcierge:boolean = false) {\n\n let relevantItems: (Space | Booking)[] = [];\n\n if(isConcierge) {\n relevantItems = allItems.filter( (item: any ) => \n isIncludes(item, 'title', searchValue) ||\n isIncludes(item.creator, 'name', searchValue) ||\n isIncludes(item.organiser, 'name', searchValue) ||\n isIncludes(item, 'simple_name', searchValue) || // search with room name \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n } else {\n relevantItems = allItems.filter( (item: any ) => \n this.isIncludes(item.creator, 'name', searchValue) ||\n this.isIncludes(item.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'simple_name', searchValue) \n );\n }\n\n const filteredItems = this.duplicateMultiroomEntriesIfAny(relevantItems);\n \n return filteredItems;\n} \n\nexport function duplicateMultiroomEntriesIfAny(bookings) {\n // Initialize an array to hold the original and duplicated entries \n const updatedBookings = [...bookings];\n\n // Loop through the original bookings array \n [...bookings].forEach(booking => {\n if(booking?.is_multiroom) {\n // calculate the number of times to duplicates the booking\n const duplicatesCount = booking.multi_rooms.filter(el => el.id !== booking.space.id);\n\n // Create the duplicate and add them to the updatedBookings array.\n for(let i = 0; i < duplicatesCount.length; i++) {\n // Deep copy the booking to ensure references are not copied\n const duplicatedBooking = cloneDeep(booking); \n duplicatedBooking.room = duplicatesCount[i]; \n updatedBookings.push(duplicatedBooking);\n }\n }\n });\n\n // Return the array with duplicated entries \n return updatedBookings;\n\n}\n \n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { DateNow } from \"@mckinsey-converge/date-tz\";\nimport { Observable } from 'rxjs/internal/Observable';\nimport { forkJoin } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n const now = DateNow(new Date())\n if (!options.from) {\n options.from = now\n .startOfValue('day')\n .subtractValue({ days: 2 })\n .ms;\n }\n if (!options.until) {\n options.until = null;\n }\n\n const key = `bookings|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Booking[]) => {\n delete this._promises[key];\n resolve(list);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking, series?: boolean): Promise {\n const body = booking.toApiJSON()\n if(series){\n body.series = true\n }\n return booking.id ? this.update(booking.id, body) : this.add(body);\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n public checkinIndividualVisitor(id: string, fields: BookingCheckinParams) {\n return this.taskObsr(id, 'checkin', fields); \n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n public declineMultiple(bookings: Booking[]): Observable {\n const requests = [];\n bookings.forEach(bkg => {\n const booking = bkg.toJSON();\n const id = booking.id;\n const fields = {\n booking_id: booking.id,\n organiser: booking.organiser.email,\n room_email: booking.space?.email,\n icaluid: booking.icaluid,\n start: booking.startDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n end: booking.endDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n };\n if (bkg.is_recurrent && bkg.recurrence_type === 'master') {\n // Add series=true for recurrent bookings\n fields['series'] = true;\n } \n requests.push(this.taskObsr(id, 'concierge_decline', fields) ); \n });\n return forkJoin(requests);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { PaginatedAPIService } from '../paginated.service';\nimport { Booking, IBookingQueryOptions, } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { Observable } from 'rxjs';\n\nexport interface PaginatedBooking {\n results: Booking[];\n total: number;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsPaginatedService extends PaginatedAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n\n const key = `bookingsPaginated|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (response: any) => {\n delete this._promises[key];\n resolve(response);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking): Promise {\n return booking.id ? this.update(booking.id, booking.toJSON()) : this.add(booking.toJSON());\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n // public getHoldingBay(query: IBookingQueryOptions): Promise {\n // const key = `bookingsPaginated|holding-bay`;\n // if (!this._promises[key]) {\n // this._promises[key] = new Promise((resolve, reject) => {\n // const respond = (response: any) => {\n // delete this._promises[key];\n // resolve(response);\n // };\n // const error = e => {\n // reject(e);\n // delete this._promises[key];\n // }; \n // this.query(query, { url: '/api/staff/bookings/holding_bay' }).then(respond, error);\n // });\n // }\n\n // return this._promises[key];\n // }\n\n public getHoldingBay = (query: IBookingQueryOptions): Observable => this.queryHoldingBay(query, { url: '/api/staff/bookings/holding_bay' });\n}\n","export * from './booking.class'\nexport * from './space.types'\nexport * from './bookings.service'\nexport * from './bookingsPaginated.service'\nexport * from './booking.utilities'\nexport * from './booking-state.service'\nexport * from './space.utilities'\nexport * from './booking.types'\n","import { SpaceRules } from './booking.types';\n\nimport {\n durationGreaterThanOrEqual,\n stringToMinutes\n} from './booking.utilities';\nimport {\n SpaceCheckOptions,\n SpaceRuleOptions\n} from './space.types';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * Get booking rules for the given user and space\n * @param options\n */\nexport function rulesForSpace(options: SpaceRuleOptions): SpaceRules {\n if (!options) {\n throw Error('Options are needed to check for rule matches');\n }\n const space_rules_for_user: SpaceRules = {\n auto_approve: true,\n hide: true,\n reason: ''\n };\n let match = false;\n /* istanbul ignore else */\n if (options.space) {\n for (const type in options.rules) {\n if (\n options.rules.hasOwnProperty(type) &&\n options.rules[type] instanceof Array &&\n options.space.zones.find((zone) => zone === type)\n ) {\n for (const rule_block of options.rules[type]) {\n /* istanbul ignore else */\n if (\n checkRules({\n user: options.user,\n space: options.space,\n time: options.time,\n duration: options.duration,\n rules: rule_block.conditions\n })\n ) {\n const ruleset = rule_block.rules;\n const conditions = rule_block.conditions;\n space_rules_for_user.hide = false;\n /* istanbul ignore else */\n if (conditions.max_length) {\n space_rules_for_user.max_length = stringToMinutes(\n conditions.max_length as string\n );\n }\n /* istanbul ignore else */\n if (conditions.min_length) {\n space_rules_for_user.min_length = stringToMinutes(\n conditions.min_length as string\n );\n }\n // NOTE: use max_length in conditions instead of book_length in rules\n // if (ruleset.book_length) {\n // space_rules_for_user.max_length = stringToMinutes(ruleset.book_length as string);\n // }\n /* istanbul ignore else */\n if (ruleset.auto_approve !== undefined) {\n space_rules_for_user.auto_approve = ruleset.auto_approve;\n }\n match = true;\n space_rules_for_user.reason = '';\n break;\n }\n else {\n space_rules_for_user.reason = 'OfficeRules';\n }\n }\n }\n \n /* istanbul ignore else */\n if (!space_rules_for_user.hide) {\n break;\n }\n }\n }\n if (!match) {\n space_rules_for_user.hide = true;\n }\n return space_rules_for_user;\n}\n\n\n/**\n * Check if user matches the given ruleset\n * @param options\n */\nfunction checkRules(options: SpaceCheckOptions): boolean {\n /* istanbul ignore else */\n if (options.rules) {\n const time = new DateTZ({date: options.time});\n const count = Object.keys(options.rules).length;\n let matches = 0;\n Object.keys(options.rules).forEach((key) => {\n let counter = 0;\n const condition: string[] =\n options.rules[key] instanceof Array\n ? (options.rules[key] as [])\n : [options.rules[key] as string];\n switch (key) {\n case 'groups':\n /* istanbul ignore else */\n if (options.user && options.user.groups) {\n counter = 0;\n condition.forEach((i) =>\n options.user.groups.find((j) => j === i) ? counter++ : null\n );\n /* istanbul ignore else */\n if (counter > 0) {\n matches++;\n }\n }\n break;\n case 'locations':\n /* istanbul ignore else */\n if (options.user && options.user.location) {\n counter = 0;\n condition.forEach((i) =>\n (options.user.last_location.name || '').indexOf(i) >= 0\n ? counter++\n : null\n );\n /* istanbul ignore else */\n if (counter >= options.rules[key].length) {\n matches++;\n }\n }\n break;\n case 'is_before':\n /* istanbul ignore else */\n if (options.time) {\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date()).addValue({ minutes: duration });\n let match = time.isBeforeDate(check);\n /* istanbul ignore else */\n matches += match ? 1 : 0;\n }\n break;\n case 'is_after':\n /* istanbul ignore else */\n if (options.time) {\n\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date());\n time.isAfterDate(check.addValue({ minutes: duration })) ? matches++ : '';\n }\n break;\n case 'min_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(options.duration, condition[0])\n ) {\n matches++;\n }\n break;\n case 'max_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(condition[0], options.duration)\n ) {\n matches++;\n }\n break;\n }\n });\n return matches >= count;\n }\n return false;\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringCategoriesService extends BaseAPIService {\n\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringCategory, this);\n this._name = 'catering category/group';\n this._api_route = 'catering/category';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering categories. Use catering menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering categories. Use catering menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringCategory(raw_item);\n }\n\n public format(item: CateringCategory) {\n return { ...item };\n }\n}\n","import { CateringItem } from \"./catering-item.class\";\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport class CateringCategory extends CateringItem {\n /** Whether item is a category */\n public is_category = true;\n public admin_only: boolean;\n public restricted_from: number;\n\n constructor(data: HashMap) {\n super(data);\n this.is_category = true;\n (this as any).must_select = this.must_select || 0;\n (this as any).order_anytime = !!data.order_anytime && this.package;\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj = super.toJSON();\n obj.order_anytime = !!obj.order_anytime && obj.package;\n return obj;\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport interface CateringAvailability {\n /** Month of the year that the item starts being available */\n readonly from_month: number;\n /** Month of the year that the item ends being available */\n readonly to_month: number;\n}\n\nexport class CateringItem {\n /** Unique ID of the catering item */\n public readonly id: string;\n /** Display name of the catering item */\n public readonly name: string;\n /** Description of the item */\n public readonly description: string;\n /** URL to the image associated with the item */\n public readonly image_path: string;\n /** Type of catering item */\n public readonly catering_type: string;\n /** Availability of the item */\n public readonly available: CateringAvailability;\n /** Time in hours that is needed to prepare the item beforehand */\n public readonly prior_notice: number;\n /** Cost of the item without decimals */\n private unit_price: number;\n /** Cost of the item without decimals */\n public readonly supplier_cost: number;\n /** Minimum number this item allowed in an order */\n public readonly minimum_quantity: number;\n /** Maximum number this item allowed in an order */\n public readonly maximum_quantity: number;\n /** List of categories that the item is contained in */\n public readonly parent_categories: readonly string[];\n /** Allegen information associated with the item */\n public readonly allergy: string;\n /** Whether the supply of this item has run out */\n public out_of_stock: boolean;\n /** Whether item can be ordered within the time limit set by the building */\n public readonly order_anytime: boolean;\n /** Number of child items that must be selected as part of the package */\n public readonly must_select: number;\n /** List of associated items */\n public readonly items: CateringItem[];\n public readonly availableItems: CateringItem[];\n /** Whether child items are part of a package */\n public readonly package: boolean;\n /** List of zone ids associated with the category */\n public readonly zones: readonly string[];\n /** Number of this item in the assoicated order */\n private _amount = 0;\n /** Unique ID of the catering item */\n private instance_id: string;\n /** Whether item is a category */\n public is_category: boolean = false;\n /** Whether item is disabled in Staff App */\n public admin_only: boolean;\n /** restricted_from indicates category restriction from hours ahead of delivery time */\n public restricted_from: number;\n\n public get can_order_anytime(): boolean {\n return (\n this.order_anytime ||\n !this.package && this.items.reduce(\n (anytime, item) => anytime || item.can_order_anytime,\n false,\n )\n );\n }\n\n /** Number of this item in the assoicated order */\n public get amount(): number {\n return this._amount || 0;\n }\n\n /** Unit price in the assoicated order */\n public get price(): number {\n return this.unit_price || 0;\n }\n\n /** Total cost of the amount of items set */\n public get total(): number {\n return (this._amount * this.unit_price) || 0;\n }\n\n constructor(data: HashMap) {\n this.instance_id = `item-${Math.floor(Math.random() * 999_999_999)}`;\n this.id = data.id || '';\n this.name = data.name || '';\n this.is_category = this.id.includes('category-');\n this.available = {\n from_month: (data.available ? data.available.from_month : data.available_from) || -1,\n to_month: (data.available ? data.available.to_month : data.available_to) || -1,\n };\n this.description = data.description || '';\n this.prior_notice = data.prior_notice || data.notice;\n this.unit_price = data.unit_price || data.price || 0;\n this.supplier_cost = data.supplier_cost;\n this.minimum_quantity = Math.max(0, data.minimum_quantity || 0);\n this.maximum_quantity = Math.max(1, data.maximum_quantity || 999);\n this.parent_categories = data.category_ids || data.parent_categories || data.categories;\n this.order_anytime = !!data.order_anytime;\n this.image_path = data.image_path || '';\n this.admin_only = data.admin_only;\n this.restricted_from = data.restricted_from || data?.root_category_restricted_from || 0;\n \n this.catering_type = data.catering_type;\n this.must_select = data.must_select ?? 0;\n this._amount = data._amount || data.amount || 0;\n this.allergy = data.allergy || '';\n const cateringItems: CateringItem[] = (data.items || []).map(item => new CateringItem(item));\n this.items = cateringItems;\n const filteredCateringItems = cateringItems.filter(c => !c.out_of_stock);\n this.availableItems = filteredCateringItems;\n this.out_of_stock = !!data.out_of_stock ||\n // if original items are empty, we hit the bottom, so if we filter out items then its out of stock.\n (cateringItems.length > 0 && filteredCateringItems.length === 0);\n this.package = data.package === 'true' || data.package === true;\n this.zones = data.zones && data.zones.length ? [...data.zones] : [];\n }\n\n public setAmount(amount: number = 0): void {\n if (amount <= this._amount) {\n if (amount < this.minimum_quantity) {\n amount = 0;\n }\n } else {\n if (amount < this.minimum_quantity) {\n amount = this.minimum_quantity;\n }\n }\n this._amount = Math.max(0, Math.min(this.maximum_quantity, amount));\n }\n\n /**\n * Updates the unit_price in the assoicated order if necessary\n * @param price value to compare to unit_price\n */\n public setPrice(price: number = 0): void {\n if(this.unit_price !== price) this.unit_price = price;\n }\n\n /**\n * Increase amount of the item the order\n * @param amount Amount to increase by\n */\n public addToOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount += amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = this.minimum_quantity;\n } else if (this._amount > this.maximum_quantity) {\n this._amount = this.maximum_quantity;\n }\n }\n\n /**\n * Decrease amount of the item the order\n * @param amount Amount to decrease by\n */\n public removeFromOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount -= amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = 0;\n }\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._changes;\n delete obj._server_names;\n // Convert remaining members to be public\n obj.price = obj.unit_price;\n obj.categories = obj.parent_categories;\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n return obj;\n }\n\n\n\n public within_category_restricted_time(dateTz): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!this?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: this?.restricted_from }).startOfValue('minute');\n return dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { CateringItem } from './catering-item.class';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringItemsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringItem, this);\n this._name = 'Catering Menu';\n this._api_route = 'catering/item';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering items. Use menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering items. Use menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringItem(raw_item);\n }\n\n public format(item: CateringItem) {\n return item instanceof CateringItem ? item.toJSON() : item;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { CateringItem } from './catering-item.class';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringMenuService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Catering Menu';\n this._api_route = 'menu';\n }\n\n /**\n * Convert user data to local format\n * @param user User data\n */\n protected processItem(item: HashMap) {\n return item.items ? new CateringCategory(item) : new CateringItem(item);\n }\n}\n","\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringNotesService {\n\n public cateringNotes = [];\n\n \n public setNotes(notes) {\n this.cateringNotes = notes;\n }\n\n public getNotes() {\n return this.cateringNotes;\n }\n}","import { CateringItem } from './catering-item.class';\nimport { HashMap } from '@mckinsey-converge/base';\n\nimport { CateringCategory } from './catering-category.class';\nimport { Booking } from '../bookings';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport type CateringOrderMutableProperties =\n | 'items'\n | 'location_id'\n | 'location'\n | 'delivery_time'\n | 'charge_code'\n | 'notes'\n | 'status';\n\nexport type CateringOrderStatus = 'accepted' | 'preparing' | 'ready' | 'delivered' | 'cancelled';\n\nconst now = DateNow(new Date());\n\n// R--- refactor booking date to be dateTz\nexport class CateringOrder {\n /**\n * Booking fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Unique Booking ID for the catering order */\n readonly booking_id: string;\n /** \n * Timestamp based booking time of the booking associated with the order\n * \n * Must be provide as the true Booking startDateTz or as a new DateTZ with \n * the correct date: timestamp, local_tz = false and bulding_tz values\n */\n readonly booking_date: number;\n /**\n * Timezone of the booking associated with the order\n */\n readonly booking_timezone: string;\n /** ID of the location to deliver the items to */\n location_id: string = '';\n /** Display text for the location to deliver the items to */\n location: string = '';\n /**\n * Smart timezone aware catering datetime with timezone\n */\n readonly bookingDateTz: DateTZ;\n\n /** \n * Booking associated with the order \n * \n * The booking attached to the CateringOrder is a special case used \n * mainly on the Concierge catering reports because someone created \n * a bad pattern to save catering changes to the booking. \n * \n * Avoid when possible.\n */\n public booking: Booking = null;\n\n /**\n * Catering specific fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Whether the order status change is loading */\n public loading: boolean;\n /** Unique ID for the catering order */\n readonly id: string;\n /** Number of minutes after the start of the associated meeting to delivery the order */\n readonly delivery_time: number = 0;\n /** Status of the catering order */\n readonly status: CateringOrderStatus;\n /** Whether items in the order need to be prepared in the kitchen */\n readonly kitchen: boolean;\n /** Whether items in the order are in the pantry */\n readonly pantry: boolean;\n /** List of items */\n readonly items: readonly (CateringItem | CateringCategory)[] = [];\n /** Creation time of the order */\n readonly created_at: number;\n /** Charge code associated with the order */\n readonly charge_code: string;\n /** Notes associated with the order */\n readonly notes: string;\n // /** Mapping of properties to their changes */\n // private _changes: HashMap = {};\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n /** Currency code for the location of the order */\n public symbol: string;\n /** Whether the is an error with the order */\n public error: boolean;\n\n\n constructor(data: HashMap) {\n /** \n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = DateNow(new Date());\n // now rounded to the next 5 minute increment\n const defaultStartTz = nowTz.setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n\n this.id = data.id || `order-${Math.floor(Math.random() * 999_999_999)}`;\n\n // If the booking is provided default the booking values to the true booking values\n this.booking = data.booking || null;\n\n \n // Has a booking so init with those values\n if (this.hasBookingAttached) {\n this.booking_date = this.booking.startDateTz.ms;\n this.booking_timezone = this.booking.timezone;\n this.bookingDateTz = this.booking.startDateTz;\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n } else {\n this.booking_date = data.booking_date || defaultStartTz.ms;\n this.booking_timezone = data.booking_timezone || defaultLocalTimezone;\n this.bookingDateTz = new DateTZ({ date: this.booking_date, is_local_tz: false, building_tz: this.booking_timezone });\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n }\n \n this.delivery_time = typeof data.delivery_time === 'number' ? data.delivery_time : 0;\n this.status = data.status || 'accepted';\n this.charge_code = data.charge_code || data.code;\n this.notes = data.notes;\n this.kitchen = data.kitchen instanceof Array ? !!data.kitchen.length : data.kitchen;\n this.pantry = data.pantry instanceof Array ? !!data.pantry.length : data.pantry;\n this.symbol = data.symbol || 'USD';\n this.items = (data.items || [])\n .map(item => (item.items ? new CateringCategory(item) : new CateringItem(item)))\n .filter(item => !!item.amount);\n }\n\n /** Special Case, check if a full booking is attached */\n public get hasBookingAttached(): boolean {\n return !!this.booking;\n }\n\n /** Display string for the types of items in the order */\n public get type(): string {\n let type = '';\n /* istanbul ignore else */\n if (this.kitchen) type += 'Kitchen';\n /* istanbul ignore else */\n if (this.pantry) {\n /* istanbul ignore else */\n if (type) type += ' + ';\n type += 'Pantry';\n }\n return type;\n }\n\n /** Total cost of the order */\n public get total(): number {\n return this.items.reduce((total, item) => total + (item.total || 0), 0);\n }\n\n /** Total number of items in the order */\n public get item_count(): number {\n return this.items.reduce((total, item) => total + (item.amount || 0), 0);\n }\n\n public get deliver_date(): DateTZ {\n return (this.bookingDateTz || this.booking?.startDateTz).addValue({ minutes: this.delivery_time })\n }\n\n /** Display string for the delivery time of the order (short version) */\n public get deliver_at(): string {\n return this.deliver_date.formatDate('h:mm a');\n }\n\n /** Display string for the delivery time of the order */\n public get deliver_at_time(): string {\n return this.deliver_date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Display string for the delivery date of the order */\n public get deliver_on_date(): string {\n return this.deliver_date.formatDate('dd MMM yyyy');\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): CateringOrder {\n return new CateringOrder(this.toJSON());\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringOrder): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._server_names;\n // Remove local public members\n delete obj.booking;\n delete obj.loading;\n delete obj.bookingDateTz;\n\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substr(1)] || key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n\n return obj;\n }\n}\n","import { CateringItem } from './catering-item.class';\n\nexport const mergeCateringItemWithFormData = (existing: CateringItem, override: any) =>\n new CateringItem({\n ...(existing instanceof CateringItem ? existing.toJSON() : existing),\n ...override\n });\n","export * from './catering-item.class';\nexport * from './catering-category.class';\nexport * from './catering-menu.service';\nexport * from './catering-order.class';\nexport * from './catering-categories.service';\nexport * from './catering-items.service';\nexport * from './catering.utilities';\nexport * from './catering-notes.service';\n","import { Injectable } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CloseDialogService {\n private dialogRefMap = new Map>();\n\n constructor() { }\n\n // Register a dialog with its ID\n registerDialog(id: string, dialogRef: MatDialogRef): void {\n this.dialogRefMap.set(id, dialogRef);\n }\n\n // Close a specific dialog by ID\n closeDialog(id: string): void {\n const dialogRef = this.dialogRefMap.get(id);\n if (dialogRef) {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n }\n }\n\n // Optional: Close all dialogs\n closeAllDialogs(): void {\n this.dialogRefMap.forEach((dialogRef, id) => {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n });\n }\n}\n\nexport enum DialogIds {\n MeetingDetails = 'meetingDetailsDialogId',\n BookingConfirmation = 'bookingConfirmationDialogId',\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapseService {\n private collapseSubject = new BehaviorSubject(false);\n collapse$ = this.collapseSubject.asObservable();\n\n collapsePanel() {\n this.collapseSubject.next(false);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class DataCommonModule {}\n","import { Injectable } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n Subscription\n} from 'rxjs';\n\nimport {\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\n/** List of keys that cannot be in a combination by themselves or with each other */\nconst INVALID_STANDALONE_KEYS: string[] = ['control', 'shift', 'alt', 'meta', 'os'];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class HotkeysService {\n /** Map of subjects which store press states of keys */\n private keydown_states: HashMap> = {};\n /** Map of obserers for key state subjects */\n private keydown_observers: HashMap> = {};\n /** List of keys at the end of a combination */\n private combo_end: string[] = [];\n /** List of registered hotkey combinations */\n private registered_combos: string[][] = [];\n /** Counter for the number of keydown events. Used for checking order of key presses */\n private counter: number = 0;\n /** Last key code to be pressed */\n private last_down: string;\n\n constructor() {\n window.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.last_down !== code) {\n /* istanbul ignore else */\n if (!this.keydown_states[code]) {\n this.keydown_states[code] = new BehaviorSubject(null);\n this.keydown_observers[code] = this.keydown_states[code].asObservable();\n }\n this.keydown_states[code].next(++this.counter);\n /* istanbul ignore else */\n if (this.combo_end.indexOf(code) >= 0) {\n event.preventDefault();\n }\n this.last_down = code;\n }\n });\n\n window.addEventListener('keyup', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.keydown_states[code]) {\n this.keydown_states[code].next(null);\n }\n /* istanbul ignore else */\n if (this.last_down === code) {\n this.last_down = null;\n }\n });\n }\n\n /**\n * Listen to the given key combination\n * @param combo Array of key codes to listen to or a hotkey string e.g. `Alt+Shift+KeyK`\n * @param next Callback for combination presses\n */\n public listen(combo: string | string[], next: () => void): Subscription {\n combo = (combo instanceof Array ? combo : combo.split('+'));\n const combination: string[] = combo.map(i => this.mapKey(i.toLowerCase()));\n /* istanbul ignore else */\n if (combination.length > 0 && this.validCombination(combination)) {\n this.registered_combos.push(combination);\n const last_key = combination[combination.length - 1];\n /* istanbul ignore else */\n if (!this.keydown_states[last_key]) {\n this.keydown_states[last_key] = new BehaviorSubject(null);\n this.keydown_observers[last_key] = this.keydown_states[last_key].asObservable();\n }\n this.updateCombinationEndList();\n return this.keydown_observers[last_key].subscribe((count) => {\n /* istanbul ignore else */\n if (count) {\n const presses: number[] = [];\n /* istanbul ignore else */\n if (combination.length > 0) {\n // Check that keys are pressed\n for (const key of combination) {\n const state = this.keydown_states[key];\n presses.push(state ? state.getValue() || -1 : -1);\n }\n // Check that keys are pressed in the correct order\n for (let i = 0; i < combination.length - 1; i++) {\n if (presses[i] > presses[i + 1]) {\n return;\n }\n }\n }\n const total = presses.reduce((a, v) => a + (v > 0 ? 1 : -1), 0);\n /* istanbul ignore else */\n if (total >= combination.length) {\n next();\n }\n }\n });\n }\n return null;\n }\n\n /**\n * Map key codes with multiple versions to simple form\n * @param code Code to transform\n */\n private mapKey(code: string): string {\n /* istanbul ignore else */\n if (code.indexOf('alt') >= 0 || code.indexOf('shift') >= 0 || code.indexOf('control') >= 0) {\n return code.replace('left', '').replace('right', '');\n }\n return code;\n }\n\n /**\n * Update the list of the last keys in combinations to allow for prevent default actions on pre-existing hotkeys\n */\n private updateCombinationEndList(): void {\n const key_list = [];\n for (const combo of this.registered_combos) {\n this.combo_end.push(combo[combo.length - 1]);\n }\n this.combo_end = unique(key_list);\n }\n\n /**\n * Checks if the given hotkey combination is allowed and valid\n * @param combo Array of key codes\n */\n private validCombination(combo: string[]): boolean {\n let non_meta = 0;\n for (const key of combo) {\n /* istanbul ignore else */\n if (INVALID_STANDALONE_KEYS.indexOf(key) < 0) {\n non_meta++;\n }\n }\n return non_meta > 0;\n }\n}\n","export * from './location.class';\nexport * from './location.service';\n","import { HashMap } from '@mckinsey-converge/base';\n\nimport { Organisation } from '../organisation/organisation.class';\nimport {\n ServiceLike,\n ServiceManager\n} from '../service-manager.class';\nimport { BuildingLevel } from '../organisation/level.class';\n\nexport class MapLocation {\n /** ID of the element on the associated map */\n public readonly id?: string;\n /** Name of the location */\n public readonly name?: string;\n /** X coordinate of the location */\n public readonly x?: number;\n /** Y coordinate of the location */\n public readonly y?: number;\n /** Level details for the location */\n public readonly level: BuildingLevel;\n /** Whether the position is fixed */\n public readonly fixed: boolean;\n /** Accuracy of the location when not fixed */\n public readonly confidence?: number;\n /** Whether location is at a desk */\n public readonly at_desk?: boolean;\n /** Whether location is set */\n public readonly empty: boolean;\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(MapLocation);\n }\n\n /** Display string for the building and level of the location */\n public get display(): string {\n const service = ServiceManager.serviceFor(Organisation);\n if (!service) {\n return this.level.name;\n }\n const bld = service.buildings.find((bld) => bld.id === this.level.building_id);\n return bld ? `${bld.name}, ${this.level.name}` : this.level.name;\n }\n\n /** Whether location is in a different building from the active one */\n public get in_another_building(): boolean {\n const service = ServiceManager.serviceFor(Organisation);\n return service && service.building.id !== this.level.building_id;\n }\n\n constructor(raw_data: HashMap) {\n this.id = raw_data.id || raw_data.map_id || raw_data.desk_id;\n this.name = raw_data.name || '';\n this.x = raw_data.x\n ? Math.floor(this.normalise(raw_data.x, raw_data.x_max || 10000) * 10000)\n : null;\n this.y = raw_data.y\n ? Math.floor(this.normalise(raw_data.y, raw_data.x_max || 10000) * 10000)\n : null;\n const service = ServiceManager.serviceFor(Organisation);\n this.level =\n raw_data.level instanceof BuildingLevel\n ? raw_data.level\n : service\n ? service.levelWithID(raw_data.level)\n : new BuildingLevel(raw_data.level);\n this.fixed = this.x === null && this.y === null;\n this.confidence = Math.max(5, Math.min(15, raw_data.confidence || 0));\n this.at_desk = this.id && this.id.indexOf('area-') === 0;\n this.empty = !(this.name && this.level && (this.id || this.x || this.y));\n }\n\n /** Normalise the given value within the max */\n private normalise(value: number, max: number): number {\n return value / (max * 1.0);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { MapLocation } from './location.class';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(MapLocation, this);\n this._name = 'Location';\n this._api_route = 'people';\n }\n\n public add(...args): never {\n throw new Error('Create not allowed for location service')\n }\n\n public update(...args): never {\n throw new Error('Update not allowed for location service')\n }\n\n public delete(...args): never {\n throw new Error('Delete not allowed for location service')\n }\n\n public process(item: HashMap) {\n return new MapLocation(item) as any;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { BookingRule } from '../bookings';\nimport { ServiceManager } from '../service-manager.class';\n\nexport interface BuildingCity {\n timezone: string\n name: string\n}\n\nexport interface IBuildingRoleUser {\n name: string;\n email: string;\n phone: string;\n}\n\nexport interface LockerMap {\n [zone: string]: {\n [area: string]: {\n [type: string]: (string | boolean)[][];\n };\n };\n}\n\nexport interface ICoordinates {\n longitude: number;\n latitude: number;\n}\n\nexport interface LevelFeature {\n id: string;\n level_id: string;\n name: string;\n}\n\nexport interface BookingRuleDetails {\n /** List of booking rules details for the building */\n readonly rules: readonly string[];\n /** Custom booking rules for the map */\n readonly map_rules?: readonly string[];\n /** Custom booking rules for the map */\n readonly other_rules?: readonly string[];\n /** Contact email address for the building */\n readonly contact?: string;\n /** Information string to display before the rule listings */\n readonly info?: string;\n /** Link for more details */\n readonly link?: { url?: string, name?: string };\n /**\n * Allow buildings to define their own rules formats where needed or for special messages.\n */\n readonly custom_html?: string;\n}\n\nexport class Building extends BaseDataClass {\n /** Service for managing buildings */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Engine Zone ID for the building */\n public readonly zone_id: string;\n /** Organisation Code for the building */\n public readonly code: string;\n /** Geographical address of the building */\n public readonly address: string;\n /** Details about the booking rules for the building */\n public readonly booking_details: BookingRuleDetails;\n /** Details about the booking rules for the building */\n public readonly booking_rules: HashMap;\n /** Number of hour before a booking catering is restricted */\n public readonly catering_restricted_from: number;\n /** Currency code for the country assoicated with the building */\n public readonly currency: string;\n /** Map of fields that are required on the form */\n public readonly required: HashMap;\n /** IANA timezone database string for the location the building resides */\n public readonly timezone: string;\n /** Whether catering is available in this building */\n public readonly has_catering: boolean;\n /** ID of the system used for the holding bay */\n public readonly holding_bay: string;\n /** ID of the system used for standalone visitors bookings */\n public readonly visitor_space: string;\n /** List of zones to determine sort order spaces */\n public readonly sort_order: readonly string[];\n /** Searchable map features */\n public readonly searchables: readonly LevelFeature[];\n /** List of available extras for the building */\n public readonly extras: readonly Identity[];\n /** List of available extra equipment for loan at the building */\n public readonly loan_items: readonly Identity[];\n /** List of available levels for the building */\n public readonly levels: readonly BuildingLevel[];\n /** The city the building belongs in **/\n public readonly city: string;\n\n public readonly catering_hours: { readonly start: number, readonly end: number };\n /** Map of custom settings for the building */\n private _settings: HashMap;\n /** Map of roles and list of the associated users */\n private _roles: HashMap;\n /** Map of the locker ID arrays */\n private _lockers: LockerMap;\n /** Map of important system ids for the building */\n private _systems: HashMap;\n /** Map of important phone numbers for the building */\n private _phone_numbers: HashMap;\n /** Globe coordiates for the build */\n private _location: ICoordinates;\n /** List of zones associated with the building */\n public readonly zones: readonly string[];\n\n constructor(raw_data: HashMap) {\n super(raw_data);\n const settings = raw_data.settings || {};\n const disc_info = settings.discovery_info || {};\n this.zone_id = raw_data.zone_id || raw_data.zone;\n this.extras = (raw_data.extras || disc_info.extras || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.loan_items = (raw_data.loan_items || disc_info.loan_items || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.levels = (raw_data.levels || disc_info.levels || []).map(i => new BuildingLevel({\n ...i,\n building_id: this.id\n }));\n this._roles = raw_data.roles || disc_info.roles || {};\n this._lockers = raw_data.lockers || raw_data.locker_structure || disc_info.locker_structure || {};\n this._systems = raw_data.systems || disc_info.systems || {};\n this._settings = settings;\n this._phone_numbers = raw_data.phone_numbers || disc_info.phone_numbers || {};\n this._location = raw_data.location || disc_info.location || { longitude: null, latitude: null };\n this.catering_hours = raw_data.catering_hours || disc_info.catering_hours || settings.catering_hours || {\n start: 7,\n end: 20\n };\n const searchables = [];\n if (raw_data.neighbourhoods) {\n for (const lvl in raw_data.neighbourhoods) {\n if (raw_data.neighbourhoods.hasOwnProperty(lvl)) {\n const lvl_features = raw_data.neighbourhoods[lvl] || {};\n for (const feature in lvl_features) {\n if (lvl_features.hasOwnProperty(feature)) {\n searchables.push({\n id: lvl_features[feature],\n name: feature,\n level_id: lvl\n });\n }\n }\n }\n }\n }\n this.searchables = searchables;\n this.code = raw_data.code || disc_info.code || settings.code || '';\n this.address = raw_data.address || disc_info.address || settings.address || '';\n this.booking_details = raw_data.booking_details || disc_info.booking_details || settings.booking_details || {};\n this.booking_rules = raw_data.booking_rules || disc_info.booking_rules || settings.booking_rules || {};\n this.catering_restricted_from = raw_data.catering_restricted_from || disc_info.catering_restricted_from || settings.catering_restricted_from || 0;\n this.currency = raw_data.currency || disc_info.currency || settings.currency || 'USD';\n this.required = raw_data.required || disc_info.required || settings.required || {};\n if (disc_info.requires_equipment_code) {\n this.required.equipment_code = true;\n }\n if (disc_info.requires_expected_attendees) {\n this.required.expected_attendees = true;\n }\n this.timezone = raw_data.timezone || disc_info.timezone || settings.timezone || '';\n this.has_catering = raw_data.has_catering || disc_info.has_catering || settings.has_catering || false;\n this.holding_bay = raw_data.holding_bay || disc_info.holding_bay || settings.holding_bay || '';\n this.visitor_space = raw_data.visitor_space || disc_info.visitor_space || settings.visitor_space || '';\n this.sort_order = raw_data.sort_order || disc_info.sort_order || settings.sort_order || [];\n this.city = raw_data.city || disc_info.city || 'No City';\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings) || getItemWithKeys(['discovery_info', ...keys], this._settings);\n return value;\n }\n\n /**\n * Get list of users with the associated role\n * @param name Role to find users for\n */\n public role(name: string): IBuildingRoleUser[] {\n return [...(this._roles[name] || [])];\n }\n\n /**\n * Get list of the names of available user role lists\n */\n public get role_names(): string[] {\n return Object.keys(this._roles).filter(i => this._roles.hasOwnProperty(i));\n }\n\n /** Map of the locker ID arrays */\n public get lockers(): LockerMap {\n return { ...(this._lockers || {}) };\n }\n\n /** Map of important system ids for the building */\n public get systems(): HashMap {\n return { ...(this._systems || {}) };\n }\n\n /** Map of important phone numbers for the building */\n public get phone_numbers(): HashMap {\n return { ...(this._phone_numbers || {}) };\n }\n\n /** Real coordinates */\n public get location(): ICoordinates {\n return { ...this._location };\n }\n\n /**\n * Get search map feature for the given level ID\n * @param level_id ID of level to grab features for\n */\n public featuresForLevel(level_id: string): LevelFeature[] {\n return (this.searchables || []).filter(i => i.level_id === level_id);\n }\n\n /**\n * Building objects are readonly and cannot be changed\n */\n public async save(): Promise {\n throw new Error('Building objects are readonly and cannot be changed');\n }\n\n /**\n * Building objects are readonly and cannot be deleted\n */\n public async delete(): Promise {\n throw new Error('Building objects are readonly and cannot be deleted');\n }\n}\n","export * from './building.class';\nexport * from './level.class';\nexport * from './organisation.class';\nexport * from './organisation.service';\n","import { HashMap } from 'libs/base/src/lib/types.utilities';\n\n/** Building Level data */\nexport class BuildingLevel {\n /** ID of the building level zone */\n readonly id: string;\n /** ID of the building zone associated with the level */\n readonly building_id: string;\n /** Name of the level */\n readonly name: string;\n /** Number or short identifier of the level */\n readonly short_name: string;\n /** Map URL for the level */\n readonly map_url: string;\n /** Usage type for the level */\n readonly type: 'staff' | 'client' | 'any';\n /** Setting for the level */\n readonly settings: HashMap;\n\n constructor(_data: HashMap = {}) {\n this.id = _data.id || _data.level_id || '';\n this.building_id = _data.bld_id || _data.building_id || '';\n this.name = _data.name || _data.level_name || '';\n const lower_name = this.name.toLowerCase();\n const num = lower_name.indexOf('level') >= 0 ? lower_name.replace(/ ?level ?/gi, '') : lower_name.substr(0, 1).toUpperCase();\n this.short_name = _data.short_name || num || '';\n this.map_url = _data.map_url || '';\n this.type = _data.type || _data.floor_type || 'any';\n this.settings = _data.settings;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap\n} from '@mckinsey-converge/base';\n\n/* istanbul ignore next */\n\nexport class Organisation extends BaseDataClass {\n /** List of available building zone ids for the organisation */\n public readonly available_buildings: readonly string[];\n /** Map of custom settings for the building */\n private _settings: HashMap;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this._settings = raw_data.settings || {};\n this.available_buildings = (raw_data.settings?.discovery_info?.buildings || []).map(\n (bld) => bld.zone_id\n );\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings);\n return value;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { Organisation } from './organisation.class';\nimport { Building } from './building.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { first } from 'rxjs/operators';\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { UsersService } from '../users';\nimport { SettingsService } from '../settings.service';\nimport { Observable, Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OrganisationService extends BaseAPIService {\n /** Organisation data for the application */\n private _organisation: Organisation;\n /** Actively displayed building */\n private _active_building: string;\n\n private _spaceTypesSubject: Subject = new Subject();\n\n constructor(\n protected _composer: ComposerService,\n private _service: ApplicationService,\n private _users: UsersService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Organisation, this);\n ServiceManager.setService(Building, this);\n this._name = 'Organisation';\n this._api_route = 'zones';\n this.set('buildings', []);\n this.set('active_building', null);\n this._users.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /**\n * Add is not available on organisation service\n */\n public async add(form_data: HashMap, query_params?: HashMap): Promise {\n throw new Error('Add is not available on the organisation service');\n }\n\n /**\n * Update is not available on organisation service\n */\n public async update(\n id: string,\n form_data: HashMap,\n query_params?: HashMap\n ): Promise {\n throw new Error('Update is not available on the organisation service');\n }\n\n /**\n * Delete is not available on organisation service\n */\n public async delete(id: string): Promise {\n throw new Error('Delete is not available on the organisation service');\n }\n\n /**\n * Get list of levels for the given building ID\n * @param bld_id Building ID\n */\n public levels(bld_id: string): readonly BuildingLevel[] {\n return (this.buildings.find((i) => i.id === bld_id) || ({} as Building)).levels;\n }\n\n /**\n * Get a setting from the organisation or active building\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string) {\n return this.building.setting(key) || this._organisation.setting(key);\n }\n\n /** Active building */\n public get building(): Building {\n return this.buildings.find((i) => i.id === this._active_building);\n }\n\n /** List of types of spaces */\n public get space_types(): Identity[] {\n return this.get('space_types') || [];\n }\n\n public set building(bld: Building) {\n if (bld instanceof Building) {\n this._active_building = bld.id;\n } else {\n this._active_building = bld;\n }\n this.set('active_building', this.building);\n this.loadSpaceTypes();\n localStorage.setItem('PlaceOS.building', this._active_building);\n localStorage.setItem('CONCIERGE.timezone', bld.timezone);\n }\n\n /** List of buildings for the organisation */\n public get buildings(): Building[] {\n return this.get('buildings') || [];\n }\n\n /**\n * Get list of available equipment\n * @param id ID of the building to get the list from. i.e. Defaults to the active building\n */\n public getExtras(id: string, bld_id?: string) {\n const bld = this.buildings.find((i) => i.id === bld_id) || this.building;\n if (bld && id) {\n return bld.extras.filter((i) => `${i.id}`.indexOf(id) >= 0);\n }\n return [];\n }\n\n /**\n * Get the first level matching the list of given IDs\n * @param ids List of ID to search with\n */\n public levelWithID(ids: string | string[]): BuildingLevel {\n const list = ids instanceof Array ? ids : [ids];\n const bld_list = this.buildings;\n for (const id of list) {\n for (const bld of bld_list) {\n for (const lvl of bld.levels) {\n if (lvl.id === id) {\n return lvl;\n }\n }\n }\n }\n return null;\n }\n\n /**\n * Initialise service data\n */\n protected async load(): Promise {\n /* istanbul ignore else */\n if (localStorage) {\n this._active_building = localStorage.getItem(`${this.settingsService.frontend.toUpperCase()}.building`);\n }\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.organisation = { message: 'Loading organisation data', state: 'loading' };\n await this.loadOrganisation();\n loading.organisation = { message: 'Loading organisation data', state: 'complete' };\n loading.buildings = { message: 'Loading building data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadBuildings();\n loading.buildings = { message: 'Loading building data', state: 'complete' };\n loading.levels = { message: 'Loading building floor data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadLevels();\n loading.levels = { message: 'Loading building floor data', state: 'complete' };\n this._service.set('loading', loading);\n loading.space_types = { message: 'Loading space type data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadSpaceTypes();\n loading.space_types = { message: 'Loading space type data', state: 'complete' };\n this._service.set('loading', loading);\n const user = this._users.current;\n\n if (user) {\n const id = localStorage.getItem('PlaceOS.building');\n const building = this.buildings.find(bld => id && bld.id === id) || this.buildings.find((bld) => bld.code === user.location);\n if (building) {\n this._active_building = building.id;\n this.set('active_building', building);\n } else if(this.building) {\n // This conditional solves a problem of infinite loop when user building doesn't exist.\n this._active_building = this.building.id;\n this.set('active_building', this.building);\n }\n }\n }\n\n /**\n * Load organisation data for application\n */\n public async loadOrganisation(): Promise {\n const org_data = await this.query({ tags: 'org', engine: true });\n this._organisation = new Organisation(org_data[0]);\n this.set('organisation', this._organisation);\n return this._organisation;\n }\n\n /**\n * Load building data for the organisation already stored in the service..\n */\n public async loadBuildings(): Promise {\n return this.loadBuildingsWithOrg(this._organisation);\n }\n\n /**\n * Load building data for the organisation passed.\n */\n public async loadBuildingsWithOrg(organisation: Organisation): Promise {\n const bld_data = await this.query({ tags: 'building', engine: true, limit: 1000 });\n const buildings = (bld_data as HashMap[])\n .map((i) => new Building(i))\n .filter((bld) => organisation.available_buildings.includes(bld.id));\n this.set('buildings', buildings);\n /* istanbul ignore else */\n if (!this._active_building && buildings && buildings.length > 0) {\n this._active_building = buildings[0].id;\n }\n return buildings;\n }\n\n /**\n * Load level data for the buildings\n */\n public async loadLevels(): Promise {\n const lvl_data = await this.query({ tags: 'level', engine: true, limit: 1000 });\n const levels = (lvl_data as HashMap[]).map((i) => new BuildingLevel(i));\n this.set('levels', levels);\n return levels;\n }\n\n /**\n * Load space type data for the buildings\n */\n public async loadSpaceTypes(): Promise {\n const type_data = await this.query({ tags: 'room', engine: true, limit: 1000, building_id: this._active_building });\n const types = (type_data as HashMap[]).map((i) => ({ id: i.id, name: i.name }));\n this.set('space_types', types);\n // Emit the updated space_types\n this._spaceTypesSubject.next(types);\n }\n\n /**\n * Observable to listen for changes in space_types\n */\n public get spaceTypesObservable(): Observable {\n return this._spaceTypesSubject.asObservable();\n }\n\n public getOrganizationFiltersByRoomType(key: string) {\n if (!this._organisation) {\n return {}\n }\n const discovery_info = this._organisation.setting('discovery_info')\n\n return discovery_info && discovery_info[key] ? discovery_info[key] : {}\n }\n\n public getRoomTypeSubsetDDOptions(type:string) {\n const filters = this.getOrganizationFiltersByRoomType(type) || {}\n return [...Object.keys(filters).map((key) => {\n const display = filters[key].toString();\n return {\n display,\n value: key,\n meta: {}\n }\n }) ];\n }\n\n\n\n /**\n * The function will generate filter options, excluding London. London has its own set of options as per the request. \n * The filter options pertain to a subset of room type options managed by the room admin module.\n * @returns filterOptions: filter options for day view space type filter\n */\n public getRoomFilterOptionsPerLocation() {\n let internalSubSet = this.getRoomTypeSubsetDDOptions('internal_room_types');\n if(this.building.name.toLowerCase().includes('london')) {\n internalSubSet = internalSubSet.filter(e => !e.value.includes('meeting') && !e.value.includes('partner') );\n }\n const filterOptions = [];\n internalSubSet.forEach(el => filterOptions.push({name: el.display, id: el.value} ) ); \n return filterOptions\n }\n\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseAPIService } from './base.service';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class PaginatedAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}, config: { url?: string } = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = query_params.cache || 1000;\n delete query_params.cache;\n }\n const query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = config && config.url ? `${config.url}${query ? '?' + query : ''}` : `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: IEngineResponse;\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * \n * @param query_params \n * @param config \n * @returns \n */\n queryHoldingBay(query_params: HashMap = {}, config: { url?: string } = {}):Observable {\n const query = toQueryString(query_params);\n const url = `${config.url}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );\n }\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse{\n let result: IEngineResponse;\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n return result;\n }\n \n\n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => {\n result = this.process(d); \n },\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { FormGroup } from \"@angular/forms\";\nimport { HashMap } from \"@mckinsey-converge/base\"\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\"\n\nexport enum RecurrencePeriod {\n LIST = 'list',\n DAILY = 'daily',\n WEEKLY = 'weekly',\n //RELATIVE_MONTHLY = 'relativeMonthly', for the moment we will only support absoluteMonthly\n ABSOLUTE_MONTHLY = 'monthly'\n}\n\nexport enum DaysOfWeek {\n SUNDAY = 'sunday',\n MONDAY = 'monday',\n TUESDAY = 'tuesday',\n WEDNESDAY = 'wednesday',\n THURSDAY = 'thursday',\n FRIDAY = 'friday',\n SATURDAY = 'saturday'\n\n}\n\nexport enum SeriesAction {\n EDIT = 'edit',\n CLONE = 'clone'\n}\n\nexport enum BookingAction {\n CLONE = 'booking_clone',\n EDIT = 'booking_edit'\n}\n\nexport interface WeekDays {\n id: string;\n active: boolean;\n day_index: number;\n full_name: string;\n}\n\nexport interface RepeatPeriod {\n id: RecurrencePeriod;\n label: string\n}\n\nexport enum RepeatsOn {\n PATTERN = 'pattern',\n DATE = 'date'\n}\n\nexport interface RecurrenceType {\n type: RepeatsOn;\n label: string;\n}\n\nexport interface RecurrenceDetails {\n period: RecurrencePeriod,\n end: DateTZ,\n list: Array\n interval: number\n}\n\nexport interface RecurrenceRecurringDetails extends RecurrenceDetails {\n start: number\n}\n\nexport const recurrencePeriodToDurationType = (period: RecurrencePeriod) =>{\n switch (period) {\n case RecurrencePeriod.DAILY:\n return 'days'\n case RecurrencePeriod.WEEKLY:\n return 'weeks' \n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return 'months' \n default:\n return 'days'\n }\n}\n\n/**\n * Generate weekdays from monday to saturday\n */\nexport const generateWeekDays = (date: number, params: { building_tz?: string } = {}): Array=> {\n const { building_tz } = params;\n let start_week = DateNow(new Date()).startOfValue('week').addValue({days : 1}); //set monday as start of week\n const week_days: Array = []\n for (let i = 1; i <= 7; i++) {\n const activeDate = new DateTZ({date, building_tz, is_local_tz: false })\n const active = activeDate.dateWeekday === i\n const full_name = start_week.formatDate('EEEE')\n const day_index = i === 7 ? 0 : i //Sunday must be indexed as day 0\n week_days.push({id: full_name.substring(0, 1), active, day_index, full_name: full_name.toLocaleLowerCase()});\n start_week = start_week.addValue({ days : 1 });\n }\n return week_days\n}\n\nexport const getFirstDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isBeforeDate(b) ? a : b; });\n}\n\nexport const getLastDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isAfterDate(b) ? a : b; });\n}\n\nexport const recurrenceDetails = (recurr: RecurrenceDetails): string => {\n const end = getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `Occurs Every ${period} until ${end}`\n }else{\n return `Occurs Every ${recurr.interval} ${period}s until ${end}`\n }\n } \n \n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `Occurs on Specific Dates until ${getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')}`\n default:\n return ''\n }\n}\n\nexport const recurrenceRecurringDetails = (recurr: RecurrenceRecurringDetails): string => {\n const end = recurr.end\n const start = new DateTZ({ date: recurr.start })\n\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `occurs every ${period} effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }else{\n return `occurs every ${recurr.interval} ${period}s effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }\n }\n\n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `occurs on Specific Dates`\n default:\n return ''\n }\n}\n\nexport const handleRecurrenceFields = (data: HashMap) => {\n if(data.is_recurrent){\n if(data.recurrence_period !== RecurrencePeriod.LIST){\n delete data.recurrence_starts\n delete data.recurrence_endTz\n if(data.recurrence_period !== RecurrencePeriod.WEEKLY){\n delete data.recurrence_days\n }\n } else if(data.recurrence_period){\n data.recurrence_list = [...(data.recurrence_starts || []).map((date: DateTZ) => date.startOfValue('minute').seconds)]\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.recurrence_days\n }\n delete data.is_recurrent\n }else{\n delete data.recurrence_period;\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.is_recurrent\n delete data.recurrence_exceptions\n delete data.recurrence_days\n }\n\n return data\n}\n\n/** Removes expired occurrences and updates start and end dates when cloning a series */\nexport const removeExpiredOcurrences = (form: FormGroup) =>{\n if(form.controls.action?.value === SeriesAction.CLONE ){\n const tz = form.controls.space_list.value[0].timezone\n const date_now = new DateTZ({ is_local_tz: false, building_tz: tz });\n const occurrences = form.controls.recurrence_starts.value.filter((date: DateTZ) =>\n date_now.isBeforeDate(date, 'day') || date_now.isSameDate(date, 'day')\n )\n form.controls.recurrence_starts.setValue(occurrences)\n const { start, end } = setStartAndEndDateFromArray(occurrences, tz)\n form.controls.dateTz.setValue(start)\n form.controls.recurrence_endTz.setValue(end)\n }\n}\n\n/** \n * Returns starts and end dates from an array of dates in milliseconds \n **/\n export const setStartAndEndDateFromArray = (dates: Array, tz: string): {start: DateTZ, end: DateTZ} =>{\n if(dates.length !== 0){\n return {\n start: dates.sort((d1, d2) => d1.ms - d2.ms)[0] ,\n end: dates.sort((d1, d2) => d2.ms - d1.ms)[0]\n }\n }\n //if the dates array is empty set the start and end dates as the current and next day\n const now = DateNow(new Date()).toZone(tz)\n return {start: now, end: now.addValue({days: 1})}\n}\n\nexport const setRecurrenceStartsTime = (form: FormGroup) => {\n const { recurrence_starts, dateTz } = form.value\n const list = (recurrence_starts || []).map((date: DateTZ) => date.setValue({hour: dateTz.dateHour, minute: dateTz.minutes}))\n form.controls.recurrence_starts.setValue(list)\n}","export * from './report.class'\nexport * from './reports.service'\n","import { CurrencyPipe } from '@angular/common';\n\nimport {\n csvToJson,\n downloadFile,\n HashMap,\n humaniseDuration,\n jsonToCsv,\n} from '@mckinsey-converge/base';\n\nimport { ServiceManager } from '../service-manager.class';\nimport { Space } from '../spaces';\nimport { Organisation } from '../organisation';\n\nexport class Report {\n /** Type of report */\n public readonly type: string;\n /** List of data associated with the report */\n public readonly data: T[];\n\n constructor(raw_data: HashMap = {}) {\n this.type = raw_data.type || '';\n this.data = this.cleanData(raw_data.data);\n }\n\n /** Create report data structure from CSV */\n public static fromCSV(type: string, data: string): Report {\n const csv_json = csvToJson(data);\n return new Report({ type, data: csv_json });\n }\n\n /** Download report data as CSV format */\n public downloadCSV(name: string = 'unnamed.csv'): void {\n downloadFile(name, jsonToCsv(this.data));\n }\n\n /** Download report data as JSON format */\n public downloadJSON(name: string = 'unnamed.json'): void {\n downloadFile(name, JSON.stringify(this.data, undefined, 4));\n }\n\n public formatCancelledBy(email: string) {\n if (email !== null && email !== undefined) {\n let name = email.split('@')[0];\n name = name.split('_').join(' '); //get name from email and convert it to title case\n name = name.replace(/\\w\\S*/g, function (txt) {\n return `${txt\n .charAt(0)\n .toUpperCase()}${txt.substr(1).toLowerCase()}`;\n });\n return name;\n } else {\n return email;\n }\n }\n\n public timeConverter( UNIX_timestamp: number ){\n if(!UNIX_timestamp) return '';\n let a = new Date(UNIX_timestamp * 1000);\n let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n let year = a.getFullYear();\n let month = months[a.getMonth()];\n let date = a.getDate();\n let hour = ((a.getHours() + 11) % 12 + 1);\n let suffix = a.getHours() >= 12 ? \"PM\":\"AM\";\n let min = a.getMinutes() === 0 ? '00':a.getMinutes();\n let time = date + ' ' + month + ' ' + year + ' - ' + hour + ':' + min + ' ' + suffix;\n return time;\n }\n\n private cleanData(data: T[] = []) {\n if (data.length > 0 && this.type === 'day') {\n for (let i = 0; i < data.length; i++) {\n data[i]['booker'] = data[i]['booker'].name;\n data[i]['expected_attendees'] = Object.values(data[i]['expected_attendees'])[0];\n }\n } else if (data.length > 0 && this.type === 'audit') {\n for (let i = 0; i < data.length; i++) {\n data[i]['created_at'] = this.timeConverter(data[i]['created_at']);\n }\n } else if (data.length > 0 && this.type === 'catering') {\n for (let i = 0; i < data.length; i++) {\n data[i]['Cancelled By'] = this.formatCancelledBy(\n data[i]['Cancelled By']\n );\n }\n const fields = Object.keys(data[0]);\n const room_field = fields.find(\n (key) =>\n key.toLowerCase().includes('room') &&\n key.toLowerCase().includes('email')\n );\n const price_field = fields.find((key) =>\n key.toLowerCase().includes('price')\n );\n\n for (let row of data) {\n /* istanbul ignore else */\n const space_service = ServiceManager.serviceFor(Space);\n if (room_field && price_field && space_service) {\n const room = space_service.find(\n row[room_field].toLowerCase()\n );\n const org_service = ServiceManager.serviceFor(Organisation);\n const bld = org_service.buildings.find(\n (bld: { id: any }) =>\n bld.id === room?.level?.building_id\n );\n row[price_field] = new CurrencyPipe('en_us').transform(\n row[price_field] / 100,\n bld?.currency\n );\n }\n /* istanbul ignore else */\n for (let field of fields) {\n row[field] =\n typeof row[field] === 'string'\n ? row[field].replace(/\\,/g, '٫')\n : row[field];\n }\n }\n } else if (this.type === 'bookings') {\n data = data.map((i: HashMap) => {\n const booking = i;\n try {\n if (booking.setup instanceof Object) {\n booking.setup = booking.setup[booking.room_email];\n }\n if (booking.breakdown instanceof Object) {\n booking.breakdown =\n booking.breakdown[booking.room_email];\n }\n booking.setup = humaniseDuration((booking.setup || 0) / 60);\n booking.breakdown = humaniseDuration(\n (booking.breakdown || 0) / 60\n );\n booking.description = (booking.description || '')\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ');\n booking['Meeting Host'] =\n booking.organizer?.name || booking.organizer;\n booking['Booked By'] =\n booking.booked_by?.name ||\n booking.booked_by?.email ||\n '';\n booking.charge_code =\n booking.equipment_codes[booking.room_email] || '';\n // booking.expected_attendees = Object.keys(booking.expected_attendees).map(key => booking.expected_attendees[key]).join(', ');\n booking.attendees = (booking.attendees || [])\n .map((person) => person.name || person.email || person)\n .join('٫ ');\n booking.notes = (booking.notes || [])\n .map((note) =>\n note.author &&\n (note.type === 'description' ||\n note.type === 'private')\n ? `[${note.author}|${note.type}]${note.message\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ')}`\n : ''\n )\n .join(' | ');\n booking.cancelled = booking.isCancelled;\n booking.status = booking.status[booking.room_email] || '';\n booking.company = booking.company.join(', ');\n if (booking.cancelled_by) {\n booking.cancelled_by = this.formatCancelledBy(\n booking.cancelled_by\n );\n }\n booking.cancelled_date = this.timeConverter(booking.cancelled_at_epoch);\n\n } catch (e) {}\n const remove_fields = [\n 'id',\n 'icaluid',\n 'accepted_at',\n 'accepted_by',\n 'check_ins',\n 'changeKey',\n 'created',\n 'booking_type',\n 'edit_history',\n 'end_epoch',\n 'old_attendees',\n 'start_epoch',\n 'expected_attendees',\n 'isAllDay',\n 'isCancelled',\n 'body',\n 'is_free',\n 'lastModifiedDateTime',\n 'locationType',\n 'locations',\n 'organizer',\n 'booked_by',\n 'originalEndTimeZone',\n 'originalStartTimeZone',\n 'room_booking_status',\n 'room_email',\n 'room_emails',\n 'room_id',\n 'sensitivity',\n 'seriesMasterId',\n 'show_as',\n 'notes',\n 'subject',\n 'type',\n 'previous_booking',\n 'catering',\n 'responseStatus',\n 'equipment_codes',\n 'cancelled_at_epoch',\n ];\n for (const field of remove_fields) {\n if (booking[field] !== undefined) {\n delete booking[field];\n }\n }\n const output = {};\n const order = [\n 'title',\n 'start',\n 'end',\n 'location',\n 'Meeting Host',\n 'Booked By',\n 'booked_at',\n 'booked_ahead_by',\n 'all_day',\n 'attendees',\n 'company',\n 'description',\n 'cancelled',\n 'cancelled_by',\n 'cancelled_date',\n ];\n const keys = Object.keys(booking);\n keys.sort((a, b) => {\n const idx_a = order.indexOf(a);\n const idx_b = order.indexOf(b);\n return (\n (idx_a === -1 ? keys.length : idx_a) -\n (idx_b === -1 ? keys.length : idx_b)\n );\n });\n for (const key of keys) {\n output[key] = booking[key];\n }\n return output;\n }) as any;\n }\n return data;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { Report } from './report.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ReportsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Reports';\n this._api_route = 'reports';\n }\n\n protected process(raw_data: any): Report {\n return raw_data instanceof Array\n ? new Report({ data: raw_data })\n : Report.fromCSV('', raw_data);\n }\n}\n","import { Type } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { HashMap } from '@mckinsey-converge/base';\n\n\nexport interface ServiceLike extends HashMap {\n parent: any;\n add: (_: HashMap) => Promise;\n update: (id: string, _: HashMap) => Promise;\n delete: (id: string, params?: HashMap) => Promise;\n task: (id: string, name: string, data: HashMap) => Promise;\n listen: (prop: string) => Observable;\n}\n\nexport interface ServiceProvider {\n provideFor: Type;\n useValue: T;\n}\n\nexport class ServiceManager {\n /** Map of available services for child classes */\n private static _service_list: ServiceProvider[] = [];\n\n /** Set the services used to handle data model requests */\n public static setService(type: Type, service: any): void {\n if (window.debug) {\n (window as any).ServiceManager = this._service_list;\n }\n const index = ServiceManager._service_list.findIndex(provider => provider.provideFor === type);\n if (index >= 0) {\n ServiceManager._service_list.splice(index, 1, { provideFor: type, useValue: service });\n } else {\n ServiceManager._service_list.push({ provideFor: type, useValue: service });\n }\n }\n\n /** Get the services used to handle data model requests */\n public static serviceFor(type: Type): ServiceLike {\n const provider = ServiceManager._service_list.find(provider => provider.provideFor === type) || { useValue: null };\n return provider.useValue;\n }\n\n constructor() {\n throw new Error('ServiceMananger is static class');\n }\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\n\nimport { VERSION } from '@mckinsey-converge/environment';\nimport {\n BaseClass,\n getItemWithKeys,\n HashMap,\n log\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from './service-manager.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ndeclare global {\n interface Window {\n debug: boolean;\n }\n}\n\nexport const SETTINGS_TOKEN = 'settings_service_data';\n\ntype SettingsAppData = T & {\n title: string;\n description: string;\n short_name: string;\n logo_light: {\n type: string;\n src: string;\n background: string;\n }\n logo_dark: {\n type: string;\n src: string;\n background: string;\n }\n heap_io: {\n app_id: number;\n force_ssl: boolean;\n secure_cookie: boolean;\n disable_text_capture: boolean;\n cookie_path: string;\n }\n}\n\nexport interface SettingsData {\n debug: boolean;\n mock: boolean;\n frontend: 'staff' | 'concierge' | 'booking';\n composer: {\n domain: string;\n route: string;\n protocol: string;\n port: string;\n use_domain: boolean;\n local_login: boolean;\n }\n app: SettingsAppData;\n}\n\nexport class SettingsObject {\n constructor(public data: SettingsData) {\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SettingsService extends BaseClass {\n /** Name of the application */\n private _app_name = 'Converge';\n /** List of override settings in order of priority */\n private _overrides = new BehaviorSubject([]);\n /** Mapping of behaviour subjects */\n private _subjects: HashMap> = {};\n /** Mapping of observables */\n private _observables: HashMap> = {};\n /** Which frontend we're in. staff, concierge, or bookings **/\n public readonly frontend: string;\n private _bypass_bookings: boolean = false;\n\n /**\n * @hidden\n */\n public set overrides(value: HashMap[]) {\n this._overrides.next(value);\n }\n\n /** Get observable for key */\n public listen(name: string): Observable {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n return this._observables[name];\n }\n\n /** Update observable value for key */\n public post(name: string, value: T): void {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n this._subjects[name].next(value);\n }\n\n public value(name: string): T {\n return !this._observables[name] ? null : this._subjects[name].getValue();\n }\n\n /** Page title */\n public get title() {\n return this._title.getTitle();\n }\n\n public set title(value: string) {\n this._title.setTitle(`${value} | ${this._app_name}`);\n }\n\n constructor(private _title: Title,\n @Inject(SETTINGS_TOKEN)\n private settings: SettingsObject) {\n super();\n ServiceManager.setService(SettingsService, this);\n const time = new DateTZ({date: VERSION.time});\n const built = DateNow(new Date()).isSameDate(time, 'day')\n ? `Today at ${time.formatDate('h:mma')}`\n : time.formatDate('do MMM yyyy, h:mma');\n const frontend = this.get('frontend') || 'Unknown';\n this.frontend = frontend;\n log('CORE', `${VERSION.semver}`, null, 'debug', true, frontend?.toUpperCase());\n log('APP', `${VERSION.hash} | Built: ${built}`, null, 'debug', true, frontend?.toUpperCase());\n this.init();\n }\n\n /**\n * Initialise the settings\n */\n public async init() {\n if (this.get('debug')) {\n window.debug = true;\n }\n if (this.get('app')?.name) {\n this._app_name = this.get('app').name;\n }\n log('Settings', 'Successfully loaded settings');\n this._initialised.next(true);\n }\n\n /** Whether settings service has initialised */\n public get app_name() {\n return this._app_name;\n }\n\n public get concierge() {\n return this.frontend === 'concierge';\n }\n\n public set bypass_bookings(value: boolean) {\n this._bypass_bookings = value;\n }\n\n public get bypass_bookings() {\n return this._bypass_bookings;\n }\n\n /**\n * Get a setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public get(key: string): any {\n const keys = key.split('.');\n if (keys[0] !== 'app') {\n return getItemWithKeys(keys, this.settings.data);\n }\n const override_settings = this._overrides.getValue();\n for (const override of override_settings) {\n const value = getItemWithKeys(keys.slice(1), override);\n if (value != null) {\n return value;\n }\n }\n return getItemWithKeys(keys, this.settings.data);\n }\n}\n","export * from './space.class';\nexport * from './spaces.service';\nexport * from './space.utilities';\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n} from '@mckinsey-converge/base';\nimport {\n Building,\n BuildingLevel,\n Organisation\n} from '../organisation';\nimport { User } from '../users';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { SpaceRules } from '../bookings/booking.types';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { DateTime } from 'luxon';\n\nexport interface ISpaceAvailabilityOptions {\n /** Start date and time of the availability block */\n dateTz?: DateTZ;\n /** Length of the availability block */\n duration: number;\n /** */\n id?: string;\n /** List of spaces to look at the availability for */\n room_ids?: string;\n /** Whether the spaces looked at should be bookable */\n bookable?: boolean;\n /** List of spaces or zones to ignore */\n ignore?: string;\n /** List of zones to look at the availability for */\n zone_ids?: string | string[];\n /** Whether space bookings should not be returned */\n hide_bookings?: boolean;\n /** Min capacity on the room **/\n capacity?: number\n clear?: boolean;\n /** Length of the setup */\n setup?: number;\n /** Length of the breakdown */\n breakdown?: number;\n /** Hide declined bookings */\n hide_declined?: boolean;\n /** Max capacity on the room **/\n capacity_max?: number\n\n diff_capacity?: boolean\n\n /** Fields to include recurrence in the availability search */\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array\n is_recurrent?: boolean\n is_multiroom?: boolean\n merged?: boolean\n recurrence_days?: Array\n}\n\nexport interface SpaceBookingRuleOptions {\n dateTz: DateTZ;\n duration: number;\n host: User;\n}\n\nexport const OPTION_DEFAULTS: ISpaceAvailabilityOptions = {\n duration: 60\n};\n\nexport interface RecurrenceAvailability {\n /** Unix epoch in seconds */\n readonly date: number;\n /** Whetehr space is available at this time */\n readonly available: boolean;\n}\n\n/**\n * Room Settings Type\n *\n * Exmaple:\n * available: true\n * available_until: 1644344999\n * bookings: []\n * catering: false\n * charge_code: false\n * extra_features: \"meeting_room boardroom\"\n * internal_or_external: \"internal\"\n * map_id: \"08.8.15\"\n * natural_light: false\n * room_booking_screen: true\n * room_name: \"8.15 Meeting\"\n * vc: false\n * recurrence_availability: {\n * date: \"1642596300\",\n * available: false,\n * }\n */\nexport interface RoomSettings {\n // Local room name is required.\n room_name?: string\n // TBD if anything else should be required\n available?: boolean\n available_until?: number\n bookings?: HashMap[]\n catering?: boolean\n charge_code?: boolean\n extra_features?: string\n internal_or_external?: string\n map_id?: string\n natural_light?: boolean\n room_booking_screen?: boolean\n vc?: boolean\n recurrence_availability?: RecurrenceAvailability[]\n equipment_code?: boolean\n external?: boolean\n}\n\n/**\n * List of space features that come from settings.\n *\n * Im sure this list will grow. It is not the most comprehensive list.\n */\nexport enum SpaceFeatures {\n BoardRoom = 'boardroom',\n Catering = 'catering',\n CocktailRoom = 'cocktail',\n ConferencePhone = 'conference_phone',\n ConferenceRoom = 'conference',\n ElectronicWhiteboard = 'whiteboard',\n FlipChart = 'flipchart',\n Glassboard = 'glassboard',\n PartnerOffice = 'partner',\n PhoneBooth = 'phone_booth',\n TheatreRoom = 'theatre',\n TeamRoom = 'team_room',\n VideoConference = 'vc',\n NaturalLight = 'natural_light',\n WirelessContentSharing = 'wireless_content_sharing',\n WorkshopRoom = 'workshop',\n UShapeRoom = 'u_shape',\n Miscellaneous = 'miscellaneous'\n}\n\nexport enum SpaceEquipments {\n conference_phone,\n whiteboard,\n vc,\n flipchart,\n glassboard,\n wireless_content_sharing\n}\nexport enum SpaceStyles {\n boardroom,\n cocktail,\n conference,\n partner,\n theatre,\n team_room,\n // natural_light,\n workshop,\n u_shape,\n miscellaneous\n}\n\nconst EMPTY_ARRAY = [];\n\nexport class Space extends BaseDataClass {\n /** Whether space can be booked by users */\n public readonly bookable: boolean;\n /** People capacity of the space */\n public readonly capacity: number;\n /** Index to force order when sorting multiple spaces */\n public readonly sort_priority: number;\n /** Settings has extensive info displayed in the app. */\n public readonly settings: RoomSettings;\n /** URL for the control interface of the space */\n public readonly support_url: string;\n /** Engine zones associated with the space */\n public readonly zones: readonly string[];\n /** Is the Application concierge */\n public is_concierge: boolean = false;\n /** To allow bookings with rooms for staff calendar view only */\n public allowStaffRoomWithBookings: boolean = false;\n\n /** Simple name == local name being using in seeting.room_name\n\t\t *\n\t\t*/\n public simple_name: string;\n\n /** Room style set of all room style one room has\n * [\"boardroom\", \"cocktail\", \"miscellaneous\", \"natural_light\", \"theatre\", \"u-shape\", \"workshop\"] */\n public room_style: string[] = [];\n\n /** Equipment set of all room equipment one room has\n * [\"conference_phone\", \"whiteboard\", \"vc\", \"flipchart\", \"glassboard\", \"whiteboard\", \"wireless_content_sharing\"] */\n public equipment: string[] = [];\n\n /** Filters has charge code settings for booking and catering */\n public filters: RoomSettings;\n\n /** room_type subset of internal or external rooms */\n public room_type: string[] | string;\n /**\n * Features used in identifying room types.\n *\n * Both features and extra_features are space delimited strings.\n *\n * There is a getter featuresArray that returns the\n * combination of the two as an array.\n */\n public readonly features: string;\n public readonly extra_features: string;\n public map_id: string;\n\n\n /** Service for managing spaces */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Return the rooms' building */\n public get building() {\n return this._service?.buildings.find((bld) => {\n return this.zones.includes(bld.id);\n });\n }\n\n /** Return building timezone */\n public get timezone() {\n return this.building?.timezone;\n }\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = !!settingsService?.concierge;\n this.allowStaffRoomWithBookings = settingsService?.bypass_bookings || false;\n\n const defaultGlobalName = raw_data.name || raw_data.email || 'Meeting Room';\n const defaultSettings = {\n room_name: defaultGlobalName\n }\n /**\n * Duplicate of base-api.class just for readability\n * .name is the full, mckinsey standardised name of the room.\n * You can think of it was what people would call the room when\n * considering every office and room globally.\n *\n * this.name = raw_data.name;\n */\n /**\n * Settings has extensive info displayed in the app.\n * setting.room_name is always used when displaying the room name in the applications\n * setting.room_name is the more office-specific room name, you can think of this as\n * the one people in that office would refer to the room as.\n *\n */\n this.settings = raw_data.settings || defaultSettings;\n this.filters = raw_data?.filters;\n // Room fields\n this.bookable = raw_data.bookable || false;\n this.capacity = raw_data.capacity || 0;\n this.support_url = raw_data.support_url;\n this.zones = raw_data.zones instanceof Array ? raw_data.zones : [];\n // Feature fields\n this.features = raw_data.features || '';\n this.extra_features = raw_data.settings?.extra_features || '';\n\n\t\tthis.room_type = raw_data?.room_type;\n this.simple_name = raw_data?.simple_name;\n this.map_id = raw_data?.map_id || raw_data.settings?.map_id || '';\n this.room_style = raw_data?.room_style || [];\n this.equipment = raw_data?.equipment || [];\n\n }\n\n /**\n * Return the global room name\n * IE LDN-4-408-06\n */\n public get global_name(): string {\n return this.name || ''\n }\n\n /**\n * Return the local room name\n * i.e. 4.08\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.room_name\n */\n public get local_name(): string {\n return this.simple_name || this.name || ''; // this.settings?.room_name\n }\n\n public get street_and_city(): string {\n return this.building ? `${this.building.address}, ${this.building.city}` : '';\n }\n\n /**\n * Return the map_id from settings\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.map_id and use map_id from space modal( after testing over prod)\n */\n // public get map_id(): string {\n // return this?.map_id || this.settings?.map_id || '';\n // }\n\n /** Internal / External status */\n public get internal_or_external(): string {\n const external = this.filters?.external;\n return external ? 'external' : 'internal'; // ( external ? 'external' : this.settings?.internal_or_external ) || 'internal';\n }\n\n /**\n * Works in conjunction with available_until.\n *\n * If a room is bookable that only means you can make a booking but not when.\n * Available indicates that it is available to be booked durring the queried times.\n */\n public get available(): boolean {\n return this.settings?.available ?? false;\n }\n\n public get currently_in_use(): boolean {\n const nowMs = new DateTZ({ date: DateTime.now(), is_local_tz: false, building_tz: this.timezone }).ms;\n const runningBookings = this.settings?.bookings?.filter( bks => {\n const startEpoch = new DateTZ({ date: bks.start_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n const endEpoch = new DateTZ({ date: bks.end_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n return startEpoch <= nowMs && endEpoch >= nowMs;\n })\n // console.log(raw_data.settings.room_name+' : '+ nowMs.ms);\n // console.log('IS IN USER CURRENTLY : ', isinUsernow);\n return !!runningBookings.length;\n }\n\n /** Last returned availability time */\n public get available_until(): number {\n return this.settings?.available_until;\n }\n\n /** Bookings associated with the space */\n public get bookings(): HashMap[] {\n // We should need to care if a room as bookings in Staff\n if (!this.is_concierge && !this.allowStaffRoomWithBookings) {\n return EMPTY_ARRAY;\n }\n\n if (this.settings?.bookings?.length) {\n /**\n * When we're dealing with Concierge the API data arriving is rooms, and those rooms contain booking,\n * but those bookings don't contain a room since the room is the root.\n * In order for Concierge to filter bookings by room we need to reattach this room\n * to each of the bookings, with it's own bookings.\n *\n * It's loopy and kooky but correcting for this pattern is beyond the scope of this refactor.\n */\n const spaceWithBookings = new Space(this.toJSON());\n return this.settings?.bookings.map(b => {\n b.room = spaceWithBookings;\n return b;\n });\n }\n return EMPTY_ARRAY;\n }\n\n /**\n\t\t * Whether space has catering\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.catering and use filters?.catering instead\n\t\t */\n public get has_catering(): boolean {\n return this.filters?.catering || this.settings?.catering || false;\n }\n\n /** Returns an array of the space delimited feature and extra_feature strings.\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove features, extra_features\n */\n public get featuresArray(): (SpaceFeatures | string)[] {\n // (this.simple_name === \"Entresol M-06\" ) && console.log('raw_data : ', this)\n const roomType = Array.isArray(this.room_type) ? this.room_type : [this.room_type]\n const features = [\n ...this.features.split(' '),\n ...this.extra_features?.split(' '),\n\n ...roomType, // required to work with staff>result>filters\n ...this?.room_style,\n ...this?.equipment,\n\n (this.filters?.natural_light) && SpaceFeatures.NaturalLight || undefined, // || this.settings?.natural_light\n // this.settings?.natural_light && SpaceFeatures.NaturalLight || undefined,\n // this.settings?.vc && SpaceFeatures.VideoConference || undefined,\n ].filter(f => !!f).map(f => f.toLowerCase());\n //will be an array... new Set() turns it into a set, but [... ] turns it back into an array again\n return [ ...new Set(features) ];\n }\n\n /** Level in which the space is associated */\n public get level(): BuildingLevel {\n const service = ServiceManager.serviceFor(Organisation);\n return (service ? service.levelWithID(this.zones as any) : null) || new BuildingLevel({});\n }\n\n /**\n * Return the new recurrence_availability from settings\n */\n public get recurrence_availability(): RecurrenceAvailability[] {\n return this.settings?.recurrence_availability || [];\n }\n\n public get availableOccurrences(): number {\n if(this?.recurrence_availability) {\n return this?.recurrence_availability?.filter(recurr => recurr.available).length;\n }\n }\n\n public get totalOccurrences(): number {\n return this?.recurrence_availability.length;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Space {\n return new Space(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): Space {\n const space = { ...this };\n space.settings.bookings = []; // clear out bookings\n return new Space({ ...space, id: null, email: null });\n }\n\n /**\n * Generate the booking rules for space with given options\n * @param options Conditions for generating the space rules\n */\n public rulesFor(options: SpaceBookingRuleOptions): SpaceRules {\n if (!this._service || !this.level) {\n return { auto_approve: true, hide: false };\n }\n\n const building = this.is_concierge ? this.level.building_id : this.building\n\n if (!building) {\n return { auto_approve: true, hide: false };\n }\n const { dateTz, duration, host } = options;\n const rules: SpaceRules = rulesForSpace({\n time: dateTz.ms,\n duration,\n space: this,\n user: host,\n rules: building.booking_rules\n });\n return rules;\n }\n\n /**\n * Whether space can only be booked by request\n * @param options Conditions for checking the space rules\n */\n public byRequest(options: SpaceBookingRuleOptions) {\n const rules = this.rulesFor(options);\n return !rules.auto_approve;\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Space): HashMap {\n return { ...super.toJSON(), settings: { ...this.settings, bookings: [] }, filters: { ...this.filters }, equipment: [ ...this.equipment] };\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport {\n ISpaceAvailabilityOptions,\n Space\n} from './space.class';\nimport { Building } from '../organisation/building.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\n\nexport function availabilityOptionsToQuery(options: ISpaceAvailabilityOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n if (options.dateTz) {\n const date = options.dateTz.startOfValue('minute');\n query.available_from = date.seconds; // Add one second or API will not allow end to end booking\n query.available_to = date.addValue({ minutes: options.duration || 60 }).subtractValue({ seconds: 1 }).seconds;\n\n if (options.setup) query.setup = options.setup ;\n if (options.breakdown) query.breakdown = options.breakdown;\n \n delete query.dateTz;\n delete query.duration;\n }\n\n if (!options.capacity_max) delete query.capacity_max\n\n if (options.hide_declined) query.hide_declined = options.hide_declined;\n query = handleRecurrenceFields(query)\n }\n return query;\n}\n\n/**\n * Compare two spaces to determine order\n * @param first\n * @param second\n */\nexport function sort(first: Space, second: Space, blds: Building[] = []) {\n const bld = blds.find(bld => first.zones.includes(bld.id));\n const bld_b = blds.find(bld => second.zones.includes(bld.id));\n if (bld) {\n if (bld !== bld_b) {\n return (bld.name).localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = first.zones.indexOf(zone_id) >= 0;\n const b_has_zone = second.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n }\n return first.name.localeCompare(second.name);\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { BaseAPIService } from '../base.service';\nimport { ISpaceAvailabilityOptions, Space } from './space.class';\nimport { ApplicationLoadingState, HashMap } from '@mckinsey-converge/base';\nimport { availabilityOptionsToQuery } from './space.utilities';\nimport { ServiceManager } from '../service-manager.class';\nimport { OrganisationService } from '../organisation';\nimport { ApplicationService } from '../app.service';\nimport { SettingsService } from '../settings.service';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\n\nlet SPACE_LIST = [];\n\nexport function findSpace(id: string) {\n return SPACE_LIST.find((_) => _.id === id || _.email === id);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SpacesService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n private _org: OrganisationService,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n \n super(_composer, settingsService);\n ServiceManager.setService(Space, this);\n this._name = 'Space';\n this._api_route = 'rooms';\n this._compare = (a, b) =>\n !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this._list_filter = (a: Space) => {\n const bld = this._org.building;\n return a.level.building_id === bld.id;\n };\n this._org.initialised\n .pipe(first((_) => _))\n .subscribe(() => this.init());\n }\n\n public async query(query: HashMap = {}, setList:boolean = false) {\n const list = await super.query(query);\n if ( (query.hasOwnProperty('cache') && query.cache === false) || !Object.keys(query).length || setList) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n return list;\n }\n\n public filterAvailableSpaces(list: Space[]) {\n return list.filter((i) => {\n if (i.recurrence_availability?.length) return i; //if recurrence, send the space regardless of availability (needed for edit and cloning series)\n return i.available;\n });\n }\n\n /**\n * Get available spaces\n * @param options\n */\n public available(\n options: ISpaceAvailabilityOptions,\n uniqueId?: string,\n filter: boolean = true\n ): Promise {\n if (!options) {\n throw new Error('Space avilability requires request options');\n }\n\n const now = DateNow(new Date());\n if (!options.dateTz) {\n options.dateTz = now.startOfValue('minute');\n }\n\n if (options.hide_declined === undefined) {\n options.hide_declined = true;\n }\n\n const key = `available|${options.id ? options.id : ''}|${\n uniqueId ?? ''\n }`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Space[]) => {\n delete this._promises[key];\n resolve(filter ? this.filterAvailableSpaces(list) : list);\n };\n const error = (e) => {\n reject(e);\n delete this._promises[key];\n };\n const query = availabilityOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(\n (i) => respond([i]),\n error\n );\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n const loading: ApplicationLoadingState =\n this._service.get('loading') || {};\n if (!loading.spaces) {\n loading.spaces = {\n message: 'Loading space data',\n state: 'loading',\n };\n this._service.set('loading', loading);\n }\n // Adjusted the query by incorporating the \"zone_ids\" option to filter rooms based on specific zone IDs instead of considering all thousands of rooms.\n const option = {\n zone_ids: this._org.building.id\n }\n await this.query(option, true).catch(() => {\n loading.spaces = { message: 'Loading space data', state: 'failed' };\n this._service.set('loading', loading);\n });\n loading.spaces = { message: 'Loading space data', state: 'complete' };\n this._service.set('loading', loading);\n }\n\n /**\n * Convert raw data into API object\n * @param raw_data Raw API data\n */\n public process(raw_data: HashMap): Space {\n return new Space(raw_data);\n }\n /**\n * \n * Special observable function to make http call for rooms\n * @param query \n * @returns observable\n */\n public queryRooms = (query: HashMap = {}): Observable => super.queryRoomsForQR(query);\n\n public setSpaceList(list) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n\n public queryBooking = (query: HashMap = {}) : Observable | Observable => super.queryObsr(query);\n public updateSpace = (id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.updateObsr(id, form_data, should_inject_concierge, query_params);\n public uploadSpacePhotos = (apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.uploadSpacePhotos(apiSubRoute, form_data, should_inject_concierge, query_params);\n \n public updateRoomList() {\n this.load().then((_) => null)\n }\n}\n","import {\n BehaviorSubject,\n of\n} from 'rxjs';\nimport {\n Building,\n Organisation\n} from './organisation';\nimport { BaseDataClass } from './base-api.class';\nimport { MapLocation } from './location';\nimport { User } from './users';\nimport { Booking } from './bookings';\nimport {\n RoomSettings,\n Space,\n SpaceFeatures\n} from './spaces';\nimport { ServiceManager } from './service-manager.class';\nimport {\n CateringCategory,\n CateringItem\n} from './catering';\nimport {\n HashMap,\n padZero,\n predictableRandomInt,\n unique\n} from '@mckinsey-converge/base';\n\nimport * as faker from 'faker';\n\nimport {\n SETTINGS_TOKEN,\n SettingsData,\n SettingsObject,\n SettingsService\n} from './settings.service';\nimport { Report } from './reports';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nfaker.seed(2560);\n\nlet SERVICE: any;\n\ndeclare global {\n interface Jest {\n fn: () => any\n }\n}\n\n\ndeclare let jest: Jest;\n\n/* istanbul ignore file */\n\nexport function generateMockOrganisationService(): HashMap {\n return {\n levelWithID: jest.fn(),\n listen: jest.fn(),\n loadOrganisation: jest.fn(),\n initialised: of(true),\n building: new Building(generateMockBuilding({ id: 'bld-01' })),\n loadBuildingsWithOrg: jest.fn(),\n getOrganizationFiltersByRoomType: jest.fn(),\n getRoomTypeSubsetDDOptions: jest.fn(),\n getRoomFilterOptionsPerLocation: jest.fn(),\n ...generateMockDataService('OrganisationService')\n };\n}\n\nexport const generateMockSpacesService = (): HashMap => ({\n available: jest.fn(),\n ...generateMockDataService('SpacesService')\n});\n\nexport const generateMockUsersService = (): HashMap => ({\n loadCurrentUser: jest.fn(),\n ...generateMockDataService('UsersService')\n});\n\nexport const bookingState = () => ({\n bookings: of([]),\n filtered: of([]),\n filtered_week: of([]),\n filtered_month: of([]),\n setZone: jest.fn(),\n setDate: jest.fn(),\n setFilters: jest.fn(),\n add: jest.fn(),\n replace: jest.fn(),\n remove: jest.fn(),\n startPolling: jest.fn(),\n startPollingMonth: jest.fn(),\n startPollingWeek: jest.fn(),\n startPollingEveryFiveMin: jest.fn(),\n _noOfMeetings: of([])\n});\n\nconst test_app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n }\n};\n\nexport const TEST_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/test',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app: test_app,\n mock: false,\n frontend: 'staff'\n};\n\nexport const generateMockSettingsService = (overrides: Partial> = {}) => new SettingsService({ getTitle: () => jest.fn() } as any,\n new SettingsObject({\n ...TEST_SETTINGS,\n ...overrides\n }));\n\n/**\n * Provides an injectable instance for settings.\n */\nexport const provideMockSettingsObject = (settings: Partial> = {}) => ({\n provide: SETTINGS_TOKEN,\n useValue: new SettingsObject({\n ...TEST_SETTINGS,\n ...settings\n })\n});\n\n/**\n * Generate a mocked version of the application service\n */\nexport function generateMockAppService(settingsOverrides: Partial> = {}) {\n SERVICE = {\n setting: jest.fn(),\n notify: jest.fn(),\n notifyInfo: jest.fn(),\n notifyWarn: jest.fn(),\n notifySuccess: jest.fn(),\n notifyError: jest.fn(),\n log: jest.fn(),\n navigate: jest.fn(),\n navigateBack: jest.fn(),\n get: jest.fn(),\n listen: jest.fn(),\n set: jest.fn(),\n Composer: { auth: { token: 'test' } },\n Hotkeys: { listen: jest.fn() },\n Users: generateMockUsersService(),\n Organisation: generateMockOrganisationService(),\n Locations: generateMockDataService('LocationsService'),\n Base: generateMockDataService('BaseService'),\n Menu: generateMockDataService('CateringMenuService'),\n Spaces: generateMockSpacesService(),\n Bookings: generateMockDataService('BookingsService'),\n Reports: generateMockDataService('ReportsService'),\n CateringItems: generateMockDataService('CateringItemsService'),\n CateringCategories: generateMockDataService('CateringCategoriesService'),\n Settings: generateMockSettingsService(settingsOverrides),\n initialised: of(true)\n };\n ServiceManager.setService(BaseDataClass, SERVICE.Base);\n ServiceManager.setService(Organisation, SERVICE.Organisation);\n ServiceManager.setService(Building, SERVICE.Organisation);\n ServiceManager.setService(User, SERVICE.Users);\n ServiceManager.setService(Booking, SERVICE.Bookings);\n ServiceManager.setService(Space, SERVICE.Spaces);\n ServiceManager.setService(MapLocation, SERVICE.Locations);\n ServiceManager.setService(Report, SERVICE.Reports);\n ServiceManager.setService(CateringItem, SERVICE.CateringItems);\n ServiceManager.setService(CateringCategory, SERVICE.CateringCategories);\n SERVICE.Organisation.buildings = [SERVICE.Organisation.building];\n SERVICE.Users.current = new User(generateMockUser());\n SERVICE.Users.initialised = of(true);\n SERVICE.Bookings.booking_list = new BehaviorSubject(new Array(10).fill(0).map(_ => new Booking(generateMockBooking())));\n SERVICE.listen.mockReturnValue(of(null, []));\n return SERVICE;\n}\n\nexport function generateMockDataService(name: string) {\n const service = {\n find: jest.fn(),\n filter: jest.fn(),\n listen: jest.fn(),\n get: jest.fn(),\n set: jest.fn(),\n setting: jest.fn(),\n query: jest.fn(),\n show: jest.fn(),\n add: jest.fn(),\n save: jest.fn(),\n remove: jest.fn(),\n delete: jest.fn(),\n update: jest.fn(),\n addFrom: jest.fn(),\n removeFrom: jest.fn(),\n task: jest.fn(),\n available: jest.fn(),\n process: jest.fn(),\n updateList: jest.fn(),\n clearList: jest.fn(),\n removeFromList: jest.fn(),\n accept: jest.fn(),\n decline: jest.fn(),\n checkin: jest.fn(),\n is_logged_in: false,\n initialised: of(true),\n getHoldingBay: jest.fn(),\n name,\n queryRooms: of(true),\n queryRoomsForQR: of([]),\n queryObsr: of([]),\n queryBooking: of(true),\n checkinIndividualVisitor: jest.fn(),\n taskObsr: of(true),\n updateSpace: jest.fn(),\n updateObsr: of([]),\n uploadSpacePhotos: of([])\n\n };\n\n service.getHoldingBay.mockImplementation(_ => Promise.resolve([new Booking({})]));\n service.save.mockImplementation(_ => Promise.resolve(new Booking({})));\n\n service.listen.mockReturnValue(of(null));\n service.filter.mockReturnValue([]);\n return service;\n}\n\nlet SPACE_COUNT: number = 0;\n\nexport function generateMinimalRoomDetails(count: number) {\n return {\n name: `space-0${count}`,\n email: `space-0${count}@test.com`,\n settings: {\n name: `localname-0${count}`,\n catering: true\n }\n }\n}\n\nexport function generateMockSpace(overrides: HashMap = {}, space_id: number = null, recurring_search: boolean = false ): Space {\n const id = `space-${space_id || SPACE_COUNT++}`;\n const name = overrides.name || `${faker.name} ${faker.name.lastName()} Space`;\n const startOfDay = DateNow(new Date()).startOfValue('day');\n let settings: RoomSettings = {\n available: true,\n available_until: startOfDay.addValue({ days: 1 }).seconds, // (Date.now() / 1000) + (60 * 60 * 24), // now plus 24 hrs\n bookings: Array(10).fill(0).map(i => generateMockBooking()),\n catering: true,\n charge_code: true,\n extra_features: \"meeting_room boardroom\",\n internal_or_external: \"internal\",\n map_id: \"1\",\n natural_light: false,\n room_booking_screen: true,\n room_name: `${name} - Local Name`,\n vc: false,\n }\n if (overrides.settings) {\n settings = { ...settings, ...overrides.settings };\n delete overrides.settings;\n }\n if (recurring_search) {\n settings.recurrence_availability = [\n {\n date: startOfDay.seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 1 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 2 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 3 }).seconds,\n available: false,\n },\n ]\n }\n\n const linked = Math.floor(predictableRandomInt(99999)) % 2 === 0 && SPACE_COUNT > 1;\n return new Space({\n id,\n name: `${name} - Global Name`,\n map_id: `${space_id || SPACE_COUNT}`,\n type: faker.commerce.productName(),\n searchable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n controlable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n hourly_rate: Math.floor(predictableRandomInt(300)) * 100,\n bookable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n capacity: 15,\n sort_priority: 0,\n setup: Math.floor(predictableRandomInt(6)) * 5,\n breakdown: Math.floor(predictableRandomInt(6)) * 5,\n support_url: `/control/#/${id}`,\n image: faker.image.business(),\n zones: ['zone_lvl-0'],\n features: `${SpaceFeatures.BoardRoom} ${SpaceFeatures.ElectronicWhiteboard}`,\n email: `${name.toLowerCase().split(' ').join('.')}@${USER_DOMAIN}`,\n settings,\n ...overrides\n });\n}\n\nlet BOOKING_COUNT = 0;\nlet BOOKING_DATE = DateNow(new Date()).setValue({ hour: 6 }).setValue({minute: 0}).subtractValue({ days: 10 }).startOfValue('minute');\n\n/**\n * Set the initial time used for generating mock bookings\n * @param time New initial time as ms from UTC epoch\n */\nexport function setMockBookingStartDatetime(time: number) {\n const date = new DateTZ({date: time})\n BOOKING_DATE = date.startOfValue('minute');\n}\n\n/**\n * Create mock raw API data for a booking\n * @param override Overrides the properties of the generated booking with it's own\n */\nexport function generateMockBooking(override: HashMap = {}) {\n const id = `booking-${BOOKING_COUNT++}`;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4) + 2) * 15 });\n const start = BOOKING_DATE.ms;\n const duration = Math.floor(predictableRandomInt(4) + 2) * 15;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4)) * 15 });\n const organiser = generateMockUser({ external: false, visitor: false });\n const orders = Array(Math.floor(predictableRandomInt(5)))\n .fill(0)\n .map(_ => generateMockCateringOrder({ booking_date: start }, override.room_ids, override.menu));\n const hasCatering = Math.floor(predictableRandomInt(34567)) % 3 === 0;\n const date_start = new DateTZ({date: start})\n return {\n id,\n title: `${faker.commerce.productName()} Meeting`,\n attendees: Array(Math.floor(predictableRandomInt(5) + 2))\n .fill(0)\n .map((_, i) => generateMockUser(override.users)),\n organiser,\n start_epoch: date_start.seconds,\n end_epoch: date_start.addValue({ minutes: duration }).seconds,\n body: faker.lorem.paragraph(),\n notes: [{ type: 'other', message: faker.lorem.paragraph() }],\n location: faker.address.city(),\n // Mckinsey only has internal or external meetings\n booking_type: ['internal', 'external'][predictableRandomInt(2)],\n setup: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n breakdown: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n status: 'accepted',\n catering: hasCatering ? orders : [],\n room: new Space(generateMinimalRoomDetails(1)), // returns space-01 type values\n equipment_codes: {},\n company:[],\n ...override\n };\n}\n\nlet BLD_COUNT = 0;\nlet LVL_COUNT = 0;\n\n/**\n * Generate raw mock data for creating a building\n * @param id Forced ID for the mock\n * @param overrides Supply object value overrides in place. Supports a levelGenerator function\n * to stabilize level ids for testing.\n */\nexport function generateMockBuilding(overrides: HashMap = {}): HashMap {\n const id = `zone_bld-${BLD_COUNT++}`;\n const levels = Array(10)\n .fill(0)\n .map((_, i) => generateMockLevel(undefined, overrides.levelGenerator?.(i)));\n const features: any = {};\n for (const lvl of levels) {\n const count = Math.floor(predictableRandomInt(3) + 2);\n features[lvl.level_id] = {};\n for (let i = 0; i < count; i++) {\n features[lvl.level_id][faker.commerce.productName()] = `feature-${i + 1}`;\n }\n }\n return {\n id,\n zone_id: id,\n extras: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n code: 'NYO',\n name: faker.name.firstName(),\n address: 'building address field',\n city: 'building city',\n loan_items: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n levels,\n roles: {\n 'first-aiders': Array(10)\n .fill(0)\n .map(i => generateMockUser())\n },\n neighbourhoods: features,\n settings: {\n test: {\n nested: {\n level2: true,\n org: false\n }\n },\n city: faker.address.city()\n },\n timezone: 'America/Chicago',\n ...overrides\n };\n}\n\n/**\n * Generate raw mock data for a building level\n * @param id Forced ID for the mock\n * @param overrides value overrides\n */\nexport function generateMockLevel(id?: string, overrides: HashMap = {}): HashMap {\n if (!id) {\n id = `zone_lvl-${LVL_COUNT++}`;\n }\n return {\n id,\n level_id: id,\n level_name: `Level ${LVL_COUNT}`,\n short_name: `L ${LVL_COUNT}`,\n ...overrides\n };\n}\n\nlet USER_COUNT = 0;\n\nexport let USER_DOMAIN = 'acaprojects.com';\n\nconst USER_EMAILS: string[] = [];\n\n/**\n * Generate raw mock data for a user\n * @param id Forced ID for the mock\n * @param name Forced name for the user\n * @param external Whether user is external of the organisation\n */\nexport function generateMockUser(override: HashMap = {}): HashMap {\n const id = `user-${USER_COUNT++}`;\n const name = `${faker.name.firstName()} ${faker.name.lastName()}`;\n const external = override.external || !(predictableRandomInt(99999) % 2);\n const organisation = external ? faker.company.companyName() : USER_DOMAIN.split('.')[0];\n let delegates: {email: string, opt_out: boolean}[] = [];\n const delegate_count = Math.min(predictableRandomInt(4) + 1, USER_EMAILS.length);\n for (let i = 0; i < delegate_count; i++) {\n delegates.push({email: USER_EMAILS[Math.floor(predictableRandomInt(USER_EMAILS.length))], opt_out: false});\n }\n delegates = unique(delegates);\n const email = `${name\n .split(' ')\n .join('.')\n .toLowerCase()}@${external ? 'not-' : ''}${USER_DOMAIN}`;\n USER_EMAILS.push(email);\n return {\n id,\n name,\n first_name: name.split(' ')[0],\n last_name: name.split(' ')[1],\n email,\n phone: faker.phone.phoneNumber(),\n visitor: external,\n organisation: {\n id: organisation\n .split(' ')\n .join('.')\n .toLowerCase(),\n name: organisation\n },\n department: faker.commerce.department(),\n staff_code: padZero(Math.floor(predictableRandomInt(99999)), 5),\n delegates,\n image: faker.image.avatar(),\n ...override\n };\n}\n\nexport function generateMockCateringOrder(overrides: HashMap = {}, room_id: string = '', menu: HashMap = {}) {\n return {\n id: `order-${predictableRandomInt(9999_9999)}`,\n delivery_time: predictableRandomInt(6) * 5,\n location_id: room_id, // R--- could be undefined\n items: new Array(predictableRandomInt(5, 1)).fill(0).map(i => pickMenuItem(menu)),\n ...overrides\n };\n}\n\nfunction pickMenuItem(menu_map: HashMap = {}) {\n const zones = Object.keys(menu_map);\n const menu = menu_map[zones[predictableRandomInt(zones.length)]] || [];\n const category = menu[predictableRandomInt(menu.length)] || { items: [] };\n const group = { ...(category.items[predictableRandomInt(category.items.length)] || {}) };\n if (!group.package && group.items?.length) {\n const item = { ...group.items[predictableRandomInt(group.items.length)] };\n item.amount = predictableRandomInt(5, 1);\n return item;\n }\n group.amount = predictableRandomInt(5, 1);\n return group;\n}\n\nexport function generateMockLocation(overrides: HashMap, fixed_locations: string[], maps: string[]): HashMap {\n const fixed = predictableRandomInt(999_999_999) % 2 === 0;\n if (fixed && (!overrides || overrides.fixed)) {\n return {\n map_id: fixed_locations[predictableRandomInt(fixed_locations.length)],\n level: maps[predictableRandomInt(maps.length)],\n ...overrides\n };\n } else {\n return {\n x: predictableRandomInt(900, 100),\n x_max: 1000,\n y: predictableRandomInt(500, 100),\n level: maps[predictableRandomInt(maps.length)],\n confidence: predictableRandomInt(30),\n ...overrides\n };\n }\n}\n\nlet ORG_COUNT = 0;\n\nexport function generateMockOrganisation(): HashMap {\n const buildings = Array(3).fill(0).map(i => generateMockBuilding());\n return {\n id: `zone_org-${ORG_COUNT++}`,\n name: `Organisation ${ORG_COUNT}`,\n buildings,\n settings: {\n discovery_info: {\n buildings\n },\n test: {\n nested: {\n org: true\n }\n }\n }\n };\n}\n\n\nexport const generateMockBuildingSetByCity = () => {\n const buildings: Building[] = Array(10).fill(0)\n .map(() => new Building(generateMockBuilding()));\n buildings.push(...Array(2).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'Auckland'\n },\n city: 'Auckland'\n }))));\n buildings.push(...Array(5).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'NYC'\n },\n city: 'NYC'\n }))));\n return buildings;\n};\n\nexport function generateMockModalData(data: HashMap = null) : HashMap {\n if (data) {\n return data;\n }\n return {\n pendingDate: new Date(1603087100 + (1000 * 60 * 15)),\n pendingDuration: 60,\n date: 1603087100,\n duration: 30,\n }\n}\n\nexport const mockDateToBuildingTz = (date?: number) =>{\n return new DateTZ({date, building_tz: 'America/Chicago', is_local_tz: false})\n}","export * from './user.class'\nexport * from './user.utilities'\nexport * from './users.service'\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { MapLocation } from '../location';\nimport { ServiceManager } from '../service-manager.class';\n\nexport class User extends BaseDataClass {\n \n /** Currently logged in user */\n public static get active_user(): User {\n const service = ServiceManager.serviceFor(User);\n return service ? service.current : null;\n }\n\n /** First name of the user */\n public readonly first_name: string;\n /** Last name of the user */\n public readonly last_name: string;\n /** Windows user ID */\n public readonly windows_id: string;\n /** FMNO */\n public readonly fmno: string;\n /** Type of user */\n public readonly type: 'partner' | 'external' | 'internal';\n /** Contact phone number of the user */\n public readonly phone: string;\n /** Organisational department the user is part of */\n public readonly business_unit: string;\n /** Whether user is external from the application's organisation */\n public readonly external: boolean;\n /** Whether user is a visitor */\n public readonly visitor: boolean;\n /** Organisational Identifier for the user */\n public readonly staff_code: string;\n /** Basic location descriptor for the user */\n public readonly location: string;\n /** List of users that this user can act on behalf */\n public readonly delegates: readonly {email: string, opt_out: boolean}[];\n /** URL of the user's avatar image */\n public readonly image: string;\n /** List of user groups associated with this user */\n public readonly groups: readonly string[];\n /** Organisation the user is associated with */\n private _organisation: Identity;\n\n /** Map location of the user */\n private _location: MapLocation;\n /** List of desk bookings */\n // private _desk_bookings: HashMap = {}; // R--- can't explain why this is here.\n /** Host/Organisawe email notification opt out/in setting */\n public opt_out: boolean;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this.first_name = raw_data.first_name || '';\n this.last_name = raw_data.last_name || '';\n this.windows_id = raw_data.email || '';\n this.fmno = raw_data.fmno;\n this.external = raw_data.external || false;\n this.visitor = raw_data.visitor || false;\n\n\n this.type = this.visitor ? 'external' : 'internal';\n this.phone = raw_data.phone || raw_data.mobile || '';\n this.business_unit = raw_data.business_unit || raw_data.department || '';\n this._organisation = raw_data.organisation || {\n id: raw_data.organisation_id,\n name: raw_data.organisation_name\n };\n\n this._location = null;\n this.image = raw_data.image || '';\n this.staff_code = raw_data.staff_code || raw_data.fmno || '';\n this.delegates = raw_data.delegates || [];\n this._location = new MapLocation(\n raw_data.location && raw_data.location instanceof Object\n ? raw_data.location\n : { name: raw_data.location }\n );\n this.groups = raw_data.groups || [];\n this.location = raw_data.location || raw_data.officeLocation || '';\n this.opt_out = raw_data.opt_out;\n }\n\n /** Organisation the user is associated with */\n public get organisation() {\n return this._organisation;\n }\n\n /** Map location of the user */\n public get last_location(): MapLocation {\n return new MapLocation(this._location || {});\n }\n\n /**\n * Ask the server for the users current location\n */\n public locate(): Promise {\n const service: any = ServiceManager.serviceFor(MapLocation);\n return new Promise((resolve, reject) => {\n if (service) {\n service.show(this.id, { desk: this.email }).then(\n l => {\n this._location = l;\n resolve(l);\n },\n e => reject(e)\n );\n } else {\n resolve(null);\n }\n });\n }\n\n /**\n * Whether user is available during the given period\n * @param start Start time as a unix timestamp with milliseconds\n * @param end End time as a unix timestamp with milliseconds\n */\n public available(start?: number, end?: number): Promise {\n return new Promise(resolve => {\n this._service.query({ email: this.email, start, end }).then(\n l => resolve(l && l.length > 0),\n _ => resolve(false)\n );\n });\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): User {\n return new User(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): User {\n return new User({ ...this, id: null, email: null });\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: User): HashMap {\n const data = super.toJSON();\n delete data.location;\n return data;\n }\n}\n\n// R--- Might need an toApiJSON due to visitor field.","import {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { HashMap } from '@mckinsey-converge/base';\nimport { User } from './user.class';\n\n/**\n * Generate form fields for the given user\n * @param user User to generate form for\n */\nexport function generateUserForm(user: User): FormGroup {\n if (!user) {\n throw Error('No user passed');\n }\n const fields: HashMap = {\n id: new FormControl(user.id || ''),\n name: new FormControl(user.name || ''),\n first_name: new FormControl(user.first_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n last_name: new FormControl(user.last_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n email: new FormControl(user.email || '', [Validators.email])\n };\n // Generate form group for booking item\n return new FormGroup(fields);\n}\n","import { Injectable } from '@angular/core';\nimport { Location } from '@angular/common';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { Md5 } from 'ts-md5/dist/md5';\n\nimport { BaseAPIService } from '../base.service';\nimport { User } from './user.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface ILoginOptions {\n /** URL to post login request to */\n url?: string;\n /** Whether form data is passed in the body of the request */\n form?: boolean;\n /** Custom headers to pass into the post request */\n headers?: HashMap;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UsersService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n protected uhttp: HttpClient,\n protected location: Location,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(User, this);\n this._name = 'Users';\n this._api_route = 'users';\n this._compare = (a, b) => !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this.set('list', []);\n this.set('current_user', new User({ id: 'local_user', name: 'Local User' }));\n this.set('delegates', null);\n this._composer.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /** Currently logged in user */\n public get current(): User {\n return this.get('current_user');\n }\n\n /** Whether the user has properly logged in */\n public get is_logged_in(): boolean {\n return this.current && this.current.id !== 'local_user';\n }\n\n /* istanbul ignore next */\n /**\n * Sets the access token and expiry for the user\n * @param token OAuth bearer token\n * @param expiry Expiry epoch timestamp in ms\n * @param reload Whether to reload the page after setting tokens\n */\n public setToken(token: string, expiry?: number, reload: boolean = true) {\n if (!expiry) {\n const now = DateNow(new Date())\n expiry = now.addValue({ days: 7 }).endOfValue('day').ms;\n }\n const path = `${location.origin}${\n this._service.setting('composer.route') || ''\n }/oauth-resp.html`;\n const client_id = Md5.hashStr(path);\n if (sessionStorage) {\n sessionStorage.setItem(`${client_id}_access_token`, token);\n sessionStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (localStorage) {\n localStorage.setItem(`${client_id}_access_token`, token);\n localStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (reload) {\n this.location.go(this.location.path());\n }\n return path;\n }\n\n /**\n * Post login request to the API\n * @param query_params Key value pairs to pass into\n * @param options Options for the login request\n */\n public async login(query_params: HashMap, options: ILoginOptions = {}): Promise {\n if (this.settingsService.concierge) {\n if (!this._promises['login']) {\n this._promises['login'] = new Promise((resolve, reject) => {\n this.set('status', 'loading');\n let headers = new HttpHeaders();\n if (!options || options.form !== false) {\n headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');\n }\n const url = (options ? options.url : '') || '/auth/signin';\n this.uhttp.post(url, query_params, { headers }).subscribe(\n (_) => null,\n (e) => reject(e),\n () => {\n this._composer.auth.authorise();\n resolve();\n }\n );\n });\n }\n return this._promises['login'];\n }\n }\n\n\n /**\n * Logout of user and redirect to logout URL\n */\n public logout() {\n this._composer.auth.logout();\n }\n\n /**\n * Loads current user from API. This diverges from {@link load} in order to simply return\n * the user object instead of setting it on the service.\n */\n public async loadCurrentUser(): Promise {\n return this.show('current')\n }\n\n /**\n * Load initial data for the service\n */\n protected load(tries: number = 0): Promise {\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.user = { message: 'Loading user credentials', state: 'loading' };\n this._service.set('loading', loading);\n this.set('status', 'loading');\n return new Promise((resolve) => {\n // this is due to unclear nature of the merge between concierge and staff\n // concierge has the retries enabled, while staff continuously retries.\n if (this.settingsService.concierge && tries > 4) {\n this.set('status', 'invalid');\n loading.user = { message: 'Loading user credentials', state: 'failed' };\n this._service.set('loading', loading);\n return resolve();\n }\n this.show('current').then(\n async (current_user) => {\n this.set('status', 'available');\n this.set('current_user', current_user);\n this._initialised.next(true);\n if (this._service && this._service.setting('app.user.grab_api_details')) {\n this.show(current_user.email).then(\n async (user) => {\n this.set('current_user', user);\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = {\n message: 'Loading user credentials',\n state: 'complete'\n };\n this._service.set('loading', loading);\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n } else {\n \n // is after process\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => current_user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = { message: 'Loading user credentials', state: 'complete' };\n this._service.set('loading', loading);\n }\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n });\n }\n\n private async loadDelegates() {\n const delegates = this.current.delegates;\n if (!delegates || !delegates.length) {\n return [];\n }\n const promises: Promise[] = [];\n for (const del of delegates) {\n promises.push(this.show(del.email));\n }\n const list = await Promise.all(promises);\n this.set('delegates', list);\n this.set('list', unique((this.get('list') || []).concat(list)));\n return list;\n }\n\n /**\n * Convert raw API data into a valid User Object\n * @param raw_item Raw API data\n */\n protected process(raw_data: any): User {\n return new User(raw_data);\n }\n}","import { AbstractControl } from '@angular/forms';\n\nimport { User } from './users';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n\nconst HAS_ERROR = true;\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n */\nexport function buildValidateDate(date?: number) {\n const from = new DateTZ({ date });\n return (c) => validateDate(c, date);\n}\n\n/**\n * Check that control value is a date that is the same or after from date\n * @param control Angular form control\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateDate(control: AbstractControl, is_from?: number) {\n const from = new DateTZ({date: is_from})\n const date = new DateTZ({date: control.value})\n return date.isBeforeDate(from) ? { date: HAS_ERROR, message: 'Booking needs to be made in the future' } : null;\n}\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function buildValidateStartTime(date: number, is_from?: number) {\n const from = new DateTZ({date: is_from})\n return (c) => validateStartTime(c, date, from.ms);\n}\n\n/**\n * Check that control value time is after the comparison date time\n * @param control Angular form control\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateStartTime(control: AbstractControl, date: number, is_from?: number) {\n const now = new DateTZ({date: is_from});\n const parts = control.value.split(':');\n const date_obj = new DateTZ({date});\n return date_obj.setValue({ hour: +parts[0], minute: +parts[1] }).isBeforeDate(now) ? {\n start: HAS_ERROR,\n message: 'Booking time needs to be made in the future'\n } : null;\n}\n\nexport function buildValidateDuration(min: number = 30, max: number = 240) {\n return (c) => validateDuration(c, min, max);\n}\n\nexport function validateDuration(control: AbstractControl, min: number = 30, max: number = 240) {\n if (control.value < (min || 30)) {\n return { duration: HAS_ERROR, message: `Minimum booking duration is ${min} minute${min === 1 ? 's' : ''}` };\n } else if (control.value > (max || 480)) {\n return { length: HAS_ERROR, message: `Maximum booking duration is ${max} minute${max === 1 ? 's' : ''}` };\n }\n return null;\n}\n\nexport function buildValidateAttendees(host: User, min: number = 0) {\n return (c) => validateAttendees(c, host, min);\n}\n\nexport function validateAttendees(control: AbstractControl, host: User, min: number = 0) {\n if (!control || !(control.value instanceof Array)) {\n return min > 0\n ? { invalid: true, message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you` }\n : null;\n }\n const list: User[] = control.value;\n if (host) {\n const result = list.find(a => a.email === host.email);\n if (result) {\n list.splice(list.indexOf(result), 1);\n }\n }\n return list.length >= min ? null : {\n count: true,\n message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you`\n };\n}\n\nexport function validateEndTime(dateControlTz: AbstractControl) {\n return (control: AbstractControl) => {\n // const date = new DateTZ({date: date_control ? date_control.value : undefined})\n const now = DateNow(new Date())\n return dateControlTz.value.addValue({ minutes: control.value || 60 }).isBeforeDate(now)? { end_time: true } : null;\n };\n}\n\nexport function noWhitespaceValidator(control: AbstractControl) {\n const value = control?.value;\n if ( value === '') {\n return null; // Return null if control value is undefined or null\n }\n const isWhitespace = value.trim().length === 0;\n // const isValid = !isWhitespace;\n return !isWhitespace ? null : { whitespace: true };\n}\n\n","export * from './lib/date-tz.class'","import { DateObjectUnits, DateTime, DateTimeUnit, DurationLike, DurationUnits } from 'luxon';\nimport { getTimezoneOffset } from 'date-fns-tz';\n\nfunction padZero(value: number, length: number): string {\n let str = `${value}`;\n while (str.length < length) str = `0${str}`;\n return str;\n}\n\ninterface DateTZParams {\n date?: number | DateTime\n building_tz?: string\n is_local_tz?: boolean\n all_day?: boolean\n}\n\nconst now = new Date()\n\nexport class DateTZ {\n date: DateTime\n date_org: DateTime\n building_tz: string\n is_local_tz: boolean = true\n all_day: boolean\n local_tz: string\n valid: boolean\n\n constructor(data?: DateTZParams) { \n this.date_org = typeof data?.date === 'number' ? DateTime.fromMillis(data?.date) : data?.date ? data?.date : DateTime.fromMillis(now.valueOf())\n this.is_local_tz = data?.is_local_tz === false ? data?.is_local_tz : true\n this.all_day = data?.all_day || false\n this.local_tz = DateTime.now().zoneName\n this.building_tz = data?.building_tz || this.local_tz\n this.date = !this.is_local_tz ? this.date_org.setZone(this.building_tz) : this.date_org\n this.valid = this.date.isValid\n }\n\n //get epoch milliseconds\n public get ms(): number {\n return this.date.valueOf()\n }\n\n //get epoch seconds\n public get seconds(): number {\n return Math.trunc(this.date.toSeconds())\n }\n\n //get the second of the minute\n public get second(): number {\n return this.date.second\n }\n\n //get the minutes of the hour\n public get minutes(): number {\n return this.date.minute\n }\n\n //get the minutes of the hour\n public get hours(): number {\n return this.date.hour\n }\n\n public get utc(): number {\n const newDate = new DateTZ({...this, date: this.date.toUTC()})\n return newDate.seconds\n }\n\n public get dateDay(): number {\n return this.date.day\n }\n\n public get dateHour(): number {\n return this.date.hour\n }\n\n public get dateYear(): number {\n return this.date.year\n }\n\n public get dateWeekday(): number {\n try {\n return this.date.weekday;\n } catch (e) {\n return this.date.toJSDate().getDay();\n }\n }\n\n public get dateMonth(): number {\n return this.date.month\n }\n\n public dateDiff (compare_to: DateTZ, unit: DurationUnits, ans_unit = 'minutes'): number {\n return this.date.diff(compare_to.date, unit)[ans_unit]\n }\n\n //set the date to the begining of the given unit\n public startOfValue (unit: DateTimeUnit) {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 7) {\n // Don't change, we want sunday as the start of the week even though luxon thinks it is Monday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 1) {\n // If this.date is monday, just subtract one more day to make it Sunday\n const monday = new DateTZ({ ...this, date: this.date })\n newDate = monday.subtractValue({ days: 1 });\n } else {\n // If later than monday, startOfWeek back to monday and then subtact another day to get to Sunday.\n const monday = new DateTZ({...this, date: this.date.startOf(unit)})\n newDate = monday.subtractValue({ days: 1 })\n }\n }\n\n return newDate\n }\n\n //set the date to the end of the given unit\n public endOfValue (unit: DateTimeUnit) : DateTZ {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 6) {\n // Don't change, we want saturday as the end of the week even though luxon thinks it is Sunday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 7) {\n // If this.date is Sunday, this alone is the luxon end of week so add a day\n // to get to monday, then endOfWeek to Sunday, and subtract 1 day to Saturday\n const sunday = new DateTZ({ ...this, date: this.date }).addValue({ days: 1 })\n newDate = sunday.endOfValue(unit).subtractValue({ days: 1 }); // return next saturday\n } else {\n // If not saturday or sunday\n // endOfWeek to Sunday and then subtact a day to get to Saturday.\n const later = new DateTZ({...this, date: this.date.endOf(unit)})\n newDate = later.subtractValue({ days: 1 })\n }\n } else {\n newDate = new DateTZ({...this, date: this.date.endOf(unit)})\n }\n\n return newDate\n }\n \n public startEpoch (): number {\n const org = new DateTZ({date: this.date_org})\n return this.all_day\n ? this.startOfValue('day').ms - this.dateDiff(org, 'minutes')\n : this.ms\n }\n\n //clone the given value and unit to the date\n public clone (): DateTZ {\n // return new DateTZ({...this})\n return this.addValue({ seconds: 0 })\n }\n\n //adds the given value and unit to the date\n public addValue (duration: DurationLike, isLastDayOfMonth?: boolean): DateTZ {\n return new DateTZ({...this, date: isLastDayOfMonth ? this.date.plus(duration).endOf('month') : this.date.plus(duration)});\n }\n\n //subtracts the given value and unit to the date\n public subtractValue (duration: DurationLike): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.minus(duration)})\n return newDate\n }\n\n public setValue (obj: DateObjectUnits): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.set(obj)})\n return newDate\n }\n\n public formatDate (format: string): string {\n // Return new immuatable via \"plus\" to prevent \n // TypeError: Cannot assign to read only property 'weekData' of object\n // https://github.com/moment/luxon/issues/601\n return this.date.plus({ seconds: 0 }).toFormat(format)\n }\n\n public formatLocalDate (format: string): string {\n // setZone already returns new immutable so it doesn't have the formatDate issue.\n return this.date.plus({ seconds: 0 }).setZone(this.local_tz).toFormat(format)\n }\n\n public isSameDate(compare_to: DateTZ, value: DateTimeUnit): boolean {\n return this.date.hasSame(compare_to.date, value)\n }\n\n public isAfterDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear > compare_to.dateYear\n case 'month':\n if(this.isAfterDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth > compare_to.dateMonth\n }\n case 'day':\n if(this.isAfterDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay > compare_to.dateDay\n }\n case 'hour':\n if(this.isAfterDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour > compare_to.dateHour\n }\n case 'minute':\n if(this.isAfterDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes > compare_to.minutes\n }\n default:\n return this.ms > compare_to.ms;\n }\n }\n\n public isBeforeDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear < compare_to.dateYear\n case 'month':\n if(this.isBeforeDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth < compare_to.dateMonth\n }\n case 'day':\n if(this.isBeforeDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay < compare_to.dateDay\n }\n case 'hour':\n if(this.isBeforeDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour < compare_to.dateHour\n }\n case 'minute':\n if(this.isBeforeDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes < compare_to.minutes\n }\n default:\n return this.ms < compare_to.ms;\n }\n }\n\n public toZone(tz: string): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: this.date.setZone(tz), \n building_tz: tz, \n is_local_tz: false\n })\n return newDate\n }\n\n public setTimestamp(timestamp: number): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: timestamp,\n })\n return newDate\n }\n\n public get JSDate(): Date {\n return this.date.toJSDate()\n }\n\n // helper to log out the dateTZ values\n public logDateTz (label: string = ''): void {\n console.log(`${label} local tz/date/time`, this.addValue({ seconds: 0 }).formatLocalDate(\"cccc d MMMM,yyyy h:mma\"), this.local_tz)\n console.log(`${label} building tz/date/time`, this.addValue({ seconds: 0 }).formatDate(\"cccc d MMMM,yyyy h:mma\"), this.building_tz)\n }\n}\n\nexport const DateNow = (date: Date = new Date()) => {\n return new DateTZ({date: date.valueOf()})\n} \n\n// input the local time and the building timezone\nexport const convertLocalTimestampToTimezonedDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const date = new Date(timestamp);\n return new DateTZ({ date: timestamp, building_tz: buildingTimezone, is_local_tz: false }).setValue({\n day: date.getDate(),\n hour: date.getHours(),\n minute: date.getMinutes()\n });\n}\n\n// input the building time and the building timezone\nexport const convertTimezonedTimestampToLocalDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const local_tz = DateTime.now().zoneName;\n const localOffset = getTimezoneOffset(local_tz, new Date(timestamp));\n const desiredOffset = getTimezoneOffset(buildingTimezone, new Date(timestamp));\n if (localOffset > desiredOffset) {\n const eleA = timestamp + (localOffset - desiredOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n } else {\n const eleA = timestamp + (desiredOffset - localOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n }\n}\n\nexport const localTimezone = () => {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n}\n\nexport const getTimezoneOffsetString = (tz: string) => {\n const offset_minutes = Math.floor(getTimezoneOffset(tz) / 1000 / 60);\n const hours = Math.floor(offset_minutes/60);\n const minutes = offset_minutes % 60;\n return `${offset_minutes > 0 ? '+' : '-'}${padZero(Math.abs(hours), 2)}${padZero(minutes, 2)}`;\n}\n\nexport function toMiddayUTC(value: DateTZ = DateNow()) {\n // exclude Auckland from rouding up timezone as it has 12+ hours UTC timezone difference\n return value.building_tz.includes('Auckland') ? value : new DateTZ({\n date: value.setValue({ hour: 12, minute: 0 }).ms,\n is_local_tz: false,\n building_tz: 'UTC',\n }).setValue({ hour: 12, minute: 0 });\n}\n\n/**returns the offset between two timezones in minutes and hours */\nexport function timezoneOffset(tz: string){\n const nowTz = DateNow(new Date())\n const offset = nowTz.date.offset - nowTz.toZone(tz).date.offset\n return {minutes: offset, hours: offset/60}\n}\n\nexport function isToday (date, timezone) {\n\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: timezone\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: timezone,\n }),\n 'day'\n );\n}\n","export * from './lib/environment.module';\nexport * from './lib/version';\nexport * from './lib/environment.service'\nexport * from './lib/types'\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n providers: []\n})\nexport class EnvironmentModule {\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { EnvironmentData } from './types';\n\nexport const ENVIRONMENT_TOKEN = 'environments_service_data';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class EnvironmentService {\n\n public get production(): boolean {\n return this.environment.production;\n }\n\n public get heap_io_id(): number {\n return this.environment.heap_io_id;\n }\n\n constructor(@Inject(ENVIRONMENT_TOKEN) private environment: EnvironmentData) {\n }\n}\n","// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\n/* tslint:disable */\nexport const VERSION = {\n \"dirty\": false,\n \"raw\": \"a592d101a\",\n \"hash\": \"a592d101a\",\n \"distance\": null,\n \"tag\": null,\n \"semver\": null,\n \"suffix\": \"a592d101a\",\n \"semverString\": null,\n \"version\": \"0.0.0\",\n \"time\": 1734294095956\n};\n/* tslint:enable */\n","export * from './lib/legacy-overlays.module';\nexport * from './lib/space-select-modal/space-select-modal.component';\nexport * from './lib/new-user-modal/new-user-modal.component';\nexport * from './lib/confirm-modal/confirm-modal.component';\nexport * from './lib/catering-confirm-modal/catering-confirm-modal.component';\nexport * from './lib/catering-details-modal/catering-details-modal.component';\nexport * from './lib/requirement-details-modal/requirement-details-modal.component';\nexport * from './lib/booking-confirm/booking-confirm.component';\nexport * from './lib/user-form/user-form.component'\nexport * from './lib/booking-form/booking-form.component'\nexport * from './lib/no-catering-modal/no-catering-modal.component'\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n Renderer2,\n ViewChild\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport { Router } from '@angular/router';\n\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n CateringOrder,\n getFirstDateFromList,\n OrganisationService,\n rulesForSpace,\n recurrenceDetails,\n SeriesAction,\n SettingsService,\n Space,\n SpacesService,\n User,\n UsersService,\n formatWhen,\n BOOKING_STATUS,\n CloseDialogService,\n DialogIds\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent,\n HashMap,\n humaniseDuration\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport interface BookingConfirmModalData {\n old_booking: Booking;\n booking: Booking;\n action?: SeriesAction\n}\n\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\n\n@Component({\n selector: 'a-booking-confirm-modal',\n templateUrl: './booking-confirm.component.html',\n styleUrls: ['./booking-confirm.component.scss']\n})\nexport class BookingConfirmComponent extends BaseDirective implements OnInit{\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** Display string for changes are being processed */\n public loading: string;\n /** Whether space availability is being checked */\n public checking_available: boolean;\n /** Whether to show all attendees */\n public show_attendees: boolean = false;\n /** Whether to show all locations */\n public show_locations: boolean;\n /** Whether to show all catering orders */\n public show_orders: boolean;\n /** Whether booking has succeeded */\n public success: boolean;\n /** Whether booking needs to be accepted */\n public readonly is_request: boolean;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n lastMomentConflict: boolean = false;\n \n @ViewChild('attendeesListRef') attendeesListRef: ElementRef;\n @ViewChild('locationsListRef') locationsListRef: ElementRef;\n @ViewChild('cateringListRef') cateringListRef: ElementRef;\n\n /** Booking to confirm changes to */\n public get old_booking(): Booking {\n return this._data.old_booking;\n }\n\n /** Booking to confirm changes to */\n public get booking(): Booking {\n return this._data.booking;\n }\n\n /** Active user */\n public get user(): User {\n return this._users.current;\n }\n\n /** Title of the displayed event */\n public get title(): string {\n return this.booking.title;\n }\n\n /** Comapny names */\n public get company(): string[] {\n return this.booking.company;\n }\n \n\n /** Display string of when the event will occur */\n public get when(): string {\n const duration_value = this.booking.duration;\n const all_day = this.booking.all_day && duration_value < 25 * 60;\n if(this.booking.is_recurrent && this.booking.recurrence_starts && this.booking.recurrence_starts.length){\n return formatWhen({all_day, ...this.recurrenceDates })\n }\n return formatWhen({\n all_day,\n startTZ: this.booking.startDateTz,\n endTZ: this.booking.endDateTz,\n displayEndTZ: this.booking.displayEndDateTz})\n }\n\n public get recurrenceDates(){\n const startTZ = getFirstDateFromList(this.booking.recurrence_starts)\n const endTZ = startTZ.addValue({minutes: this.booking.duration})\n return {startTZ, endTZ, displayEndTZ: endTZ}\n }\n\n /** Display string for the recurrence value of the booking */\n public get recurrence(): string {\n return recurrenceDetails({\n period: this.booking.recurrence_period,\n end: this.booking.recurrence_endTz,\n list: this.booking.recurrence_starts,\n interval: this.booking.recurrence_interval\n });\n }\n\n /** Display string for the event's duration */\n public get duration(): string {\n const duration_value = this.booking.duration;\n return this.booking.all_day ? 'All Day' : humaniseDuration(duration_value);\n }\n\n /** List of spaces associated with the event */\n public get spaces(): Space[] {\n return this.booking.multi_rooms;\n }\n\n /** List of attendees associated with the event not including the host */\n public get attendees(): User[] {\n const attendees = this.booking.attendees;\n return attendees.filter((i) => i.email !== this.organiser.email);\n }\n\n /** Host of the event */\n public get organiser(): User {\n return this.booking.organiser || this._users.current;\n }\n\n /** Host of the event */\n public get equipment_codes(): HashMap {\n return this.booking.equipment_codes || {};\n }\n\n /** Host of the event */\n public get catering_codes(): HashMap {\n const catering = this.catering;\n const codes = {};\n for (const order of this.catering) {\n codes[order.location_id] = order.charge_code;\n }\n return codes;\n }\n\n /** Host of the event */\n public get equipment_notes(): HashMap {\n return this.booking.notes\n .filter((note) => note.type === 'equipment')\n .reduce((map, notes) => {\n map[notes.space] = notes.message;\n return map;\n }, {});\n }\n\n /** Details about the event */\n public get notes(): string {\n return this.booking.body;\n }\n\n /** List of catering orders in the booking */\n public get catering(): CateringOrder[] {\n return (this.booking.catering || []).map((order) => {\n const space: any = this.spaces.find(\n (a_space) => a_space.email === order.location_id\n ) || {\n level: {}\n };\n const building: any =\n this._org.buildings.find((bld) => bld.id === space.level.building_id) || {};\n return new CateringOrder({\n ...order,\n location: space.local_name,\n symbol: building.currency,\n booking_date: this.booking.startDateTz.ms,\n booking_timezone: this.booking.timezone,\n });\n });\n }\n\n /** Map of changes to the booking */\n public get changes(): HashMap {\n return {};\n }\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _org: OrganisationService,\n private _bookings: BookingsService,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private _router: Router,\n private _dialog: MatDialog,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: BookingConfirmModalData,\n public settings: SettingsService,\n private closeDialogService: CloseDialogService, \n private renderer: Renderer2,\n ) {\n super();\n this.booking.time_changed =\n this.old_booking &&\n (this.old_booking.startDateTz.ms !== this.booking.startDateTz.ms ||\n this.old_booking.duration !== this.booking.duration);\n // in concierge, all bookings are acceptable without explicit approval.\n\n const rules = rulesForSpace({ user: this.user, space: this.booking.room, duration: 60 });\n this.is_request = this.settings.concierge ? false : rules.auto_approve;\n }\n\n ngOnInit(): void {\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined; \n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && (booker_concierge !== null && booker_concierge !==undefined ) && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && (booker_concierge['email'] && organiser.email !==booker_concierge['email']) ) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = 'Checking availability of selected spaces';\n this._dialog_ref.disableClose = true;\n this.checkSpaceAvailability().then(\n () => {\n this.loading = 'Processing booking request...';\n // Change the unchanged settings to the selected room\n const newEmail = this.booking.space.email;\n const replaceObjects = ['setup', 'breakdown', 'approval_status']\n replaceObjects.forEach(key => {\n const obj = this.booking[key];\n if (obj && obj.constructor === Object) {\n const keys = Object.keys(obj);\n if (keys.length > 0) {\n const replacement = {};\n keys.forEach(nk => {\n replacement[newEmail] = obj[nk];\n })\n this.booking[key] = replacement;\n }\n }\n });\n\n const buffer = {};\n this.booking.multi_rooms.map(room => room.email).forEach(elem => buffer[elem] = 900);\n\n // // if no setup or breakdown time already added and notes or catering exist? add 15 min buffer setup and breakdown to booking\n // if(this.booking.setup === null || this.booking.breakdown === null){\n // const has_note_buffer = (this.booking.notes && this.booking.notes?.length) || (this.booking.catering && this.booking.catering?.length) ? \n // buffer : null; // 900 seconds = 15 min\n // if (has_note_buffer) {\n // this.booking.setup = has_note_buffer;\n // this.booking.breakdown = has_note_buffer; \n // this.booking.room_setup = has_note_buffer; \n // this.booking.room_breakdown = has_note_buffer; \n // }\n // }\n\n // if no setup time already added and notes or catering exist? add 15 min buffer setup time to booking\n if (this.booking.setup === null || this.booking.setup === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.setup = has_note_buffer;\n this.booking.room_setup = has_note_buffer;\n }\n }\n\n // if no breakdown time already added and notes or catering exist? add 15 min buffer breakdown time to booking\n if (this.booking.breakdown === null || this.booking.breakdown === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.breakdown = has_note_buffer;\n this.booking.room_breakdown = has_note_buffer;\n }\n }\n\n\n this._bookings.save(this.booking, this._data.action === SeriesAction.EDIT).then(\n async (bkn) => {\n this.loading = null;\n this.success = true;\n this._dialog_ref.disableClose = false;\n const updated = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this._booking_state_service.replace(updated);\n \n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(updated.recurrence_master_id !== null)\n { \n const master_booking = await this._bookings.show(updated.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n if (bkn.is_recurrent && bkn.recurrence_type === 'master') {\n this._booking_state_service.pollOnce();\n this.closeDialogService.closeDialog(DialogIds.MeetingDetails);\n }\n\n localStorage.removeItem('ACA_STAFF.booking_form_data');\n this.event.emit({ reason: 'done' });\n this._service.notifySuccess(\n `Successfully ${this.booking.id ? 'updated' : 'created'} booking`\n );\n },\n (err) => {\n\n this._dialog_ref.disableClose = false;\n let erroMessage: string = '';\n switch(err.status){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 400:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 409:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.lastMomentConflict = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n },\n (err) => {\n\n this.lastMomentConflict = true;\n this._dialog_ref.disableClose = false;\n const erroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n }\n\n /**\n * Staff only\n */\n public newBooking() {\n this._router.navigate(['/book', 'spaces']);\n this._dialog_ref.close();\n }\n\n /**\n * Staff only\n */\n public toSchedule() {\n this._router.navigate(['/schedule'], {\n queryParams: { email: this.booking.organiser.email }\n });\n this._dialog_ref.close();\n }\n\n /**\n * Check whether the selected spaces are available for the selected time period\n */\n public checkSpaceAvailability(): Promise {\n const spaces: Space[] = this.spaces;\n if (\n (this.booking.id &&\n (this.booking.startDateTz.ms === this.old_booking.startDateTz.ms &&\n this.booking.duration === this.old_booking.duration)) ||\n (spaces && spaces.length <= 0)\n ) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n // Use of this.booking.timezone is unreliable, use booking space instead.\n const all_day = this.booking.all_day;\n // R--- should be nothing to do with date as a timestamp getter\n this._spaces\n .available({\n room_ids: spaces.map((space) => space.id).join(','),\n dateTz: this.booking.startDateTz,\n duration: all_day ? 24 * 60 : this.booking.duration,\n ignore: this.booking.icaluid,\n recurrence_count: this.booking.recurrence_count,\n recurrence_period: this.booking.recurrence_period,\n recurrence_endTz: this.booking.recurrence_endTz,\n recurrence_interval: this.booking.recurrence_interval,\n recurrence_starts: this.booking.recurrence_starts,\n is_recurrent: this.booking.is_recurrent,\n recurrence_days: this.booking.recurrence_days\n })\n .then(\n (space_list) => {\n for (const space of space_list) {\n if (!space.bookable) {\n this.lastMomentConflict = true;\n return reject(\n `${space.name} is not available at the select time period.`\n );\n }\n }\n if (space_list.length < spaces.length) {\n this.lastMomentConflict = true;\n return reject(\n `${spaces[0].name} is not available at the select time period.`\n );\n }\n resolve();\n },\n (err) => reject(err)\n );\n });\n }\n\n public openConflictsModal(){\n const ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: this.booking.local_room_name,\n conflicts: this.booking.recurrence_exceptions,\n copy_conflicts: true,\n timezone: this.booking.timezone\n }\n });\n\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n if(event.reason === 'close'){\n ref.close();\n }else if(event.reason === 'action'){\n navigator.clipboard.writeText(this.conflictsText)\n }\n \n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public get conflictsText(){\n let text = ''\n this.booking.recurrence_exceptions.map((date)=>{\n const dateTZ = new DateTZ({date: date*1000});\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n text = `${text}\\n${display}${dateTZ.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n })\n return text\n }\n\n public toggleList(listType: 'attendees' | 'locations' | 'catering') {\n if (listType === 'attendees') {\n this.show_attendees ? this.collapseList(this.attendeesListRef) : this.expandList(this.attendeesListRef);\n this.show_attendees = !this.show_attendees;\n } else if (listType === 'locations') {\n this.show_locations ? this.collapseList(this.locationsListRef) : this.expandList(this.locationsListRef);\n this.show_locations = !this.show_locations;\n } else if (listType === 'catering') {\n this.show_orders ? this.collapseList(this.cateringListRef) : this.expandList(this.cateringListRef);\n this.show_orders = !this.show_orders;\n }\n }\n\n public expandList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n const listItems = listElement.getElementsByClassName('list-item');\n let totalHeight = 0;\n\n for (let i = 0; i < listItems.length; i++) {\n totalHeight += listItems[i].offsetHeight;\n }\n\n this.renderer.setStyle(listElement, 'max-height', `${totalHeight}px`);\n this.renderer.addClass(listElement, 'shown');\n }\n\n public collapseList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n this.renderer.setStyle(listElement, 'max-height', '4.5em');\n this.renderer.removeClass(listElement, 'shown');\n }\n}\n","\n \n\n\n
\n \n \n \n \n
\n
\n\n
\n
\n
\n \n
\n
\n {{ loading }}\n
\n
\n
\n
\n\n \n \n \n
My Day\n \n\n","import {\n Component,\n Input,\n OnInit, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter \n} from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { MatDialog } from '@angular/material/dialog';\nimport { distinctUntilChanged, first, skip } from 'rxjs/operators';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n arrayWithValues,\n BookingAction,\n CateringOrder,\n SeriesAction,\n SettingsService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\n\nimport { NewUserModalComponent } from '../new-user-modal/new-user-modal.component';\nimport {\n SpaceSelectModalComponent,\n SpaceSelectModalData\n} from '../space-select-modal/space-select-modal.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { MatChipsModule} from '@angular/material/chips';\n\n\n@Component({\n selector: 'a-booking-form',\n templateUrl: './booking-form.component.html',\n styleUrls: ['./booking-form.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingFormComponent extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n /** List of available users to host bookings */\n public user_list: User[] = [];\n public nowTz: DateTZ = DateNow(new Date());\n /** From date input for date field */\n public fromDateTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n /** Last bookable date, concierge only */\n public readonly untilDateTz = DateNow(new Date()).addValue({ days: 365 }).endOfValue('day');\n public isConcierge: boolean;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\";\n // Define an array to store selected company options\n public chipOptions: any[] = [];\n public showTimeCateringWarning: boolean = false;\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _dialog: MatDialog,\n private settingsService: SettingsService,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n this.isConcierge = this.settingsService.concierge;\n }\n\n public ngOnInit(): void {\n // Trim title \n // this.form.get('title').setValue(this.form.get('title').value.trim());\n\n this.chipOptions = [...this.form.controls.company.value];\n\n this.localTimezone = DateNow(new Date()).building_tz;\n const building_tz = (\n this.form.controls.action &&\n (\n this.form.controls.action.value === 'booking_clone' ||\n this.form.controls.action.value === 'clone' ||\n this.form.controls.action.value === 'edit' ||\n this.form.controls.action.value === 'booking_edit'\n ) &&\n this.form.controls.dateTz &&\n this.form.controls.dateTz.value\n ) ? this.form.controls.dateTz.value.building_tz : this.localTimezone;\n\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz });\n this.fromDateTz = closestToTimeSlotTz(this.nowTz, 15);\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map(\n (del) => this._users.find(del.email) || new User({ email: del.email, name: del.email.split('@')[0] })\n );\n this.user_list = [user].concat(delegates);\n });\n\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n this.subscription('formChanges', this.form.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe(() => {\n this.timeout('update_coachmark', () => {\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n }, 500);\n })\n );\n\n this.subscription('isRecurrentChanges', this.form.controls.is_recurrent.valueChanges\n .subscribe(() => {\n const recurrenceStarts = this.form.controls.recurrence_starts\n if(!this.form.controls.is_recurrent.value){\n recurrenceStarts.clearValidators() \n }else{\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n recurrenceStarts.setValidators(arrayValidators);\n }\n recurrenceStarts.updateValueAndValidity()\n })\n ); \n\n /**Disable Inputs */\n this.disableInputs();\n\n /**turn is_recurrent to false if editing or cloning a stand-alone/occurrence */\n if(this.form.controls.id?.value && !this.form.controls.action?.value){\n this.form.controls.is_recurrent.setValue(false)\n }\n\n // Subscribe to changes in dateTz, duration, and has_catering\n this.subscription('dateTz_changes', this.form.controls.dateTz.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n this.subscription('duration_changes', this.form.controls.duration.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // No need to subscribe to catering_changes since we're now handling has_catering\n this.subscription('has_catering_changes', this.form.controls.has_catering.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // Initial check\n this.checkTimeCateringWarning();\n}\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.form.get(key).setValue(this.form.get(key).value.trim());\n }\n\n /** Whether notes and description should use the HTML editor */\n public get use_html(): boolean {\n return this._service.setting('app.booking.html_body') || false;\n }\n\n /** List of available types for bookings */\n public get booking_types(): Identity[] {\n return this._service.setting('app.booking.booking_types') || [];\n }\n\n /** Display string for the list of active spaces */\n public get spaces(): string {\n const spaces = this.form.controls.space_list.value;\n return spaces.length === 1\n ? spaces[0].local_name\n : spaces.length > 1\n ? `${spaces.length} spaces selected`\n : 'No Spaces selected';\n }\n\n public disableInputs() {\n const { id, action, needs_space, is_recurrent } = this.form.value;\n const has_id = !!id;\n const is_edit = action === BookingAction.EDIT;\n if (has_id) {\n this.form.get('is_recurrent')?.disable();\n }\n\n if(is_edit){\n this.form.get('is_multiroom')?.disable();\n }\n\n if (!this.isConcierge && !needs_space) {\n this.form.get('has_catering')?.disable();\n }\n if(has_id && is_edit && is_recurrent){\n this.form.get('dateTz')?.disable()\n this.form.patchValue({ action: null });\n }\n }\n\n /**\n * Open modal to change the space details for the booking\n */\n public openSpacesModal(): void {\n const ref = this._dialog.open(\n SpaceSelectModalComponent,\n {\n width: 'auto',\n height: 'auto',\n maxWidth: '95vw',\n data: {\n spaces: this.form.controls.space_list.value,\n dateTz: this.form.controls.dateTz.value,\n duration: this.form.controls.duration.value,\n host: this.form.controls.organiser.value,\n multiple: true,\n needsCatering: !!this.form.controls.catering?.value?.length,\n }\n }\n );\n this.subscription(\n 'new_spaces',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n let space_list = this.form.controls.space_list.value;\n space_list = event.metadata;\n this.form.controls.space_list.setValue(unique(space_list, 'id'));\n if (event.noCatering) {\n // Set has_catering to false and clear the catering list\n this.form.controls.has_catering.setValue(false);\n this.form.controls.catering?.setValue([]);\n } else {\n const catering = this.form.controls?.catering?.value.map((order: CateringOrder) => {\n order.location = space_list[0].name;\n order.location_id = space_list[0].email;\n return order;\n });\n this.form.controls.catering?.setValue(catering || []);\n }\n ref.close();\n this.unsub('new_spaces');\n }\n if (event.reason === 'close') {\n ref.close();\n this.unsub('new_spaces');\n }\n })\n );\n }\n\n /**\n * Open modal to change the recurrence details for the booking\n */\n public openNewUserModal() {\n const ref = this._dialog.open(NewUserModalComponent, {\n width: 'auto',\n height: 'auto'\n });\n this.subscription(\n 'new_user',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const attendees = this.form.controls.attendees?.value;\n attendees.push(event.metadata);\n this.form.controls.attendees.setValue(unique(attendees, 'email'));\n ref.close();\n this.unsub('new_user');\n this.cdRef.detectChanges();\n }\n })\n );\n }\n\n // Add & Remove chip and set the value of the form control accordingly\n addCompany(event, company): void {\n if (company) {\n this.chipOptions.push(company);\n this.form.controls.company.setValue(this.chipOptions);\n }\n event.preventDefault();\n }\n\n removeOption(option: any): void {\n const index = this.chipOptions.indexOf(option);\n if (index >= 0) {\n this.chipOptions.splice(index, 1);\n }\n this.form.controls.company.setValue(this.chipOptions);\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (!timezone) timezone = this.localTimezone;\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n const dateTz = this.form.controls.dateTz.value;\n if (dateTz && localTzOffset !== buildingTzOffset) {\n const startDate = dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.form.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n this.cdRef.detectChanges();\n }\n\n public get isSeriesAction(){\n return this.form.value.action === SeriesAction.CLONE || this.form.value.action === SeriesAction.EDIT\n }\n\n onToggleChange(toggledControlName: string, is_multiroom: boolean): void {\n if (toggledControlName === 'is_recurrent') {\n // If the is_recurrent toggle is being activated, deactivate is_multiroom\n if (this.form.controls.is_recurrent?.value) {\n this.form.controls.is_multiroom?.setValue(false);\n this.form.controls.merged?.setValue(false);\n this.form.get('merged')?.disable();\n\n }\n } else if (toggledControlName === 'is_multiroom') {\n // If the is_multiroom toggle is being activated, deactivate is_recurrent\n if (this.form.controls.is_multiroom?.value) {\n this.form.controls.is_recurrent?.setValue(false);\n }\n if(is_multiroom) { \n this.form.get('merged').setValue(false);\n this.form.get('merged')?.enable() \n } else {\n this.form.get('merged').setValue(false); \n this.form.get('merged')?.disable(); }\n }\n }\n \n private checkTimeCateringWarning() {\n const dateTz = this.form.controls.dateTz.value;\n const duration = this.form.controls.duration.value;\n const hasCatering = this.form.controls.has_catering?.value;\n const cateringOrders = this.form.controls.catering?.value;\n \n if (dateTz && duration && hasCatering && cateringOrders && cateringOrders.length > 0) {\n // Create DateTime object for the start time\n const startDateTime = DateTime.fromISO(dateTz.date, { zone: dateTz.building_tz });\n \n // Calculate the end time\n const endDateTime = startDateTime.plus({ minutes: duration });\n \n // Get the date part of the startDateTime\n const bookingDate = startDateTime.startOf('day');\n\n // Define 7 am and 8 pm on the booking date\n const dayStartAt7am = bookingDate.set({ hour: 7 });\n const dayEndAt8pm = bookingDate.set({ hour: 20 });\n\n // Check if booking ends before or at 7 am, or starts at or after 8 pm\n if (endDateTime <= dayStartAt7am || startDateTime >= dayEndAt8pm) {\n // Booking is outside of catering hours and has catering selected\n this.showTimeCateringWarning = true;\n } else {\n this.showTimeCateringWarning = false;\n }\n } else {\n this.showTimeCateringWarning = false;\n }\n\n // Inform Angular that the component needs to be checked\n this.cdRef.markForCheck();\n }\n\n}\n","
\n \n \n \n
\n
\n \n Title*:\n \n \n \n\n \n {{ ( form?.get('title').errors && form?.get('title').hasError('pattern')) \n ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Title is required'}} \n \n \n
\n\n
\n \n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n \n \n
\n \n
\n Duration is invalid. End time must be in the future\n
\n
\n
\n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n Warning: Changing the booking time outside of catering hours will drop your catering order.\n
\n
\n
\n
\n
\n Recurring booking\n
\n \n
\n Multiroom\n
\n
\n \n
\n
Merged
\n
\n \n
\n
\n \n \n
\n \n \n \n \n \n {{ user.name || user.email }}\n \n \n \n
\n
\n \n \n \n {{ form?.get('attendees').errors?.customError }}\n \n
\n
\n \n
\n \n
\n \n
\n \n \n {{ ( form?.get('company').errors && form?.get('company').hasError('pattern'))\n ? 'Some special characters (^=`~@#$%*{};:_\\\",.\\<>) are not allowed' : ''}}\n \n
\n \n
\n \n \n {{ selected }}\n
\n
\n
\n
\n\n
1\">\n \n \n \n \n {{ type.name }}\n \n \n \n
\n
\n Need a meeting space?\n \n
\n
\n \n \n Need catering?\n \n
\n
\n \n \n \n \n \n \n \n
\n\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringItem,\n OrganisationService,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringConfirmModalData {\n all_day: boolean;\n form: FormGroup;\n dateTz: DateTZ;\n}\n\n@Component({\n selector: 'a-catering-confirm-modal',\n templateUrl: './catering-confirm-modal.component.html',\n styleUrls: ['./catering-confirm-modal.component.scss']\n})\nexport class BookingCateringConfirmModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** List of selected items for the order */\n public item_list: CateringItem[] = [];\n\n /** Space selected for delivery */\n public get space(): Space {\n return this._spaces.find(this._data.form?.controls?.location_id?.value);\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n let date = this._data.dateTz;\n if (this._data.form && this._data.form.controls.delivery_time) {\n date = date.addValue({ minutes: this._data.form.controls.delivery_time.value });\n }\n return date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Form field for order items */\n public get item_field(): FormControl {\n return this._data.form.controls.items as any;\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n return this.item_list.reduce((amount, item) => {\n const price = item.price\n return amount + item.amount * price\n }, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.space || !this.space.level) {\n return 'USD';\n }\n const building = this._org.buildings.find(\n (bld) => bld.id === this.space.level.building_id\n ) || { currency: 'USD' };\n return building.currency;\n }\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: CateringConfirmModalData\n ) {\n super();\n if (!this._data.form) {\n this._service.notifyError('No form data for order');\n this._dialog_ref.close();\n }\n }\n\n public ngOnInit(): void {\n /* istanbul ignore else */\n if (this._data.form.controls.items) {\n this.subscription(\n 'item_list',\n this._data.form.controls.items.valueChanges.subscribe((items) => {\n /* istanbul ignore else */\n if (!items || items.length <= 0) {\n this._dialog_ref.close();\n }\n })\n );\n }\n this.item_list = this._data.form.controls.items.value.map((item) => new CateringItem(item.toJSON()));\n }\n}\n","
\n
Confirm Catering Order
\n \n
\n\n
\n
\n Delivering to {{ space?.local_name || space?.simple_name || space?.settings?.room_name }} at {{ delivery_time }}\n
\n
\n \n
\n
\n \n
{{ order_cost / 100 | currency:symbol }}
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n OrganisationService,\n BookingNote,\n CateringOrder,\n Space,\n UsersService,\n CateringNotesService,\n Booking\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n catering: AbstractControl;\n booking: Booking\n}\n\n@Component({\n selector: 'a-catering-details-modal',\n templateUrl: './catering-details-modal.component.html',\n styleUrls: ['./catering-details-modal.component.scss']\n})\nexport class CateringDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: HashMap = {};\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return (this._data.spaces || []).filter((space) =>\n this._data.catering.value.find((order) => order.location_id === space.email)\n );\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.pattern || this.active_form.controls.code.errors?.minlength;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n return this.space_list.reduce(\n (valid, space) => valid && this.form[space.email].valid,\n true\n );\n }\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _cateringNotesService: CateringNotesService,\n @Inject(MAT_DIALOG_DATA) private _data: CateringDetailsModalData\n ) {\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type === 'catering'\n );\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = this._data.catering.value.reduce((map, order: CateringOrder) => {\n map[order.location_id] = order.charge_code;\n return map;\n }, {});\n this.generateFormFields();\n }\n\n public submit(): void {\n this.space_list.forEach((space) => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes\n const notes = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type !== 'catering'\n );\n const new_notes = this.space_list.map(\n (space) =>\n ({\n author: this._data.booking.booked_by ? this._data.booking.booked_by['name'] : this._users.current.name,\n type: 'catering',\n message: this.form[space.email].controls.notes.value,\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote)\n );\n this._cateringNotesService.setNotes(new_notes);\n this._data.notes_field.setValue(notes.concat(new_notes).filter((note) => note.message));\n // Save the notes\n const orders = this._data.catering.value.map(\n (order) =>\n new CateringOrder({\n ...order,\n charge_code: this.form[order.location_id]\n ? this.form[order.location_id].controls.code.value\n : ''\n })\n );\n\n this._data.catering.setValue(orders);\n // This should go to the next\n this.event.emit({ reason: 'done' });\n } else {\n this._scrollToBottom();\n }\n }\n\n /** Generate form fields for each space */\n private generateFormFields(): void {\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space.level.building_id\n );\n \n this.needs_charge_code[space.email] = space?.filters?.charge_code || space?.settings?.charge_code || false;\n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(this.codes[space.email] || '',\n this.needs_charge_code[space.email] ?\n [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4), Validators.required ] : [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4)])\n });\n }\n }\n\n /** Scroll the content container to the bottom */\n private _scrollToBottom(): void {\n this._content_el?.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n}\n","
\n
\n \n \n \n
\n \n
\n\n
\n
\n \n
Please specify any allergies or gluten intolerances
\n
\n
\n
\n \n \n \n \n
\n
\n \n Charge Code\n *\n \n \n \n \n Note: Your booking will be confirmed before you are charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\nexport interface ConfirmModalData {\n /** Title of the modal */\n title: string;\n /** Contents of the modal */\n content: string;\n /** Text displaed on the confirmation button */\n action?: string;\n /** Icon to display on the modal */\n icon: ApplicationIcon;\n}\n\nexport const CONFIRM_METADATA = {\n height: 'auto',\n width: '24em',\n maxHeight: 'calc(100vh - 2em)',\n maxWidth: 'calc(100vw - 2em)'\n};\n\n@Component({\n selector: 'confirm-modal',\n templateUrl: './confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss']\n})\nexport class ConfirmModalComponent extends BaseDirective {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Loading state */\n public loading: string;\n\n /** Title of the confirm modal */\n public get title(): string {\n return (this._data ? this._data.title : null) || 'Confirm';\n }\n\n /** Body of the confirm modal */\n public get content(): string {\n return (this._data ? this._data.content : null) || 'Are you sure?';\n }\n\n /** Display text on the confirm button */\n public get action(): string {\n return (this._data ? this._data.action : null) || 'Ok';\n }\n\n /** Display icon properties */\n public get icon(): ApplicationIcon {\n return (this._data ? this._data.icon : null) || null;\n }\n\n constructor(\n private _dialog: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: ConfirmModalData\n ) {\n super();\n }\n\n /**\n * User confirmation of the content of the modal\n */\n public accept() {\n this.event.emit({ reason: 'done' });\n }\n}\n","
\n

{{ title || 'Confirm' }}

\n
\n\n
\n \n
\n

\n
\n
\n
\n\n
\n \n \n
\n
\n\n
\n
\n
\n \n
\n
{{ loading }}
\n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { LegacyUiModule } from '@mckinsey-converge/legacy-ui';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SpaceSelectModalComponent } from './space-select-modal/space-select-modal.component';\nimport { NewUserModalComponent } from './new-user-modal/new-user-modal.component';\nimport { ConfirmModalComponent } from './confirm-modal/confirm-modal.component';\nimport { NoCateringModalComponent } from './no-catering-modal/no-catering-modal.component';\nimport { BookingCateringConfirmModalComponent } from './catering-confirm-modal/catering-confirm-modal.component';\nimport { CateringDetailsModalComponent } from './catering-details-modal/catering-details-modal.component';\nimport { RequirementDetailsModalComponent } from './requirement-details-modal/requirement-details-modal.component';\nimport { BookingConfirmComponent } from './booking-confirm/booking-confirm.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UserFormComponent } from './user-form/user-form.component';\nimport { BookingFormComponent } from './booking-form/booking-form.component';\nimport { EditorModule } from '@tinymce/tinymce-angular';\n\nconst DECLARATIONS = [\n SpaceSelectModalComponent,\n NewUserModalComponent,\n ConfirmModalComponent,\n NoCateringModalComponent,\n BookingCateringConfirmModalComponent,\n CateringDetailsModalComponent,\n RequirementDetailsModalComponent,\n BookingConfirmComponent,\n UserFormComponent,\n BookingFormComponent,\n];\n\n@NgModule({\n imports: [\n LegacyUiModule,\n FormsModule,\n ReactiveFormsModule,\n CommonModule,\n UiModule,\n BaseModule,\n EditorModule,\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ...DECLARATIONS,\n BaseModule\n ]\n})\nexport class LegacyOverlaysModule {\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\n\nimport { BaseDirective, DialogEvent } from '@mckinsey-converge/base';\nimport { generateUserForm, User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'new-user-modal',\n templateUrl: './new-user-modal.component.html',\n styleUrls: ['./new-user-modal.component.scss'],\n})\nexport class NewUserModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Form fields for the new user */\n public form: FormGroup;\n /** New user data store */\n public user: User;\n /** Whether user details are being saved */\n public loading: boolean;\n\n public ngOnInit(): void {\n this.user = new User();\n this.form = generateUserForm(this.user);\n }\n\n public saveChanges() {\n this.form.markAllAsTouched();\n if (this.form.valid) {\n if (!this.form.controls.email.value) {\n this.form.controls.email.setValue(\n `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`\n );\n }\n const firstName = this.form.value.first_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n const lastName = this.form.value.last_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n \n const new_user = new User({\n ...this.form.value,\n name: `${firstName} ${lastName}`,\n type: 'external',\n external: true,\n visitor: true,\n });\n this.event.emit({ reason: 'done', metadata: new_user });\n }\n }\n}\n","
\n

Add External Attendee

\n \n
\n
\n \n
\n
\n \n \n
\n\n
\n
\n
\n \n
\n
\n Saving attendee...\n
\n
\n
\n
\n\n","import {\n Component,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'no-catering-modal',\n templateUrl: './no-catering-modal.component.html',\n styleUrls: ['./no-catering-modal.component.scss']\n})\nexport class NoCateringModalComponent extends BaseDirective {\n constructor(\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n // /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n\n // Submit the Survey in it's current state.\n public confirm() {\n this.event.emit({ reason: 'done', noCatering: true });\n this._dialog_ref.close();\n }\n\n // Close the modal\n public cancel() {\n this.event.emit({ reason: 'close' });\n this._dialog_ref.close();\n }\n}\n","
\n \n
\n
\n
\n \n

Catering is not available for your new room selection. \n
Are you sure you want to drop order and change rooms?

\n
\n
\n \n \n \n
\n
\n
","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n BookingNote,\n OrganisationService,\n SettingsService,\n Space,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface RequirementDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n codes_field: AbstractControl;\n head_counts_field: AbstractControl;\n standalone?: boolean;\n}\n\n@Component({\n selector: 'a-requirement-details-modal',\n templateUrl: './requirement-details-modal.component.html',\n styleUrls: ['./requirement-details-modal.component.scss']\n})\nexport class RequirementDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: boolean;\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return this._data.spaces;\n }\n\n public get has_recurrence(): boolean {\n return false\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.minlength || this.active_form.controls.code.errors?.pattern;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n // return this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n return this.space_list.length > 0 && this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n }\n\n public isConcierge: boolean;\n public frontend: string;\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n @Inject(MAT_DIALOG_DATA) private _data: RequirementDetailsModalData,\n private _settings: SettingsService,\n ) {\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value\n .filter((note: BookingNote) => note.type === 'equipment');\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = { ...this._data.codes_field.value };\n this.head_counts = { ...this._data.head_counts_field.value };\n this.generateFormFields();\n }\n\n public submit(): void {\n // Get the email of the first space\n const firstSpaceEmail = this.space_list[0].email;\n\n // Copy values from the first space's form controls to all other spaces\n this.space_list.forEach(space => {\n if (space.email !== firstSpaceEmail) {\n this.form[space.email].controls.notes.setValue(this.form[firstSpaceEmail].controls.notes.value);\n this.form[space.email].controls.code.setValue(this.form[firstSpaceEmail].controls.code.value);\n this.form[space.email].controls.head_count.setValue(this.form[firstSpaceEmail].controls.head_count.value);\n }\n });\n\n this.space_list.forEach(space => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes \n const notes = this._data.notes_field.value\n .filter((note: BookingNote) => note.type !== 'equipment');\n const new_notes = this.space_list.map(space => ({\n author: this._users.current.name,\n type: 'equipment',\n message: this.form[space.email].controls.notes.value.trim(),\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote));\n this._data.notes_field.setValue(notes.concat(new_notes).filter(note => note.message));\n this._data.codes_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.code.value;\n return map;\n }, {}));\n this._data.head_counts_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.head_count.value;\n return map;\n }, {}));\n this.event.emit({ reason: 'done' });\n } else {\n this._content_el.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n }\n\n /** Generate form fields for each space */\n // private generateFormFields(): void {\n // for (const space of this.space_list) {\n // const building = this._org.buildings.find(\n // bld => bld.id === space[0]?.level.building_id\n // );\n // // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n // const { filters, settings } = space;\n // const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n // const officeBasedEqCode = building?.required?.equipment_code;\n // this.needs_charge_code[space.email] = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n\n // this.form[space.email] = new FormGroup({\n // notes: new FormControl(this.notes[space.email] || ''),\n // code: new FormControl(\n // this.codes[space.email] || '',\n // this.needs_charge_code[space.email] ?\n // [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] : [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n // ),\n // head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n // });\n // }\n // }\n \n private generateFormFields(): void {\n // Initialize a variable to determine if any space needs a charge code\n let anySpaceNeedsChargeCode = false;\n \n // First pass to determine if any space needs a charge code\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space?.level.building_id\n );\n const { filters, settings } = space;\n const roomBasedEqCode = filters?.equipment_code;\n const officeBasedEqCode = building?.required?.equipment_code;\n \n // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n if (roomBasedEqCode || officeBasedEqCode) {\n anySpaceNeedsChargeCode = true;\n this.needs_charge_code = true;\n break;\n } else{\n this.needs_charge_code = false;\n }\n }\n \n // Second pass to create form groups with the determined charge code requirement.\n // We show only the first space, but if one of the selected spaces needs a mandatory charge code,\n // then all spaces need a mandatory charge code\n for (const space of this.space_list) { \n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(\n this.codes[space.email] || '',\n anySpaceNeedsChargeCode ?\n [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] :\n [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n ),\n head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n });\n }\n }\n}\n","
\n
\n \n \n \n \n {{\n this.space_list.length > 1 ? this.space_list.length + ' spaces selected' :\n this.space_list[0]?.local_name || 'No spaces selected'\n }}\n \n \n \n \n
\n \n
\n\n
\n
\n \n
\n {{\n has_recurrence && !isConcierge\n ? 'To update headcount information, add equipment or catering, please edit individual meeting occurences in My Day'\n : \"Would you like to add equipment to your booking's spaces?\"\n }}\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n Charge Code*\n \n \n \n \n Note: Your booking will be confirmed before you are\n charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n \n Headcount Estimate*\n \n \n \n \n Note: This estimate is used to calculate catering and/or\n assign rooms. Please keep updated of any changes.\n \n \n Headcount Estimate is required\n \n \n
\n \n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n Building,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n OrganisationService,\n SettingsService,\n Space,\n SpaceBookingRuleOptions,\n SpacesService,\n toggleSelectedByGroup,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n DialogEvent,\n HashMap,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport { NoCateringModalComponent } from '../no-catering-modal/no-catering-modal.component'\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport interface SpaceSelectModalData {\n /** List of selected spaces */\n spaces: Space[];\n /** Start time for availability of spaces */\n dateTz: DateTZ;\n /** Duration of the availability block to look for */\n duration: number;\n /** Host of the booking being made */\n host: User;\n /** Whether multiple spaces can be selected */\n multiple: boolean;\n /** Force zone ids */\n zone_ids?: string;\n /** Booking needs catering */\n needsCatering?: boolean,\n}\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'a-space-select-modal',\n templateUrl: './space-select-modal.component.html',\n styleUrls: ['./space-select-modal.component.scss']\n})\nexport class SpaceSelectModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Whether space list is being loaded */\n public loading: boolean;\n /** List of available spaces to select from */\n public spaces: Space[] = [];\n /** Active building to filter spaces on */\n public active_building: Building;\n /** Active building to filter spaces on */\n public active_type: Identity;\n /** List of items from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public readonly change$ = new Subject();\n /** List of currently selected spaces */\n public selected_spaces: Space[] = [];\n /** Mapping as to whether a space is by request */\n public request_map: HashMap = {};\n /** Whether selected list should be shown on mobile */\n public show_list: boolean;\n\n /** host to load (only in staff) **/\n public host: User;\n\n /** List of available buildings */\n public types: Identity[] = [];\n\n public isConcierge: boolean;\n public frontend: string;\n\n /** List of available buildings */\n public get buildings(): Building[] {\n return this._org.buildings;\n }\n\n /** Whether multiple spaces can be selected */\n public get multiple(): boolean {\n return false;\n }\n\n public get has_zone(): boolean {\n return !!this._data.zone_ids;\n }\n\n public formGroup = new FormGroup({\n location: new FormControl([]),\n });\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n\n public noCateringDialogRef: MatDialogRef;\n\n /** List of zones to filter the spaces on */\n public zone_ids: string[] = [];\n\n\n public get initialBuildingIds(): string[] {\n return this._org.building ? [this._org.building.id] : [];\n }\n\n public savedSelection\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _spaces: SpacesService,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n @Inject(MAT_DIALOG_DATA) private _data: SpaceSelectModalData\n ) {\n super();\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n let request_id = 0;\n // Listen for input changes\n this.search_results$ = this.change$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap((bld) => {\n this.loading = true;\n const zone_ids: string[] = [];\n /* istanbul ignore else */\n if (this.active_building) {\n zone_ids.push(this.active_building.id);\n }\n\n if (bld?.includes('|')) {\n bld = this.savedSelection\n }\n\n const id = request_id;\n return this._spaces.available({\n zone_ids: bld?.length ? bld : this._data.spaces[0].building.id || zone_ids.join(','),\n dateTz: this._data.dateTz,\n duration: this._data.duration\n }).then(async (list) => ({ id, list }));\n }),\n catchError((_) => of({ id: request_id, list: [], error: _ })),\n map((resp: { id: number, list: Space[] }) => {\n this.loading = false;\n const filtered_list = resp.list.filter((space: Space) => {\n // if concierge skip rules check.\n if (this._settings.concierge) {\n return (this.active_type && this.active_type.id ? space.zones.includes(`${this.active_type.id}`) : true) &&\n !this.selected_spaces.find((s) => s.id === space.id);\n }\n\n const rules = space.rulesFor({\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this.host || this._data.host\n });\n return (\n rules.hide !== true &&\n (this.active_type && this.active_type.id\n ? space.zones.includes(`${this.active_type.id}`)\n : true) &&\n !this.selected_spaces.find((_space) => _space.id === space.id)\n );\n });\n return resp.id === request_id ? filtered_list : this.spaces;\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.spaces = list.filter((space) => {\n if (!space.available) {\n return false;\n }\n for (const zone of this.zone_ids) {\n if (space.zones.includes(zone)) {\n return true;\n }\n }\n return !this.zone_ids.length;\n });\n this.spaces.sort((a, b) => this.sort(a, b));\n if (!this.selectedOptions.value.length) {\n this.setDefaultBuilding()\n }\n })\n );\n this.active_building = this._data.spaces?.length\n ? this._org.buildings.find((i) => i.id === this._data.spaces[0].level.building_id)\n : this._org.building;\n this.types = [{ id: '', name: 'Any Space Type' } as any].concat(\n this._org.space_types || []\n );\n this.active_type = this.types[0];\n this.change$.next('');\n });\n\n this.subscription('buildings', this._org.listen('buildings').subscribe((bld_list) => {\n const city = this._org.building.city\n const timezone = this._org.building.timezone\n const grouped_by_city = {\n key: { name: city, timezone },\n value: bld_list?.filter((bld) => bld.city === city) || []\n }\n const city_buildings = grouped_by_city.value.map(\n (bld) => mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n )\n const buildings = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings\n ]\n this.options.next(buildings)\n }));\n\n }\n\n /** Add space to selected list */\n public addSpace(space: Space) {\n this.selected_spaces.push(space);\n this.selected_spaces = unique(this.selected_spaces, 'id');\n }\n\n /** Remove space from selected list */\n public removeSpace(space: Space) {\n this.selected_spaces = this.selected_spaces.filter((a_space) => a_space.id !== space.id);\n }\n\n /** Emit current state of the selected list */\n public save(list: Space[]) {\n if (!this._data.needsCatering) {\n // No catering order to warn about\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // Check if the room has catering \n if (list[0].has_catering) {\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // If not warn that the room doesn't have catering\n this.noCateringDialogRef = this._dialog.open(NoCateringModalComponent, {\n panelClass: 'mck-modal-mini',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.subscription(\n 'no-catering-modal',\n this.noCateringDialogRef.componentInstance.event.subscribe((event) => {\n if (event.reason === 'done') {\n this.event.emit({ reason: 'done', metadata: list, noCatering: event.noCatering });\n }\n if (event.reason === 'close') {\n this.event.emit({ reason: 'close' });\n }\n })\n );\n }\n\n private update() {\n const map = {};\n const options: SpaceBookingRuleOptions = {\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this._data.host\n };\n this.selected_spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.request_map = map;\n }\n\n public setDefaultBuilding() {\n const defaultBld = this.options.value.filter(opt => opt.value === this._org.building.id)\n this.selectedOptions.next(defaultBld)\n }\n\n /**\n * Compare two spaces to determine order\n * @param space_a\n * @param space_b\n */\n public sort(space_a: Space, space_b: Space) {\n const bld = this._org.buildings.find((bld) => space_a.zones.includes(bld.id)) || { name: '', sort_order: [] };\n const bld_b = this._org.buildings.find((bld) => space_b.zones.includes(bld.id));\n if (bld && bld !== bld_b) {\n return bld.name.localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = space_a.zones.indexOf(zone_id) >= 0;\n const b_has_zone = space_b.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n return space_a.name.localeCompare(space_b.name);\n }\n\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n const formData = this.formGroup.value;\n this.formGroup.setValue({\n location: formData.location,\n });\n this.selectedOptions.next(next);\n this.savedSelection = next.map((bld) => bld.value)\n\n });\n }\n\n /**\n * Update the selected space list\n * @param space Space to add/toggle in the selected list\n */\n public selectSpace(space: Space) {\n const list = this.spaces;\n if (list.find((item) => item.id === space.id)) {\n this.spaces = list.filter((item) => item.id !== space.id);\n } else {\n this.spaces = [space];\n }\n }\n\n public clearList() {\n this.spaces = []\n this.savedSelection = []\n }\n\n public triggerSearch = () => {\n if (this.savedSelection.length) {\n this.change$.next(this.savedSelection)\n } else {\n this.spaces = []\n }\n }\n\n}\n","
\n
Select meeting space{{ multiple ? 's' : '' }}
\n \n
\n\n
\n
\n \n \n 1\">Type\n 1\">\n \n \n {{ type?.name }}\n \n \n \n \n
\n \n \n
\n
\n
{{ space.local_name }}
\n
{{ space.level.name }}
\n
\n
\n \n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n {{ (!isConcierge && request_map[space.id]) ? 'Request' : 'Select' }}\n \n
\n
\n
\n
\n
\n
\n
\n

Selected spaces

\n
\n \n
\n \n \n
\n
\n
{{ space.name }}
\n
{{ space.level.name }}
\n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n \n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
Loading available spaces...
\n
\n
\n\n
\n
\n \n
\n
No results available, please select another office.
\n
\n
\n\n
\n
\n \n
\n
No selected spaces
\n
\n
\n","import { Component, Input } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'user-form',\n templateUrl: './user-form.component.html',\n styleUrls: ['./user-form.component.scss']\n})\nexport class UserFormComponent {\n /** Group of form fields used for creating the system */\n @Input() public form: FormGroup;\n}\n","
\n
\n
\n First Name:\n \n \n First name is required\n \n \n
\n
\n Last Name:\n \n \n Last name is required\n \n
\n
\n Email:\n \n \n A valid email is required\n \n
\n
\n
\n","export * from './lib/legacy-ui.module';\nexport * from './lib/custom-fields';\nexport * from './lib/icon/icon.component';\nexport * from './lib/feedback/feedback.component';\nexport * from './lib/action-icon/action-icon.component';\nexport * from './lib/user-avatar/user-avatar.component';\nexport * from './lib/bookings/catering/item/item.component';\nexport * from './lib/cng-search-bar/cng-search-bar.component';\n","import { Component, OnInit, Input } from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'action-icon',\n templateUrl: './action-icon.component.html',\n styleUrls: ['./action-icon.component.scss']\n})\nexport class ActionIconComponent implements OnInit {\n /** Icon to display */\n @Input() public icon: ApplicationIcon;\n /** Whether action is being processed */\n @Input() public loading: boolean;\n /** State of the action */\n @Input() public state: 'success' | 'error' | '' = '';\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","
\n \n
\n \n
\n
\n \n
\n
\n","import {\n Component,\n Input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { FormControl } from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringCategory,\n CateringItem,\n SettingsService\n} from '@mckinsey-converge/data-common';\nimport { ANIMATION_SHOW_CONTRACT_EXPAND } from '@mckinsey-converge/animations';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { PackageOptionsModalComponent } from '../package-options-modal/package-options-modal.component';\n\nfunction hasSelectionRequirements(category: CateringCategory) {\n return (\n category.must_select < category.items.length ||\n (category.must_select === category.items.length &&\n category.items.find((item: any) => item.items && item.must_select < item.items.length))\n );\n}\n\nfunction getActiveList(category: CateringCategory) {\n const items = category.items || [];\n let list = items.filter((item) => item.amount > 0).map((item) => item.id);\n for (const item of items) {\n if ((item as any).items && (item as any).items.length) {\n list = list.concat(getActiveList(item as any));\n }\n }\n return list;\n}\n\n@Component({\n selector: 'a-catering-menu-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss'],\n animations: [ANIMATION_SHOW_CONTRACT_EXPAND]\n})\nexport class CateringMenuItemComponent extends BaseDirective implements OnChanges {\n /** Whether item is a child of another */\n @Input() public subitem: boolean;\n /** Item to display */\n @Input() public item: CateringCategory;\n /** Field for storing items */\n @Input() public field: FormControl;\n /** Current symbol for the selected space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Whether to show children items */\n public show_children: boolean;\n public initial_state = null;\n\n /** List of contents of the package */\n public get contents(): string {\n return this.item.items\n ? this.item.items.reduce((list, item) => {\n /* istanbul ignore else */\n if (list) {\n list += '\\n\\n';\n }\n return (list += `${item.name}${\n (item as any).items\n ? (item as any).items.reduce(\n (a_list, an_item) =>\n (a_list += `\\n ${an_item.amount ? '✓' : '•'} ${an_item.name} `),\n ''\n )\n : ''\n } ${item.amount ? '✓' : ''}`);\n }, '')\n : '';\n }\n\n constructor(private _service: ApplicationService, private _dialog: MatDialog,\n public settings: SettingsService) {\n super();\n // on the item selection set the revert/close state\n this.initial_state = this.item;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.field && this.field) {\n const list = this.field.value;\n // check the category\n let item = list.find((an_cat) => an_cat.id === this.item.id);\n if (item) {\n // update the category level amount\n this.item.setAmount(item ? item.amount : 0);\n } else {\n // find a category item\n for (var cat of list) {\n item = cat?.items.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(item ? item.amount : 0);\n break;\n }\n }; \n } \n\n // On the confirm catering order modal set the revert/close state\n if (!this.initial_state && this.item.amount) {\n this.initial_state = this.item;\n }\n\n this.subscription(\n 'field_change',\n this.field.valueChanges.subscribe((list) => {\n const item = list.find((an_item) => an_item.id === this.item.id);\n this.item.setAmount(item ? item.amount : 0);\n this.updatePackageSelection();\n })\n );\n }\n }\n\n /**\n * Update the amount of the item in the order\n * @param value New amount\n */\n public updateAmount(value: number) {\n /* istanbul ignore else */\n if (this.field) {\n const list: CateringItem[] = this.field.value;\n const item = list.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(value);\n item.setAmount(value);\n // MCK-1550 fix\n const price = this.item.price;\n item.setPrice(price)\n } else {\n const amount = this.item.amount;\n this.item.setAmount(value);\n if (\n this.item.package &&\n amount < value &&\n this.item.items &&\n this.item.items.length &&\n hasSelectionRequirements(this.item)\n ) {\n this.selectPackageOptions().then(\n (confirmed_item) => {\n list.push(new CateringCategory(confirmed_item));\n this.field.setValue(list.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n } else {\n list.push(new CateringItem(this.item));\n }\n }\n this.field.setValue(list.filter((an_item) => an_item.amount));\n }\n }\n\n public updatePackageSelection() {\n const cart_item = this.field.value.find((item) => item.id === this.item.id);\n if (cart_item) {\n const active_items = getActiveList(cart_item);\n this.timeout(\n 'update_package',\n () => {\n this.item.items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n if ((item as any).items) {\n (item as any).items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n });\n }\n });\n },\n 5\n );\n }\n }\n\n /** Reselect package options */\n public updatePackageOptions(): void {\n let updatedList: CateringItem[] = [];\n this.selectPackageOptions().then(\n (confirmed_item) => {\n // Update the existing category package\n this.field.value.forEach((category: CateringCategory) => {\n if (category.id === confirmed_item.id) {\n updatedList.push(new CateringCategory(confirmed_item))\n } else {\n updatedList.push(category)\n }\n })\n this.field.setValue(updatedList.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n }\n\n /**\n * Open modal for user to select package options\n */\n private selectPackageOptions(): Promise {\n return new Promise((resolve, reject) => {\n const ref = this._dialog.open(PackageOptionsModalComponent, {\n maxWidth: '95vw',\n data: {\n item: new CateringCategory(this.item)\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n let done = false;\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n done = true;\n resolve(ref.componentInstance.item);\n this.initial_state = this.item;\n ref.close();\n }\n });\n ref.afterClosed().subscribe(() => {\n /* istanbul ignore else */\n if (!done) {\n if (this.initial_state) {\n resolve(this.initial_state);\n } else {\n reject();\n }\n }\n });\n });\n }\n}\n","\n \n
\n
{{ item.name }}
\n
{{ item.package ? '[Package] ' : '' }}{{ item.description }}
\n
\n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n { item.availableItems.length, plural, =1 { Contains {{ item.availableItems.length }} item } other {\n Contains {{ item.availableItems.length }} items } }\n
\n 0\"\n [matTooltip]=\"contents\"\n >\n {{ item.must_select }}\n \n Selected\n \n
\n 0\"\n (click)=\"updatePackageOptions()\"\n i18n=\"Catering order item options change action\"\n >\n Customise\n \n \n \n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n \n \n \n\n
\n \n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n CateringCategory,\n CateringItem\n} from '@mckinsey-converge/data-common';\n\nexport interface PackageOptionsModalData {\n item: CateringCategory;\n}\n\nexport function checkItemRequirements(category: CateringCategory): boolean {\n const items = category.items || [];\n return category.must_select >= items.length\n ? items.reduce((valid, item) => valid && checkItemRequirements(item as any), true)\n : items.reduce((amount, item) => amount + (item.amount ? 1 : 0), 0) ===\n category.must_select;\n}\n\nexport function getActiveItems(category: CateringCategory): HashMap {\n let map = {};\n if (category.items) {\n const item = category.items.find(item => item.amount > 0);\n if (item) {\n map[category.id] = item.id;\n }\n category.items.forEach(item => map = { ...map, ...getActiveItems(item as any) });\n }\n return map;\n}\n\n@Component({\n selector: 'a-package-options-modal',\n templateUrl: './package-options-modal.component.html',\n styleUrls: ['./package-options-modal.component.scss']\n})\nexport class PackageOptionsModalComponent {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n\n /** Item to select options for */\n public get item(): CateringCategory {\n return this._data.item;\n }\n\n /** Whether package requirements have been met */\n public get requirements_met(): boolean {\n return checkItemRequirements(this.item);\n }\n\n public get active_items(): HashMap {\n return getActiveItems(this.item);\n }\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: PackageOptionsModalData) {\n }\n\n /**\n * Update the list of selected items\n */\n public updateAmount(a_package: CateringCategory, option: CateringItem, state: boolean) {\n if (state) {\n const needed = a_package.must_select;\n const active = a_package.items.filter(an_item => an_item.amount > 0).length;\n if (active >= needed) {\n const item = a_package.items.find(an_item => an_item.amount > 0);\n item.setAmount(0);\n }\n option.setAmount(1);\n } else {\n option.setAmount(0);\n }\n }\n}\n","
\n

Package Options

\n \n
\n\n
\n \n
\n
\n\n
\n \n
\n
\n\n \n \n
\n \n 1\"\n [checked]=\"!!option.amount\"\n (change)=\"updateAmount(package, option, $event.checked)\"\n >\n {{ option.name }}\n \n \n {{ option.name }}\n \n \n = package.items.length || option.must_select\">\n {{ option.name }}\n \n \n
\n
\n
\n
\n","import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n// Interface to define the structure of the configuration object for the search bar\nexport interface SearchBarConfig {\n placeholder?: string;\n totalFoundItem?: number;\n showSrchWarning?: boolean;\n}\n\n@Component({\n selector: 'cng-search-bar',\n templateUrl: './cng-search-bar.component.html',\n styleUrls: ['./cmg-search-bar.component.scss']\n})\nexport class CngSearchBarComponent implements OnChanges {\n // Input property to accept configuration for the search bar\n @Input() config: SearchBarConfig = {\n placeholder: 'Search ...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n // Output event emitter to emit search strings to parent components\n @Output() search = new EventEmitter();\n\n // Local variable to store the search string entered by the user\n searchStr: string = '';\n\n // Lifecycle hook that is called when any data-bound property of a directive changes\n ngOnChanges(changes: SimpleChanges): void {\n // Check if the config property has changed\n if (changes.config) {\n const configChanges = changes.config.currentValue;\n // Update the config with new values or fallback to defaults\n this.config = {\n placeholder: configChanges.placeholder || 'Search ...',\n totalFoundItem: configChanges.totalFoundItem || 0,\n showSrchWarning: configChanges.showSrchWarning || false\n };\n }\n }\n\n // Method to handle the search action\n onSearch(value: string): void {\n // Emit the search string if it's not empty\n if (value) {\n this.search.emit(value);\n } else {\n this.clearSearch();\n }\n }\n\n // Method to clear the search input and reset related configurations\n clearSearch(box: HTMLInputElement | null = null): void {\n this.searchStr = '';\n if (box) {\n box.value = '';\n }\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n this.search.emit('');\n }\n\n // Method to reset the search-related warnings and item count\n resetSearch(): void {\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n }\n}\n","
\n \n \n
{{ config.totalFoundItem }}
\n \n \n \n
\n \n No search found!\n
\n
\n ","import { Directive, ElementRef, HostListener, Input } from '@angular/core';\n\n@Directive({\n selector: '[hover-class]'\n})\nexport class HoverClassDirective {\n @Input('hover-class') hoverClass: string;\n\n constructor(private elementRef: ElementRef) {}\n\n @HostListener('mouseenter') onMouseEnter() {\n this.update('add');\n }\n\n @HostListener('mouseleave') onMouseLeave() {\n this.update('remove');\n }\n\n @HostListener('blur') onBlur() {\n this.update('remove');\n }\n\n private update(action: string): void {\n this.hoverClass.split(' ').forEach(item => this.elementRef.nativeElement.classList[action](item));\n }\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'an-action-field',\n templateUrl: './action-field.component.html',\n styleUrls: ['./action-field.component.scss']\n})\nexport class ActionFieldComponent extends BaseDirective {\n /** Name of the field */\n @Input() public name: string;\n /** Value to display on the field */\n @Input() public placeholder: string;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Emitter for user interaction events */\n @Output('onAction') public on_action = new EventEmitter();\n /** Whether to show tooltip */\n public show_tooltip = false;\n\n /**\n * Emit that the user has performed an action on the field\n */\n public performAction() {\n this.show_tooltip = !this.show_tooltip;\n this.on_action.emit();\n }\n}\n","\n
{{ placeholder }}
\n
\n \n
\n\n","import { Component, forwardRef, Input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'a-counter',\n templateUrl: './counter.component.html',\n styleUrls: ['./counter.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n /* istanbul ignore next */\n useExisting: forwardRef(() => CounterComponent),\n multi: true,\n },\n ],\n})\nexport class CounterComponent implements ControlValueAccessor {\n /** Maximum amount for the counter */\n @Input() public max: number = 10;\n /** Minimum amount for the counter */\n @Input() public min: number = 0;\n\n @Input() public useInput = false;\n\n /** Current value of the counter */\n public value: number;\n public previous_value: number = 0;\n /** Whether shift key is being held by the user */\n public shift_key: boolean;\n /** Whether control key is being held by the user */\n public ctrl_key: boolean;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /**\n * Add the `step` to the current value\n */\n public add() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value += step;\n if (this.value > this.max) {\n this.value = this.max || 10;\n }\n this.setValue(this.value);\n }\n\n /** Remove the `step` from the current value */\n public remove() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value -= step;\n if (this.value < this.min) {\n this.value = this.min || 0;\n }\n this.setValue(this.value);\n }\n\n public handleTimeout = null;\n\n public onInputChange(new_value: string) {\n if (this.handleTimeout) {\n clearTimeout(this.handleTimeout);\n this.handleTimeout = null;\n }\n this.handleTimeout = setTimeout(() => this.changeInput(new_value), 500);\n }\n\n public changeInput(new_value: string) {\n let value = Number(new_value);\n if (isNaN(value)) {\n value = this.previous_value;\n }\n if (value < this.min) {\n value = this.min || 0;\n }\n if (value > this.max) {\n value = this.max || 10;\n }\n this.setValue(value);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.previous_value = new_value;\n this.value = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.value = value;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","\n \n \n
\n {{value || '0'}}\n
\n \n\n","import { Component, OnInit, forwardRef, Input, ViewChild, Output, EventEmitter } from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { MatMenuTrigger } from '@angular/material/menu';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-date-field',\n templateUrl: './date-field.component.html',\n styleUrls: ['./date-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateFieldComponent),\n multi: true\n }\n ]\n})\nexport class DateFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n /** Optional event emitter for changes */\n @Output() public onChange = new EventEmitter();\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Currently selected date */\n public date: number;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n /** Display value for the current date */\n public get date_string(): string {\n // R--- Needs TZ aware inputs\n const date = new DateTZ({date: this.date})\n return date.formatDate('dd MMM yyyy');\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public ngOnInit() {\n this.date = DateNow(new Date()).ms;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = new DateTZ({date: this.date });\n const new_d = new DateTZ({date: new_value})\n let new_date = new_d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n this.date = new_date;\n if (this._onChange) {\n this._onChange(new_date);\n this.onChange.emit(new_date);\n }\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","\n
{{ date_string }}
\n
\n \n
\n\n\n
\n \n
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport {\n humaniseDuration,\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-duration-field',\n templateUrl: './duration-field.component.html',\n styleUrls: ['./duration-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ]\n})\nexport class DurationFieldComponent extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor {\n /** Maximum duration option available */\n @Input() public max: number = 240;\n /** Minimum duration option available */\n @Input() public min: number = 15;\n /** Step value between options */\n @Input() public step: number = 15;\n /** Reference time for displaying next to durations */\n @Input() public time: number;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Special case prepopulation i.e. out of step options */\n @Input() public specialPreprops: Array = [];\n /** Whether form all_day is enabled. */\n @Input() public all_day: boolean = false;\n\n public duration: number = 60;\n /** List of available duration options */\n public duration_options: Identity[];\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n public ngOnInit(): void {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.max || changes.min || changes.step || changes.time || changes.all_day) {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.duration = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(+new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.duration = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n private generateDurationOptions(max: number, min: number, step: number, all_day: boolean = false): Identity[] {\n const blocks: Identity[] = [];\n let time = min;\n // R--- Change input to dateTz\n let date = this.time ? new DateTZ({date: this.time}) : null;\n\n // Add special case for 10min duration/prepropulation\n for (const option of this.specialPreprops) {\n blocks.push({\n id: option,\n name: date\n ? `${date.addValue({ minutes: option }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(option)})`\n : `${humaniseDuration(option)}`\n });\n }\n\n\n while (time <= max) {\n blocks.push({\n id: time,\n name: date\n ? `${date.addValue({ minutes: time }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(time)})`\n : `${humaniseDuration(time)}`\n });\n time += step;\n }\n if (all_day) {\n blocks.push({ id: 24 * 60, name: 'All Day' }); \n }\n blocks.push({ id: 7 * 24 * 60, name: '1 week' });\n return blocks;\n }\n}\n","
\n \n \n \n {{ option.name }}\n \n \n \n
\n","export * from './action-field/action-field.component'\nexport * from './counter/counter.component'\nexport * from './date-field/date-field.component'\nexport * from './duration-field/duration-field.component'\nexport * from './time-field/time-field.component'\nexport * from './user-search-field/user-search-field.component'\nexport * from './user-list-field/user-list-field.component'\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-time-field',\n templateUrl: './time-field.component.html',\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ]\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n /** Time step between each allowed time option */\n @Input() public step: number = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public no_past_times: boolean = true;\n /** String representing the currently set time */\n public date: number = DateNow(new Date()).ms;\n /** String representing the currently set time */\n public time: string = DateNow(new Date()).formatDate('HH:mm');\n /** Available time blocks for the selected date */\n public _time_options: Identity[];\n /** Whether select field should be shown */\n public show_select: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n // R--- This is the form input that needs to be TZ active.\n public ngOnInit(): void {\n this.show_select = true;\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n this.timeout('hide', () => this.show_select = false);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step) {\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n }\n\n public get date_(){\n return new DateTZ({date: this.date})\n }\n\n /** Available time blocks for the selected date */\n public get time_options() {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] });\n if (date.minutes % 15 !== 0 && !this._time_options.find(time => time.id === date.formatDate('HH:mm'))) {\n this._time_options.push({\n name: `${date.formatDate(timeFormatString())}`,\n id: date.formatDate('HH:mm')\n });\n this._time_options.sort((a, b) => `${a.id}`.localeCompare(`${b.id}`));\n }\n return this._time_options;\n }\n\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.time = new_value;\n if (this._onChange) {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] }).startOfValue('minute');\n this._onChange(date.ms);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n if (!value) {\n return;\n }\n this.date = value;\n let date = this.date_.startOfValue('minute');\n date = date.setValue({ minute: Math.ceil(date.minutes / 5) * 5 });\n this.time = date.formatDate('HH:mm');\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Show select field for time options\n */\n public showSelect() {\n this.show_select = true;\n this.timeout('on_shown', () => {\n if (this.select_field) {\n this.select_field.focus();\n this.select_field.open();\n this.subscription('listen_close', this.select_field.openedChange.subscribe((state) => {\n if (!state) {\n this.show_select = false;\n }\n }));\n }\n });\n }\n\n /**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n private generateAvailableTimes(datestamp: number, show_past: boolean, step: number = 15): Identity[] {\n let date = new DateTZ({date: datestamp});\n const blocks = [];\n if (show_past || date.isAfterDate(DateNow(new Date()))) {\n date = date.startOfValue('day');\n } else if (date.isAfterDate(DateNow(new Date()))) {\n date = DateNow(new Date());\n }\n date = date.setValue({ minute: Math.ceil(date.minutes / step) * step });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n name: `${date.formatDate(timeFormatString()).toLocaleLowerCase()}`,\n id: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n }\n}\n","\n
\n \n
\n
\n \n
\n\n\n \n \n {{ option.name }}\n \n \n\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n tap,\n map,\n switchMap,\n finalize\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n csvToJson,\n downloadFile,\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-list-field',\n templateUrl: './user-list-field.component.html',\n styleUrls: ['./user-list-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserListFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserListFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Number of characters needed before a search will start */\n @Input() public limit: number = 3;\n /** Emitter for action to make a new user */\n @Output('newUser') public new_user = new EventEmitter();\n\n /** User list to display */\n public user_list: User[];\n /** List of active selected users on the list */\n public active_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** String */\n public search_str: string;\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User[]) => void;\n /** Form control on touch handler */\n private _onTouch: (_: User[]) => void;\n\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n\n constructor(private _service: ApplicationService, private _users: UsersService, private cdRef: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit() {\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(100),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query.slice(0, Math.max(this.limit, 3)),\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n })\n );\n }\n\n /**\n * Add user to the user list\n * @param user\n */\n public addUser(user: User) {\n /* istanbul ignore else */\n if (!this.active_list) {\n this.active_list = [];\n }\n const index = this.active_list.findIndex((a_user) => a_user.id === user.id);\n /* istanbul ignore else */\n if (index < 0) {\n this.active_list = [...this.active_list, user];\n }\n this.setValue(this.active_list);\n this.search_str = '';\n }\n\n /**\n * Remove user from the user list\n * @param user\n */\n public removeUser(user: User) {\n this.active_list = this.active_list.filter((a_user) => a_user.id !== user.id);\n this.setValue(this.active_list);\n }\n\n /**\n * Load CSV file and populate the user list with the contents\n * @param event File input field event\n */\n public addUsersFromFile(event) {\n /* istanbul ignore else */\n if (event.target) {\n const file = event.target.files[0];\n /* istanbul ignore else */\n if (file) {\n const reader = new FileReader();\n reader.readAsText(file, 'UTF-8');\n reader.addEventListener('load', (evt) => {\n this.processCsvData((evt.srcElement as any).result);\n event.target.value = '';\n this.cdRef.detectChanges();\n });\n reader.addEventListener('error', (_) =>\n this._service.notifyError('Error reading file.')\n );\n }\n }\n }\n\n /**\n * Process raw CSV data and save user data to attendee list\n * @param data CSV data\n */\n private processCsvData(data: string) {\n const list = csvToJson(data) || [];\n const id = this._users.current.staff_code; \n list.forEach((el) => {\n const firstName = el.first_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n const lastName = el.last_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n\n el.name = el.name || `${firstName} ${lastName}`;\n const display = (el.name || `${Math.floor(Math.random() * 9999_9999)}`)\n .split(' ')\n .join('_')\n .toLowerCase();\n /* istanbul ignore else */\n if (!el.email) {\n el.email = `${display}+${id}@guest.mckinsey.com`;\n }\n el.type = 'external';\n el.external = !el.email.endsWith(\"@mckinsey.com\") && !el.email.endsWith(\"@external.mckinsey.com\");\n this.addUser(new User(el));\n });\n }\n\n /* istanbul ignore next */\n /** Download template CSV file */\n public downloadCSVTemplate() {\n const template = `Organisation Name,First Name,Last Name,Email,Phone\\nFake Org,John,Smith,john.smith@example.com,01234567898`;\n downloadFile('template.csv', template);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User[]): void {\n this.active_list = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User[]) {\n this.active_list = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User[]) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: User[]) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n \n \n \n
\n
\n \n \n {{ user.name }}\n \n \n \n
\n
\n\n
No attendees
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n map,\n switchMap\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-search-field',\n templateUrl: './user-search-field.component.html',\n styleUrls: ['./user-search-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserSearchFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserSearchFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Limit available options to these */\n @Input() public options: User[];\n /** Currently selected user */\n public active_user: User;\n /** User list to display */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Current display value of the search input field */\n public search_str: string = '';\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User) => void;\n /** Form control on touch handler */\n private _onTouch: () => void;\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n \n constructor(private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap(query => {\n this.loading = true;\n return this.options && this.options.length > 0\n ? Promise.resolve(this.options)\n : query.length >= 3\n ? (this._users.query({ q: query, cache: 60 * 1000 }) as Promise)\n : Promise.resolve([]);\n }),\n catchError((err) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription('search_results', this.search_results$.subscribe(list => {\n this.user_list = list;\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n }));\n }\n\n /** Handle input changes */\n public onInputChange(value: string): void {\n this.search_str = value;\n this.search$.next(value);\n }\n\n /**\n * Reset the search string back to the name of the active user\n */\n public resetSearchString(): void {\n if (this.active_user) {\n this.search_str = this.active_user.name;\n } else {\n this.search_str = '';\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User): void {\n this.active_user = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n this.resetSearchString();\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User): void {\n this.active_user = value;\n this.search_str = value ? value.name : '';\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: () => void): void {\n this._onTouch = fn;\n }\n\n /** Function to display the user's name in the input field */\n public displayFn(user?: User): string {\n return user ? user.name : '';\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n","import { Component, OnInit } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'feedback',\n templateUrl: './feedback.component.html',\n styleUrls: ['./feedback.component.scss'],\n})\nexport class FeedbackComponent extends BaseDirective implements OnInit {\n /** Name of the currently active page */\n public current_page: string;\n\n constructor(private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title), 1000);\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.current_page = location;\n }\n}\n","\n
\n Feedback\n \n \n \n
\n
\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-icon',\n templateUrl: './icon.component.html',\n styleUrls: ['./icon.component.scss']\n})\nexport class IconComponent extends BaseDirective {\n @Input() public icon: ApplicationIcon;\n}\n","
\n {{ icon.content }}\n \n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n ActionFieldComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserListFieldComponent,\n UserSearchFieldComponent\n} from './custom-fields';\nimport { IconComponent } from './icon/icon.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { ACA_PIPES_MODULE } from '@acaprojects/ngx-pipes';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { FeedbackComponent } from './feedback/feedback.component';\nimport { ActionIconComponent } from './action-icon/action-icon.component';\nimport { PopoutMenuComponent } from './popout-menu/popout-menu.component';\nimport { SearchbarComponent } from './searchbar/searchbar.component';\nimport { UserAvatarComponent } from './user-avatar/user-avatar.component';\nimport { CateringMenuItemComponent } from './bookings/catering/item/item.component';\nimport { PackageOptionsModalComponent } from './bookings/catering/package-options-modal/package-options-modal.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { CngSearchBarComponent } from './cng-search-bar/cng-search-bar.component';\nimport { HoverClassDirective } from './cng-search-bar/hover-class.directive';\n\nconst DECLARATIONS = [\n ActionFieldComponent,\n IconComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserSearchFieldComponent,\n UserListFieldComponent,\n FeedbackComponent,\n ActionIconComponent,\n PopoutMenuComponent,\n SearchbarComponent,\n UserAvatarComponent,\n CateringMenuItemComponent,\n PackageOptionsModalComponent,\n CngSearchBarComponent,\n HoverClassDirective\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\n@NgModule({\n imports: [\n CommonModule,\n ACA_PIPES_MODULE,\n FormsModule,\n ReactiveFormsModule,\n ...MATERIAL_MODULES,\n BaseModule,\n UiModule\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ACA_PIPES_MODULE,\n ...DECLARATIONS,\n ...MATERIAL_MODULES,\n BaseModule,\n ]\n})\nexport class LegacyUiModule {\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nexport interface PopoutAction extends ApplicationIcon {\n /** ID of the action */\n id: string;\n}\n\n@Component({\n selector: 'a-popout-menu',\n templateUrl: './popout-menu.component.html',\n styleUrls: ['./popout-menu.component.scss']\n})\nexport class PopoutMenuComponent extends BaseDirective {\n /** List of available actions */\n @Input() public actions: PopoutAction[] = [];\n /** Emitter for user actions */\n @Output() public action = new EventEmitter();\n /** Whether actions should show */\n public show: boolean;\n\n public close() {\n this.timeout('close', () => {\n this.show = false;\n });\n }\n}\n","\n \n\n\n","import { Component, OnInit, Input, EventEmitter, Output, ViewChild, ElementRef, SimpleChanges, OnChanges } from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'a-searchbar',\n templateUrl: './searchbar.component.html',\n styleUrls: ['./searchbar.component.scss']\n})\nexport class SearchbarComponent extends BaseDirective implements OnChanges {\n /** Current contents of the searchbar input */\n @Input('value') public value: string;\n /** Current contents of the searchbar input */\n @Input() public placeholder: string;\n /** Whether external changes are being processed */\n @Input() public loading: boolean;\n /** Whether external changes are being processed */\n @Input() public autofocus: boolean;\n /** Emitter for changes to the searchbar value */\n @Output() public valueChange = new EventEmitter();\n /** Input field reference */\n @ViewChild('input', { static: true }) private input_field: ElementRef;\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.autofocus && this.autofocus) {\n this.focusField()\n }\n }\n\n public focusField() {\n /* istanbul ignore else */\n if (this.input_field && this.input_field.nativeElement) {\n this.input_field.nativeElement.focus();\n }\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n","import { Component, Input } from '@angular/core';\nimport { User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-user-avatar',\n templateUrl: './user-avatar.component.html',\n styleUrls: ['./user-avatar.component.scss']\n})\nexport class UserAvatarComponent {\n /** User to display avatar for */\n @Input() public user: User;\n\n public get initials(): string {\n if (!this.user) {\n return 'NA';\n }\n const parts = this.user.name.split(' ');\n return parts.length > 1\n ? `${parts[0][0]}${parts[parts.length - 1][0]}`\n : this.user.name.slice(0, 2);\n }\n}\n","
\n
{{ initials }}
\n
\n\n \n\n","export * from './lib/loading.actions'\nexport * from './lib/loading.model'\nexport * from './lib/loading.effects'\nexport * from './lib/loading.selectors'\nexport * from '../testing'\n","import {\n createAction,\n createSelector,\n on,\n On,\n props\n} from '@ngrx/store';\nimport {\n LoadingModel,\n wrapLoading\n} from './loading.model';\nimport {\n selectIsLoading,\n selectOptionalError,\n selectOptionalSuccess,\n selectSuccess\n} from './loading.selectors';\nimport { MemoizedSelector } from '@ngrx/store/src/selector';\nimport {\n ActionCreator,\n NotAllowedCheck,\n TypedAction\n} from '@ngrx/store/src/models';\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport interface Payload {\n payload: T\n}\n\nexport type LoadingAction = T & TypedAction\nexport type LoadingActionCreator = T extends null | undefined ?\n ActionCreator TypedAction>\n : ActionCreator) => LoadingAction>\n\ntype ClearAction = ActionCreator TypedAction>\n\ninterface Selectors {\n success: MemoizedSelector\n optionalSuccess: MemoizedSelector\n error: MemoizedSelector\n loading: MemoizedSelector\n model: (TState) => LoadingModel\n}\n\nexport interface LoadingActionObject {\n request: LoadingActionCreator\n success: LoadingActionCreator>\n error: LoadingActionCreator>\n clear: ClearAction,\n ons: On[],\n selectors: Selectors\n}\n\n/**\n * Creates a {@link LoadingActionObject} that contains a set of ActionCreators\n * for request, success, error, loading, and clear data. Also, it contains\n * the necessary On reducers and selectors in order to properly connect them in\n * a standardized way to data in the application.\n *\n * `TState` is the type of data on your reducer, not global store.\n * `TRequest` is an object type to use in request methods.\n * `TSuccess` is the object type of the T parameter on `LoadingModel`.\n *\n * This assumes you have state represented by:\n * ```typescript\n * interface SomeState {\n * stateKey: LoadingModel\n * }\n * ```\n *\n * To dispatch an action:\n * ```typescript\n *\n * // request parameters depend on the object type used as second type parameter\n * // in createLoadingAction\n * this.store.dispatch(someLoadingAction.request())\n *\n * // action created with createLoadingAction\n * this.store.dispatch(someLoadingAction.request({\n * name: 'Andrew G',\n * age: 24\n * }))\n *\n * ```\n *\n * The generated selectors only select data from its fractured state, not the global\n * store. In order to use them, make sure you {@link select} the global state\n * before using them:\n *\n * ```typescript\n *\n * this.store.pipe(\n * select(selectSomeState),\n * select(someLoadingAction.selectors.success)\n * ).subscribe(next => {\n *\n * })\n *\n * ```\n *\n * @param actionPrefix - Prefixes actions to uniquely identify them.\n * @param stateKey - The field within the reducer state to set data on.\n */\nexport const createLoadingAction = (\n actionPrefix: string,\n stateKey: keyof TState\n): LoadingActionObject => {\n const buildAction = (postfix: string) => `[${actionPrefix}] ${postfix}`;\n // @ts-ignore\n const request = createAction(buildAction('request'), props());\n const success = createAction(buildAction('success'), props>());\n const error = createAction(buildAction('error'), props>());\n const clear = createAction(buildAction('clear'));\n const ons: On[] = [\n on(request, (state: TState & HashMap>, action: LoadingAction) =>\n ({\n ...state,\n [stateKey]: wrapLoading(state[stateKey]).loading()\n })),\n on(success, (state: TState & HashMap>, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.success(action.payload)\n })),\n // some reason specifying state like in success and request does not work.\n on(error, (state: any, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.error(action.payload)\n })),\n on(clear, () => ({\n ...this.state,\n [stateKey]: LoadingModel.empty()\n }))\n ];\n const selectData = (state: TState) => {\n if (!state) {\n console.warn('[LoadingActions] State is empty for key', stateKey);\n }\n return wrapLoading(state?.[stateKey] as unknown as LoadingModel);\n };\n const selSuccess = createSelector, TSuccess>(\n selectData,\n selectSuccess\n );\n const selOptionalSuccess = createSelector(\n selectData,\n selectOptionalSuccess\n );\n const selError = createSelector(\n selectData,\n selectOptionalError\n );\n const selLoading = createSelector(\n selectData,\n selectIsLoading\n );\n return {\n request,\n success,\n error,\n clear,\n ons,\n selectors: {\n success: selSuccess,\n optionalSuccess: selOptionalSuccess,\n error: selError,\n loading: selLoading,\n model: selectData\n }\n };\n};\n","import {\n Actions,\n ofType\n} from '@ngrx/effects';\n\nimport { \n LoadingAction,\n LoadingActionObject\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n catchError,\n flatMap,\n map\n} from 'rxjs/operators';\nimport {\n Observable,\n of\n} from 'rxjs';\nimport { TypedAction } from '@ngrx/store/src/models';\n\n/**\n * This creates an effect to use in Effects classes. This coordinates a simple\n * success and error payload effect.\n * @param actions - The actions object\n * @param actionObject - The created createLoadingAction object.\n * @param caller - Define what API method or asynchronous operation is needed to\n * run this. Return TSuccess.\n */\nexport const createLoadingEffect = (\n actions: Actions, actionObject: LoadingActionObject,\n caller: (action: LoadingAction) => Promise): Observable> => actions.pipe(\n ofType(actionObject.request),\n flatMap((action) => caller(action as LoadingAction)),\n map((response: TSuccess) => actionObject.success({ payload: response })),\n catchError(err => {\n return of(actionObject.error({ payload: err }));\n })\n);\n","/* eslint-disable no-underscore-dangle,no-useless-constructor */\n/**\n * Wraps around the typical data objects we write for success, error, loading, and empty state. This convenience\n * wrapper consolidates all of that logic into a handy wrapper.\n */\nexport class LoadingModel {\n static empty = () => new LoadingModel(false, false, false, undefined);\n\n static success = (success?: T): LoadingModel =>\n new LoadingModel(false, false, true, success);\n\n static error = (error?: Error, optionalSuccess?: T): LoadingModel =>\n new LoadingModel(false, true, false, optionalSuccess, error);\n\n /**\n * Mutates the model with a success state, preserving other state fields.\n * @param success - override success state.\n */\n mutate = (\n success: T2 | null) => new LoadingModel(\n this.isLoading,\n this.hasError,\n !!success,\n !success ? undefined : success\n );\n\n loading = (success: T | null = this.success) =>\n new LoadingModel(\n true,\n false,\n !!success && this.hasSuccess,\n !success ? undefined : success\n );\n\n public get success(): T {\n return this._success as T;\n }\n\n public get optionalSuccess(): T | undefined {\n return this._success;\n }\n\n constructor(\n public isLoading: boolean,\n private hasError: boolean,\n private hasSuccess: boolean,\n private _success?: T,\n public error?: Error\n ) {\n }\n\n isEmpty = () => !this.isSuccess() && !this.isError();\n\n hasLoaded = () => !this.isEmpty() && !this.isLoading;\n\n isSuccess = () => this.hasSuccess;\n\n isError = () => this.hasError;\n\n shouldLoad = () => !this.isSuccess() && !this.isLoading;\n\n public toString = () =>\n `Loading: ${this.isLoading}, Success: ${this.hasSuccess}:**${this._success}**, ` +\n `Error: ${this.hasError}:${this.error}`;\n}\n\n/**\n * Wraps an object that conforms to LoadingModel to restore object loss from\n * hydrating state during development.\n */\nexport const wrapLoading = (loading: any): LoadingModel => {\n if (loading instanceof LoadingModel) {\n return loading;\n } else {\n if (!loading) {\n return LoadingModel.empty();\n } else {\n return new LoadingModel(\n loading.isLoading || false,\n loading.hasError || false,\n loading.hasSuccess || false,\n loading._success,\n loading.error\n );\n }\n }\n};\n","import { LoadingModel, wrapLoading } from './loading.model';\n\nexport const selectSuccess = (state: LoadingModel) =>\n wrapLoading(state).success;\nexport const selectOptionalSuccess = (state: LoadingModel) =>\n wrapLoading(state).optionalSuccess;\nexport const selectIsLoading = (state: LoadingModel) =>\n wrapLoading(state).isLoading;\nexport const selectIsSuccess = (state: LoadingModel) =>\n wrapLoading(state).isSuccess();\nexport const selectOptionalError = (state: LoadingModel) =>\n wrapLoading(state).error;\nexport const selectIsError = (state: LoadingModel) =>\n wrapLoading(state).isError();\nexport const selectHasLoaded = (state: LoadingModel) =>\n wrapLoading(state).hasLoaded();\nexport const selectIsEmpty = (state: LoadingModel) =>\n wrapLoading(state).isEmpty();\n\n","import {\n Observable,\n Subject\n} from 'rxjs';\nimport { Action } from '@ngrx/store';\nimport { Actions } from '@ngrx/effects';\nimport { TypedAction } from '@ngrx/store/src/models';\nimport { take } from 'rxjs/operators';\nimport {\n LoadingActionObject\n} from '../src/lib/loading.actions';\n\nexport const generateMockActions = () => {\n const dispatcher = new Subject();\n return {\n dispatcher,\n actions: new Actions(dispatcher)\n };\n};\n\n/**\n * Simple verifier that checks if the request action results in a success returned.\n */\nexport const verifyActionSuccess = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n data: TSuccess,\n payload?: TRequest,\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.success({ payload: options.data }));\n};\n\n/**\n * Simple verifier that checks if the request action results in a failure returned.\n */\nexport const verifyActionError = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n error: Error,\n payload?: TRequest\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.error({ payload: options.error }));\n};\n","export * from './effects.testing'\n","export * from './lib/organisation.module';\nexport * from './lib/organisation.actions';\n","import { OrganisationState } from './organisation.reducer';\nimport { createLoadingAction } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\n\nexport const organisationStateSelector = (state: { organisation: OrganisationState }) => state.organisation;\n\nexport const loadOrganisations = createLoadingAction('Organisation', 'data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadOrganisations } from './organisation.actions';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\n\n\n@Injectable()\nexport class OrganisationEffects {\n\n constructor(private actions: Actions,\n private organisationService: OrganisationService) {\n }\n\n @Effect()\n public loadOrganisations = createLoadingEffect(this.actions, loadOrganisations,\n () => this.organisationService.loadOrganisation())\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { organisationReducer } from './organisation.reducer';\nimport { OrganisationEffects } from './organisation.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n OrganisationEffects\n ]),\n StoreModule.forFeature('organisation', organisationReducer)\n ]\n})\nexport class OrganisationModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\nimport { createReducer } from '@ngrx/store';\nimport { loadOrganisations } from './organisation.actions';\n\nexport interface OrganisationState {\n data: LoadingModel\n}\n\nconst initialState: OrganisationState = {\n data: LoadingModel.empty()\n};\n\nexport const organisationReducer = createReducer(initialState,\n ...loadOrganisations.ons);\n","export * from './lib/rooms.module';\nexport * from './lib/rooms.actions'\nexport * from './lib/rooms.reducer'\nexport * from './lib/rooms.types'\nexport * from './lib/rooms.utils'\n","import { createLoadingAction } from '../../../loading/src/lib/loading.actions';\nimport { Space } from '../../../data-common/src/lib/spaces/space.class';\nimport {\n RoomQueryOptions,\n RoomState,\n RoomStoreState\n} from './rooms.types';\nimport {\n createAction,\n createSelector,\n props\n} from '@ngrx/store';\n\nexport const roomStateSelector = (state: RoomStoreState) => state.rooms;\n\nexport const loadRoomsWithQuery = createAction('[Rooms] Load Rooms with query', props());\n\nexport const loadRoomsForResults = createLoadingAction('Rooms', 'query');\n\nexport const loadRoomsForResultsMap = createLoadingAction('Rooms for map', 'query');\n\n\nexport const loadLaterThatDayResults = createLoadingAction('Later Rooms', 'later');\n\nexport const loadNextDayResults = createLoadingAction('Next Day Rooms', 'next');\n\nexport const loadByIdResults = createLoadingAction('By Id Rooms', 'byid');\n\nexport const selectRoomResultsSuccess = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.optionalSuccess);\n\nexport const loadDiffSizeResults = createLoadingAction('Different Size Rooms', 'size');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n loadRoomsWithQuery,\n loadByIdResults,\n loadDiffSizeResults\n} from './rooms.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n laterThatDayFromDateTz,\n nextBusinessDay,\n} from './rooms.utils';\nimport {\n RoomQueryOptions,\n roomQueryOptionsToSpaceAvailabilityOptions,\n roomByIdQueryOptionsToSpaceAvailabilityOptions\n} from './rooms.types';\n\n@Injectable()\nexport class RoomsEffects {\n constructor(private actions: Actions,\n private spaceService: SpacesService) {\n }\n\n @Effect()\n public afterRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadRoomsWithQuery),\n mergeMap((action: LoadingAction) => {\n return [\n loadRoomsForResults.request({\n ...action,\n dateTz: action.dateTz\n }),\n // loadRoomsForResultsMap.request({\n // ...action,\n // dateTz: action.dateTz\n // }),\n loadLaterThatDayResults.request({\n ...action,\n dateTz: laterThatDayFromDateTz(action.dateTz)\n }),\n loadNextDayResults.request({\n ...action,\n dateTz: nextBusinessDay(action.dateTz)\n }),\n loadDiffSizeResults.request({\n ...action,\n dateTz: action.dateTz,\n diff_capacity: true\n }),\n ];\n })\n );\n\n @Effect()\n public loadRoomsForResultsEffect = createLoadingEffect(this.actions, loadRoomsForResults,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms'));\n \n @Effect() \n public loadRoomsForResultsMapEffect = createLoadingEffect(this.actions, loadRoomsForResultsMap,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms for maps', false));\n\n @Effect()\n public loadLaterThatDayResultsEffect = createLoadingEffect(this.actions, loadLaterThatDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'laterResults'));\n\n @Effect()\n public loadNextDayResultsEffect = createLoadingEffect(this.actions, loadNextDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'nextDay'));\n\n @Effect()\n public loadDiffSizeResultsEffect = createLoadingEffect(this.actions, loadDiffSizeResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'diffSize'));\n\n @Effect()\n public loadRoomByIdResultsEffect = createLoadingEffect(this.actions, loadByIdResults,\n (action) => \n this.spaceService.available(roomByIdQueryOptionsToSpaceAvailabilityOptions(action), 'byId', false));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { roomsReducer } from './rooms.reducer';\nimport { RoomsEffects } from './rooms.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([RoomsEffects]),\n StoreModule.forFeature('rooms', roomsReducer)\n ]\n})\nexport class RoomsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { createReducer } from '@ngrx/store';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from './rooms.actions';\nimport { RoomState } from './rooms.types';\n\nexport const initialRoomsState: RoomState = {\n query: LoadingModel.empty(),\n later: LoadingModel.empty(),\n next: LoadingModel.empty(),\n byid: LoadingModel.empty(),\n size: LoadingModel.empty(),\n};\n\nexport const roomsReducer = createReducer(initialRoomsState,\n ...loadRoomsForResults.ons,\n ...loadRoomsForResultsMap.ons,\n\n ...loadLaterThatDayResults.ons,\n ...loadNextDayResults.ons,\n ...loadByIdResults.ons,\n ...loadDiffSizeResults.ons);\n","import { LoadingModel } from '../../../loading/src/lib/loading.model';\nimport {\n Building,\n DaysOfWeek,\n ISpaceAvailabilityOptions,\n RecurrencePeriod,\n Space\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface RoomStoreState {\n rooms: RoomState;\n}\n\nexport interface RoomState {\n query: LoadingModel\n later: LoadingModel\n next: LoadingModel\n byid: LoadingModel\n size: LoadingModel\n}\n\nexport interface RoomQueryOptions {\n dateTz: DateTZ;\n duration: number;\n locations: string;\n capacity?: number;\n capacity_max?: number;\n diff_capacity?: boolean;\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n bookable?: boolean;\n ignore?: string;\n}\n\nexport const roomQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n zone_ids: options.locations,\n capacity_max: options.capacity_max,\n diff_capacity: options.diff_capacity,\n /** Fields to include recurrence in the availability search */\n is_recurrent: options?.is_recurrent,\n is_multiroom: options?.is_multiroom,\n merged: options?.merged,\n recurrence_period: options?.recurrence_period,\n recurrence_interval: options?.recurrence_interval,\n recurrence_endTz: options?.recurrence_endTz,\n recurrence_count: options?.recurrence_count,\n recurrence_starts: options?.recurrence_starts,\n recurrence_days: options?.recurrence_days,\n bookable: options?.bookable,\n ignore: options?.ignore\n});\n\nexport const roomByIdQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n room_ids: options.locations,\n capacity_max: options.capacity_max\n});\n","import { Space } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport const todayFromDate = (date: number) => new DateTZ({date});\n\n/**\n * Adds 60 mins.\n */\nexport const laterThatDayFromDateTz = (dateTz: DateTZ) => {\n return dateTz.addValue({ minutes: 60 })\n};\n\n/**\n * Next business day. In most cases 1 day, but on Fridays, it follows to the monday.\n * @param date\n */\nexport const nextBusinessDay = (dateTz: DateTZ) => {\n let retDate = dateTz.addValue({ days: 1 });\n if (retDate.dateWeekday >= 6) {\n retDate = retDate.setValue({ weekday: 8 });\n }\n return retDate;\n};\n\nexport const mapRoomToSelectOption = (room?: Space): SelectOption => room ? ({\n value: room.id,\n shortDisplay: room.local_name,\n display: `${room.local_name}, ${room.level?.name}`\n}) : undefined;\n","export * from './lib/rx-utils.module';\nexport * from './lib/operators'\nexport * from './lib/loading-model.utils'\n","import {\n combineLatest,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\n\n/**\n * Generates the results count based on if data has loaded or not. If not, undefined is returned.\n * Otherwise, it'll return the count of the results.\n */\nexport const resultCountObservable = (loadingObservable: Observable>,\n resultsObservable: Observable\n): Observable => combineLatest([\n loadingObservable.pipe(map(r => r.hasLoaded())),\n resultsObservable.pipe(map(v => v?.length))\n]).pipe(map(([isLoading, viewModelLength]) => isLoading ? viewModelLength : undefined));\n","import {\n distinctUntilChanged,\n filter\n} from 'rxjs/operators';\nimport * as deepEqual from 'fast-deep-equal';\n\n/**\n * Useful for nested objects to prevent unnecessary triggers in RX chain.\n */\nexport const deepDistinctUntilChanged = () => distinctUntilChanged(deepEqual);\n\n/**\n * Won't emit if value is undefined.\n */\nexport const filterUndefined = () => filter(f => !!f);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class RxUtilsModule {}\n","export * from './lib/ui.module';\nexport * from './lib/types';\nexport * from './lib/base-template.component';\nexport * from './lib/recurrence-pattern-form/recurrence-pattern-form.component';\nexport * from './lib/recurrence-booking-form/recurrence-booking-form.component';\nexport * from './lib/conflicts-modal/conflicts-modal.component'\nexport * from './lib/override-changes-modal/override-changes-modal.component'\nexport * from './lib/date-tz-calendar-widget/date-tz-calendar-widget.component';\nexport * from './lib/date-tz-date-picker/date-tz-date-picker.component';\nexport * from './lib/date-tz-duration-field/date-tz-duration-field.component';\nexport * from './lib/date-tz-time-field/date-tz-time-field.component';\nexport * from './lib/aca-date-picker/aca-date-picker.component';\nexport * from './lib/conflict-alert-modal/conflict-alert-modal.component';\nexport * from './lib/tooltip/tooltip.enums';\nexport * from './lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nexport * from './lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n","import { Component, OnInit, Input, Output, OnChanges, SimpleChanges, forwardRef, EventEmitter } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDatePickerOptions {\n /** Unix timestamp with millisecond. First selectable date */\n from?: number;\n /** Unix timestamp with millisecond. Last selectable date */\n to?: number;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: number;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'aca-date-picker',\n templateUrl: './aca-date-picker.component.html',\n styleUrls: ['./aca-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AcaDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class AcaDatePickerComponent implements OnInit, OnChanges, ControlValueAccessor {\n /** CSS class to add to the root element of the component */\n @Input() public klass = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDatePickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n /** Display the last selected day as active */\n @Input() public show_last_selection?: boolean = true\n\n public date: number = DateNow(new Date()).ms;\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private from: DateTZ;\n /** Last selectable date */\n private to: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n /** ID of the timer used for changing the month */\n private _change_timer: number;\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.date = item.value;\n if (this._onChange) {\n this._onChange(this.date);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date\n */\n public updateDate(): void {\n \n if (!this.date) {\n return;\n }\n const now = DateNow(new Date()).startOfValue('month');\n const date_ = new DateTZ({date: this.date})\n const date = date_.startOfValue('month');\n if (date.valid) {\n const difference = date.dateDiff(now, 'months', 'months');\n if (this.offset !== difference) {\n this.offset = difference;\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.from) {\n const date_ = new DateTZ({date: this.options.from})\n this.from = date_.startOfValue('day');;\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.from.startOfValue('month');\n this.min_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.from) {\n this.from = null;\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.to) {\n const date_ = new DateTZ({date: this.options.to})\n this.to = date_.startOfValue('day');\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.to.startOfValue('month');\n this.max_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.to) {\n this.to = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n if (!this.date) {\n return;\n }\n const date = DateNow(new Date()).addValue({ months : this.offset });\n const active = new DateTZ({date: this.date});\n let start = date.setValue({ day: 1 }).setValue({ weekday: 7 }).subtractValue({ weeks: 1 });\n const end_ = new DateTZ({date: start.ms})\n const end = end_.addValue({ weeks: 1 }).endOfValue('month').addValue({ days: 2 }).endOfValue('week');\n this.date_list = [];\n while (start.isBeforeDate(end) || start.isSameDate(end, 'day')) {\n this.date_list.push({\n value: start.ms,\n display: start.formatDate('d'),\n active: this.show_last_selection && active.isSameDate(start, 'day'),\n non_month: !date.isSameDate(start, 'month'),\n count: this.counters ? this.counters[start.formatDate('yyyy-MM-dd')] || 0 : 0,\n disabled: (this.from ? start.isBeforeDate(this.from, 'day') : false) || (this.to ? start.isAfterDate(this.to, 'day') : false),\n today: DateNow(new Date()).isSameDate(start, 'day')\n });\n start = start.addValue({ days : 1 });\n }\n this.month_name = date.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = DateNow(new Date()).startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days : 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n if (this._change_timer) {\n clearTimeout(this._change_timer);\n }\n this._change_timer = setTimeout(() => {\n const new_offset = this.offset + value;\n const now = DateNow(new Date())\n const date = now.addValue({ months : new_offset, days: now.dateMonth === 2 ? 2 : 0 }); //add 2 days if month is february to avoid calc errors\n if (this.from && date.isBeforeDate(this.from, 'month')) { return; }\n if (this.to && date.isAfterDate(this.to, 'month')) { return; }\n this.offset = new_offset;\n this.month.emit(this.offset);\n this.generateMonth();\n this._change_timer = null;\n }, 100);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const date = new DateTZ({date: this.date});\n const offset = this.offset;\n this.offset = DateNow(new Date()).dateDiff(date, 'months', 'months');\n if (offset !== this.offset) {\n this.generateMonth();\n }\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.updateDate();\n this.generateMonth();\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n
\n
\n
\n
\n
{{month_name}}
\n
= max_offset\" (click)=\"changeMonth(1)\" (touchend)=\"changeMonth(1)\">\n
\n
\n
\n
\n
{{item}}
\n
\n
\n
\n
\n {{item.display}}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nexport enum AlertMode {\n Warning = 'warning',\n Coachmark = 'coachmark',\n BlueCoachmark = 'blue-coachmark',\n Error = 'error'\n}\n\nexport enum AlertBannerDisplay {\n /**\n * New UI\n */\n V2 = 'v2',\n\n /**\n * Default, legacy ui.\n */\n V1 = 'v1',\n}\n\n@Component({\n selector: 'mck-alert-banner',\n template: `\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n `,\n styleUrls: ['./alert-banner.component.scss']\n})\nexport class AlertBannerComponent implements OnInit, OnChanges {\n\n @Input()\n public mode: AlertMode = AlertMode.Warning;\n\n @Output()\n public close = new EventEmitter();\n\n @Output()\n public action = new EventEmitter();\n\n @Input()\n public message: string;\n\n @Input()\n public buttonText: string;\n\n @Input()\n public showClose = true;\n\n @Input()\n public display: AlertBannerDisplay = AlertBannerDisplay.V1;\n\n public iconPath: string = 'assets/icon/warning-yellow.svg';\n public materialColor: string = 'black';\n public closeIcon: string = 'close_outline.svg';\n\n public ngOnInit(): void {\n this._onModeChange();\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.mode) {\n this._onModeChange();\n }\n }\n\n private _onModeChange() {\n this.iconPath = 'assets/icon/warning-yellow.svg';\n this.closeIcon = 'close_outline.svg';\n switch (this.mode) {\n case AlertMode.Warning:\n this.materialColor = 'black';\n break;\n case AlertMode.Coachmark:\n this.materialColor = 'coachmark';\n this.closeIcon = 'close_outline_coachmark.svg';\n break;\n case AlertMode.BlueCoachmark:\n this.iconPath = 'assets/icon/info-bg-dark.svg'\n this.materialColor = 'blue-coachmark'\n break;\n case AlertMode.Error:\n this.iconPath = 'assets/img/error-icon.svg'\n this.materialColor = 'white'\n break;\n default:\n this.materialColor = 'black';\n }\n }\n\n}\n","import {\n Component,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n Self,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NgControl\n} from '@angular/forms';\nimport { SelectOption } from '../types';\nimport {\n BehaviorSubject,\n combineLatest,\n from,\n Subject\n} from 'rxjs';\nimport {\n COMMA,\n ENTER\n} from '@angular/cdk/keycodes';\nimport { MatChipInputEvent } from '@angular/material/chips';\nimport {\n distinctUntilChanged,\n map,\n take\n} from 'rxjs/operators';\nimport { MatCheckboxChange } from '@angular/material/checkbox';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'mck-autocomplete-chip-select-item',\n template: `\n
\n \n {{label}}\n \n
\n \n
\n
\n \n
\n \n
\n \n
\n
\n
\n \n \n \n \n {{selected.shortDisplay}}\n close\n \n \n \n \n
\n \n \n {{option.dropdownOverride || option.display}}\n \n \n
\n
\n \n Clear\n \n \n Confirm\n \n
\n \n \n {{errorMessage}}\n
\n `,\n styleUrls: ['./auto-complete-chip-select-item.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class AutoCompleteChipSelectItemComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor, OnDestroy {\n\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n @ViewChild('componentInput')\n componentInput: HTMLInputElement;\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n feedbackInput?: boolean;\n\n @Input()\n loading?: boolean;\n\n @Input()\n placeHolder: string;\n\n @Input()\n options: Subject[]>;\n\n @Input()\n selectedOptions: Subject[]>;\n\n @Input()\n useCTAs?: boolean;\n\n @Output()\n optionSelected = new EventEmitter>();\n\n @Output()\n feedbackOutput = new EventEmitter();\n\n @Output()\n chipsCleared: EventEmitter = new EventEmitter();\n\n @Output()\n onClickConfirm: EventEmitter = new EventEmitter();\n\n /**\n * If true, only allow 1 group at a time to get selected. Show others as disabled.\n */\n @Input()\n selectOnlyOneGroup = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input() public localFilter: boolean = true;\n\n /**\n * If error exists, a message.\n */\n @Input()\n errorMessage?: string;\n\n @Input()\n hideDropdownCarret?: boolean;\n\n @Input()\n displayCTA?: boolean;\n\n private selectOnlyOneGroupChange = new BehaviorSubject(false);\n\n separatorKeysCodes = [ENTER, COMMA];\n\n public filterFormControl: FormControl = new FormControl();\n\n public focused = false;\n public mobileFullScreen = false;\n\n public autocompleteOptions = new BehaviorSubject[]>([]);\n public filteredAutocompleteOptions = new BehaviorSubject[]>([]);\n\n /** List shown to user, filters children if a group header is added **/\n public chipOptions = new BehaviorSubject[]>([]);\n\n /** Form control on change handler */\n private _onChange?: (_: SelectOption[]) => void;\n /** Form control on touch handler */\n private _onTouch?: (_: string) => void;\n\n private value = new BehaviorSubject[]>([]);\n\n public enableCTAs: boolean = false\n\n public hasChips: boolean = false;\n\n constructor(@Self() @Optional() private control: NgControl) {\n super();\n if (this.control) {\n this.control.valueAccessor = this;\n }\n }\n\n public get invalid(): boolean {\n return this.control ? this.control.invalid : false;\n }\n\n public get showError(): boolean {\n if (!this.control) {\n return false;\n }\n\n const { dirty, touched } = this.control;\n\n return this.invalid ? (dirty && touched) : false;\n }\n\n public iconFillClass(color?: string): string {\n return color === 'external' ? 'mck-icon-fill-gray' : 'mck-icon-fill-white'\n }\n\n ngOnInit() {\n this.subscription('autoCompleteOptions', combineLatest([\n this.options,\n this.selectedOptions,\n this.selectOnlyOneGroupChange\n ])\n .pipe(\n map(([options, selectedOptions, selectOnlyOneGroup]) => {\n this.hasChips = !!selectedOptions.length;\n return options.map(option => {\n const selected = !!selectedOptions.find(s => s.value === option.value);\n let enabled = true;\n if (selectOnlyOneGroup) {\n // find first group item in selection\n const selectedGroupHeader = selectedOptions.find(s => s.groupHeader || s.groupId === option.groupId);\n\n // if no options chosen, enable it, otherwise only allow selections from other options.\n enabled =\n selectedOptions.length === 0 ||\n (selectedGroupHeader ? selectedGroupHeader.groupId === option.groupId : false);\n this.enableCTAs = selectedOptions.length !== 0\n }\n\n return {\n ...option,\n enabled,\n selected\n } as SelectOption;\n });\n })\n ).subscribe(next => {\n const options = next.sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n this.autocompleteOptions.next(options);\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(this.filterFormControl.value?.trim()));\n }));\n this.subscription('filterFormControlChanges',\n this.filterFormControl.valueChanges.subscribe(value => {\n if (this.localFilter && value.length) {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(value));\n } else {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions());\n }\n }));\n this.subscription('chipOptions', this.selectedOptions\n .pipe(map(selectedOptions => {\n // find group headers and check if children are part of that group.\n // if part of group, filter them out as redundant.\n const groupHeaders = selectedOptions.filter(s => s.groupHeader) || [];\n return selectedOptions.filter(s => s.groupHeader || s.groupChild && !(groupHeaders.find(g => g.groupId === s.groupId)));\n }))\n .subscribe(next => {\n this.chipOptions.next(next);\n }));\n\n this.subscription('formData', this.selectedOptions\n .pipe(map(selected => {\n // group headers always contain children, so only pick out children for data\n return selected;\n }))\n .subscribe(next => {\n this.value.next(next);\n }));\n\n // tie value changes to change.\n this.subscription('valueChanges', this.value\n .pipe(distinctUntilChanged())\n .subscribe(next => {\n if (this._onChange) {\n // rewrote this to avoid read only error\n const values = [];\n next.forEach((v, i) => {\n const value = { ...v };\n if (v.meta?.user) {\n value.display = v.meta.user.name;\n }\n values.push(value);\n });\n this._onChange(values);\n }\n }));\n\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n getFilteredAutocompleteOptions(searchString: string = '') {\n // Exact matches of the groupId or display value\n const exactMatches = this.autocompleteOptions.value.filter(o => {\n if (searchString && searchString.length) {\n return o.groupId.toLowerCase().indexOf(searchString.toLowerCase()) === 0 || o.display.toLowerCase().indexOf(searchString.toLowerCase()) === 0;\n }\n return o.groupId && o.display;\n });\n // Fuzzier search of the dropdownOverride field\n const moreOptions = this.autocompleteOptions.value.filter(o => {\n if (o?.dropdownOverride?.length && searchString) {\n const match = o.dropdownOverride?.toLowerCase().indexOf(searchString.toLowerCase()) > -1;\n // only return found locations that don't exist in exactMatches.\n return match && !exactMatches.find(e => {\n return e.value === o.value\n });\n }\n return false;\n });\n\n // Merge the two result sets\n let joinedOptions = exactMatches.concat(moreOptions).sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n\n // Create a 1D array of the groupId\n const groupIds = joinedOptions.map(o => o.groupId);\n // Get a deduped list of the group parents\n const parents = this.autocompleteOptions.value.filter(o => {\n return o?.groupHeader && groupIds.indexOf(o.groupId) !== -1;\n });\n\n // Remove the parents from the joinedOptions and merge with the reduced parents set, and then sort by groupId.\n // Resulting array sets the parents first in order so the widget renders properly.\n const filteredAutocompleteOptions = parents.concat(joinedOptions.filter(jo => !!jo.dropdownOverride)).sort((a, b) => {\n return b.groupId > a.groupId ? -1 : 1;\n });\n return filteredAutocompleteOptions;\n }\n\n loseFocus(): void {\n this.mobileFullScreen = false;\n this.focused = false;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selectOnlyOneGroup) {\n this.selectOnlyOneGroupChange.next(this.selectOnlyOneGroup);\n }\n }\n\n keyedInput(matInput: string) {\n if (this.feedbackInput) {\n this.feedbackOutput.emit(matInput);\n }\n }\n\n selectOption(value: string) {\n this.options.pipe(\n take(1),\n map((options: SelectOption[]) => options.find(o => o.value === value))\n ).subscribe(next => {\n if (next) {\n this.optionSelected.emit(next);\n }\n });\n }\n\n removeOption(value: SelectOption) {\n this.optionSelected.emit(value);\n if (this.useCTAs) {\n this.onClickConfirm.emit();\n }\n\n }\n\n clearSelections() {\n this.selectedOptions.next([]);\n this.chipsCleared.emit();\n }\n\n onClickArrow() {\n // only close events we allow arrow to close panel.\n if (this.focused) {\n this.onFocus(false);\n }\n }\n\n onPanelFocusChange(focusIn: boolean) {\n this.onFocus(focusIn, true);\n }\n\n onFocus(focusIn: boolean, fromPanel?: boolean) {\n if (!focusIn && this.useCTAs) {\n this.onClickConfirm.emit();\n }\n // Only for location input???\n if (this.localFilter && fromPanel && focusIn) {\n // open on focus, mobile needs a refocus\n this.mobileFullScreen = true;\n this.timeout('showDefaults', () => {\n // All results do not show as expected unless I focus again.\n // Something about the mobile styles.\n this.onFocus(true);\n }, 100)\n }\n\n if (this.feedbackInput && !fromPanel) {\n // clear input when input creates options\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n this.feedbackOutput.emit('');\n }\n\n if (this.focused !== focusIn) {\n this.focused = focusIn;\n // clear on close\n if (!focusIn) {\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n }\n if (!fromPanel) {\n if (focusIn) {\n this.trigger.openPanel();\n } else {\n this.trigger.closePanel();\n // close the mobile full screen\n this.loseFocus();\n }\n }\n }\n }\n\n onChanged(value: SelectOption, event: MatCheckboxChange) {\n this.optionSelected.emit(value);\n }\n\n add(event: MatChipInputEvent) {\n // reset\n if (event.input) {\n event.input.value = '';\n }\n this.filterFormControl.setValue('');\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n // TODO: disabled not implemented yet.\n this.disabled = isDisabled;\n }\n\n writeValue(obj: SelectOption[] | undefined): void {\n // update selected options when this value is written\n this.options?.pipe(\n take(1),\n map((options: SelectOption[]) => {\n return options.filter(o => obj ? !!obj.find(spl => o.value === spl.value) : false );\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null && !event.srcElement.classList.contains('mat-form-field-autofill-control')) {\n this.onFocus(false);\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n}\n\n\n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\nimport { SelectOption } from '../types';\n\n/**\n * Patch orphaned SelectOption children into acting as their own group headers.\n *\n * This intends to help in the common scenario where filters have (for whatever\n * reason) prevented the child's usual group header from appearing.\n */\n@Pipe({\n name: 'groupHeaderPatch',\n})\nexport class GroupHeaderPipe implements PipeTransform {\n transform(items: SelectOption[]): SelectOption[] {\n if (!items) {\n return [];\n }\n\n return items.map(v => {\n const hasHeader = !!items.find(i => i.groupHeader && i.groupId === v.groupId);\n return {\n ...v,\n displayAsHeader: !hasHeader,\n }\n })\n }\n\n}\n","import { Component, Input, Output, forwardRef, SimpleChanges, OnChanges, OnInit, EventEmitter, ViewChild, OnDestroy } from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\nimport {\n BehaviorSubject\n} from 'rxjs';\n\n/**\n * @title Autocomplete filtering select of a single option via text search.\n */\n@Component({\n selector: 'mck-autocomplete-select-option',\n templateUrl: 'auto-complete-select-option.component.html',\n styleUrls: ['auto-complete-select-option.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AutoCompleteSelectOptionComponent),\n multi: true\n }\n ],\n})\nexport class AutoCompleteSelectOptionComponent implements OnInit, OnChanges, ControlValueAccessor, OnDestroy{\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n @Input()\n public resetInput: number | undefined;\n\n @Input()\n public placeholder: string;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Output()\n public filteredOptionsChange = new EventEmitter[]>();\n\n @Output()\n public inputTextChange = new EventEmitter();\n\n @Output() emptyBoxEvent = new EventEmitter();\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n filterFormControl = new FormControl();\n filteredOptions: Observable[]>;\n\n /** The selected value */\n public value = new BehaviorSubject('');\n\n /** Available options to search / select from */\n public _options = new BehaviorSubject[]>(this.options);\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n ngOnInit() {\n this.updateFilteredOptions();\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n // Watch and apply changes from the parent component.\n if (changes.options || changes.selectedValue) {\n if (changes.options && !changes.selectedValue) {\n this.filterFormControl.setValue('')\n }\n this.updateFilteredOptions();\n }\n if (changes.resetInput) {\n this.filterFormControl.setValue('');\n this.updateFilteredOptions();\n }\n \n }\n\n private updateFilteredOptions() {\n this.filteredOptions = this.filterFormControl.valueChanges\n .pipe(\n startWith(''),\n map(value => typeof value === 'string' ? value : value && value?.display ? value.display : ''),\n map(name => name ? this._filter(name) : this.options.slice())\n );\n }\n\n displayFn(data: SelectOption): string {\n return data && data?.display ? data.display : '';\n }\n\n private _filter(display: string): SelectOption[] {\n const filterValue = display.toLowerCase();\n // return all the matches found\n const filtered = this.options.filter(option => {\n // split this input and index both, if both\n // match return true.\n if (filterValue.includes(' ')) {\n const filterValues =filterValue.split(' ');\n let matchesAll = true;\n for (let x = 0; x < filterValues.length; x++) {\n if (option.display.toLowerCase().indexOf(filterValues[x]) === -1) {\n matchesAll = false;\n }\n }\n if (matchesAll) {\n return true;\n }\n }\n // match the whole string\n return option.display.toLowerCase().indexOf(filterValue) > -1;\n });\n this.inputTextChange.emit(filterValue);\n this.filteredOptionsChange.emit(filtered);\n return filtered;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: SelectOption): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value.value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n public onChangeInput() {\n if (this.filterFormControl.value === '') {\n this.emptyBoxEvent.emit(true);\n }\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null ) {\n this.trigger.closePanel();\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n\n}","
\n {{label}}\n \n \n \n \n {{option.shortDisplay || option.display}}\n \n \n \n
","import {\n AfterViewInit,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n/**\n * A helper class for rendering embedded views (ng-template) as standalone components.\n *\n * If the view is lazy and does not render upon initialization,\n * it attempts embedding view again later.\n *\n * When testing a component directly that extends this class, its best to wrap the component\n * in a wrapper component for testing so that it can render itself.\n */\nexport class BaseTemplateComponent extends BaseDirective implements AfterViewInit, OnInit, OnDestroy {\n @ViewChild(TemplateRef, { static: true })\n public template: TemplateRef;\n\n private isRendered = false;\n\n constructor(private vcRef: ViewContainerRef) {\n super();\n }\n\n public ngOnInit(): void {\n // try early rendering\n this.attemptViewEmbed();\n }\n\n public attemptViewEmbed() {\n if (this.template && !this.isRendered) {\n this.isRendered = true;\n this.vcRef.createEmbeddedView(this.template);\n return true;\n }\n return false;\n }\n\n public ngAfterViewInit(): void {\n if (!this.isRendered) {\n console.log('View not rendered yet, attempting to post initialization');\n setTimeout(() => {\n console.log('Timeout ended, trying again', this.template);\n if (!this.attemptViewEmbed()) {\n console.log('Attempting render in after view initialization');\n setTimeout(() => {\n if (!this.attemptViewEmbed()) {\n console.error('FAILED TO LOAD TEMPLATE');\n }\n }, 1000);\n }\n });\n }\n }\n\n public ngOnDestroy(): void {\n super.ngOnDestroy();\n this.isRendered = false;\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'catering-drop-modal',\n templateUrl: './catering-drop-modal.component.html',\n styleUrls: ['./catering-drop-modal.component.scss']\n})\nexport class CateringDropComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onConfirm(): void {\n this.dialogRef.close(true);\n}\n\nonCancel(): void {\n this.dialogRef.close(false);\n}\n}\n","
\n

Catering conflict

\n
\n\n
\n
\n

New proposed meeting time is outside catering hours. Proceed without catering?

\n
\n
\n
\n\n
\n \n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input\n } from \"@angular/core\";\n import { DropdownPanel } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select-options\",\n templateUrl: \"./cng-select-options.component.html\",\n styleUrls: [\"./cng-select-options.component.scss\"]\n })\n export class CngSelectOptionsComponent implements DropdownPanel {\n @ViewChild(TemplateRef) templateRef: TemplateRef;\n @Output() closed = new EventEmitter();\n @Input() ddWidth: string;\n \n constructor() {}\n }\n ","\n
\n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input,\n OnInit\n } from \"@angular/core\";\n import { DropdownPanel, DropdownOpion } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select\",\n templateUrl: \"./cng-select.component.html\",\n styleUrls: [\"./cng-select.component.scss\"]\n })\n export class CngSelectComponent implements OnInit {\n @Input() data: any;\n public isClosed: boolean = false;\n public selected: DropdownOpion;\n constructor() {\n\n }\n ngOnInit(): void {\n this.selected = this.data.defaultSelected;\n }\n\n public optionSelected(item: DropdownOpion) {\n // this.selected = item;\n this.data.defaultSelected = item;\n this.data?.onChangeCallback && this.data?.onChangeCallback(item);\n }\n }\n ","\n\n
\n {{data?.defaultSelected?.display}}\n
\n \n
\n
\n\n
{{item?.display}}
\n
","import {\n AfterViewInit,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n ViewContainerRef\n } from '@angular/core';\n import { DropdownPanel } from './dropdown-panel';\n import { Overlay, OverlayRef } from '@angular/cdk/overlay';\n import { TemplatePortal } from '@angular/cdk/portal';\n import { merge, Observable, Subscription } from 'rxjs';\n \n @Directive({\n selector: '[dropdownTriggerFor]',\n host: {\n '(click)': 'toggleDropdown()'\n }\n })\n export class DropdownTriggerForDirective implements OnDestroy, AfterViewInit, OnInit {\n private isDropdownOpen = false;\n private overlayRef: OverlayRef;\n private dropdownClosingActionsSub = Subscription.EMPTY;\n \n @Input('dropdownTriggerFor') public dropdownPanel: DropdownPanel;\n @Output() isPanelOpened = new EventEmitter();\n constructor(\n private overlay: Overlay,\n private elementRef: ElementRef,\n private viewContainerRef: ViewContainerRef,\n private renderer: Renderer2\n ) {\n \n }\n ngOnInit(): void {\n // const cngSelectEl = this.elementRef.nativeElement.nextElementSibling; \n // const parentWidth = this.elementRef.nativeElement.offsetWidth; \n // this.renderer.setStyle(cngSelectEl, 'width', `${parentWidth}px`);\n }\n ngAfterViewInit(): void {\n \n }\n\n \n toggleDropdown(): void {\n this.isDropdownOpen ? this.destroyDropdown() : this.openDropdown();\n \n }\n \n openDropdown(): void {\n let {ddWidth} = this.dropdownPanel;\n this.dropdownPanel.ddWidth = ddWidth !=='' ? ddWidth : `${this.elementRef.nativeElement.offsetWidth}px`;\n this.isDropdownOpen = true;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.close(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions([\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8\n }\n ])\n });\n \n const templatePortal = new TemplatePortal(\n this.dropdownPanel.templateRef,\n this.viewContainerRef\n );\n this.overlayRef.attach(templatePortal);\n \n this.dropdownClosingActionsSub = this.dropdownClosingActions().subscribe(\n () => this.destroyDropdown()\n );\n }\n \n private dropdownClosingActions(): Observable {\n const backdropClick$ = this.overlayRef.backdropClick();\n const detachment$ = this.overlayRef.detachments();\n const dropdownClosed = this.dropdownPanel.closed;\n \n return merge(backdropClick$, detachment$, dropdownClosed);\n }\n \n private destroyDropdown(): void {\n if (!this.overlayRef || !this.isDropdownOpen) {\n return;\n }\n \n this.dropdownClosingActionsSub.unsubscribe();\n this.isDropdownOpen = false;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef.detach();\n }\n \n ngOnDestroy(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n }\n }\n }\n ","import {\n Component,\n Input,\n OnInit,\n OnDestroy,\n ViewChild,\n AfterViewInit,\n Output,\n EventEmitter\n} from '@angular/core';\nimport { MatExpansionPanel } from '@angular/material/expansion';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { CollapseService } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'mck-collapse-header',\n template: `\n \n \n {{title}} \n
\n
\n \n
\n \n
\n
\n {{description}}\n \n \n \n \n `,\n styleUrls: ['./collapse-header.component.scss'],\n})\nexport class CollapseHeaderComponent implements OnInit, OnDestroy {\n\n @Input() title: string;\n @Input() description: string;\n @Input() isLoading = false;\n @Input() expandedIds: string[] = [];\n @Output() updateSectionIdOnOpen = new EventEmitter<{ status: string, id: string }>(); // Emit the id of the opened result section\n\n @ViewChild('expansionPanel') expansionPanel: MatExpansionPanel;\n\n public isExpanded = new BehaviorSubject(false);\n private collapseSubscription: Subscription;\n\n constructor(private collapseService: CollapseService) {}\n\n ngOnInit(): void {\n this.collapseSubscription = this.collapseService.collapse$.subscribe(() => {\n if (this.expansionPanel) {\n this.expansionPanel.close(); // Close the panel\n }\n });\n }\n\n // Update opened section id and emit the id of the opened result section to the parent component \n public updateOpenedSectionId(isOpen: string) {\n this.updateSectionIdOnOpen.emit({ status: isOpen, id: this.expandedTitleId });\n }\n\n\n \n /**\n * Gets the expanded title as an id by removing parentheses and replacing spaces with underscores.\n * @returns The expanded title.\n */\n public get expandedTitleId(): string {\n return this.title?.split('(')[0]?.split(' ')?.join('_') ;\n }\n\n ngOnDestroy(): void {\n this.collapseSubscription.unsubscribe();\n }\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nexport interface RoomAvaibilityModalData {\n\theaderText: string,\n\tmessage: string,\n\tbuttonLabel: string,\n\tcallback: Function,\n shouldClose: boolean\n}\n\n@Component({\n selector: 'conflict-alert-modal',\n templateUrl: 'conflict-alert-modal.component.html',\n styleUrls: ['./conflict-alert-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConflictAlertModalComponent implements OnInit {\n constructor(public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public dialogData: RoomAvaibilityModalData) {\n }\n ngOnInit(): void {}\n\n public done() {\n this.dialogData?.callback(); this.dialogRef.close()\n }\n}\n","
\n \n
\n\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{dialogData?.headerText}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{dialogData?.message}}
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\t\t \n\t\t\t\n
","import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {DialogEvent} from '@mckinsey-converge/base';\nimport {DateTZ, isToday} from '@mckinsey-converge/date-tz';\n\nexport interface ConflictsModalComponentData {\n room_name: string;\n conflicts: number[];\n copy_conflicts?: boolean;\n timezone: string;\n status?: string;\n}\n\n@Component({\n selector: 'app-conflicts-modal',\n templateUrl: './conflicts-modal.component.html',\n styleUrls: ['./conflicts-modal.component.scss']\n})\nexport class ConflictsModalComponent implements OnInit{\n public room_name: string;\n public conflicts: number[];\n public copy_conflicts: boolean;\n public timezone;\n public status: string;\n\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: ConflictsModalComponentData){\n\n }\n\n public ngOnInit(){\n this.timezone = this._data.timezone;\n this.room_name = this._data.room_name\n this.conflicts = this._data.conflicts\n this.copy_conflicts = this._data.copy_conflicts\n this.status = this._data.status\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone});\n const dateIsToday = isToday(dateTZ, this.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n\n public copy(): void {\n this.event.emit({ reason: 'action' });\n }\n\n\n}\n","
\n \n
\n\n
\n

Conflicts ({{conflicts.length}})

\n
\n The {{room_name}} room is not available on the following dates.\n Do you want to proceed without booking these days?\n
\n
\n The {{room_name}} room is not available on the following dates.\n You need to make individual bookings to cover these days, please.\n
\n
\n
\n
\n Date\n
\n
\n
\n {{formatDate(conflict)}}\n
\n
\n
\n
\n\n \n {{copy_conflicts ? 'Copy to clipboard' : 'Close'}}\n \n \n {{copy_conflicts ? 'Close' : 'Continue'}}\n \n\n","import { Component, OnInit, Inject } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'custom-snackbar',\n templateUrl: './custom-snackbar-component.component.html',\n styleUrls: ['./custom-snackbar-component.component.scss'],\n})\nexport class CustomSnackbarComponent implements OnInit {\n constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any) {\n }\n\n ngOnInit() {}\n\n get getIcon() {\n switch (this.data.snackType) {\n case 'success':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-success.svg',\n };\n case 'error':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-failure.svg',\n };\n case 'warn':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-warning.svg',\n };\n case 'info':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-info.svg',\n };\n default:\n return { type: 'info', iconPath: 'assets/icon/toast-info.svg' };\n }\n }\n\n closeSnackbar() {\n this.data.snackBar.dismiss();\n }\n}\n","
\n
\n
\n \"{{getIcon.type}}\n
\n
\n {{data.message}}\n
\n
\n
\n
close
\n
\n
","import { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { CustomSnackbarComponent } from './custom-snackbar-component.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarService {\n messageText: string[];\n constructor(public snackBar: MatSnackBar) {}\n\n public openSnackBar(\n message,\n type,\n duration?,\n verticalPosition?,\n horizontalPosition?\n ) {\n const _snackType = type !== undefined ? type : 'success';\n this.snackBar.openFromComponent(CustomSnackbarComponent, {\n duration: duration || 4000,\n horizontalPosition: horizontalPosition || 'end',\n verticalPosition: verticalPosition || 'top',\n data: {\n message: message,\n snackType: _snackType,\n snackBar: this.snackBar,\n },\n });\n }\n}\n","import {\n Component,\n OnInit,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n forwardRef,\n EventEmitter,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDateTzPickerOptions {\n /** DateTZ object. First selectable date */\n fromDateTz?: DateTZ;\n /** DateTZ object. Last selectable date */\n untilDateTz?: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: DateTZ;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'date-tz-calendar-widget',\n templateUrl: './date-tz-calendar-widget.component.html',\n styleUrls: ['./date-tz-calendar-widget.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzCalendarWidgetComponent),\n multi: true,\n },\n ],\n})\nexport class DateTzCalendarWidgetComponent\n extends BaseClass\n implements OnInit, OnChanges, ControlValueAccessor\n{\n /** CSS class to add to the root element of the component */\n @Input() public className = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDateTzPickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n\n public readonly weeks = new Array(6).fill(0);\n public selectedDateTz: DateTZ = DateNow();\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private fromTz: DateTZ;\n /** Last selectable date */\n private toTz: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n private _today = DateNow();\n\n public get timezone() {\n return this.selectedDateTz?.building_tz || '';\n }\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.selectedDateTz = item.value;\n if (this._onChange) {\n this._onChange(this.selectedDateTz);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date 2\n */\n public updateDate(): void {\n if (!this.selectedDateTz) {\n return;\n }\n const now = this._today.startOfValue('month');\n const startOfMonthDateTz = this.selectedDateTz.startOfValue('month');\n if (startOfMonthDateTz.valid) {\n const difference = startOfMonthDateTz.dateDiff(\n now,\n 'months',\n 'months'\n );\n if (this.offset !== difference) {\n this.offset = Math.round(difference);\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.fromDateTz) {\n const today = this._today.startOfValue('month');\n this.fromTz = this.options.fromDateTz.startOfValue('day');\n this.min_offset = Math.round(\n this.fromTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months')\n );\n } else if (this.fromTz) {\n this.fromTz = null; // R-- check if ok\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.untilDateTz) {\n const today = this._today.startOfValue('month');\n this.toTz = this.options.untilDateTz.startOfValue('day');\n this.max_offset = this.toTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months');\n } else if (this.toTz) {\n this.toTz = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n this._today = new DateTZ({ date: Date.now(), is_local_tz: !this.timezone, building_tz: this.timezone });\n const startOfMonthDateTz = this._today.addValue({ months: this.offset });\n const active = this.selectedDateTz || DateNow();\n let startDate = startOfMonthDateTz\n .setValue({ day: 1 })\n .setValue({ weekday: 7 })\n .subtractValue({ weeks: 1 });\n this.date_list = [];\n for (let i = 0; i < 42; i++) {\n this.date_list.push({\n value: startDate,\n display: startDate.formatDate('d'),\n active: active.isSameDate(startDate, 'day'),\n non_month: !startOfMonthDateTz.isSameDate(startDate, 'month'),\n count: this.counters\n ? this.counters[startDate.formatDate('yyyy-MM-dd')] || 0\n : 0,\n disabled:\n (this.fromTz ? startDate.ms < this.fromTz.ms : false) ||\n (this.toTz ? startDate.ms > this.toTz.ms : false),\n today: this._today.isSameDate(startDate, 'day'),\n });\n startDate = startDate.addValue({ days: 1 });\n }\n this.month_name = startOfMonthDateTz.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = this._today.startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days: 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n const new_offset = Math.min(\n this.max_offset,\n Math.max(this.min_offset, this.offset + value)\n );\n this.offset = Math.round(new_offset);\n this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const offset = this.offset;\n this.offset = Math.round(\n this._today.dateDiff(this.selectedDateTz, 'months', 'months')\n );\n if (offset !== this.offset) this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: DateTZ) {\n if (value) {\n this.selectedDateTz = value;\n this.updateDate();\n this.generateMonth();\n }\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n}\n","
\n
\n \n
\n \n
{{ month_name }}
\n = max_offset\"\n (click)=\"changeMonth(1)\"\n >\n
\n \n
\n \n \n \n \n \n \n \n \n \n
{{ item }}
\n \n {{ item.display }}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTzCalendarWidgetComponent } from '../date-tz-calendar-widget/date-tz-calendar-widget.component';\n\n@Component({\n selector: 'date-tz-date-picker',\n template: `\n \n {{label}}\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./date-tz-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class DateTzDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n @Input() public label?: string;\n /** Earliest date available the user is allowed to pick */\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n /** Latest date available the user is allowed to pick */\n @Input() public untilDateTz: DateTZ = DateNow(new Date()).endOfValue('day').addValue({ years: 1 });\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n // R-- possible TODO, address all_day that disables this input and displays \"Add Day for the value like the time picker\"\n @Input() public all_day: boolean = false;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public counters: any;\n\n @Input() public initialDateSelectionTz?: DateTZ;\n\n @Output() public onSelect = new EventEmitter();\n\n @Input() public invalid?: boolean;\n\n @Input() public timezone?: string;\n\n @Input() public can_pick_today: boolean = true;\n\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n\n public ngOnInit(): void {\n if (this.initialDateSelectionTz) {\n this.writeValue(this.initialDateSelectionTz)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(DateTzCalendarWidgetComponent, {static: true }) private _acaDatePicker: DateTzCalendarWidgetComponent;\n /** Currently selected date */\n public selectedDateTzValue = new BehaviorSubject(DateNow(new Date()));\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(new DateTZ({ is_local_tz: false, building_tz: d.building_tz }), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n // date\n public get dateTzObservable(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n return d \n }));\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(newValueTz: DateTZ) {\n // Keep hours and minutes of the old date\n const old_date = this.selectedDateTzValue.value;\n let newDateTz = newValueTz.setValue({ hour: old_date.dateHour, minute: old_date.minutes, second: old_date.second });\n\n // Check that new date is before from\n if (newDateTz.ms < this.fromDateTz.ms) {\n newDateTz = this.fromDateTz;\n }\n\n this.selectedDateTzValue.next(newDateTz);\n if (this._onChange) {\n this._onChange(newDateTz);\n }\n\n this.onSelect.emit(newDateTz);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n const building_tz = this.timezone || this.fromDateTz.building_tz\n const is_local_tz = DateNow(new Date()).building_tz === building_tz\n this.setValue(new DateTZ({ is_local_tz, building_tz }));\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(selectedDateTz: DateTZ) {\n this.selectedDateTzValue.next(selectedDateTz);\n this.show_tooltip = false;\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n DurationGroup,\n nearestDurationToInput,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators'; \nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'date-tz-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DateTzDurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input() public label?: string;\n @Input() public required: boolean;\n @Input() max_length?: number;\n\n // /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDateTz: DateTZ;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Whether form all_day is enabled. */\n // R-- need to address all_day that disables this input and displays \"Add Day for the value\"\n @Input() public all_day: boolean = false;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** Component will return a number of minutes */\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDateTz = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDateTz]).pipe(\n \n map(([value, currentStartDate]) => { \n /**\n * convert current start date/time to building time zone first\n * \n */\n const ms = convertTimezonedTimestampToLocalDateTz(currentStartDate.ms, currentStartDate.building_tz).ms;\n return nearestDurationToInput(this.durationGroups, ms, value); \n }\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDateTz.pipe(\n map(d => generateDurationOptionsFromGroups(d, this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDateTz.value, this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDateTz) {\n this.currentStartDateTz.next(changes.startDateTz.currentValue);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n nearestStepToInput,\n timeWithGmtOffsetFormatString,\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n generateAvailableTimes,\n generateAvailableTimesTz,\n} from '../utils/time.utils';\nimport { BehaviorSubject, combineLatest } from 'rxjs';\nimport { filter, map, withLatestFrom } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'date-tz-time-field',\n template: `\n
\n {{\n label\n }}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzTimeFieldComponent),\n multi: true,\n },\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DateTzTimeFieldComponent\n extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor\n{\n @Input() public label?: string;\n @Input() public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the DateTZ object datetime to start time options from **/\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n // Disables this input and displays R--- \"All Day\" for the value\n @Input() public all_day: boolean = false;\n @Input() public show_current: boolean = false;\n @Input() public startFromDateTz: boolean = false;\n\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n /** DateTZ object representing the currently set datetime */\n public selectedDateTz = new BehaviorSubject(\n closestToTimeSlotTz(DateNow(new Date()), this.step)\n );\n\n /** string representing the currently set datetime display value, needed for the input to display the slected value */\n public selectedTimeString = new BehaviorSubject(\n timeWithGmtOffsetFormatString(this.selectedDateTz.value)\n );\n\n public filterFormControl: FormControl = new FormControl();\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(\n generateAvailableTimesTz(\n DateNow(),\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(DateNow())]\n : [],\n this.startFromDateTz\n )\n );\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // Subscribe to selected option changes\n this.subscription(\n 'dateTimeChanges',\n combineLatest([this.selectedDateTz])\n .pipe(\n map(([selectedDateTz]) => {\n /**\n * The selectedDateTz should already be pegged to the closest time slot, but\n * if the selected time rolls into the past this can correct it. // R--- verify this statement\n */\n return closestToTimeSlotTz(selectedDateTz, this.step);\n }),\n withLatestFrom(this.options),\n filter(\n ([date, timeOptions]: [\n DateTZ,\n SelectOption[]\n ]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(\n (t) => t.value === date.formatDate('HH:mm')\n );\n }\n ),\n map(([dateTz, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz,\n });\n\n // Sort the time options\n timeOptions.sort((a, b) =>\n `${a.value}`.localeCompare(`${b.value}`)\n );\n return timeOptions;\n })\n )\n .subscribe((next) => {\n return this.options.next(next);\n })\n );\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (\n changes.no_past_times ||\n changes.step ||\n changes.fromDateTz ||\n changes.all_day\n ) {\n // If there's a new date value then update the time options\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // If today and all day goes from on to off the selected value isn't going to be available.\n if (\n changes.all_day &&\n !changes.all_day.currentValue &&\n changes.all_day.previousValue\n ) {\n this.setValue(this.options.value[0].display);\n }\n }\n }\n\n /**\n * Getter if the time picker options are visiable or not\n */\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n /**\n * Getter to return the current form timestamp from the from date object\n */\n public get timezone(): string {\n return this.fromDateTz.building_tz;\n }\n\n /**\n * A filter for finding a matching value when using the input text search\n */\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.selectedDateTz,\n ]).pipe(\n map(([value, selectedDateTz]) => {\n return nearestStepToInput(\n this.step,\n value,\n DateTime.now().valueOf()\n );\n })\n );\n\n /**\n * Default text displayed in the search field when the component initializes\n */\n public placeHolderOption = this.options.pipe(\n map((os) => os.length > 0 && os[0])\n );\n\n /**\n * Returns the selected option object by matching the selectedDateTz formated string with the option.display string\n */\n public selectedOption = combineLatest([\n this.options,\n this.selectedDateTz,\n ]).pipe(\n map(([options, selectedDateTz]) =>\n options.find(\n (o) =>\n o.display === timeWithGmtOffsetFormatString(selectedDateTz)\n )\n )\n );\n\n /**\n * Determines the visually selected value when the options list is visible.\n *\n * @param option DateTZ\n * @returns boolean\n */\n public isSelected(option: SelectOption) {\n return this.selectedTimeString.value === option.display;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: DateTZ) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: DateTZ) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Method just used in unit tests to test disabling the input\n * @param disabled\n */\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Update the selected values\n * @param dateTz the DateTz object for the new time\n */\n public setSelectedValues(dateTz: DateTZ) {\n // Update the selected DateTz and string representations\n this.selectedTimeString.next(timeWithGmtOffsetFormatString(dateTz));\n this.selectedDateTz.next(dateTz);\n if (this._onChange) {\n this._onChange(dateTz);\n }\n }\n\n /**\n * Update the form field value\n * @param displayString The \"display\" value of this.options set by the time picker\n */\n public setValue(displayString: string): void {\n // Convert the display time string to the actual option object via an array find.\n const newTimeTz = this.options.value.find(\n (opt) => opt.display === displayString\n ).value;\n // Update the selected DateTz and string representations\n this.setSelectedValues(newTimeTz);\n // Send the\n if (newTimeTz) {\n if (this._onChange) {\n this._onChange(newTimeTz);\n }\n }\n }\n\n /**\n * Fires when the form control value is changed\n * @param dateTz The new value for the component\n */\n public writeValue(dateTz: DateTZ | null) {\n // Init is null ?\n if (dateTz != null) {\n // Update the selected DateTz and string representations\n this.setSelectedValues(dateTz);\n // Update the available options\n this.options.next(\n generateAvailableTimesTz(\n dateTz,\n !this.noPastTimes,\n this.step,\n dateTz.building_tz,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(dateTz)]\n : [],\n this.startFromDateTz\n )\n );\n }\n }\n}\n\nfunction generateOptionForDateTz(dateTz: DateTZ): SelectOption {\n return {\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n nearestDurationToInput,\n DurationGroup,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map\n} from 'rxjs/operators';\nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'mck-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n @Input() max_length?: number;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDate: number;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDate = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDate]).pipe(\n map(([value, currentStartDate]) => nearestDurationToInput(this.durationGroups, currentStartDate.ms, value)\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDate.pipe(\n map(d => generateDurationOptionsFromGroups(d.toZone(this.timezone), this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDate.value.toZone(this.timezone), this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDate) {\n // R--- refactor input param\n const date = new DateTZ({date: this.startDate})\n this.currentStartDate.next(date);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'mck-error-message',\n template: `\n
\n
\n
\n \n \n \n
\n
\n `,\n styleUrls: ['./error-message.component.scss']\n})\nexport class ErrorMessageComponent {\n\n constructor() {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-calendar-icon',\n template: `\n \n \n \n \n \n `,\n})\nexport class CalendarIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-chevron-icon',\n template: `\n \n \n
\n \n \n \n
\n
\n \n
\n `\n})\nexport class ChevronIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n @Input()\n up?: boolean;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit\n} from '@angular/core';\n\n@Component({\n selector: 'mck-close-icon',\n template: `\n \n \n \n \n `\n})\nexport class CloseIconComponent implements OnInit {\n\n @Input()\n fillClass?: string;\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component(\n {\n selector: 'mck-informational-image',\n template: `\n \n
\n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./informational-image.component.scss'],\n encapsulation: ViewEncapsulation.None\n }\n)\nexport class InformationalImageComponent extends BaseTemplateComponent {\n\n @Input()\n public src: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-label',\n template: `\n \n \n \n *\n \n \n `,\n styleUrls: ['./label.component.scss']\n})\nexport class LabelComponent extends BaseTemplateComponent implements OnInit {\n\n @Input()\n required = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { MatSelect } from '@angular/material/select';\nimport { SelectOption } from '../options/select-option';\n\n@Component({\n selector: 'mck-legend-dropdown',\n template: `\n
\n \n \n \n \n
\n \n \n \n {{ buildPlaceholder() }}\n \n
\n \n
\n \n
\n `,\n styleUrls: ['./legend-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class LegendDropdownComponent {\n\n @Input()\n public placeholder: string;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public placeholderOpen?: string\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public buildPlaceholder(){\n return this.isOpen && this.placeholderOpen ? this.placeholderOpen : this.placeholder\n }\n}\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { AcaDatePickerComponent } from '../aca-date-picker/aca-date-picker.component';\n\n@Component({\n selector: 'mck-date-picker',\n template: `\n \n Date\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./mck-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MckDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class MckDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public initialDateSelection?: number;\n\n @Input() public invalid?: boolean;\n\n @Output() public onSelect = new EventEmitter();\n\n // R--- or is this the date picker to refactor. too tired.\n public ngOnInit(): void {\n if (this.initialDateSelection) {\n this.writeValue(this.initialDateSelection)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(AcaDatePickerComponent, {static: true }) private _acaDatePicker: AcaDatePickerComponent;\n\n /** Currently selected date */\n public dateValue = new BehaviorSubject(DateNow(new Date()));\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.dateValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public get date(): Observable {\n return this.dateValue;\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = this.dateValue.value;\n const d = new DateTZ({date: new_value})\n let new_date = d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n const new_d = new DateTZ({ date: new_date })\n this.dateValue.next(new_d);\n if (this._onChange) {\n this._onChange(new_date);\n }\n this.onSelect.emit(new_date);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n this.setValue(DateNow(new Date()).ms);\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n const date = new DateTZ({date: value})\n this.dateValue.next(date);\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-modal-button-row',\n template: `\n \n \n \n \n
\n \n {{secondaryLabel}}\n \n \n {{primaryLabel}}\n\n \n
\n \n
\n `,\n styleUrls: ['./modal-button-row.component.scss']\n})\nexport class ModalButtonRowComponent extends BaseTemplateComponent {\n\n @Input()\n primaryLabel?: string;\n\n /**\n * Specify if you want to disable the primary button\n */\n @Input()\n primaryDisabled?: boolean = false;\n\n /**\n * Used only if primaryLabel is specified.\n */\n @Output()\n public primarySubmit = new EventEmitter();\n\n /**\n * Specify if you want to show a secondary label button\n */\n @Input()\n secondaryLabel?: string;\n\n @Input()\n disableFixed: boolean = false;\n\n /**\n * Specify if you want to disable the secondary button\n */\n @Input()\n secondaryDisabled?: boolean = false;\n\n /**\n * Used only if secondaryLabel is specified.\n */\n @Output()\n public secondarySubmit = new EventEmitter();\n\n @Input()\n smallButtons?: boolean = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-modal',\n template: `\n \n
\n
\n \n
\n
\n

{{header}}

\n
\n
\n \n
\n `,\n styleUrls: ['./modal.component.scss']\n})\nexport class ModalComponent {\n\n @Input()\n header?: string;\n @Input() shouldClose?: boolean = true;\n\n constructor(private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n}\n","import { Component, EventEmitter, Inject, OnInit, Output } from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\nimport { DateTZ, isToday } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'override-changes-modal',\n templateUrl: './override-changes-modal.component.html',\n styleUrls: ['./override-changes-modal.component.scss']\n})\nexport class OverrideChangesModalComponent implements OnInit{\n\n public edits;\n public timezone;\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: OverrideChangesModalComponent){\n\n }\n\n public ngOnInit(){\n // this.edits = this._data.edits.sort((a, b) => a - b);\n\n // Function to convert epoch to 'YYYY-MM-DD' format\n const getDateString = (epoch) => {\n return new Date(epoch * 1000).toISOString().split('T')[0];\n };\n\n // Set to store unique date strings\n const uniqueDates = new Set();\n\n // Filter the edits array\n const filteredEdits = this._data.edits.filter(epoch => {\n const dateString = getDateString(epoch);\n if (!uniqueDates.has(dateString)) {\n uniqueDates.add(dateString);\n return true;\n }\n return false;\n });\n\n this.edits = filteredEdits;\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone });\n const dateIsToday = isToday(dateTZ, this._data.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n}","
\n \n \n
\n\n \n \n \n\n

Overriding Changes

\n

Editing the series here will override all previous changes made to individual occurrences. Are you sure you want to proceed?

\n\n \n \n \n \n \n \n \n \n \n \n \n
Dates
{{formatDate(edit)}}
\n
\n\n\n \n \n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\n\n/**\n * Transforms input by returning a subset of items based on if the\n * any items include the search text based on passed objectKey.\n *\n * objectKey can be pipe separated keys. e.g: 'name|age'. Then it will check against all.\n */\n@Pipe({\n name: 'filter'\n})\nexport class FilterPipe implements PipeTransform {\n transform(items: any[], searchText: string, objectKey?: string): any[] {\n if (!items) return [];\n if (!searchText) return items;\n searchText = searchText.toLowerCase();\n const splitKeys = objectKey?.split('|') ?? [];\n return items.filter(it => {\n let included = false;\n splitKeys.forEach((key) => {\n if (it[key]?.toLowerCase().includes(searchText)) {\n included = true;\n }\n });\n if (splitKeys.length === 0) {\n return it.toLowerCase().includes(searchText);\n }\n return included;\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport {\n DomSanitizer,\n SafeHtml,\n SafeResourceUrl,\n SafeScript,\n SafeStyle,\n} from '@angular/platform-browser';\n\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n@Pipe({\n name: 'sanitize',\n})\nexport class SanitizePipe implements PipeTransform {\n constructor(private sanitizer: DomSanitizer) {}\n\n transform(\n value: string,\n type: 'resource' | 'url' | 'script' | 'style' | 'html' = 'html'\n ): SafeHtml | SafeResourceUrl | SafeScript | SafeStyle {\n switch (type) {\n case 'resource':\n return (\n this.sanitizer.sanitize(\n SecurityContext.RESOURCE_URL,\n value\n ) || ''\n );\n case 'url':\n return (\n this.sanitizer.sanitize(SecurityContext.URL, value) || ''\n );\n case 'script':\n return (\n this.sanitizer.sanitize(SecurityContext.SCRIPT, value) || ''\n );\n case 'style':\n return (\n this.sanitizer.sanitize(SecurityContext.STYLE, value) || ''\n );\n }\n return this.sanitizer.sanitize(SecurityContext.HTML, value) || '';\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { SelectOption } from '../types';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'mck-radio-select',\n template: `\n \n
\n {{label}}\n \n {{option.display}}\n \n
\n
\n `,\n styleUrls: ['./radio-select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioSelectComponent),\n multi: true\n }\n ]\n})\nexport class RadioSelectComponent extends BaseTemplateComponent implements OnInit, ControlValueAccessor {\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n options: SelectOption[];\n\n public value = new BehaviorSubject | undefined>(undefined);\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public setValue(value: string) {\n const obj = this.options.find(o => o.value === value);\n this.writeValue(obj);\n if (this._onChange) {\n this._onChange(obj)\n }\n }\n\n writeValue(obj: SelectOption): void {\n this.value.next(obj);\n }\n}\n","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { OrganisationService, RecurrencePeriod, RecurrenceType, removeExpiredOcurrences, RepeatsOn } from \"@mckinsey-converge/data-common\";\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { first } from \"rxjs/operators\";\nimport { RecurrencePatternForm } from \"../recurrence-pattern-form/recurrence-pattern-form.component\";\n\n@Component({\n selector: 'recurrence-booking-form',\n templateUrl: './recurrence-booking-form.component.html',\n styleUrls: ['./recurrence-booking-form.component.scss']\n})\n\nexport class RecurringBookingForm implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n\n public current_type: RecurrenceType; \n public recurrence_types: Array = [\n {type: RepeatsOn.PATTERN, label: 'Repeats on'},\n {type: RepeatsOn.DATE, label: 'Repeats on specific date'}\n ]\n\n public building_tz = \"\";\n\n @ViewChild(RecurrencePatternForm) pattern_form: RecurrencePatternForm;\n\n constructor(\n private _org: OrganisationService,\n ) {}\n\n public get recurrencePeriod(){\n return this.form.get('recurrence_period')\n }\n\n public ngOnInit(): void {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.building_tz = this._org?.building?.timezone || 'America/Chicago';\n })\n if(this.recurrencePeriod.value === RecurrencePeriod.LIST){\n this.current_type = this.recurrence_types[1];\n removeExpiredOcurrences(this.form)\n }else{\n this.current_type = this.recurrence_types[0];\n }\n }\n\n public onChangeType(value: string) {\n this.current_type = this.recurrence_types.filter((type) => type.type === value)[0]\n if(this.current_type.type === RepeatsOn.PATTERN){\n this.recurrencePeriod.setValue(this.pattern_form.recurrencePatternFormControl.value)\n }else{\n this.recurrencePeriod.setValue(RecurrencePeriod.LIST)\n }\n }\n\n public dateToBuildingTz(date?: number){\n return new DateTZ({date, building_tz: this.building_tz, is_local_tz: false})\n }\n\n public get error(){\n const recurrence_starts = this.form.controls.recurrence_starts\n const recurrence_days = this.form.controls.recurrence_days\n return recurrence_starts.invalid || recurrence_days.invalid\n }\n\n}\n","
\n \n
\n \n \n {{recurrence_types[0].label}}\n \n \n \n
\n
\n \n \n {{recurrence_types[1].label}}\n \n \n \n
\n
\n
\nThe recurrence pattern is not valid.","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { MatMenuTrigger } from \"@angular/material/menu\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { OrganisationService } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ,toMiddayUTC } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-date-form',\n templateUrl: './recurrence-date-form.component.html',\n styleUrls: ['./recurrence-date-form.component.scss']\n})\n\nexport class RecurrenceDateForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n public selected_dates: Array = []\n public timezone: string = '';\n public nowTz: DateTZ = DateNow(new Date());\n public fromDateTz: DateTZ = this.nowTz.clone();\n public untilDateTz: DateTZ = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n public dateTz: DateTZ = DateNow(new Date());\n\n public get recurrenceStarts(){\n return this.form.get('recurrence_starts');\n }\n\n public get formDateTz(){\n return this.form.get('dateTz');\n }\n\n constructor (private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The fromDateTz is curious, would it make sense to be based on the form dateTz?\n this.fromDateTz = this.nowTz.clone()\n this.untilDateTz = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n\n if(this.recurrenceStarts.value){\n const tempForSort = [...this.recurrenceStarts.value]; // due to cannot assign to read only property '0' of object '[object Array]'\n this.selected_dates = tempForSort.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n this.subscription('ocurrenceChanges', this.recurrenceStarts.valueChanges\n .subscribe(() => {\n this.selected_dates = [...this.recurrenceStarts.value]\n })\n ); \n }\n\n /**\n * Add value to the list of selected dates\n * @param newDateTz\n */\n public addDate(newDateTz: DateTZ) {\n const d = newDateTz.clone();\n const start_date = this.formDateTz.value;\n let new_date = d.setValue({hour: start_date.dateHour, minute: start_date.minutes})\n \n /** Prevent user from selecting past dates */\n if (new_date.isBeforeDate(this.fromDateTz)) {\n new_date = this.fromDateTz;\n }\n\n /** Prevent user from selecting the same date more than once */\n const is_selected = this.selected_dates.filter((date: DateTZ)=> new_date.isSameDate(date, 'day'))\n if(is_selected.length){\n return\n }\n \n this.selected_dates.push(new_date);\n this.recurrenceStarts.setValue(this.selected_dates.sort((d1, d2) => d1.ms - d2.ms));\n this.setDateTzForm();\n }\n\n /**\n * \n * @param dateMsValue: number\n * @returns \n */\n public setPickerToGivenDate(dateTsValue: DateTZ) {\n this.fromDateTz = dateTsValue.clone();\n }\n\n /**\n * Function calls on close of date picker without date selection\n */\n public onDatePickerClose = () => {\n this.setPickerToGivenDate(this.nowTz)\n };\n\n public goToToday() {\n this.addDate(this.nowTz);\n this.setPickerToGivenDate(this.nowTz);\n }\n\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n public openDatePicker() {\n this._trigger.openMenu();\n }\n\n public deleteDate(date: DateTZ) {\n const index = this.selected_dates.map((d: DateTZ) => d.ms).indexOf(date.ms)\n this.selected_dates.splice(index, 1)\n this.recurrenceStarts.setValue(this.selected_dates)\n this.setDateTzForm()\n }\n\n public isToday(date) {\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: this.timezone,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone,\n }),\n 'day'\n );\n }\n\n public formatDate(date: DateTZ){\n const isToday = this.isToday(date);\n const display = date.formatDate('ccc dd MMM yyyy');\n\n return `${display}${isToday ? ' (Today)' : ''}`;\n }\n\n private setDateTzForm(): void {\n if (this.selected_dates.length === 0)\n return;\n\n const tz = this._org.building.timezone;\n const date_now = DateNow(new Date()).toZone(tz);\n let dateTz = this.selected_dates[0].clone();\n\n dateTz = dateTz.setValue({\n hour: (this.formDateTz.value as DateTZ).hours,\n minute: (this.formDateTz.value as DateTZ).minutes\n });\n\n if (this.selected_dates[0].isSameDate(this.nowTz, \"day\") && dateTz.hours < date_now.hours) {\n const { minutes: minute, hours: hour } = closestToTimeSlotTz(this.nowTz, 15);\n dateTz = dateTz.setValue({ minute, hour, second: 0 });\n }\n\n this.formDateTz.setValue(dateTz);\n }\n}\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
DateAction
{{formatDate(date)}}Delete
\n
[+] Add another date
\n \n
\n \n Today\n \n
\n
\n
\n
","import { Component, Input, OnInit } from \"@angular/core\";\nimport { FormGroup, Validators } from \"@angular/forms\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { arrayWithValues, generateWeekDays, RecurrencePeriod, recurrencePeriodToDurationType, RepeatPeriod, validDateTZ, WeekDays } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-pattern-form',\n templateUrl: './recurrence-pattern-form.component.html',\n styleUrls: ['./recurrence-pattern-form.component.scss']\n})\n\nexport class RecurrencePatternForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n\n /** Range of dates for the Start Date Picker*/\n public nowTz: DateTZ = DateNow(new Date());\n public fromStartTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n public untilTz: DateTZ = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n public timezone: string = '';\n \n\n /** Range of dates for the End Date Picker*/\n public fromEndTz: DateTZ;\n\n public repeat_period_options: Array = [\n {label: 'Day', id: RecurrencePeriod.DAILY},\n {label: 'Week',id: RecurrencePeriod.WEEKLY},\n {label: 'Month', id: RecurrencePeriod.ABSOLUTE_MONTHLY}\n ]\n public week_days: Array = []\n\n public repeat_every_options\n\n\n public get recurrenceDateStartTzFormControl() {\n return this.form.get('dateTz')\n }\n\n public get recurrenceEndFormControl(){\n return this.form.get('recurrence_endTz')\n }\n\n public get recurrencePeriodFormControl(){\n return this.form.get('recurrence_period')\n }\n\n public get recurrenceIntervalFormControl(){\n return this.form.get('recurrence_interval')\n }\n\n public get recurrencePatternFormControl(){\n return this.form.get('recurrence_pattern')\n }\n\n public get recurrenceDaysFormControl(){\n return this.form.get('recurrence_days')\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The from date is curious, why isn't it based on the form dateTz?\n this.repeat_every_options = new Array(1)\n this.fromStartTz = closestToTimeSlotTz(this.nowTz, 15)\n this.untilTz = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n this.fromEndTz = this.fromStartTz.addValue({days: 1})\n\n this.setEndDateFromStartDate(this.recurrenceDateStartTzFormControl.value) //make sure end date is after start date\n\n if(!this.recurrencePeriodFormControl.value){\n this.recurrencePeriodFormControl.setValue(RecurrencePeriod.WEEKLY)\n }\n\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.recurrencePatternFormControl.setValue(this.recurrencePeriodFormControl.value)\n }\n\n this.week_days = generateWeekDays(this.recurrenceDateStartTzFormControl.value.ms, { building_tz: this.fromStartTz.building_tz })\n this.generateMaxIntervals()\n\n if(this.recurrenceDaysFormControl.value.length > 0){\n this.week_days = this.week_days.map((day) => \n ({...day, active: this.recurrenceDaysFormControl.value.includes(day.full_name)})\n )\n }\n\n if(!this.recurrenceDaysFormControl.value.length && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n const current_days = this.week_days.filter((day) => day.active).map((day)=>day.full_name)\n this.recurrenceDaysFormControl.setValue(current_days)\n }\n\n this.generateOcurrenceList()\n\n this.subscription('startTimeChanges', this.recurrenceDateStartTzFormControl.valueChanges\n .subscribe((next) => {\n this.setEndDateFromStartDate(next) \n })\n );\n\n this.subscription('endTimeChanges', this.recurrenceEndFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n );\n \n this.subscription('recurrencePeriodFormControlChanges', this.recurrencePeriodFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n ); \n }\n\n public setEndDateFromStartDate(startDateTz: DateTZ){\n let end_date = this.recurrenceEndFormControl.value.setValue({hour: startDateTz.dateHour, minute: startDateTz.minutes})\n\n /**Update the End date picker range */\n this.fromEndTz = startDateTz.isSameDate(this.untilTz,'day') ? startDateTz : startDateTz.addValue({days: 1})\n\n if(end_date.isBeforeDate(this.fromEndTz)){\n end_date = this.fromEndTz\n }\n\n this.recurrenceEndFormControl.setValue(end_date)\n\n this.generateMaxIntervals()\n this.updateActiveWeekday() \n }\n\n public setRepeatPeriod(value: RecurrencePeriod){\n this.updateValidators(value)\n this.recurrencePeriodFormControl.setValue(value);\n this.recurrencePatternFormControl.setValue(value);\n this.recurrenceIntervalFormControl.setValue(1)\n this.generateOcurrenceList();\n }\n\n public setRepeatEvery(value: number){\n this.recurrenceIntervalFormControl.setValue(value)\n this.generateOcurrenceList()\n }\n\n public repeatTimeString(value: string){\n return this.recurrenceIntervalFormControl.value !== 1 ? `${value}(s)` : value\n }\n\n public get displayWeekdays(){\n return this.recurrencePatternFormControl.value === RecurrencePeriod.WEEKLY\n }\n\n /* Check if selected interval is valid and reset to 1 if not*/\n private validateRecurrenceInterval = () => {\n if(this.repeat_every_options.length < this.recurrenceIntervalFormControl.value){\n this.recurrenceIntervalFormControl.setValue(1)\n } \n };\n\n /**\n * Generate max value for dorpdown interval\n */\n public generateMaxIntervals(){\n const start = this.recurrenceDateStartTzFormControl.value;\n const date_diff = this.recurrenceEndFormControl.value.dateDiff(start, this.periodToDurationType, this.periodToDurationType)\n //If no diff default to 1\n this.repeat_every_options = new Array(Math.round(date_diff) || 1)\n this.validateRecurrenceInterval();\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.generateOcurrenceList()\n }\n }\n\n /**\n * Generate ocurrence list base on the selected interval\n */\n public generateOcurrenceList() {\n\n /**If selected period is list then we don't want \n * to generate a list based on the repeats on selections*/\n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.LIST){\n return\n }\n\n const occurrence = []\n const first_date = this.recurrenceDateStartTzFormControl.value;\n let start = first_date\n const end = this.recurrenceEndFormControl.value;\n const interval = this.recurrenceIntervalFormControl.value\n const recurr_days = this.week_days.filter(day => day.active)\n /**\n * isLastDayOfMonth : Boolean\n * flag - to generate last day of every month in case of day or month reccuring booking if start date is last day of month\n */\n // const isLastDayOfMonth = first_date.date.day === first_date.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY;\n const isLastDayOfMonth = first_date.dateDay === 31 && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY ;\n \n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n start = start.startOfValue('week')\n }\n\n while (end.dateDiff(start.startOfValue('day'), this.periodToDurationType, this.periodToDurationType) >= 0) {\n \n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n occurrence.push(start) \n start = start.addValue({[this.periodToDurationType]: interval}, isLastDayOfMonth);\n /**\n * IF - should only consider resetting start under mentioned condition of ticket - https://acaprojects.atlassian.net/browse/MCK-2085\n * In summery - If user select any date except 31st, other months in the series (no matter 30 or 31 day month) should have same date select as start date.\n * If user select 31st as an start date, other month in the seleries should have select last day of the month (30th/31st/28th/29th).\n * Exception for February - February should select 28th or 29th If in above both selection includes date between 28th - 31st.\n * \n */\n if(start.dateDay !== first_date.dateDay && start.dateDay !== start.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY) {\n start = start.setValue({day: first_date.dateDay});\n } \n }else {\n recurr_days.forEach((day)=>{\n const date = start.addValue({days: day.day_index})\n if((date.isAfterDate(first_date) || date.isSameDate(first_date, 'day')) && \n (date.isBeforeDate(end) || date.isSameDate(end, 'day'))){\n occurrence.push(date)\n }\n })\n start = start.addValue({[this.periodToDurationType]: interval})\n }\n }\n\n this.form.controls.recurrence_count.setValue(occurrence.length)\n this.form.controls.recurrence_starts.setValue(occurrence.sort((d1, d2) => d1.ms - d2.ms))\n \n }\n\n public get periodToDurationType(){\n const period = this.recurrencePeriodFormControl.value\n return recurrencePeriodToDurationType(period)\n }\n\n /**\n * Update active weekday in the weekdays array\n */\n private updateActiveWeekday() {\n const _week_days = this.week_days.map((day)=>{\n if(this.recurrenceDaysFormControl.value.includes(day.full_name)){\n return {...day, active: true}\n }else{\n return {...day, active: false}\n }\n })\n this.week_days = [..._week_days] \n }\n\n public setWeekDays(new_day: WeekDays){\n const days = this.recurrenceDaysFormControl.value\n if(this.disabled){\n return\n }\n\n if(!new_day.active){\n days.push(new_day.full_name)\n }else{\n const current_index = days.indexOf(new_day.full_name)\n days.splice(current_index,1)\n }\n this.recurrenceDaysFormControl.setValue([...days])\n this.updateActiveWeekday()\n this.generateOcurrenceList()\n }\n\n /**Update the recurrence days validator if period changes */\n public updateValidators(value: RecurrencePeriod){\n if(value === RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n this.recurrenceDaysFormControl.setValidators(arrayValidators);\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }else if(value !== RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n this.recurrenceDaysFormControl.clearValidators();\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }\n }\n}\n","
\n
\n \n \n \n Date and time must be in the future\n
\n
\n \n \n \n Date and time must be in the future\n
\n
\n
\n \n
\n \n \n \n {{ i + 1}}\n \n \n \n \n \n \n {{ repeatTimeString(option.label) }}\n \n \n \n
\n
\n
\n \n
\n
\n {{day.id}}\n
\n
\n
\n
\n
","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { SelectOption } from '../types';\n\n@Component({\n selector: 'mck-select-option',\n template: `\n \n \n \n \n {{ option.display }}\n \n \n `,\n styleUrls: ['./select-option.component.css']\n})\nexport class SelectOptionComponent extends BaseTemplateComponent {\n\n @Input()\n option: SelectOption;\n\n @Input()\n selected: boolean;\n\n /**\n * If true, we still display as if it wasn't disabled.\n */\n @Input()\n ignoreDisabled = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators';\nimport { MatSelect } from '@angular/material/select';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\n@Component({\n selector: 'mck-select',\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class SelectComponent implements OnInit, OnChanges, ControlValueAccessor {\n\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n /**\n * When true, can filter by searching on the input.\n */\n @Input()\n public searchEnabled = false;\n\n @Input()\n public splitDisplay = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Input()\n public showDivider: boolean = false\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n public filterFormControl: FormControl = new FormControl();\n\n public value = new BehaviorSubject(this.selectedValue || this.options[0]?.value);\n\n /** Available time blocks for the selected date */\n public _options = new BehaviorSubject[]>(this.options);\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public selectedOption = combineLatest([this._options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this._options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n\n constructor() {\n }\n\n public ngOnInit(): void {\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this._options.next(this.options);\n this.value.next(this.selectedValue || this.options?.[0]?.value);\n }\n if (changes.selectedValue) {\n this.value.next(this.selectedValue?.value);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n}\n","
\n {{label}}\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\n@Component({\n selector: 'mck-selected-chip-count',\n template: `\n \n {{count}}\n \n \n `,\n styleUrls: ['./selected-chip-count.component.scss']\n})\nexport class SelectedChipCountComponent {\n\n @Input()\n count: number;\n\n @Output()\n close = new EventEmitter();\n\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\nexport enum SpacerMode {\n /**\n * If vertical, it expands in the vertical direction. Size is width.\n */\n Vertical = 'vertical',\n /**\n * If horizontal, it expands in the horizontal direction. Size is height.\n */\n Horizontal = 'horizontal',\n}\n\n@Component({\n selector: 'mck-spacer',\n template: `\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./spacer.component.css'],\n})\nexport class SpacerComponent extends BaseTemplateComponent implements OnInit {\n SpacerMode = SpacerMode;\n\n @Input()\n size: string;\n\n @Input()\n mode: SpacerMode = SpacerMode.Horizontal;\n\n @Input()\n autoSize?: boolean;\n\n @Input()\n spacerClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-switch-group',\n template: `\n
\n {{title}}\n {{option.display}}\n
\n `,\n styleUrls: ['./switch-group.component.scss']\n})\nexport class SwitchGroupComponent implements OnInit {\n\n @Input()\n title: string;\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selectedOptions: SelectOption[] = [];\n\n @Output()\n optionChecked = new EventEmitter>();\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n public onCheckedChange(option: SelectOption) {\n this.optionChecked.emit(option);\n }\n\n public isSelected(option: SelectOption) {\n return !!this.selectedOptions.find(s => s.value === option.value);\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlot,\n nearestStepToInput,\n timeWithGmtOffsetFormatString\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { generateAvailableTimes } from '../utils/time.utils';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport {\n filter,\n map,\n withLatestFrom\n} from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'mck-time-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n `,\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the date from start **/\n @Input() public from: number;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n // R-- Which time field is going to be used, there's too many\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** String representing the currently set date */\n public date = new BehaviorSubject(DateNow(new Date()).ms);\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.date]).pipe(\n map(([value, date]) => nearestStepToInput(this.step, value, DateTime.now().valueOf()))\n );\n\n /** String representing the currently set time */\n public value = new BehaviorSubject(closestToTimeSlot(DateTime.now(), this.step).toFormat('HH:mm'));\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(generateAvailableTimes(DateNow(new Date()).ms, !this.noPastTimes, this.step, this.timezone));\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this.options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n\n // Subscribe to selected option changes\n this.subscription('dateTimeChanges',\n combineLatest([\n this.date\n ]).pipe(\n map(([date]) => {\n // R--- The time input needing to be TZ aware.\n const closestTimeSlot = closestToTimeSlot(DateTime.fromMillis(date.valueOf()), this.step);\n // Need to return the date with building timezone or the HH:mm representation will no match the option values\n return new DateTZ({date: closestTimeSlot.valueOf(), is_local_tz:false, building_tz: this.timezone});\n }),\n withLatestFrom(this.options),\n filter(([date, timeOptions]: [DateTZ, SelectOption[]]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(t => t.value === date.formatDate('HH:mm'));\n }),\n map(([date, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(date),\n value: date.formatDate('HH:mm')\n });\n // Sort the time options\n timeOptions.sort((a, b) => `${a.value}`.localeCompare(`${b.value}`));\n return timeOptions;\n })\n ).subscribe(next => this.options.next(next)));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step || changes.timezone) {\n // If there's a new date value then update the time options\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n const buildingDate = new DateTZ({date: this.from, is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.value.next(buildingDate.formatDate('HH:mm'));\n }\n if (changes.from) {\n // When the from input param changes update the date value\n this.date.next(this.from);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n // value comes in as a HH:mm string\n const newTime = (new_value.indexOf(':') > 0 ? new_value : '00:00').split(':');\n // need the date with the building timezone so the hour set is relative to there and not local.\n const d = new DateTZ({ date: this.date.value, is_local_tz: false, building_tz: this.timezone });\n const date = d.setValue({ hour: parseInt(newTime[0]), minute: parseInt(newTime[1]) });\n if (date) {\n if (this._onChange) {\n this._onChange(date.ms);\n }\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number | null) {\n if (value != null) {\n // Time input value in building time milliseconds\n this.date.next(value);\n // Get the closest time to slot in case the browser was idle and elapse the valid times\n const date = closestToTimeSlot(DateTime.fromMillis(value).startOf('minute'), this.step);\n // Need the building time so HH:mm is correct\n const buildingDate = new DateTZ({date: date.valueOf(), is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.options.next(generateAvailableTimes(buildingDate.ms, !this.noPastTimes, this.step, this.timezone));\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-toggle',\n template: `\n
\n \n
\n `,\n styleUrls: ['./toggle.component.scss']\n})\nexport class ToggleComponent {\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selected: SelectOption;\n\n @Output()\n selectedChange = new EventEmitter>();\n\n public onTapOption(option: SelectOption) {\n this.selectedChange.emit(option);\n }\n\n isSelected(option: SelectOption) {\n return this.selected === option;\n }\n}\n","import { Component, Input } from '@angular/core';\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Component({\n selector: 'app-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss']\n})\nexport class TooltipComponent {\n isVisible: boolean = false; // To control the visibility of the tooltip\n position: TooltipPosition = TooltipPosition.DEFAULT;\n theme: TooltipTheme = TooltipTheme.DEFAULT;\n tooltip = '';\n left = 0;\n top = 0;\n visible = false;\n}","
\n
\n
\n {{string}}\n
\n
\n
","import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n HostListener,\n Injector,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport {TooltipComponent} from \"./tooltip.component\";\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Directive({\n selector: '[tooltip]'\n})\nexport class TooltipDirective {\n\n @Input() tooltip = '';\n @Input() position: TooltipPosition = TooltipPosition.DEFAULT;\n @Input() theme: TooltipTheme = TooltipTheme.DEFAULT;\n @Input() trigger: ('hover' | 'click' | 'touch')[] = ['hover']; // Now an array of trigger types\n @Input() showDelay = 0;\n @Input() hideDelay = 0;\n @Input() show: boolean = true;\n\n private componentRef: ComponentRef | null = null;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n\n constructor(\n private elementRef: ElementRef, \n private appRef: ApplicationRef,\n private componentFactoryResolver: ComponentFactoryResolver, \n private injector: Injector) {\n }\n\n // Helper function to check if the tirgger type is present \n private hasTrigger(triggerType: 'hover' | 'click' | 'touch'): boolean {\n return this.trigger.includes(triggerType);\n }\n\n //Mouse and hover events\n @HostListener('mouseenter')\n onMouseEnter(): void {\n if (this.hasTrigger('hover') ) {\n this.initializeTooltip();\n }\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n if (this.hasTrigger('hover') ) {\n this.setHideTooltipTimeout();\n }\n }\n\n // Click event\n @HostListener('click')\n onClick(): void {\n if (this.hasTrigger('click') ) {\n if (this.componentRef === null) {\n this.initializeTooltip();\n } else {\n this.destroy(); // Hide tooltip if it is already shown\n }\n }\n }\n\n // Touch event\n\n\n @HostListener('touchstart', ['$event'])\n onTouchStart($event: TouchEvent): void {\n // Prevent default to avoid click event fire immedieatly \n // $event.preventDefault();\n if(this.hasTrigger('touch')) {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = window.setTimeout(this.initializeTooltip.bind(this), 150); // show the tooltip after short delay\n }\n \n }\n\n @HostListener('touchend')\n onTouchEnd(): void {\n // Hide the tooltip when touch end \n if(this.hasTrigger('touch') ){\n window.clearTimeout(this.touchTimeout);\n // this.setHideTooltipTimeout();\n setTimeout(() => {\n this.setHideTooltipTimeout();\n }, 500); \n }\n \n }\n\n // Initialization of the tooltip\n private initializeTooltip() {\n if (this.componentRef === null) {\n window.clearInterval(this.hideDelay);\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);\n this.componentRef = componentFactory.create(this.injector);\n\n this.appRef.attachView(this.componentRef.hostView);\n const [tooltipDOMElement] = (this.componentRef.hostView as EmbeddedViewRef).rootNodes;\n\n this.setTooltipComponentProperties();\n\n document.body.appendChild(tooltipDOMElement);\n this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);\n }\n }\n\n private setTooltipComponentProperties() {\n if (this.componentRef !== null) {\n this.componentRef.instance.tooltip = this.tooltip;\n this.componentRef.instance.position = this.position;\n this.componentRef.instance.theme = this.theme;\n\n const {left, right, top, bottom} = this.elementRef.nativeElement.getBoundingClientRect();\n\n switch (this.position) {\n case TooltipPosition.BELOW: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(bottom);\n break;\n }\n case TooltipPosition.ABOVE: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(top);\n break;\n }\n case TooltipPosition.RIGHT: {\n this.componentRef.instance.left = Math.round(right);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n case TooltipPosition.LEFT: {\n this.componentRef.instance.left = Math.round(left);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n default: {\n break;\n }\n }\n }\n }\n\n private showTooltip() {\n if (this.componentRef !== null) {\n this.componentRef.instance.visible = this.show ? true : false;\n }\n }\n\n private setHideTooltipTimeout() {\n this.hideTimeout = window.setTimeout(this.destroy.bind(this), this.hideDelay);\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n\n destroy(): void {\n if (this.componentRef !== null) {\n window.clearInterval(this.showTimeout);\n window.clearInterval(this.hideDelay);\n this.appRef.detachView(this.componentRef.hostView);\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","export enum TooltipPosition {\n ABOVE = 'above',\n BELOW = 'below',\n LEFT = 'left',\n RIGHT = 'right',\n DYNAMIC = 'dynamic',\n DEFAULT = 'below'\n}\n\nexport enum TooltipTheme {\n DARK = 'dark',\n LIGHT = 'light',\n DEFAULT = 'dark'\n}\n","export { AlertMode, AlertBannerDisplay } from './alert-banner/alert-banner.component';\nexport { SelectOption } from './options/select-option';\nexport * from './cng-select/dropdown-panel';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatSelectModule } from '@angular/material/select';\nimport { AutoCompleteChipSelectItemComponent } from './auto-complete-chip-select-item/auto-complete-chip-select-item.component';\nimport { AutoCompleteSelectOptionComponent } from './auto-complete-select-option/auto-complete-select-option.component';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { RadioSelectComponent } from './radio-select/radio-select.component';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FilterPipe } from './pipes/filter.pipe';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TimeFieldComponent } from './time-field/time-field.component';\nimport { DateTzTimeFieldComponent } from './date-tz-time-field/date-tz-time-field.component';\nimport { SpacerComponent } from './spacer/spacer.component';\nimport { DurationFieldComponent } from './duration-field/duration-field.component';\nimport { DateTzDurationFieldComponent } from './date-tz-duration-field/date-tz-duration-field.component';\nimport { AcaDatePickerComponent } from './aca-date-picker/aca-date-picker.component'; // the old widget\nimport { MckDatePickerComponent } from './mck-date-picker/mck-date-picker.component'; // the old form field \nimport { DateTzCalendarWidgetComponent } from './date-tz-calendar-widget/date-tz-calendar-widget.component'; // the new widget\nimport { DateTzDatePickerComponent } from './date-tz-date-picker/date-tz-date-picker.component'; // the new form field \nimport { CalendarIconComponent } from './icons/calendar/calendar-icon.component';\nimport { ChevronIconComponent } from './icons/calendar/chevron-icon.component';\nimport { SelectOptionComponent } from './select-option/select-option.component';\nimport { CloseIconComponent } from './icons/close/close-icon.component';\nimport { SelectedChipCountComponent } from './selected-chip-count/selected-chip-count.component';\nimport { AlertBannerComponent } from './alert-banner/alert-banner.component';\nimport { ErrorMessageComponent } from './error-message/error-message.component';\nimport { ToggleComponent } from './toggle/toggle.component';\nimport { LabelComponent } from './label/label.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { CollapseHeaderComponent } from './collapse-header/collapse-header.component';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { SwitchGroupComponent } from './switch-group/switch-group.component';\nimport { ModalButtonRowComponent } from './modal-button-row/modal-button-row.component';\nimport { InformationalImageComponent } from './informational-image/informational-image.component';\nimport { GroupHeaderPipe } from './auto-complete-chip-select-item/groupHeader.pipe';\nimport { SelectComponent } from './select/select.component';\nimport { LegendDropdownComponent } from './legend-dropdown/legend-dropdown.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RecurrencePatternForm } from './recurrence-pattern-form/recurrence-pattern-form.component'; \nimport { RecurrenceDateForm } from './recurrence-date-form/recurrence-date-form.component';\nimport { ConflictsModalComponent } from './conflicts-modal/conflicts-modal.component';\nimport { RecurringBookingForm } from './recurrence-booking-form/recurrence-booking-form.component';\nimport { OverrideChangesModalComponent } from './override-changes-modal/override-changes-modal.component';\nimport { SanitizePipe } from './pipes/sanitise.pipe';\nimport { ConflictAlertModalComponent } from './conflict-alert-modal/conflict-alert-modal.component';\nimport { CngSelectComponent } from './cng-select/cng-select.component';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { DropdownTriggerForDirective } from './cng-select/dropdown-trigger-for.directive';\nimport { CngSelectOptionsComponent } from './cng-select/cng-select-options.component';\nimport { TooltipComponent } from './tooltip/tooltip.component';\nimport { TooltipDirective } from './tooltip/tooltip.directive';\nimport { ZoomWarningComponent } from './zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nimport { CustomSnackbarComponent } from './custom-snackbar-component/custom-snackbar-component.component';\nimport { SnackBarService } from './custom-snackbar-component/custom-snackbar-component.service';\nimport { CateringDropComponent } from './catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n\nexport const MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule,\n MatExpansionModule,\n OverlayModule\n];\n\n@NgModule({\n imports: [CommonModule,\n ...MATERIAL_MODULES,\n ReactiveFormsModule,\n FormsModule,\n NgxMatSelectSearchModule, \n NgxSkeletonLoaderModule,\n MatSnackBarModule],\n declarations: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n GroupHeaderPipe,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n SelectOptionComponent,\n CloseIconComponent,\n SelectedChipCountComponent,\n AlertBannerComponent,\n ErrorMessageComponent,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n CustomSnackbarComponent,\n CateringDropComponent\n ],\n exports: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n AlertBannerComponent,\n ReactiveFormsModule,\n FormsModule,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n ],\n entryComponents: [\n CustomSnackbarComponent,\n CateringDropComponent\n ]\n \n})\nexport class UiModule {\n}\n","/**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n\nimport {\n closestToTimeSlot,\n closestToTimeSlotTz,\n DurationGroup,\n durationHumanized,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../types';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { DateTime } from 'luxon';\n\n// 24 hours\nexport const ALL_DAY_BOOKING_VALUE = 60 * 24;\n\nexport const DEFAULT_DURATION = 30;\n\n// R--- depreciate.\nexport const generateAvailableTimes = (\n datestamp: number,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz\n): SelectOption[] => {\n // R--- refactor to only used dateTz input and drop timezone param.\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let date = new DateTZ({ date: datestamp, is_local_tz: false, building_tz: timezone });\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || date.isAfterDate(now, 'day')) {\n // later than today\n date = date.startOfValue('day');\n } else {\n // today\n date = now;\n }\n // Get the closest timeslot to the start time\n const inputDate = DateTime.fromMillis(date.ms);\n const closestDate = closestToTimeSlot(inputDate, step);\n // Date changed to the closest time\n date = new DateTZ({ date: closestDate.valueOf(), is_local_tz: false, building_tz: timezone });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(date),\n shortDisplay: date.formatDate('hh:mma'),\n value: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n};\n\n\nexport const generateAvailableTimesTz = (\n fromDateTz: DateTZ,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz,\n all_day: boolean = false,\n extras: SelectOption[] = [],\n startFromDateTz: boolean = false\n): SelectOption[] => {\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let dateTz = fromDateTz.clone();\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || dateTz.isAfterDate(now, 'day')) {\n // later than today\n dateTz = dateTz.startOfValue('day');\n } else {\n // today/fromDateTz using the flag\n dateTz = startFromDateTz ? dateTz : now;\n }\n // Get the closest timeslot to the start time\n dateTz = closestToTimeSlotTz(dateTz, step);\n // Date changed to the closest time\n const end = dateTz.endOfValue('day');\n // Add the all day option for today\n if (all_day && dateTz.isSameDate(now, 'day')) {\n const startOfDay = dateTz.startOfValue('day');\n blocks.push({\n display: timeWithGmtOffsetFormatString(startOfDay),\n shortDisplay: startOfDay.formatDate('hh:mma'),\n value: startOfDay\n })\n }\n // Add options for the rest of the day\n while (dateTz.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n });\n \n dateTz = dateTz.addValue({ minutes: step });\n }\n\n return unique(extras.concat(blocks), 'shortDisplay');\n};\n\n/**\n * Generates list of duration options for new booking flow.\n * @param date - The start dateTime\n * @param max - The max number of minutes to go to from the date param.\n * @param min - The min number of minutes to display first time from.\n * @param step - The number of minutes to step up by for timeslots.\n */\nexport const generateDurationOptions = (\n date: DateTZ,\n max: number,\n min: number,\n step: number,\n extended: boolean): SelectOption[] => {\n const blocks: SelectOption[] = [];\n let value = min;\n while (value <= max) {\n let duration: string;\n if (extended) {\n const d = durationHumanized(value - min, true);\n duration = d ? `+${d}` : 'Current';\n } else {\n duration = durationHumanized(value, true);\n }\n\n blocks.push({\n value,\n display: `${date.addValue({ minutes: value }).formatDate(timeFormatString()).toLocaleLowerCase()} (${duration})`,\n });\n value += step;\n }\n return blocks;\n};\n\nexport const allDayOption: SelectOption = ({\n value: ALL_DAY_BOOKING_VALUE,\n display: 'All Day'\n});\n\nexport const oneWeekOption: SelectOption = ({\n value: 60 * 24 * 7, // 1 week\n display: 'One Week'\n});\n\nexport const defaultDurationGroups: DurationGroup[] = [\n {\n start: 15,\n step: 15,\n max: 60 * 24\n }\n // , {\n // start: 60,\n // step: 30,\n // max: (60 * 8) - 1 // 8 hours\n // }, {\n // start: 60 * 8,\n // step: 60,\n // max: 60 * 24 // 24 hours\n // }\n];\n\n/**\n * Maps the {@link DurationGroup} to {@link SelectOption} and appends the default all day and week options.\n */\nexport const generateDurationOptionsFromGroups = (date: DateTZ, durationGroups: DurationGroup[], extended: boolean): SelectOption[] => [\n ...(durationGroups.map(duration => generateDurationOptions(date, duration.max, duration.start, duration.step, extended)).reduce(((previousValue, currentValue) => {\n previousValue.push(...currentValue);\n return previousValue;\n }), [])),\n // allDayOption,\n // oneWeekOption\n ];\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-zoom-warning',\n templateUrl: './zoom-warning.component.html',\n styleUrls: ['./zoom-warning.component.scss']\n})\nexport class ZoomWarningComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onCloseClick(): void {\n this.dialogRef.close();\n }\n}\n","
\n

Excessive zoom warning

\n
\n\n
\n
\n

\n
\n
\n
\n\n
\n \n
\n
","export * from './lib/user.module';\nexport * from './lib/user.actions'\nexport * from './lib/user.types'\nexport * from './lib/user.reducer'\n","import { \n createLoadingAction\n } from '../../../loading/src/lib/loading.actions';\nimport {\n UserState,\n UserStoreState\n} from './user.types';\nimport { User } from '../../../data-common/src/lib/users/user.class';\nimport { createSelector } from '@ngrx/store';\n\nexport const loadUser = createLoadingAction('CurrentUser', 'current');\n\nexport const selectUserState = ({ user }: UserStoreState) => user;\n\nexport const selectHasUserData = createSelector(createSelector(selectUserState, loadUser.selectors.model), (state) => !!state.optionalSuccess);\n\nexport const selectCurrentUser = createSelector(selectUserState, loadUser.selectors.optionalSuccess);\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\nimport { UsersService } from '../../../data-common/src/lib/users/users.service';\n\n\n@Injectable()\nexport class UserEffects {\n\n constructor(private actions: Actions,\n private userService: UsersService) {\n }\n\n @Effect()\n loadUser = createLoadingEffect(this.actions, loadUser, () => this.userService.loadCurrentUser());\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { StoreModule } from '@ngrx/store';\nimport { userReducer } from './user.reducer';\nimport { EffectsModule } from '@ngrx/effects';\nimport { UserEffects } from './user.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n StoreModule.forFeature('user', userReducer),\n EffectsModule.forFeature([UserEffects])\n ]\n})\nexport class UserModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { UserState } from './user.types';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\n\n\nexport const initialUserState: UserState = {\n current: LoadingModel.empty()\n};\n\nexport const userReducer = createReducer(initialUserState,\n ...loadUser.ons);\n","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./$$_lazy_route_resource lazy recursive\";","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { ShellWrapperComponent } from './shell/shell.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: ShellWrapperComponent,\n children: [\n {\n path: 'home',\n loadChildren: () => import('./booking/booking.module').then((m) => m.BookingModule),\n },\n { path: '**', redirectTo: 'home' },\n ],\n },\n { path: '**', redirectTo: 'home' },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, { useHash: true })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective, detectIE } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingsService,\n OrganisationService,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { environment } from 'src/environments/environment';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ZoomWarningComponent } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: [\n './styles/app.component.scss',\n './styles/custom-element.styles.scss',\n './styles/native-element.styles.scss'\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class AppComponent extends BaseDirective implements OnInit {\n constructor(\n private _app: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private _router: Router,\n private _route: ActivatedRoute,\n private _dialog: MatDialog,\n ) {\n super();\n\n // ensure app is trusted in dev mode so we can preserve login.\n if (!environment.production) {\n localStorage.setItem('trusted', 'true');\n }\n\n\n if (detectIE() && detectIE() < 12) {\n location.href = `${location.origin}${location.pathname}assets/not-supported.html`;\n return;\n }\n }\n\n public ngOnInit(): void {\n this._router.events.subscribe((val: NavigationStart) => {\n const bookingForm = JSON.parse(localStorage.getItem('bookingForm'));\n if (val && val.navigationTrigger && val.url) {\n // Redirect everyone who doesn't have an active bookingForm back to the home page.\n const cleanHash = location?.hash.split('?')[0];\n const isLoadBookingUrl = cleanHash.indexOf('#/home/booking/') === 0;\n const isLoadCateringUrl = cleanHash.indexOf('#/home/catering/') === 0;\n if (!isLoadBookingUrl && !isLoadCateringUrl && cleanHash && ['#/home', '#/home/manage', '#/home/create', '#/home/edit'].indexOf(cleanHash) === -1 && bookingForm && !bookingForm?.activeForm) {\n location.href = `${location.origin}`;\n return;\n }\n }\n\n })\n this.adjustZoom();\n }\n\n private adjustZoom() {\n const clientWidth = document.body.clientWidth;\n if (this.isMobileOrTablet()) { // Do not show the warning if it's a mobile or tablet device\n return;\n }\n if (clientWidth < 1300) {\n this._dialog.open(ZoomWarningComponent);\n }\n }\n private isMobileOrTablet(): boolean {\n const userAgent = navigator.userAgent || navigator.vendor;\n const maxTouchPoints = navigator.maxTouchPoints || 0; // Check for touch points \n if (maxTouchPoints > 0 && window.innerWidth <= 1024) {\n return true;\n } // Check for common mobile/tablet user agent strings \n const mobileAgents = ['Android', 'webOS', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'IEMobile', 'Opera Mini'];\n for (const agent of mobileAgents) {\n if (userAgent.indexOf(agent) > -1) {\n return true;\n }\n }\n return false;\n }\n}\n","
\n \n
\n","// remove after trigger build\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { NgModule } from '@angular/core';\nimport { HttpClientModule } from '@angular/common/http';\nimport { FormsModule } from '@angular/forms';\nimport { MAT_LABEL_GLOBAL_OPTIONS } from '@angular/material/core';\n\nimport { ComposerModule } from '@placeos/composer';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { environment } from '../environments/environment';\nimport { SharedContentModule } from './shared/shared.module';\n\nimport { ShellWrapperComponent } from './shell/shell.component';\nimport {\n ActionReducer,\n MetaReducer,\n StoreModule\n} from '@ngrx/store';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport { BookingModule } from 'src/app/booking/booking.module';\nimport { BookingsModule } from '@mckinsey-converge/bookings';\nimport { BuildingsModule } from '@mckinsey-converge/buildings';\nimport { EffectsModule } from '@ngrx/effects';\nimport { DEFAULT_SETTINGS } from 'src/environments/settings';\nimport { provideMockSettingsObject } from '@mckinsey-converge/data-common';\nimport { OrganisationModule } from '@mckinsey-converge/organisation';\nimport { localStorageSync } from 'ngrx-store-localstorage';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { RoomsModule } from '@mckinsey-converge/rooms';\nimport { ENVIRONMENT_TOKEN } from '@mckinsey-converge/environment';\nimport { LegacyOverlaysModule } from '@mckinsey-converge/legacy-overlays';\nimport { UserModule } from '@mckinsey-converge/user';\nimport { MapModule } from 'src/app/map/map.module';\n\n/**\n * Cache some state in local storage. Not for use in production.\n */\nexport function localStorageSyncReducer(reducer: ActionReducer): ActionReducer {\n // Keys needed to fix prod reloading. MCK-1229\n let keys = [\n 'buildings',\n 'bookingForm',\n 'rooms',\n ];\n\n if (!environment.production) {\n keys = [\n 'bookings',\n 'buildings',\n 'organisation',\n 'bookingForm',\n 'rooms',\n 'user'\n ];\n }\n\n return localStorageSync({\n keys,\n rehydrate: true,\n })(reducer);\n}\n\nconst metaReducers: Array> = [localStorageSyncReducer];\n\n\n@NgModule({\n declarations: [\n AppComponent,\n ShellWrapperComponent\n ],\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n AppRoutingModule,\n HttpClientModule,\n FormsModule,\n ComposerModule,\n SharedContentModule,\n LegacyOverlaysModule,\n StoreModule.forRoot({}, { metaReducers }),\n StoreDevtoolsModule.instrument({\n maxAge: 100,\n logOnly: environment.production\n }),\n EffectsModule.forRoot(),\n BookingsModule,\n BookingModule,\n BuildingsModule,\n MapModule,\n OrganisationModule,\n RoomsModule,\n UiModule,\n UserModule\n ],\n providers: [\n { provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: { float: 'nevet' } },\n provideMockSettingsObject(DEFAULT_SETTINGS),\n { provide: ENVIRONMENT_TOKEN, useValue: environment }\n ],\n bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n","import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { BookingStateService, OrganisationService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, getTimezoneOffsetString, toMiddayUTC } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'calendar-date-widget',\n templateUrl: './calendar-date-widget.component.html',\n styleUrls: ['./calendar-date-widget.component.scss'],\n})\nexport class CalendarDateWidgetComponent extends BaseDirective implements OnInit {\n /** Currently selected date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Currently building timezone */\n @Input() public timezone: string;\n /** Currently active zone */\n @Input() public zone: string;\n /** Whether to show new item button */\n @Input() public show_add_item = false;\n /** Whether to show the events for the active month */\n @Input() public show_events: boolean = false;\n /** Preserve last selected date */\n @Input() public retainSelectedDate: boolean = false;\n /** Emitter for changes selected date */\n @Output() public dateChangeTz = new EventEmitter();\n /** Emitter for add item button */\n @Output() public event = new EventEmitter();\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n public event_map: { [date: string]: number };\n\n public fromDateTz = DateNow().subtractValue({ months: 6 });\n\n public get now() {\n return DateNow();\n }\n\n /** Display string for the currently selected date */\n public get tz(): string {\n return getTimezoneOffsetString(this.timezone_value);\n }\n\n public get timezone_value() {\n return localStorage.getItem('CONCIERGE.timezone') || this.timezone || this.now.building_tz;\n }\n\n public get is_today() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone_value,\n }),\n 'day'\n );\n }\n\n constructor(private _bookings: BookingStateService, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // CONCIERGE.date: Get the localstorage date and timezone when changing pages.\n let date: any;\n if(!this.retainSelectedDate) {\n date = +localStorage.getItem('CONCIERGE.date') || this.now.ms;\n } else {\n date = this.now.ms;\n }\n\n \n /* istanbul ignore else */\n if (date && (date !== this.dateTz.ms || this.timezone_value !== this.dateTz.building_tz)) {\n // CONCIERGE.date Reapply the localstorage date and timezone when changing pages.\n this.timeout(\n 'init',\n () => {\n this.dateTz = new DateTZ({\n date,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n this.updateDate();\n },\n 10\n );\n }\n this.subscription(\n 'events',\n this._bookings._noOfMeetings.subscribe((list) => {\n this.event_map = {};\n this.event_map = list[0];\n })\n );\n }\n\n public noOfCount(event) {\n // Disabling bellow until find more reliable way to call as it is been called multiple times on hover/click\n // this._bookings.getDailyMeetingCount();\n // event.stopPropogation();\n }\n\n /**\n * Change the selected date with the arrow controls\n *\n */\n public changeDate(value: number) {\n let date = new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n date = date.addValue({ days: value });\n this.dateTz = date;\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n /**\n * Change the selected date with the calendar widget\n *\n */\n public applyDatePickerValue(dateInputTz: DateTZ) {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(dateInputTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n this.closeDatePicker();\n }\n\n public updateDate() {\n this.timeout('update_date', () => this._bookings.setDate(this.dateTz));\n }\n\n /** Reset date to the current date */\n public resetDate() {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(this.now).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n public closeDatePicker() {\n this.updateDate();\n }\n\n /** New Item button click */\n public newItem(): void {\n this.event.emit('new_item');\n }\n}\n","
\n\n \n
\n
\n \n
\n

Today

\n

{{ dateTz.ms | date: 'mediumDate':tz }}

\n
\n \n
\n
\n \n \n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\n\nconst routes: Routes = [\n { path: '', component: BookingCalendarWrapperComponent },\n { path: ':level', component: BookingCalendarWrapperComponent },\n { path: '**', redirectTo: '' }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingCalendarRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingFormData,\n BookingsService,\n Building,\n OrganisationService,\n SettingsService,\n SpacesService,\n selectActiveForm\n} from '@mckinsey-converge/data-common';\nimport { Store, select } from '@ngrx/store';\nimport { distinctUntilChanged, first } from 'rxjs/operators';\n\nimport { RoutePayload, TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'booking-calendar-wrapper',\n templateUrl: './booking-calendar-wrapper.html',\n styleUrls: ['./booking-calendar.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookingCalendarWrapperComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n orgBuildings: Building[] = [];\n \n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private settingService: SettingsService,\n private store: Store,\n ) {\n super();\n\n \n }\n\n public ngOnInit(): void {\n /** allow booking bypass to receive bookings for staff calendar view only */\n this.settingService.bypass_bookings = true;\n\n this.orgBuildings = this._org.buildings;\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz) {\n localStorage.setItem('CONCIERGE.date', `${next.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${next.timezone}`);\n const building = this._org.buildings.find(\n (_) => _.id === next.location.filter(el => el.groupChild)[0]?.meta?.building?.id\n );\n if(building) {\n this._org.building = building;\n }\n \n }\n }));\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.orgBuildings = this._org.buildings;\n })\n\n \n }\n\n public onBackCallback() {}\n\n public ngOnDestroy(): void {\n /** disallowed booking bypass when you are moving from staff app calendar view*/\n this.settingService.bypass_bookings = false;\n }\n\n}\n","
\n\t
\n\t\t \n\t\t\n\t
\n\t\n\t\n
","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\nimport { StaffCalendarComponent } from './staff-calendar/staff-calendar.component';\nimport { CalendarDateWidgetComponent } from './booking-calendar-date-widget/calendar-date-widget.component';\nimport { DayViewTimelineComponent } from './staff-calendar/timeline/timeline.component';\nimport { DayViewSpaceComponent } from './staff-calendar/space/space.component';\nimport { DayViewSpaceEventComponent } from './staff-calendar/space/event/event.component';\n\n\nimport { BookingCalendarRoutingModule } from './booking-calendar-routing.module';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { UiModule } from '@mckinsey-converge/ui';\n\nimport {CngMenuItemComponent} from './cng-menu-item/cng-menu-item.component';\n\nexport const bookingModuleDeclarations = [\n BookingCalendarWrapperComponent,\n StaffCalendarComponent,\n CalendarDateWidgetComponent,\n DayViewTimelineComponent,\n DayViewSpaceComponent,\n DayViewSpaceEventComponent,\n CngMenuItemComponent\n ];\n\nexport const bookingModuleImports = [\n CommonModule,FormsModule,\n ReactiveFormsModule,\n SharedContentModule,\n UiModule,\n \n \n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingCalendarRoutingModule,\n // StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingCalendarModule {\n}","import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NavItem} from './nav-item';\nimport { MatMenu } from '@angular/material/menu';\n\n@Component({\n selector: 'cng-menu-item',\n templateUrl: './cng-menu-item.component.html',\n styleUrls: ['./cng-menu-item.component.scss']\n})\nexport class CngMenuItemComponent implements OnInit {\n @Input() items: NavItem[];\n @Input() activeOption: string;\n @ViewChild('childMenu', {static: true}) public childMenu: any;\n\n @Output() public onChildSelect = new EventEmitter<{}>();\n \n constructor(public router: Router) {\n }\n\n ngOnInit() {\n }\n\n public notifySelection(node) {\n this.onChildSelect.emit(node);\n }\n}\n","\n \n \n 0\">\n \n \n \n \n \n \n \n \n \n ","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space, BOOKING_STATUS, CloseDialogService, DialogIds, BookingStoreState, User } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { CateringOrder } from '@mckinsey-converge/data-common';\n\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState, selectCurrentUser } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { take } from 'rxjs/operators';\n\n/** Details about the associated event overlapping with other events */\nexport interface IEventOverlap {\n /** Index of this item with the overlapping items */\n index: number;\n /** Total number of items overlapping with this one */\n total: number;\n}\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n \n@Component({\n selector: 'day-view-space-event',\n templateUrl: './event.component.html',\n styleUrls: ['./event.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewSpaceEventComponent extends BaseDirective implements OnInit, OnChanges {\n /** Event to display */\n @Input() public booking: Booking;\n /** Date to display bookings for */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Space associated with the booking */\n @Input() public space: Space;\n /** Whether the item is a fixed size */\n @Input() public fixed: boolean;\n /** Overlap details for the booking */\n @Input() public overlap: IEventOverlap;\n /** Whether an action is being processed for this booking */\n @Input() public loading: boolean;\n /** Emitter for the current position of the booking within the timeline */\n @Output() public position = new EventEmitter<{ top: number; height: number }>();\n\n /** Position of the booking start time in the day */\n public top: number;\n /** Position of the booking relative to overlapping bookings */\n public left: number;\n /** Height based of the duration of the booking */\n public height: number;\n /** Size of the booking when overlapping with other bookings */\n public width: number;\n /** Offset from the booking's top that the setup time starts */\n public overflow_top: number;\n /** Offset from the booking's bottom that the breakdown time ends */\n public overflow_bottom: number;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n currentUser: User;\n constructor(\n private _service: ApplicationService,\n public store: Store,\n private _dialog: MatDialog,\n private _router: Router,\n private cdRef: ChangeDetectorRef,\n private closeDialogService: CloseDialogService\n ) {\n super();\n }\n\n ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n public get local_id(): string {\n return this.booking.icaluid.substr(0, 6);\n }\n\n /** Type of booking */\n public get type(): string {\n const userEmail = this.currentUser.email;\n const { creator, organiser } = this.booking;\n if(userEmail === creator.email || userEmail === organiser.email) \n return this.booking.getType();\n else \n return 'others-booking';\n }\n\n /** Period that the booking will occur during the day */\n public get period(): string {\n // the booking time is being pass in as the local timezone version.\n return this.booking.time_period;\n }\n\n /** Number attendees expected to turn up to the booking */\n public get expected(): number {\n const expected = this.booking.expected_attendees;\n return this.space ? expected[this.space.email] || 0 : 0;\n }\n\n /** Whether the meeting has catering attached */\n public get has_catering(): boolean {\n return !!this.order;\n }\n\n public get order(): CateringOrder {\n return this.booking.catering.find((order) => order.location_id === this.space.email);\n }\n\n /** Whether booking is active */\n public get active(): boolean {\n const booking = this._service.get('CONCIERGE.day_view.viewing');\n return !booking || booking.id === this.booking.id;\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.booking || changes.overlap || changes.dateTz) {\n this.calculatePosition();\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n }\n }\n\n /** Store the order details for viewing in another component */\n public storeOrder(order: CateringOrder) {\n const booking_details = this.booking.toApiJSON();\n localStorage.setItem('CONCIERGE.view_order', JSON.stringify(order.toJSON()));\n localStorage.setItem('CONCIERGE.view_booking', JSON.stringify(booking_details));\n localStorage.setItem('CONCIERGE.date', `${this.booking.startDateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.booking.startDateTz.building_tz}`);\n }\n\n /**\n * View catering order for the booking\n */\n public viewOrder(order: CateringOrder) {\n /* istanbul ignore else */\n if (this.booking && this.booking.catering) {\n /* istanbul ignore else */\n if (localStorage) {\n this.storeOrder(order);\n }\n this._router.navigate(['/catering', 'orders'], {\n queryParams: { booking: this.booking.id, view: order.id },\n });\n }\n }\n\n /** Calculate the position */\n private calculatePosition() {\n /* istanbul ignore else */\n if (this.booking) {\n const overlap = this.overlap || { index: 0, total: 1 };\n const shown_date = this.dateTz.startOfValue('day');\n const date = this.booking.startDateTz.startOfValue('minute');\n const end = this.booking.endDateTz.startOfValue('minute');\n const from_previous_day = !date.isSameDate(shown_date, 'day');\n if (end.isBeforeDate(shown_date, 'day')) { // Hide booking if not on shown date\n this.top = -100;\n this.height = 1;\n return;\n }\n\n //R-- Stragest thing, but one time this was logging bookings form different timezones?\n // this.dateTz.logDateTz('calculatePosition this.dateTz')\n // this.booking.startDateTz.logDateTz('calculatePosition this.booking.startDateTz')\n\n const start = from_previous_day ? 0 : Math.abs(+date.dateDiff(shown_date, 'hours', 'hours').toFixed(3));\n const duration = Math.min(\n this.booking.duration,\n Math.abs(shown_date.dateDiff(date.addValue({ minutes: this.booking.duration }), 'minutes'))\n );\n this.top = Math.max(0, (start / 24) * 100);\n this.height = Math.min(\n 100 - this.top,\n this.fixed ? duration / 60 : (duration / 60 / 24) * 100\n );\n this.position.emit({ top: this.top, height: (duration / 60 / 24) * 100 });\n this.width = Math.min(100, 100 / overlap.total + 5);\n this.left = Math.min(100 - this.width, this.width * overlap.index - 5 * overlap.index);\n this.overflow_top =\n (this.booking.setup[this.space.email]\n ? (this.booking.setup[this.space.email] / 60) / duration\n : -0.1) * 100;\n this.overflow_bottom =\n (this.booking.breakdown[this.space.email]\n ? (this.booking.breakdown[this.space.email] / 60) / duration\n : -0.1) * 100;\n if (this.booking.all_day) {\n this.top = 0;\n this.height = 100;\n }\n }\n }\n\n public get emailURL() {\n const userEmail = this.currentUser.email;\n const userName = this.currentUser.name\n const { creator, organiser } = this.booking;\n\t\treturn `mailto:${encodeURIComponent(organiser.email)}?cc=${encodeURIComponent(userEmail)}&subject=Request%20to%20release%20room%20reservation%20-%20${encodeURIComponent(this.space.simple_name)}`;\n\t}\n\n /** Whether booking has been ended */\n public expired(): boolean {\n return ['started','in_progress','expired_yesterday', 'done'].includes(this.booking.timeBasedStatusLabel);\n }\n}\n","\n \n \n 50 ? ' low' : '')\"\n [style.z-index]=\"(overlap?.index || 0) + 2\"\n \n >\n
\n
{{ booking.all_day ? 'All Day' : period }}
\n
\n \n\n \n \n
\n
\n
\n
\n
Host: 
\n
\n {{ booking.organiser?.name || booking.organiser }}\n
\n
\n \n
Booked by: 
\n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n
\n
{{ booking.title }}
\n
\n
\n
\n {{ booking.attendees ? booking.attendees.length || 'No' : 'No' }} Attendee{{\n booking.attendees?.length === 1 ? '' : 's'\n }}{{ expected ? '(' + expected + ' Expected)' : '' }}\n
\n
\n
0\">\n
\n Company: {{ booking.company.length }}\n
\n
\n
\n
Welcomed by: {{ booking.organiser?.name || booking.organiser }}
\n
\n
\n
Catered
\n
\n
\n \n \n \n \n\n","import {\n Component,\n OnChanges,\n Input,\n SimpleChanges,\n Output,\n EventEmitter,\n ViewChild,\n ElementRef,\n OnInit,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { CdkDragMove, CdkDragDrop } from '@angular/cdk/drag-drop';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first } from 'rxjs/operators';\n\nimport { IEventOverlap } from './event/event.component';\nimport { BaseDirective, closestToTimeSlotTz, Identity } from '@mckinsey-converge/base';\nimport { OrganisationService, Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { ConfirmModalComponent } from '@mckinsey-converge/legacy-overlays';\nimport { DialogEvent, HashMap } from '@mckinsey-converge/base';\nimport { DayViewSettings } from '@mckinsey-converge/data-common';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { BookingsService } from '@mckinsey-converge/data-common';\n\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\n@Component({\n selector: 'day-view-space',\n templateUrl: './space.component.html',\n styleUrls: ['./space.component.scss'],\n})\nexport class DayViewSpaceComponent extends BaseDirective implements OnInit, OnChanges {\n /** List of space dropzones connected to */\n @Input() public space_list: string[];\n /** Date to display events for */\n @Input() public dateTz: DateTZ;\n /** Space to display events for */\n @Input() public space: Space;\n /** Scroll value of the day view */\n @Input() public scroll: number;\n /** Only show events with setup and/or breakdown times */\n @Input() public overflow_only: boolean;\n /** Mapping of whether to show events with a given legend id */\n @Input() public legend: HashMap = {};\n /** Scroll value to add to drop placeholders */\n @Input('scrollTop') public scroll_top: number;\n /** Last update time of the displayed bookings */\n @Input('lastUpdate') public last_update: number;\n\n @Input() public eventMovingLoader : HashMap = {};\n /** Emitter for whether the space column is in view */\n @Output() public inView = new EventEmitter();\n /** Emitter for whether an event is being dragged */\n @Output() public dragging = new EventEmitter();\n /** Emitter for whether an event is being dropped and moving in progress */\n @Output() public moving = new EventEmitter<{}>();\n /** List of bookings for the current date and space */\n public event_list: Booking[] = [];\n /** Mapping of event IDs to overlap details */\n public overlap_details: HashMap = {};\n /** Mapping of positions of event in the day */\n public position_list: HashMap<{ top: number; height: number }> = {};\n /** Override for mapped position */\n public top: number;\n /** Client Rectangle for the container element box */\n public box: ClientRect;\n /** Whether the space list is in view */\n public in_view: boolean;\n /** ID of the booking with an action processing */\n public override_state: string;\n /** Map of bookings to whether they are loading */\n public loading: HashMap = {};\n /** Settings for day view */\n public settings: DayViewSettings = {} as any;\n\n /** Container element for the component contents */\n @ViewChild('view', { static: true }) private view: ElementRef;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _bookings: BookingsService,\n private _dialog: MatDialog,\n private cdr: ChangeDetectorRef,\n private _org: OrganisationService,\n ) {\n super();\n }\n\n /** Events to display for the active date */\n public events: Booking[] = []\n\n public ngOnInit(): void {\n this.events = this.filterEvents();\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.settings = this._service.setting('app.day_view') || {};\n // this.subscription(\n // 'breakdown',\n // this._service\n // .listen('APP.breakdown')\n // .subscribe((state) => {\n // this.overflow_only = state;\n // this.events = [...this.filterEvents()];\n // })\n // );\n // this.subscription(\n // 'legend',\n // this._service\n // .listen('CONCIERGE.legend')\n // .subscribe((state) => (this.legend = state || {}))\n // );\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...list];\n this.events = [...this.filterEvents()];\n this.cdr.detectChanges();\n })\n );\n this.checkInView();\n });\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.scroll) {\n this.checkInView();\n }\n if (changes.space) {\n this.event_list = [...this.event_list];\n this.timeout('in_view', () => this.checkInView(), 100);\n }\n /* istanbul ignore else */\n if (changes.last_update) {\n this.timeout('update_overlaps', () => this.calculateOverlaps(), 1000);\n }\n }\n\n //replace this with concierge space.comp filterEvents\n // private filterEvents(): Booking[] {\n // if (this.space) {\n // const bookings = this.event_list;\n // const list = bookings.filter((event) => {\n // if (this.override_state && this.override_state === event.icaluid) {\n // this.loading[event.id] = true;\n // }\n\n // const ignore = event.is_recurrent && event.recurrence_type === 'master';\n\n // return (\n // !ignore && !event.declined && // filtered declied bookings\n // event.room.email === this.space.email &&\n // (!this.overflow_only ||\n // event.setup[event.room.email] ||\n // event.breakdown[event.room.email])\n // );\n // }).map(e => new Booking({...e.toJSON()}) );\n\n // return list;\n // }\n // return [];\n // }\n\n private filterEvents(): Booking[] {\n if (!this.space) {\n return [];\n }\n \n return this.event_list.filter((event) => {\n // Mark as loading if override state matches.\n if (this.override_state && this.override_state === event.icaluid) {\n this.loading[event.id] = true;\n }\n \n const isRecurrentMaster = event.is_recurrent && event.recurrence_type === 'master';\n const isRoomEmailMatch = event.multi_rooms.some(room => room.email === this.space.email);\n \n // Determine if the event should be included based on setup or breakdown conditions.\n const isIncludedInSetupOrBreakdown = event.multi_rooms.some(room => {\n return event.setup[room.email] || event.breakdown[room.email];\n });\n \n return !isRecurrentMaster && isRoomEmailMatch && (!this.overflow_only || isIncludedInSetupOrBreakdown);\n }).map(event => new Booking({...event.toJSON()}));\n }\n\n /* istanbul ignore next */\n /**\n * Track by function for ngFor optimisation\n * @param index Index of the item\n * @param item Data associated with the item at the given index\n */\n public trackByFn(index: number, item: Booking) {\n return item.id || index;\n }\n\n /**\n * Calculate to overlap details for the booking events on the space\n */\n private calculateOverlaps() {\n const events = this.events.sort(\n (a, b) =>\n a.startDateTz.ms - b.startDateTz.ms ||\n a.duration - b.duration ||\n (a.title || '').localeCompare(b.title || '')\n );\n events.forEach((i) => (this.overlap_details[i.id] = { index: 0, total: 1 }));\n for (const bkn of events) {\n const bkn_start = bkn.startDateTz.startOfValue('minute');\n const bkn_end = bkn.endDateTz.startOfValue('minute');\n let count = 1;\n let index = 0;\n const collisions: Booking[] = [];\n for (const cmp of events) {\n /* istanbul ignore else */\n if (bkn.id !== cmp.id) {\n const cmp_start = cmp.startDateTz.startOfValue('minute');\n const cmp_end = cmp.endDateTz.startOfValue('minute');\n /* istanbul ignore else */\n if (\n bkn_start.isSameDate(cmp_start, 'minute') ||\n (bkn_start.isAfterDate(cmp_start) && bkn_start.isBeforeDate(cmp_end)) ||\n bkn_end.isSameDate(cmp_end, 'minute') ||\n (bkn_end.isAfterDate(cmp_start) && bkn_end.isBeforeDate(cmp_end))\n ) {\n count++;\n collisions.push(bkn);\n /* istanbul ignore else */\n if (\n events.findIndex((i) => i.id === bkn.id) >\n events.findIndex((i) => i.id === cmp.id)\n ) {\n index++;\n }\n }\n }\n }\n this.overlap_details[bkn.id] = { index: Math.max(0, index), total: count };\n }\n }\n\n /**\n * Check whether the space column is with the view of the\n */\n private checkInView() {\n /* istanbul ignore else */\n if (this.view && this.view.nativeElement) {\n const el = this.view.nativeElement;\n this.in_view =\n el.offsetLeft + this.scroll >= -240 &&\n el.offsetLeft + this.scroll <= window.innerWidth;\n this.inView.emit(this.in_view);\n }\n }\n\n /**\n * Initialise drag events\n */\n public initDrag() {\n this.box = this.view.nativeElement.getBoundingClientRect();\n this.dragging.emit(true);\n }\n\n /**\n * Cleanup after drag\n */\n public endDrag() {\n this.timeout('end_drag', () => (this.top = 0), 10);\n this.dragging.emit(false);\n }\n\n /**\n * Update top position of the dragged event placeholder\n * @param booking Booking being dragged\n * @param event Drag event\n */\n public updateDragTop(event: CdkDragMove) {\n /* istanbul ignore else */\n if (event.delta.y) {\n const y = event.pointerPosition.y;\n const top = (y - this.box.top - this.scroll_top) / this.box.height;\n const top_minutes = (Math.round((top * 24 * 60) / 15) * 15) / 60;\n this.top = (top_minutes / 24) * 100;\n\n }\n }\n\n\n\n\n\n public checkAvailabilityOnGivenTime(selectedBlockStart, selectedBlockEnd) {\n const runningBookings =\n this.events?.filter((bks) => {\n const startEpoch = new DateTZ({\n date: bks.start_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const endEpoch = new DateTZ({\n date: bks.end_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const hasValidBreakdown: boolean =\n bks.breakdown &&\n Object.values(bks.breakdown).some((value) => value !== null);\n if (selectedBlockStart.ms === endEpoch && hasValidBreakdown) {\n return true;\n } else\n return (\n (selectedBlockStart.ms >= startEpoch && selectedBlockStart.ms < endEpoch) ||\n (selectedBlockEnd.ms > startEpoch && selectedBlockEnd.ms < endEpoch)\n );\n }) || [];\n return !!runningBookings.length;\n }\n\n\t\t/** Whether booking has been ended */\n public expired(booking): boolean {\n\t\t\treturn booking.timeBasedStatusLabel === 'done';\n\t\t}\n\n\t\t\n}\n","\n\n
\n
\n
\n
\n
\n\n \n \n \n\t\t\n
\n
\n \n
\n
\n
\n \n\n\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first, take } from 'rxjs/operators';\n\nimport { BaseDirective, HashMap, Identity } from '@mckinsey-converge/base';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\nexport interface NavItem {\n\tdisplayName: string;\n\ticonName?: string;\n\troute?: string;\n\tmeta?:{}; \n\tchildren?: NavItem[];\n}\n\n\nimport {\n ApplicationService,\n BookingStateService,\n BookingStoreState,\n BuildingLevel,\n OrganisationService,\n selectBookingByIdResultsFromState,\n User,\n Booking,\n SpacesService,\n Space,\n Building,\n searchRoomsAndBookings\n} from '@mckinsey-converge/data-common';\n\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { BuildingStoreState } from 'libs/buildings/src';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { Subscription } from 'rxjs';\nimport { DropdownOpion } from '@mckinsey-converge/ui';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'staff-calendar',\n templateUrl: './staff-calendar.component.html',\n styleUrls: ['./staff-calendar.component.scss']\n})\nexport class StaffCalendarComponent extends BaseDirective implements OnInit {\n /** Currently selected date, starts out with no timezone data, gets updated later */\n public dateTz: DateTZ = DateNow(new Date());\n\n /** ID of the currently selected level */\n public active_level: string = '';\n /** ID of the currently selected type */\n public active_type: string = '';\n /** List of levels available for the active building */\n public levels: BuildingLevel[] = [];\n /** List of space types available for the active building */\n public space_types: Identity[] = [];\n /** Whether to show only items with a setup and/or breakdown time */\n public only_overflow: boolean;\n \n\n\t\tprivate spaceTypesSubscription: Subscription;\n\n\t\tevent_list: Booking[] = [];\n\t\tsearchStr: any;\n\t\tfoundSearchLength: number = 0;\n\t\tsearchedCounter: any = 1;\n\t\tshowSrchWarning: boolean;\n\t\ttotalFoundItem: number = 0;\n spaces: Space[] = [];\n\t\tbuildingsInSameCity: Building[];\n\t\tbuildingMenuItems: NavItem[];\n\t\tactiveBuildingName: string;\n\t levelsDD: any = [];\n\t roomLevelDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; };\n \n\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _dialog: MatDialog,\n private _router: Router,\n private _route: ActivatedRoute,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this._service.title = 'Day View';\n\n\t\t\t\tthis._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Init dateTz here once the organization data is loaded.\n this.dateTz = new DateTZ({ date: this.dateTz.ms, is_local_tz: false, building_tz: this.timezone });\n this.subscription(\n 'route.params',\n this._route.paramMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('level') && this.active_level !== params.get('level')) {\n const level = this._org.levelWithID(params.get('level'));\n /* istanbul ignore else */\n if (level) {\n const building = this._org.buildings.find(\n (bld) => bld.id === level.building_id\n );\n /* istanbul ignore else */\n if (building) {\n this.active_level = level.id;\n this._org.building = building;\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n }\n }\n }\n })\n );\n this.subscription(\n 'building',\n this._org.listen('active_building').subscribe(() => {\n this._booking_state_service.updateRoomList();\n // Update dateTz here when the building is changed.\n\t\t\t\t\t\t\t\t\t\tthis.dateTz = new DateTZ({\n\t\t\t\t\t\t\t\t\t\t\tdate: this.dateTz.ms,\n\t\t\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\t\t\tbuilding_tz: this.timezone,\n\t\t\t\t\t\t\t\t\t\t});\n const building = this._org.building;\n\n /* istanbul ignore else */\n if (!building.levels.find((lvl) => lvl.id === this.active_level)) {\n this.active_level = building?.levels[0]?.id;\n this.updateLevel();\n }\n\t\t\t\t\t\t\t\t\t\tthis.initSpace();\n\n this.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\t\t\t\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\t\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\t\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.levelsDD = [];\n\t\t\t\t\t\t\t\t\t\tthis.levels.forEach(el => {\n\t\t\t\t\t\t\t\t\t\t\tthis.levelsDD.push({\n\t\t\t\t\t\t\t\t\t\t\t\t display: el.name, value: el.id, meta: {} \n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\tthis.roomLevelDD = {\n\t\t\t\t\t\t\t\t\t\t\tddBoxClass: 'room-level',\n\t\t\t\t\t\t\t\t\t\t\toptions: this.levelsDD,\n\t\t\t\t\t\t\t\t\t\t\tdefaultSelected: this.levelsDD.filter(el => el.value === this.active_level )[0],\n\t\t\t\t\t\t\t\t\t\t\tonChangeCallback: this.onChangeActiveLevel.bind(this)\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\tthis.buildingsInSameCity = this._org.buildings.filter(\n\t\t\t\t\t\t\t\t\t\t\t(_) => _.city === building.city\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.generateBuildingMenu();\n\n \n })\n );\n \n });\n\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...this.filterEvents(list)];\n\n })\n );\n }\n\n private filterEvents(list): Booking[] {\n\t\t\tconst bookings = list;\n\t\t\tconst filterd_booking = bookings.filter((event) => {\n\t\t\t\t\tconst ignore = event.is_recurrent && event.recurrence_type === 'master';\n\t\t\t\t\treturn ( !ignore );\n\t\t\t});\n\n\t\t\treturn filterd_booking || [];\n }\n\n public initSpace() {\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.active_level ? this._org.building.id : this.active_level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0 && _.bookable);\n })\n );\n }\n\n // isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n \n searchBooking(value) {\n\n // Resetting warning flag\n this.showSrchWarning = false;\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = value.toLowerCase().trim();\n \n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.event_list, ...this.spaces];\n // Filtering the combine array to find matching room or booking\n const filteredItems = searchRoomsAndBookings(allItems, searchValue);\n \n // Updating the total number of found items in serach\n this.totalFoundItem = filteredItems.length;\n\n // Setting showSrchWarning flag if no result were found \n this.showSrchWarning = !this.totalFoundItem;\n\n // Updating lenght of found items for later use\n this.foundSearchLength = this.totalFoundItem - 1;\n\n if(this.searchStr !== value) {\n // Setting the first found as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[0]);\n // Resetting the search counter\n this.searchedCounter = 0;\n }\n else {\n // Handling case where seached string is the same as previou one \n // Incrementing search counter, loopoing back to 0 if it exceed the length of found items\n this.searchedCounter = ( this.searchedCounter < this.foundSearchLength ) ? this.searchedCounter + 1 : 0\n // Setting the next found items as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[this.searchedCounter]);\n }\n\n // Storing the current search string for future camparison\n this.searchStr = value;\n }\n\n\n public ngOnDestroy(): void {\n this._service.set('CONCIERGE.day_view.viewing', []);\n }\n\n\n \n\n // that encapsulates the common elements.\n public get timezone() {\n return this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone');\n }\n\n public updateDateTz(dateTz: DateTZ) {\n this.dateTz = dateTz;\n }\n\n public updateLevel() {\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n\t\t\t\tthis.initSpace();\n // this._router?.url?.includes('/booking-calendar') && this._router.navigate(['/home/results/booking-calendar', this.active_level], {relativeTo: this._route});\n }\n\n\t\tpublic generateBuildingMenu() {\n\n\n\t\t\tif(this.buildingsInSameCity.length) {\n\n\t\t\t\tconst menuItem: NavItem[] = [{\n\t\t\t\t\tdisplayName: this._org.building.name,\n\t\t\t\t\ticonName: 'close',\n\t\t\t\t\tchildren:[]\n\t\t\t\t}];\n\n\n\t\t\t\tthis.buildingsInSameCity.forEach(el => {\n\t\t\t\t\tconst buildingLevels: NavItem[] = [];\n\n\t\t\t\t\tel.levels.forEach(lvl => buildingLevels.push({\n\t\t\t\t\t\tdisplayName: lvl.name,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tlevel_id : lvl.id,\n\t\t\t\t\t\t\tbuilding_id: lvl.building_id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tbuildingLevels.push({ displayName: 'All Levels', children: [], meta: {\n\t\t\t\t\t\t\tlevel_id : '',\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t} \n\t\t\t\t\t});\n\n\t\t\t\t\tmenuItem[0].children.push({\n\t\t\t\t\t\tdisplayName: el.name,\n\t\t\t\t\t\tchildren: buildingLevels,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\tthis.buildingMenuItems = menuItem;\n\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\tpublic updateActiveBuilding (node) {\n\t\t\t// console.log(node);\n\t\t\tconst building = this.buildingsInSameCity.filter(bld => bld.id === node.meta.building_id)[0];\n\t\t\tthis._org.building = building;\n\t\t\tthis.activeBuildingName = building.name;\n\n\t\t\n\t\t\t\tthis.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\n\n\t\t\t\tthis.active_level = node.meta.level_id;\n\t\t\t\tthis.roomLevelDD.defaultSelected = this.levelsDD.filter(el => el.value === this.active_level )[0];\n\t\t\t\tthis.updateLevel();\n\t\t}\n\n\t\tonChangeActiveLevel(level:any) {\n\t\t\tthis.active_level = level.value;\n\t\t\t\n\t\t\tthis.updateLevel();\n\n\t\t}\n\n\t\t\n}\n\n","
\n
\n \n
\n \n
\n \n \n 0\">\n
\n {{activeBuildingName || item.displayName}}\n
\n \n
\n
\n \n
\n \n \n
\n
\n \n 1\">\n\n
\n \n \n \n
{{ totalFoundItem }}
\n \n
\n \n No search found!\n
\n
\n
\n\n \n \n \n \n
\n\n
\n \n
\n
\n
\n\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewChild, NgZone, DoCheck, ChangeDetectionStrategy, ChangeDetectorRef\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { filter, first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { HashMap, Identity } from '@mckinsey-converge/base';\n// import { MeetingDetailsModalComponent } from 'src/app/calendar/meeting-details-modal/meeting-details-modal.component';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, toMiddayUTC } from '@mckinsey-converge/date-tz';\nimport { isToday } from 'date-fns';\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n\n\nconst UPDATE_INTERVAL = 10;\n\n@Component({\n selector: 'day-view-timeline',\n templateUrl: './timeline.component.html',\n styleUrls: ['./timeline.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewTimelineComponent\n extends BaseDirective\n implements OnInit, OnChanges, OnDestroy\n{\n /** DateTZ object of the active date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** ID of the active level */\n @Input() public level: string;\n /** ID of the room type to filter displayed spaces by */\n @Input() public space_type: string;\n /** List of shown legend items */\n @Input() public legend: HashMap = {};\n /** Whether to show only items with a setup and/or breakdown time */\n @Input() public overflow_only: boolean;\n /** Whether space bookings are being loaded */\n @Input() public loading: boolean;\n\n @Input() undo_action;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n /** Top value of the content scroll */\n public scroll_top: number = 0;\n /** Left value of the content scroll */\n public scroll_left: number = 0;\n /** Offset of the scroll value when starting a drag */\n public scroll_offset: number = 0;\n /** List of spaces to display for */\n public spaces: Space[] = [];\n /** List of spaces to display for */\n public filtered_spaces: Space[] = [];\n /** Mapping of space ids to whether they are in view */\n public in_view: { [id: string]: boolean } = {};\n /** Percent of the day that is now */\n public now: number;\n /** Currently active hour of the day */\n public active_hour: string;\n /** Mapping of spaces loading booking date */\n public loading_space: { [id: string]: boolean } = {};\n /** Booking ID to open modal for */\n public view_id: string;\n /** Last update time for the space bookings */\n public last_update: number = 0;\n /** Whether an event is being dragged */\n public is_dragging: boolean;\n /** Client rectangle for the scroll area */\n public box: ClientRect;\n /** Whether to show the holding bay */\n // public show_holding_bay: boolean = true;\n\n public space_zones: string[] = [];\n\n public is_today: boolean = this.isToday();\n public modalInitialized = false;\n\n /** Scrollable area of the day view */\n @ViewChild('scroll_area', { static: true }) private scroll_area: ElementRef;\n\n @ViewChild(CdkVirtualScrollViewport) virtualScroll: CdkVirtualScrollViewport;\n isEventMoving: boolean = false;\n bookingEl: any;\n timeoutID: any;\n column: any;\n\n /** Update scroll box when the window is resized */\n @HostListener('window:resize')\n public onResize() {\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n public get is_loading() {\n return this._booking_state_service.loading;\n }\n\n public isToday() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }),\n 'day'\n );\n }\n\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _org: OrganisationService,\n private _route: ActivatedRoute,\n private _renderer: Renderer2,\n private _dialog: MatDialog,\n private _zone: NgZone,\n private cdr: ChangeDetectorRef,\n ) {\n super();\n }\n\n public get holding_bay(): Space {\n const bld = this._org.building;\n /* istanbul ignore else */\n if (bld && bld.holding_bay) {\n return this._spaces.find(bld.holding_bay);\n }\n return null;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this._booking_state_service.startPollingEveryFiveMin();\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n this._zone.runOutsideAngular(() => {\n this.interval('time', () => this.updateTime(), 15 * 1000);\n });\n // R--- return to see if the booking service needs updating\n this.subscription(\n 'dateTz',\n this._booking_state_service.dateTz.subscribe((dateTz) => {\n // const dateTz = new DateTZ({date});\n this.dateTz = dateTz;\n })\n );\n });\n });\n this.is_today = this.isToday();\n\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n })\n );\n\n }\n\n ngAfterViewInit() {\n const d2 = this._renderer.createElement('div');\n this._renderer.addClass(d2, 'adjustable-room-block-2');\n this.virtualScroll.elementRef && this._renderer.appendChild(this.virtualScroll.elementRef.nativeElement, d2);\n }\n\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.level && this._org.building) {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.updateTime();\n this.initSpaces();\n }\n if (changes.space_type) {\n this.initSpaces();\n }\n }\n\n public ngOnDestroy() {\n if (this._booking_state_service?.stopPolling) this._booking_state_service?.stopPolling();\n }\n\n public init() {\n this._service.title = 'Day View';\n this.subscription(\n 'viewing',\n this._service\n .listen('CONCIERGE.day_view.viewing')\n .subscribe((event) => this.scrollIntoView(event) )\n );\n // Subscribe to route query changes\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('view') || localStorage.getItem('CONCIERGE.view_booking')) {\n this.view_id = params.get('view');\n const details = localStorage.getItem('CONCIERGE.view_booking');\n const spaceJson = localStorage.getItem('CONCIERGE.view_booking_space');\n /* istanbul ignore else */\n if (details) {\n const space: Space | undefined = spaceJson\n ? new Space(JSON.parse(spaceJson))\n : undefined;\n const booking = new Booking({ ...JSON.parse(details), room: space });\n if(!this.modalInitialized) {\n this.modalInitialized = true;\n // this.view(booking, space);\n localStorage.removeItem('CONCIERGE.view_booking');\n localStorage.removeItem('CONCIERGE.view_booking_space');\n }\n }\n }\n })\n );\n \n /* istanbul ignore else */\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n /**\n * Update scroll parameters to match the change in the scroll position\n * @param event\n */\n public updateScroll(event) {\n this.scroll_top = event.target.scrollTop;\n this.scroll_left = event.target.scrollLeft;\n }\n\n\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n\n /** Update the now line position */\n private updateTime() {\n const now = new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n });\n this.now = (now.dateHour + now.minutes / 60) / 24;\n this.active_hour = now.startOfValue('hour').formatDate('HH:mm');\n this.is_today = this.isToday();\n this.cdr.detectChanges();\n }\n\n\n /**\n * Scroll booking to the event on the day view\n * @param booking Booking to scroll into view\n */\n private scrollIntoView(searchData: Booking | Space ) {\n if (searchData && this.scroll_area && this.scroll_area['elementRef'].nativeElement) {\n this.column && this._renderer.removeClass(this.column, 'wild');\n\n /** Select space column element using space id in search data - \n * space.id if seach data is space object or data.space.id if search data is booking object\n * \n */\n const spaceId = searchData['space'] ? searchData['space'].id : searchData.id;\n const element: HTMLDivElement = this.scroll_area['elementRef']\n .nativeElement.querySelector(`#space-col-${spaceId}`);\n\n\n this.column = element;\n\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n if(searchData['space'] && searchData['space'].id) \n this.bookingEl = element?.querySelector(`#${searchData.id}`)?.querySelector('.event-container');\n\n\n /* istanbul ignore else */\n if (element) {\n this.timeoutID && clearTimeout(this.timeoutID);\n this._renderer.addClass(element, 'wild');\n this.bookingEl && this._renderer.addClass(this.bookingEl, 'wild');\n const scroll_box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n\n let date_percent;\n if(searchData['space'] && searchData['space'].id) {\n date_percent = Math.abs(\n searchData['startDateTz'].dateDiff(\n searchData['startDateTz'].startOfValue('day'),\n 'minutes'\n )\n ) / (24 * 60);\n }\n \n\n const box = element.getBoundingClientRect();\n const left = box.left - scroll_box.left + this.scroll_area['elementRef'].nativeElement.scrollLeft - 500;\n const top = (searchData['space'] && searchData['space'].id) ? \n this.scroll_area['elementRef'].nativeElement.scrollHeight * date_percent - 10 :\n 0\n\n\n this.scroll_area['elementRef'].nativeElement.scrollTo({\n left: left,\n top: top,\n behavior: 'smooth',\n });\n\n this.timeoutID = setTimeout(()=> {\n element && this._renderer.removeClass(element, 'wild');\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n }, 3000);\n }\n }\n }\n\n /**\n * Setup an auto-scroll for the display view\n * @param x\n * @param y\n */\n public scrollView(x: number, y: number) {\n /* istanbul ignore else */\n if (x || y) {\n this.scroll_area['elementRef'].nativeElement.scrollTop += y || 0;\n this.scroll_area['elementRef'].nativeElement.scrollLeft += x || 0;\n /* istanbul ignore else */\n if (\n (y &&\n this.scroll_area['elementRef'].nativeElement.scrollTop >=\n this.scroll_area['elementRef'].nativeElement.scrollHeight) ||\n (x &&\n this.scroll_area['elementRef'].nativeElement.scrollLeft >=\n this.scroll_area['elementRef'].nativeElement.scrollWidth) ||\n (y && this.scroll_area['elementRef'].nativeElement.scrollTop <= 0) ||\n (x && this.scroll_area['elementRef'].nativeElement.scrollLeft <= 0)\n ) {\n this.clearInterval('auto_scroll');\n }\n // this.updateScroll({ target: this.scroll_area['elementRef'].nativeElement });\n }\n }\n\n public clearSelected() {\n this._service.set('CONCIERGE.day_view.viewing', null);\n }\n\n public cancelScroll() {\n this.clearInterval('auto_scroll');\n }\n\n /** */\n\n // public dragChange(is_dragging: boolean) {\n // if (is_dragging) {\n // this.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop; \n // this.subscription(\n // 'listen_move',\n // this._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n // const position = { x: event.clientX, y: event.clientY };\n // const y = position.y > this.box.bottom - this.box.height * 0.05\n // ? 1\n // : position.y < this.box.top + this.box.height * 0.05\n // ? -1\n // : 0;\n // const x = position.x > this.box.right - this.box.width * 0.05\n // ? 1\n // : position.x < this.box.left + this.box.height * 0.05\n // ? -1\n // : 0;\n // this.scrollView(x * 5, y * 5);\n // this._zone.runOutsideAngular(() => {\n // this.interval('auto_scroll', () => {\n // return this.scrollView(x * 40, y * 40) \n // }, 15);\n // });\n // this.cdr.detectChanges();\n // })\n // );\n // this.clearInterval('bookings');\n // } else {\n // this.cancelScroll();\n // this.unsub('listen_move');\n // }\n // }\n\n private initSpaces() {\n const holding_bay = this.holding_bay;\n this.filtered_spaces = this.spaces.filter(\n (i) =>\n (!this.space_type || i.zones.indexOf(this.space_type) >= 0) &&\n (!holding_bay || i.id !== holding_bay.id) &&\n i.bookable\n );\n this.filtered_spaces.sort((a, b) => a.local_name.localeCompare(b.local_name));\n this.space_zones = this.spaces.map((i) => `space-col-${i.id}`);\n }\n\n\n\n\t// public onEventDragging(isDragging: boolean): void {\n\t// \t\t// Check if dragging is initiated\n\t// \t\tif (isDragging) {\n\t// \t\t\t// Store the current scroll position\n\t// \t\t\tthis.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop;\n\t// \t\t\t// Subscribe to mouse move events\n\t// \t\t\tthis.subscribeToMouseMove();\n\t// \t\t\t// Clear existing interval for bookings\n\t// \t\t\tthis.clearInterval('bookings');\n\t// \t\t} else {\n\t// \t\t\t// Cancel scroll operation\n\t// \t\t\tthis.cancelScroll();\n\t// \t\t\t// Unsubscribe from mouse move events\n\t// \t\t\tthis.unsubscribeFromMouseMove();\n\t// \t\t}\n\t// }\n\n\t// Subscribe to mouse move events and handle scroll logic\n\t// private subscribeToMouseMove(): void {\n\t// \tthis.subscription(\n\t// \t\t'listen_move',\n\t// \t\tthis._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n\t// \t\t\t// Get mouse position\n\t// \t\t\tconst position = { x: event.clientX, y: event.clientY };\n\t// \t\t\t// Calculate scroll direction based on mouse position\n\t// \t\t\tconst [x, y] = this.calculateScrollDirection(position);\n\t// \t\t\t// Scroll the view based on calculated direction\n\t// \t\t\tthis.scrollView(x * 5, y * 5);\n\t// \t\t\t// Run auto-scroll logic\n\t// \t\t\tthis.runAutoScroll(x, y);\n\t// \t\t\t// Detect changes to update the view\n\t// \t\t\tthis.cdr.detectChanges();\n\t// \t\t})\n\t// \t);\n\t// }\n\n\t// Calculate scroll direction based on mouse position\n\t// private calculateScrollDirection(position: { x: number, y: number }): [number, number] {\n\t// \tconst tolerance = 0.05;\n\t// \tconst x = this.calculateDirection(position.x, this.box.left, this.box.right, tolerance);\n\t// \tconst y = this.calculateDirection(position.y, this.box.top, this.box.bottom, tolerance);\n\t// \treturn [x, y];\n\t// }\n\n\t// Calculate direction based on mouse position and element boundaries\n\t// private calculateDirection(pos: number, min: number, max: number, tolerance: number): number {\n\t// \tif (pos > max - this.box.width * tolerance) {\n\t// \t\t\treturn 1; // Scroll right\n\t// \t} else if (pos < min + this.box.width * tolerance) {\n\t// \t\t\treturn -1; // Scroll left\n\t// \t} else {\n\t// \t\t\treturn 0; // Do not scroll\n\t// \t}\n\t// }\n\n\t// Run auto-scroll logic\n\t// private runAutoScroll(x: number, y: number): void {\n\t// \tthis._zone.runOutsideAngular(() => {\n\t// \t\t\tthis.interval('auto_scroll', () => this.scrollView(x * 10, y * 10), 10);\n\t// \t});\n\t// }\n\n\t// Unsubscribe from mouse move events\n\t// private unsubscribeFromMouseMove(): void {\n\t// \tthis.unsub('listen_move');\n\t// }\n\n // public movingEvent(booking) {\n // this.isEventMoving = booking.isMoving;\n // this.loading_space[booking.movingId] = booking.isMoving;\n \n // }\n\n}\n\n","
\n\t
\n\t\t\n\t
\n\n\t
\n\t\t
\n\t\t\t\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Time
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ timeslot.name }}
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ room.local_name }}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tCapacity - {{ room.capacity || '0' }}\n\t\t\t\t\t\t\t{{ room.capacity === 1 ? 'person' : 'people' }}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t
\n
\n
\n
\n\t
\n\t\t
Moving meeting
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n
\n","import {\n Component,\n Input,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n Router\n} from '@angular/router';\nimport {\n BaseDirective, shorterBuildingDateFormatString,\n} from '@mckinsey-converge/base';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n Booking,\n Building,\n BookingStoreState,\n clearBookingFormData,\n cateringAllowed,\n openBookingSurvey,\n roomHasCateringHours\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface statusObject {\n text: string,\n title: string,\n image: string,\n}\n\n@Component({\n selector: 'booking-confirmation',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n \n

{{ data?.isEditSeries || (booking.is_recurrent && booking.recurrence_type === 'master') ? 'Recurring Series' : 'Booking' }} {{data?.status.title}}

\n
\n \n \n \n
\n
\n
\n

{{ booking.title }}

\n

Room is no longer available for your chosen date and time

\n
\n \n
\n
Status: {{data?.status.text}}
\n
Date: {{data?.dateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.typeString}} meeting ({{data?.durationString}})
\n
\n
\n
\n \n {{booking?.recurrence_period === 'list' ? 'Specific dates' : booking?.recurrence_period | titlecase}}\n \n - Conflicts({{data?.isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{data?.dateString}}
\n
End date: {{data?.endDateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.type}} meeting ({{data?.durationString}})
\n
\n\n
\n \n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n Address: {{building.address}},\n {{building.city}}\n
\n
Room: {{booking.space.local_name}}
\n
Room Capacity: {{booking.space.capacity}}
\n
\n \n
\n \n \n \n \n
\n
\n
\n
\n \n
\n \n

{{ data?.status.text }}

\n
\n
\n \n
\n \n

\n \n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n

{{booking.organiser.name}}

\n

{{attendees}}

\n

{{company}}

\n

{{charge_code}}

\n

{{headcount}}

\n

{{notes}}

\n

\n
\n \n

\n

\n

\n

\n

\n

\n \n \n \n

\n
\n
\n
\n
\n

Catering is available for this meeting room

\n Add catering\n\n \n
\n
\n
\n
\n \n

\n

\n

 

\n \n
\n\n
\n
\n
\n

Ooops - we're sorry!

\n

Unfortunately your selected room has been booked by another user

\n

Please try searching for another room.

\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./booking-confirmation.component.scss']\n})\nexport class BookingConfirmationComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n\n @Input() public confirmed: boolean;\n @Input() public loading: boolean;\n\n @Input() public modal: boolean;\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\t\t@Input('dataForConfirmation') public data: any; // consolidated data using for confirmation template\n\n /** Emitter for close events */\n @Output() public callback = new EventEmitter();\n\n public currentPage: string;\n\n\t\tpublic get booking(): Booking {\n\t\t\treturn this.data?.booking\n\t\t};\n\n\n public get building(): Building {\n return this.data?.booking.room.building;\n };\n\n public get disableCateringButton(): boolean {\n return !cateringAllowed(this.data?.booking, this.building);\n }\n\n public get charge_code() {\n return (this.data?.booking.equipment_codes || {})[\n this.data?.booking.room.email\n ] || 'No Charge Code'\n }\n\n public get headcount() {\n return (this.data?.booking.expected_attendees || {})[\n this.data?.booking.room.email\n ] || 0\n }\n\n public get attendees() {\n const a = Array.isArray(this.data?.booking.attendees) ? this.data?.booking.attendees.map(u => u?.name ? u.name : '') : [];\n return a.join(', ');\n }\n\n public get company() {\n return this.data?.booking.company.join(', ');\n }\n\n public get notes() {\n const note = this.data?.booking.notes.find(n => n.type === 'equipment');\n return note ? note.message : '';\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get roomHasCatering() {\n return roomHasCateringHours(this.building, this.data?.booking?.space) && cateringAllowed(this.data?.booking, this.building);\n }\n\n public listItems(order) {\n return order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.data?.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n }\n\n constructor(\n private store: Store,\n private _router: Router,\n ) {\n super();\n }\n\n public getStatusColor (statusText: string): string {\n switch (statusText) {\n case 'confirmed':\n return 'approved'\n case 'unavailable':\n return 'cancelled'\n default:\n return statusText;\n }\n }\n\n public hasData() {\n return (this.confirmed && !this.loading) || this.isUnavailable();\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public async returnHome() {\n \n if (this.modal || this.placeIntoModal) {\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n } else {\n if(!this.isUnavailable()){\n this.store.dispatch(openBookingSurvey());\n // Clear everything out\n this.store.dispatch(clearBookingFormData());\n this._router.navigate(['/', 'home']);\n } else {\n await this._router.navigate(['/home', 'results'], { queryParams: { display: 'list' }});\n }\n }\n }\n\n public async startCatering() {\n this.store.dispatch(clearBookingFormData());\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n await this._router.navigate(['/', 'home', 'catering', this.data?.booking.id]);\n }\n\n public isUnavailable() {\n return this.data?.status.text.toLowerCase() === 'unavailable'\n }\n\n getTooltipText() { \n return this.data.booking.occurrence_details?.filter(ocurrence => ocurrence.id !== this.data.booking.id).map((item)=>{\n let date = item.start_epoch * 1000;\n let specificDates = new DateTZ({date, is_local_tz: false, building_tz: this.data.booking.timezone});\n return shorterBuildingDateFormatString(specificDates).slice(3);\n })\n }\n\n \n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n Booking,\n BookingFormData,\n selectActiveForm,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n\t\tSpace,\n\t\tgetLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent, shorterLocalDateFormatString } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-booking-create',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingCreateComponent extends BookingFormBaseComponent implements OnInit {\n\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.booking = this.bookingFormToBooking(next);\n }\n }));\n\n\t\t\t\t// in the parent component\n\t\t\t\tthis.updateConfimatinModal();\n }\n\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n this.booking = this.bookingFormToBooking(this.data.value);\n // const booking_form_data = this.data.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n if (!bookable) {\n // Refactored for\n //\thttps://acaprojects.atlassian.net/browse/MCK-1498\n //\thttps://mckinsey.atlassian.net/browse/CNG-97\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n\t\t\t\t\t\t\t\t\t// update template properties and booking\n\t\t\t\t\t\t\t\t\tthis.handleBookingSuccessResponse(bkn);\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n\t\t\t\t\t\t\t\t\t\t\tthis.loading = false;\n \tthis.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n },(err) => {\n this.timeout('error', () => {\n\t\t\t\t\t\t\t\t\tthis.handleBookingErrorMessage();\n }, 500);\n }\n );\n }\n\n}\n","
\n
\n \n

{{ warningMessage }}

\n \n
\n
\n \n \n \n \n
\n
\n
\n
\n
\n
\n

Book {{booking?.space?.local_name}}

\n
\n
\n \n
\n
\n
\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Details

\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
{{type}} meeting ({{durationString}})
\n
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' : data?.value?.recurrence_period | titlecase}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t - Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Start date: {{dateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
End date: {{endDateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Time: {{timeString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{type}} meeting ({{durationString}})
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\n
\n
Address: {{building?.address}},\n {{building?.city}}
\n
Room: {{booking?.space?.local_name}}
\n
Capacity: {{booking?.space?.capacity}}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n","import {Component,OnInit,Input,Output,EventEmitter,\n } from '@angular/core';\n import {\n Booking,\n selectActiveForm,\n BookingFormData,\n\t\tBookingStoreState,\n } from '@mckinsey-converge/data-common';\n import {\n\t\tStore,\n select,\n } from '@ngrx/store';\n import {\n distinctUntilChanged, take,\n } from 'rxjs/operators';\n import { BaseDirective } from '@mckinsey-converge/base';\n\timport {\n\t\tRoomStoreState,\n\t} from '@mckinsey-converge/rooms';\n\timport {\n\t\tBuildingStoreState\n\t} from '@mckinsey-converge/buildings';\n\timport { UserStoreState } from '@mckinsey-converge/user';\n\n\texport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n\n @Component({\n selector: 'app-booking-edit-wrapper',\n template: `
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
`,\n styleUrls: ['./booking-create.component.scss']\n })\n export class BookingEditWrapperComponent extends BaseDirective implements OnInit {\n\n\t\tpublic booking: Booking;\n\t\tpublic loading: boolean = true;\n\n constructor(\n public store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n this.subscription('activeForm',\n this.store.pipe(take(1),\n\t\t\t\t\tselect(selectActiveForm),\n \tdistinctUntilChanged()\n\t\t\t\t\t).subscribe((next: BookingFormData | undefined) => {\n\t\t\t\t\t\tthis.loading = false;\n \t\tif (next && next?.dateTz) {\n \t\tthis.booking = new Booking(next);\n \t\t}\n }));\n\n }\n\n }\n","import {\n Component,\n OnInit,\n Input,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport {\n Booking,\n selectActiveForm,\n storeBookingFormData,\n BookingFormData,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n getLastDateFromList,\n Space,\n SeriesAction\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\n@Component({\n selector: 'app-booking-edit',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingEditComponent extends BookingFormBaseComponent implements OnInit {\n @Input() public booking: Booking;\n @Output() public updateCallback = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n public roomEmail: string;\n\n public ngOnInit(): void {\n super.ngOnInit();\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n\n this.modal = !this.isEditSeries && !this.placeIntoModal;\n this.roomEmail = this.booking.space.email;\n const attendees = (this.data?.value?.attendees?.length && this.data?.value?.attendees[0]?.meta)\n ? this.data.value.attendees\n : this.booking.attendees.filter(bk => bk.name !== '' && bk.email !=='').map(u => {\n return {\n value: u.email,\n display: u.name,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: u.name,\n meta: { external: u.external, user: u, color: u.email.toLowerCase().includes('mckinsey.') ? 'internal' : 'external' },\n }\n });\n\n const company = (this.data?.value?.company?.length && this.data?.value?.company[0]?.groupId)\n ? this.data?.value?.company\n : this.booking.company.map(u => {\n return {\n value: u,\n display: u,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: u,\n }\n });\n\n const head_count = this.booking?.expected_attendees[this.roomEmail] ? this.booking?.expected_attendees[this.roomEmail] : 0;\n const code = this.booking?.equipment_codes[this.roomEmail] ? this.booking?.equipment_codes[this.roomEmail] : '';\n const organiser = (this.data?.value?.organiser && this.data?.value?.organiser?.meta)\n ? this.data?.value?.organiser\n : {\n display: this.booking.organiser.name,\n value: this.booking.organiser.email,\n meta: { user: this.booking.organiser }\n };\n const notes = Array.isArray(this.booking.notes) ? this.booking.notes.find(n => n.type === 'equipment')?.message : this.booking.notes;\n const selectedRoom = this.data?.value?.selectedRoom\n ?\n this.data?.value?.selectedRoom\n :\n {\n space: this.booking.room, // this.building,\n };\n\n const payload = {\n ...this.booking.toJSON(),\n attendees,\n code,\n head_count,\n notes,\n organiser,\n selectedRoom,\n company\n };\n this.store.dispatch(storeBookingFormData({\n payload: payload\n }));\n \n if(this.isEditSeries) {\n this.booking = this.bookingFormToBooking(this.data.value, this.isEditSeries); \n }\n // in parent component\n this.updateConfimatinModal();\n\n\n }\n\n public updateNotes(booking, note, room) {\n const notes = [];\n const cateringNotes = this._cateringNotesService.getNotes();\n const isEquipmentNote = booking.notes.find(note => note.type === 'equipment');\n const isCateringNote = booking.notes.find(note => note.type === 'catering');\n\n if (cateringNotes.length && !isCateringNote) {\n notes.push(cateringNotes[0]);\n }\n\n if (isEquipmentNote) {\n booking.notes.map(item => {\n const message = cateringNotes.length && item.type === 'catering' ? cateringNotes[0].message : item.message;\n\n notes.push({\n ...item,\n author : this.currentUser.name,\n message : item.type === 'equipment' ? note : message,\n space: item.type === 'equipment' ? room : item.space,\n date: item.type === 'equipment' ? new Date().getTime() : item.date\n })\n });\n } else {\n if (note) {\n notes.push({\n author: this.currentUser.name,\n type: \"equipment\",\n message: note,\n space: room,\n date: new Date().getTime()\n })\n }\n }\n return notes;\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n const booking_form_data = this.data.value;\n\n if(!this.isEditSeries) {\n\t\t\t // clone booking to allow editing\n const booking = cloneDeep(this.booking);\n \n\t\t\tbooking.title = booking_form_data.title;\n\t\t\tbooking.attendees = this.formToAttendees(booking_form_data.attendees);\n\t\t\tbooking.company = this.formToCompany(booking_form_data.company);\n\t\t\tbooking.notes = this.updateNotes(this.booking, booking_form_data.notes, this.roomEmail);;\n\t\t\tbooking.equipment_codes = { [this.roomEmail]: booking_form_data.code };\n\t\t\tbooking.expected_attendees = { [this.roomEmail]: booking_form_data.head_count };\n\t\t\tbooking.organiser = booking_form_data.organiser?.meta.user;\n\t\t\tconst has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom?.space?.email || booking?.space?.email]: 900} : null; // 900 seconds = 15 min\n\t\t\t// Removing the note does not remove the existing setup / breakdown\n\t\t\tif (has_note_buffer) {\n\t\t\t booking.setup = has_note_buffer;\n\t\t\t booking.breakdown = has_note_buffer;\n\t\t\t}\n booking.opt_out = booking_form_data.opt_out;\n // booking.outlook_opt_out = booking_form_data.outlook_opt_out;\n\t\t\tthis.booking = booking;\n\t\t }\n\t\t else {\n\t\t\tthis.booking = this.bookingFormToBooking(booking_form_data, this.isEditSeries);\n\t\t }\n\n\n this.loading = true;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n // We expect the current booking to be returned form this api call,\n if (bookable) {\n\n this._bookings_service.save(this.booking, this.isEditSeries).then(\n (bkn) => {\n // update template properties and booking\n this.handleBookingSuccessResponse(bkn);\n // update callback in case of standard booking edit\n this.updateCallback && this.updateCallback.emit(this.booking);\n\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n this.loading = false;\n this.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n } else {\n this.handleBookingErrorMessage();\n return;\n }\n },\n (err) => {\n this.handleBookingErrorMessage();\n }\n );\n }\n\n public callback() {\n this.closeCallback.emit(true);\n }\n\n}\n","import {\n Component,\n OnInit,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport { TopBarHeaderMode, RoutePayload } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n dateLocalFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase,\n dateBuildingFormatString,\n shorterLocalDateFormatString,\n DialogEvent,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n Space,\n SpacesService,\n User,\n BookingNote,\n BookingFormData,\n BookingStoreState,\n storeBookingFormData,\n bookingStatusDetails,\n clearBookingFormData,\n CateringNotesService,\n getLastDateFromList,\n BOOKING_STATUS,\n DataForConfirmation,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n take,\n} from 'rxjs/operators';\nimport {\n BuildingStoreState\n} from '@mckinsey-converge/buildings';\nimport {\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport {\n Router\n} from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-booking-base',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingFormBaseComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results', 'room'],\n queryParams: {}\n };\n\n @Output() public closeCallback = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n public placeIntoModal = false;\n // Eliminate selectedRoom (room building capacity )\n public modal = false;\n public data = new BehaviorSubject(undefined);\n public submitTimestamp: number;\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public updated: boolean;\n /** Display loading template */\n public loading: boolean= false;\n public booking: Booking = new Booking({});\n /** Current User */\n public currentUser: User;\n public invalidForm: boolean = true;\n public showWarningBanner: boolean = false;\n public warningMessage: string;\n\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n\n constructor(\n public _service: ApplicationService,\n public store: Store,\n public router: Router,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _spaces: SpacesService,\n public _cateringNotesService: CateringNotesService,\n public dialog: MatDialog,\n private _users: UsersService\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n\n }\n\n public get building(){\n return this.booking.room.building;\n }\n\n public get type() {\n return this.booking.bookingTypeLabel;\n }\n\n public get internal_external_type() {\n return this.booking.room?.[0].filters.external === true? \"External\" : \"Internal\";\n }\n\n public get date(){\n // R--- remove if no longer used.\n return this.booking.startDateTz;\n }\n\n public get dateString() {\n return this.booking.startDateTz.formatDate('ccc d MMM yyyy'); //shorterLocalDateFormatString(this.booking.startDateTz);\n \n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n public async goToBackRoute() {\n await this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n /**\n * Continue to Booking Form\n */\n public createBooking() { // todo change links based on usage\n // trigger the booking form submit\n this.submitTimestamp = new Date().getTime();\n }\n\n // submit the booking form\n public submitForm(formGroup: any) {\n let creator: User;\n if (formGroup.has_delegate) {\n if (formGroup.organiser.value !== this.currentUser.email) {\n creator = this.currentUser;\n }\n }\n\n // Combines booking with selected form fields and not the entire formGroup like other places.\n // to combine booking with selected form fields on submit - WHY IS THIS NEEDED TO DISPACH TO STORE BOOKING FORM DATA ???\n // THIS ISSUE IS SPILLING INTO - libs/data-common/src/lib/booking/booking.selectors.ts lno: 70\n // - due to .toJSON recurrence_starts becomes Array ?!?\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...this.booking.toJSON(),\n attendees: formGroup.attendees,\n code: formGroup.code,\n head_count: formGroup.head_count,\n notes: formGroup.notes,\n organiser: formGroup.organiser,\n creator,\n title: formGroup.title,\n company: formGroup.company,\n opt_out: formGroup.opt_out,\n outlook_opt_out: formGroup.outlook_opt_out\n }\n }));\n this.saveChanges();\n }\n\n // submit the booking form\n public validateForm(valid: boolean) {\n this.invalidForm = !valid;\n }\n\n public setupNotes(note: string, roomEmail: string) {\n if (note && note.length ) {\n // this note was required to update setup and breakdown\n return [{\n author: this.currentUser.name,\n type: \"equipment\",\n message: !Array.isArray(note) ? note : note[0].message,\n space: roomEmail,\n date: new Date().getTime()\n }] as BookingNote[];\n }\n\n return [];\n }\n\n public formToAttendees(attendees: any[]) {\n return !attendees ? [] : attendees.map(a => {\n let raw_user = {\n first_name: '',\n last_name: '',\n email: '',\n name: '',\n type: 'internal',\n external: false,\n visitor: false,\n };\n if (a.meta?.external) {\n // External users get assigned a random email\n const nameParts = a.display.split(' ');\n const length = nameParts.length;\n if (length) {\n raw_user.first_name = nameParts[0];\n raw_user.name = nameParts.join(' ');\n }\n if (length > 1) {\n nameParts.shift();\n raw_user.last_name = nameParts.join(' ');\n }\n raw_user.email = a.value ?? `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n raw_user.type = 'external'; // retain external identity\n raw_user.external = true;\n raw_user.visitor = true;\n } else if (a.meta?.user) {\n raw_user = a.meta.user;\n }\n else {\n raw_user = a;\n }\n return new User(raw_user);\n });\n }\n\n public formToCompany(companies: any[]) {\n return !companies ? [] : companies.map(a => {\n return a.value;\n });\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n const booking_form_data = this.data.value;\n // override in child class\n }\n\n public callback() {\n // mock interface\n }\n\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n return space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser\n });\n }\n\n public displayWarningBanner(custom: string) {\n this.warningMessage = custom;\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n\n public discardChanges() {\n this.store.dispatch(clearBookingFormData());\n this.closeCallback.emit(true)\n }\n\n\n\n setupOrganiser(booking_form_data: BookingFormData) {\n if(booking_form_data.organiser?.meta?.user){\n return booking_form_data.organiser?.meta?.user;\n }\n else{\n booking_form_data.organiser = {...booking_form_data.organiser, meta: {user: this.currentUser}}\n return booking_form_data.organiser?.meta.user;\n }\n }\n\n public bookingFormToBooking(bookingData, isEditSeries: boolean = false): Booking {\n let booking_form_data = bookingData;\n const has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom.space.email]: 900} : {}; // 900 seconds = 15 min\n const attendees = this.formToAttendees(booking_form_data.attendees);\n const company = this.formToCompany(booking_form_data.company);\n const start_epoch = booking_form_data?.dateTz?.seconds;\n const end_epoch = booking_form_data.dateTz.addValue({ minutes: booking_form_data.duration }).seconds;\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = booking_form_data?.nextBusinessDay || false\n\n const raw_data = {\n id: isEditSeries ? booking_form_data.id : '',\n all_day: booking_form_data.all_day || false,\n attendees,\n booking_type: booking_form_data.bookingType.value,\n catering: booking_form_data.catering || [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data.timezone,\n equipment_codes: {[booking_form_data.selectedRoom.space.email]: booking_form_data.code},\n expected_attendees: {[booking_form_data.selectedRoom.space.email]: booking_form_data.head_count},\n has_catering: booking_form_data.has_catering || false,\n needs_space: booking_form_data.needs_space || false,\n organiser: this.setupOrganiser(booking_form_data),\n notes: this.setupNotes(booking_form_data.notes, booking_form_data.selectedRoom.space.email),\n creator: booking_form_data.creator,\n room: booking_form_data.selectedRoom.space,\n title: booking_form_data.title,\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n /* Staff Recurring form fields */\n is_recurrent: booking_form_data.is_recurrent,\n recurrence_count: booking_form_data.recurrence_count,\n recurrence_days: booking_form_data.recurrence_days,\n recurrence_endTz: booking_form_data.recurrence_endTz,\n recurrence_exceptions: booking_form_data.recurrence_exceptions,\n recurrence_interval: booking_form_data.recurrence_interval,\n recurrence_period: booking_form_data.recurrence_period,\n recurrence_starts: booking_form_data.recurrence_starts,\n\n occurrence_details: booking_form_data.occurrence_details,\n // occurrence_edits: booking_form_data.occurrence_edits || null,\n // occurrence_ids: booking_form_data.occurrence_ids || null,\n recurrence_type: booking_form_data.recurrence_type || null,\n recurrence_master_id: booking_form_data.recurrence_master_id,\n edits: booking_form_data?.edits,\n ignore: booking_form_data?.ignore,\n\n opt_out: bookingData.opt_out,\n \n //outlook_opt_out: true //bookingData.outlook_opt_out keeping always true for now (will never send outlook invite) until feature fully tested and released to prod \n\n\n };\n\n return new Booking(raw_data);\n }\n\n\n public async handleBookingSuccessResponse(bkn) {\n\n // const user: User = this._users.current;\n // if(this._users.current.email === bkn.organiser.email) {\n // this._users.current.opt_out = true;\n // }else {\n // this._users.current.delegates.map(el => { \n // if(el.email === bkn.organiser.email) {\n // el.opt_out = true;\n // }\n // return el;\n // })\n // }\n \n\n //const responceBkn = new Booking({...bkn}); // \n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this.updateConfimatinModal();\n this._booking_state_service.replace(this.booking);\n\n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(this.booking.recurrence_master_id !== null && this.isEditSeries)\n {\n const master_booking = await this._bookings_service.show(this.booking.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n\n // Heap track event\n this._service.analytics.track('update', {\n booking_id: this.booking.id,\n office: this.booking.room.building.name, // this.building.name,\n room: this.booking.room.simple_name,\n start_time: this.booking.startDateTz.ms,\n end_time: this.booking.endDateTz.ms,\n catering: !!this.booking.catering.length,\n headcount: this.data.value.head_count,\n });\n\n }\n\n\n public handleBookingErrorMessage() {\n this.loading = false;\n this.booking.status = BOOKING_STATUS.unavailable\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n this.updateConfimatinModal();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n\n if (this.booking.multi_rooms && this.booking.multi_rooms.length > 0) {\n this.booking.multi_rooms.forEach((room) => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n } \n if (this.booking.room) {\n totalConflicts =\n this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n }\n\n const result = {\n is_conflict: totalConflicts > 0,\n total_Conflicts: totalConflicts,\n };\n return result;\n}\n\n\n/**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details?.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n const requestedEndDateTz = getLastDateFromList(recurrenceStart); //shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n \n // add one day if user room selection from next business day section on result page\n const endDatestring = this.nextBusinessDay ? requestedEndDateTz.addValue({ minutes: this.data?.value.offset }) : requestedEndDateTz;\n\n return endDatestring.formatDate('ccc d MMM yyyy');\n }\n\n /**\n * Opens a modal to display recurrence conflicts for a given room.\n *\n * @param {Space} room - The room for which recurrence conflicts are being displayed.\n *\n * This function opens a modal dialog to show recurrence exceptions (conflicts)\n * for the specified room.\n *\n * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n * and mckinsey-converge/apps/staff/src/app/booking/catering/catering.component.ts\n */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n status: 'confirmed'\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\n}\n","import {BehaviorSubject,fromEvent,\n} from 'rxjs';\nimport {take,throttleTime,tap,distinctUntilChanged,map\n} from 'rxjs/operators';\nimport {select,Store\n} from '@ngrx/store';\nimport {Component,Inject,OnInit,\n} from '@angular/core';\nimport { BaseDirective, dateBuildingFormatString, startEndTimeWithZoneFormatString, humaniseDuration, toTitleCase, closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { User,\n\tApplicationService,\n\tAvailableBookingFields,\n\tBooking,\n\tBookingFormData,\n\tBookingFlowSettings,\n\tSpacesService,\n\tstoreBookingFormData,\n\tDateDurationData,\n\tselectFilteredByIdResults,\n\tgenerateBookingForm,\n\tcateringAllowed,\n\trulesForSpace,\n\tgetStatusErrorMessage,\n\troomHasCateringHours,\n\tBookingsService,\n\tSpaceConflictAlertModalData,\n\tSpaceFilterReason,\n\tBuilding,\n\tBuildingCity,\n\tflattenDisplayOffices,\n\troomSizeOptions,\n\tDEFAULT_BOOKING_DURATION,\n\tbookingTypeOptions,\n\troomFormDataToQuery,\n\tclearBookingFormData,\n\tBookingStateService,\n\tRecurrencePeriod,\n\tselectActiveForm,\n\tSeriesAction\n} from '@mckinsey-converge/data-common';\nimport { first } from 'rxjs/operators';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { CancelBookingModalComponent } from '../cancel-booking-modal/cancel-booking-modal.component';\nimport { BookingDurationModalComponent } from '../booking-duration-modal/booking-duration-modal.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport {\n\tloadByIdResults, loadRoomsForResults, loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { FormGroup } from '@angular/forms';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictAlertModalComponent, SelectOption } from '@mckinsey-converge/ui';\nimport { buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { RoomBookingModalComponent } from '../room-booking-modal/room-booking-modal.component';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { CateringDropComponent } from '@mckinsey-converge/ui';\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n\tselector: 'app-booking-details-modal',\n\ttemplateUrl: 'booking-details-modal.component.html',\n\tstyleUrls: ['./booking-details-modal.component.scss']\n})\nexport class BookingDetailsModalComponent extends BaseDirective implements OnInit {\n\tpublic TopBarHeaderMode = TopBarHeaderMode;\n\tpublic title: string;\n\tpublic roomName: string;\n\tpublic roomLocation: string;\n\tpublic host: string;\n\tpublic hostEmail: string;\n\tpublic type: string;\n\tpublic status: string;\n\tpublic statusText: string = '';\n\tpublic statusImage: string;\n\tpublic durationString: string;\n\tpublic dateString: string;\n\tpublic timeString: string;\n\tpublic capacity: number;\n\tpublic attendeesString: string;\n\tpublic chargeCode: string;\n\tpublic headcount: number;\n\tpublic requirements: string;\n\tpublic showDetails: boolean;\n\tpublic warningMessage: string;\n\tpublic mapUrl: string;\n\tpublic focusedRoom: string;\n\tpublic expandedLocation = false;\n\tpublic isRecurrentBooking = false;\n\tpublic isMultiroomBooking:boolean = false;\n\n\tpublic checkingExtendable: boolean;\n\tpublic extendableMaximum: number;\n\n\tpublic receiptionEmail: string;\n\n\tpublic data = new BehaviorSubject(undefined);\n\tpublic byIdResults = new BehaviorSubject(undefined);\n\n\t// Track event date changes in the UI in this param\n\tpublic alternativeWeekStartDateTz: DateTZ;\n\t/** Current User */\n\tpublic currentUser: User;\n\tpublic expandedAvailability: boolean = false;\n\t// Set in the room availablity callback\n\tpublic mobile: boolean = false;\n\tpublic loading: boolean = false;\n\tpublic showInfoBanner: boolean = false;\n\tpublic showWarningBanner: boolean = false;\n\tpublic showCatering: boolean = false;\n\t/** Application settings for bookings */\n\tpublic settings: BookingFlowSettings;\n\tpublic form: FormGroup;\n\tpublic companyString: string;\n\n\tinvalidDueToOfficeRule: boolean;\n\tbuildings: SelectOption[];\n\tmaster_booking: Booking;\n\n\tprivate recurrence_period: RecurrencePeriod;\n\tprivate recurrence_interval: number;\n\toccurrence_details: { start_epoch: number; dateTz: DateTZ; id: string; }[];\n\tdisableSeriesEditButton: boolean = false;\n\topt_out: boolean;\n\toutlook_opt_out: boolean;\n\t/** List of available booking fields for the form */\n\tpublic get available_fields(): AvailableBookingFields[] {\n\t\treturn this.settings?.show_fields || [];\n\t}\n\n\tpublic get emailURL() {\n\t\treturn `mailto:${encodeURIComponent(this.receiptionEmail)}?cc=${encodeURIComponent(this.hostEmail)}&subject=Enquiry%3A%20${encodeURIComponent(this.roomName)}&body=Details%3A%0ADate%3A%20${encodeURIComponent(this.dateString)}%0ATime%3A%20${encodeURIComponent(this.timeString)}%0A${encodeURIComponent(this.type)}%20meeting%20(${encodeURIComponent(this.durationString)})%0AAddress%3A%20${encodeURIComponent(this.roomLocation)}%0ARoom%3A%20${encodeURIComponent(this.roomName)}%0ACapacity%3A%20${encodeURIComponent(this.capacity)}%20people%0A%0ANeeding%20assistance%20with%3A%0A`;\n\t}\n\n\tpublic disableCancelButton: boolean = false;\n\tpublic disableEditTimeButton: boolean = false;\n\tpublic disableUpdateDetailsButton: boolean = false;\n\n\tprivate _specific_dates = false;\n\n\n\tconstructor(\n\t\t private router: Router,\n private route: ActivatedRoute,\n\t\t@Inject(MAT_DIALOG_DATA) public _data: any,\n\t\tprivate dialogRef: MatDialogRef,\n\t\tprivate store: Store,\n\t\tpublic _bookings: BookingsService,\n\t\tprivate _service: ApplicationService,\n\t\tprivate _spaces: SpacesService,\n\t\tprivate dialog: MatDialog,\n\t) {\n\t\tsuper();\n\t\tthis.roomLocation = this._data.booking.room.street_and_city;\n\t\tthis.initDisplayValues(this._data.booking);\n\t\tthis.timeout('slowinit', () => {\n\t\t\tthis.initDisplayValues(this._data.booking);\n\t\t\tif (this._data.cancel && this.displayCancelModal()) {\n\t\t\t\tthis.cancelBooking();\n\t\t\t}\n\t\t\tif (this._data.addCatering && this.roomHasCatering) {\n\t\t\t\tthis.addCatering();\n\t\t\t}\n\t\t\t// Close up the loader panel\n\t\t\tthis.timeout('hide modal mask', () => {\n\t\t\t\tthis._data.hasLoaderUrl = false;\n\t\t\t}, 300);\n\t\t}, 1000);\n\t}\n\n\n\tpublic ngOnInit() {\n\n\t\t/**\n\t\t * Update booking recurrence and occurrence details based on master booking data.\n\t\t *\n\t\t * This code block checks if there is a master booking available in the data.\n\t\t * If a master booking exists, it extracts recurrence period and interval information,\n\t\t * and processes occurrence details, excluding the current booking itself. Occurrence\n\t\t * start epochs are converted to milliseconds and date-time strings are created in the\n\t\t * building's timezone.\n\t\t */\n\t\tif(this._data?.master_booking !== null) {\n\t\t\tthis.recurrence_period = this._data?.master_booking?.recurrence_period;\n\t\t\tthis.recurrence_interval = this._data?.master_booking?.recurrence_interval;\n\n\t\t\tconst bookingData = this._data?.master_booking || this._data?.booking;\n\n\t\t\tthis.occurrence_details = bookingData.occurrence_details && bookingData.occurrence_details\n\t\t\t\t.filter(ocurrence => ocurrence.id !== bookingData.id)\n\t\t\t\t.map(ocurrence => ({\n\t\t\t\t\t...ocurrence,\n\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000, // Convert start epoch to milliseconds\n\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000, // Create a DateTZ object with the converted epoch\n\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\tbuilding_tz: bookingData.timezone\n\t\t\t\t\t})\n\t\t\t\t}));\n\t\t}\n\n\n\t\tthis.subscription('currentUser', this.store.select(selectCurrentUser)\n\t\t\t.pipe(take(1))\n\t\t\t.subscribe((user: User | undefined) => {\n\t\t\t\t// Once we know we have the user loaded.\n\t\t\t\tthis.currentUser = new User(user);\n\t\t\t})\n\t\t);\n\n\t\tthis.subscription('byId', this.store.pipe(\n\t\t\tselect(selectFilteredByIdResults)\n\t\t).subscribe(next => {\n\t\t\t// Should be fired when loading by ID in URL\n\t\t\tthis.byIdResults.next(next.success?.spaces?.length ? next.success.spaces[0].settings.bookings : EMPTY_ARRAY);\n\t\t}));\n\n\t\tthis._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n\t\t\tthis.settings = this._service.setting('app.booking');\n\t\t\tthis.form = generateBookingForm(this._data.booking, this.available_fields);\n\t\t});\n\n\t\tconst breakpoint = 450;\n\t\tif (window) {\n\t\t\tthis.mobile = window.innerWidth < breakpoint;\n\t\t}\n\n\t\tfromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n\t\t\tnext: val => {\n\t\t\t\tconst target = val.target as Window;\n\t\t\t\tthis.mobile = target.innerWidth < breakpoint;\n\t\t\t}\n\t\t})).subscribe();\n\n\n\t\tthis.subscription('buildings', this.store.pipe(\n\t\t\tselect(buildingStateSelector),\n\t\t\tselect(selectBuildingOptionsGroupedByCity),\n\t\t\tmap((grouped: Map) => {\n\t\t\t\treturn flattenDisplayOffices(grouped);\n\t\t\t}),\n\t\t\tdistinctUntilChanged()\n\t\t).subscribe(next => {\n\t\t\tthis.buildings = next;\n\t\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t\t}));\n\n\n\t}\n\n\t// public get isCateringAdded()\n\n\tpublic get disableCateringButton() {\n\t\tswitch (this.status) {\n\t\t\tcase 'cancelled':\n\t\t\tcase 'declined':\n\t\t\tcase 'expired':\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\treturn !cateringAllowed(this._data?.booking, this._data.booking.room.building);\n\t\t}\n\t}\n\n\tpublic get roomHasCatering() {\n\t\treturn roomHasCateringHours(this._data.booking.room.building, this._data.booking?.room);\n\t}\n\n\tpublic get catering() {\n\t\treturn this._data.booking?.catering || [];\n\t}\n\n\tpublic formatDeliveryTime(order) {\n\t\treturn this._data.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n\t}\n\n\tpublic initDisplayValues(booking: Booking) {\n\t\tconst roomEmail = booking.room.email || '';\n\t\tthis.dateString = dateBuildingFormatString(booking.startDateTz, true);\n\t\tthis.timeString = startEndTimeWithZoneFormatString(booking.startDateTz, booking.displayEndDateTz);\n\t\tthis.host = booking.organiser.name;\n\t\tthis.opt_out = booking.opt_out;\n\t\tthis.outlook_opt_out = booking.outlook_opt_out;\n\t\tthis.hostEmail = booking.organiser.email;\n\t\tthis.title = booking.title;\n\t\tthis.type = toTitleCase(booking.booking_type);\n\t\tthis.roomName = booking.local_room_name || '';\n\t\tthis.durationString = humaniseDuration(booking.duration);\n\t\tthis.capacity = booking.room.capacity; // in case of multiroom booking should we sum the capacity for all the rooms?\n\t\tthis.attendeesString = booking.attendees.map(a => a.name).join(', ');\n\t\tthis.chargeCode = booking.equipment_codes[roomEmail];\n\t\tthis.headcount = booking.expected_attendees[roomEmail];\n\t\tthis.mapUrl = booking.room.level.map_url;\n\t\tthis.extendableMaximum = 0;\n\t\tthis.focusedRoom = `area-${booking.room.map_id}-status`;\n\t\tthis.checkingExtendable = false;\n\t\tthis.receiptionEmail = this._data.booking.room.building?._settings?.discovery_info?.reception_email || '';\n\t\tthis.companyString = booking.company.join(', ');\n\t\t// UI button availability\n\t\tthis.disableCancelButton = true; // CSS hide disabled\n\t\tthis.disableEditTimeButton = true;\n\t\tthis.disableUpdateDetailsButton = true;\n\t\tthis.isRecurrentBooking = (booking.recurrence_type !== null || booking.recurrence_type === '') && booking.recurrence_period !== null ? true : false;\n\t\tthis.isMultiroomBooking = booking.is_multiroom ? true : false\n\n\t\t// Room Availability modal start date\n\t\tthis.setAlternativeWeekStartDate(booking.startDateTz);\n\n\t\t// Get the equiptment notes\n\t\tconst requirements = booking.notes.find(n => {\n\t\t\tif (n.type === 'equipment') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\tthis.requirements = requirements ? requirements.message : '';\n\n\t\t// Setup the UI status based on the booking approval status\n\t\tif (booking.status) {\n\t\t\t// mark bookings before today expired\n\t\t\tconst orgStatus = booking.status;\n\t\t\tthis.status = booking.status;\n\t\t\tconst recentlyExpired = DateNow(new Date()).subtractValue({ minutes: 5 }).isBeforeDate(booking.startDateTz.addValue({ minutes: booking.duration }));\n\t\t\tif (!['declined', 'cancelled'].includes(booking.status)) {\n\t\t\t\tthis.status = DateNow(new Date()).isAfterDate(booking.startDateTz.addValue({ minutes: booking.duration })) ? 'expired' : booking.status;\n\t\t\t}\n\n\t\t\tif(this._data.master_booking && this._data.master_booking.status === 'tentative' ) {\n\t\t\t\tthis.disableSeriesEditButton = true;\n\t\t\t}\n\n\t\t\tswitch (this.status) {\n\t\t\t\tcase 'tentative':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_pending.svg';\n\t\t\t\t\tthis.statusText = 'Pending';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accepted':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on but returns to tenative on save\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'approved':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false; // BLOCKED: API doesn't update 'approval_status' on save.\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on, back to pending on change.\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'declined':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\t// you can edit time and go back to pending\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cancelled':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'expired':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\n\t\t\t\t\tif (recentlyExpired && ['accepted', 'approved'].includes(orgStatus)) {\n\t\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // TODO What is an appropriate default ? And refactor where else this is common.\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic listItems(order) {\n\t\treturn order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n\t}\n\n\tpublic expandLocation() {\n\t\tthis.expandedLocation = true;\n\t}\n\n\tpublic handleClose(fetchRooms: boolean = false) {\n\t\tthis.expandedLocation = false;\n\t\tthis.expandedAvailability = false;\n\t\tif (fetchRooms) {\n\t\t\tthis.fetchRooms(false);\n\t\t\tthis.invalidDueToOfficeRule && this.alertIfItHasConflict(false, true);\n\t\t\tthis.invalidDueToOfficeRule = false;\n\t\t}\n\t}\n\n\tpublic close(flag: string = '') {\n\t\tthis.dialogRef.close(flag);\n\t}\n\n\t/**\n\t * Check if there are any booking collisions with the new booking time\n\t * @param room_id 'sys-' id of room in question\n\t * @param date proposed booking time\n\t * @param duration proposed booking length (in minutes)\n\t */\n\tprivate async findMaxExtension(): Promise {\n\t\tconst setupInSeconds = this._data.booking.setup[this._data.booking.room.email] || 0;\n\t\tconst breakdownInMinutes = this._data.booking.breakdown[this._data.booking.room.email] ? this._data.booking.breakdown[this._data.booking.room.email] / 60 : 0;\n\n\t\t// Add a seconds, since the end time ends in :59, and add the setup time\n\t\tconst endTz = this._data.booking.endDateTz.addValue({ seconds: setupInSeconds + 1 });// (this._data.booking.date + this._data.booking.duration*60000)*0.001 -1\n\t\tconst params = {\n\t\t\troom_ids: this._data.booking.room.id,\n\t\t\tdateTz: endTz, // (((end + 60 + setupSeconds) * 1000)),\n\t\t\tduration: 60 + breakdownInMinutes,\n\t\t\thide_bookings: true,\n\t\t};\n\n\t\treturn await this._spaces\n\t\t\t.available(params, null, false)\n\t\t\t.then(\n\t\t\t\t(list) => {\n\t\t\t\t\t// measure gap in booking instead and have options\n\t\t\t\t\tconst gapInMinutes = ((list[0].available_until - (endTz.seconds - 60)) / 60);\n\t\t\t\t\tconst value = Math.min(60, gapInMinutes);\n\t\t\t\t\treturn value >= 15 ? value : 0;\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t);\n\t}\n\n\tpublic toggleUpdateView() {\n\t\tthis.showDetails = !this.showDetails;\n\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t}\n\n\n\n\n\tpublic getLocation(booking: Booking): any {\n\n\t\tif (this.buildings && booking.building_zone) {\n\t\t\treturn this.buildings.find(b => booking.building_zone === b.value);\n\t\t}\n\t\treturn [];\n\t}\n\n\n\t/**\n * Dispatches data for getting the current status of the booking floor.\n *\n * This function prepares and dispatches necessary data to retrieve the current status\n * of the booking floor.\n *\n * @param {Object} booking - The booking details object, containing room, date, duration, etc.\n * @param {boolean} editingSeries - A boolean indicating whether the booking is part of a series and being edited.\n\n */\n\tpublic dispatchToGetFloorCurrentStatus(booking, editingSeries: boolean = false) {\n\t\tconst timezone = booking.timezone;\n\t\tconst { capacity, internal_or_external } = booking.room;\n\t\tconst roomOption = capacity < 3 ? 0 : (capacity > 2 && capacity < 10) ? 1 : 2;\n\t\tconst roomSize = roomSizeOptions[roomOption];\n\n\t\t// Process recurrence data if the booking is part of a series being edited\n\t\tlet recurringBookingData = {};\n\t\tlet recurrenceStart = [];\n\t\tif(booking.is_recurrent && editingSeries) {\n\n\t\t\tthis._data.master_booking.occurrence_details.forEach(element => {\n\t\t\t\trecurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n\t\t\t});\n\t\t\trecurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n\n\t\t\tconst {\n\t\t\t\tid,\n\t\t\t\trecurrence_period,\n\t\t\t\trecurrence_interval,\n\t\t\t\trecurrence_count,\n\t\t\t\tis_recurrent,\n\t\t\t\trecurrence_exceptions,\n\t\t\t\trecurrence_pattern,\n\t\t\t\trecurrence_days,\n\t\t\t\trecurrenEndFromOcurrences,\n\t\t\t\toccurrence_details,\n\t\t\t\toccurrence_edits,\n\t\t\t\toccurrence_ids,\n\t\t\t\trecurrence_type,\n\t\t\t\trecurrence_master_id,\n\t\t\t\tedits } = this._data.master_booking\n\n\t\t\tconst rec_endTz = recurrenEndFromOcurrences.bind(this._data.master_booking);\n\t\t\tconst recurrence_endTz = rec_endTz(occurrence_details)\n\n\n\n\n\t\t\trecurringBookingData = {\n\t\t\t\tid:id,\n\t\t\t\trecurrence_period: recurrence_period,\n\t\t\t\trecurrence_interval: recurrence_interval || 1,\n\t\t\t\trecurrence_endTz: recurrence_endTz, //this._data.master_booking.recurrence_endTz,\n\t\t\t\trecurrence_count: recurrence_count || 1,\n\t\t\t\tis_recurrent: is_recurrent,\n\t\t\t\trecurrence_starts: recurrenceStart,\n\t\t\t\trecurrence_exceptions: recurrence_exceptions || [],\n\t\t\t\trecurrence_pattern: recurrence_pattern || \"weekly\", //Helper value to store the last selected pattern (daily, weekly, monthly),\n\t\t\t\trecurrence_days: recurrence_days || [],\n\n\t\t\t\toccurrence_details: occurrence_details,\n occurrence_edits: occurrence_edits || null,\n occurrence_ids: occurrence_ids || null,\n recurrence_type: recurrence_type || null,\n recurrence_master_id: recurrence_master_id,\n\t\t\t\tedits: edits\n\t\t\t}\n\t\t};\n\n\n\t\tconst formGroup: BookingFormData = {\n\t\t\tlocation: [this.getLocation(booking)],\n\t\t\t//date: booking.date,\n\t\t\t// dateTz: recurrenceStart[0], //building_tz: timezone\n\t\t\tdateTz: recurrenceStart.length >=1 ? recurrenceStart[0] : closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }),\t15\t).toZone(timezone),\n\t\t\tduration: booking.duration,\n\t\t\tbookingType: internal_or_external === 'internal' ? bookingTypeOptions[0] : bookingTypeOptions[1],\n\t\t\troomSize: roomSize,\n\t\t\tselectedRoom: null,\n\t\t\ttimezone: timezone,\n\t\t\t// buildings: buildings,\n\t\t\t...this._data?.master_booking?.toJSON(),\n\t\t\t...recurringBookingData,\n\t\t\topt_out:booking.opt_out,\n\t\t\toutlook_opt_out: booking.outlook_opt_out,\n\t\t\taction: 'edit_booking'\n\n\t\t};\n\n\t\t// Clear existing form and result data, then dispatch the updated form data\n\t\tthis.clearFormAndResultData();\n\t\tthis.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n\t\t// Dispatch a request to load available rooms based on the updated form data\n\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(formGroup)))\n\t}\n\n\t/**\n * Opens a modal for editing a recurring series of bookings.\n */\n\tpublic editRecurringSeries() {\n\t\t// Dispatch the current status of the booking floor for editing the recurring series\n\t\tthis.dispatchToGetFloorCurrentStatus(this._data.booking, true);\n\n\t\tconst dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n\t\t\t\tpanelClass: 'mck-modal',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdata: {\n\t\t\t\t\tnavigateTo: this.navigateT0Search.bind(this),\n\t\t\t\t\taction: SeriesAction.EDIT, // Indicates the action type (editing a series)\n\t\t\t\t}\n\t\t});\n\n\t\t// Subscribe to the modal's closed event to handle the result\n\t\tdialog_ref.afterClosed().subscribe((flag) => {\n\t\t\t// Close the modal if the operation was successful (flag is truthy)\n\t\t\tflag && this.close(flag); //console.log('ROOM MODAL CLOSED')\n\t\t});\n\n\t}\n\n\tnavigateT0Search() {\n\t\tthis.router.navigate(['../home/results'], { relativeTo: this.route });\n\t}\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n\n\tpublic toggleEditView() {\n\t\tthis.fetchRooms(true);\n\t\tthis.expandedAvailability = true;\n\t}\n\n\tpublic updateBookingState(booking: Booking) {\n\t\tthis._data.booking = booking;\n\t\tthis.initDisplayValues(booking);\n\t\tthis.store.dispatch(loadBookingsWithQuery({ 'id': booking.id, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n\t\t// reload all booking for user from - apps/staff/src/app/booking/room-booking/room-booking.component.ts\n\t\tthis._data.refresh(); //\n\t}\n\n\tpublic cancelBooking(opts: { series?: boolean } = {}) {\n\t\t// Open the cancel booking modal\n\t\tthis.dialog.open(CancelBookingModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\t...this._data,\n\t\t\t\t...opts,\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst booking = this._data.booking.clone();\n\t\t\t\t\tthis._data.booking.delete(opts).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tthis.close();\n\t\t\t\t\t\t\t// @TODO:API The deleted record is still being returned for quite some time regardless of timeout.\n\t\t\t\t\t\t\tthis._data.refresh()\n\t\t\t\t\t\t\t// this.timeout('refresh', () => this._data.refresh(), 1000);\n\t\t\t\t\t\t\t// Heap track event\n\t\t\t\t\t\t\tthis._service.analytics.track('delete', {\n\t\t\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\t\t\troom: booking.room.name,\n\t\t\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\t\t\tcatering: !!booking.catering.legth,\n\t\t\t\t\t\t\t\theadcount: booking?.expected_attendees[booking.room.email],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err) => {\n\t\t\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\t}\n\n\tpublic extendBooking() {\n\t\t// open the extend booking modal\n\t\tconst dialogRefX = this.dialog.open(BookingDurationModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\tbooking: this._data.booking,\n\t\t\t\tmaximum: this.extendableMaximum,\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\n\t\tdialogRefX.afterClosed().subscribe((booking?: Booking) => {\n\t\t\tif (booking) {\n\t\t\t\tthis.updateBookingState(booking);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic displayCancelModal() {\n\t\t// Can the display cancel modal open? If it isn't one of these statuses\n\t\treturn !['cancelled', 'expired', 'declined'].includes(this.status);\n\t}\n\n\n\tpublic confirmChanges(data: DateDurationData) {\n\t\t// Confirm the changes returned from the room availability modal.\n\t\tthis.mobile = data.mobile;\n\t\tthis.setAlternativeWeekStartDate(data.dateTz);\n\n\t\t// New booking flow has this.data\n\t\tif (this.data.value) {\n\t\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t\t\t// submit\n\t\t\tthis.store.dispatch(storeBookingFormData({\n\t\t\t\tpayload: {\n\t\t\t\t\t...this.data.value,\n\t\t\t\t\tdateTz: data.dateTz,\n\t\t\t\t\tduration: data.duration,\n\t\t\t\t}\n\t\t\t}));\n\t\t} else if (data.save) {\n\t\t\t// update booking date/duration\n\t\t\tconst booking = this._data.booking.clone();\n\t\t\tconst pendingChanges = booking.duration !== data.duration || booking.startDateTz.ms !== data.dateTz.ms;\n\t\t\t// booking.duration = data.duration;\n\t\t\tbooking.startDateTz = data.dateTz; // date = data.dateTz.ms;\n\t\t\tbooking.endDateTz = data.dateTz.addValue({ minutes: data.duration });\n\t\t\tthis.loading = true;\n\n\t\t\tconst roomRules = rulesForSpace({\n\t\t\t\ttime: booking.date,\n\t\t\t\tduration: booking.duration,\n\t\t\t\tuser: this.currentUser,\n\t\t\t\trules: this._data.booking.room.building?.booking_rules,\n\t\t\t\tspace: booking.room\n\t\t\t});\n\n\t\t\t// Rooms requiring approval are reset to tentative when the time changes.\n\t\t\tif (pendingChanges && !roomRules?.auto_approve) {\n\t\t\t\t// https://acaprojects.atlassian.net/browse/MCK-1481\n\t\t\t\t/**\n\t\t\t\t * Having 2 ways of containing the status is icky but until PlaceOS\n\t\t\t\t * depreciates approval_status it's necessry.\n\t\t\t\t */\n\t\t\t\t// booking.approval_status[booking.room.email] = \"tentative\";\n\t\t\t\tbooking.status = \"tentative\";\n\t\t\t\tbooking.time_changed = true;\n\t\t\t}\n\t\t\telse if (roomRules.reason === SpaceFilterReason.OfficeRules) {\n\t\t\t\t// this.alertIfItHasConflict(false, true);\n\t\t\t\tthis.invalidDueToOfficeRule = true;\n\t\t\t\tthis.loading = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// -----------------------------------------------------------\n\t\t\t// Check if catering is outside allowed hours before saving\n\t\t\t// -----------------------------------------------------------\n\t\t\tif (this.hasCateringOutsideHours(booking)) {\n\t\t\t\tthis.dialog.open(CateringDropComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-mini',\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\t})\n\t\t\t\t.afterClosed().subscribe((confirm_drop: boolean) => {\n\t\t\t\t\tif (confirm_drop) {\n\t\t\t\t\t\t// User chose to drop catering and proceed\n\t\t\t\t\t\tbooking.catering = [];\n\t\t\t\t\t\tthis.saveBooking(booking);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// User cancelled - do not save, just stop here\n\t\t\t\t\t\tthis.loading = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// If catering is within hours or no catering issue, just save\n\t\t\t\tthis.saveBooking(booking);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate saveBooking(booking: Booking) {\n\t\t\t// booking.save() won't use the toAPIJSON conversion so use the booking service.\n\t\t\tthis._bookings.save(booking).then(\n\t\t\t\t(bkn) => {\n\t\t\t\t\t// update booking\n\t\t\t\t\tthis.updateBookingState(booking);\n\t\t\t\t\tthis.form = generateBookingForm(booking, this.available_fields);\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.displayInfoBanner();\n\t\t\t\t\tbooking.room.building.name\n\t\t\t\t\tthis._service.analytics.track('update', {\n\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\troom: booking.room.global_name,\n\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\tcatering: !!booking.catering.length,\n\t\t\t\t\t\theadcount: booking.headcount,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.expandedAvailability = false;\n\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\n\t/**\n\t * Check if the booking has catering and if it's outside allowed hours.\n\t */\n\tprivate hasCateringOutsideHours(booking: Booking): boolean {\n\t\tif (!booking?.catering || !booking.catering.length) return false;\n\t\n\t\t// Extract the hour from startDateTz\n\t\tconst hour = booking.startDateTz.date.hour;\n\t\t// Check if hour is outside 7 AM - 8 PM\n\t\treturn hour < 7 || hour >= 20;\n\t}\n\n\t/**\n\t * Open dialog if booking date and time is out of office rule\n\t * TO DO : Redundant code - same validaiton been applied over room detail while creating new booking - need to handle more graceful way. better if user been prohibited from choose future date if out of office rule on show avaialability calender itself\n\t * related to - https://acaprojects.atlassian.net/browse/MCK-2419\n\t */\n\n\talertIfItHasConflict(isBookable, isAvailable) {\n\t\t// this.isAlertDisplayed = true;\n\t\tconst data = {\n\t\t\theaderText: !isBookable ? SpaceConflictAlertModalData.NotBookableHeaderText : !isAvailable ? SpaceConflictAlertModalData.NotAvailableHeaderText : '',\n\t\t\tmessage: SpaceConflictAlertModalData.NotBookableDueToOfficeRule,\n\t\t\tbuttonLabel: 'Close',\n\t\t\tcallback: () => null,\n\t\t\tshouldClose: false\n\t\t};\n\t\tconst dialog = this.dialog.open(ConflictAlertModalComponent,\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tpanelClass: 'mck-alert',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdisableClose: !isBookable\n\t\t\t});\n\t}\n\n\n\n\tpublic displayInfoBanner() {\n\t\tthis.showInfoBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showInfoBanner = false;\n\t\t}, 3000);\n\t}\n\n\tpublic displayWarningBanner(custom: string) {\n\t\tthis.warningMessage = custom;\n\t\tthis.showWarningBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showWarningBanner = false;\n\t\t}, 10000);\n\t}\n\n\tpublic hideInfoBanner() {\n\t\tthis.showInfoBanner = false;\n\t}\n\n\tpublic hideWarningBanner() {\n\t\tthis.showWarningBanner = false;\n\t}\n\n\tpublic setAlternativeWeekStartDate(bookingDate: DateTZ) {\n\t\tif (!bookingDate) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mobile) {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone();\n\t\t} else {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone().startOfValue('week').startOfValue('day');\n\t\t}\n\t}\n\n\tpublic updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n\t\tthis.alternativeWeekStartDateTz = alternativeWeekStartDateTz.clone();\n\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t}\n\n\tpublic fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n\t\tif (!this._data?.booking?.space?.id) {\n\t\t\treturn\n\t\t}\n\n\t\tconst day = 24 * 60;\n\t\tconst week = day * 7;\n\t\tconst date = (alternativeWeekStartDateTz || this._data?.booking?.startDateTz).clone(); // new DateTZ({date: alternativeWeekStartDateTz || this._data?.booking?.date});\n\t\tconst startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n\t\tconst startOfWeek = date.startOfValue('week');\n\n\t\t// Query for the entire day for this room\n\t\tconst query = {\n\t\t\tdateTz: allWeek ? startOfWeek : startOfDay,\n\t\t\tduration: allWeek ? week : day,\n\t\t\tlocations: this._data?.booking?.space?.id,\n\t\t\tcapacity: this._data?.booking?.space?.capacity,\n\t\t};\n\t\tthis.store.dispatch(loadByIdResults.request(query));\n\t}\n\n\tpublic addCatering() {\n\t\t// For the Add Catering button\n\t\tthis.showCatering = true;\n\t}\n\n\tpublic saveBookingWithCatering(form: FormGroup) {\n\t\t// Response from the catering modal closing\n\t\t// Close catering and confirmation modals and just show booking details modal\n\t\tif (!form) {\n\t\t\tthis.showCatering = false;\n\t\t\tthis.showDetails = false;\n\t\t\treturn;\n\t\t}\n\t\t// Update the booking state.\n\t\tconst booking = this._data.booking.clone();\n\t\tbooking.catering = form.controls.catering.value;\n\n\t\tif (booking.catering.length) {\n\t\t\tconst setup = {};\n\t\t\tsetup[booking.room.email] = booking.setup[booking.room.email] || 900;\n\t\t\tconst breakdown = {};\n\t\t\tbreakdown[booking.room.email] = booking.breakdown[booking.room.email] || 900;\n\n\t\t\tbooking.setup = setup\n\t\t\tbooking.breakdown = breakdown\n\t\t}\n\n\t\tthis.updateBookingState(booking);\n\t}\n\n\tpublic set specific_dates(val: boolean) {\n\t\tthis._specific_dates = val;\n\t}\n\n\tpublic get specific_dates(): boolean {\n\t\treturn this._specific_dates;\n\t}\n\n\n\tpublic toggleSpecificDates() {\n\t\tthis.specific_dates = !this.specific_dates;\n\t}\n\n\n}\n","\n
\n
\n
 
\n
\n \n

Your booking date and/or time was successfully updated

\n \n
\n
\n \n

{{ warningMessage }}

\n \n
\n \n \n
\n
\n
\n
\n \n Recurring booking status: {{ statusText }} \n
\n
\n \n
\n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Days' : 'Day'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Weeks' : 'Week'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Months' : 'Month'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs on Specific Dates effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}\n
\n
\n
\n
{{ occurrence.dateTz.formatDate('dd MMM yyyy') }}
\n
\n
\n
\n
\n
\n
\n
\n \n Edit series\n \n \n \n
\n
\n\n
\n
\n

{{statusText}}

\n {{timeString}} \n
\n
\n
\n \n
\n

This is a multiroom booking. To request edits, please contact your local backoffice team.

\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n \n
\n\n
\n
\n {{roomName}}\n
\n
\n {{roomLocation}}\n
\n
\n Capacity: {{capacity}}\n
\n \n
\n\n\n\n
\n\n \n
\n \n Reception\n \n
\n
\n \n Cancel booking\n \n
\n \n
\n\n\n
\n \n\n
\n \n
\n \n
\n
\n
\n

\n \n Schedule\n

\n \n \n
\n\n

\n Date: {{dateString}}
\n Time: {{timeString}}
\n {{type}} meeting ({{durationString}})\n

\n \n {{ checkingExtendable ? 'Checking availability...' : 'Extend booking duration'}}\n \n
\n \n
\n
\n

\n \n

\n

\n \n \n \n

\n
\n \n\n \n
\n
\n
\n

\n Meeting\n

\n \n \n
\n \n
\n
Meeting title:   {{ title}}
\n
Host:   {{ host}}
\n
Attendees:   {{attendeesString}}\n
\n
Company:   {{companyString}}
\n
Charge code:   {{chargeCode}}
\n
Headcount estimate:   {{headcount}}
\n
Additional requirements:   {{requirements}}
\n
Email notification for this booking has been opt out.
\n
Outlook calendar invite for this booking has been opted out of.
\n \n
\n \n
\n
\n\n
\n
\n

\n \n

\n \n \n \n \n \n \n
\n
\n \n\n
\n
\n
\n \n
\n
\n \n
\n\n \n
\n\n \n
\n
\n \n \n \n

\n \n \n \n

\n \n \n
\n\n
\n
\n \n
\n

\n \n Catering\n

\n \n \n
\n Catering available for this room\n
\n \n \n
\n
\n\n \n
\n \n
\n

\n \n

\n

\n \n

\n \n
\n
\n
\n\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n \n
\n
\n\n
\n \n
\n \n \n
\n
\n
\n\n
\n \n
\n\n
\n \n
\n \n
\n
\n
\n\n
\n\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n } from '@mckinsey-converge/base';\nimport {\n Booking,\n BookingsService,\n DEFAULT_BOOKING_DURATION,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\ninterface extendData {\n booking: Booking;\n maximum: number\n}\n\n@Component({\n selector: 'app-booking-duration-modal',\n template: `\n \n
\n \n

Your booking failed to update, please try again

\n \n
\n
\n \n
Extend booking duration
\n
\n
\n \n \n
\n
\n \n
\n
\n `,\n styleUrls: ['./booking-duration-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class BookingDurationModalComponent extends BaseDirective implements OnInit {\n\n public loading: string;\n public showWarningBanner: boolean = false;\n\n public get durationGroups() {\n const step = 15;\n const steps = Math.floor(this.data.maximum / step);\n const max = (steps * step) + this.data.booking.duration;\n\n return [{\n start: this.data.booking.duration,\n step,\n max\n }];\n }\n\n public formGroup = new FormGroup({\n date: new FormControl(this.data.booking.date, [Validators.required]),\n dateTz: new FormControl(this.data.booking.startDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n });\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: extendData,\n private dialogRef: MatDialogRef,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n ngOnInit() {\n this.formGroup.setValue({\n date: this.data.booking.date,\n dateTz: this.data.booking.startDateTz,\n duration: this.data.booking.duration,\n });\n }\n\n public closeModal(booking?: Booking) {\n this.dialogRef.close(booking);\n }\n\n public updateBookingDuration() {\n const formData = this.formGroup.getRawValue();\n this.loading = 'Saving...';\n\n // clone booking to allow editing\n // const booking = this.data.booking.clone(); // this line commented for bug appearing in CNG-352. Used cloneDeep instead\n const booking = cloneDeep(this.data?.booking);\n booking.endDateTz = booking.startDateTz.addValue({ minutes: formData.duration });\n this._bookings.save(booking).then(\n () => {\n this.loading = null;\n this.closeModal(booking);\n },\n (err) => {\n this.loading = null;\n this.displayWarningBanner()\n }\n );\n }\n\n\n public displayWarningBanner() {\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { BookingResultsViewModel } from '../manage-bookings/manage-bookings.viewmodel';\nimport {\n BaseDirective,\n shorterLocalDateFormatString,\n timeWithZoneFormatString,\n startEndTimeFormatString,\n humaniseDuration,\n closestToTimeSlotTz,\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ, localTimezone } from \"@mckinsey-converge/date-tz\";\nimport { Booking, BookingFormData, BookingStoreState, bookingTypeOptions, Building, BuildingCity, clearBookingFormData, defaultRoomSizeOption, DEFAULT_BOOKING_DURATION, flattenDisplayOffices, roomFormDataToQuery, roomSizeOptions, storeBookingFormData } from '@mckinsey-converge/data-common';\nimport { buildingStateSelector, BuildingStoreState, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BehaviorSubject,\n} from 'rxjs';\n\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n@Component({\n selector: 'app-booking-result-item',\n templateUrl: './booking-result-item.component.html',\n styleUrls: ['./booking-result-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingResultItemComponent extends BaseDirective implements OnInit {\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: BookingResultsViewModel | undefined;\n \n @Input()\n public bookings: BookingResultsViewModel[];\n\n @Input()\n public list: string;\n\n @Input() public index: number;\n\n @Input() public small: boolean = false;\n\n @Output()\n public bookingSelect = new EventEmitter();\n\n public buildings = new BehaviorSubject[]>([]);\n\n public roomName: string;\n public roomLocation: string;\n public host: string;\n public status: string;\n public timeStringParts: string[] = [' ', ' '];\n public localTimeStringParts: string[] = [' ', ' '];\n public isAnotherTimezone: boolean = false;\n public statusText: string;\n public statusImage: string;\n public durationString: string;\n public timeRangeString: string;\n public building: any;\n public get dateString() {\n if (!this.bookings || !this.bookings.length) return '';\n const bkn1 = this.bookings[this.index].booking;\n const d1 = new DateTZ({ date: bkn1.startDateTz.ms, is_local_tz: false, building_tz: bkn1.startDateTz.building_tz });\n if (this.index === 0) {\n return shorterLocalDateFormatString(d1);\n }\n const bkn2 = this.bookings[this.index - 1].booking;\n const d2 = new DateTZ({ date: bkn2.startDateTz.ms, is_local_tz: false, building_tz: bkn2.startDateTz.building_tz });\n if (!d1.isSameDate(d2, 'day')) {\n return shorterLocalDateFormatString(d1);\n }\n return '';\n }\n public get todayString() {\n if (!this.bookings || !this.bookings.length) {\n return '';\n }\n \n // Strip the booking of it's timezone infomation so isSameDate is just based on timestamp and local time.\n const d1 = new DateTZ({ date: this.bookings[this.index].booking.startDateTz.ms });\n return DateNow(new Date()).isSameDate(d1, 'day') ? '(Today)' : '';\n }\n\n public get attendeesCount(): number {\n // allAttendees is booking.attendees + 1 (booking.organizer)\n return this.viewModel.booking?.allAttendees.length; \n }\n\n public get has_catering(): number {\n return this.viewModel.booking?.has_catering && this.viewModel.booking?.catering?.length;\n }\n\n public get upcoming() {\n return ['tentative', 'accepted', 'approved'].includes(this.status);\n }\n\n constructor(private store: Store,\n private cdRef: ChangeDetectorRef) {\n super();\n }\n\n public ngOnInit(): void {\n this.setupDisplayFields();\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n }));\n this.cdRef.detectChanges();\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public getTooltipText(){\n return this.viewModel.booking.local_room_name.split(',');\n }\n\n public setupDisplayFields() { \n if (!this.viewModel?.booking) {\n return;\n }\n this.timeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz).split(' ');\n this.timeRangeString = startEndTimeFormatString(this.viewModel.booking.startDateTz, this.viewModel.booking.displayEndDateTz);\n this.isAnotherTimezone = !this.viewModel.booking.startDateTz.is_local_tz;\n this.localTimeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz.toZone(localTimezone())).split(' ');\n this.host = this.viewModel.booking.organiser.name;\n this.roomName = this.viewModel.booking.local_room_name.split(',')[0];\n this.roomLocation = this.viewModel.booking.room.street_and_city;\n this.durationString = humaniseDuration(this.viewModel.booking.duration, 'medium');\n\n if (this.viewModel.booking.status) {\n // mark bookings before today expired\n this.status = (DateNow(new Date()).isAfterDate(this.viewModel.booking.endDateTz) && this.list !== 'cancelled') ? 'expired' : this.viewModel.booking.status;\n switch(this.status) {\n case 'tentative':\n this.statusImage = 'assets/icon/booking_pending.svg';\n this.statusText = 'Pending';\n break;\n case 'accepted':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'approved':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'declined':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'cancelled':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'expired':\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n default: // TODO\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n }\n }\n this.cdRef.detectChanges();\n return;\n }\n\n}\n","

\n {{ dateString }} {{ todayString }}\n

\n
\n
\n
\n
\n
\n {{ timeStringParts[0] }} ({{ timeStringParts[1] }}) ({{\n durationString\n }})\n
\n
\n {{ localTimeStringParts[0] }} ({{ localTimeStringParts[1] }}) in your\n local timezone\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
{{ statusText }}
\n
\n {{ timeRangeString }}\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
{{ viewModel.booking.title }}
\n {{\n viewModel.booking.bookingTypeLabel\n }}\n \n {{viewModel.booking?.merged ? 'Merged' : 'Multiroom'}} \n \n \n
\n \n \n \n
\n
\n \n {{ roomName }}\n {{ roomLocation }}\n Host: {{ host }}\n {{ attendeesCount }}pp\n Catered\n \n \n \n \n \n \n \n \n
\n
\n
\n\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { RoomBookingComponent } from 'src/app/booking/room-booking/room-booking.component';\nimport { RoomResultsComponent } from 'src/app/booking/room-results/room-results.component';\nimport { RoomDetailsComponent } from 'src/app/booking/room-details/room-details.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { OfficeFloorComponent } from './office-floor/office-floor/office-floor.component';\n\nconst routes: Routes = [\n {\n path: 'results',\n component: RoomResultsComponent,\n },\n {\n path: 'results/filter',\n component: RoomFiltersModalComponent,\n },\n {\n path: 'results/room',\n component: RoomDetailsComponent,\n },\n {\n path: 'create',\n component: BookingCreateComponent,\n },\n {\n path: 'edit',\n component: BookingEditWrapperComponent,\n },\n {\n path: 'manage',\n component: ManageBookingsComponent,\n },\n {\n path: 'catering/:id',\n data: { hasCatering: true },\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id/:verb',\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id',\n component: ManageBookingsComponent,\n },\n {\n path: 'floor-map',\n component: OfficeFloorComponent,\n },\n {\n path: 'results/booking-calendar',\n loadChildren: () => import('./booking-calendar/booking-calendar.module').then((m) => m.BookingCalendarModule),\n },\n {\n path: '**',\n component: RoomBookingComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingRoutingModule {}\n","import {\n createReducer,\n on\n} from '@ngrx/store';\nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\nimport { closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n};\n\nexport const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: \n {\n location: state?.activeForm?.location,\n timezone: state?.activeForm?.timezone,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: state?.activeForm?.timezone, }), 15)\n \n }\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { BookingRoutingModule } from './booking-routing.module';\nimport { BookingsListingComponent } from './bookings-listing/bookings-listing.component'\nimport { RoomBookingComponent } from './room-booking/room-booking.component';\nimport { RoomDetailsComponent } from './room-details/room-details.component';\nimport { BookingFormBaseComponent } from './booking-create/booking-form-base.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditComponent } from './booking-create/booking-edit.component';\nimport { BookingConfirmationComponent } from './booking-confirmation/booking-confirmation.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule } from '@angular/material/select';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { MatButtonModule } from '@angular/material/button';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingFormReducer } from 'src/app/booking/booking.form.reducer';\nimport { BookingResultItemComponent } from './booking-result-item/booking-result-item.component';\nimport { BookingDetailsModalComponent } from './booking-details-modal/booking-details-modal.component';\nimport { BookingDurationModalComponent } from './booking-duration-modal/booking-duration-modal.component';\nimport { CancelBookingModalComponent } from './cancel-booking-modal/cancel-booking-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { RoomResultsComponent } from './room-results/room-results.component';\nimport { SearchedLocationComponent } from './searched-location/searched-location.component';\nimport { ResultsHeaderComponent } from './results-header/results-header.component';\nimport { RoomAvailabilityPreviewComponent } from './room-availability-preview/room-availability-preview.component';\nimport { RoomLocationPreviewComponent } from './room-location-preview/room-location-preview.component';\nimport { RoomResultItemComponent } from './room-result-item/room-result-item.component';\nimport { RoomBookingFormComponent } from './room-booking-form/room-booking-form.component';\nimport { RoomBookingDetailsFormComponent } from './room-booking-details-form/room-booking-details-form.component';\nimport { RoomBookingModalComponent } from './room-booking-modal/room-booking-modal.component';\nimport { RoomResultsPaginatedComponent } from './room-results-paginated/room-results-paginated.component';\nimport { RoomFiltersModalComponent } from './room-filters-modal/room-filters-modal.component';\nimport { RoomFiltersFormComponent } from './room-filters-form/room-filters-form.component';\nimport { RoomAvailabilityPreviewModalComponent } from './room-availability-preview-modal/room-availability-preview-modal.component';\nimport { MapModule } from 'src/app/map/map.module';\nimport { OfficeFloorMapModule } from 'src/app/booking/office-floor/office-floor-map.module';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RoomResultsSectionComponent } from './room-results-section/room-results-section.component';\nimport { CalendarModule, DateAdapter } from 'angular-calendar';\nimport { adapterFactory } from 'angular-calendar/date-adapters/date-fns';\nimport { BookingCateringComponent } from './catering/catering.component';\nimport { OrderTableComponent } from './catering/order-table/order-table.component';\nimport { BookingCateringOrderDetailsComponent } from './catering/order-details/order-details.component';\nimport { BookingCateringOrderListComponent } from './catering/order-list/order-list.component';\nimport { CateringOrderListItemComponent } from './catering/order-list/item/item.component';\nimport { CateringMenuCategoryComponent } from './catering/order-details/category/category.component';\nimport { SurveyModalComponent } from '../components/survey-modal/survey-modal.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\n\nexport const bookingModuleDeclarations = [\n BookingFormBaseComponent,\n BookingCreateComponent,\n BookingEditComponent,\n BookingConfirmationComponent,\n BookingDetailsModalComponent,\n BookingDurationModalComponent,\n BookingsListingComponent,\n BookingResultItemComponent,\n CancelBookingModalComponent,\n ManageBookingsComponent,\n BookingCateringComponent,\n BookingCateringOrderDetailsComponent,\n BookingCateringOrderListComponent,\n CateringMenuCategoryComponent,\n CateringOrderListItemComponent,\n RoomBookingComponent,\n RoomDetailsComponent,\n RoomResultsComponent,\n SearchedLocationComponent,\n ResultsHeaderComponent,\n RoomAvailabilityPreviewComponent,\n RoomLocationPreviewComponent,\n RoomResultItemComponent,\n RoomBookingModalComponent,\n RoomBookingFormComponent,\n RoomBookingDetailsFormComponent,\n RoomResultsPaginatedComponent,\n RoomFiltersModalComponent,\n RoomFiltersFormComponent,\n RoomResultsSectionComponent,\n RoomAvailabilityPreviewModalComponent,\n CateringMenuCategoryComponent,\n OrderTableComponent,\n SurveyModalComponent,\n BookingEditWrapperComponent\n];\n\nexport const bookingModuleImports = [\n CommonModule,\n UiModule,\n MatSelectModule,\n MatButtonModule,\n NgxMatSelectSearchModule,\n ReactiveFormsModule,\n SharedContentModule,\n FormsModule,\n NgxSkeletonLoaderModule,\n MapModule,\n CalendarModule.forRoot({\n provide: DateAdapter,\n useFactory: adapterFactory,\n }),\n OfficeFloorMapModule\n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingRoutingModule,\n StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingModule {\n}","import { Component, Input, OnInit, OnChanges, ChangeDetectionStrategy, ChangeDetectorRef, NgZone } from '@angular/core';\nimport { throttleTime, tap, first, distinctUntilChanged, map } from 'rxjs/operators';\nimport { fromEvent } from 'rxjs';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BuildingStoreState, buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Booking, User, IEngineResponse, BookingStoreState, clearBookingFormData, BookingsService, UsersService, flattenDisplayOffices, BuildingCity, Building } from '@mckinsey-converge/data-common';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { loadBookingsWithQuery, loadUpcomingBookingsResults, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel,\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { BookingPagination } from '@mckinsey-converge/bookings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nexport type ManageBookingsStoreState = BookingStoreState &\n BuildingStoreState &\n MyBookingsStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-bookings-listing',\n templateUrl: './bookings-listing.component.html',\n styleUrls: ['./bookings-listing.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingsListingComponent extends BaseDirective implements OnInit, OnChanges {\n @Input() public config: any;\n @Input() public buildings: BehaviorSubject[]>;\n @Input() public searchBookingBy: string;\n @Input() public selectedHost: string;\n @Input() public activeTab: string;\n\n public bookingResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public bookings: BookingResultsViewModel[];\n public showBookings = false;\n public reloading = false;\n public TopBarHeaderMode = TopBarHeaderMode;\n public mobile: boolean = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n public pagination: BookingPagination = {\n currentPage: 1,\n totalRecords: 0,\n pageLimit: 10,\n };\n bookingPerPage: any[] = [];\n filteredByHost: any[] = [];\n\n public get lastPage() {\n return this.pages.total === this.pagination.currentPage;\n }\n\n public get pages() {\n const p = this.pagination;\n const total = Math.ceil(p.totalRecords / p.pageLimit) ;\n const group = Math.ceil(p.currentPage / 5);\n const startPosition = Math.max(\n 1,\n Math.min(group > 1 ? (group - 1) * (p.pageLimit + 1) : 1, total - 4)\n );\n let pages = [];\n for (let x = startPosition; x <= Math.min(startPosition + 4, total); x++) {\n pages.push(x);\n }\n if (!pages.length) {\n pages.push(1);\n }\n const maxed = () => {\n if (total <= 5 || p.currentPage >= total) {\n return false;\n }\n return true;\n };\n const mined = () => {\n if (total <= 5 || p.currentPage < 6) {\n return false;\n }\n return true;\n };\n const start = p.currentPage > 5;\n const end = !(p.currentPage >= total);\n return {\n total,\n pages,\n min: mined(),\n max: maxed(),\n start,\n end,\n };\n }\n\n constructor(\n private store: Store,\n private _route: ActivatedRoute,\n private _router: Router,\n private dialog: MatDialog,\n private _bookings: BookingsService,\n private _zone: NgZone,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 450;\n const selector = this.config.selector;\n const target = this.config.type;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n \n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n // this.buildings.next(next);\n if(this.activeTab === this.config.type) {\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target,\n offset: 0,\n })\n );\n }\n\n // start the timer at the top of the minute;\n const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n setTimeout(() => {\n this.refresh(target);\n this._zone.runOutsideAngular(() => {\n this.interval('refreshBookings', () => this.refresh(target, true), 60 * 1000);\n });\n\n }, offset + 5000);\n\n \n }));\n\n\n\n const sort_asc = (a, b) => a.date - b.date;\n const sort_desc = (a, b) => b.date - a.date;\n\n this.subscription(\n 'bookingResults',\n this.store.pipe(select(selector)).subscribe((next) => {\n this.bookingResults.next(next);\n if (!next.isEmpty() && Array.isArray(next?.success?.results)) {\n let results = [...next?.success?.results].sort(\n this.config.reverse_sort ? sort_desc : sort_asc\n );\n this.showBookings = !!results.length;\n this.reloading = false;\n // save all bookings to reuse later \n this.allBookings = results;\n \n /** Filter all booings of active tab by selected host if any */\n this.filterBySelectedHost(true);\n\n } else {\n this.showBookings = false;\n this.reloading = false;\n this.bookings = [];\n this.pagination.totalRecords = 0;\n this.cdRef.detectChanges();\n }\n })\n );\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n ).subscribe();\n \n this.timeout('query', () =>\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n if (params.has('page')) this.setPage(+params.get('page'), false);\n })\n )\n );\n }\n\n //For each result from results, it find its level and building from the lists and map with BookingResultsViewModel but filter all master from list.\n public getViewModel = (results) => mapResultsToViewModels(results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n\n\n public splitArrayIntoSubarrays(originalArray, subarrayLength) {\n var newArray = [];\n for (var i = 0; i < originalArray.length; i += subarrayLength) {\n newArray.push(originalArray.slice(i, i + subarrayLength));\n }\n return newArray;\n }\n\n\n public ngOnChanges($change: any) {\n \n if ($change?.buildings?.currentValue !== $change?.buildings?.previousValue || $change?.activeTab?.currentValue !== $change?.activeTab?.previousValue) {\n this.refresh(this.config.type);\n }\n if ($change?.selectedHost?.currentValue !== $change?.selectedHost?.previousValue) {\n this.filterBySelectedHost(true);\n } else\n if ($change?.searchBookingBy?.currentValue !== $change?.searchBookingBy?.previousValue) {\n this.filterBySelectedHost(false);\n }\n }\n\n\n\n public filterBySelectedHost(isHostChanged: boolean) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchHost = this.selectedHost.toLowerCase().trim();\n // this.filteredByHost = [];\n\n if(this.allBookings) {\n\n if(searchHost) {\n if(isHostChanged) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.allBookings];\n // Filtering the combine array to find matching host email \n this.filteredByHost = allItems.filter( (item: any ) => \n this.isIncludes(item?.host, 'email', searchHost) ||\n this.isIncludes(item?.organiser, 'email', searchHost)\n );\n }\n else {\n this.filteredByHost = [...this.filteredByHost];\n }\n \n }\n else {\n this.filteredByHost = [...this.allBookings];\n }\n\n //Now send filtered booking by host to filter further by search input given in the field\n this.filterBookingsBySearchValue([...this.filteredByHost]);\n\n \n }\n }\n\n \n public isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\n public filterBookingsBySearchValue(filteredByHost) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = this.searchBookingBy.toLowerCase().trim();\n let filteredItems = [];\n\n if(filteredByHost) {\n\n if(searchValue) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...filteredByHost];\n // Filtering the combine array to find matching room or booking \n filteredItems = allItems.filter( (item: any ) => \n this.isIncludes(item, 'title', searchValue) ||\n this.isIncludes(item?.creator, 'name', searchValue) ||\n this.isIncludes(item?.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'local_room_name', searchValue) || // search with room name \n this.isIncludes(item, 'simple_name', searchValue) || \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n }\n else {\n filteredItems = [...filteredByHost];\n }\n\n const filteredBookings = this.getViewModel(filteredItems);\n \n this.pagination.totalRecords = filteredBookings.length;\n this.pagination.currentPage = !this.lastPage ? 1 : this.pagination.currentPage;\n this.bookingPerPage = this.splitArrayIntoSubarrays(filteredBookings, this.pagination.pageLimit);\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n }\n \n }\n\n \n\n\n\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return this.reloading; // || !this.bookingResults?.value?.isLoading;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find((b) => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // From the Manage Bookings page\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n if(viewModel.booking.is_recurrent) {\n let booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n if (!booking) {\n booking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n }\n this.master_booking = mapResultsToViewModels([booking])[0];\n }\n this.cdRef.detectChanges();\n\n // real booking.room here.\n const dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking: viewModel.booking,\n refresh: () => {\n this.refresh('all');\n },\n\n building: this.getBuilding(viewModel.booking),\n master_booking: this.master_booking?.booking || null,\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRefX.afterClosed().subscribe((flag) => {\n flag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n this.cdRef.detectChanges();\n // this.timeout('refreshBookings', () => this.refresh('all'), 1000);\n // this.timeout('refreshBookings', () => this.refresh('all'), 5000);\n });\n }\n\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n this.cdRef.detectChanges();\n }\n\n public readonly prevPage = () => this.setPage(this.pagination.currentPage - 1);\n public readonly nextPage = () => this.setPage(this.pagination.currentPage + 1);\n public readonly prevGroup = () => this.setPage(this.pages.pages.length);\n public readonly nextGroup = () => this.setPage(this.pages.pages.length + 1);\n public readonly gotoPage = (page: number) => this.setPage(page);\n\n public setPage(page_idx: number, route: boolean = true) {\n if (!this.pages.total) return;\n const page = Math.max(1, Math.min(page_idx, this.pages.total));\n if (route) this._router.navigate([], { relativeTo: this._route, queryParams: { page } });\n this.pagination.currentPage = page;\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n // this.refresh();\n }\n\n public refresh(target: string = this.activeTab, dontShowReloading = false) {\n if (!this.currentUser?.email) {\n return;\n }\n\n \n const offset = 0 ; //(this.pagination.currentPage - 1) * this.pagination.pageLimit;\n // fetch it on one minute interval now that there is room data.\n if(this.activeTab === this.config.type) {\n\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target:this.activeTab,\n offset,\n })\n );\n this.reloading = !dontShowReloading;\n this.cdRef.detectChanges();\n }\n \n\n \n\n \n }\n\n identify(index, item) {\n return item.booking.id;\n }\n}\n","
\n \n \n
\n
\n \n\n \n \n \n \n \n \n \n \n
\n \n
\n
\n \n

End of list. You have no upcoming bookings

\n
\n
\n \n

End of list. Past meetings are saved for up to 48 hours.

\n
\n
\n \n

End of list. Cancelled meetings are saved for up to 48 hours.

\n
\n
\n
\n \n \n \n \n
\n
\n
\n
    \n
  • \n
  • 1
  • \n
  • ...
  • \n
  • \n {{p}}\n
  • \n
  • ...
  • \n
  • \n {{pages.total}}\n
  • \n
  • \n
\n
\n","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { Booking, Building, RecurrencePeriod } from '@mckinsey-converge/data-common';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface data {\n booking: Booking;\n building: Building;\n callback: Function;\n master_booking?: Booking;\n hasLoaderUrl?: boolean;\n refresh?: Function;\n\t\tseries?:{};\n}\n\n@Component({\n selector: 'app-cancel-booking-modal',\n template: `\n \n
\n \n
\n
\n \n
{{ subtitle }}
\n
\n
\n

{{ data.booking.title }}

\n\n \n

\n Daily from \n \n

\n weekly on {{ data?.master_booking?.recurrence_days[0] | titlecase }}\n

\n

from

\n \n Monthly on \n\n {{ data?.master_booking?.dateString }} until\n {{ data?.master_booking?.endDateString }}\n

\n \n \n Specific Dates: \n
\n
\n
Date
\n
\n
\n {{ occurrence.dateTz.formatDate('dd MMM yyyy') }}\n
\n
\n
\n
\n
\n
\n\n

{{ dateString }}

\n

{{ timeString }}

\n

{{ buildingAddress }}

\n

{{ data.booking.room.local_room_name }}

\n \n
\n \n
\n
\n `,\n styleUrls: ['./cancel-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CancelBookingModalComponent extends BaseClass {\n public title: string;\n public roomName: string;\n public buildingAddress: string;\n public dateString: string;\n public timeString: string;\n public canceled = false;\n private _specific_dates = false;\n private recurrence_period: RecurrencePeriod;\n public occurrence_details: { start_epoch: number; dateTz: DateTZ; id: string }[];\n private recurrence_interval: number;\n\n public get subtitle() {\n return this.canceled\n ? `${this.title} booking cancelled`\n : this.data?.series\n ? 'Are you sure you want to cancel this recurring series?'\n : 'Are you sure you want to cancel this booking?';\n }\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: data,\n private dialogRef: MatDialogRef\n ) {\n super();\n this.dateString = dateBuildingFormatString(this.data.booking.startDateTz, true);\n this.timeString = startEndTimeWithZoneFormatString(this.data.booking.startDateTz, this.data.booking.displayEndDateTz);\n this.title = this.data.booking.title;\n this.buildingAddress = this.data.booking.room.street_and_city;\n\n\n\t\t\t\tif(this.data?.master_booking !== null) {\n\n\t\t\t\t\tthis.recurrence_period = this.data?.master_booking?.recurrence_period;\n\t\t\t\t\tthis.recurrence_interval = this.data?.master_booking?.recurrence_interval;\n\n\t\t\t\t\tthis.occurrence_details = this.data?.master_booking?.occurrence_details &&\n\t\t\t\t\t\tthis.data?.master_booking?.occurrence_details\n\t\t\t\t\t\t\t.filter((ocurrence) => ocurrence.id !== this.data?.master_booking?.id)\n\t\t\t\t\t\t\t.map((ocurrence) => ({\n\t\t\t\t\t\t\t\t...ocurrence,\n\t\t\t\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\tbuilding_tz: this.data.master_booking.timezone,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t}));\n\t\t\t\t}\n\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public cancelBooking() {\n this.canceled = true;\n this.data.callback();\n this.timeout('closeModal', () => this.closeModal(), 2000);\n }\n\n public set specific_dates(val: boolean) {\n this._specific_dates = val;\n }\n\n public get specific_dates(): boolean {\n return this._specific_dates;\n }\n\n public toggleSpecificDates() {\n this.specific_dates = !this.specific_dates;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n Booking,\n Building,\n CateringOrder,\n Space,\n bookingStatusDetails,\n ApplicationService,\n CateringCategory,\n BookingsService,\n DataForConfirmation,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap,\n shorterLocalDateFormatString\n} from '@mckinsey-converge/base';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase\n} from '@mckinsey-converge/base';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n CateringDetailsModalComponent,\n CateringDetailsModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface BookingFlowEvent {\n /** Type of flow event */\n type: 'previous' | 'next' | 'reset' | 'close' | 'error';\n /** Step which the event was emitted from */\n step: string;\n /** Additional metadata for the event */\n metadata?: HashMap;\n}\n\n@Component({\n selector: 'booking-catering',\n templateUrl: './catering.component.html',\n styleUrls: ['./catering.component.scss']\n})\nexport class BookingCateringComponent extends BaseDirective implements OnInit {\n /** Form fields for the booking */\n @Input() public form: FormGroup;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n @Input() public booking: Booking;\n @Input() public isOccurence: boolean;\n /** Emitter for open catering */\n @Output() public showCatering = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n\n constructor(\n private _dialog: MatDialog,\n public _service: ApplicationService,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.updateConfimatinModal();\n }\n\n /** Active order to display details for */\n public active_order: CateringOrder;\n public TopBarHeaderMode = TopBarHeaderMode;\n public confirmed: boolean = false;\n public next_disabled: boolean = true;\n\n public loading: boolean = false;\n\n\n public get building(): Building[] {\n return this.booking.room.building;\n };\n\n /** Field for storing catering details */\n public get catering_field() {\n return this.form && this.form.controls.catering ? this.form.controls.catering : null;\n }\n\n /** List of spaces selected for the booking */\n public get space_list(): Space[] {\n return this.form && this.form?.controls?.space_list?.value.length\n ? this.form.controls.space_list.value\n : [];\n }\n\n /** Date of the booking */\n public get dateTz(): number {\n return this.form && this.form.controls.dateTz\n ? this.form.controls.dateTz.value\n : DateNow(new Date()).startOfValue('minute');\n }\n\n /** Duration of the booking */\n public get duration(): number {\n return this.form && this.form.controls.duration ? this.form.controls.duration.value : 60;\n }\n\n /** Whether booking is all day */\n public get all_day(): boolean {\n return this.form && this.form.controls.all_day && this.form.controls.all_day.value;\n }\n\n\n public get type() {\n return toTitleCase(this.booking?.class);\n }\n\n public get dateString() {\n return dateBuildingFormatString(this.booking.startDateTz);\n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n /** Create a new catering order */\n public newOrder(): void {\n const order = new CateringOrder({ booking_timezone: this.booking?.timezone });\n this.active_order = order;\n }\n\n // Combine the same items for the same timeslot into the same order item\n public combineItems = (newItems: CateringCategory[], oldItems: CateringCategory[]) => {\n // Group and Sum the items in an Item ID keyed object\n const itemsObj = {};\n oldItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n });\n newItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n })\n // Convert the object to an array\n const items = [];\n for (const item in itemsObj) {\n items.push(itemsObj[item]);\n }\n // return the items consolidated by item ID.\n return items;\n }\n\n /** Handle changes to catering order */\n public handleOrderEvent(order: CateringOrder) {\n /* istanbul ignore else */\n if (order) {\n this.next_disabled = false;\n const orders = this.form.controls.catering.value;\n // When the order edit button is clicked we are editing an existing order\n const index = orders.findIndex((an_order) => {\n return order.id === an_order.id\n });\n\n // If editing an existing order row it will have an index, if not create a new row\n if (index < 0) {\n // Add the new order\n orders.push(order);\n } else {\n // Replace the existing order with the edited order\n orders.splice(index, 1, order);\n }\n\n // Setup the \"reduced\" data containers\n const reduceItems = {};\n const reduceOrders = {};\n orders.forEach((o) => {\n if (reduceItems[o.delivery_time]) {\n // An order for this timeslot already exists, combine the same items to dedupe rows\n reduceItems[o.delivery_time] = this.combineItems(o.items, reduceItems[o.delivery_time]);\n } else {\n // Since this is a new timeslot, use the existing items\n reduceItems[o.delivery_time] = o.items;\n // Copy the order and clear its item contents, placeholder for the updated items\n reduceOrders[o.delivery_time] = o;\n reduceOrders[o.delivery_time].items = [];\n }\n });\n\n // Add the reduced items to the reduced orders\n let consolidatedOrders = [];\n for (const deliveryTime in reduceOrders) {\n const order = reduceOrders[deliveryTime];\n order.items = reduceItems[deliveryTime]\n consolidatedOrders.push(order);\n }\n\n this.form.controls.catering.setValue(consolidatedOrders);\n }\n this.active_order = null;\n }\n\n public closeCallback() {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n\n public closeConfirmation() {\n this.event.emit();\n }\n\n /** Open modal for adding equipment requirements to booking */\n private openCateringDetailsModal() {\n const ref = this._dialog.open(\n CateringDetailsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n spaces: this.form.controls.space_list.value,\n notes_field: this.form.controls.notes,\n catering: this.form.controls.catering,\n booking: this.booking\n }\n }\n );\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n // Catering requirements and charge code modal closed event\n /* istanbul ignore else */\n if (event.reason === 'done') {\n // Closed with the reason done\n ref.close();\n\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n\n this.saveBooking();\n }\n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public saveBooking() {\n // Clone and append the catering and note data to the booking\n let booking = this.booking.clone();\n booking.catering = this.form.controls.catering.value;\n booking.notes = this.form.controls.notes.value;\n if(booking.notes.length || booking.catering.length) {\n\n const setup = { ...booking.setup };\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n booking.setup = setup;\n\n const breakdown = { ...booking.breakdown };\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n booking.breakdown = breakdown;\n }\n\n\n // Save to the API and respond. && !this.isOccurence\n this._bookings.save(booking, booking.is_recurrent ).then(\n (bkn) => {\n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() }); \n // Stop the loading animation and show the booking confirmation component.\n this.updateConfimatinModal();\n\n this.loading = false;\n this.confirmed = true;\n this.event.emit(this.form)\n },\n (err) => {\n // Stop the loading animation and return to the catering flow with an error.\n this.loading = false;\n this.confirmed = false;\n this._service.notifyError(\n `Error updating booking.`\n );\n }\n )\n }\n\n public handleOrderListEvent($event: any) {\n const orders = this.form.controls.catering.value;\n // Handle the Previous and Next buttons\n if ($event.type === 'previous') {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n if ($event.type === 'next') {\n // Move on to the catering details modal\n this.next_disabled = false;\n if (orders.length) {\n this.openCateringDetailsModal();\n } else {\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n this.saveBooking();\n }\n }\n }\n\n public openCatering() {\n // Start catering from the Booking Confirmation page Add Catering button\n this.confirmed = false;\n this.next_disabled = true;\n this.showCatering.emit();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n // openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n \n this.booking.multi_rooms.forEach(room => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n \n\n const result = {\n is_conflict: totalConflicts > 0, \n total_Conflicts: totalConflicts \n };\n return result;\n }\n\n /**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n return shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n }\n\n}\n","
\n
\n \n \n
\n
\n
\n
\n \n \n \n
\n \n \n \n
\n
\n \n
\n
\n
","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport { CateringCategory } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-category-display',\n templateUrl: './category.component.html',\n styleUrls: ['./category.component.scss']\n})\nexport class CateringMenuCategoryComponent {\n /** Category to display details for */\n @Input() public category: CateringCategory;\n /** Form control for the list of order items */\n @Input() public items: FormControl;\n /** Currency symbol for the active space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for close events */\n @Output() public close = new EventEmitter();\n}\n","
\n
\n \n
{{ category?.name }}
\n
\n
\n\n
\n \n
\n
\n\n
\n
\n \n
\n
\n Category contains no available items\n
\n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\nimport { BehaviorSubject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n Building,\n CateringCategory,\n CateringItem,\n CateringMenuService,\n CateringOrder,\n OrganisationService,\n Space\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n Identity\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n BookingCateringConfirmModalComponent,\n CateringConfirmModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface StartEndResponse {\n timezone: string,\n start: DateTZ;\n end: DateTZ\n}\n\n@Component({\n selector: 'a-catering-order-details',\n templateUrl: './order-details.component.html',\n styleUrls: ['./order-details.component.scss']\n})\nexport class BookingCateringOrderDetailsComponent extends BaseDirective implements OnInit {\n /** Catering order to edit details of */\n @Input() public order: CateringOrder;\n /** Booking date */\n @Input() public dateTz: DateTZ;\n /** Booking duration */\n @Input() public duration: number;\n /** Booking duration */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether top header details should be shown */\n @Input() public hide_details: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for changes to the catering order */\n @Output() public event = new EventEmitter();\n /** Form controls for order */\n public form: FormGroup;\n /** List of available catering item categories */\n public category_list: CateringCategory[] = [];\n /** Active category to display details for */\n public active_category: CateringCategory;\n /** List of available times for delivering catering */\n public available_times: Identity[] = [];\n /** Whether the menu is loading */\n public loading: boolean;\n /** Whether the search input should be shown */\n public show_search: boolean;\n /** Current search string for filtering */\n public readonly search$ = new BehaviorSubject('');\n /** List of menu items that match the search string */\n public matched_items: CateringItem[] = [];\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n @ViewChild('input') private _input_el: ElementRef;\n\n /** Whether user is able to order from the currently selected space */\n public get can_order(): boolean {\n return (\n (this.active_building.has_catering || this.category_list.length) &&\n (!this.within_restricted_time || this.has_available_items) &&\n !this.out_of_hours\n );\n }\n\n /** Building associated with the selected space */\n public get active_building(): Building {\n const form_controls = (this.form || { controls: { location_id: { value: '' } } }).controls;\n const space: Space =\n this.space_list.find((space) => space.email == form_controls.location_id.value) ||\n ({ level: {} } as any);\n return (\n this._org.buildings.find((bld) => space.level?.building_id === bld.id) ||\n ({ catering_restricted_from: 0 } as any)\n );\n }\n\n /** Currency code for the active building */\n public get symbol(): string {\n return this.active_building.currency || 'USD';\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n return this.form\n ? this.form.controls.items.value.reduce((total, item) => total + item.amount, 0)\n : 0;\n }\n\n /* istanbul ignore next */\n /** Whether booking time is outside of catering hours */\n public get out_of_hours(): boolean {\n return this.form.controls.delivery_time.value < 0;\n }\n\n /** Whether booking is with the restricted ordering period */\n public get within_restricted_time(): boolean {\n const expired = DateNow(new Date()).addValue({ hours: this.active_building.catering_restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n }\n\n /** Whether booking is with the restricted ordering period */\n public within_category_restricted_time(item?: CateringItem ): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!item?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: item?.restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n /** Whether items are available for order at anytime */\n public get has_available_items(): boolean {\n return this.category_list.reduce(\n (available, category) => available || category.can_order_anytime,\n false\n );\n }\n\n constructor(\n private _menu: CateringMenuService,\n private _org: OrganisationService,\n private _dialog: MatDialog\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.generateAvailableTimes();\n this.subscription('search', this.search$.pipe(map((str) => {\n const search = str.toLowerCase();\n const items = [];\n const available_categories = this.category_list.filter(item => !item.within_category_restricted_time(this.dateTz) )\n\n for (const category of available_categories) {\n if (category.items) {\n for (const group of category.items) {\n if ((group as any).items.length) {\n if (\n (group as any).package &&\n (group.name.toLowerCase().includes(search) ||\n (group as any).items.find((item) =>\n item.name.toLowerCase().includes(search)\n ))\n ) {\n items.push(group);\n } else {\n for (const item of (group as any).items) {\n if (item.name.toLowerCase().includes(search)) {\n items.push(item);\n }\n }\n }\n } else {\n if (group.name.toLowerCase().includes(search)) {\n items.push(group);\n }\n }\n }\n }\n }\n \n return items;\n })).subscribe((items) => this.matched_items = items));\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.date || changes.duration) {\n this.generateAvailableTimes();\n /* istanbul ignore else */\n if (\n this.form &&\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n /* istanbul ignore else */\n if (changes.space_list) {\n /* istanbul ignore else */\n if (this.form && this.space_list && !this.form.controls.location_id.value) {\n this.form.controls.location_id.setValue(this.space_list[0].email);\n }\n }\n /* istanbul ignore else */\n if (changes.order && this.order) {\n this.initForm();\n }\n }\n\n public focusSearch() {\n if (this._input_el && this.show_search) {\n this._input_el.nativeElement.focus();\n }\n }\n\n public initForm() {\n this.form = new FormGroup({\n id: new FormControl(this.order.id),\n booking_date: new FormControl(\n this.all_day ? this.dateTz.startOfValue('day').ms : this.dateTz.ms\n ),\n location_id: new FormControl(this.order.location_id || this.space_list[0]?.email),\n delivery_time: new FormControl(this.order.delivery_time || this.available_times[0].id),\n items: new FormControl(this.order.items.map((item) => new CateringItem(item)))\n });\n this.subscription(\n 'space_change',\n this.form.controls.location_id.valueChanges.subscribe((space) => {\n this.generateAvailableTimes();\n if (\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n this.form.controls.items.setValue([]);\n this.loadMenu();\n })\n );\n this.loadMenu();\n this.generateAvailableTimes();\n if (\n this.form &&\n !this.available_times.find((time) => time.id === this.form.controls.delivery_time.value)\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n\n public confirmOrder() {\n const ref = this._dialog.open(BookingCateringConfirmModalComponent, {\n maxWidth: '95vw',\n data: {\n all_day: this.all_day,\n dateTz: this.dateTz,\n form: this.form\n }\n });\n this.subscription(\n 'confirm_event',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const order = new CateringOrder({ ...this.order, ...this.form.value });\n // order is emited but who is receiving?\n this.event.emit(order);\n ref.close();\n }\n })\n );\n ref.afterClosed().subscribe(() => {\n this.unsub('confirm_event');\n });\n }\n\n private loadMenu() {\n const space = this.space_list.find(\n (space) => space.email === this.form.controls.location_id.value\n );\n\n this.loading = true;\n this._menu\n .query({ zone_id: this._org.buildings.find((bld) => space?.zones.includes(bld.id))?.id })\n .then(\n (list) => {\n this.loading = false;\n this.category_list = list.map((i) => new CateringCategory(i))\n .filter(c => !c.out_of_stock);\n },\n () => (this.loading = false)\n );\n }\n\n /** Generate a list of available delivery times for the given booking time */\n private generateAvailableTimes() {\n let { timezone, start, end } = this.generateStartAndEndTimes();\n start = start.setValue({ minute: Math.ceil(start.minutes / 5) * 5 });\n // will be different from staff in these commonly named methods.\n const start_date = this.dateTz;\n this.available_times = [];\n while (start.isBeforeDate(end)) {\n this.available_times.push({\n id: Math.abs(start_date.dateDiff(start, 'minutes')),\n name: start.formatDate('h:mma').toLocaleLowerCase(),\n });\n start = start.addValue({ minutes: 5 });\n }\n /* istanbul ignore else */\n if (this.available_times.length === 0) {\n this.available_times.push({ id: -1, name: 'Out of hours' });\n }\n }\n\n private generateStartAndEndTimes(): StartEndResponse {\n const now = DateNow(new Date())\n let timezone = now.local_tz;\n const space_email = this.form ? this.form.controls.location_id.value : null;\n let catering_hours = { start: 7, end: 20 };\n let building_time = this.dateTz.startOfValue('day');\n let cat_start_time = building_time.addValue({ hours: catering_hours.start });\n let cat_end_time = building_time.addValue({ hours: catering_hours.end });\n\n if (space_email) {\n // Fetch the Space and Building\n const space = this.space_list.find((space) => space.email === space_email);\n const building = this._org.buildings.find((bld) => space?.zones.includes(bld.id));\n if (building.timezone) {\n // Update to the building timezone if defined.\n timezone = building.timezone;\n building_time = this.dateTz.toZone(timezone).startOfValue('day');\n }\n if (building?.catering_hours) {\n // Update to the building catering hours if defined.\n catering_hours = building?.catering_hours;\n }\n // Update the hours with the currently defined timezone.\n cat_start_time = building_time.addValue({ hours: catering_hours.start });\n cat_end_time = building_time.addValue({ hours: catering_hours.end });\n }\n\n // Start Time of the Booking\n let start = this.dateTz.toZone(timezone);\n let end = this.dateTz.toZone(timezone).addValue({ minutes: this.duration });\n\n // Do the booking start and end time coincide with the catering hours?\n if (start.isBeforeDate(cat_start_time)) {\n // booking start before catering opens'\n if (cat_end_time.isAfterDate(start)) {\n // catering closes after booking starts'\n start = cat_start_time.addValue({});\n } else {\n // were just closed, catering closes before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking starts after catering is open'\n if (cat_end_time.isBeforeDate(start)) {\n // were just closed, catering closed before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n }\n\n if (end.isBeforeDate(cat_end_time)) {\n // booking ends before catering closes'\n if (cat_start_time.isAfterDate(end)) {\n // were just closed, catering opens is after booking ends'\n start = cat_start_time.addValue({});\n end = cat_start_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking ends after catering closes'\n // set the booking end to the catering close time.'\n end = cat_end_time.addValue({});\n }\n\n return { timezone, start, end };\n }\n}\n\n","
\n
\n
\n
\n
Deliver to:
\n \n \n \n {{ space.local_name }}\n \n \n \n
\n
\n
At:
\n \n \n \n {{ time.name }}\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n \n
\n \n
\n
{{ item.name }}
\n \n
\n
\n
\n
\n
\n
\n \n Back\n \n \n Confirm Order({{ item_count || '0' }})\n \n
\n
\n
\n\n
\n
\n \"No\n
\n

\n Catering is not available for this booking.
\n Catering must be ordered within business hours at {{ active_building?.name }}.\n

\n
\n
\n\n
\n
\n
\n \n
\n
\n Loading menu for {{ active_building?.name }}...\n
\n
\n
\n
\n\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\n\nimport {\n CateringOrder,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { DateNow } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'catering-order-list-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss']\n})\nexport class CateringOrderListItemComponent implements OnInit {\n /** Catering order to display */\n @Input() order: CateringOrder;\n /** */\n @Input() public space_list: Space[];\n /** Selected datetime */\n @Input() date: number = DateNow(new Date()).ms;\n /** Emitter for edit events */\n @Output() public edit = new EventEmitter();\n /** Emitter for delete events */\n @Output() public delete = new EventEmitter();\n\n public room: Space;\n\n public ngOnInit(): void {\n this.room = (this.space_list || []).find(space => space.email === this.order.location_id);\n }\n\n public get space_in_booking(): boolean {\n return !!this.room;\n }\n\n /** Space selected for delivery */\n public get local_space_name(): string {\n return this.room?.local_name || '';\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n /* istanbul ignore else */\n if (!this.order) {\n return '';\n }\n\n // R--- there's probably a helper for this calculation on the Catering Order \n return this.order.bookingDateTz.addValue({ minutes: this.order.delivery_time || 0 }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount * item.unit_price, 0);\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.room || !this.room.level) {\n return 'USD';\n }\n\n return this.room?.building?.currency || 'USD';\n }\n\n constructor(private _spaces: SpacesService) {\n }\n}\n","
\n Deliver to {{ local_space_name }} at {{ delivery_time }}\n
\n
\n
\n {{ item_count }}\n { item_count, plural, =1 { item } other { items } }\n
\n
{{ order_cost / 100 | currency: symbol }}
\n
\n
\n \n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport {\n CateringOrder,\n Space\n} from '@mckinsey-converge/data-common';\nimport { BookingFlowEvent } from '../../catering/catering.component';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'a-catering-order-list',\n templateUrl: './order-list.component.html',\n styleUrls: ['./order-list.component.scss']\n})\nexport class BookingCateringOrderListComponent {\n /** Form field for storing catering orders */\n @Input() public catering: FormControl;\n /** Selected datetime for the booking */\n @Input() public date: number;\n /** */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether booking is all day */\n @Input() public next_disabled: boolean;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n /** Emiiter for order events */\n @Output() public order = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n \n public delete: boolean = false;\n\n /** List of orders in the booking */\n public get orders(): CateringOrder[] {\n /* istanbul ignore else */\n if (!this.catering) {\n return [];\n }\n let orders = [];\n const date_ = new DateTZ({date: this.date})\n this.catering.value.forEach(\n order => {\n const newOrder = order;\n newOrder.booking_date = this.all_day\n ? date_.startOfValue('day').ms\n : this.date;\n orders.push(newOrder);\n }\n \n );\n return orders;\n }\n\n /** Emit event for a new catering order */\n public newOrder() {\n this.order.emit();\n }\n\n /** Emit event for editing existing order */\n public editOrder(order: CateringOrder) {\n this.order.emit(order);\n }\n\n /** Remove order from the list */\n public deleteOrder(order: CateringOrder) {\n const orders = this.orders;\n const index = orders.findIndex(an_order => order.id === an_order.id);\n /* istanbul ignore else */\n if (index >= 0) {\n orders.splice(index, 1);\n this.catering.setValue(orders);\n this.delete = true;\n }\n }\n\n /**\n * Proceed to the next step in the space booking flow\n */\n public next(): void {\n // Open the confirmation modal\n this.event.emit({ type: 'next', step: 'catering' });\n }\n\n /** Move flow to previous step */\n public previous(): void {\n this.event.emit({ type: 'previous', step: 'catering' });\n }\n}\n","
\n
\n

Catering Orders

\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n Back\n \n \n Next\n \n
\n
\n
\n\n
\n
\n \n
\n
No catering orders
\n \n
\n
\n","import {\n Component,\n Input,\n} from '@angular/core';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'catering-order-table',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n Delivery\n Charge CodeOrder
\n {{formatDeliveryTime(order)}}\n \n {{order?.charge_code}} \n \n {{listItems(order)}}\n
\n
\n `,\n styleUrls: ['./order-table.component.scss']\n})\nexport class OrderTableComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public booking: Booking;\n\n public listItems(order) {\n return order.items.map(i => `${i.name}${i.amount > 1 ? ` (${i.amount})` : ''}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n public oddEvenClass(x) {\n return x % 2 === 0 ? 'odd' : 'even';\n }\n}\n","import {\n Component,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnInit\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n User,\n Booking,\n Building,\n BuildingCity,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectUpcomingBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n selectBookingByIdResultsFromState,\n UsersService,\n} from '@mckinsey-converge/data-common';\nimport {\n clearBookingByIdResults,\n} from '@mckinsey-converge/bookings';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n first,\n map,\n take,\n} from 'rxjs/operators';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport {\n SelectOption\n} from '@mckinsey-converge/ui';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { RoomBookingStoreState } from '../room-booking/room-booking.component';\nimport { MatTabChangeEvent } from '@angular/material/tabs';\nimport { SearchBarConfig } from 'libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component';\n\n\n@Component({\n selector: 'app-manage-bookings',\n template: `\n
\n
 
\n
\n \n
\n
\n
\n
\n

Manage Bookings

\n\n
\n \n \n
\n \n
\n \n
\n\n\n \n \n
\n \n \n \n
\n
\n\n
\n
\n
\n
\n `,\n styleUrls: ['./manage-bookings.component.scss']\n})\nexport class ManageBookingsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public buildings = new BehaviorSubject[]>([]);\n public bookingTypes = [\n {\n type: 'upcoming',\n display: 'Upcoming',\n selector: selectUpcomingBookingsResultsFromState\n },\n {\n type: 'past',\n display: 'Past',\n selector: selectPastBookingsResultsFromState\n },\n {\n type: 'cancelled',\n display: 'Cancelled',\n reverse_sort: true,\n selector: selectCancelledBookingsResultsFromState\n },\n ];\n\n /** Current User */\n public currentUser: User;\n public dialogRef: MatDialogRef;\n public modalInitialized = false;\n public hasLoaderUrl = true;\n\n public activeTab = 'upcoming';\n\n /**\n * Configs for delegate dropdown\n */\n /* if user has no delegates, hide the dropdown */\n public has_delegate: boolean = false; \n /* Holds list of all host/delegates */\n public host_list: User[];\n public hostOptions: { display: string; value: string; meta: { user: User; }; }[];\n public delegateDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; ddOptionBoxWidth: string };\n public selectedHost: string = '';\n\n public searchBookingBy: any = '';\n\n\n searchBarConfig: SearchBarConfig = {\n placeholder: 'Search by title, room name, attendees...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n constructor(\n private dialog: MatDialog,\n private store: Store,\n private route: ActivatedRoute,\n private _router: Router,\n private _users: UsersService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Get the router params\n const bookingId = this.route.snapshot.paramMap.get('id');\n const verb = this.route.snapshot.paramMap.get('verb');\n // Load the buildings data\n this.store.dispatch(loadOrganisations.request());\n this.route.data.subscribe(initData => {\n // Determine if the cancel or booking submodal is loading\n const cancel = verb === 'cancel';\n const addCatering = initData.hasCatering;\n /**\n * When using the catering or cancel URLs,\n * Users reported the modals loading after one another was\n * jarring so, so the UI is masked out until the modal is loaded.\n */\n this.hasLoaderUrl = addCatering || cancel;\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n if (bookingId && !this.modalInitialized) {\n this.store.dispatch(clearBookingByIdResults())\n this.modalInitialized = true;\n // Once the data loads viewBooking\n this.subscription('bookingResults', this.store.pipe(\n select(selectBookingByIdResultsFromState)\n ).subscribe(next => {\n const booking = next.success ? next.success?.[0] : null;\n if (booking && booking.room) {\n // Modal Madness, close the existing booking details modals.\n if (this.dialogRef) {\n this.dialogRef.close();\n }\n if (this.dialog) {\n this.dialog.closeAll();\n }\n // Call viewBookingFromEmailLink with cancel = true to trigger the cancel modal\n // Call viewBookingFromEmailLink with addCatering = true to trigger the add Catering modal\n this.viewBookingFromEmailLink(booking, cancel, addCatering);\n\n // Remove the \"loader\" url from view\n this.timeout('rewrite url',() => {\n this._router.navigate(['/home','manage'], { replaceUrl: true });\n })\n }\n }));\n }\n }));\n\n })\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n if (bookingId) {\n // If there's a booking ID loadBookingById\n this.store.dispatch(loadBookingsWithQuery({ 'id': bookingId, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n }\n }));\n\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n\n const delegates = user.delegates.map((del) => {\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n });\n\n if (delegates.length) {\n this.has_delegate = true;\n\n this.host_list = [user].concat(delegates);\n const options = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }))\n \n this.hostOptions = [{ display: 'All', value: '', meta: { user: null } }].concat(options);\n this.selectedHost = this.hostOptions[0].value;\n this.delegateDD = {\n ddBoxClass: '',\n options: this.hostOptions,\n defaultSelected: this.hostOptions[0],\n onChangeCallback: this.onChangeDelegates.bind(this),\n ddOptionBoxWidth: '200px'\n }\n }\n \n });\n }\n\n public onChangeDelegates(del) {\n this.selectedHost = del.value;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // Only fires from an email link\n public viewBookingFromEmailLink(booking: Booking, cancel: boolean = false, addCatering: boolean = false) {\n if (this.modalInitialized && this.dialogRef) {\n this.dialogRef.close();\n this.dialogRef = null;\n }\n // R--- Verify the email links are working.\n // Open the booking details modal\n if (!this.dialogRef && booking.room) {\n this.dialogRef = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking,\n building: this.getBuilding(booking),\n cancel,\n addCatering,\n hasLoaderUrl: this.hasLoaderUrl,\n refresh: () => null\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n // Close up the loader panel\n setTimeout(() => {\n this.hasLoaderUrl = false;\n }, 1000);\n }\n }\n\n public clearPage(event : MatTabChangeEvent) {\n this.activeTab = this.bookingTypes[event.index].type;\n this._router.navigate([], { relativeTo: this.route, queryParams: { page: 1 } });\n }\n\n\n searchBooking(value) {\n this.searchBookingBy = value;\n }\n\n}\n","import {\n Booking\n} from '@mckinsey-converge/data-common';\n\n\nexport class BookingResultsViewModel {\n constructor(public booking: Booking) {\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Booking[]): BookingResultsViewModel[] => {\n if (!results || !results[0]?.space) {\n return [];\n }\n return results.map((booking: Booking) => {\n return new BookingResultsViewModel(\n booking,\n );\n }); \n}\n\n","import { Component, Inject, OnInit, ViewEncapsulation, ElementRef, Input, ViewChild, ChangeDetectorRef } from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n BookingStoreState,\n User,\n Booking,\n BookingFormData,\n BOOKING_STATUS,\n checkCollisions,\n SpacesService,\n BookingsService,\n BookingStateService,\n clearBookingFormData,\n ApplicationService,\n selectFilteredByIdResults,\n FilteredSpaces,\n selectActiveForm,\n roomFormDataToQuery,\n storeBookingFormData,\n getNextFreeBookingSlot,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\nimport { DateTime } from 'luxon';\nimport { Point, BaseDirective, closestToTimeSlot, HashMap, closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { BehaviorSubject, Observable, interval, timer, of } from 'rxjs';\nimport { CENTER_POINT, MIN_ZOOM_LEVEL } from 'src/app/map/map.utils';\nimport { Store, select } from '@ngrx/store';\nimport { RoomStoreState, loadByIdResults, loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { delay, map, take } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { WAITING_TIME } from '../floor-map.utils'; // commented and re declare below due to circular dependency overlay > util > overlay\n\nexport const WAITING_TIME = 15;\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel;\n parentComponent?: any;\n roomObs?: Observable\n}\n\ninterface InProgressRoomBookingTimeInfo {\n\tcurrentStatus: string,\n\tactiveBookings: Booking[],\n\ttimeUntilNextBooking: number,\n\ttimeRemainingInActiveBooking : number,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'foor-map-overlay',\n template: `\n
\n
\n\n
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \t\n
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tThis room is available\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tRoom {{ data.simple_name || data.name || '' }} is available for booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tBook now for:\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tUntil next booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Available if you book in the next {{minutesRemaining}}:{{secondsRemaining}} minutes\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tRefresing availability ...\n\t\t\t\t\t\t\t
\n \t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tThis room is booked\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Apologies, this room has been booked recently by another user, please try another one. \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n
\n
\n
\n `,\n styleUrls: ['./floor-map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class FloorMapOverlayComponent extends BaseDirective implements OnInit {\n public selectedRoomId = this.data.id;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public center = new BehaviorSubject(CENTER_POINT);\n\n public date = DateTime.now().valueOf();\n /** Current User */\n public currentUser: User;\n\n public availableUntil = parseInt(this.data?.settings?.available_until.toString()) * 1000;\n public diff: any;\n\n public latestBooking: any[];\n public latestBookingStartTime: string;\n public diffInHours: number;\n public diffInMinutes: number;\n public booking: Booking = new Booking({});\n public loading: boolean;\n public bookingData = new BehaviorSubject(undefined);\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public diffInMs: number;\n public futureBookingsForTheDay: HashMap[];\n public untilNextBookingFlag: boolean = false;\n public start_epoch: any;\n public end_epoch_15: any;\n public end_epoch_30: any;\n\n public userSelectedRoom: RoomResultsViewModel;\n\n // @ViewChild('time', { static: false }) public time: ElementRef;\n public isTimerActive: boolean = true;\n minutesRemaining: number | string;\n secondsRemaining: number | string;\n isAvailable: boolean = true;\n intervalCall_15: any;\n intervalCall_1: any ;\n\t\ttimerIndex = 0;\n\t\tpublic currentMin;\n\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n private elementRef: ElementRef,\n public store: Store,\n public _spaces: SpacesService,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _service: ApplicationService,\n // public cdRef: ChangeDetectorRef,\n ) {\n super();\n }\n\n public updateRoomData(space) {\n\n\t\t\t\t\t\t// get all booking of selected room\n this.fetchRoomWithBookings(false);\n\n\t\t\t\t\t\t// subscrip selected room detail with all bookings for the day\n this.subscription(\n 'bookingSpaceResults',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n if (next.success.spaces) {\n\n space.space = next.success.spaces[0];\n this.userSelectedRoom = space;\n\n this.isTimerActive = true;\n\n this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n\n\t\t\t\t\t\t\t\t\t\t\t\t//Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t\t\t\t\t\t\t\t\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t\t\t\t\t\t\t\t\t\tthis.diff = timeUntilNextBooking\n // inform user if space has been booked by other\n if( currentStatus !== 'available') {\n if(activeBookings.length && timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 ) {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n } else {\n this.isAvailable = false;\n this.intervalCall_1?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n }else {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n }\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Determine available time until next booking start time\n this.determineNextBookingStartTime();\n }\n })\n );\n\n }\n\n\t\t/**\n\t\t * Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t * @returns\n\t\t */\n\t\tpublic calculateRoomBookingTimeInfo(): InProgressRoomBookingTimeInfo {\n\n\t\t\tconst now: any = DateNow(new Date()); // current date time\n\n\t\t\t// Retirive a list of bookings and map them to booking objects\n\t\t\tconst bookings = this.userSelectedRoom.space.settings.bookings.map(b => new Booking(b));\n\n\t\t\t// Filter active/in-progress bookings based on the current time\n\t\t\tconst activeBookings = bookings.filter(booking =>\n\t\t\t\t\t\tnow.isAfterDate(booking.startDateTz.startOfValue('second')) &&\n\t\t\t\t\t\tnow.isBeforeDate(booking.endDateTz.startOfValue('second') )\n\t\t\t);\n\n\t\t\t// Retrive the status of the selected room from parent component data\n\t\t\tconst currentStatus = this.data.parentComponent.roomStatus.statusMap[this.selectedRoomId]; // \" 'available' / 'in-use'\"\"\n\n\t\t\t// Initialize the variable to track time-related information\n\t\t\tlet timeRemainingInActiveBooking = 0; // The remaining time in the active booking in milliseconds\n\t\t\tlet timeUntilNextBooking = 30; // Time until the start of the next booking minutes\n\n\t\t\t// Check if ther are active bookings (room is 'in-use')\n\t\t\tif(activeBookings.length) {\n\t\t\t\tconst nowTime: any = DateTime.now()\n\t\t\t\t// Calculate the time remaining in the active booking in minutes\n\t\t\t\ttimeRemainingInActiveBooking = Math.abs(Math.round((activeBookings[0].end_epoch * 1000 - nowTime.ts) / 60000));\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n\t\t\t\tconst addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// calculate the start time of the next booking in the same time slot\n\t\t\t\tconst nextBookingStartTime: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n\n\t\t\t\t// Filter futute booking for the day to find the next booking\n\t\t\t\tconst futureBookingsForTheDay = this.userSelectedRoom.space?.settings?.bookings.filter((item) =>\n\t\t\t\t\titem.start_epoch * 1000 >= nextBookingStartTime.ts\n\t\t\t\t);\n\n\t\t\t\t// Check if there is an futute booking for the day\n\t\t\t\tif(futureBookingsForTheDay.length) {\n\t\t\t\t\t// calculate the time until start of the next booking in minutes\n\t\t\t\t\tconst nextBookingStartTimeMs = futureBookingsForTheDay[0].start_epoch * 1000;\n\t\t\t\t\ttimeUntilNextBooking = Math.floor((nextBookingStartTimeMs - nowTime.ts) / (1000 * 60));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t\t\t\tcurrentStatus: currentStatus,\n\t\t\t\t\t\t\tactiveBookings: activeBookings,\n\t\t\t\t\t\t\ttimeUntilNextBooking: timeUntilNextBooking,\n\t\t\t\t\t\t\ttimeRemainingInActiveBooking : timeRemainingInActiveBooking,\n\t\t\t\t\t\t};\n\n\t\t}\n\n public setup15MinTimer() {\n //interval for 15 min\n !this.timerIndex && setTimeout(()=>this.setUpTime(), 1100 ) ;\n this.timerIndex++\n this.intervalCall_15 = window.setInterval(\n () => { this.intervalCall_1?.unsubscribe(); setTimeout(()=>this.setUpTime(), 1100 ) }\n , ( 1000 * 60 * WAITING_TIME ) );\n\n\n }\n\n public setUpTime() {\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute'));\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME)\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second'))\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n let start:any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n start = start.toLocaleString(DateTime.TIME_SIMPLE);\n if(start !== this.start_epoch ) {\n\n this.start_epoch = start;\n\n // this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(this.availableUntil);\n // this.diff = Math.abs(Math.round((endTime.getTime() - currentTime.getTime()) / 60000));\n\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n\n }\n\n\t\t\t\t\t\t//update up start and end epoch times for a booking button options\n\t\t\t\t\t\tthis.updateSchedulingEpochs()\n\n // let end_15: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 15 });\n // end_15 = end_15.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_15 !== this.end_epoch_15) {\n // this.end_epoch_15 = end_15\n // }\n\n // let end_30: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 30 });\n // end_30 = end_30.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_30 !== this.end_epoch_30) {\n // this.end_epoch_30 = end_30;\n // }\n }\n\n public ngOnInit(): void {\n this.fetchRoomWithBookings(false);\n\n this.data.parentComponent.childCallback = this.updateRoomData.bind(this);\n this.userSelectedRoom = this.data?.room;\n\t\t\t\tthis.updateSchedulingEpochs();\n this.updateRoomData(this.userSelectedRoom);\n\t\t\t\t// Determine available time until next booking start time\n // this.determineNextBookingStartTime();\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n //update up start and end epoch times for a booking button options\n // this.updateSchedulingEpochs();\n this.data.parentComponent.isOverlayOpened = true;\n }\n\n /**\n * This function sets up start and end epoch times for a booking scheduling system.\n * It calculates and assigns various epoch times based on the current time,\n * available until time, and user-selected room's timezone.\n */\n public updateSchedulingEpochs() {\n\n\t\t\tconst now: any = DateTime.now();\n\n\t\t\t// Calculate the time difference in minutes between current and available until time\n\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t// this.diff = Math.abs(Math.round((this.availableUntil - now.ts) / 60000)); // recheck\n\t\t\tthis.diff = timeUntilNextBooking;\n\n\t\t\t// Determine system availability based on time difference\n\t\t\tthis.isAvailable = timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 // this.diff >= 15;\n\n\t\t\t// Calculate the next time slot for scheduling\n\t\t\tconst addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\t\t\tconst adjustedTime = now.plus({ minutes: addMin, seconds: 0 }).setZone(this.userSelectedRoom?.building?.timezone);\n\n\t\t\t// Calculate and assign the start and end epoch times with 15 and 30-minute intervals\n\t\t\tconst timeSlot = closestToTimeSlot(adjustedTime, WAITING_TIME);\n\t\t\tthis.start_epoch = timeSlot.toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_15 = timeSlot.plus({ minutes: 15 }).toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_30 = timeSlot.plus({ minutes: 30 }).toLocaleString(DateTime.TIME_SIMPLE);\n }\n\n ngAfterViewInit() {\n this.setupTimer();\n }\n\n public setupTimer() {\n console.log(DateTime.now().get('second'))\n const addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n }\n\n\n // countdown timer for coachmark\n public startTimer(display = 0, addSeconds = 0) {\n\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n // const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n // let timer = availableTimeToBook; //(this.diff -35) * 60;\n // let minutes;\n // let seconds;\n let timer = 0 ;\n if(timer >= 0){\n this.intervalCall_1 = interval(1000).subscribe(x => {\n\n const currentTime = new Date(DateTime.now().valueOf());\n const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n let timer = availableTimeToBook; //(this.diff -35) * 60;\n\n this.isTimerActive = true;\n this.minutesRemaining = Math.floor(timer / 60);\n this.secondsRemaining = Math.floor(timer % 60);\n\n this.minutesRemaining = this.minutesRemaining < 10 ? \"0\" + this.minutesRemaining : this.minutesRemaining;\n this.secondsRemaining = this.secondsRemaining < 10 ? \"0\" + this.secondsRemaining : this.secondsRemaining;\n\n --timer;\n\n if (timer <= 0) {\n timer = 0\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n this.isTimerActive = false;\n !this.timerIndex && this.setup15MinTimer();\n\n\t\t\t\t\t\t\t\t\t\tthis.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t\t\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addSeconds = 60 - DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second');\n\t\t\t\t\t\t\t\t\t\t\t\t\tform['date'] = closestToTimeSlot(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).plus({ minutes: addMin, seconds:0 }), WAITING_TIME).valueOf(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tform.dateTz = closestToTimeSlotTz(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew DateTZ({ date: DateTime.now().plus({ minutes: addMin, seconds:0 }), is_local_tz: false, building_tz: form.timezone }),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWAITING_TIME\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n\n\t\t\t\t\t\t\t\t\t\t\t});\n\n }\n }) //, 1000, endTime)\n }\n }\n\n\t\t/**\n\t\t * This function updates information related to the lates booking in the selected room\n\t\t */\n public determineNextBookingStartTime() {\n\n\t\t\t\t// Get the current time using DateTime library\n const now = DateTime.now();\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n const addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// Adjust the current time by adding the calculated minutes adna setting the timezone based on the selected room's building\n const addjustedTime: any = closestToTimeSlot(\n now.plus({ minutes: addMin, seconds:0 })\n .setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME\n );\n\n\t\t\t\t\t\t// Check if room is selected and has bookings settings\n if (this.userSelectedRoom?.space) {\n\t\t\t\t\t// Returive the list of future bookings or initializem it as an empaty array\n const futureBookings = this.userSelectedRoom?.space?.settings?.bookings || [];\n\n\t\t\t\t\t\t// Calculate the end time for a 30-minute interval from the addjested time\n const endEpoch30 = addjustedTime.plus({ minutes: 30 }).ts;\n\n\t\t\t\t\t\t// Filter future booking that start after end_epoch_30\n\t\t\t\t\t\tconst futureBookingsForTheDay = futureBookings.filter(item => item.start_epoch * 1000 >= endEpoch30);\n\n\t\t\t\t\t\t// Check if there are futute bookings found\n\t\t\t\t\t\tif(futureBookingsForTheDay.length > 0) {\n\t\t\t\t\t\t\t//Extract the start time of latest booking\n\t\t\t\t\t\t\tconst latestBookingStartTime = new Date(futureBookingsForTheDay[0].start_epoch * 1000);\n\n\t\t\t\t\t\t\t// Calculate the time difference between the latest booking start time and the current time in milliseconds\n\t\t\t\t\t\t\tconst timeDiffMs = latestBookingStartTime.getTime() - now.valueOf();\n\t\t\t\t\t\t\tthis.diffInMs = timeDiffMs;\n\t\t\t\t\t\t\t// Calculate the timne differenc in hours and minutes\n\t\t\t\t\t\t\tthis.diffInHours = Math.floor(timeDiffMs / (1000 * 60 * 60));\n \tthis.diffInMinutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));\n\n\t\t\t\t\t\t\t// Set flag to indicate the wether the difference is NaN (no future booking)\n \tthis.untilNextBookingFlag = !isNaN(timeDiffMs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.untilNextBookingFlag = false;\n\t\t\t\t\t\t}\n }\n\n }\n\n //fetch all the bookings for selected room for the day to the store\n public fetchRoomWithBookings(allWeek: boolean = true) {\n const day = 24 * 60;\n const week = day * 7;\n const date = (this.booking?.startDateTz).clone();\n const startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = date.startOfValue('week');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.data?.id,\n capacity: this.booking?.space?.capacity,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public closeModal() {\n const modal = this.elementRef.nativeElement.querySelector('.map-overlay-container');\n modal.classList.add('hide');\n this.data.parentComponent.isOverlayOpened = false;\n this.timerIndex = 0;\n this.isAvailable = false;\n\t\t\t\tthis.untilNextBookingFlag = false;\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n // this.intervalCall_15?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.userSelectedRoom) {\n this.data.parentComponent.roomSelected(this.userSelectedRoom);\n }\n }\n\n public onBook(minutes: number) {\n minutes = Math.round(minutes);\n const {filters, settings} = this.userSelectedRoom.space;\n if ( (filters && filters?.equipment_code ) || (settings && settings?.equipment_code) ) {\n this.roomDataCallback();\n } else {\n this.saveChanges(minutes);\n }\n }\n\n public bookingFormToBooking(minutes): Booking {\n const booking_form_data = this.bookingData.value;\n const has_note_buffer =\n booking_form_data?.notes && booking_form_data.notes?.length\n ? { [booking_form_data.selectedRoom.space.email]: 900 }\n : {}; // 900 seconds = 15 min\n const attendees = this.booking.attendees;\n const company = this.booking.company;\n const start_epoch = closestToTimeSlot(DateTime.now(), 15).valueOf() / 1000;\n const end_epoch =\n closestToTimeSlot(DateTime.now(), 15).plus({ minutes: minutes }).valueOf() / 1000;\n\n const raw_data = {\n space: { id: this.selectedRoomId },\n all_day: false,\n attendees,\n // booking_type: booking_form_data?.bookingType.value,\n booking_type: this.userSelectedRoom.space.filters.external === true? \"External\" : \"Internal\",\n catering: [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data?.timezone,\n equipment_codes: {\n [booking_form_data?.selectedRoom.space.email]: booking_form_data?.code,\n },\n expected_attendees: {\n [this.data.email]: 1,\n },\n has_catering: false,\n needs_space: false,\n notes: this.booking.notes,\n organiser: this.currentUser,\n creator: this.currentUser,\n room: this.userSelectedRoom.space,\n title: 'Ad hoc meeting',\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n };\n console.log(new Booking(raw_data));\n return new Booking(raw_data);\n }\n\n //function for sending final booking request\n public saveChanges(minutes) {\n this.loading = true;\n this.booking = this.bookingFormToBooking(minutes);\n // const booking_form_data = this.bookingData.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(this._spaces, this.booking).then(\n (bookable: boolean) => {\n if (!bookable) {\n // TODO - Refactor for https://acaprojects.atlassian.net/browse/MCK-1498\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n this._booking_state_service.replace(bkn);\n\n // When saved, the returned booking has a null room.\n // Correct this so the rest of the code doesn't flake out.\n this.booking = new Booking({ ...bkn.toJSON(), room: this.booking.room });\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n // Heap track event\n this._service.analytics.track('create', {\n booking_id: bkn.id,\n office: this.booking.room.building.name,\n room: this.booking.local_room_name,\n start_time: bkn.startDateTz.ms,\n end_time: bkn.endDateTz.ms,\n catering: !!bkn.catering.length,\n headcount: 1,\n });\n this.data.parentComponent.confirmBooking(this.booking);\n },\n (err) => {\n this.loading = false;\n this.confirmed = false;\n if (err.status === 409) {\n // Unavailable Confirmation\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n } else {\n console.log(err);\n }\n }\n );\n },\n (err) => {\n // Unavailable Confirmation\n this.loading = false;\n this.timeout(\n 'error',\n () => {\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n },\n 500\n );\n }\n );\n }\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nexport const WAITING_TIME = 15;\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 1\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room\n }\n});\n\n// service account for office floor map view - read only\nexport const SERVICE_ACCOUNT = 'svc_kiosk_converge@mckinsey.onmicrosoft.com';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OfficeFloorComponent } from './office-floor/office-floor.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapModule } from 'src/app/map/map.module';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n MapModule,\n];\n\nexport const mapModuleDeclarations = [\n OfficeFloorComponent,\n FloorMapOverlayComponent,\n // MapControlsComponent,\n // MapFiltersComponent,\n // OfficeInformationModalComponent,\n // MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations,\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class OfficeFloorMapModule {\n}\n","import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, closestToTimeSlot, closestToTimeSlotTz, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults,\n User,\n selectMapFilteredResults,\n ApplicationService,\n clearRoomFilters,\n\t\tbookingTypeOptions,\n defaultRoomSizeOption,\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\n\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n SERVICE_ACCOUNT,\n WAITING_TIME,\n} from '../floor-map.utils';\nimport {\n loadDiffSizeResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router, RouterStateSnapshot } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-office-floor',\n templateUrl: './office-floor.component.html',\n styleUrls: ['./office-floor.component.scss'],\n})\nexport class OfficeFloorComponent extends BaseDirective implements OnInit, OnChanges {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n\n public roomStatus: any;\n public payload: any;\n /** Current User */\n public currentUser: User;\n public bookingConfirmed = false;\n public bookingData: {};\n serviceAccount: boolean;\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private route: ActivatedRoute,\n public _service: ApplicationService,\n private location: Location\n ) {\n super();\n this.payload = location.getState();\n this.payload.floorMap = false;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n throw new Error('Method not implemented.');\n }\n\n public ngOnInit(): void {\n //clear filters first if any applied previously \n this.store.dispatch(clearRoomFilters());\n\n const selection = { value: this.payload?.payload, display: '' };\n this.payload.building.value = this.payload.building[0].id;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n this.serviceAccount = this.currentUser.email === SERVICE_ACCOUNT\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n next.duration = 30;\n this.bookingFormData.next(next); /// <---- timezone setting can be done here\n }\n })\n );\n\n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n this.roomStatus = filteredSpaces;\n\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) =>\n !!s.map_id &&\n s.zones.includes(building.id) &&\n s.zones.includes(this.payload?.payload)\n );\n\n this.resultSpaces.next(cloneDeep(spacesFromSelection));\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n () => {\n if(!this.serviceAccount) {\n this.activeSpace.next(space);\n this.focusOnRoom();\n }\n \n }\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n this.isOverlayOpened && this.focusOnRoom();\n })\n );\n\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'setActiveSpace',\n this.resultSpaces\n .subscribe((next) => {\n // console.log(this.focusedRoom?.value?.space?.id);\n const space = next.find((s) => s.id === this.focusedRoom?.value?.space?.id)\n space && this.activeSpace.next(space);\n })\n );\n\n\n \n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(this.payload.building);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n \n form['date'] = closestToTimeSlot(DateTime.now().plus({ minutes: 1 }), WAITING_TIME).valueOf(),\n form.dateTz = closestToTimeSlotTz(\n new DateTZ({ date: DateTime.now().plus({ minutes: 1 }), is_local_tz: false, building_tz: form.timezone }),\n WAITING_TIME\n )\n this.store.dispatch(storeBookingFormData({ payload: form }));\n this.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n })\n );\n\n this.selectActiveBuilding(this.payload.building);\n this.selectBuildingLevel(selection);\n\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeLevel.next(next);\n });\n }\n\n public selectActiveSpace(selection?: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === this.focusedRoom?.value.space.id)),\n // take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom() {\n // this.selectedSpace = space;\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n // this.focusedRoom.next(null);\n \n this.focusedRoom.next(cloneDeep(focusedRoom[0]));\n this.isOverlayOpened && this.childCallback( cloneDeep(focusedRoom[0]) );\n\n\t\t\t\t\tconst { filters, settings } = this.focusedRoom?.value?.space; // use of new data structure fields\n if ( this.roomStatus.statusMap[this.focusedRoom.value.space.id] === 'requestable' || (filters?.equipment_code || settings?.equipment_code) ) {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.bookingFormData.value,\n selectedRoom: this.focusedRoom.value,\n },\n })\n );\n this.roomSelected(this.focusedRoom.value);\n }\n !this.isOverlayOpened && this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this));\n this.zoom.next(6);\n },\n delay\n );\n });\n }\n\n public isOverlayOpened = false;\n public childCallback;\n\n public exitFullscreen(route: string): void {\n this.store.dispatch(clearRoomFilters());\n\n this.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\tform.bookingType = bookingTypeOptions[0],\n form.roomSize = defaultRoomSizeOption,\n\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\t\t\t\t\t});\n\n const navigationExtras = {\n state: { payload: this.activeLevel.value },\n relativeTo: this.route,\n queryParams: {\n display: 'map',\n },\n };\n this._service.kioskFormFilter = true;\n this.router.navigate([route], navigationExtras);\n }\n\n // public triggerRefresh(){\n // this.subscription(\n // 'activeForm',\n // this.store\n // .pipe(select(selectActiveForm), distinctUntilChanged())\n // .subscribe((next: BookingFormData | undefined) => {\n // if (next) {\n // next.duration = 35;\n // this.bookingFormData.next(next);\n // }\n // })\n // );\n\n // this.subscription(\n // 'bookingSpaceResults',\n // combineLatest([\n // this.store.pipe(\n // select(selectMapFilteredResults),\n // map((r: LoadingModel) => r.success)\n // ),\n // this.activeBuilding.pipe(filterUndefined()),\n // this.activeLevel.pipe(filterUndefined()),\n // ]).subscribe(([filteredSpaces, building, level]) => {\n // this.roomStatus = filteredSpaces;\n\n // const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n // (s) =>\n // !!s.map_id &&\n // s.zones.includes(building.id) &&\n // s.zones.includes(this.payload?.payload)\n // );\n\n // this.resultSpaces.next(spacesFromSelection);\n\n // const listeners: MapListener[] = [];\n // const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach((space) => {\n // const status = filteredSpaces.statusMap[space.id];\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // listeners.push(\n // ...generateMapListenersForSpace(\n // space,\n // () => {},\n // () => {},\n // () => {\n // this.activeSpace.next(space);\n // this.focusOnRoom();\n // }\n // )\n // );\n // });\n // this.style_map.next(styles);\n // this.listeners.next(listeners);\n // })\n // );\n\n // this.subscription(\n // 'bookingResults',\n // this.resultSpaces\n // .pipe(withLatestFrom(this.activeSpace))\n // .subscribe(([resultSpaces, activeSpace]) => {\n // this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n // })\n // );\n // }\n\n public roomSelected(room: RoomResultsViewModel) {\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n let organiser = { display: this.currentUser.name, value: this.currentUser.email };\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n organiser: organiser,\n title: 'Ad hoc meeting',\n // attendees: [this.currentUser],\n code: '',\n notes: '',\n head_count: 1,\n selectedRoom: room,\n },\n })\n );\n\n this.router.navigate(['../create'], { relativeTo: this.route });\n }\n\n public getDayOfWeek(date: string | number | Date) {\n const dayOfWeek = new Date(date).getDay();\n return isNaN(dayOfWeek)\n ? null\n : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][\n dayOfWeek\n ];\n }\n\n public confirmBooking = (bookingData: {}) => {\n this.bookingConfirmed = true;\n this.bookingData = bookingData;\n };\n}\n","
\n
\n
\n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
Booking Confirmed
\n
\n
\n \n
Confirmed
\n
\n
\n
Status: Confirmed
\n
Date: {{this.getDayOfWeek(this.bookingData?.date_string)}}, {{this.bookingData?.date_string}}
\n
Time: {{this.bookingData?.time_period}} GMT{{this.bookingData?.tz_offset}}
\n
{{this.bookingData?.booking_type}} meeting ({{this.bookingData?.duration}} minutes)
\n
Address: {{this.activeBuilding?.value.address}}, {{this.activeBuilding?.value.city}}
\n
Room: {{this.focusedRoom.value.title}}
\n
Room {{this.focusedRoom.value.capacity}}
\n
\n
\n
\n
\n
\n
\n
Host: {{this.currentUser?.name}}
\n
Attendees: {{this.currentUser?.name}}
\n
Charge Code: {{this.focusedRoom?.value.space.filters.charge_code === false ? \"No charge code\" : \"\"}}
\n
Headcount Estimate: {{this.bookingData?.attendees.length}}
\n
Additional Requirements: {{this.bookingData?.notes[0]}}
\n
\n
\n
\n
\n \n Close\n \n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n ActivatedRoute,\n ParamMap,\n Router\n} from '@angular/router';\nimport { deepDistinctUntilChanged } from '@mckinsey-converge/rx-utils';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-results-header',\n template: `\n
\n
\n

Results

\n Matching your search criteria {{resultsCount>=0 ? '('+resultsCount+')' : ''}} \n
\n \n \n
\n `,\n styleUrls: ['./results-header.component.scss']\n})\nexport class ResultsHeaderComponent extends BaseDirective implements OnInit {\n\n public toggleOptions: SelectOption[] = [\n {\n value: 0,\n display: 'List',\n meta: { \n mobile: true\n }\n },\n {\n value: 1,\n display: 'Map',\n meta: { \n mobile: true\n }\n },\n {\n value: 2,\n display: 'Calendar',\n meta: { \n route: 'booking-calendar',\n mobile: false\n }\n }\n ];\n\n public selectedToggle = new BehaviorSubject>(this.toggleOptions[0]);\n\n @Input()\n public resultsCount: number | undefined;\n\n @Output()\n public selectedToggleChange = new EventEmitter>();\n\n constructor(private router: Router,\n private route: ActivatedRoute) {\n super();\n }\n\n public ngOnInit(): void {\n this.selectedToggleChange.next(this.selectedToggle.value);\n\n this.subscription('paramsToUI', this.route.queryParamMap\n .pipe(deepDistinctUntilChanged())\n .subscribe((next: ParamMap) => {\n const retrievedOption = this.toggleOptions.find(o => o.display.toLowerCase() === next.get('display'));\n this.onSelectedChange(retrievedOption ?? this.toggleOptions[0]);\n }));\n }\n\n public onSelectedChange(option: SelectOption) {\n this.selectedToggle.next(option);\n this.selectedToggleChange.next(option);\n\n if(option.meta?.route) {\n this.router.navigate(['booking-calendar'], { relativeTo: this.route });\n }\n else {\n // toggle route.\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n display: option.display.toLowerCase()\n },\n queryParamsHandling: 'merge'\n });\n }\n \n\n }\n\n}\n","import {\n Component,\n Inject,\n OnInit,\n Output,\n EventEmitter,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport {\n Space,\n SpacesService,\n DEFAULT_BOOKING_DURATION,\n checkCollisions,\n Booking\n} from '@mckinsey-converge/data-common';\nimport { DateTZ, convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow } from '@mckinsey-converge/date-tz';\n\ninterface ModalData {\n dateTz: DateTZ,\n duration: number,\n pendingDateTz: DateTZ,\n pendingDuration: number,\n space?: Space,\n rules?: any,\n bookingId?: string,\n currentBooking?: Booking,\n}\n\n@Component({\n selector: 'app-room-availability-preview-modal',\n template: `\n
\n \n
\n \n
New Booking Date/Time
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n

\n Room is available for selected date/time.\n \n But the following items\n \n \n \" {{ item.name }} {{ i === category.items.length - 1 ? '' : ', ' }} \"\n \n \n are restricted due to catering unavailability. Please select another time or remove these items.\n \n\n

\n

Room is unavailable for selected date/time.

\n

Checking availability for selected date/time...

\n

\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n

\n
\n
\n
\n
\n

Old

\n

Date: {{dateString}}

\n

Time: {{timeString}}

\n

({{durationString}})

\n \n
\n
\n

New

\n

Date: {{pendingDateString}}

\n

Time: {{pendingTimeString}}

\n

({{pendingDurationString}})

\n
\n
\n
\n
\n \n 0\"\n primaryLabel=\"Confirm\" (primarySubmit)=\"confirm()\"\n secondaryLabel=\"Cancel\" (secondarySubmit)=\"closeModal()\"\n >\n \n
\n `,\n styleUrls: ['./room-availability-preview-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class RoomAvailabilityPreviewModalComponent implements OnInit {\n @Output() public submitForm = new EventEmitter();\n public dateString: string;\n public timeString: string;\n public durationString: string;\n public pendingDateString: string;\n public pendingTimeString: string;\n public pendingDurationString: string;\n public mapBookingRules: readonly string[];\n public mapBookingSubtitle: string;\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ(), 15);\n public available: boolean = null;\n public formGroup = new FormGroup({\n dateTz: new FormControl(this.fromDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required])\n });\n public localTimezone = \"\";\n public buildingTimezone = \"\";\n public localStart = \"\";\n public localEnd = \"\";\n\n // Declare the restrictedDueToCatering property\n public restrictedDueToCatering: any[] = [];\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: ModalData,\n private dialogRef: MatDialogRef,\n private _spaces: SpacesService,\n ) {}\n\n public get pending_date(){\n return this.data.pendingDateTz; // new DateTZ({ date: this.data.pendingDate.valueOf(), is_local_tz: false, building_tz: this.data?.space?.timezone })\n }\n\n public ngOnInit(): void {\n this.formGroup.setValue({\n dateTz: this.data.pendingDateTz,\n duration: this.data.pendingDuration,\n });\n this.updateDisplay();\n }\n\n // Method run when the confirming the modal.\n public applyChanges(changes: any): void {\n this.data.pendingDateTz = changes.pendingDateTz; // new Date(changes.pendingDate.valueOf());\n this.data.pendingDuration = changes.pendingDuration;\n this.updateDisplay();\n }\n\n public updateDisplay() {\n // this.data.dateTz is the existing time in building time\n // this.data.pendingDateTz is the new time in building time\n const dateTz = this.data.dateTz;\n this.dateString = dateBuildingFormatString(dateTz);\n this.timeString = startEndTimeWithZoneFormatString(dateTz, dateTz.addValue({ minutes: this.data.duration }));\n this.durationString = humaniseDuration(this.data.duration);\n\n const pendingDateTz = this.data.pendingDateTz;\n this.pendingDateString = dateBuildingFormatString(pendingDateTz);\n this.pendingTimeString = startEndTimeWithZoneFormatString(pendingDateTz, pendingDateTz.addValue({ minutes: this.data.pendingDuration }));\n this.pendingDurationString = humaniseDuration(this.data.pendingDuration);\n this.fromDateTz = closestToTimeSlotTz(pendingDateTz, 15); // building value\n\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n this.updateCoachmarkTimes(this.data?.space?.timezone);\n\n // Check if any restricted catering category included \n \n\n this.restrictedDueToCatering = this.data.currentBooking?.catering.filter(order => order.items.filter(category => category.within_category_restricted_time(this.data.pendingDateTz)).length )\n\n\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: this.data.pendingDateTz.seconds,\n end_epoch: this.data.pendingDateTz.addValue({ minutes: this.data.pendingDuration }).seconds,\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n }).catch(() => {\n this.available = false;\n });\n }\n\n public closeModal() {\n this.dialogRef.close(null);\n }\n\n public updateDatePickerValue(dateTz: DateTZ) {\n const pending_date: DateTZ = this.formGroup.value.dateTz\n const day = pending_date.setValue({ \n day: dateTz.dateDay,\n month: dateTz.dateMonth,\n year: dateTz.dateYear\n });\n this.setValue(day, this.formGroup.controls.dateTz);\n }\n\n public setValue($value, formControl: AbstractControl) {\n // valid options are in building time\n formControl.setValue($value); // bulding time\n this.submitForm.emit(this.formGroup.value);\n }\n\n public confirm() {\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n const buildingDate = convertLocalTimestampToTimezonedDateTz(this.data.pendingDateTz.ms, this.data?.currentBooking?.timezone);\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: buildingDate.seconds,\n end_epoch: buildingDate.addValue({ minutes: this.data.pendingDuration }),\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n this.dialogRef.close({\n ...this.formGroup.value,\n }); \n }).catch(() => {\n this.available = false;\n });\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (timezone) {\n this.buildingTimezone = timezone;\n const localizedStartDate = this.formGroup.value.dateTz;\n const localizedEndDate = localizedStartDate.addValue({ minutes: this.formGroup.value.duration });\n this.localStart = localizedStartDate.formatLocalDate(\"h:mma\");\n this.localEnd = localizedEndDate.formatLocalDate(\"h:mma\");\n } else {\n this.buildingTimezone = this.localTimezone.slice(0);\n this.localStart = \"\";\n this.localEnd = \"\";\n } \n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n Input,\n OnInit,\n OnChanges,\n ElementRef,\n ViewChild,\n EventEmitter,\n Output,\n SimpleChanges,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { fromEvent, Subject, BehaviorSubject, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { CalendarEvent, CalendarEventTimesChangedEvent } from 'angular-calendar';\nimport { BaseClass, durationHumanized, isLessThanBreakpoint } from '@mckinsey-converge/base';\nimport {\n Booking,\n Building,\n BuildingLevel,\n Space,\n User,\n rulesForSpace,\n SpaceRules,\n} from '@mckinsey-converge/data-common';\nimport { generateFeedbackUrl, Urls } from '../../utilities/urls';\nimport { TopBarHeaderMode } from '../room-location-preview/room-location-preview.component';\nimport { RoomAvailabilityPreviewModalComponent } from '../room-availability-preview-modal/room-availability-preview-modal.component';\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n convertTimezonedTimestampToLocalDateTz,\n timezoneOffset,\n} from '@mckinsey-converge/date-tz';\nimport { utcToZonedTime } from 'date-fns-tz';\nimport { FormControl } from '@angular/forms';\nimport { DateTime } from 'luxon';\n\nconst WEEKEND_DAYS = [6, 7];\nconst colors = {\n grey: {\n secondary: '#D2D2D2',\n primary: '#A19F9F',\n },\n blue: {\n secondary: '#C0DBF5',\n primary: '#00A9F4',\n },\n red: {\n secondary: '#EB5757',\n primary: '#EB5757',\n },\n};\n\ninterface CalendarClickEvent {\n date: Date;\n}\n\nexport interface BookingBumper {\n top?: string;\n bottom?: string;\n height: string;\n backgroundColor: string;\n}\nexport interface BookingBumpers {\n top: BookingBumper;\n bottom: BookingBumper;\n}\n\nexport type BookingPlus = Booking & { start: number; end: number }; // R--- why again?\nexport type CalendarEventPlus = CalendarEvent & { bumper?: BookingBumpers; booking?: Booking };\n\n@Component({\n selector: 'room-availability-preview',\n templateUrl: './room-availability-preview.component.html',\n styleUrls: ['./room-availability-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RoomAvailabilityPreviewComponent extends BaseClass implements OnInit, OnChanges {\n @ViewChild('scrollContainer') scrollContainer: ElementRef;\n\n @Input() public alternativeWeekStartDateTz: DateTZ;\n // Used when editing a booking\n @Input() public bookingId?: string;\n @Input() public bookings: BookingPlus[];\n /** retain as mutable */\n @Input() public building: Building;\n // R--- could probably use the currentBooking ID edit,\n // The bookingId was an after thought\n @Input() public currentBooking: Booking;\n @Input() public currentUser: User;\n @Input() public dateTz: DateTZ;\n @Input() public duration: number;\n @Input() public expanded: boolean;\n @Input() public level: BuildingLevel;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n @Input() public space: Space;\n // @Input() public timezone: string;\n\n @Output() public confirmChanges: EventEmitter = new EventEmitter();\n @Output() public handleExpand: EventEmitter = new EventEmitter();\n @Output() public updateCalendarWeekView: EventEmitter = new EventEmitter();\n @Output() public warnIfItHasConflict: EventEmitter = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n constructor(public dialog: MatDialog) {\n super();\n }\n\n public breakpoint = 768;\n public mobile = false;\n public showDatePicker = false;\n public events: CalendarEventPlus[] = [];\n public dayStartHour: number;\n public dayEndHour: number;\n public viewDateTz: DateTZ;\n public weekViewDateTz: DateTZ;\n public weekViewRangeText: string;\n public showWeekend: boolean = false;\n public currentPage: string;\n public calendarPopupValue = new BehaviorSubject(DateNow(new Date()));\n public pendingChange: boolean = false;\n public pendingDateTz: DateTZ;\n public pendingDuration: number;\n public eventSnapSize: number = 15;\n public dayRefresh: Subject = new Subject();\n public weekRefresh: Subject = new Subject();\n public addMarginOnConflict: boolean = false; // helps to add html class to adjust margin top in case of QR code scan conflict\n public event: CalendarEventPlus = {\n start: new Date(),\n end: new Date(),\n title: '',\n color: colors.blue,\n cssClass: 'selected',\n actions: null,\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n };\n\n public get timezone(): string {\n return this.dateTz.building_tz;\n }\n\n public get one_day_in_millis() {\n return 86400000;\n }\n\n public get thirty_minutes_in_millis() {\n return 1800000;\n }\n public rules: SpaceRules;\n public modal_data: any = {};\n public scrollFired: boolean = false;\n\n // Values to display a span on the date picker, but the date picker doesn't support this.\n public date_span = {\n start: 0,\n end: 0,\n };\n\n // I can't think of any reason the calendar widget needs to go back further than 2 years, if even that.\n public fromDateTz = DateNow(new Date()).subtractValue({ years: 2 });\n\n public dateControl = new FormControl(new Date().valueOf());\n\n public isEventDate(d: CalendarClickEvent) {\n const date = new DateTZ({ date: d.date.valueOf() }); // local time I think.. problem TODO\n return this.pendingDateTz.isSameDate(date, 'day');\n }\n\n public get inputDate(): Observable {\n return this.calendarPopupValue.pipe(map((d) => d));\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public ngOnInit(): void {\n // R--- retrun to document\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.pendingDateTz = this.dateTz.clone();\n const date = this.dateTz.clone();\n const currentBookingStartDate = this.currentBooking\n ? this.currentBooking.startDateTz.addValue({ seconds: 0 })\n : date;\n this.alternativeWeekStartDateTz = date.startOfValue('week').startOfValue('day');\n\n // Not sure if this is correct\n this.weekViewDateTz = this.alternativeWeekStartDateTz.clone();\n\n this.calendarCenter();\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.pendingDateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 });\n this.setCalendarValue(this.pendingDateTz);\n this.showWeekend =\n WEEKEND_DAYS.includes(currentBookingStartDate.dateWeekday) ||\n WEEKEND_DAYS.includes(date.dateWeekday);\n this.setupEventName();\n this.transformBookings();\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < this.breakpoint;\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n },\n })\n )\n .subscribe();\n\n this.rules = rulesForSpace({\n time: this.dateTz.ms,\n duration: this.duration,\n user: this.currentUser,\n rules: this.building?.booking_rules,\n space: this.space,\n });\n\n // Update the display when the screen resizes.\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.calendarCenter();\n this.setDislayValues();\n },\n })\n )\n .subscribe();\n this.dateControl.setValue(this.dateTz);\n this.transformBookings();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.expanded) {\n // set if the event is editable\n this.event.draggable = this.expanded;\n this.event.resizable = {\n beforeStart: this.expanded,\n afterEnd: this.expanded,\n };\n const date = this.dateTz;\n this.setCalendarValue(date);\n }\n\n if (this.dayStartHour) this.scrollTo();\n\n if (!this.pendingDateTz) return;\n\n if (changes.bookings || changes.expanded) {\n this.transformBookings();\n }\n if (changes.alternativeWeekStartDateTz) {\n this.setDislayValues();\n }\n if (changes.expanded) {\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n }\n\n public setDislayValues() {\n const tz_offset = timezoneOffset(this.alternativeWeekStartDateTz.building_tz).hours\n const week_start_date = this.alternativeWeekStartDateTz.subtractValue({hours: tz_offset}).clone(); // Operation needed to trick the mwl-calendar-week-view to display the correct day if the day changes between timezones \n this.weekViewDateTz = this.weekViewDateTz || this.alternativeWeekStartDateTz.clone();\n let week_view_date = this.weekViewDateTz.startOfValue('week'); // new DateTZ({date: this.weekViewDate?.valueOf()}).startOfValue('week')\n if (!this.showWeekend) {\n // Advance from Sunday to Monday\n week_view_date = week_view_date.addValue({ days: 1 });\n }\n\n if (this.mobile) {\n this.weekViewDateTz = week_start_date\n this.weekViewRangeText = `${this.weekViewDateTz.formatDate('d MMMM')}`;\n this.calendarPopupValue.next(this.weekViewDateTz);\n } else {\n this.weekViewDateTz = week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }); // new Date(week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }).ms);\n this.weekViewRangeText = `${week_view_date.formatDate('d MMMM')} - ${week_view_date\n .addValue({ days: this.showWeekend ? 6 : 4 })\n .formatDate('d MMMM yyyy')}`;\n this.calendarPopupValue.next(week_view_date);\n }\n }\n\n public getBumpers(booking: Booking, selected: boolean = false) {\n const email = booking.space.email || this.space.email;\n const setup = booking.setup[email] ? booking.setup[email] / 60 : 0;\n const breakdown = booking.breakdown[email] ? booking.breakdown[email] / 60 : 0;\n\n return {\n top: {\n top: `-${setup - 1}px`,\n height: `${setup}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n bottom: {\n bottom: `-${breakdown - 1}px`,\n height: `${breakdown}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n };\n }\n\n public setupEventName() {\n this.setDislayValues();\n const pending_date = this.pendingDateTz.clone();\n const start_date = pending_date.setValue({ second: 0, millisecond: 0 });\n this.event.start = start_date.JSDate;\n this.event.end = start_date.addValue({ minutes: this.pendingDuration }).JSDate;\n const startHour = parseInt(pending_date.formatDate('H'), 10);\n\n if (startHour === 0) {\n this.dayStartHour = startHour;\n } else if (startHour < 6) {\n const offset = startHour > 3 ? startHour - 2 : startHour;\n this.dayStartHour = startHour - offset;\n } else {\n // The min of 18 is needed so start times after 6pm\n // don't push the calendar view beyond midnight.\n const offset = Math.min(18, startHour - 3);\n this.dayStartHour = offset;\n }\n\n if (!this.scrollFired && this.dayStartHour) {\n this.scrollTo();\n }\n\n this.dayEndHour = Math.max(24, this.dayStartHour + 6);\n this.event.title = `${pending_date\n .formatDate('h:mma')\n .toLocaleLowerCase()} (${durationHumanized(this.pendingDuration, true)})`;\n this.event.cssClass = `selected ${this.showWeekend ? 'show-weekend' : ''} ${\n this.mobile && this.expanded ? 'mobile' : ''\n } `;\n\n if (this.currentBooking) {\n this.event.bumper = this.getBumpers(this.currentBooking);\n this.event.booking = this.currentBooking;\n }\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n\n public transformBookings() {\n this.calendarSpan();\n const events = [];\n if (Array.isArray(this.bookings)) {\n this.bookings.forEach((raw_booking) => {\n const booking = new Booking(raw_booking);\n const { mode, duration } = this.displayClass(\n booking.startDateTz.ms,\n booking.endDateTz.ms\n );\n\n // back off a ms when end of day to avoid all day wrapping to next day.\n let end = booking.endDateTz;\n const endTime = booking.endDateTz;\n if (endTime.minutes === 0 && endTime.seconds === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n end = booking.endDateTz.subtractValue({ seconds: 1 });\n }\n\n // When editing skip over the current booking\n if (booking.id === this.bookingId) return;\n\n const utcStart = booking.startDateTz; // building time\n const utcEnd = end; // building time\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n const adjustedStartDate = utcToZonedTime(utcStart.ms, booking.timezone); // return local time\n const adjustedEndDate = utcToZonedTime(utcEnd.ms, booking.timezone); // return local time\n\n events.push({\n start: adjustedStartDate,\n end: adjustedEndDate,\n title: `Booked by ${booking.booker['name']}`,\n color: colors.grey,\n actions: null,\n cssClass: `booked ${this.mobile && 'mobile'} ${\n this.showWeekend ? 'show-weekend' : ''\n } ${mode}`,\n bumper: this.getBumpers(booking),\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n booking,\n });\n });\n }\n\n const { mode, duration } = this.displayClass(\n this.event.start.getTime(),\n this.event.end.getTime()\n );\n const event = Object.assign({}, this.event);\n const endTime = new DateTZ({ date: this.event.start.valueOf() }).addValue({\n minutes: this.pendingDuration,\n }); // building time\n if (endTime.minutes === 0 && endTime.second === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n event.end = endTime.subtractValue({ milliseconds: 1 }).JSDate; // building time\n }\n\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n // will need to adjust the other way with drag and drop and click actions.\n event.start = utcToZonedTime(event.start, this.timezone); // local time\n event.end = utcToZonedTime(event.end, this.timezone); // local time\n\n event.cssClass = `selected ${this.mobile && this.expanded ? 'mobile' : ''} ${mode}`;\n if (this.currentBooking) {\n event.bumper = this.getBumpers(this.currentBooking, true);\n event.booking = this.currentBooking;\n }\n\n events.push(event);\n this.events = events.slice();\n this.updateTileColor();\n }\n\n public updateTileColor() {\n const pending_date = this.pendingDateTz.clone();\n const start = pending_date.setValue({ second: 0, millisecond: 0 });\n const end = start.addValue({ minutes: this.pendingDuration });\n const booked = this.events.filter((e) => !e.draggable); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n const isEvents = this.events.filter((e) => e.draggable);\n if(isEvents.length ) {\n isEvents[0].color = conflict ? colors.red : colors.blue;\n this.addMarginOnConflict = conflict ? true : false;\n \n } \n !this.expanded && this.warnIfItHasConflict.emit({room: this.space, hasConflict: conflict});\n }\n public displayClass(start: number, end: number) {\n const duration = end - start;\n return {\n duration,\n mode: duration > this.thirty_minutes_in_millis ? 'extended' : 'minimal',\n };\n }\n\n public setCalendarValue(dateTz: DateTZ) {\n let toDate = DateNow().startOfValue('minute');\n if (dateTz) {\n toDate = dateTz.startOfValue('minute');\n }\n if (!this.mobile && toDate.dateWeekday !== 7) {\n toDate = toDate.startOfValue('week');\n }\n this.updateCalendarWeekView.emit(toDate);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = toDate;\n this.setDislayValues();\n }\n\n /**\n * Convert the true bulding based time object to a timestamp skewed to the local time\n *\n * @param buildingTz - DateTZ object of time in bulding timezone\n * @returns number - timestamp in local time skewed from bulding time\n */\n public convertTimezonedValueForCalendar(buildingTz: DateTZ) {\n return convertTimezonedTimestampToLocalDateTz(buildingTz.ms, this.timezone).ms;\n }\n\n public hasConflict(startTz, endTz, booked) {\n // Convert the start and end building times to the local timezone for comparison with the localized bookings.\n const localizedStartTime = startTz.ms;\n const localizedEndTime = endTz.ms;\n let email = this.space?.email || this.currentBooking?.room?.email;\n return booked.some((b) => {\n email = email || b.booking?.room?.email;\n // Booking here are local time to render on the calendar correctly\n const setup = b.booking?.setup[email] || 0;\n // R--- This weird augmented booking with start and end needs to be with DateTZ and a getter when ms is needed.\n const bookingStartTime = new DateTZ({ date: b.start.valueOf() }); // local times\n const bookingEndTime = new DateTZ({ date: b.end.valueOf() }); // local times\n const bstart = bookingStartTime.subtractValue({ seconds: setup }).ms;\n const breakdown = b.booking?.breakdown[email] || 0;\n const bend = bookingEndTime.addValue({ seconds: breakdown }).ms;\n\n if (\n (localizedStartTime >= bstart && localizedStartTime < bend) || // booking starts durring a meeting\n (localizedStartTime <= bstart && localizedEndTime > bstart) || // booking ends durring meeting\n (localizedStartTime >= bstart && localizedEndTime <= bend) || // booking starts and ends durring a meeting\n (localizedStartTime <= bstart && localizedEndTime >= bend) // booking overlaps entire meeting\n ) {\n return b.booking?.id !== this.currentBooking?.id;\n }\n return false;\n });\n }\n\n public eventTimesChanged({ event, newStart, newEnd }: CalendarEventTimesChangedEvent): void {\n const s = convertLocalTimestampToTimezonedDateTz(\n newStart.valueOf(),\n this.timezone\n );\n if (s.ms < Date.now()) return;\n // newStart and newEnd are local times from the calendar component\n // merging in with localized bookings in this.events\n this.events = this.events.map((iEvent) => {\n if (event.id && iEvent.id === event.id) {\n return {\n ...event,\n start: newStart,\n end: newEnd,\n };\n }\n return iEvent;\n }); // local times\n\n let buildingStartDateTz = new DateTZ(\n { date: newStart.valueOf()}\n );\n let buildingEndDateTz = new DateTZ(\n { date: Math.ceil(newEnd.valueOf()/900000)*900000 } //For latest bug in CNG-309, make sure end time follows a 15-min interval\n );\n\n // Clear out the seconds and miliseconds to avoid collision by seconds.\n buildingStartDateTz.setValue({ millisecond: 0, second: 0 });\n\n if (buildingStartDateTz < DateNow(new Date())) {\n // compare building time to now\n // Abandon updates if the past\n this.transformBookings();\n return;\n }\n\n let pendingDuration = Math.floor(\n (buildingEndDateTz.ms - buildingStartDateTz.ms) / 60 / 1000\n );\n // Make adjustments to the time and duration so the snap to behavior aligns\n // with the Mckinsey time and duration rules.\n const new_start = buildingStartDateTz.clone(); //new DateTZ({date: buildingNewStart.getTime()}); // building time\n if (pendingDuration >= 60) {\n // check that duration is inc of 1/2 hr\n const d = pendingDuration % 30;\n // if (d) {\n // pendingDuration = Math.floor(pendingDuration + (30 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // check that the start time is 1/2 hr\n const m = parseInt(new_start.formatDate('m'), 10);\n const md = m % 30;\n // if (md) {\n // buildingStartDateTz = new_start.addValue({ minutes: md }); // building time\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // Update snap to rules\n // this.eventSnapSize = 30; //done for CNG-309\n } else {\n // check that duration is inc of 1/4 hr\n const d = pendingDuration % 15;\n if (d) {\n // pendingDuration = Math.floor(pendingDuration + (15 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n }\n this.eventSnapSize = 15;\n }\n\n // Drag and Drop / Resize duration\n const dnd_duration = buildingEndDateTz.ms - buildingStartDateTz.ms;\n if (dnd_duration >= this.one_day_in_millis - 1) {\n // Add that millisecond back in so the angular calender drag and drop snapping still works.\n buildingEndDateTz = buildingEndDateTz.addValue({ milliseconds: 1 });\n }\n\n if (this.rules?.max_length) {\n if (dnd_duration / 60000 > this.rules?.max_length) {\n // Abandon updates if exceeeds max duration\n this.transformBookings();\n return;\n }\n }\n\n // Setup values for conflict checking, add on the setup and breakdown times form comparison\n let conflictCheckStartTime = buildingStartDateTz.clone();\n let conflictCheckEndTime = buildingEndDateTz.clone();\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n const start = buildingStartDateTz.clone();\n conflictCheckStartTime = start.subtractValue({ seconds: setup });\n }\n const breakdown = this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n const end = buildingEndDateTz.subtractValue({ seconds: 1 });\n conflictCheckEndTime = end.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const start = conflictCheckStartTime;\n const end = conflictCheckEndTime;\n const booked = this.events.filter((e) => e.draggable === false); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n this.dateControl.setValue(start);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n // check if the time or duration has changed\n if (this.pendingDateTz !== buildingStartDateTz) {\n this.pendingChange = true;\n } else if (this.pendingDuration !== pendingDuration) {\n this.pendingChange = true;\n }\n\n // set the new Pending Date\n this.pendingDateTz = convertLocalTimestampToTimezonedDateTz(buildingStartDateTz.ms, this.timezone); // building time\n this.pendingDuration = pendingDuration;\n\n this.setupEventName();\n this.transformBookings();\n }\n\n public hourClicked(event: CalendarClickEvent) {\n // convert the calender local input to the building times\n const buildingStartDate = convertLocalTimestampToTimezonedDateTz(\n event.date.valueOf(),\n this.timezone\n ); // return building time\n let startTz = buildingStartDate.clone();\n let endTz = startTz.addValue({ minutes: this.pendingDuration });\n\n if (buildingStartDate.ms < Date.now()) {\n // compare building time to now\n // Abandon past events\n return;\n }\n\n // this.pendingDate is in building time\n if (this.pendingDateTz.ms !== startTz.ms) {\n // comparing building to building\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n startTz = startTz.subtractValue({ seconds: setup });\n }\n const breakdown =\n this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n endTz = endTz.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const booked = this.events.filter((e) => e.draggable === false);\n // building start and end time but localized bookings\n const conflict = this.hasConflict(startTz, endTz, booked);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n this.pendingChange = true;\n this.pendingDateTz = buildingStartDate; // building time\n\n this.setupEventName();\n this.transformBookings();\n }\n }\n\n public displayConfirmationModal() {\n this.modal_data = {\n pendingDateTz: this.pendingDateTz, // building time , new time\n pendingDuration: this.pendingDuration,\n dateTz: this.dateTz, // building time, existing time\n duration: this.duration,\n space: new Space(this.space),\n rules: this.rules,\n bookingId: this.bookingId,\n currentBooking: this.currentBooking,\n };\n\n const dialogRef = this.dialog.open(RoomAvailabilityPreviewModalComponent, {\n data: this.modal_data,\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRef.componentInstance.submitForm.subscribe((d: any) => {\n // Apply the confirmed changes\n this.pendingChange = true;\n this.pendingDateTz = d.dateTz;\n this.pendingDuration = d.duration;\n\n dialogRef.componentInstance.applyChanges({\n dateTz: d.dateTz,\n duration: this.pendingDuration,\n pendingDateTz: this.pendingDateTz,\n pendingDuration: this.pendingDuration,\n });\n this.setupEventName();\n this.transformBookings();\n // Change View\n this.setCalendarValue(d.dateTz);\n });\n\n dialogRef.afterClosed().subscribe((d) => {\n // Update the current with pending record\n if (d) {\n // convert the local input values returned into the same time in the building timezone\n const buildingDate = convertLocalTimestampToTimezonedDateTz(\n d.dateTz.ms,\n this.timezone\n );\n this.dateTz = buildingDate;\n this.duration = d.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(buildingDate.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.confirmChanges.emit({ ...d, mobile: this.mobile, save: true });\n } else {\n // this is ok\n const md = this.modal_data;\n this.dateTz = md.dateTz;\n this.duration = md.duration;\n this.pendingDateTz = md.dateTz;\n this.pendingDuration = md.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(md.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n // This is reverting the changes\n this.confirmChanges.emit({\n dateTz: md.dateTz,\n duration: this.duration,\n mobile: this.mobile,\n save: !!d,\n });\n this.setupEventName();\n this.transformBookings();\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = this.viewDateTz;\n this.setDislayValues();\n }\n });\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public scrollTo() {\n if (this.scrollFired) return;\n this.timeout(\n 'scroll_to',\n () => {\n const ele = document.getElementById('calendarScrollContainer');\n if (ele) {\n ele.scrollTo({\n top: this.dayStartHour * 64,\n left: 0,\n behavior: 'smooth',\n });\n this.scrollFired = true;\n }\n },\n 500\n );\n }\n\n public toggleDatePicker() {\n this.showDatePicker = !this.showDatePicker;\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n // Reset to the initial view\n this.pendingDateTz = this.dateTz; // = new Date(this.date);\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.setupEventName();\n this.transformBookings();\n this.dayRefresh.next();\n }\n\n public calendarBack() {\n let today = this.alternativeWeekStartDateTz; // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.subtractValue({ days: 1 });\n } else {\n today = today.subtractValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarSpan() {\n let today = this.pendingDateTz; // new DateTZ({date: this.pendingDate.valueOf()});\n if (this.mobile || !this.expanded) {\n this.date_span.start = today.startOfValue('day').ms;\n this.date_span.end = today.endOfValue('day').ms;\n } else {\n this.date_span.start = today.startOfValue('week').ms;\n this.date_span.end = today.endOfValue('week').ms;\n }\n }\n\n public calendarCenter() {\n let today = this.pendingDateTz.startOfValue('day');\n if (!this.mobile) {\n today = today.startOfValue('week');\n }\n\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarForward() {\n let today = this.alternativeWeekStartDateTz // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.addValue({ days: 1 });\n } else {\n today = today.addValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public toggleWeekend() {\n this.showWeekend = !this.showWeekend;\n this.setupEventName();\n }\n}\n","
\n
\n \n \n
\n
\n \n \n
\n
\n
\n

Room Availability

\n

{{space.local_name}}

\n

{{building?.name}}, {{level?.name}}, {{building?.address}}

\n
\n
\n
\n
\n \n \n \n
\n
\n {{weekViewRangeText}}\n \n \n
\n \n Show Weekend\n \n
\n
\n
\n \n\n \n
\n \n {{ day.date | calendarDate:'weekViewColumnHeader':locale }} {{ day.date | calendarDate:'weekViewColumnSubHeader':locale }}\n

{{ isEventDate(day) ? '(Current Selection)' : '' }}

\n
\n
\n \n\n \n \n
\n
\n
\n
\n \n \n &ngsp;\n \n \n
\n \n
\n
\n
\n\n
\n
\n \n \n
\n
\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom,\n} from 'rxjs/operators';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n checkCollisions,\n Booking,\n User,\n UsersService,\n BookingFormData,\n selectActiveForm,\n SpacesService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n matchToHighlight\n} from '@mckinsey-converge/base';\n\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'app-room-booking-details-form',\n templateUrl: './room-booking-details-form.component.html',\n styleUrls: ['./room-booking-details-form.component.scss']\n})\nexport class RoomBookingDetailsFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n public formRef: FormGroupDirective;\n /** Number of characters needed before a search will start */\n @Input() public limit = 3;\n /** When the value changes, the form is submitted */\n @Input() public triggerSubmit = '';\n /** Need booking details */\n @Input() public booking: Booking = null;\n /** Data returned to parent */\n @Output() public submitForm = new EventEmitter();\n /** Data returned to parent */\n @Output() public validateForm = new EventEmitter();\n /** Current User */\n public currentUser: User;\n /** Host list to display */\n public host_list: User[];\n /** User list to display from the Attendees search */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Whether to show the attendees hint */\n public showHint = false;\n /** Attendee Input / Search String */\n public searchString: string;\n /** List of users from an API search */\n public searchResults: Observable;\n /** Subject holding the value of the search */\n public searchSubject = new Subject();\n /** Host field options */\n public hostOptions = [];\n /** Attendees options */\n public options = new BehaviorSubject[]>([]);\n /** Selected Attendees */\n public selectedOptions = new BehaviorSubject[]>([]);\n public selectedUsers = new BehaviorSubject[]>([]);\n public needs_charge_code = false;\n public has_delegate = false;\n public available: boolean = null;\n public notesHandle = null;\n public noteValidationClass = '';\n public selectedCompanies = new BehaviorSubject[]>([]);\n public companyOptions = new BehaviorSubject[]>([]);\n\n /** Data collected on this form */\n public bookingFormGroup = new FormGroup({\n organiser: new FormControl(),\n title: new FormControl('', [ Validators.minLength(1)]), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n attendees: new FormControl(),\n code: new FormControl('', [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]),\n notes: new FormControl(),\n head_count: new FormControl(1, [Validators.required, Validators.min(1)]),\n user_list: new FormControl(),\n host_list: new FormControl(),\n company: new FormControl(),\n opt_out: new FormControl(),\n outlook_opt_out: new FormControl(),\n\n });\n action: string;\n // Indecates that processing request to check availability of breakdown if special requirement being added by user\n checkingBreakdown: boolean = false;\n\n public get invalid_charge_error(): string {\n if (this.bookingFormGroup.controls.code.errors?.required) {\n return 'Charge Code is required';\n }\n if (this.bookingFormGroup.controls.code.errors?.minlength) {\n return 'Charge Code must be at least four characters';\n }\n if (this.bookingFormGroup.controls.code.errors?.pattern) {\n return 'Charge Code cannot contain spaces or special characters';\n }\n return '';\n }\n\n public get headCountControl(): AbstractControl {\n return this.bookingFormGroup.get('head_count');\n }\n\n constructor(\n private _spaces: SpacesService,\n private _snackBar: MatSnackBar,\n private store: Store,\n vcRef: ViewContainerRef,\n private _service: ApplicationService,\n private _users: UsersService) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map((del) => {\n // the kludgy or new User is for when the user service isn't ready.\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n\n // (del) => new User({ email: del.email, name: del.email.split('@')[0].split('_').join(' '), opt_out: del.opt_out })\n });\n if (delegates.length) {\n this.has_delegate = true;\n }\n this.host_list = [user].concat(delegates);\n this.hostOptions = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }));\n });\n\n // if we have an active form, refill the information here once.\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // Get the Equipment charge code mandatory requirement\n const { filters, settings } = next.selectedRoom?.space;\n const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n const officeBasedEqCode = next.selectedRoom?.building?.required?.equipment_code;\n this.needs_charge_code = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n \n\n if (this.needs_charge_code) {\n this.bookingFormGroup.controls.code.setValidators([Validators.required, Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]);\n }\n // build the initial options\n const options = [];\n const attendees = next?.attendees || [];\n const organiser = next?.organiser || { display: this.currentUser.name , value: this.currentUser.email, meta: { external: false, user: this.currentUser }};\n const company = next?.company || [];\n\n const opt_out = next?.opt_out || false;\n const outlook_opt_out = next?.outlook_opt_out || false;\n this.action = next.action || 'new';\n // Load the saved form\n this.bookingFormGroup.setValue({\n organiser,\n title: next.title || '',\n attendees, // options will display current user\n code: next.code || '',\n notes: next.notes || '',\n head_count: next.head_count || '',\n user_list: [],\n host_list: [],\n company,\n opt_out: opt_out,\n outlook_opt_out\n });\n this.selectedOptions.next(attendees);\n this.options.next(attendees);\n this.selectedCompanies.next(company);\n this.companyOptions.next(company);\n }\n })\n );\n\n // Listen for input changes\n this.searchResults = this.searchSubject.pipe(\n debounceTime(500),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query,\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return list;\n })\n );\n\n // Process API results\n this.subscription(\n 'search_results',\n this.searchResults.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n\n // Build options from returned users\n const options = this.user_list.map(u => {\n return {\n value: u.email,\n display: `${u.name} ${u.email}`,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: `${u.name}`,\n meta: { external: false, user: u },\n };\n });\n // Add the manual option to the beginning of the array\n options.unshift({\n value: this.searchString,\n display: this.searchString,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: this.searchString,\n meta: { external: true, user: null },\n });\n // this.loading = false;\n this.options.next(options);\n })\n );\n\n this.bookingFormGroup.valueChanges.subscribe(val => {\n\n clearTimeout(this.notesHandle);\n if (val?.notes?.length) {\n this.checkingBreakdown = true;\n \n // Check for conflicts if adding a note and default setup and breakdown times.\n this.notesHandle = setTimeout(() => {\n this.validateForm.emit(false);\n const booking = this.booking.clone();\n const setup = {};\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n const breakdown = {};\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n\n const mockBooking = new Booking({\n id: booking.id,\n room: booking.space,\n start_epoch: booking.startDateTz.seconds,\n end_epoch: booking.endDateTz.seconds,\n setup,\n breakdown,\n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.checkingBreakdown = false;\n this.available = bookable;\n // this.validateForm.emit(true);\n this.validateForm.emit(this.bookingFormGroup.valid);\n this.noteValidationClass = bookable === false ? 'booked' : 'available';\n // this.loading = false;\n }).catch(() => {\n this.checkingBreakdown = false;\n this.available = false;\n this.validateForm.emit(false);\n this.noteValidationClass = 'booked';\n // this.loading = false;\n\n return;\n });\n }, 200);\n } else {\n this.checkingBreakdown = false;\n this.available = null;\n this.noteValidationClass = '';\n this.validateForm.emit(this.bookingFormGroup.valid);\n }\n\n });\n }\n\n public setOrganiserOptOut(opt_out) {\n this.bookingFormGroup.controls.opt_out.setValue(opt_out);\n }\n\n public updateOrganiser(user) {\n console.log(user);\n }\n\n /** Listen for changes */\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.bookingFormGroup.get(key).setValue(this.bookingFormGroup.get(key).value.trim());\n }\n\n /** Toggle an attendee on/off */\n public toggle(option: SelectOption) {\n const inputValue = option.value\n .split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n let inputValueEmail = '';\n // Check if inputValue is a valid email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(inputValue)) {\n // If not, replace all spaces with underscores and append a random guest email string\n inputValueEmail = inputValue.replace(/\\s+/g, '_') + `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n }\n\n // Check for character limit\n if (\n // this.selectedOptions.value.some((option: SelectOption) => option.value === inputValue) ||\n inputValue.length > 50\n ) {\n this._service.notifyWarn('Attendee name cannot exceed 50 characters');\n return;\n }\n\n this.selectedOptions\n .pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n let opts = selectedOptions.slice();\n const found = opts.some((v) => inputValue === v.value);\n if (found) {\n opts = opts.filter((v) => inputValue !== v.value);\n } else {\n const color = inputValue.toLowerCase().includes('mckinsey.')\n ? 'internal'\n : 'external';\n opts.push({\n ...option,\n value: inputValueEmail,\n display: inputValue,\n shortDisplay: inputValue,\n meta: {\n ...option.meta,\n color,\n },\n });\n }\n\n return opts;\n })\n )\n .subscribe((next) => {\n if (!this.bookingFormGroup.controls.head_count.touched) {\n this.bookingFormGroup.controls.head_count.setValue(next.length + 1);\n }\n this.selectedOptions.next(next);\n });\n }\n\n public clearHeadcount() {\n this.headCountControl.setValue(1);\n }\n\n /** Return the data to the listening parent */\n public onSubmitForm() {\n this.bookingFormGroup.markAllAsTouched();\n // a bit of an issue that the form state isn't saved unless valid\n if (this.bookingFormGroup.valid) {\n const form_data = this.bookingFormGroup.value;\n form_data.user_list = this.user_list;\n form_data.host_list = this.host_list;\n form_data.has_delegate = this.has_delegate;\n this.submitForm.emit(form_data);\n }\n }\n\n /** Take the input and feed it back to the parent to add to attendees array */\n public updateAttendeeOptionsFromUserInput(v: string) {\n const l = v.length;\n const options = this.selectedOptions.value.slice();\n if (!l) {\n this.options.next([]);\n return;\n }\n if (l > 2) {\n // Triggers the API call to search for the user input\n this.searchSubject.next(v);\n }\n\n options.unshift({\n value: v,\n display: v,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: v,\n meta: { external: true },\n });\n this.searchString = v;\n this.options.next(options);\n }\n\n public toggleAttendeesHint() {\n this.showHint = !this.showHint;\n }\n\n public updateCompanyOptionsFromUserInput(v: string) {\n if (!v.length) {\n this.companyOptions.next([]);\n return;\n }\n this.companyOptions.next([{\n value: v,\n display: v,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: v,\n }]);\n }\n\n public toggleCompany(option: SelectOption) {\n this.selectedCompanies.pipe(\n take(1),\n withLatestFrom(this.companyOptions),\n map(([selectedCompanies, options]) => {\n let opts = selectedCompanies.slice();\n const found = opts.some(v => option.value === v.value);\n if (found) {\n opts = opts.filter(v => option.value !== v.value);\n } else {\n opts.push(option);\n }\n\n return opts;\n })\n ).subscribe(next => {\n this.selectedCompanies.next(next);\n });\n }\n}\n","\n
\n
\n
\n \n Meeting Title*\n \n \n \n \n
\n \n {{ ( bookingFormGroup?.get('title').errors && bookingFormGroup?.get('title').hasError('pattern')) ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Meeting Title is required'}}\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n Opt out email notification \n
\n \n
\n\n\n \n\n
\n \n \n \n Why do we need this?\n
\n
\n Attendee emails are used for visitor management purposes.\n Converge won't send any emails to attendees.\n
\n \n
\n\n
\n
\n \n \n
\n
\n \n Charge Code{{ needs_charge_code ? '*' : '' }}\n \n \n \n \n
\n \n {{ invalid_charge_error }}\n \n
\n
\n
\n
\n \n Headcount estimate*\n \n \n \n \n
\n \n Headcount is required\n \n
\n
\n
\n
\n\n
\n
\n \n Additional requirements (e.g room setup, equipment...)\n \n \n \n \n \n \n

Checking breakdown availability for selected date/time...

\n

\n \n A set up and breakdown time of 15 mins was added to either side\n of your booking to cater for these additional requirements.\n

\n

\n \n A set up and break down time of 15mins was added to either side of your booking to cater for these additional requirements. This has resulted in a conflict with another booking. Please adjust your booking accordingly.\n

\n
\n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\nimport { closestToTimeSlot, closestToTimeSlotTz, resetSecondsOnTimestamp } from '@mckinsey-converge/base';\n\nimport {\n distinctUntilChanged,\n map,\n skip,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingCity,\n flattenDisplayOffices,\n toggleSelectedByGroup,\n storeBookingFormData,\n BookingFormData,\n bookingTypeOptions,\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption,\n roomSizeOptions,\n selectActiveForm,\n ApplicationService,\n roomSizeOptionsKiosk,\n\t\tRecurrencePeriod,\n generateBookingForm,\n SeriesAction,\n setRecurrenceStartsTime\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Booking } from '../../../../../../libs/data-common/src';\nimport * as cloneDeep from 'lodash/cloneDeep';\n@Component({\n selector: 'app-room-booking-form',\n templateUrl: './room-booking-form.component.html',\n styleUrls: ['./room-booking-form.component.scss']\n})\nexport class RoomBookingFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n formRef: FormGroupDirective;\n\n @Output()\n public submitForm = new EventEmitter();\n\n @Input()\n public showCancel = false;\n\n @Input()\n public triggerSubmit: number;\n\n /**\n * Used only if showCancel is true.\n */\n @Output()\n public cancelSubmit = new EventEmitter();\n\n // fromDate is the selected date\n public fromDate: number = closestToTimeSlot(DateTime.now(), 15).valueOf(); // R--- depreciate\n /** DateTZ object of the date and time that the date and time picker will begin it's options from */\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15);\n public bookingTypeOptions = bookingTypeOptions;\n public roomSizeOptions = roomSizeOptions;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\"\n\n public formGroup: FormGroup = new FormGroup({\n id: new FormControl('', []), // used in case of recurring series edit\n location: new FormControl([], [Validators.required]),\n date: new FormControl(this.fromDate, [Validators.required]),\n dateTz: new FormControl(this.fromDateTz, [Validators.required]), // starts out as the next closest available time interval\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n bookingType: new FormControl(internalBookingTypeOption),\n roomSize: new FormControl(defaultRoomSizeOption),\n selectedRoom: new FormControl({}),\n timezone: new FormControl(\"\"),\n offset: new FormControl(\"\"),\n\n\t\trecurrence_period: new FormControl(RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl( 1),\n recurrence_endTz: new FormControl( new DateTZ({ date: 1 }).addValue({days: 1})),\n recurrence_count: new FormControl( 0),\n is_recurrent: new FormControl(null),\n recurrence_starts: new FormControl( []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl( []),\n\n ignore: new FormControl('', []), // used in case of recurring series edit\n // TODO, there's a few missing from interface BookingFormData, libs/data-common/src/lib/booking/booking.form.data.ts\n });\n\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n constructor(private store: Store,\n // private _service: ApplicationService,\n vcRef: ViewContainerRef, \n private _snackBar: MatSnackBar,\n private _service: ApplicationService,\n ) {\n super(vcRef);\n // if(this._service?.kioskFormFilter) {\n // this.formGroup.setValue({\n // roomSize: roomSizeOptions[3]\n // })\n // }\n }\n\n public ngOnInit(): void {\n\n\n super.ngOnInit();\n // R--- Complicated, need the TZ aware inputs and to not init those inputs until the building timezone is available.\n // R--- See if there's any way to make the timezone retrieval less fragile.\n\n // if we have an active form, refill the information here once.\n // Doesn't run on initial steps, only if you go back to the home page\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set the fromDate correctly\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15); // R--- shouldn't this actually be the current date start of day to make all the options available?\n\n const form = cloneDeep(next);\n this.formGroup.patchValue({\n ...form,\n }, { emitEvent: true });\n\n // this.formGroup.markAllAsTouched();\n // this.formGroup.updateValueAndValidity();\n\n }\n })\n );\n\n // R--- I only see this fire when the modal opens or going to the home page\n this.subscription('formChanges', this.formGroup.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe((next) => {\n const timezone = next.timezone || this.localTimezone\n /**\n * When the selected date changes update the time picker's start time\n * to the nearest available slot of the current day\n */\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15);\n\n /**\n * When the new selected date arrives, update the coachmark displayed below the date time picker\n */\n this.updateCoachmarkTimes(timezone);\n\n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n )\n .subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n public onSubmitForm() {\n if(this.formGroup.controls?.is_recurrent?.value){\n setRecurrenceStartsTime(this.formGroup)\n }\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const is_past = this._checkDateInPast();\n if (is_past) {\n this._service.notifyWarn('Start Time updated to after current time, please click search again.');\n return;\n } else {\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(formGroupData.dateTz.ms),\n dateTz: formGroupData.dateTz.setValue({ millisecond: 0, second: 0 })\n });\n }\n this.formGroup.markAllAsTouched();\n if (this.formGroup.valid) {\n this.submitForm.emit(this.formGroup.value);\n }\n }\n\n // public openSnackBar(message: string, action: string) {\n // this._snackBar.open(message, action, {\n // duration: 5000,\n // panelClass: ['yellow-snackbar']\n // });\n // }\n\n // Fires when the location selector value is changed\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n // deselecting the location option sets the timezone to local so convert.\n const formGroupDate = this.formGroup.value;\n if (!next.length) {\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: this.localTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(this.localTimezone)\n });\n } else {\n const buildingTimezone = next[0]?.meta?.building?.timezone || next[0]?.meta?.city?.timezone;\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: buildingTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(buildingTimezone)\n });\n }\n this._checkDateInPast();\n // Must fire last or location picker will be buggy.\n this.selectedOptions.next(next);\n });\n }\n\n private _checkDateInPast() {\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const date = new DateTZ({ date: this.formGroup.value.dateTz.ms, building_tz: formGroupData.timezone, is_local_tz:false }).addValue({ seconds: 30 })\n const now = DateNow(new Date())\n if (now.isAfterDate(date)) {\n // Reset the start time if in the past\n const closestTz = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: formGroupData.timezone }).addValue({ minutes: 1 }), 15)\n const prevClosestTz = closestTz.subtractValue({minutes: 15})\n const prevDateTz = prevClosestTz.addValue({ seconds: 30 });\n // R-- why do I do this on submit? move to a another method.\n if(now.isAfterDate(prevDateTz)){\n this.fromDateTz = closestTz;\n }else{\n this.fromDateTz = prevClosestTz;\n }\n\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(this.fromDateTz.ms),\n dateTz: this.fromDateTz.setValue({ millisecond: 0, second: 0 })\n });\n return true;\n }\n return false;\n }\n\n private updateCoachmarkTimes(timezone: string) {\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n\n this.fromDateTz = new DateTZ({ date: this.fromDateTz.ms, is_local_tz: false, building_tz: timezone });\n\n if (localTzOffset !== buildingTzOffset) {\n const startDate = this.formGroup.value.dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.formGroup.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n }\n}\n","\n
\n \n\n\n
\n \n\n \n \n \n \n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n\n
\n
\n Recurring booking\n
\n \n \n\n
\n\n \n\n \n \n \n \n \n
","import { Component, ViewEncapsulation, Inject } from '@angular/core';\nimport { BookingFormData, storeBookingFormData, SeriesAction} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Store } from '@ngrx/store';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n// import { Router, ActivatedRoute } from '@angular/router';\n\n@Component({\n selector: 'app-room-booking-modal',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomBookingModalComponent extends BaseDirective {\n public trigger = Date();\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: any ) {\n super();\n }\n\n public triggerSubmit() {\n this.trigger = Date();\n }\n\n public submitForm(next: BookingFormData) {\n /// submit\n\n const ignore = this._data?.action === SeriesAction.EDIT ? next.id : null;\n const bookable = this._data?.action === SeriesAction.EDIT || null;\n\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next,\n ignore, // ignore id in case of recurring edit series\n bookable, // true in case of recurring edit series\n action: this._data?.action || '' // 'edit' in case of recurring edit series\n }\n }));\n this.close('DoNotClearActiveForm'); // do not clear active form if for submit as form need forther in result module\n this._data && this._data.navigateTo && this._data.navigateTo(); // navigate to result in case of staff recurring edit\n\n }\n\n public close(flag: string = '') {\n this.dialogRef.close(flag);\n }\n}\n","import {\n Component,\n OnInit,\n OnDestroy\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n AlertMode,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BaseDirective,\n dateBuildingFormatString,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n User,\n Building,\n BuildingCity,\n IEngineResponse,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectHomepageBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n BookingStoreState,\n BookingFormData,\n clearBookingFormData,\n storeBookingFormData,\n BookingsService\n} from '@mckinsey-converge/data-common';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { Urls } from 'src/app/utilities/urls';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { loadBookingsWithQuery, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n elementAt,\n map,\n take,\n} from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'app-room-booking',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n

Meeting Room Booking

\n
\n \"Booking\n
\n
\n
\n
\n
\n \n \n \n \n
\n
\n
\n

Your Bookings

\n
\n
\n \n
You have no upcoming bookings
\n
\n
\n \n \n
\n
\n \n \n \n \n
\n
\n \n Manage\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-booking.component.scss']\n})\nexport class RoomBookingComponent extends BaseDirective implements OnInit, OnDestroy {\n public TopBarHeaderMode = TopBarHeaderMode;\n public AlertMode = AlertMode;\n\n public width = 16;\n\n // public showBanner = true;\n public showBookings = false;\n public showManageButtonA = false;\n public showManageButtonB = false;\n public showManageButtonC = false;\n public dateString: string;\n\n public homepageBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public pastBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public upcomingBookings: BookingResultsViewModel[];\n public buildings = new BehaviorSubject[]>([]);\n public reloading = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n constructor(private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _bookings: BookingsService,\n private dialog: MatDialog) {\n super();\n this.dateString = dateBuildingFormatString(DateNow(new Date()));\n }\n\n public ngOnDestroy() {\n if (typeof window === 'object') {\n window.onbeforeunload = undefined;\n }\n\t\t\t\t// clear interval\n\t\t\t\tthis.clearInterval('refreshBookings');\n }\n\n public ngOnInit(): void {\n // only run on window onload\n if (typeof window === 'object') {\n window.onbeforeunload = (event) => {\n const e = event || window.event;\n this.store.dispatch(clearBookingFormData())\n return e;\n };\n }\n\n this.store.dispatch(loadOrganisations.request());\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n // console.log('on buildings ')\n // this.refresh('homepage');\n }));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded\n this.currentUser = new User(user);\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, 'target': 'homepage' }));\n // start the timer at the top of the minute;\n // const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n // setTimeout(() => {\n // console.log('on setTimeout ')\n // this.refresh('homepage')\n this.interval('refreshBookings', () => {\n\t\t\t\t\t\t\t\t\t\t\tthis.refresh('homepage')\n\t\t\t\t\t\t\t\t\t\t}, 60 * 1000);\n // }, offset + 5000)\n\n })\n );\n\n this.reloading = true;\n this.subscription('homepageResults', this.store.pipe(\n select(selectHomepageBookingsResultsFromState)\n ).subscribe(next => {\n // this.reloading = true;\n this.homepageBookingResults.next(next);\n if (!next.isEmpty() && next.success && Array.isArray(next.success.results) && next.success.total) {\n this.reloading = false;\n this.showManageButtonA = true;\n this.upcomingBookings = mapResultsToViewModels(next.success.results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n this.allBookings = next.success.results;\n\n if (this.upcomingBookings.length) {\n this.showBookings = true;\n }\n } else {\n this.reloading = false;\n this.showManageButtonA = false;\n this.upcomingBookings = [];\n this.showBookings = false;\n }\n }));\n\n this.subscription('pastResults', this.store.pipe(\n select(selectPastBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonB = true;\n }\n }));\n\n this.subscription('cancelledResults', this.store.pipe(\n select(selectCancelledBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonC = true;\n }\n }));\n }\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return !this.reloading; //|| this.homepageBookingResults.value.hasLoaded();\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return '';\n }\n\n // public hideBanner() {\n // this.showBanner = false;\n // }\n\n public learnMore() {\n window.open(Urls.LearnMore);\n }\n\n public routeToResults(next: BookingFormData) {\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next\n }\n }));\n this.store.dispatch(loadRoomsForResults.clear());\n this.router.navigate(['results'], { relativeTo: this.route });\n }\n\n public routeToManageBookings() {\n this.router.navigate(['manage'], { relativeTo: this.route });\n }\n\n public refresh(target: string) {\n if (!this.currentUser?.email) {\n return;\n }\n\n // tslint:disable-next-line: max-line-length\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, target }));\n }\n\n\n\t\t/**\n\t\t * Displays detailed information about a booking in a modal dialog.\n\t\t * If the booking is part of a recurring series, it retrieves the master booking\n\t\t * details and displays them along with the selected booking. The modal allows\n\t\t * users to view and interact with the booking details. After the modal is closed,\n\t\t * it checks for special flags to determine if the active form and result data should be cleared.\n\t\t *\n\t\t * @param {BookingResultsViewModel} viewModel - The view model containing booking information to display.\n\t\t */\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n\t\t\t// Handle logic for recurring bookings to fetch the master booking details\n \t// and set the master_booking property for displaying in the modal\n\t\t\tif(viewModel.booking.is_recurrent) {\n\t\t\t\t\tlet booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n\t\t\t\t\tif (!booking) {\n\t\t\t\t\t\t\tbooking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n\t\t\t\t\t}\n\t\t\t\t\tthis.master_booking = mapResultsToViewModels([booking])[0];\n\t\t\t}\n\n\t\t\t// Open a modal dialog to display the booking details along with master booking (if applicable)\n\t\t\tconst dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-wide-manage-booking',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tbooking: viewModel.booking,\t// Selected booking information\n\t\t\t\t\t\t\tbuilding: this.getBuilding(viewModel.booking),\t// Building information for the booking\n\t\t\t\t\t\t\tmaster_booking: this.master_booking?.booking || null,\t// Master booking details (if available)\n\t\t\t\t\t\t\trefresh: () => {\n\t\t\t\t\t\t\t\t\tthis.refresh('homepage');\t// Function to refresh the homepage after modal closure\n\t\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t});\n\n\t\t\tdialogRefX.afterClosed().subscribe((flag) => {\n\t\t\t\t// Clear form and result data if the flag indicates it's necessary\n\t\t\t\t\tflag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n\t\t\t});\n }\n\n\t\t/**\n\t\t * Clears active form and result data from the store.\n\t\t *\n\t\t * This function dispatches actions to clear the active form data and the loaded\n\t\t * rooms data from the store. It is typically used after a modal interaction or\n\t\t * a specific user action to reset the form state and loaded room information.\n\t\t */\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n }\n\n\n}\n","import { Component, OnInit } from '@angular/core';\nimport {\n TopBarHeaderMode,\n RoutePayload,\n} from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n Booking,\n User,\n Space,\n BookingFormData,\n selectActiveForm,\n selectFilteredByIdResults,\n BookingStoreState,\n storeBookingFormData,\n DateDurationData,\n OrganisationService,\n SpaceConflictAlertModalData,\n SpaceStatus,\n filterSpacesByAppliedFilters,\n FilteredSpaces,\n Building,\n SpaceFilterReason,\n getLastDateFromList,\n RoomResultsViewModel,\n stringToMinutes,\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n DialogEvent,\n shorterLocalDateFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { distinctUntilChanged, take, throttleTime, tap, filter } from 'rxjs/operators';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { RoomStoreState, loadByIdResults } from '@mckinsey-converge/rooms';\nimport { Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n ConflictAlertModalComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n} from '@mckinsey-converge/ui';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n selector: 'app-room-details',\n templateUrl: './room-details.component.html',\n styleUrls: ['./room-details.component.scss'],\n})\nexport class RoomDetailsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public booking: Booking;\n // @TODO get this from current settings.\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n\n public data = new BehaviorSubject(undefined);\n public byIdResults = new BehaviorSubject(undefined);\n public open: boolean = true;\n // Set to a config once we know where the files are hosted.\n public rootFolderURL = 'assets/img/rooms/';\n // Set in the room availablity callback\n public mobile: boolean = false;\n public expandedLocation: boolean = false;\n public expandedAvailability: boolean = false;\n // Track event date changes in the UI in this param\n public alternativeWeekStartDateTz: DateTZ = new DateTZ();\n /** Current User */\n public currentUser: User;\n /** Display warning banner by default */\n public showInfoBanner: boolean = true;\n /** Space class created from subscribed active form room data */\n public room: Space;\n /** Requested booking start time from subscribed active form data */\n public requestedDateTz: DateTZ;\n /** Requested booking end time from subscribed active form data */\n public requestedEndDateTz: DateTZ;\n\n /** Track alert dialog should display's only once for not bookable or unavailable */\n private isAlertDisplayed: boolean = false;\n /** Update availability status of current rooom */\n public availabilityStatus: string;\n /** Space validity per rule */\n public isSpaceValidAsPerRule: FilteredSpaces;\n\n public orgBuildings: Building[] = [];\n /** Subtype of a room or space. */\n public roomSubtype: string = '';\n\n /* recurrence booking - occurence availability */\n public occurenceAvailability: string = '';\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n constructor(\n private store: Store,\n private router: Router,\n private _org: OrganisationService,\n public dialog: MatDialog\n ) {\n super();\n /**\n * Router extras expecting from\n * On navigation from result or home page after QR code scan\n */\n if ( this.router.getCurrentNavigation() !== null && this.router.getCurrentNavigation().extras?.state?.payload ) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = this.router.getCurrentNavigation().extras.state.payload?.nextBusinessDay\n this.store.dispatch(storeBookingFormData({\n payload: this.router.getCurrentNavigation().extras.state.payload,\n })\n );\n }\n }\n\n public ngOnInit(): void {\n this.availabilityStatus = 'unavailable';\n this.orgBuildings = this._org.buildings;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = next?.nextBusinessDay || false;\n\n this.data.next(next);\n // R--- selectedRoom could sure use some clarity, why is everything but the kitchen sink in there?\n if (!this.data.value?.selectedRoom || !this.data.value?.dateTz.ms) {\n return;\n }\n // Create a full fledged Space object since the selectedRoom.space is just JSON\n this.room = new Space(this.data.value?.selectedRoom?.space);\n\n // Check room validtion of selected room to maintain status on detail page\n this.checkAvailabiltyAsPerRule();\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n\n // Query for the entire day for this room\n this.fetchRooms(false);\n this.setRoomSubType();\n\n this.requestedDateTz = this.data.value?.dateTz;\n if (next.is_recurrent) {\n const { is_local_tz, building_tz} = this?.data?.value?.dateTz;\n const endDateTz = getLastDateFromList( this?.data?.value?.recurrence_starts );\n const endDate = new DateTZ({ date: endDateTz.date.valueOf(), is_local_tz, building_tz }) \n // add one day if user room selection from next business day section on result page\n this.requestedEndDateTz = this.nextBusinessDay ? endDate.addValue({ minutes: this.data?.value.offset }) : endDate;\n\n this.occurenceAvailability = `${this?.room?.availableOccurrences} out of ${this?.room?.totalOccurrences}`;\n }\n }\n })\n );\n\n this.subscription(\n 'byId',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n this.byIdResults.next(\n next.success?.spaces?.length\n ? next.success.spaces[0].settings.bookings\n : EMPTY_ARRAY\n );\n })\n );\n\n const breakpoint = 450;\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n )\n .subscribe();\n }\n\n public setRoomSubType() {\n //test\n const room_type = `${this?.room.internal_or_external}_room_types`;\n const temp: string = Array.isArray(this?.room?.room_type)\n ? this?.room?.room_type[0]\n : this?.room?.room_type;\n const type = this?._org?.getOrganizationFiltersByRoomType(room_type)[temp];\n this.roomSubtype = type !== undefined ? `( ${type} Room )` : '';\n }\n\n public isConflictWithOccurences() {\n const conflicts = this?.room?.totalOccurrences - this?.room?.availableOccurrences;\n return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n }\n\n /**\n\t\t * Opens a modal to display recurrence conflicts for a given room.\n\t\t *\n\t\t * @param {Space} room - The room for which recurrence conflicts are being displayed.\n\t\t *\n\t\t * This function opens a modal dialog to show recurrence exceptions (conflicts)\n\t\t * for the specified room.\n\t\t *\n\t\t * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n\t\t */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(\n ConflictsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n },\n }\n );\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t\t/**\n\t\t * Retrieves the end date string for the booking, considering recurrence if applicable.\n\t\t * If the booking is recurrent.\n\t\t *\n\t\t * @returns {string} The formatted end date string in a shorter local date format.\n\t\t */\n\t\t public get endDateString(): string {\n\t\t\t// if this.requestedEndDateTz is not in use anywhere here in this file than remove that property and use const here\n\t\t\tif(!this.requestedEndDateTz) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn this.requestedEndDateTz.formatDate('ccc d MMM yyyy'); // shorterLocalDateFormatString(this.requestedEndDateTz);\n\t\t}\n\n /**\n * Functino to check if room is available as per room/user rules\n */\n public checkAvailabiltyAsPerRule() {\n this.orgBuildings =\n !this.orgBuildings.length && this.data.value?.buildings\n ? this.data.value?.buildings\n : this.orgBuildings;\n this.isSpaceValidAsPerRule = filterSpacesByAppliedFilters(\n [],\n [this.room],\n this.data.value,\n this.orgBuildings,\n this.currentUser\n );\n }\n\n /**\n * Function popup advise alert dialog if scanned (QR code) room details found conflicts with other booking/s\n * @param room\n */\n alertIfItHasConflict(isBookable, isAvailable) {\n this.isAlertDisplayed = true;\n const data = {\n headerText: !isBookable\n ? SpaceConflictAlertModalData.NotBookableHeaderText\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableHeaderText\n : '',\n message:\n this.isSpaceValidAsPerRule.specificReason === SpaceFilterReason.OfficeRules\n ? SpaceConflictAlertModalData.NotBookableDueToOfficeRule\n : !isBookable\n ? SpaceConflictAlertModalData.NotBookableMessage\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableMessage\n : '',\n buttonLabel: !isBookable\n ? SpaceConflictAlertModalData.NotBookableButtonLabel\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableButtonLabel\n : '',\n callback: !isBookable\n ? this.goToBackRoute.bind(this)\n : !isAvailable\n ? this.expandAvailability.bind(this, true)\n : null,\n shouldClose: isBookable,\n };\n const dialog = this.dialog.open(ConflictAlertModalComponent, {\n data: data,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n disableClose: !isBookable,\n });\n }\n\n public warnIfItHasConflict({ room: room, hasConflict: hasConflict }) {\n if (\n (!room.bookable || !this.isSpaceValidAsPerRule.spaces.length) &&\n !this.isAlertDisplayed\n ) {\n // room is not bookable(not available to book) and no warning dialog displayed yet\n this.alertIfItHasConflict(false, true);\n this.updateAvailabilityStatus(SpaceStatus.Unavailable);\n } else if (!room.available && hasConflict && !this.isAlertDisplayed) {\n //room is not available AT THIS TIME to book (booked) and has conflict with other booking and no warning dialog displayed yet\n this.alertIfItHasConflict(room.bookable, !hasConflict); // (true, true/false)\n this.updateAvailabilityStatus(SpaceStatus.Booked);\n } else {\n /**\n * Update status of availability - Uavailable/Booked/Requestable/Bookable\n * If room is not bookable(not available to book) and warning dialog dispalyed once\n * If room is bookable but not available to boot AT THIS TIME (or and has conflict with other booking) and warning dialog displayed once\n * If room is bookable and availanle to book AT THIS TIME then check the type of room Requestable? or Bookable\n */\n const status =\n !room.bookable || !this.isSpaceValidAsPerRule.spaces.length\n ? SpaceStatus.Unavailable\n : !room.available && hasConflict\n ? SpaceStatus.Booked\n : this.is_request\n ? SpaceStatus.Requestable\n : SpaceStatus.Bookable;\n this.updateAvailabilityStatus(status);\n }\n }\n\n public updateAvailabilityStatus(primaryCheck: string, secondaryCheck?: string) {\n this.availabilityStatus =\n primaryCheck !== ''\n ? primaryCheck\n : this.data.value.is_recurrent ||\n ['unavailable', 'booked'].indexOf(this.availabilityStatus) === -1\n ? secondaryCheck\n : this.availabilityStatus;\n }\n\n public get catering(): string {\n return (\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.start })\n .formatDate('ha')\n .toLocaleLowerCase() +\n ' - ' +\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.end })\n .formatDate('ha')\n .toLocaleLowerCase()\n );\n }\n\n public get dateString(): string {\n\t\t\t\tif(!this.requestedDateTz) return '';\n return this.requestedDateTz.formatDate('ccc d MMM yyyy');; //shorterLocalDateFormatString(this.requestedDateTz);\n \n }\n\n public get focusedRoomMapKey(): string {\n return `area-${this.room?.map_id}-status`;\n }\n\n /** Whether we are only allowed to 'request' the selected space */\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n const isRequest = space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser,\n });\n this.updateAvailabilityStatus(\n '',\n isRequest ? SpaceStatus.Requestable : SpaceStatus.Bookable\n );\n return isRequest;\n }\n\n public get roomFeatures(): string[] {\n // const room_type = `${this.room.internal_or_external}_room_types`\n const combinedFeatures = {\n // ...this._org.getOrganizationFiltersByRoomType(room_type),\n ...this._org.getOrganizationFiltersByRoomType('equipment_types'),\n };\n const features = this.room !== undefined ? this.room?.featuresArray.map(\n (feature: string) => combinedFeatures[feature]\n ) : [];\n\n return [...new Set(features)].filter((f) => !!f);\n }\n\n public get roomHasCatering() {\n // Building scope catering available is true or false\n const building = this.data.value?.selectedRoom?.building;\n let hasCatering = building ? building.has_catering : false;\n // but if Room catering is false it overrides the building\n if (this.room?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n }\n\n public get roomImagesFileSlug(): string {\n return this.room?.email.split('@')[0];\n }\n\n public get mapUrl(): string {\n return this.room?.level?.map_url;\n }\n\n public get timeString(): string {\n\t\t\tif(!this.requestedDateTz) return '';\n\t\t\treturn startEndTimeWithZoneFormatString(\n\t\t\t\t\tthis.requestedDateTz,\n\t\t\t\t\tthis.requestedDateTz.addValue({ minutes: this.data.value?.duration })\n\t\t\t);\n }\n\n /**\n * Get the timezone form the subscribed activeForm\n */\n public get timezone(): string {\n // R--- this.room.timezone wasn't reliable enough on page refresh, something to look into\n return this.data.value.selectedRoom?.building.timezone;\n }\n\n public setAlternativeWeekStartDate(bookingDate: DateTZ) {\n if (!bookingDate) {\n return;\n }\n\n const booking_date = bookingDate.clone();\n if (this.mobile) {\n this.alternativeWeekStartDateTz = booking_date;\n } else {\n this.alternativeWeekStartDateTz = booking_date.startOfValue('week');\n }\n }\n\n public updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n this.alternativeWeekStartDateTz = alternativeWeekStartDateTz;\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n }\n\n public confirmChanges(data: DateDurationData) {\n // R-- refactor room-availability-preview to return DateTZ so setAlternativeWeekStartDate can use it.\n this.mobile = data.mobile;\n this.setAlternativeWeekStartDate(data.dateTz);\n\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n dateTz: data.dateTz,\n duration: data.duration,\n },\n })\n );\n }\n\n public fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n if (!this.room?.id) {\n return;\n }\n\n const day = 24 * 60;\n const week = day * 7;\n\n let start_date = (alternativeWeekStartDateTz || this.data.value.dateTz).clone();\n if (allWeek && start_date.dateWeekday !== 7) {\n start_date = start_date.startOfValue('week');\n }\n\n const startOfDay = start_date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = start_date.setValue({ second: 0, millisecond: 0 }).startOfValue('day');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.room?.id,\n capacity: this.data.value?.roomSize.value,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public removeDateOffset() {\n const data = this.data.value;\n let { dateTz, offset } = data;\n dateTz = dateTz.subtractValue({ minutes: ((typeof offset === 'string' && offset == '') || (typeof offset === 'undefined')) ? 0 : Number(offset) });\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...data,\n dateTz: dateTz,\n offset: 0,\n },\n })\n );\n }\n\n public goToBackRoute() {\n this.removeDateOffset();\n this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n public expandMap(open: boolean) {\n this.expandedLocation = open;\n }\n\n public expandAvailability(open: boolean) {\n this.fetchRooms(!this.mobile);\n this.expandedAvailability = open;\n }\n\n public handleClose() {\n this.expandedLocation = false;\n this.expandedAvailability = false;\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n this.fetchRooms(false);\n }\n\n /**\n * Continue to Booking Form\n */\n public bookRoom() {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n },\n })\n );\n\n const bookingRoute = this.data.value.id ? 'edit' : 'create';\n this.router.navigate(['/home', bookingRoute]);\n }\n\n public hideInfoBanner() {\n this.showInfoBanner = false;\n }\n}\n","
\n
\n \n \n
\n
\n \n

This room is not guaranteed until booking confirmation is received.

\n \n
\n
\n \n

This time slot is not available, drag or choose a diferent date or time.

\n
\n
\n
\n \n
\n
\n
\n {{ availabilityStatus | titlecase }} {{ occurenceAvailability }}\n
\n
\n

{{room?.local_name}}

{{data.value?.bookingType.display}}
\n \n
\n
\n \n Equipment\n
    \n
  • \n {{feature}}\n
  • \n
\n
\n
\n
\n \n Catering Available\n
    \n
  • {{catering}}
  • \n
  • (specified in the last booking step)
  • \n
\n
\n
\n
\n
\n
\n

Room Availability:

\n

{{dateString}}

\n \n
\n \n
\n
\n
\n

Room Location:

\n

{{room?.building?.name}}, {{room?.level?.name}}

\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n {{ open ? '(tap to close)' : '(tap to open)'}}\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Detail

\n
\n\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
\n
\n
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' :\n data?.value?.recurrence_period | titlecase}}\n -\n Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{dateString}}
\n
End date: {{endDateString}}
\n
Time: {{timeString}}
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n instantBookOptions,\n roomDetailsRequired,\n roomEquipmentRequiredOptions,\n selectFormFilters,\n selectIsInternal,\n roomCateringAvailable,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map,\n take\n} from 'rxjs/operators';\n\n@Component({\n selector: 'app-room-filters-form',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-form.component.scss']\n})\nexport class RoomFiltersFormComponent extends BaseDirective implements OnInit {\n\n public instantBookOptions = instantBookOptions;\n public roomEquipmentRequiredOptions = roomEquipmentRequiredOptions;\n public roomDetailsRequired = roomDetailsRequired;\n public roomCateringAvailable = roomCateringAvailable;\n public internalRoomTypeRequiredOptions = [];\n public externalRoomTypeRequiredOptions = [];\n public isInternal = false;\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n @Output()\n public cancelSubmit = new EventEmitter();\n\n @Output()\n public filtersSubmit = new EventEmitter[]>();\n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('bookingType',\n this.store.pipe(\n select(selectIsInternal)\n ).subscribe(next => {\n this.isInternal = next;\n }));\n this.subscription('filters',\n this.store.pipe(\n select(selectFormFilters)\n ).subscribe(next => {\n this.selectedOptions.next(next);\n }));\n\n this.externalRoomTypeRequiredOptions = this.getFilters('external_room_types')\n this.internalRoomTypeRequiredOptions = this.getFilters('internal_room_types')\n }\n\n public toggleOptionChecked(selectOption: SelectOption) {\n this.selectedOptions.pipe(\n take(1),\n map(options => {\n const found = options.find(o => o.value === selectOption.value);\n if (found) {\n // remove\n return options.filter(o => o.value !== selectOption.value);\n }\n // add\n return [...options, selectOption];\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n public submitFilters() {\n this.selectedOptions.pipe(\n take(1)\n ).subscribe(options => {\n this.filtersSubmit.emit(options);\n });\n }\n\n public getFilters(type:string) {\n const filters = this._org.getOrganizationFiltersByRoomType(type) || {}\n return Object.keys(filters).map((key) => {\n const display = filters[key]\n return {\n value: key,\n display,\n shortDisplay: display\n }\n })\n }\n}\n","import {\n Component,\n ViewChild\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { Store } from '@ngrx/store';\nimport { storeRoomFilters } from '@mckinsey-converge/data-common';\nimport { RoomFiltersFormComponent } from 'src/app/booking/room-filters-form/room-filters-form.component';\n\n@Component({\n selector: 'app-room-filters',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-modal.component.scss']\n})\nexport class RoomFiltersModalComponent {\n\n @ViewChild(RoomFiltersFormComponent)\n public form: RoomFiltersFormComponent;\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n\n public submitFilters(filters: SelectOption[]) {\n this.store.dispatch(storeRoomFilters({\n payload: filters\n }));\n this.close();\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n OnChanges,\n EventEmitter,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n combineLatest,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n CENTER_POINT,\n generateMapStyleForSpace,\n legendOptions,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n spaceToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n SpaceStatus,\n selectMapFilteredResults,\n FilteredSpaces\n} from '@mckinsey-converge/data-common';\nimport {\n Point,\n HashMap,\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport { MapSearchStoreState } from '../../map/map-search/map-search.component';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\n@Component({\n selector: 'room-location-preview',\n template: `\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n {{building.name}}, {{level.name}}\n
\n \n
\n
The pinpoint indicates your selected room's location on the floor. No futher interaction is available.
\n \n
\n
\n \n
\n \n \n
\n \n
\n
\n\n\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./room-location-preview.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomLocationPreviewComponent extends BaseDirective implements OnInit, OnChanges {\n public legendOptions = legendOptions();\n\n @Input()\n public mapUrl: string;\n\n @Input()\n public focus: any; // @todo fix\n\n @Input()\n public expanded: boolean;\n\n @Input()\n public building: Building;\n\n @Input()\n public space: Space;\n\n @Input()\n public level: any; // @todo fix\n\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n\n // Use \"booking_preview\" to show smaller height with zoom icon\n @Input() public viewMode: String = null;\n\n @Output()\n public handleExpand: EventEmitter = new EventEmitter();\n\n public currentPage: string;\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get zoomLevel() {\n return this.expanded ? this.minZoom.value : this.zoom.value;\n }\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService) {\n super();\n }\n\n public focusedRoom = new BehaviorSubject(undefined);\n public featuresRoom = new BehaviorSubject(undefined);\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public minZoom = new BehaviorSubject(MAX_ZOOM_LEVEL / 3);\n public features = combineLatest([this.featuresRoom]).pipe(map(items => items.filter(i => !!i)));\n public setIntervalHandle: any = null;\n public count = 0;\n public center = new BehaviorSubject(CENTER_POINT);\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n public ngOnChanges(changes: any): void {\n if (changes.expanded && changes.expanded.currentValue) {\n this.activeSpace.pipe(\n take(1),\n filterUndefined(),\n map(spaceToMapFeature)\n ).subscribe(next => {\n this.featuresRoom.next(next);\n });\n } else if (changes.expanded && changes.expanded.previousValue && !changes.expanded.currentValue) {\n this.featuresRoom.next(undefined);\n }\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n\n // MCK-1850 And it's even slower when loading form scratch via an email link, so 10 second interval.\n this.timeout('Zoom to Room', () => this.initMapZoom(), 2000);\n this.activeSpace.next(this.space);\n this.activeBuilding.next(this.building);\n this.activeLevel.next(this.level);\n\n this.subscription('bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined())\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || [])\n .filter(s => !!s.map_id && s.zones.includes(building.id) && s.zones.includes(level.id));\n\n const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach(space => {\n // const status = filteredSpaces.statusMap[space.id] || SpaceStatus.Available;\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // });\n this.style_map.next(styles);\n \n })\n );\n\n }\n\n public initMapZoom() {\n const self = this;\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n // But this alone is not enough when loading from an email link due to how slow the loading is. See the ngOnInit\n this.setIntervalHandle = setInterval(() => {\n if (!this.focus) {\n return;\n }\n \n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 1000);\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public zoomToRoom(): void {\n this.focusedRoom.next(this.focus);\n this.zoom.next(MAX_ZOOM_LEVEL);\n }\n\n public zoomIn() {\n if (this.minZoom.value < MAX_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.minZoom.value > MIN_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value - 1);\n }\n }\n\n public resetZoomLevels() {\n this.minZoom.next(MIN_ZOOM_LEVEL);\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n const self = this;\n self.count = 0;\n\n this.zoom.next(MAX_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n this.setIntervalHandle = setInterval(() => {\n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 200);\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent,\n {\n data: this.building,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport { ApplicationService, BookingFormData, RoomResultsViewModel, setupRoomImages, User } from '@mckinsey-converge/data-common';\nimport { ImageDirective, SpaceImageObject } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-room-result-item',\n template: `\n
\n
\n
\n
\n {{ availability === 'requestable' ? 'Requestable' : 'Bookable'}}\n {{ viewModel?.space?.availableOccurrences }} out of {{ viewModel?.space?.totalOccurrences }} \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n
\n \n {{viewModel.levelDisplay}}, {{viewModel.title}}\n {{type}}\n {{viewModel.office}}\n {{viewModel.capacity}}\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-result-item.component.scss']\n})\nexport class RoomResultItemComponent extends ImageDirective implements OnInit, OnChanges {\n\n public rootFolderURL: string = 'assets/img/rooms/';\n public fileSlug: string = '';\n public type: string = '';\n\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: RoomResultsViewModel | undefined;\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public user: User;\n\n @Output()\n public roomSelect = new EventEmitter();\n\n public availability: \"requestable\" | \"bookable\" | \"booked\" | \"non-bookable\" | null;\n\n public foundImages: SpaceImageObject[] = [1,2].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n constructor(\n private _appService: ApplicationService) {\n super();\n }\n\n public ngOnInit(): void {\n if (this.viewModel && this.viewModel.space) {\n this.fileSlug = this.viewModel.space.email.split('@')[0];\n setupRoomImages(this, [1,2], this.rootFolderURL, this.fileSlug);\n const t = this.viewModel.space.internal_or_external;// || 'internal';\n this.type = `${t[0]?.toUpperCase()}${t.toLocaleLowerCase().substring(1)}`\n\n // Set the viewing space in the app service so that the staff result page can receive event on loading previously selected room card \n // which will help to scroll to the selected room\n if(this.viewModel.space.id === this.data.selectedRoom?.space?.id) {\n this._appService.set('STAFF.result.card.viewing', this.viewModel.space.id);\n }\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (this.availability !== null && (\n changes.data &&\n changes.data.firstChange === true &&\n changes.data.currentValue &&\n changes.data.currentValue.dateTz &&\n changes.data.currentValue.duration\n )) {\n this.availability = this.viewModel.space.byRequest({\n dateTz: this.data.dateTz,\n duration: this.data.duration,\n host: this.user\n }) === false ? \"bookable\" : \"requestable\";\n\n }\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public get typeClass() {\n return this.type.toLocaleLowerCase();\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n }\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n NgZone,\n OnInit,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable\n} from 'rxjs';\nimport {\n RoomResultsViewModel,\n BookingFormData,\n BookingStoreState,\n selectActiveForm,\n storeBookingFormData,\n SpaceFilterReason,\n User,\n OrganisationService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n map,\n take,\n distinctUntilChanged\n} from 'rxjs/operators';\nimport {\n AlertBannerDisplay,\n AlertMode,\n BaseTemplateComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n\t\tOverrideChangesModalComponent\n} from '@mckinsey-converge/ui';\nimport { RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n RoomStoreState\n} from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-room-results-paginated',\n template: `\n \n
\n
\n \n \n \n \n \n \n \n \n \n\n
\n \n
\n
\n \n \n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-results-paginated.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RoomResultsPaginatedComponent extends BaseTemplateComponent implements OnInit {\n public ROOM_DISPLAY_STEP = 10;\n public ROOM_DISPLAY_START = 3;\n public AlertMode = AlertMode;\n public AlertBannerDisplay = AlertBannerDisplay;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n @Input()\n public viewModels: Observable;\n\n @Input()\n public coachMark: Observable | undefined;\n\n /**\n * If true, show skeleton.\n */\n @Input()\n public isLoading: Observable;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay = false;\n\n @Input() public expanded_section_ids: string[] = [];\n @Input() public headerTitle: string = '';\n\n public displayCount = new BehaviorSubject(this.ROOM_DISPLAY_START);\n\n /**\n * Fake pagination since API does not support it.\n */\n public displayViewModels: Observable;\n\n public showLoadMore: Observable;\n\n public remainingResults: Observable;\n\n public data = new BehaviorSubject(undefined);\n public currentUser: User;\n noOfResultLoaded: number;\n\n constructor(vcRef: ViewContainerRef,\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _appService: ApplicationService,\n private cdRef: ChangeDetectorRef,\n private _dialog: MatDialog) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n //test commet for to trigger build again\n this.displayViewModels = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => { this.cdRef.markForCheck(); return vm?.slice(0, displayCount) } ));\n\n this.showLoadMore = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => {\n return ((vm?.length ?? 0) > displayCount);\n })\n );\n this.remainingResults = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => vm && (vm.length - displayCount) || 0));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.data.next(next);\n this.cdRef.detectChanges();\n\n }\n }));\n\n\n\n // Load more results if the section is expanded previously and the data is loaded \n const shouldLoadMore = this.data?.value?.expanded_section_ids?.includes(this?.headerTitle?.split('(')[0].split(' ').join('_'));\n if( this.showLoadMore && this?.data?.value?.resultLoaded && shouldLoadMore) {\n this.loadMore();\n } \n \n // Scroll to the selected room card if the user has selected a room from section previously \n this.subscription(\n 'viewing',\n this._appService\n ?.listen('STAFF.result.card.viewing')\n ?.subscribe((event) => {\n // Scroll to the selected room card \n if(event === this.data?.value?.selectedRoom?.space.id) {\n const spaceId = this.data?.value?.selectedRoom?.space.id;\n document.querySelectorAll(`[space-name=\"${spaceId}\"]`)[0].scrollIntoView();\n }\n \n })\n );\n\n this.cdRef.detectChanges();\n }\n\n public loadMore(isDom: boolean = false) {\n // fake pagination\n const previouslyLoadedCount = this.data.value.resultLoaded || 0; // previously loaded results count\n this.displayCount.pipe(\n take(1),\n // if the data is loaded from the dom then do not reset the count to previously loaded count\n map(v => (previouslyLoadedCount && !isDom) ? previouslyLoadedCount : v + this.ROOM_DISPLAY_STEP)\n ).subscribe(next => {\n this.displayCount.next(next);\n this.noOfResultLoaded = next;\n this.cdRef.detectChanges();\n });\n }\n\n\n public trackViewModelById(index: number, item: RoomResultsViewModel) {\n return item.space.id;\n }\n\n\n\t\t/**\n\t\t * Handles the selection of a room from the search results.\n\t\t * Depending on the room's availability and recurrence conflicts, this function decides\n\t\t * whether to open a modal for recurrence conflicts, override changes, or navigate to the\n\t\t * room details page. It updates the state and user interface accordingly.\n\t\t *\n\t\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t\t * @param {number} availableOccurrences - The number of available occurrences of the room.\n\t\t * @param {number} totalOccurrences - The total number of occurrences of the room.\n\t\t */\n public roomSelected(room: RoomResultsViewModel, availableOccurrences: number, totalOccurrences: number) {\n\n const { is_recurrent } = this.data.value;\n this.data.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.data.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\t\t// Determine the action based on recurrence conflicts, occurrence edits, and room availability\n\t\tif(this.data.value.recurrence_exceptions.length) {\n this.openRecurrenceConflictsModal(room);\t// Open modal for recurrence conflicts\n }\n else if( this.data.value.occurrence_edits && this.data.value.occurrence_edits.length) {\n this.overrideChanges(room);\t// Open modal to override changes\n }\n else {\n this.goToRoomDetail(room);\t// Navigate to the room details page\n }\n\n }\n\n /**\n * Navigates to the room details page for the selected room.\n * It updates the URL and navigates to the room details page with appropriate query parameters.\n *\n * @param {RoomResultsViewModel} room - The selected room from the search results.\n *\n * @remarks\n * The function manages timezone offset and other necessary details to provide accurate room information.\n * The state object is used to pass relevant data for correct page rendering and form population.\n *\n * @private\n */\n private goToRoomDetail(room) {\n this.cdRef.detectChanges();\n\t\t\t// Handle timezone offset for accurate date and time information\n let { dateTz } = this.data.value;\n if (this.offset) {\n dateTz = dateTz.addValue({ minutes: this.offset });\n }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.data.value.booking.room is not and does not contain the timezone\n * this.data.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.data.value,\n buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: this.offset,\n selectedRoom: room,\n nextBusinessDay: this.nextBusinessDay,\n expanded_section_ids: this.expanded_section_ids,\n resultLoaded: this?.expanded_section_ids?.length ? this.noOfResultLoaded : 0\n }\n }});\n }\n\n\n /**\n\t * Opens a modal to display recurrence conflicts for the selected room.\n\t * It shows recurrence conflicts, allowing the user to resolve them before proceeding.\n\t * After the modal is closed, it navigates to the room details page if there are no unresolved conflicts.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private openRecurrenceConflictsModal(room: RoomResultsViewModel) {\n let { recurrence_exceptions } = this.data.value;\n\n\t\t// Open modal for recurrence conflicts\n const recurr_ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.space.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n\n\t\t\t\tif (event.reason === 'done' && !(this.data.value.occurrence_edits && !this.data.value.occurrence_edits.length) ) {\n this.goToRoomDetail(room); \t// Navigate to room details page after resolving conflicts\n\t\t\t\t}\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t/**\n\t * Opens a modal to allow the user to override changes made to the booking.\n\t * It provides options to confirm or cancel the override, depending on user preference.\n\t * After the modal is closed, it navigates to the room details page if the user confirms the override.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private overrideChanges(room: RoomResultsViewModel) {\n\t\t// Open modal for overriding changes made to the booking\n const ref = this._dialog.open(OverrideChangesModalComponent, {\n width: '576px',\n data: {\n edits: this.data.value.occurrence_edits,\n timezone: this.data.value.timezone\n }\n });\n ref.componentInstance.event.subscribe(event => {\n if (event.reason === 'done') {\n this.goToRoomDetail(room);\t// Navigate to room details page after confirming the override\n ref.close();\n } else if (event.reason === 'close') {\n ref.close();\n }\n });\n }\n\n\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, Observable, of, Subject } from 'rxjs';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { distinctUntilChanged, filter, map } from 'rxjs/operators';\nimport { BookingRulesLink, RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n Building,\n BuildingLevel,\n mapResultsToViewModels,\n RoomResultsViewModel,\n FilteredSpaces,\n SpaceFilterReason,\n selectActiveForm,\n BookingStoreState,\n BookingFormData,\n OrganisationService,\n storeBookingFormData,\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { select, Store } from '@ngrx/store';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n\n@Component({\n selector: 'app-room-results-section',\n template: `\n
\n \n
\n\n \n \n \n\n \n \n \n \n `,\n styleUrls: ['./room-results-section.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class RoomResultsSectionComponent extends BaseDirective implements OnInit {\n @Input() public rules_link?: BookingRulesLink;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay : boolean = false\n\n @Input()\n public collapsable: boolean;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseTitle: string;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseDescription: string;\n\n @Input()\n public levelBuildings: Observable<{ flattenedLevels: BuildingLevel[]; buildings: Building[] }>;\n\n @Input()\n public results: BehaviorSubject>;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n public mainResultViewModels = new BehaviorSubject(\n undefined\n );\n\n public editing_form = new BehaviorSubject(false);\n\n public resultsLoading: Observable;\n public coachMarkDisplay: Observable;\n\n public AlternateBuildings = [];\n public location: any;\n\n public activeForm: BookingFormData; // active form data\n public expanded_section_ids: string[] = []; // expanded section ids\n\n\n private subscribeResultsToViewModels = (\n subName: string,\n resultsObservable: Observable>,\n flattenLevelBuildings: Observable<{ flattenedLevels: any; buildings: Building[] }>,\n viewModelSubject: Subject\n ) => {\n this.subscription(\n subName,\n combineLatest([\n resultsObservable.pipe(map((r) => r.optionalSuccess?.spaces || [])),\n flattenLevelBuildings,\n ])\n .pipe(\n map(([results, { flattenedLevels, buildings }]) =>\n mapResultsToViewModels(\n results?.length && results[0]?.building ? results : [],\n flattenedLevels,\n buildings\n )\n )\n )\n .subscribe((next) => {\n viewModelSubject.next(next);\n })\n );\n };\n \n \n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.resultsLoading = this.results.pipe(map((m) => m.isLoading));\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.location = next.location;\n this.updateCoachMark();\n this.activeForm = next;\n } else {\n }\n })\n );\n\n this.subscription(\n 'buildings',\n this._org.listen('buildings').subscribe(() => {\n this.updateCoachMark();\n })\n );\n\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n\n // Update opened section id and send it to child component\n private updateSectionIdOnOpen (event: { status: string; id: string }) {\n // if status is opened, then push to the expanded_section_ids in the store otherwise remove from the store\n if (event.status === 'opened') {\n const ids = this.activeForm?.expanded_section_ids ? this.activeForm?.expanded_section_ids : [];\n // Remove duplicates and add the new id to the list \n this.activeForm.expanded_section_ids = Array.from(new Set([...ids, event.id]));\n \n } else if (event.status === 'closed'){\n // Remove the id from the list \n this.activeForm.expanded_section_ids = this.activeForm?.expanded_section_ids.filter(\n (id) => id !== event.id\n )\n }\n }\n \n\n updateCoachMark() {\n const buildingsInSameCity = this._org.buildings?.filter(_ => {\n // Make sure this.location is populated to pass unit tests -\n if (!this.location || this.location.length === 0) return false;\n // If all offices are selected, city name will be at this.location[0]?.meta?.city.name, otherwise use this.location[0]?.meta?.city \n const cityFromLocation = typeof this.location[0]?.meta?.city === 'object' && this.location[0]?.meta?.city !== null\n ? this.location[0]?.meta?.city.name\n : this.location[0]?.meta?.city;\n return _.city === cityFromLocation;\n });\n const AlternateBuildings = buildingsInSameCity?.filter(\n (building) =>\n !this.location.some(\n (locationItem) => locationItem.meta?.building?.id === building.id\n )\n );\n this.AlternateBuildings = AlternateBuildings;\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.results || changes.levelBuildings || changes.mainResultViewModels) {\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n this.coachMarkAction.emit(reason);\n }\n}\n","import { SpaceFilterReason } from '@mckinsey-converge/data-common';\n\nexport interface BookingRulesLink {\n name: string;\n url: string;\n}\nexport class RoomResultsCoachmarkViewmodel {\n public visible: boolean;\n public title: string;\n public actionButtonText: string;\n\n constructor(public reason: SpaceFilterReason, public rules_link?: BookingRulesLink, alternateBuildings?:any[]) {\n this.visible = true;\n switch (reason) {\n case SpaceFilterReason.DateTime:\n this.title =\n 'There are no available rooms that match your search criteria. ' +\n 'Please adjust your search criteria and try again.';\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.OfficeRules:\n this.title =\n `There are no available rooms that match your search criteria.\n Please adjust your search criteria and try again.`;\n if (alternateBuildings && alternateBuildings.length > 0) {\n this.title += ` Alternatively, you can try ${alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n }\n if (rules_link) {\n this.title +=\n `
For information on booking rules please see ` +\n `${rules_link.name}`;\n }\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.Filters:\n this.title =\n 'No rooms available for your filter criteria. ' +\n 'Try to clear the filter please.';\n this.actionButtonText = 'Clear filter';\n break;\n case SpaceFilterReason.AlternateBuildingsFound:\n this.title = `There are no available rooms that match your search criteria. Please try ${\n alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.None:\n this.visible = false;\n this.title = '';\n this.actionButtonText = '';\n break;\n }\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n laterThatDayFromDateTz,\n loadRoomsWithQuery,\n RoomStoreState,\n mapRoomToSelectOption,\n loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { BaseDirective, timeWithZoneFormatString } from '@mckinsey-converge/base';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport {\n Building,\n BuildingLevel,\n flattenBuildingsWithLevels,\n BookingStoreState,\n FilteredSpaces,\n SpaceFilterReason,\n clearRoomFilters,\n selectActiveForm,\n selectFilteredLaterDayResults,\n selectFilteredNextDayResults,\n selectFilteredResults,\n selectFormFilters,\n BookingFormData,\n roomFormDataToQuery,\n selectFilteredDiffSizeResults,\n OrganisationService,\n CollapseService\n} from '@mckinsey-converge/data-common';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { debounceTime, distinctUntilChanged, filter, map, shareReplay } from 'rxjs/operators';\nimport {\n buildingStateSelector,\n BuildingStoreState,\n loadBuildings,\n} from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport { filterUndefined, resultCountObservable } from '@mckinsey-converge/rx-utils';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { RoomBookingModalComponent } from 'src/app/booking/room-booking-modal/room-booking-modal.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\nimport {\n BookingRulesLink,\n RoomResultsCoachmarkViewmodel,\n} from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { FormControl } from '@angular/forms';\nimport { Location } from '@angular/common';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-room-results',\n template: `\n \n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n {{ open ? '(tap to close)' : '(tap to open)' }}\n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n `,\n styleUrls: ['./room-results.component.scss'],\n animations: [\n trigger('collapseHeight', [\n state(\n 'open',\n style({\n height: '*',\n opacity: 1,\n })\n ),\n state(\n 'closed',\n style({\n overflow: 'hidden',\n opacity: 0,\n height: '0px',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n trigger('expandWidth', [\n state(\n 'open',\n style({\n maxWidth: '1024px',\n })\n ),\n state(\n 'closed',\n style({\n maxWidth: '96%',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class RoomResultsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public day_offset = 1;\n\n public data = new BehaviorSubject(undefined);\n public filters = new BehaviorSubject[]>([]);\n\n public mainResults = new BehaviorSubject>(LoadingModel.empty());\n public mainResultsFiltered = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public laterThatDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public nextBusinessDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public diffSizeResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public mainResultsSpaces: SelectOption[];\n\n public laterThatDayDisplay = new BehaviorSubject(undefined);\n\n public mainCoachMarkDisplay = this.mainResults.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map((r) => new RoomResultsCoachmarkViewmodel(r, this.rules_link))\n );\n\n public rules_link?: BookingRulesLink;\n\n public mainResultsCount = resultCountObservable(\n this.mainResultsFiltered,\n this.mainResultsFiltered.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public laterThatDayCount = resultCountObservable(\n this.laterThatDayResults,\n this.laterThatDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public nextBusinessDayCount = resultCountObservable(\n this.nextBusinessDayResults,\n this.nextBusinessDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public diffSizeCount = resultCountObservable(\n this.diffSizeResults,\n this.diffSizeResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n\n public selectedToggle = new BehaviorSubject(0);\n\n public flattenLevelBuildings: Observable<{\n flattenedLevels: BuildingLevel[];\n buildings: Building[];\n }>;\n\n public open: boolean = true;\n public editing_form = new BehaviorSubject(false);\n\n public spaceControl = new FormControl();\n\n public selectedSpace: SelectOption;\n public resetInput: number;\n\n public searchStringPresent = false;\n public payload: any = {\n payload: { name: 'test', id: 'test-id' },\n building: {},\n floorMap: true,\n };\n\n public isOpen = true;\n\n public toggle() {\n this.isOpen = !this.isOpen;\n }\n\n constructor(\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private dialog: MatDialog,\n private _org: OrganisationService,\n private location: Location,\n private collapseService: CollapseService\n ) {\n super();\n this.payload = location.getState();\n }\n\n public ngOnInit(): void {\n this.subscription(\n 'filters',\n this.store.pipe(select(selectFormFilters), distinctUntilChanged()).subscribe((next) => {\n return this.filters.next(next);\n })\n );\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n const day = next.dateTz.dateWeekday - 1;\n this.day_offset = day >= 4 ? 7 - day : 1;\n const building = this._org.buildings.find(\n (_) => _.id === next.location[0]?.meta?.building?.id\n );\n this.rules_link =\n building?.setting('booking.rules_link') ||\n next.location.find(\n office => office?.meta?.building?._settings?.discovery_info?.booking?.rules_link\n )?.meta?.building?._settings?.discovery_info?.booking?.rules_link;\n // next.location[0]?.meta?.building?.settings?.discovery_info?.booking\n // ?.rules_link;\n const nday = laterThatDayFromDateTz(next.dateTz);\n this.laterThatDayDisplay.next(`at ${timeWithZoneFormatString(nday)}`);\n // this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(next)));\n this.data.next(next);\n \n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n\n // this.data.next(next);\n } else {\n // no form data, likely visiting directly. navigate back to start\n this.router.navigate(['../'], {\n replaceUrl: true,\n relativeTo: this.route,\n });\n }\n })\n );\n\n this.subscription(\n 'results',\n this.store.pipe(select(selectFilteredResults)).subscribe((next) => {\n this.mainResults.next(next);\n this.mainResultsFiltered.next(next);\n // Populate results for Search\n this.mainResultsSpaces = next.success?.spaces\n ? next.success?.spaces?.map(mapRoomToSelectOption)\n : [];\n })\n );\n\n this.subscription(\n 'laterResults',\n this.store.pipe(select(selectFilteredLaterDayResults)).subscribe((next) => {\n this.laterThatDayResults.next(next);\n })\n );\n\n this.subscription(\n 'nextDayResults',\n this.store.pipe(select(selectFilteredNextDayResults)).subscribe((next) => {\n this.nextBusinessDayResults.next(next);\n })\n );\n\n this.subscription(\n 'diffSize',\n this.store.pipe(select(selectFilteredDiffSizeResults)).subscribe((next) => {\n this.diffSizeResults.next(next);\n })\n );\n\n this.flattenLevelBuildings = this.store.pipe(\n select(buildingStateSelector),\n select(loadBuildings.selectors.optionalSuccess),\n filterUndefined(),\n map(flattenBuildingsWithLevels),\n shareReplay(1)\n );\n\n this.subscription(\n 'spaceChanges',\n this.spaceControl.valueChanges.subscribe((value) => {\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults.value.success?.spaces?.filter((s) => {\n if (s.id === value.value) {\n return true;\n }\n return false;\n });\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n })\n );\n\n // if coming from kiosk map url, route there\n if (this.payload?.floorMap) {\n this.router.navigate([`../home/floor-map`], {\n state: { ...this.payload },\n queryParams: {\n display: '',\n },\n });\n }\n\n this.subscription(\n 'spaceChanges',\n this.selectedToggle.subscribe((value) => {\n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n })\n );\n }\n\n /**\n * Dispatches actions to load rooms based on the provided value.\n * @param {number} value - The value indicating the mode of operation.\n * 0: Load rooms for regular view.\n * 1: Load rooms for results map view.\n */\n public despatchLoadRooms() {\n const selectedMenuIndex = this.selectedToggle.value; // List/Map/Calendar\n const isForFloorMap = this.payload?.floorMap;\n // If value is 0 and floorMap is not present in payload\n if(selectedMenuIndex === 0 && !isForFloorMap) {\n // Dispatch action to load rooms with query generated from form data\n this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(this.data.value)));\n }\n \n // If value is 1 or floorMap is present in payload\n if(selectedMenuIndex === 1 || isForFloorMap) {\n // Dispatch action to load rooms for results map view with query generated from form data\n this.store.dispatch( loadRoomsForResultsMap.request(roomFormDataToQuery(this.data.value)));\n }\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n const mainResults = cloneDeep(this.mainResults.value);\n this.mainResultsFiltered.next(mainResults);\n this.searchStringPresent = false;\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n\n public changeInput(event) {\n if (event) {\n this.clearRoomSearch();\n }\n }\n\n public filteredRoomsChange(event: SelectOption[]) {\n const roomIds = event.map((o) => o.value);\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults?.value?.success?.spaces\n ? this.mainResults?.value?.success?.spaces?.filter((s) => {\n if (roomIds.includes(s.id)) {\n return true;\n }\n return false;\n })\n : [];\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n }\n\n public changeSearchResults() {\n this.editing_form.next(true);\n const dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n dialog_ref.afterClosed().subscribe(() => {\n this.editing_form.next(false);\n this.collapseService.collapsePanel();\n });\n }\n\n public filterResults() {\n this.dialog.open(RoomFiltersModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n switch (reason) {\n case SpaceFilterReason.Filters:\n this.store.dispatch(clearRoomFilters());\n break;\n case SpaceFilterReason.OfficeRules:\n case SpaceFilterReason.DateTime:\n this.changeSearchResults();\n break;\n }\n }\n\n public selectedToggleChange(event: SelectOption) {\n this.selectedToggle.next(event.value);\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n humaniseDuration,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n weekDayMonthYearFormat\n} from '@mckinsey-converge/base';\nimport {\n truncateLocationList,\n BookingFormData,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\nimport { Store } from '@ngrx/store';\nimport { clearRoomFilters } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'app-searched-location',\n template: `\n
\n
\n {{name}}\n {{date}}\n {{timing}}\n {{types}}\n No filters applied\n Filtering unavailable for this view\n {{filterDisplay}}\n
\n \n
\n `,\n styleUrls: ['./searched-location.component.scss']\n})\nexport class SearchedLocationComponent implements OnInit, OnChanges {\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public filters: SelectOption[] = [];\n\n @Output()\n public changeClick = new EventEmitter();\n\n @Output()\n public filterClick = new EventEmitter();\n\n @Input()\n public canFilter = true;\n\n public name = '';\n public date = '';\n public timing = '';\n public types = '';\n public filterDisplay = '';\n public filterCount = '';\n\n constructor(private store: Store) {}\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.data || changes.filters) {\n this.computeDisplay();\n }\n }\n\n public ngOnInit(): void {\n this.computeDisplay();\n }\n\n\n public computeDisplay() {\n if (!this.data) {\n return;\n }\n const { duration, dateTz, location, roomSize, bookingType, is_recurrent, recurrence_endTz } = this.data;\n\n \n // this.requestedEndDateTz = new DateTZ({ date: endDate.date.valueOf(), is_local_tz, building_tz })\n\n const group = location.find(l => l.groupHeader);\n if (group) {\n this.name = group.shortDisplay;\n } else {\n this.name = truncateLocationList(location);\n }\n\n // R--- blocked until TZ booking form inputs\n const building_tz = location[0]?.meta?.building?.timezone || location[0]?.meta?.city?.timezone;\n const startDate = new DateTZ({date: dateTz.ms, is_local_tz: false, building_tz })\n\n if(is_recurrent) {\n const occEndDate = getLastDateFromList( this?.data?.recurrence_starts );\n \tconst endRecDate = new DateTZ({date: occEndDate.ms, is_local_tz: false, building_tz });\n this.date = `From ${weekDayMonthYearFormat(startDate)} until ${weekDayMonthYearFormat(endRecDate)}` ;\n }\n else {\n this.date = weekDayMonthYearFormat(startDate);\n }\n\n const startDisplay = startDate.formatDate(`${timeFormatString()}`).toLocaleLowerCase();\n const endDate = startDate.addValue({ minutes: duration });\n const endDisplay = timeWithGmtOffsetFormatString(endDate);\n this.timing = `${startDisplay}-${endDisplay}`; // - TODO correct for DST?\n\n const durationDisplay = humaniseDuration(duration, 'short');\n this.types = `${durationDisplay}, ${bookingType.display}, ${roomSize.display}`;\n\n this.filterDisplay = this.filters.map(f => f.shortDisplay).join(', ');\n this.filterCount = this.filters.length > 0 ? `(${this.filters.length})` : '';\n }\n\n public clearAllFilters() {\n this.store.dispatch(clearRoomFilters());\n } \n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-footer-menu',\n templateUrl: './footer-menu.component.html',\n styleUrls: ['./footer-menu.component.scss']\n})\nexport class FooterMenuComponent extends BaseDirective implements OnInit {\n\n /** Tiles to display on the home page */\n public tiles: ApplicationLink[] = [];\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Angular Component initialisation lifecycle hook */\n public ngOnInit(): void {\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.tiles = this._service.setting('app.home.tiles') || [];\n });\n }\n}\n","\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Building,\n BuildingLevel,\n OrganisationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-map-controls',\n templateUrl: './map-controls.component.html',\n styleUrls: ['./map-controls.component.scss']\n})\nexport class MapControlsComponent extends BaseDirective implements OnInit {\n /** ID of the active building */\n @Input() public building: string;\n /** ID of the active level */\n @Input() public level: string;\n /** Emitter for changes to the active level */\n @Output() public levelChange = new EventEmitter();\n /** Details of the active building */\n public building_details: Building = this._org.building;\n /** List of available buildings */\n public building_list: Building[] = [];\n /** List of available levels */\n public level_list: readonly BuildingLevel[] = [];\n\n public get can_select_building(): boolean {\n return !!this._service.setting('app.explore.can_select_building');\n }\n\n constructor(\n private _route: ActivatedRoute,\n private _router: Router,\n private _service: ApplicationService,\n private _org: OrganisationService\n ) {\n super();\n }\n\n public ngOnInit() {\n this._org.listen('buildings').pipe(first(_ => !!_ && !!_.length)).subscribe(() => {\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe(params => {\n /* istanbul ignore else */\n if (params.has('level')) {\n const level_id = params.get('level');\n const level = this._org.levelWithID(level_id);\n this.level = level.id;\n this.setBuilding(level.building_id);\n this.levelChange.emit(this.level);\n this.clearTimeout('check_building');\n }\n })\n );\n this.building_list = this._org.buildings;\n this.timeout('check_building', () => {\n /* istanbul ignore else */\n if (!this.building) {\n this.setBuilding(this._org.building.id);\n }\n this.levelChange.emit(this.level);\n });\n });\n }\n\n public setBuilding(bld_id: string) {\n const building = this._org.buildings.find(bld => bld.id === bld_id);\n /* istanbul ignore else */\n if (building) {\n this.building_details = building;\n this.building = bld_id;\n this._org.building = building;\n this.level_list = building.levels;\n /* istanbul ignore else */\n if (this.level_list.length && !this.level_list.find(lvl => lvl.id === this.level)) {\n this.updateLevel(this.level_list[0].id);\n }\n }\n }\n\n public updateLevel(lvl_id: string) {\n this.level = lvl_id;\n this.levelChange.emit(this.level);\n this._router.navigate([], {\n relativeTo: this._route,\n queryParams: { level: lvl_id }\n });\n }\n}\n","
\n 1\"\n >\n \n {{ building_details?.code }} - {{ building_details?.name }} \n \n
\n
{{ bld.code }}
\n
{{ bld.name }}
\n
{{ bld.address }}
\n
\n
\n
\n \n \n \n \n {{ level.name }}\n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'a-overlay-menu',\n templateUrl: './overlay-menu.component.html',\n styleUrls: ['./overlay-menu.component.scss']\n})\nexport class OverlayMenuComponent extends BaseDirective {\n /** Whether to show the menu */\n @Input() public show: boolean;\n /** Emitter for changes to show */\n @Output() public showChange = new EventEmitter();\n\n /** List of links to display on the menu */\n public get menu_items(): ApplicationLink[] {\n const settings = this._service.setting('app.general.menu') || { items: [] };\n return settings.items || [];\n }\n\n /** Copyright details for the application */\n public get copyright(): string {\n return (this._service.setting('app.general.menu') || {}).copyright || '';\n }\n\n public get settings() {\n const settings = this._service.setting('app.general.menu') || { position: '' };\n return settings;\n }\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Current year to display for copyright */\n public get year(): number {\n return DateNow(new Date()).dateYear;\n }\n\n /** Close the overlay menu */\n public close() {\n this.show = false;\n this.showChange.emit(this.show);\n }\n\n public delayedClose() {\n this.timeout('close', () => this.close(), 50);\n }\n\n public cancelClose() {\n this.timeout('cancel_close', () => this.clearTimeout('close'), 10);\n }\n}\n","\n
\n
\n
\n \n
\n
\n \n
\n
\n Copyright © {{ year }} {{ copyright }}\n
\n
\n\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { ImageDirective } from '@mckinsey-converge/base';\nimport { setupRoomImages } from '@mckinsey-converge/data-common';\nimport { SpaceImageObject } from 'libs/base/src/lib/types.utilities'\n\n@Component({\n selector: 'mck-responsive-inline-images',\n template: `\n
\n
\n \n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n
\n
\n `,\n styleUrls: ['./responsive-inline-images.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ResponsiveInlineImagesComponent extends ImageDirective implements OnInit {\n\n /** Input array of images */\n @Input() public rootFolderURL: string;\n @Input() public fileSlug: string;\n\n /** Ignore this param, it's only use is to bypass the image onload event in testing */\n @Input() public imagesLoaded: boolean;\n public loadImages = new BehaviorSubject([]);\n\n public foundImages: SpaceImageObject[] = [1,2,3].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n public mobile = false;\n\n constructor(private cdRef: ChangeDetectorRef,) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 768;\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n next: val => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n }\n })).subscribe();\n setupRoomImages(this, [1,2,3], this.rootFolderURL, this.fileSlug, this.imagesLoaded);\n this.subscription(\n\t\t\t\t\t\t'found_images',\n\t\t\t\t\t\tthis.loadImages.subscribe((imgArr: SpaceImageObject[]) => {\n\t\t\t\t\t\t\tif(imgArr.length) this.foundImages = imgArr;\n\t\t\t\t\t\t\tthis.cdRef.detectChanges();\n\t\t\t\t\t\t}));\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n } \n\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n MatDialogRef,\n MAT_DIALOG_DATA\n} from '@angular/material/dialog';\nimport {\n BaseClass\n} from '@mckinsey-converge/base';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'a-survey-modal',\n templateUrl: './survey-modal.component.html',\n styleUrls: ['./survey-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SurveyModalComponent extends BaseClass implements OnInit {\n constructor(\n @Inject(MAT_DIALOG_DATA) public _data: any,\n private _composer: ComposerService,\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n /* present experience question by default */\n public token = '';\n public phase = 'intro';\n public baseUrl = '';\n\n public questions = {\n created_at: 0,\n updated_at: 0,\n header_question: \"What went wrong?\",\n header_subtext: \"Select one or several options\",\n options: [],\n id: \"\"\n }\n\n public answers = {\n questions_id: \"\",\n positive: true, // Experience is positive until the questions are displayed\n option_responses: [],\n comments: \"\"\n };\n\n // Show the questions and mark the experience negative. (false positive)\n public showQuestions(): void {\n this.answers.positive = false;\n this.phase = 'questions';\n }\n\n public ngOnInit(): void {\n /* fetch the question options once composer is initialized */\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n const token = this._composer.auth.token;\n this.token = token;\n this.baseUrl = this._composer.auth.api_endpoint.replace(this._composer.auth.route, '/api/staff/feedback')\n this.getFeedbackQuestionsFromApi(token, this._data)\n });\n }\n\n public getFeedbackQuestionsFromApi(token: string, questionID: string) {\n new Promise((resolve, reject) => {\n const url = `${this.baseUrl}/questions/${questionID}`;\n let result: any = null;\n this._composer.http.get(url).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.questions = d;\n this.answers = {\n questions_id: this.questions.id,\n positive: true,\n option_responses: this.questions.options.map(q => ({ // map the questions to default answers.\n id: q.id,\n checked: false,\n })),\n comments: \"\"\n };\n }).catch(e => {\n console.log('error', e)\n });\n }\n\n // Handle the checkbox changes\n public handleChange(value: any) {\n this.answers.option_responses.some((o, i) => {\n if (o.id === value.id) {\n this.answers.option_responses[i].checked = !this.answers.option_responses[i].checked;\n return true;\n }\n });\n }\n\n // Handle the comment input changes\n public handleComment($evemt: any) {\n this.answers.comments = $evemt.target.value;\n }\n\n // Submit the Survey in it's current state.\n public confirm() {\n new Promise((resolve, reject) => {\n let result: any = null;\n this._composer.http.post(this.baseUrl, this.answers).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.phase = 'exit';\n this.closeModal(true);\n }).catch(e => {\n console.log('error', e)\n this.phase = 'exit';\n this.closeModal(true);\n });\n \n }\n\n // Close the modal\n public closeModal(delayed: boolean = false) {\n if (delayed) {\n this.timeout('closeModal', () => {\n this._dialog_ref.close();\n }, 2000);\n } else {\n this._dialog_ref.close();\n }\n }\n}\n","
\n \n
\n
\n \n
\n How was your booking experience?\n
\n
\n
\n \n \n
\n
\n\n\n
\n
\n \n
\n \n What went wrong?\n

Select one or several options

\n
\n
\n
\n
\n {{question.option}}\n
\n
\n \n \n \n \n
\n
\n \n \n \n
\n\n
\n
\n \n
\n\n \n
\n Thank you!\n
\n \n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n distinctUntilChanged,\n first,\n} from 'rxjs/operators';\nimport {\n ApplicationIcon,\n BookingFormState,\n SettingsService,\n openBookingSurvey,\n clearBookingFormData,\n BookingFormData,\n SeriesAction,\n selectActiveForm,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport {\n NavigationEnd,\n Router,\n ActivatedRoute\n} from '@angular/router';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport { SurveyModalComponent } from '../survey-modal/survey-modal.component';\nimport {\n Store, select\n} from '@ngrx/store';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface RoutePayload {\n /** IE ['/home', 'results'] */\n route: string[];\n /** IE { display: '/list' } */\n queryParams?: object;\n}\n\nexport type RoomBookingStoreState = BookingFormState & BuildingStoreState;\n\n@Component({\n selector: 'a-topbar-header',\n template: `\n
\n
\n \n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n
\n `,\n styleUrls: ['./topbar-header.component.scss'],\n // encapsulation: ViewEncapsulation.None,\n})\nexport class TopbarHeaderComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether to show menu */\n @Input() public menu: boolean;\n /** Whether to show modal close icon */\n @Input() public modal: boolean = false;\n /** Whether t show modal back icon */\n @Input() public backModal: boolean = false;\n /** Whether to disable the survey triggers */\n @Input() public noSurvey: boolean = false;\n /** Name of the page being rendered */\n @Input() public page: string;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n /** Override the home route. **/\n @Input() public homeOverride: string | undefined;\n /** Show history back instead of logo block */\n @Input() public back: RoutePayload;\n /** Emitter for changes to menu state */\n @Output() public menuChange = new EventEmitter();\n /** Emitter for the close button */\n @Output() public closeCallback = new EventEmitter();\n /** Emitter for the back button */\n @Output() public onBack = new EventEmitter();\n /** Name of the currently active page */\n public currentPage: string;\n /** Survey modal state */\n public modalOpen: boolean = false;\n isEditSeries: boolean = false;\n\n public get feedback() {\n const feedback_url = this._org.getOrganizationFiltersByRoomType('feedback_url');\n return `${feedback_url}${this.currentPage}`;\n // return generateFeedbackUrl(this.currentPage);\n }\n\n public surveyDialogRef: MatDialogRef = null;\n\n public bookingCompleted: Date = new Date();\n public feedbackId: string = null;\n\n constructor(private store: Store,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.store.dispatch(loadOrganisations.request());\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => {\n this.logo = this._settings.get(`app.logo_${this.mode}`) || { type: 'icon' };\n });\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n\n // if the survey is allowed (don't in modals! due to duplicate appearances)\n if (!this.noSurvey) {\n // get the active form values\n this.subscription('openSurveyModal', this.store.pipe(\n distinctUntilChanged()\n ).subscribe((next: any | undefined) => {\n const feedbackId = next.organisation?.data?.success?._settings?.discovery_info?.feedback_id;\n if (feedbackId && this.feedbackId !== feedbackId) {\n this.feedbackId = feedbackId;\n }\n if (next.bookingForm?.bookingCompleted && this.bookingCompleted.getTime() < next.bookingForm.bookingCompleted.getTime()) {\n this.bookingCompleted = new Date(next.bookingForm.bookingCompleted.getTime());\n this.openFeedbackModal();\n }\n }));\n }\n\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n /** Set menu state to `true` */\n public showMenu() {\n this.menu = true;\n this.menuChange.emit(this.menu);\n }\n\n public async goToHome() {\n // this.isEditSeries && this.clearFormAndResultData();\n // Clear the form and result data before navigating to home for a fresh start for all type of bookings\n this.clearFormAndResultData();\n await this._router.navigate([this.homeOverride ?? '/']);\n // await this._router.navigate(['/', 'home'], { relativeTo: this.route });\n this._dialog.closeAll();\n }\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n public goToHelp() {\n const help_url = this._org.getOrganizationFiltersByRoomType('help_url');\n window.open(help_url || Urls.Help);\n }\n\n public goToFeedback() {\n // Over-engineered button action to mimic/test booking confirmation event.\n this.store.dispatch(openBookingSurvey());\n }\n\n public openFeedbackModal() {\n if (!this.modalOpen && !this.surveyDialogRef) {\n this.modalOpen = true;\n this.surveyDialogRef = this._dialog.open(SurveyModalComponent, {\n disableClose: true,\n panelClass: 'mck-modal-survey',\n data: this.feedbackId,\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.surveyDialogRef.afterClosed().subscribe(() => {\n this.modalOpen = false;\n this.surveyDialogRef = null;\n });\n }\n\n }\n\n public async goToBackRoute() {\n this.onBack.emit();\n await this._router.navigate(this.back.route, { queryParams: this.back.queryParams });\n }\n\n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { first } from 'rxjs/operators';\n\nimport {\n ApplicationIcon,\n ApplicationService,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-login',\n templateUrl: './login.component.html',\n styleUrls: ['./login.component.scss']\n})\nexport class LoginComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether the user credentials are being checked */\n public loading: boolean;\n /** Form fields for the login form */\n public form: FormGroup;\n\n constructor(private _service: ApplicationService, private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n this.loading = true;\n this.form = new FormGroup({\n username: new FormControl('', [Validators.required]),\n password: new FormControl('', [Validators.required])\n });\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.loading = false;\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n }\n\n /** Perform user login */\n public login() {\n this.loading = true;\n const form = this.form.value;\n this._users.login({\n username: form.username,\n password: form.password\n }, { form: true }).then(() => {\n this.loading = false;\n }, () => {\n this.loading = false;\n this.form.controls.password.setErrors({ check: true });\n });\n }\n\n}\n","
\n
\n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n \n Username:\n \n \n \n Username is required\n \n
\n
\n \n Password:\n \n \n \n Invalid username or password\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n
\n \n
\n
Converge is loading
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\n@Component({\n selector: 'app-map-controls',\n template: `\n
\n
\n \n
\n \n \n
\n \n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-controls.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class MapControlsComponent implements OnInit {\n @Output()\n public zoomOutClick = new EventEmitter();\n\n @Output()\n public zoomInClick = new EventEmitter();\n\n @Output()\n public refreshClick = new EventEmitter();\n\n @Output()\n public infoClick = new EventEmitter();\n\n @Output() toggleEvent = new EventEmitter();\n\n public isClosed = true;\n\n toggle() {\n this.toggleEvent.emit();\n this.isClosed = !this.isClosed;\n }\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { FormControl } from '@angular/forms';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { legendOptions } from '../map.utils';\n\n@Component({\n selector: 'app-map-filters',\n template: `\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-filters.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapFiltersComponent extends BaseDirective implements OnInit {\n\n public legendOptions = legendOptions();\n\n @Input()\n public buildings: SelectOption[];\n\n @Input()\n public selectedBuilding: SelectOption;\n\n @Output()\n public selectedBuildingChange = new EventEmitter>();\n\n @Input()\n public levels: SelectOption[];\n\n @Input()\n public selectedLevel: SelectOption;\n\n @Output()\n public selectedLevelChange = new EventEmitter>();\n\n @Input()\n public spaces: SelectOption[];\n\n @Output()\n public selectedSpaceChange = new EventEmitter>();\n\n @Input()\n public selectedSpace: SelectOption;\n\n @Output()\n public searchClick = new EventEmitter();\n\n public buildingControl = new FormControl();\n\n public levelControl = new FormControl();\n\n public spaceControl = new FormControl();\n\n public resetInput: number;\n\n public searchStringPresent = false;\n\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('buildingChanges',\n this.buildingControl.valueChanges.subscribe(value => this.selectedBuildingChange.emit(value)));\n this.subscription('levelChanges',\n this.levelControl.valueChanges.subscribe(value => this.selectedLevelChange.emit(value)));\n this.subscription('spaceChanges',\n this.spaceControl.valueChanges.subscribe(value => {\n this.selectedSpaceChange.emit(value);\n this.searchClick.emit();\n }));\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n this.searchStringPresent = false;\n // TODO, reset the focused room if required?\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\n\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel,\n parentComponent?: any,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'app-map-overlay',\n template: `\n
\n \n
\n
\n
\n \n
\n
\n
\n {{data.simple_name || 'No Label'}}\n \n \n
{{ data.status === 'requestable' ? 'Requestable' : 'Bookable'}} {{ data?.room?.space?.availableOccurrences }} out of {{ data?.room?.space?.totalOccurrences }}
\n
\n
\n
\n\n
\n `,\n styleUrls: ['./map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapOverlayComponent implements OnInit {\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n ) {\n }\n public ngOnInit(): void {\n }\n\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.data.room) {\n this.data.parentComponent.roomSelected(this.data.room)\n }\n }\n\n public get is_recurrent () {\n return this.data.parentComponent?.bookingFormData?.value?.is_recurrent || false;\n }\n\n public closeOverlay() {\n this.data.parentComponent?.closeMapOverlayOutlet();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectMapFilteredResults,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-map-search',\n template: `\n
\n
\n \n \n
\n
\n
\n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-search.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n animations: [\n trigger('expandHeight', [\n state(\n 'open',\n style({\n height: '470px',\n })\n ),\n state(\n 'closed',\n style({\n height: 'calc(100vh - 270px)',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class MapSearchComponent extends BaseDirective implements OnInit {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n // public resultSpaces = new BehaviorSubject>(\n // LoadingModel.empty()\n // );\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n public floorData: any;\n public floorDataParam: any;\n @Output() toggleEvent = new EventEmitter();\n\n //to capture state for toggling expandHeight animation\n public isOpen = true;\n resultsLoading: any;\n\n propagateToggle() {\n this.toggleEvent.emit();\n this.isOpen = !this.isOpen;\n }\n \n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private location: Location,\n private route: ActivatedRoute\n ) {\n super();\n this.floorData = location.getState();\n }\n\n public ngOnInit(): void {\n // this.resultsLoading = this.resultSpaces.pipe(map((m) => m.isLoading));\n \n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => { \n this.resultsLoading = r.isLoading;\n return r.success;})\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) => !!s.map_id && s.zones.includes(building.id)\n );\n this.resultSpaces.next(spacesFromSelection);\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n status !== 'in-use' ? \n () => {\n this.activeSpace.next(space);\n this.focusOnRoom(status);\n } \n : ()=> {}\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n })\n );\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(buildings);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n \n if(this.activeLevel.value){\n this.floorDataParam = {\n display: this.activeLevel.value.name,\n value: this.activeLevel.value.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n \n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n this.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(form) ));\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.bookingFormData.next(next);\n }\n })\n );\n\n if (this.floorData?.payload) {\n this.floorDataParam = {\n display: this.floorData?.payload.name,\n value: this.floorData?.payload.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n }\n\n public refreshFloorNumber(): void {\n this.activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n // this.focusedMapSpace.next(undefined);\n }\n\n public closeMapOverlayOutlet = () => {\n this.focusedMapSpace.next(undefined)\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n };\n \n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n\t\t\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(this.bookingFormData.value) ));\n this.activeLevel.next(next);\n\n /**\n * update mapUrl as per active level on change of filter search\n */\n this.mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''))\n });\n }\n\n public selectActiveSpace(selection: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom(status?:string) {\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n this.focusedRoom.next(focusedRoom[0]);\n this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this, status));\n this.zoom.next(MAX_ZOOM_LEVEL);\n },\n delay\n );\n });\n }\n\n public roomSelected(room: RoomResultsViewModel) {\n\n\n const { is_recurrent } = this.bookingFormData.value;\n this.bookingFormData.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.bookingFormData.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\n // Handle timezone offset for accurate date and time information\n let { dateTz } = this.bookingFormData.value;\n // if (this.offset) {\n dateTz = dateTz.addValue({ minutes: 0 });\n // }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.bookingFormData.value.booking.room is not and does not contain the timezone\n * this.bookingFormData.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.bookingFormData.value,\n // buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: 0,\n selectedRoom: room\n }\n }});\n\n\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n // this.router.navigate(['room'], { relativeTo: this.route });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MapSearchComponent } from './map-search/map-search.component';\nimport { MapControlsComponent } from './map-controls/map-controls.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MapFiltersComponent } from './map-filters/map-filters.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { OfficeInformationModalComponent } from './office-information-modal/office-information-modal.component';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapOverlayComponent } from './map-overlay/map-overlay.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n NgxSkeletonLoaderModule\n];\n\nexport const mapModuleDeclarations = [\n MapSearchComponent,\n MapControlsComponent,\n MapFiltersComponent,\n OfficeInformationModalComponent,\n MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class MapModule {\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { MapOverlayComponent } from 'src/app/map/map-overlay/map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 0.99\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any, status?: string): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room,\n status:status\n }\n});","import {\n Component,\n Inject,\n ViewEncapsulation\n} from '@angular/core';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { \n BookingRuleDetails,\n Building,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n defaultMapBookingRules,\n defaultMapBookingSubtitle\n} from 'src/app/map/map.utils';\n\n@Component({\n selector: 'app-office-information-modal',\n template: `\n \n
\n
Booking in {{building?.name}}
\n
{{targetLinks(info)}}
\n
\n
\n
    \n \n
\n
\n
\n {{group.title}}\n
    \n \n
\n
\n
\n When booking from maps:\n
    \n \n
\n \n

\n For more info email: {{contact}}\n

\n

\n
\n
\n
\n \n
\n
\n `,\n styleUrls: ['./office-information-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OfficeInformationModalComponent {\n constructor(@Inject(MAT_DIALOG_DATA) public building: Building,\n private dialogRef: MatDialogRef) {\n }\n\n\n /** Booking rule details */\n public get rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.rules || [] as any;\n }\n\n /** Booking rule details */\n public get info(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.info || defaultMapBookingSubtitle;\n }\n\n public get customHtml(): string | undefined {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.custom_html;\n }\n\n /** Booking map rule details */\n public get map_rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.map_rules || defaultMapBookingRules as any;\n }\n\n /** Other special booking rules */\n public get other_rules(): { title: string, rules: string[] }[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n const rules: HashMap = (details as any)?.other_rules || {};\n return Object.keys(rules).reduce((a, v) => {\n \n a.push({ title: v, rules: rules[v] || [] });\n return a;\n }, []);\n }\n\n public get contact(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.contact || '';\n }\n\n public get link(): { url?: string, name?: string } {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.link || {};\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public targetLinks(info: string) {\n const regex = /[] = [\n BaseDirective,\n LoginComponent,\n TopbarHeaderComponent,\n ResponsiveInlineImagesComponent,\n OverlayMenuComponent,\n FooterMenuComponent,\n MapControlsComponent\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\nconst CDK_MODULES: any[] = [\n ScrollingModule,\n DragDropModule,\n CdkTableModule\n];\n\n\n@NgModule({\n declarations: [\n ...COMPONENTS\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n RouterModule,\n EditorModule,\n ComposerModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n IvyCarouselModule,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ],\n exports: [\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n ...COMPONENTS,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ]\n})\nexport class SharedContentModule {\n}\n","import { Component, OnInit } from '@angular/core';\nimport { filter, first, map, distinctUntilChanged, shareReplay } from 'rxjs/operators';\nimport {\n ApplicationLoadingState,\n BaseDirective,\n closestToTimeSlot,\n closestToTimeSlotTz,\n LoadingState,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationIcon,\n ApplicationService,\n Building,\n BuildingCity,\n defaultRoomSizeOption,\n DEFAULT_BOOKING_DURATION,\n flattenDisplayOffices,\n internalBookingTypeOption,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n mapResultsToViewModels,\n OrganisationService,\n SpacesService,\n storeBookingFormData,\n availabilityOptionsToQuery,\n bookingTypeOptions,\n selectFilteredDiffSizeResults,\n flattenBuildingsWithLevels,\n clearRoomFilters,\n allBookingTypeOption,\n roomSizeOptions,\n roomSizeOptionsKiosk,\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport { select, Store } from '@ngrx/store';\nimport { loadUser, selectHasUserData, UserStoreState } from '@mckinsey-converge/user';\nimport { ComposerService } from '@placeos/composer';\nimport { ActivatedRoute, Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\n\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n} from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n buildingStateSelector,\n loadBuildings,\n selectBuildingOptionsGroupedByCity,\n} from '@mckinsey-converge/buildings';\nimport { loadDiffSizeResults, loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { timeStamp } from 'console';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\n\n@Component({\n selector: 'app-shell-wrapper',\n templateUrl: './shell.component.html',\n styleUrls: ['./shell.component.scss'],\n})\nexport class ShellWrapperComponent extends BaseDirective implements OnInit {\n /** Loading state of the application */\n public loading_state: ApplicationLoadingState;\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n\n private userLoading = new BehaviorSubject(true);\n public isQRCode = new BehaviorSubject(true);\n public buildingOptions = new BehaviorSubject[]>([]);\n public zone_id: any;\n public floor: any;\n\n constructor(\n private _service: ApplicationService,\n private placeOs: ComposerService,\n private _org: OrganisationService,\n private activatedRoute: ActivatedRoute,\n private _spaces: SpacesService,\n private router: Router,\n private store: Store\n ) {\n super();\n\n // Initialize roomID\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n // roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n\n // Initialize zoneID\n let zone_id = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('zone_id')) {\n zone_id = this.activatedRoute.snapshot.queryParamMap.get('zone_id');\n } else if (\n localStorage.oauth_redirect &&\n localStorage.oauth_redirect.includes('?zone_id=')\n ) {\n zone_id = localStorage.oauth_redirect.split('=')[1];\n if (zone_id.includes('&')) {\n zone_id = zone_id.split('&')[0];\n }\n }\n\n this.zone_id = zone_id;\n\n // Initialize floor number\n let floor = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('floor')) {\n floor = this.activatedRoute.snapshot.queryParamMap.get('floor');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('&floor=')) {\n floor = localStorage.oauth_redirect.split('&floor=')[1];\n }\n this.floor = floor;\n (floor && zone_id) || roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n }\n\n /** Whether the user needs to login */\n public get show_login(): Observable {\n return this.userLoading;\n }\n\n /** Whether a module is still loading data */\n public get is_loading(): Observable {\n return this.userLoading;\n }\n\n /** List of modules with a loading state */\n public get loading_state_list(): LoadingState[] {\n const list: LoadingState[] = [];\n for (const mod in this.loading_state) {\n if (this.loading_state[mod]) {\n list.push(this.loading_state[mod]);\n }\n }\n return list;\n }\n\n /**\n * Function: To check and fetch room details if available for the scanned roomId\n * @param buildings\n * @param roomId\n */\n public checkRoomId(buildings: Building[], roomId: string) {\n let formGroup = {\n location: [],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: true }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType: bookingTypeOptions[0],\n roomSize: defaultRoomSizeOption,\n selectedRoom: null,\n timezone: null,\n buildings: buildings,\n };\n\n const params = {\n room_ids: roomId,\n };\n\n const availibityParams = {\n room_ids: roomId,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n hide_declined: true,\n };\n const query = availabilityOptionsToQuery(availibityParams);\n this._spaces.queryRooms(query).subscribe(\n (res) => {\n //Convert raw data into API object\n const list = res.map((i) => this._spaces.process(i));\n this._spaces.setSpaceList(list);\n /**\n * Building form data to resue to navigate to result page if room is not available!\n */\n const bookingRoom = mapResultsToViewModels(\n list,\n list[0].building.levels,\n buildings\n );\n const city = list[0].building.city;\n const timezone = list[0].timezone;\n const grouped_by_city = {\n key: { name: city, timezone },\n value: buildings?.filter((bld) => bld.city === city) || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [mapCityToAllSelectOption(grouped_by_city.key), ...city_buildings];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === list[0].building.id\n )[0];\n const buildingTimezone = list[0].timezone;\n // form group data\n formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({ date: Date.now(), is_local_tz: false }),\n 15\n ).toZone(buildingTimezone),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType:\n list[0].internal_or_external === 'internal'\n ? bookingTypeOptions[0]\n : bookingTypeOptions[1],\n roomSize: defaultRoomSizeOption,\n selectedRoom: bookingRoom[0],\n timezone: buildingTimezone,\n buildings: buildings,\n };\n\n this.store.dispatch(\n storeBookingFormData({\n payload: formGroup,\n })\n );\n this.router.navigate([`../home/results/room`], {\n state: { payload: { ...formGroup, offset: 0 } },\n });\n localStorage.oauth_redirect = localStorage.oauth_redirect.split('?')[0];\n this.isQRCode.next(true);\n },\n (error) => {\n // console.log(error);\n this.isQRCode.next(true);\n // this.router.navigate([`home/`]); // to navigate to default route if room dont exists\n /**\n * Navigate to room result page if no room/id exist in the db/ removed from the db in future -\n */\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n this.router.navigate([`../home/results`], {\n state: { payload: { ...formGroup, offset: 0 } },\n queryParams: { display: 'list' },\n });\n }\n );\n }\n\n public ngOnInit(): void {\n // when qr code lands on a url for the second time, reload it (to compensate for different browser/device combination default behaviors)\n this.subscription(\n 'navigationEventShell',\n this.router.events\n .pipe(filter((event) => event instanceof NavigationStart))\n .subscribe((event: NavigationEvent) => {\n if (event instanceof NavigationStart) {\n if (\n event.navigationTrigger === 'popstate' &&\n (event.url.includes('home?zone_id=') || event.url.includes('home?id='))\n ) {\n this.userLoading.next(true);\n window.location.reload();\n }\n }\n })\n );\n\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n\n if (roomId) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n this.checkRoomId(bld_list, roomId);\n })\n );\n }\n\n if (this.zone_id && this.floor) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n const building = bld_list.filter((el) => el.id === this.zone_id);\n\n const city = building[0].city;\n const timezone = building[0].timezone;\n\n const grouped_by_city = {\n key: { name: city, timezone },\n value: building || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings,\n ];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === building[0].id\n )[0];\n const buildingTimezone = building[0].timezone;\n // form group data\n const addMin = DateTime.now().get('minute') % 5 === 0 ? 1 : 0;\n const formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(\n DateTime.now().plus({ minutes: addMin }),\n 15\n ).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n bookingType: allBookingTypeOption, // all rooms (including internal and external both)\n roomSize: roomSizeOptionsKiosk[3],\n selectedRoom: null,\n timezone: buildingTimezone,\n buildings: bld_list,\n };\n\n const query2 = {\n // capacity: 3,\n locations: this.zone_id,\n // capacity_max: 9,\n // diff_capacity: true,\n hide_declined: true,\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n };\n\n //clear search filters first if any applied previously\n this.store.dispatch(clearRoomFilters());\n\n this.store.dispatch(loadRoomsForResults.clear());\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n this.store.dispatch(loadRoomsForResults.request(query2));\n localStorage.oauth_redirect = '';\n // To do: navigate to floor-map route\n this.router.navigate([`../home/results`], {\n state: {\n payload: this.floor,\n building: building,\n floorMap: true,\n url: window.location.href,\n },\n queryParams: { display: '' },\n });\n this.isQRCode.next(true);\n })\n );\n }\n\n this.subscription(\n 'loading',\n this._service.listen('loading').subscribe((loading) => {\n this.loading_state = loading;\n })\n );\n\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n\n /**\n * Load current user into redux. this is meant to remove old way of loading user from user's service.\n */\n this.subscription(\n 'currentUser',\n combineLatest([\n this.store.pipe(select(selectHasUserData)),\n this.placeOs.initialised,\n this.isQRCode, // added to track room details if QR code used to open app\n ])\n .pipe(\n filter(([_, initialized, isQRCodeScanedAndReady]) => {\n console.log(_);\n return initialized && isQRCodeScanedAndReady;\n })\n )\n .subscribe(([next]) => {\n this.userLoading.next(!next);\n if (!next) {\n this.store.dispatch(loadUser.request());\n }\n })\n );\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
Converge is loading
\n
\n
\n
\n","export enum Urls {\n LearnMore = 'https://our-firm.intranet.mckinsey.com/covid-portal/travel',\n Feedback = 'mailto:converge_feedback@mckinsey.com?subject=Feedback for page: ',\n Help = 'https://mckinsey.service-now.com/ghd?id=topic_simple&topic_id=54e8eb091bea3d1831b17449cd4bcbed',\n OfficeContacts = 'https://our-firm.intranet.mckinsey.com/ourfirm/geographies',\n}\n\nexport const generateFeedbackUrl = (page: string) => {\n return `${Urls.Feedback}${page}`;\n};\n","import { EnvironmentData } from '@mckinsey-converge/environment';\n\nexport const environment: EnvironmentData = {\n production: true,\n hmr: false,\n heap_io_id: 91016686,\n};\n","import { SettingsData } from '@mckinsey-converge/data-common';\n\n;\n/**\n * GENERAL APPLICATION SETTINGS\n */\nconst general = {\n menu: {\n items: [],\n copyright: 'McKinsey & Company',\n position: 'left'\n }\n};\n\n/**\n * HOME PAGE SETTINGS\n */\nconst home = {\n background: 'assets/img/skyline.jpg',\n tiles: [\n {\n name: 'Book',\n route: '/book/spaces',\n icon: {\n type: 'icon',\n class: 'custom-book'\n }\n },\n {\n name: 'Maps',\n route: '/explore/space',\n icon: {\n type: 'icon',\n class: 'custom-spaces'\n }\n },\n {\n name: 'My Day',\n route: '/schedule',\n icon: {\n type: 'icon',\n class: 'custom-schedule'\n }\n }\n ]\n};\n/**\n * HELP/SUPPORT SETTINGS\n */\nconst help = {\n tiles: [],\n columns: 2\n};\n/**\n * BOOKING FLOW SETTINGS\n */\nconst booking = {\n booking_types: [\n { name: 'Internal', id: 'internal' },\n { name: 'External', id: 'external' },\n ],\n show_fields: [\n 'attendees',\n 'body',\n 'catering',\n 'dateTz',\n 'duration',\n 'organiser',\n 'title',\n 'type',\n 'all_day',\n 'needs_space',\n 'has_catering'\n ],\n html_body: false,\n multiple_spaces: true,\n desk_start: 9\n};\n/*===========================*\\\n|| SPACE LISTING SETTINGS ||\n\\*===========================*/\nconst space_display = {\n show_images: false\n};\n/*===========================*\\\n|| USER DIRECTORY SETTINGS ||\n\\*===========================*/\nconst directory = {\n show_avatars: true,\n min_search_length: 3\n};\n/*===========================*\\\n|| EXPLORE MAP SETTINGS ||\n\\*===========================*/\nconst explore = {\n colors: {\n 'space-available': '#43a047',\n 'space-requestable': '#ffb300',\n 'space-unavailable': '#e53935',\n 'space-in-use': '#d4483e',\n 'space-not-bookable': '#ccc',\n 'desk-available': '#43a047',\n 'desk-available-stroke': '#1b5e20',\n 'desk-unavailable': '#e53935',\n 'desk-unavailable-stroke': '#b71c1c',\n 'desk-reserved': '#ffb300',\n 'desk-reserved-stroke': '#ff6f00',\n 'desk-not-bookable': '#fff',\n 'desk-not-bookable-stroke': '#ccc',\n 'zone-low': '#43a047',\n 'zone-medium': '#ffb300',\n 'zone-high': '#e53935'\n },\n can_select_building: true,\n show_legend_group_names: false,\n show_timeline: true,\n legend: {\n General: [\n { key: 'space-available', name: 'Available' },\n { key: 'space-requestable', name: 'Available by request' },\n { key: 'space-unavailable', name: 'In use' },\n { key: 'space-not-bookable', name: 'Not Bookable' }\n ]\n }\n};\n\n/*=========================*\\\n|| DAY VIEW SETTINGS ||\n\\*=========================*/\nconst day_view = {\n dragdrop: false,\n};\n\n\n/**\n * ROOT APPLICATION SETTINGS\n */\nconst app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n },\n general,\n home,\n help,\n booking,\n space_display,\n directory,\n explore,\n day_view\n}\n\n\n/**\n * ROOT SETTIGNS\n */\nexport const DEFAULT_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/staff',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app,\n mock: false,\n frontend: 'staff',\n};\n","import { ApplicationRef, NgModuleRef } from '@angular/core';\nimport { createNewHosts } from '@angularclass/hmr';\n\nexport const hmrBootstrap = (\n module: any,\n bootstrap: () => Promise>,\n) => {\n let ngModule: NgModuleRef;\n module.hot.accept();\n bootstrap().then(mod => (ngModule = mod));\n module.hot.dispose(() => {\n const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef);\n const elements = appRef.components.map(c => c.location.nativeElement);\n const makeVisible = createNewHosts(elements);\n ngModule.destroy();\n makeVisible();\n });\n};\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\nimport { environment } from './environments/environment';\nimport { hmrBootstrap } from './hmr';\nimport { AppModule } from './app/app.module';\n\nif (environment.production) {\n enableProdMode();\n}\n\nconst bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);\n\n// comes from https://medium.com/wizardnet972/hot-module-replacement-with-angular-cli-5fc7a3ae4a9c\nif (environment.hmr) {\n if ((module as any).hot) {\n hmrBootstrap(module, bootstrap);\n } else {\n console.error('HMR is not enabled for webpack-dev-server!');\n console.log('Are you using the --hmr flag for ng serve?');\n }\n} else {\n bootstrap().catch(err => console.log(err));\n}\n"],"sourceRoot":"webpack:///"} \ No newline at end of file diff --git a/staff/main-es5.js b/staff/main-es5.js index 064154971..e792e0699 100644 --- a/staff/main-es5.js +++ b/staff/main-es5.js @@ -18343,15 +18343,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons exports.VERSION = { "dirty": false, - "raw": "9bc1456e2", - "hash": "9bc1456e2", + "raw": "a592d101a", + "hash": "a592d101a", "distance": null, "tag": null, "semver": null, - "suffix": "9bc1456e2", + "suffix": "a592d101a", "semverString": null, "version": "0.0.0", - "time": 1734038699575 + "time": 1734294095956 }; /* tslint:enable */ diff --git a/staff/main-es5.js.map b/staff/main-es5.js.map index e9933a90d..40b784124 100644 --- a/staff/main-es5.js.map +++ b/staff/main-es5.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/lib/angular-animations.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/lib/animations.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/cdk-drop-list-scroll-container.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/date.spec-helpers.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/date.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/general.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/image.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/numbers-only.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/replace.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/api.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/app.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/base-api.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/base.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking-filter.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.data.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.spec-helpers.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.selectors.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/room-results/room-results.viewmodel.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking-state.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.types.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/bookings.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/bookingsPaginated.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/space.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-categories.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-category.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-item.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-items.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-menu.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-notes.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-order.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/close-modal-dialog-service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/collapse-accordion-service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/data-common.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/hotkeys.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/location.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/location.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/building.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/level.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/organisation.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/organisation.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/paginated.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/recurrence/recurrence.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/report.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/reports.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/service-manager.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/settings.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/space.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/space.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/spaces.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spec-helpers.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/user.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/user.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/users.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/validation.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/date-tz/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/date-tz/src/lib/date-tz.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/environment.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/environment.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/version.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-confirm/booking-confirm.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-confirm/booking-confirm.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-form/booking-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-form/booking-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-confirm-modal/catering-confirm-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-confirm-modal/catering-confirm-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-details-modal/catering-details-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-details-modal/catering-details-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/confirm-modal/confirm-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/confirm-modal/confirm-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/legacy-overlays.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/new-user-modal/new-user-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/new-user-modal/new-user-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/no-catering-modal/no-catering-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/no-catering-modal/no-catering-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/requirement-details-modal/requirement-details-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/requirement-details-modal/requirement-details-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/space-select-modal/space-select-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/space-select-modal/space-select-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/user-form/user-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/user-form/user-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/action-icon/action-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/action-icon/action-icon.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/item/item.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/item/item.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/package-options-modal/package-options-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/package-options-modal/package-options-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/hover-class.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/action-field/action-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/action-field/action-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/counter/counter.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/counter/counter.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/date-field/date-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/date-field/date-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/duration-field/duration-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/duration-field/duration-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/time-field/time-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/time-field/time-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-list-field/user-list-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-list-field/user-list-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-search-field/user-search-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-search-field/user-search-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/feedback/feedback.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/feedback/feedback.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/icon/icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/icon/icon.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/legacy-ui.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/popout-menu/popout-menu.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/popout-menu/popout-menu.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/searchbar/searchbar.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/searchbar/searchbar.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/user-avatar/user-avatar.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/user-avatar/user-avatar.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.model.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.selectors.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/testing/effects.testing.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/testing/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.types.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/loading-model.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/operators.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/rx-utils.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/aca-date-picker/aca-date-picker.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/aca-date-picker/aca-date-picker.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/alert-banner/alert-banner.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-chip-select-item/auto-complete-chip-select-item.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-chip-select-item/groupHeader.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-select-option/auto-complete-select-option.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-select-option/auto-complete-select-option.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/base-template.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select-options.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select-options.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/dropdown-trigger-for.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/collapse-header/collapse-header.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflict-alert-modal/conflict-alert-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflict-alert-modal/conflict-alert-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflicts-modal/conflicts-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflicts-modal/conflicts-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-calendar-widget/date-tz-calendar-widget.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-calendar-widget/date-tz-calendar-widget.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-date-picker/date-tz-date-picker.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-duration-field/date-tz-duration-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-time-field/date-tz-time-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/duration-field/duration-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/error-message/error-message.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/calendar/calendar-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/calendar/chevron-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/close/close-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/informational-image/informational-image.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/label/label.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/legend-dropdown/legend-dropdown.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/mck-date-picker/mck-date-picker.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/modal-button-row/modal-button-row.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/modal/modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/override-changes-modal/override-changes-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/override-changes-modal/override-changes-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/pipes/filter.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/pipes/sanitise.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/radio-select/radio-select.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-booking-form/recurrence-booking-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-booking-form/recurrence-booking-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-date-form/recurrence-date-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-date-form/recurrence-date-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-pattern-form/recurrence-pattern-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-pattern-form/recurrence-pattern-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select-option/select-option.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select/select.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select/select.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/selected-chip-count/selected-chip-count.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/spacer/spacer.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/switch-group/switch-group.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/time-field/time-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/toggle/toggle.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.enums.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/types.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/ui.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/utils/time.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.reducer.ts","webpack:///$_lazy_route_resource lazy namespace object","webpack:///src/app/app-routing.module.ts","webpack:///src/app/app.component.ts","webpack:///src/app/app.component.html","webpack:///src/app/app.module.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-date-widget/calendar-date-widget.component.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-date-widget/calendar-date-widget.component.html","webpack:///src/app/booking/booking-calendar/booking-calendar-routing.module.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-wrapper.component.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-wrapper.html","webpack:///src/app/booking/booking-calendar/booking-calendar.module.ts","webpack:///src/app/booking/booking-calendar/cng-menu-item/cng-menu-item.component.ts","webpack:///src/app/booking/booking-calendar/cng-menu-item/cng-menu-item.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/space/event/event.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/space/event/event.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/space/space.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/space/space.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/staff-calendar.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/staff-calendar.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/timeline/timeline.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/timeline/timeline.component.html","webpack:///src/app/booking/booking-confirmation/booking-confirmation.component.ts","webpack:///src/app/booking/booking-create/booking-create.component.ts","webpack:///src/app/booking/booking-create/booking-form-base.component.html","webpack:///src/app/booking/booking-create/booking-edit-wrapper.component.ts","webpack:///src/app/booking/booking-create/booking-edit.component.ts","webpack:///src/app/booking/booking-create/booking-form-base.component.ts","webpack:///src/app/booking/booking-details-modal/booking-details-modal.component.ts","webpack:///src/app/booking/booking-details-modal/booking-details-modal.component.html","webpack:///src/app/booking/booking-duration-modal/booking-duration-modal.component.ts","webpack:///src/app/booking/booking-result-item/booking-result-item.component.ts","webpack:///src/app/booking/booking-result-item/booking-result-item.component.html","webpack:///src/app/booking/booking-routing.module.ts","webpack:///src/app/booking/booking.form.reducer.ts","webpack:///src/app/booking/booking.module.ts","webpack:///src/app/booking/bookings-listing/bookings-listing.component.ts","webpack:///src/app/booking/bookings-listing/bookings-listing.component.html","webpack:///src/app/booking/cancel-booking-modal/cancel-booking-modal.component.ts","webpack:///src/app/booking/catering/catering.component.ts","webpack:///src/app/booking/catering/catering.component.html","webpack:///src/app/booking/catering/order-details/category/category.component.ts","webpack:///src/app/booking/catering/order-details/category/category.component.html","webpack:///src/app/booking/catering/order-details/order-details.component.ts","webpack:///src/app/booking/catering/order-details/order-details.component.html","webpack:///src/app/booking/catering/order-list/item/item.component.ts","webpack:///src/app/booking/catering/order-list/item/item.component.html","webpack:///src/app/booking/catering/order-list/order-list.component.ts","webpack:///src/app/booking/catering/order-list/order-list.component.html","webpack:///src/app/booking/catering/order-table/order-table.component.ts","webpack:///src/app/booking/manage-bookings/manage-bookings.component.ts","webpack:///src/app/booking/manage-bookings/manage-bookings.viewmodel.ts","webpack:///src/app/booking/office-floor/floor-map-overlay/floor-map-overlay.component.ts","webpack:///src/app/booking/office-floor/floor-map.utils.ts","webpack:///src/app/booking/office-floor/office-floor-map.module.ts","webpack:///src/app/booking/office-floor/office-floor/office-floor.component.ts","webpack:///src/app/booking/office-floor/office-floor/office-floor.component.html","webpack:///src/app/booking/results-header/results-header.component.ts","webpack:///src/app/booking/room-availability-preview-modal/room-availability-preview-modal.component.ts","webpack:///src/app/booking/room-availability-preview/room-availability-preview.component.ts","webpack:///src/app/booking/room-availability-preview/room-availability-preview.component.html","webpack:///src/app/booking/room-booking-details-form/room-booking-details-form.component.ts","webpack:///src/app/booking/room-booking-details-form/room-booking-details-form.component.html","webpack:///src/app/booking/room-booking-form/room-booking-form.component.ts","webpack:///src/app/booking/room-booking-form/room-booking-form.component.html","webpack:///src/app/booking/room-booking-modal/room-booking-modal.component.ts","webpack:///src/app/booking/room-booking/room-booking.component.ts","webpack:///src/app/booking/room-details/room-details.component.ts","webpack:///src/app/booking/room-details/room-details.component.html","webpack:///src/app/booking/room-filters-form/room-filters-form.component.ts","webpack:///src/app/booking/room-filters-modal/room-filters-modal.component.ts","webpack:///src/app/booking/room-location-preview/room-location-preview.component.ts","webpack:///src/app/booking/room-result-item/room-result-item.component.ts","webpack:///src/app/booking/room-results-paginated/room-results-paginated.component.ts","webpack:///src/app/booking/room-results-section/room-results-section.component.ts","webpack:///src/app/booking/room-results/room-results-coachmark.viewmodel.ts","webpack:///src/app/booking/room-results/room-results.component.ts","webpack:///src/app/booking/searched-location/searched-location.component.ts","webpack:///src/app/components/footer-menu/footer-menu.component.ts","webpack:///src/app/components/footer-menu/footer-menu.component.html","webpack:///src/app/components/map-controls/map-controls.component.ts","webpack:///src/app/components/map-controls/map-controls.component.html","webpack:///src/app/components/overlay-menu/overlay-menu.component.ts","webpack:///src/app/components/overlay-menu/overlay-menu.component.html","webpack:///src/app/components/responsive-inline-images/responsive-inline-images.component.ts","webpack:///src/app/components/survey-modal/survey-modal.component.ts","webpack:///src/app/components/survey-modal/survey-modal.component.html","webpack:///src/app/components/topbar-header/topbar-header.component.ts","webpack:///src/app/login/login.component.ts","webpack:///src/app/login/login.component.html","webpack:///src/app/map/map-controls/map-controls.component.ts","webpack:///src/app/map/map-filters/map-filters.component.ts","webpack:///src/app/map/map-overlay/map-overlay.component.ts","webpack:///src/app/map/map-search/map-search.component.ts","webpack:///src/app/map/map.module.ts","webpack:///src/app/map/map.utils.ts","webpack:///src/app/map/office-information-modal/office-information-modal.component.ts","webpack:///src/app/shared/shared.module.ts","webpack:///src/app/shell/shell.component.ts","webpack:///src/app/shell/shell.component.html","webpack:///src/app/utilities/urls.ts","webpack:///src/environments/environment.ts","webpack:///src/environments/settings.ts","webpack:///src/hmr.ts","webpack:///src/main.ts"],"names":["ANIMATION_SHOW_ENTER_LEAVE","trigger","transition","style","opacity","height","animate","ANIMATION_SHOW_CONTRACT_EXPAND","state","AnimationsModule","CommonModule","NgModule","imports","BaseClass","_timers","_intervals","_subscriptions","_initialised","BehaviorSubject","key","hasOwnProperty","clearTimeout","clearInterval","unsub","name","fn","delay","Function","setTimeout","Error","setInterval","Subscription","unsubscribe","getValue","BaseDirective","destroy","Directive","selector","BaseModule","NumbersOnlyDirective","declarations","exports","ScrollDirection","CdkDropListScrollContainer","_cdkDropList","_renderer","direction","X","last_scroll","x","y","changes","scrollContainer","element","nativeElement","closest","subscription","items","subscribe","list","toArray","forEach","i","index","listen","onDrop","onDrag","updateListPosition","timeout","scroll","scrollLeft","scrollTop","BOTH","Y","_dropListRef","_cacheOwnPosition","_siblings","isReceiving","CdkDrag","Input","ContentChildren","initialTime","mockDate","timeOverride","set","Date","resetDate","reset","closestToTimeSlot","date","stepMinute","start","millisecond","second","minute","Math","ceil","plus","minutes","closestToTimeSlotTz","dateTz","setValue","addValue","durationHumanized","duration","short","h","floor","d","m","weekDayMonthYearFormat","formatDate","extractDateFromInput","input","checkHour","startDate","dayjs","dayJsTimeFormatString","isValid","cleanedInput","times","split","undefined","length","dayJsHoursMinutes","month","year","hour","nearestStepToInput","step","currentStartDate","luxonDate","DateTime","fromMillis","valueOf","closestDate","toFormat","nearestDurationToInput","durationGroups","value","parseInt","indexOf","add","diff","closestDurationGroup","find","max","offset","reduce","previousValue","currentValue","resetSecondsOnTimestamp","timestamp","toMillis","formatDateWithSuffix","dateObj","day","getDate","toLocaleString","getFullYear","nthNumber","number","getListOfDateFormat","extend","utc","timezone","isToday","weekday","customParseFormat","log","type","msg","args","stream","force","app_name","window","debug","colors","console","getItemWithKeys","keys","map","slice","isMobileDevice","r","navigator","userAgent","match","isMobileSafari","agent","isAndroidChrome","padZero","str","toString","unique","array","filter","el","pos","arr","humaniseDuration","durationInput","size","singular","format","hours","filterList","fields","results","filters","toLowerCase","f","parts","push","word","count","regex","RegExp","sort","a","b","localeCompare","item_list","JSON","parse","stringify","item","match_count","match_index","field_list","matched","field","matches","replace","changed","tokens","k","join","matchToHighlight","timeToDate","time","DateNow","startOfValue","ms","randomInt","random","timeFormatString","is24HourTime","hoursMinutes","timezoneNameToDate","timeZoneName","zone","toZone","e","timezoneDisplay","gmtOffsetDisplay","timeWithZoneFormatString","toLocaleLowerCase","timeWithGmtOffsetFormatString","startEndTimeFormatString","startDateTz","endDateTz","startEndTimeWithZoneFormatString","dateLocalFormatString","comma","formatLocalDate","dateBuildingFormatString","shorterLocalDateFormatString","shorterBuildingDateFormatString","localeString","toLocaleTimeString","document","querySelector","getAttribute","language","downloadFile","filename","contents","createElement","setAttribute","encodeURIComponent","display","body","appendChild","click","removeChild","csvToJson","csv","lines","splice","v","line","part","jsonToCsv","json","Array","Object","valid_keys","detectIE","ua","msie","substring","trident","rv","edge","eventToPoint","event","MouseEvent","clientX","clientY","touches","flatten","an_array","stack","res","next","pop","isArray","reverse","seed","xmur3","rand","sfc32","predictableRandomInt","imul","charCodeAt","c","t","isLessThanBreakpoint","breakpoint","innerWidth","toTitleCase","toUpperCase","ImageDirective","_el","initalValue","stopPropagation","HostListener","ReplacePipe","from","to","Pipe","bookingStateSelector","bookings","loadBookingsWithQuery","createAction","props","loadHomepageBookingsResults","createLoadingAction","loadUpcomingBookingsResults","loadPastBookingsResults","loadCancelledBookingsResults","loadBookingByIdResults","clearBookingByIdResults","BookingsEffects","actions","bookingService","afterBookingsRequestResultsLoadOthersEffect","pipe","ofType","mergeMap","action","DateTZ","yourBookingsRequest","email","pagination","limit","show_cancelled","end_epoch","subtractValue","seconds","include_rooms","upcomingRequest","pastRequest","start_epoch","cancelledRequest","byIdRequest","id","effects","target","request","loadHomepageBookingsResultsEffect","createLoadingEffect","userBookings","loadUpcomingBookingsResultsEffect","loadPastBookingsResultsEffect","loadCancelledBookingsResultsEffect","loadBookingByIdResultsEffect","Effect","Injectable","BookingsModule","EffectsModule","forFeature","StoreModule","bookingsReducer","initialBookingsState","query","LoadingModel","empty","homepage","upcoming","past","cancelled","bookingById","createReducer","on","ons","initialBookingFormState","activeFormFilters","bookingFormReducer","storeBookingFormData","activeForm","payload","clearBookingFormData","openBookingSurvey","bookingCompleted","storeRoomFilters","clearRoomFilters","mapBookingToSelectOption","booking","loadBuildings","buildingStateSelector","buildings","selectLoadBuildingsSuccess","createSelector","selectors","optionalSuccess","selectBuildingOptionsGroupedByCity","success","mapped","Map","s","found","city","get","selectLevelByZoneId","param","levels","l","BuildingsEffects","organizationService","loadBuildingsWithOrg","loadBuildingsAfterOrg","loadOrganisations","BuildingsModule","buildingsReducer","initialBuildingState","data","toQueryString","ApplicationService","store","analytics","_app_ref","_zone","_title","_settings","_hotkeys","_composer","_snackbar","_environment","snack","_subjects","_observers","isStable","first","_","run","waitForSettings","message","on_action","icon","content","openSnack","openSnackBar","notify","asObservable","initialised","init","setupComposer","select","selectCurrentUser","user","take","setupAnalytics","fmno","application","loading","composer","settings","protocol","location","host","domain","hostname","port","url","use_domain","origin","route","includes","mock","href","localStorage","getItem","config","scope","auth_uri","token_uri","redirect_uri","handle_login","local_login","setup","heap_io_id","heapIo","app_id","load","identify","frontend","isIt","_kioskFormFilter","title_suffix","setting","setTitle","getTitle","auth","api_endpoint","is_initialised","providedIn","BaseDataClass","raw_data","event_subject","Subject","events","_server_names","zone_id","_service","form","toJSON","Promise","resolve","reject","promise","update","then","metadata","task_name","parameters","task","obj","_changes","new_key","ServiceManager","serviceFor","BaseAPIService","settingsService","_subscribers","_promises","_compare","_list_filter","_name","_api_route","form_data","concierge","err","engine","endpoint","predicate","query_params","cache","result","http","process","processApiResult","catchError","error","of","new_item","post","injectConcierge","analyticsEvent","updateList","method","post_data","_task","put","removeItem","should_inject_concierge","apiSubRoute","token","sessionStorage","access_token","headers","HttpHeaders","requestOptions","q","label","raw_item","old_list","compareFn","new_list","mixed_list","spaceExtraFeatureToDisplayName","feature","SpaceFeatures","VideoConference","ConferencePhone","WirelessContentSharing","FlipChart","Glassboard","ElectronicWhiteboard","ConferenceRoom","TeamRoom","PartnerOffice","PhoneBooth","NaturalLight","BoardRoom","CocktailRoom","TheatreRoom","WorkshopRoom","UShapeRoom","Miscellaneous","Catering","instantBookOption","shortDisplay","instantBookOptions","mapSpaceFeaturesToSelectOption","roomEquipmentRequiredOptions","internalRoomTypeRequiredOptions","externalRoomTypeRequiredOptions","roomDetailsRequired","roomCateringAvailable","SpaceFilterReason","filterSpacesByAppliedFilters","formFilters","spaces","currentUser","isStaffMap","instantBook","some","onlyCatering","featureFilters","formFiltersEmpty","options","rulesCount","ruleReason","excludedByFiltersCount","statusMap","filteredSpaces","space","Space","raw_space","building","zones","rules","rulesForSpace","booking_rules","reason","valid","hide","hasAllFeatures","internalRoomTypeFilters","every","featuresArray","canBook","bookable","matchesType","bookingType","internal_or_external","hasCatering","has_catering","status","statusFromBookings","Booking","auto_approve","group","is_recurrent","availableOccurrences","totalOccurrences","buildingsInSameCity","meta","alternateBuildings","locationItem","specificReason","None","Filters","OfficeRules","AlternateBuildingsFound","DEFAULT_BOOKING_DURATION","internalBookingTypeOption","allBookingTypeOption","bookingTypeOptions","defaultRoomSizeOption","roomSizeOptions","roomSizeOptionsKiosk","roomCapacityToValue","roomSize","roomMaxCapacityToValue","roomFormDataToQuery","filteredLocationIds","groupChild","locations","capacity","capacity_max","is_multiroom","merged","recurrence_period","recurrence_interval","recurrence_endTz","recurrence_count","recurrence_starts","recurrence_exceptions","recurrence_days","ignore","now","defaultTestBookingForm","selectBookingFormsData","bookingForm","selectActiveForm","is_local_tz","building_tz","endTzDate","recEditingSearchPayload","SeriesAction","EDIT","selectBookingType","selectBookingLocations","groupHeader","selectIsInternal","selectFormFilters","selectRoomResultsFromState","roomStateSelector","loadRoomsForResults","model","selectRoomResultsFromState_map","loadRoomsForResultsMap","selectLaterThatDayResultsFromState","loadLaterThatDayResults","selectNextDayResultsFromState","loadNextDayResults","selectByIdResultsFromState","loadByIdResults","selectDiffSizeResultsFromState","loadDiffSizeResults","selectHomepageBookingsResultsFromState","selectUpcomingBookingsResultsFromState","selectPastBookingsResultsFromState","selectCancelledBookingsResultsFromState","selectBookingByIdResultsFromState","filterSpacesByAppliedFiltersIfSuccess","mutate","selectFilteredResults","selectMapFilteredResults","selectFilteredLaterDayResults","selectFilteredNextDayResults","selectFilteredByIdResults","selectFilteredDiffSizeResults","selectSelectedBuildingOptions","MAX_ABBREV_LOCATIONS","mapBuildingToSelectOption","dropdownOverride","code","address","groupId","mapCityToAllSelectOption","flattenDisplayOffices","grouped","toggleSelectedByGroup","selectedOptions","option","toSelect","selected","newGroup","remainingChildrenInGroup","o","ng","truncateLocationList","truncatedLocations","shouldTruncate","mapBuildingLevelToOption","level","flattenBuildingsWithLevels","flattenedLevels","placeholderRoute","num","setupRoomImages","componentReference","image_positions","rootFolderURL","fileSlug","imagesLoaded","foundImages","path","n","desiredImageName","desiredImage","pathname","tester","Image","onload","loadImages","src","bookingStatusDetails","image","text","title","roomHasCateringHours","catering_hours","cateringAllowed","disallowedStatus","opens","closed","end","openMinutes","closeMinutes","startOfDay","cateringOpenTime","cateringCloseTime","checkCollisions","service","availabilityParams","room_ids","breakdown","hide_bookings","recurrence_type","icaluid","available","start_time","end_time","has_conflict","bkn","b_setup","b_breakdown","recurrence_master_id","getStatusErrorMessage","RoomResultsViewModel","levelDisplay","short_name","local_name","office","mapResultsToViewModels","BookingStateService","_org","_spaces","ngZone","_poll","_long_poll","_long_poll_week","_bookings","_noOfMeetings","_filters","_dateTz","_loading","_state","combineLatest","filtered","bdTz","booking_date","startTz","endTz","endOfValue","filterBookings","shareReplay","filtered_week","bd","getEndOfWeek","filtered_month","search","debounceTime","switchMap","fzone","queryBooking","zone_ids","available_from","available_to","search_long_week","querySpace","space_list","processBookings","dailyCount","days","daily_count","buildSpaceLongQuery","counts","details","runOutsideAngular","interval","updateRoomList","new_bookings","concat","undo","attempted_to_delete","bkg","booking_master","period","replaceBookings","room_email","fromTz","toTz","intersects","timePeriodsIntersect","roomSatisfiesConditions","multi_rooms","room","in_zone","has_space","space_emails","in_zones","declined","getType","show","hide_type","dateWeekday","time_changed","SettingsService","is_concierge","nowTz","defaultTitle","defaultLocalTimezone","Intl","DateTimeFormat","resolvedOptions","timeZone","defaultBuildingZone","defaultOrgainiser","User","active_user","defaultBookingType","building_zone","booking_type","attendees","organiser","creator","booked_by","room_setup","room_breakdown","notes","equipment_codes","equipment_code","expected_attendees","headcount","check_ins","notify_users","company","booker","booker_concierge","level_zone","opt_out","outlook_opt_out","multiroom_master_id","room_id","findSpace","roomsData","roomId","newRoom","defaultStartTz","startEpochProvided","startDateTzProvided","round","created_epoch","all_day","show_as","approvalStatus","approval_status","catering","CateringOrder","edited_fields","edits","values","occurrence_edits","recurrence_end","occurrence_ids","occurrence_details","author","isEdit","opts","note","handleRecurrenceFields","recurrence_list","location_name","from_room","approve","old_start","old_end","creation_date","creationDateTz","cateringOrders","allAttendees","checked_in","checkInsArray","has_visitors","occurence","getTime","shift","_recurrence_endTz","byRequest","tentative","isAnyRoomDeclined","delivery_time","getTimezoneOffsetString","abs","dateDiff","displayEndDateTz","external","buildingTzDt","isBeforeDate","isAfterDate","recurrenEndFromOcurrences","mergeCateringOrders","order_list","orders","order","location_id","booking_timezone","BOOKING_STATUS","MINUTE","HOUR","DAY","WEEK","MONTH","DURATION_MAP","months","week","weeks","bookingOptionsToQuery","property","until","getFreeBookingSlots","min_size","dateTzMs","slots","bkn_start","bkn_end","getNextFreeBookingSlot","date_","block","generateBookingForm","use_fields","isConcierge","manualTimezone","user_service","current_user","current","FormControl","disabled","Validators","required","validators","minLength","updateOn","needs_space","is_before_date","setValidators","validateEndTime","disable","dateValidators","isFuture","validDateTZ","updateValueAndValidity","list_length","valueChanges","expected","codes","new_expected","new_codes","space_needed","simplified_fields","handleAllDay","clone","enable","occurrences","RecurrencePeriod","LIST","occurrence","CLONE","BookingAction","start_dateTz","d1","d2","_recurr_end","fields_with_recurrence","WEEKLY","recurrence_pattern","arrayWithValues","FormGroup","control","validDate","isSameDate","JSDate","getMinLength","rule_list","min","min_block","min_length","conditions","stringToMinutes","durationGreaterThanOrEqual","duration_1","duration_2","requestable","free_slots","next_free_slot","currently_free","time_until_next_block","free_tomorrow","free_today","available_until","spaceStatusToDisplay","filter_options","filtered_list","updated_list","start1","end1","start2","end2","formatWhen","startTZ","endTZ","displayEndTZ","isIncludes","searchVaue","searchRoomsAndBookings","allItems","searchValue","relevantItems","filteredItems","duplicateMultiroomEntriesIfAny","updatedBookings","duplicatesCount","duplicatedBooking","cloneDeep","BookingsService","setService","uniqueId","respond","series","toApiJSON","taskObsr","requests","booking_id","forkJoin","BookingsPaginatedService","getHoldingBay","queryHoldingBay","response","PaginatedAPIService","space_rules_for_user","rule_block","checkRules","ruleset","max_length","counter","condition","groups","j","last_location","check","CateringCategoriesService","CateringCategory","is_category","must_select","order_anytime","CateringItem","_amount","instance_id","from_month","to_month","description","prior_notice","notice","unit_price","price","supplier_cost","minimum_quantity","maximum_quantity","parent_categories","category_ids","categories","image_path","admin_only","restricted_from","root_category_restricted_from","catering_type","amount","allergy","cateringItems","filteredCateringItems","out_of_stock","availableItems","substr","expired","anytime","can_order_anytime","CateringItemsService","CateringMenuService","CateringNotesService","cateringNotes","hasBookingAttached","bookingDateTz","charge_code","kitchen","pantry","symbol","total","deliver_date","mergeCateringItemWithFormData","existing","override","CloseDialogService","dialogRefMap","dialogRef","close","DialogIds","CollapseService","collapseSubject","collapse$","DataCommonModule","INVALID_STANDALONE_KEYS","HotkeysService","keydown_states","keydown_observers","combo_end","registered_combos","addEventListener","mapKey","last_down","preventDefault","combo","combination","validCombination","last_key","updateCombinationEndList","presses","key_list","non_meta","MapLocation","map_id","desk_id","normalise","x_max","Organisation","BuildingLevel","levelWithID","fixed","confidence","at_desk","bld","building_id","LocationService","Building","disc_info","discovery_info","extras","extra_id","extra_name","loan_items","_roles","roles","_lockers","lockers","locker_structure","_systems","systems","_phone_numbers","phone_numbers","_location","longitude","latitude","searchables","neighbourhoods","lvl","lvl_features","level_id","booking_details","catering_restricted_from","currency","requires_equipment_code","requires_expected_attendees","holding_bay","visitor_space","sort_order","_data","bld_id","level_name","lower_name","map_url","floor_type","available_buildings","OrganisationService","_users","_spaceTypesSubject","_organisation","ids","bld_list","_active_building","organisation","loadOrganisation","loadLevels","space_types","loadSpaceTypes","tags","org_data","bld_data","lvl_data","type_data","types","getOrganizationFiltersByRoomType","internalSubSet","getRoomTypeSubsetDDOptions","filterOptions","setItem","DaysOfWeek","RepeatsOn","recurrencePeriodToDurationType","DAILY","ABSOLUTE_MONTHLY","generateWeekDays","params","start_week","week_days","activeDate","active","full_name","day_index","getFirstDateFromList","getLastDateFromList","recurrenceDetails","recurr","getPeriod","recurrenceRecurringDetails","removeExpiredOcurrences","controls","tz","date_now","setStartAndEndDateFromArray","dates","setRecurrenceStartsTime","dateHour","Report","cleanData","txt","charAt","UNIX_timestamp","getMonth","getHours","suffix","getMinutes","timeConverter","formatCancelledBy","room_field","price_field","row","space_service","org_service","CurrencyPipe","transform","organizer","person","isCancelled","cancelled_by","cancelled_date","cancelled_at_epoch","remove_fields","output","idx_a","idx_b","csv_json","ReportsService","fromCSV","_service_list","findIndex","provider","provideFor","useValue","SETTINGS_TOKEN","SettingsObject","_app_name","_overrides","_observables","_bypass_bookings","VERSION","built","semver","hash","override_settings","Inject","OPTION_DEFAULTS","SpaceEquipments","SpaceStyles","EMPTY_ARRAY","allowStaffRoomWithBookings","room_style","equipment","bypass_bookings","defaultGlobalName","defaultSettings","room_name","support_url","features","extra_features","room_type","simple_name","rulesFor","nowMs","runningBookings","bks","startEpoch","endEpoch","spaceWithBookings","roomType","natural_light","Set","recurrence_availability","availabilityOptionsToQuery","hide_declined","blds","bld_b","a_has_zone","b_has_zone","SPACE_LIST","SpacesService","queryRooms","updateSpace","uploadSpacePhotos","setList","filterAvailableSpaces","faker","SERVICE","generateMockOrganisationService","jest","generateMockBuilding","getRoomFilterOptionsPerLocation","generateMockDataService","generateMockSpacesService","generateMockUsersService","loadCurrentUser","bookingState","setZone","setDate","setFilters","remove","startPolling","startPollingMonth","startPollingWeek","startPollingEveryFiveMin","test_app","logo_light","background","logo_dark","heap_io","force_ssl","secure_cookie","disable_text_capture","cookie_path","TEST_SETTINGS","app","generateMockSettingsService","overrides","provideMockSettingsObject","provide","generateMockAppService","settingsOverrides","notifyInfo","notifyWarn","notifySuccess","notifyError","navigate","navigateBack","Composer","Hotkeys","Users","Locations","Base","Menu","Spaces","Bookings","Reports","CateringItems","CateringCategories","Settings","generateMockUser","booking_list","fill","generateMockBooking","mockReturnValue","save","addFrom","removeFrom","clearList","removeFromList","accept","decline","checkin","is_logged_in","queryRoomsForQR","queryObsr","checkinIndividualVisitor","updateObsr","mockImplementation","SPACE_COUNT","generateMinimalRoomDetails","generateMockSpace","space_id","recurring_search","lastName","room_booking_screen","vc","linked","commerce","productName","searchable","controlable","hourly_rate","sort_priority","business","USER_DOMAIN","BOOKING_COUNT","BOOKING_DATE","setMockBookingStartDatetime","visitor","generateMockCateringOrder","menu","date_start","users","lorem","paragraph","BLD_COUNT","LVL_COUNT","generateMockLevel","levelGenerator","firstName","test","nested","level2","org","USER_COUNT","USER_EMAILS","companyName","delegates","delegate_count","first_name","last_name","phone","phoneNumber","department","staff_code","avatar","pickMenuItem","menu_map","category","generateMockLocation","fixed_locations","maps","ORG_COUNT","generateMockOrganisation","generateMockBuildingSetByCity","generateMockModalData","pendingDate","pendingDuration","mockDateToBuildingTz","windows_id","mobile","business_unit","organisation_id","organisation_name","officeLocation","desk","generateUserForm","pattern","maxLength","UsersService","uhttp","expiry","reload","client_id","Md5","hashStr","go","append","authorise","logout","tries","locate","loadDelegates","promises","del","all","HAS_ERROR","buildValidateDate","validateDate","is_from","buildValidateStartTime","validateStartTime","date_obj","buildValidateDuration","validateDuration","buildValidateAttendees","validateAttendees","invalid","dateControlTz","noWhitespaceValidator","isWhitespace","trim","whitespace","date_org","local_tz","zoneName","compare_to","unit","ans_unit","newDate","startOf","monday","sunday","later","endOf","isLastDayOfMonth","minus","hasSame","dateYear","dateMonth","dateDay","trunc","toSeconds","toUTC","toJSDate","getDay","convertLocalTimestampToTimezonedDateTz","buildingTimezone","convertTimezonedTimestampToLocalDateTz","localOffset","getTimezoneOffset","desiredOffset","eleA","localTimezone","offset_minutes","toMiddayUTC","timezoneOffset","EnvironmentModule","providers","ENVIRONMENT_TOKEN","EnvironmentService","environment","production","BookingConfirmComponent","_booking_state_service","_router","_dialog","_dialog_ref","closeDialogService","renderer","EventEmitter","show_attendees","lastMomentConflict","old_booking","is_request","approved","bookingDetails","bookedBy","disableClose","checkSpaceAvailability","newEmail","replaceObjects","constructor","replacement","nk","buffer","elem","has_note_buffer","updated","master_booking","pollOnce","closeDialog","MeetingDetails","emit","erroMessage","queryParams","ref","open","ConflictsModalComponent","maxWidth","width","local_room_name","conflicts","copy_conflicts","componentInstance","clipboard","writeText","conflictsText","afterClosed","listType","collapseList","attendeesListRef","expandList","show_locations","locationsListRef","show_orders","cateringListRef","listRef","listElement","listItems","getElementsByClassName","totalHeight","offsetHeight","setStyle","addClass","removeClass","duration_value","recurrenceDates","a_space","dateTZ","MAT_DIALOG_DATA","Component","templateUrl","styleUrls","Output","ViewChild","$event","BookingFormComponent","cdRef","user_list","fromDateTz","untilDateTz","localStart","localEnd","chipOptions","showTimeCateringWarning","updateCoachmarkTimes","skip","distinctUntilChanged","recurrenceStarts","clearValidators","arrayValidators","disableInputs","checkTimeCateringWarning","has_id","is_edit","patchValue","SpaceSelectModalComponent","multiple","needsCatering","noCatering","NewUserModalComponent","detectChanges","localTzOffset","buildingTzOffset","toggledControlName","startDateTime","fromISO","endDateTime","bookingDate","dayStartAt7am","dayEndAt8pm","markForCheck","changeDetection","ChangeDetectionStrategy","OnPush","BookingCateringConfirmModalComponent","CateringDetailsModalComponent","_cateringNotesService","head_counts","needs_charge_code","active_space","note_list","notes_field","generateFormFields","markAllAsTouched","is_valid","new_notes","setNotes","_scrollToBottom","_content_el","scrollTo","top","scrollHeight","left","behavior","active_form","errors","minlength","submit","CONFIRM_METADATA","maxHeight","ConfirmModalComponent","DECLARATIONS","NoCateringModalComponent","RequirementDetailsModalComponent","UserFormComponent","LegacyOverlaysModule","LegacyUiModule","FormsModule","ReactiveFormsModule","UiModule","EditorModule","new_user","confirm","cancel","codes_field","head_counts_field","firstSpaceEmail","head_count","anySpaceNeedsChargeCode","roomBasedEqCode","officeBasedEqCode","change$","selected_spaces","request_map","formGroup","triggerSearch","savedSelection","request_id","search_results$","active_building","resp","active_type","_space","setDefaultBuilding","grouped_by_city","city_buildings","noCateringDialogRef","panelClass","autoFocus","backdropClass","defaultBld","opt","space_a","space_b","withLatestFrom","formData","ActionIconComponent","hasSelectionRequirements","getActiveList","CateringMenuItemComponent","initial_state","an_cat","setAmount","cat","an_item","updatePackageSelection","setPrice","selectPackageOptions","confirmed_item","cart_item","active_items","updatedList","PackageOptionsModalComponent","done","a_list","animations","checkItemRequirements","getActiveItems","a_package","needed","CngSearchBarComponent","placeholder","totalFoundItem","showSrchWarning","searchStr","configChanges","clearSearch","box","onSearch","resetSearch","HoverClassDirective","elementRef","hoverClass","classList","ActionFieldComponent","show_tooltip","performAction","CounterComponent","useInput","previous_value","handleTimeout","ctrl_key","shift_key","new_value","changeInput","Number","isNaN","_onChange","_onTouch","NG_VALUE_ACCESSOR","useExisting","forwardRef","multi","DateFieldComponent","_from","position","onChange","old_date","new_d","new_date","_trigger","closeMenu","openMenu","_to","years","menuOpen","MatMenuTrigger","openDatePicker","closeDatePicker","DurationFieldComponent","specialPreprops","duration_options","generateDurationOptions","blocks","TimeFieldComponent","no_past_times","show_select","_time_options","generateAvailableTimes","select_field","focus","openedChange","datestamp","show_past","showSelect","UserListFieldComponent","search$","search_str","match_name","match_email","inputAutoComplete","openPanel","closePanel","active_list","a_user","file","files","reader","FileReader","readAsText","evt","processCsvData","srcElement","endsWith","addUser","template","MatAutocompleteTrigger","addUsersFromFile","downloadCSVTemplate","read","UserSearchFieldComponent","resetSearchString","onInputChange","FeedbackComponent","updateRoute","NavigationEnd","current_page","IconComponent","PopoutMenuComponent","SearchbarComponent","UserAvatarComponent","MATERIAL_MODULES","MatButtonModule","MatSnackBarModule","MatDialogModule","MatFormFieldModule","MatInputModule","MatProgressSpinnerModule","MatProgressBarModule","MatAutocompleteModule","MatSelectModule","MatChipsModule","MatRippleModule","MatMenuModule","MatCheckboxModule","MatTooltipModule","MatRadioModule","MatTabsModule","MatSlideToggleModule","ACA_PIPES_MODULE","valueChange","autofocus","focusField","input_field","actionPrefix","stateKey","buildAction","postfix","clear","wrapLoading","selectData","warn","selSuccess","selectSuccess","selOptionalSuccess","selectOptionalSuccess","selError","selectOptionalError","selLoading","selectIsLoading","actionObject","caller","flatMap","isLoading","hasError","hasSuccess","_success","isEmpty","isSuccess","isError","hasLoaded","shouldLoad","selectIsSuccess","selectIsError","selectHasLoaded","selectIsEmpty","generateMockActions","dispatcher","Actions","verifyActionSuccess","effect","expect","toBeDefined","toStrictEqual","verifyActionError","organisationStateSelector","OrganisationEffects","organisationService","OrganisationModule","organisationReducer","initialState","rooms","loadRoomsWithQuery","selectRoomResultsSuccess","RoomsEffects","spaceService","afterRequestResultsLoadOthersEffect","laterThatDayFromDateTz","nextBusinessDay","diff_capacity","loadRoomsForResultsEffect","roomQueryOptionsToSpaceAvailabilityOptions","loadRoomsForResultsMapEffect","loadLaterThatDayResultsEffect","loadNextDayResultsEffect","loadDiffSizeResultsEffect","loadRoomByIdResultsEffect","roomByIdQueryOptionsToSpaceAvailabilityOptions","RoomsModule","roomsReducer","initialRoomsState","byid","todayFromDate","retDate","mapRoomToSelectOption","resultCountObservable","loadingObservable","resultsObservable","viewModelLength","deepDistinctUntilChanged","deepEqual","filterUndefined","RxUtilsModule","AcaDatePickerComponent","klass","show_last_selection","min_offset","max_offset","date_list","month_name","days_of_week","day_format","month_format","generateMonth","generateDaysOfTheWeek","updateOptions","counters","difference","today","end_","non_month","_change_timer","new_offset","updateDate","changeMonth","AlertMode","AlertBannerDisplay","AlertBannerComponent","mode","Warning","showClose","V1","iconPath","materialColor","closeIcon","_onModeChange","Coachmark","BlueCoachmark","AutoCompleteChipSelectItemComponent","optionSelected","feedbackOutput","chipsCleared","onClickConfirm","selectOnlyOneGroup","localFilter","selectOnlyOneGroupChange","separatorKeysCodes","ENTER","COMMA","filterFormControl","focused","mobileFullScreen","autocompleteOptions","filteredAutocompleteOptions","enableCTAs","hasChips","scrollEvent","panelOpen","contains","onFocus","blur","valueAccessor","color","enabled","selectedGroupHeader","getFilteredAutocompleteOptions","groupHeaders","g","searchString","exactMatches","moreOptions","joinedOptions","groupIds","parents","jo","matInput","feedbackInput","useCTAs","focusIn","fromPanel","componentInput","loseFocus","isDisabled","spl","removeEventListener","dirty","touched","keyedInput","onPanelFocusChange","selectOption","encapsulation","ViewEncapsulation","Self","Optional","GroupHeaderPipe","hasHeader","displayAsHeader","AutoCompleteSelectOptionComponent","filteredOptionsChange","inputTextChange","emptyBoxEvent","_options","updateFilteredOptions","selectedValue","resetInput","filteredOptions","startWith","_filter","filterValue","filterValues","matchesAll","onChangeInput","BaseTemplateComponent","vcRef","isRendered","attemptViewEmbed","createEmbeddedView","TemplateRef","CateringDropComponent","onCancel","onConfirm","CngSelectOptionsComponent","CngSelectComponent","isClosed","defaultSelected","onChangeCallback","DropdownTriggerForDirective","overlay","viewContainerRef","isDropdownOpen","dropdownClosingActionsSub","EMPTY","isPanelOpened","destroyDropdown","openDropdown","ddWidth","dropdownPanel","offsetWidth","overlayRef","create","hasBackdrop","scrollStrategy","scrollStrategies","positionStrategy","flexibleConnectedTo","withPositions","originX","originY","overlayX","overlayY","offsetY","templatePortal","TemplatePortal","templateRef","attach","dropdownClosingActions","backdropClick$","backdropClick","detachment$","detachments","dropdownClosed","merge","detach","dispose","CollapseHeaderComponent","collapseService","expandedIds","updateSectionIdOnOpen","isExpanded","collapseSubscription","expansionPanel","isOpen","expandedTitleId","updateOpenedSectionId","ConflictAlertModalComponent","dialogData","callback","dateIsToday","CustomSnackbarComponent","snackBar","dismiss","snackType","MAT_SNACK_BAR_DATA","closeSnackbar","SnackBarService","verticalPosition","horizontalPosition","_snackType","openFromComponent","DateTzCalendarWidgetComponent","className","selectedDateTz","_today","registerOnChange","registerOnTouched","startOfMonthDateTz","DateTzDatePickerComponent","icon_only","onSelect","can_pick_today","selectedDateTzValue","resetToLastSelection","_acaDatePicker","initialDateSelectionTz","writeValue","newValueTz","newDateTz","onDatePickerClose","DateTzDurationFieldComponent","defaultDurationGroups","DEFAULT_DURATION","currentStartDateTz","nearestStep","placeHolderOption","selectedOption","generateDurationOptionsFromGroups","extended","dopt","DateTzTimeFieldComponent","noPastTimes","show_current","startFromDateTz","selectedTimeString","generateAvailableTimesTz","generateOptionForDateTz","os","timeOptions","displayString","newTimeTz","setSelectedValues","ErrorMessageComponent","CalendarIconComponent","ChevronIconComponent","CloseIconComponent","InformationalImageComponent","LabelComponent","LegendDropdownComponent","placeholderOpen","MckDatePickerComponent","dateValue","initialDateSelection","goToToday","secondarySubmit","primarySubmit","ModalButtonRowComponent","primaryDisabled","disableFixed","secondaryDisabled","smallButtons","ModalComponent","shouldClose","OverrideChangesModalComponent","getDateString","epoch","toISOString","uniqueDates","filteredEdits","dateString","has","FilterPipe","searchText","objectKey","splitKeys","it","included","SecurityContext","SanitizePipe","sanitizer","sanitize","RESOURCE_URL","URL","SCRIPT","STYLE","HTML","RadioSelectComponent","RecurringBookingForm","recurrence_types","PATTERN","DATE","recurrencePeriod","current_type","pattern_form","recurrencePatternFormControl","RecurrencePatternForm","onChangeType","RecurrenceDateForm","selected_dates","setPickerToGivenDate","tempForSort","start_date","formDateTz","is_selected","setDateTzForm","dateTsValue","addDate","fromStartTz","untilTz","repeat_period_options","validateRecurrenceInterval","repeat_every_options","recurrenceIntervalFormControl","fromEndTz","setEndDateFromStartDate","recurrenceDateStartTzFormControl","recurrencePeriodFormControl","generateMaxIntervals","recurrenceDaysFormControl","current_days","generateOcurrenceList","recurrenceEndFormControl","end_date","updateActiveWeekday","updateValidators","date_diff","periodToDurationType","first_date","recurr_days","daysInMonth","_week_days","new_day","current_index","setRepeatEvery","setRepeatPeriod","SelectOptionComponent","ignoreDisabled","noEntriesFoundLabel","SelectComponent","searchEnabled","splitDisplay","showDivider","SelectedChipCountComponent","SpacerMode","SpacerComponent","Horizontal","SwitchGroupComponent","optionChecked","closestTimeSlot","buildingDate","newTime","ToggleComponent","selectedChange","TooltipComponent","isVisible","TooltipPosition","DEFAULT","theme","TooltipTheme","tooltip","visible","TooltipDirective","appRef","componentFactoryResolver","injector","showDelay","hideDelay","componentRef","triggerType","hasTrigger","initializeTooltip","setHideTooltipTimeout","touchTimeout","bind","componentFactory","resolveComponentFactory","attachView","hostView","rootNodes","tooltipDOMElement","setTooltipComponentProperties","showTimeout","showTooltip","instance","getBoundingClientRect","right","bottom","BELOW","ABOVE","RIGHT","LEFT","hideTimeout","detachView","MatIconModule","MatExpansionModule","OverlayModule","NgxMatSelectSearchModule","NgxSkeletonLoaderModule","ZoomWarningComponent","entryComponents","ALL_DAY_BOOKING_VALUE","showPast","inputDate","allDayOption","oneWeekOption","onCloseClick","loadUser","selectUserState","selectHasUserData","UserEffects","userService","UserModule","userReducer","initialUserState","webpackEmptyAsyncContext","req","module","routes","component","ShellWrapperComponent","children","loadChildren","BookingModule","redirectTo","AppRoutingModule","RouterModule","forRoot","useHash","AppComponent","_app","_route","val","navigationTrigger","cleanHash","isLoadBookingUrl","isLoadCateringUrl","adjustZoom","clientWidth","isMobileOrTablet","vendor","maxTouchPoints","mobileAgents","localStorageSyncReducer","reducer","localStorageSync","rehydrate","metaReducers","AppModule","MAT_LABEL_GLOBAL_OPTIONS","DEFAULT_SETTINGS","BrowserModule","BrowserAnimationsModule","HttpClientModule","ComposerModule","SharedContentModule","StoreDevtoolsModule","instrument","maxAge","logOnly","MapModule","bootstrap","CalendarDateWidgetComponent","show_add_item","show_events","retainSelectedDate","dateChangeTz","timezone_value","event_map","dateInputTz","changeDate","noOfCount","applyDatePickerValue","BookingCalendarWrapperComponent","BookingCalendarRoutingModule","forChild","settingService","TopBarHeaderMode","backRoute","orgBuildings","onBackCallback","bookingModuleDeclarations","StaffCalendarComponent","DayViewTimelineComponent","DayViewSpaceComponent","DayViewSpaceEventComponent","CngMenuItemComponent","bookingModuleImports","BookingCalendarModule","router","onChildSelect","node","overlap","calculatePosition","storeOrder","view","shown_date","from_previous_day","toFixed","overflow_top","overflow_bottom","timeBasedStatusLabel","userEmail","time_period","userName","cdr","legend","eventMovingLoader","inView","dragging","moving","event_list","overlap_details","position_list","time_blocks","generateTimeBlocks","filterEvents","checkInView","last_update","calculateOverlaps","override_state","isRecurrentMaster","isRoomEmailMatch","isIncludedInSetupOrBreakdown","overflow_only","collisions","cmp","cmp_start","cmp_end","in_view","offsetLeft","delta","pointerPosition","scroll_top","top_minutes","selectedBlockStart","selectedBlockEnd","hasValidBreakdown","active_level","foundSearchLength","searchedCounter","levelsDD","paramMap","updateLevel","initSpace","numeric","ignorePunctuation","roomLevelDD","ddBoxClass","onChangeActiveLevel","generateBuildingMenu","filterd_booking","menuItem","displayName","iconName","buildingLevels","buildingMenuItems","activeBuildingName","searchBooking","updateDateTz","UPDATE_INTERVAL","scroll_left","scroll_offset","filtered_spaces","loading_space","space_zones","is_today","modalInitialized","isEventMoving","scroll_area","initSpaces","updateTime","virtualScroll","space_type","stopPolling","scrollIntoView","queryParamMap","view_id","spaceJson","active_hour","searchData","column","spaceId","bookingEl","timeoutID","scroll_box","date_percent","scrollWidth","CdkVirtualScrollViewport","clearSelected","updateScroll","BookingConfirmationComponent","Light","placeIntoModal","statusText","confirmed","isUnavailable","Urls","Help","modal","dispatch","ocurrence","specificDates","u","generateFeedbackUrl","currentPage","BookingCreateComponent","selectedRoom","bookingFormToBooking","updateConfimatinModal","unavailable","_bookings_service","handleBookingSuccessResponse","handleBookingErrorMessage","displayWarningBanner","BookingFormBaseComponent","BookingEditWrapperComponent","BookingEditComponent","updateCallback","isEditSeries","roomEmail","bk","getNotes","isEquipmentNote","isCateringNote","booking_form_data","formToAttendees","formToCompany","updateNotes","closeCallback","dialog","invalidForm","showWarningBanner","submitTimestamp","has_delegate","saveChanges","raw_user","nameParts","companies","custom","warningMessage","bookingData","setupOrganiser","setupNotes","track","dataForConfirmation","endDateString","timeString","durationString","isConflictWithOccurences","openRecurrenceConflictsModal","totalConflicts","is_conflict","total_Conflicts","recurr_ref","bookingTypeLabel","recurrenceStart","requestedEndDateTz","endDatestring","BookingDetailsModalComponent","expandedLocation","isRecurrentBooking","isMultiroomBooking","byIdResults","expandedAvailability","showInfoBanner","showCatering","disableSeriesEditButton","disableCancelButton","disableEditTimeButton","disableUpdateDetailsButton","_specific_dates","roomLocation","street_and_city","initDisplayValues","displayCancelModal","cancelBooking","addCatering","roomHasCatering","hasLoaderUrl","available_fields","fromEvent","throttleTime","tap","showDetails","dispatchToGetFloorCurrentStatus","hostEmail","roomName","attendeesString","chargeCode","mapUrl","extendableMaximum","focusedRoom","checkingExtendable","receiptionEmail","reception_email","companyString","setAlternativeWeekStartDate","requirements","orgStatus","recentlyExpired","statusImage","findMaxExtension","fetchRooms","invalidDueToOfficeRule","alertIfItHasConflict","flag","setupInSeconds","breakdownInMinutes","gapInMinutes","editingSeries","roomOption","recurringBookingData","rec_endTz","getLocation","clearFormAndResultData","dialog_ref","RoomBookingModalComponent","navigateTo","navigateT0Search","relativeTo","refresh","CancelBookingModalComponent","legth","dialogRefX","BookingDurationModalComponent","maximum","updateBookingState","alternativeWeekStartDateTz","pendingChanges","roomRules","hasCateringOutsideHours","confirm_drop","saveBooking","displayInfoBanner","global_name","isBookable","isAvailable","headerText","buttonLabel","allWeek","startOfWeek","specific_dates","show_fields","getRawValue","closeModal","steps","updateBookingDuration","bookingSelect","BookingResultItemComponent","small","timeStringParts","localTimeStringParts","isAnotherTimezone","setupDisplayFields","viewModel","timeRangeString","bkn1","bkn2","RoomResultsComponent","RoomFiltersModalComponent","RoomDetailsComponent","ManageBookingsComponent","OfficeFloorComponent","RoomBookingComponent","BookingRoutingModule","BookingsListingComponent","BookingCateringComponent","BookingCateringOrderDetailsComponent","BookingCateringOrderListComponent","CateringMenuCategoryComponent","CateringOrderListItemComponent","SearchedLocationComponent","ResultsHeaderComponent","RoomAvailabilityPreviewComponent","RoomLocationPreviewComponent","RoomResultItemComponent","RoomBookingFormComponent","RoomBookingDetailsFormComponent","RoomResultsPaginatedComponent","RoomFiltersFormComponent","RoomResultsSectionComponent","RoomAvailabilityPreviewModalComponent","OrderTableComponent","SurveyModalComponent","CalendarModule","DateAdapter","useFactory","adapterFactory","OfficeFloorMapModule","bookingResults","showBookings","reloading","totalRecords","pageLimit","bookingPerPage","filteredByHost","getViewModel","prevPage","setPage","nextPage","prevGroup","pages","nextGroup","gotoPage","page","activeTab","sort_asc","sort_desc","reverse_sort","allBookings","filterBySelectedHost","originalArray","subarrayLength","newArray","$change","selectedHost","searchBookingBy","isHostChanged","searchHost","filterBookingsBySearchValue","filteredBookings","lastPage","splitArrayIntoSubarrays","getBuilding","page_idx","dontShowReloading","p","startPosition","maxed","mined","canceled","buildingAddress","next_disabled","combineItems","newItems","oldItems","itemsObj","active_order","an_order","reduceItems","reduceOrders","consolidatedOrders","deliveryTime","openCateringDetailsModal","_menu","category_list","available_times","matched_items","available_categories","within_category_restricted_time","initForm","_input_el","show_search","loadMenu","generateStartAndEndTimes","space_email","building_time","cat_start_time","cat_end_time","within_restricted_time","has_available_items","out_of_hours","form_controls","confirmOrder","edit","newOrder","previous","bookingTypes","searchBarConfig","bookingId","snapshot","verb","initData","closeAll","viewBookingFromEmailLink","replaceUrl","ifUser","host_list","hostOptions","delegateDD","onChangeDelegates","ddOptionBoxWidth","clearPage","BookingResultsViewModel","WAITING_TIME","FloorMapOverlayComponent","selectedRoomId","zoom","MIN_ZOOM_LEVEL","center","CENTER_POINT","availableUntil","untilNextBookingFlag","isTimerActive","timerIndex","fetchRoomWithBookings","userSelectedRoom","calculateRoomBookingTimeInfo","currentStatus","activeBookings","timeRemainingInActiveBooking","timeUntilNextBooking","setupTimer","updateSchedulingEpochs","intervalCall_1","intervalCall_15","determineNextBookingStartTime","parentComponent","roomStatus","nowTime","ts","addMin","nextBookingStartTime","futureBookingsForTheDay","nextBookingStartTimeMs","setUpTime","addSeconds","TIME_SIMPLE","startTimer","childCallback","updateRoomData","isOverlayOpened","adjustedTime","timeSlot","end_epoch_15","end_epoch_30","timer","currentTime","endTime","availableTimeToBook","minutesRemaining","secondsRemaining","setup15MinTimer","addjustedTime","futureBookings","endEpoch30","latestBookingStartTime","timeDiffMs","diffInMs","diffInHours","diffInMinutes","roomSelected","roomDataCallback","confirmBooking","MAP_OVERLAY_DATA","Emulated","MAX_ZOOM_LEVEL","mapSpaceStatusToDisplay","mapSpaceStatusToOption","legendOptions","defaultMapBookingRules","defaultMapBookingSubtitle","generateMapStyleForSpace","colorStatusMap","styles","generateMapListenersForSpace","hoverSpace","leaveSpace","clickSpace","listeners","spaceToMapFeature","coordinates","roomToMapFeature","SERVICE_ACCOUNT","mapModuleImports","LibraryModule","mapModuleDeclarations","openHeader","focusedMapSpace","resultBuildings","resultSpaces","activeBuilding","activeLevel","activeSpace","style_map","bookingLocations","buildingLevelOptions","spaceListOptions","activeBuildingOption","activeLevelOption","activeSpaceOption","bookingFormData","bookingConfirmed","getState","floorMap","selection","serviceAccount","self","selectActiveBuilding","spacesFromSelection","colour_map","mapStyle","focusOnRoom","firstBuilding","selectBuildingLevel","OfficeInformationModalComponent","navigationExtras","kioskFormFilter","dayOfWeek","toggleOptions","selectedToggle","selectedToggleChange","retrievedOption","onSelectedChange","queryParamsHandling","submitForm","restrictedDueToCatering","pendingDateTz","updateDisplay","pendingDateString","pendingTimeString","pendingDurationString","currentBooking","mockBooking","pending_date","$value","formControl","localizedStartDate","localizedEndDate","updateDatePickerValue","WEEKEND_DAYS","grey","secondary","primary","blue","red","confirmChanges","handleExpand","updateCalendarWeekView","warnIfItHasConflict","showDatePicker","showWeekend","calendarPopupValue","pendingChange","eventSnapSize","dayRefresh","weekRefresh","addMarginOnConflict","cssClass","resizable","beforeStart","afterEnd","draggable","modal_data","scrollFired","date_span","dateControl","currentBookingStartDate","weekViewDateTz","calendarCenter","viewDateTz","setCalendarValue","setupEventName","transformBookings","expanded","setDislayValues","dayStartHour","tz_offset","week_start_date","week_view_date","weekViewRangeText","backgroundColor","startHour","dayEndHour","bumper","getBumpers","calendarSpan","raw_booking","displayClass","utcStart","utcEnd","adjustedStartDate","utcToZonedTime","adjustedEndDate","assign","milliseconds","updateTileColor","booked","conflict","hasConflict","isEvents","thirty_minutes_in_millis","toDate","buildingTz","localizedStartTime","localizedEndTime","bookingStartTime","bookingEndTime","bstart","bend","newStart","newEnd","iEvent","buildingStartDateTz","buildingEndDateTz","new_start","md","dnd_duration","one_day_in_millis","conflictCheckStartTime","conflictCheckEndTime","buildingStartDate","applyChanges","ele","getElementById","_snackBar","triggerSubmit","validateForm","showHint","searchSubject","selectedUsers","notesHandle","noteValidationClass","selectedCompanies","companyOptions","bookingFormGroup","checkingBreakdown","searchResults","unshift","formRef","onSubmit","inputValue","inputValueEmail","emailRegex","headCountControl","showCancel","cancelSubmit","fromDate","emitEvent","formGroupData","is_past","_checkDateInPast","formGroupDate","closestTz","prevClosestTz","prevDateTz","showManageButtonA","showManageButtonB","showManageButtonC","homepageBookingResults","pastBookingResults","onbeforeunload","upcomingBookings","LearnMore","routeToResults","routeToManageBookings","isAlertDisplayed","roomSubtype","occurenceAvailability","getCurrentNavigation","availabilityStatus","checkAvailabiltyAsPerRule","setRoomSubType","requestedDateTz","endDate","temp","isSpaceValidAsPerRule","goToBackRoute","expandAvailability","updateAvailabilityStatus","primaryCheck","secondaryCheck","removeDateOffset","bookingRoute","isRequest","combinedFeatures","handleClose","expandMap","bookRoom","isInternal","filtersSubmit","getFilters","toggleOptionChecked","submitFilters","Dark","viewMode","featuresRoom","minZoom","setIntervalHandle","initMapZoom","zoomToRoom","_appService","roomSelect","availability","firstChange","coachMarkAction","ROOM_DISPLAY_STEP","ROOM_DISPLAY_START","expanded_section_ids","headerTitle","displayCount","displayViewModels","viewModels","vm","showLoadMore","remainingResults","shouldLoadMore","resultLoaded","loadMore","querySelectorAll","isDom","previouslyLoadedCount","noOfResultLoaded","spaceConflicts","overrideChanges","goToRoomDetail","mainResultViewModels","editing_form","AlternateBuildings","subscribeResultsToViewModels","subName","flattenLevelBuildings","viewModelSubject","resultsLoading","updateCoachMark","coachMarkDisplay","RoomResultsCoachmarkViewmodel","rules_link","levelBuildings","cityFromLocation","actionButtonText","day_offset","mainResults","mainResultsFiltered","laterThatDayResults","nextBusinessDayResults","diffSizeResults","laterThatDayDisplay","mainCoachMarkDisplay","mainResultsCount","laterThatDayCount","nextBusinessDayCount","diffSizeCount","spaceControl","searchStringPresent","nday","despatchLoadRooms","mainResultsSpaces","filteredRooms","selectedMenuIndex","isForFloorMap","selectedSpace","clearRoomSearch","roomIds","collapsePanel","changeSearchResults","overflow","changeClick","filterClick","canFilter","timing","filterDisplay","filterCount","computeDisplay","occEndDate","endRecDate","startDisplay","endDisplay","durationDisplay","FooterMenuComponent","tiles","MapControlsComponent","levelChange","building_details","building_list","level_list","setBuilding","lvl_id","OverlayMenuComponent","showChange","copyright","delayedClose","cancelClose","ResponsiveInlineImagesComponent","imgArr","phase","baseUrl","questions","created_at","updated_at","header_question","header_subtext","answers","questions_id","positive","option_responses","comments","getFeedbackQuestionsFromApi","questionID","checked","$evemt","delayed","TopbarHeaderComponent","backModal","noSurvey","menuChange","onBack","modalOpen","surveyDialogRef","feedbackId","logo","feedback_id","openFeedbackModal","homeOverride","help_url","back","feedback_url","goToFeedback","goToHelp","LoginComponent","username","password","login","setErrors","zoomOutClick","zoomInClick","refreshClick","infoClick","toggleEvent","toggle","MapFiltersComponent","selectedBuildingChange","selectedLevelChange","selectedSpaceChange","searchClick","buildingControl","levelControl","MapOverlayComponent","closeMapOverlayOutlet","closeOverlay","MapSearchComponent","floorData","floorDataParam","refreshFloorNumber","selectActiveSpace","displayOfficeInformation","propagateToggle","zoomIn","zoomOut","resetZoomLevels","info","custom_html","map_rules","other_rules","contact","link","COMPONENTS","CDK_MODULES","ScrollingModule","DragDropModule","CdkTableModule","APipesModule","AInteractiveMapModule","ACustomEventsModule","IvyCarouselModule","placeOs","activatedRoute","userLoading","isQRCode","buildingOptions","oauth_redirect","availibityParams","setSpaceList","bookingRoom","seledtedZone","NavigationStart","checkRoomId","query2","loading_state","initialized","isQRCodeScanedAndReady","mod","Feedback","hmr","general","home","help","columns","booking_types","html_body","multiple_spaces","desk_start","space_display","show_images","directory","show_avatars","min_search_length","explore","can_select_building","show_legend_group_names","show_timeline","General","day_view","dragdrop","hmrBootstrap","ngModule","hot","ApplicationRef","elements","components","makeVisible","createNewHosts","enableProdMode","platformBrowser","bootstrapModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AACJ,KAPD,MAOO;AACH4xE,eAAS,WAAT,CAAkB,UAAAj5D,GAAG;AAAA,eAAIjY,OAAO,CAACV,GAAR,CAAY2Y,GAAZ,CAAJ;AAAA,OAArB;AACH","file":"main-es5.js","sourcesContent":["export * from './lib/animations.module';\nexport * from './lib/angular-animations'\n","import { trigger, transition, style, animate, state } from '@angular/animations';\n\nexport const ANIMATION_SHOW_ENTER_LEAVE = trigger('show', [\n transition(':enter', [\n style({ opacity: 0, height: 0 }),\n animate(300, style({ opacity: 1, height: '*' }))\n ]),\n transition(':leave', [\n style({ opacity: 1, height: '*' }),\n animate(300, style({ opacity: 0, height: 0 }))\n ])\n]);\n\nexport const ANIMATION_SHOW_CONTRACT_EXPAND = trigger('show', [\n state('show', style({ opacity: 1, height: '*' })),\n state('hide', style({ opacity: 0, height: 0 })),\n transition('show <=> hide', animate('200ms ease-in'))\n]);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class AnimationsModule {}\n","export * from './lib/base.module';\nexport * from './lib/types.utilities';\nexport * from './lib/general.utilities';\nexport * from './lib/base.class';\nexport * from './lib/base.directive';\nexport * from './lib/date.utils'\nexport * from './lib/date.spec-helpers'\nexport * from './lib/replace.pipe'\nexport * from './lib/cdk-drop-list-scroll-container.directive'\nexport * from './lib/image.directive';\n","import { Subscription, BehaviorSubject } from \"rxjs\";\n\nexport class BaseClass {\n /** Store for named timers */\n protected _timers: { [name: string]: number } = {};\n /** Store for named intervals */\n protected _intervals: { [name: string]: number } = {};\n /** Store for named subscription unsub callbacks */\n protected _subscriptions: { [name: string]: (Subscription | (() => void)) } = {};\n /** Subject which stores the initialised state of the object */\n protected readonly _initialised = new BehaviorSubject(false);\n\n /** Observable of the initialised state of the object */\n public get initialised(): BehaviorSubject {\n return this._initialised;\n }\n /** Whether the object has been initialised */\n public get is_initialised(): boolean {\n return this._initialised.getValue();\n }\n\n protected destroy() {\n for (const key in this._timers) {\n if (this._timers.hasOwnProperty(key)) {\n this.clearTimeout(key);\n }\n }\n for (const key in this._intervals) {\n if (this._intervals.hasOwnProperty(key)) {\n this.clearInterval(key);\n }\n }\n for (const key in this._subscriptions) {\n if (this._subscriptions.hasOwnProperty(key)) {\n this.unsub(key);\n }\n }\n }\n\n /**\n * Creates a named timer\n * @param name Name of the timer\n * @param fn Callback function for the timer\n * @param delay Callback delay\n */\n protected timeout(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearTimeout(name);\n this._timers[name] = setTimeout(() => {\n fn();\n this._timers[name] = null;\n }, delay);\n } else {\n throw new Error(\n name ? 'Cannot create named timeout without a name' : 'Cannot create a timeout without a callback'\n );\n }\n }\n\n /**\n * Clears the named timer\n * @param name Timer name\n */\n protected clearTimeout(name: string) {\n if (this._timers[name]) {\n clearTimeout(this._timers[name]);\n this._timers[name] = null;\n }\n }\n\n /**\n * Creates a named interval\n * @param name Name of the interval\n * @param fn Callback function for the interval\n * @param delay Callback delay\n */\n protected interval(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearInterval(name);\n this._intervals[name] = setInterval(() => fn(), delay);\n } else {\n throw new Error(\n name ? 'Cannot create named interval without a name' : 'Cannot create a interval without a callback'\n );\n }\n }\n\n /**\n * Clears the named interval\n * @param name Timer name\n */\n protected clearInterval(name: string) {\n if (this._intervals[name]) {\n clearInterval(this._intervals[name]);\n this._intervals[name] = null;\n }\n }\n\n /**\n * Store named subscription\n * @param name Name of the subscription\n * @param unsub Unsubscribe callback or Subscription object\n */\n protected subscription(name: string, unsub: Subscription | (() => void)) {\n this.unsub(name);\n this._subscriptions[name] = unsub\n }\n\n /**\n * Call unsubscribe callback with the given name\n * @param name\n */\n protected unsub(name: string) {\n if (this._subscriptions && this._subscriptions[name]) {\n this._subscriptions[name] instanceof Subscription\n ? (this._subscriptions[name] as Subscription).unsubscribe()\n : (this._subscriptions[name] as any)();\n this._subscriptions[name] = null;\n }\n }\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\n\n@Directive({\n selector: 'a-very-basic-component-base-that-should-not-be-used'\n})\nexport class BaseDirective extends BaseClass implements OnDestroy {\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NumbersOnlyDirective } from './numbers-only.directive';\n\n@NgModule({\n imports: [CommonModule,],\n declarations: [\n NumbersOnlyDirective\n ],\n exports: [\n NumbersOnlyDirective\n ]\n})\nexport class BaseModule {\n}\n","import {\n Directive,\n Input,\n Renderer2,\n SimpleChanges,\n OnChanges,\n ContentChildren,\n QueryList,\n AfterContentInit\n} from '@angular/core';\nimport { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';\nimport { BaseDirective } from './base.directive';\n\nexport enum ScrollDirection {\n NONE,\n X,\n Y,\n BOTH\n}\n\n@Directive({\n selector: '[cdkDropList][scrollContainer]'\n})\nexport class CdkDropListScrollContainer extends BaseDirective\n implements OnChanges, AfterContentInit {\n /** Direction of scroll to determine updating the position of the drop list */\n @Input() direction: ScrollDirection = ScrollDirection.X;\n /** Name of the scroll container for the list */\n @Input() scrollContainer: string;\n /** Scroll container element */\n public element: HTMLElement;\n /** Last scroll position */\n public last_scroll: { x: number; y: number } = { x: 0, y: 0 };\n\n /** Draggable children elements */\n @ContentChildren(CdkDrag) private items: QueryList;\n\n constructor(private _cdkDropList: CdkDropList, private _renderer: Renderer2) {\n super();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.scrollContainer && this.scrollContainer) {\n this.element = this._cdkDropList.element.nativeElement.closest(\n this.scrollContainer\n ) as HTMLElement;\n }\n }\n\n public ngAfterContentInit(): void {\n this.subscription(\n 'drag_items',\n this.items.changes.subscribe((items: QueryList) => {\n const list = items.toArray();\n list.forEach((i, index) => {\n this.subscription(\n `list-item-${index}`,\n this._renderer.listen(i.element.nativeElement, 'mousedown', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'mouseup', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n this.subscription(\n `list-item-touch-${index}`,\n this._renderer.listen(i.element.nativeElement, 'touchstart', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'touchend', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n });\n })\n );\n }\n\n /** Start listing for scroll events on the container */\n public onDrag() {\n if (this.element) {\n this.subscription(\n 'scroll',\n this._renderer.listen(this.element, 'scroll', () => this.updateListPosition())\n );\n }\n }\n\n /** Stop listening for scroll events on the container */\n public onDrop() {\n this.unsub('scroll');\n }\n\n /**\n * Forcefully update the position data of the drop list\n */\n private updateListPosition() {\n this.timeout(\n 'update_positions',\n () => {\n const scroll = { x: this.element.scrollLeft, y: this.element.scrollTop };\n if (\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.Y) &&\n scroll.y !== this.last_scroll.y) ||\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.X) &&\n scroll.x !== this.last_scroll.x)\n ) {\n (this._cdkDropList._dropListRef as any)._cacheOwnPosition();\n (this._cdkDropList._dropListRef as any)._siblings.forEach(i =>\n i.isReceiving() ? i._cacheOwnPosition() : null\n );\n }\n this.last_scroll = scroll;\n },\n 50\n );\n }\n}\n","import MockDate from 'mockdate';\n\n/**\n * August 13, 2020 at 7:22:12 UTC\n */\nconst initialTime = 1597346532 * 1000;\n\nexport const mockDate = (timeOverride = initialTime) => MockDate.set(new Date(timeOverride));\n\nexport const resetDate = () => MockDate.reset();\n","import { DateNow, DateTZ } from '@mckinsey-converge/date-tz'\nimport { DateTime } from 'luxon';\nimport * as dayjs from 'dayjs';\nimport {\n dayJsHoursMinutes,\n dayJsTimeFormatString,\n} from './general.utilities';\n\n/**\n * Allows you to split up durations into a group.\n */\nexport interface DurationGroup {\n /**\n * Step amount to generate between start and max.\n */\n step: number;\n /**\n * Where to start in minutes.\n */\n start: number;\n /**\n * Where to end in minutes.\n */\n max: number;\n}\n\n/**\n * Find the multiple of `stepMinute` which is closest to the 'minutes' property of the given date.\n * @param date - Any Lexon date.\n * @param stepMinute - The number of minutes between one timeslot and the next. Integer value\n * 1 to 59, inclusive.\n */\n// R--- depreciate this one\nexport const closestToTimeSlot = (date: DateTime, stepMinute: number, start: number = 0) : DateTime => {\n return date.set({ millisecond: 0, second: 0, minute: Math.ceil(date.minute / stepMinute) * stepMinute })\n .plus({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\nexport const closestToTimeSlotTz = (dateTz: DateTZ, stepMinute: number, start: number = 0) : DateTZ => {\n return dateTz.setValue({ millisecond: 0, second: 0, minute: Math.ceil(dateTz.minutes / stepMinute) * stepMinute })\n .addValue({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as hrs, or minutes as mins\n */\nexport function durationHumanized(duration: number, short: boolean = false): string {\n if (!duration || duration < 0) {\n return '';\n }\n const h = Math.floor(duration / 60);\n let d = `${h >= 1 ? h + (short ? ' hr' : ' hour' + (h === 1 ? '' : 's')) : ''}`;\n if (duration % 60 !== 0) {\n if (d) {\n d += short ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${m >= 1 ? m + (short ? ' min' : ' minute' + (m === 1 ? '' : 's')) : ''}`;\n }\n return d;\n}\n\nexport const weekDayMonthYearFormat = (date: DateTZ): string => date.formatDate('ccc dd MMM yyyy');\n\n/**\n * Tries to extract best-fit input\n * @return undefined if not valid. otherwise if good\n */\nexport const extractDateFromInput = (input: string,\n checkHour,\n startDate: dayjs.Dayjs): dayjs.Dayjs | undefined => {\n // check if input has am/pm or normal 24 hour time.\n // let date = dayjs(input, 'HH:mm');\n // let date = dayjs(input, 'h:mma');\n let date = dayjs(input, dayJsTimeFormatString());\n if (!date.isValid()) {\n // patch if time is in format xx:x to assume you meant xx:x0\n let cleanedInput = input;\n const times = input.split(':');\n if(!input){\n return undefined\n }\n if (times.length === 2) {\n if (times[1].length === 1) {\n cleanedInput = `${times[0]}:${times[1]}0`;\n }\n }\n // may be other input, lets try next value (without am/pm)\n date = dayjs(cleanedInput, dayJsHoursMinutes());\n // might be just purely an hour\n if (!date.isValid() && checkHour) {\n date = dayjs(input, 'H');\n }\n }\n // We expect input times to be in the future. If now is in the afternoon, this\n // simple block will ensure the returned date is also in the afternoon.\n //\n // NB: dayjs parses times as morning by default.\n if (date.isValid()) {\n // Move to the selected start date\n date = date.month(startDate.month()).date(startDate.date()).year(startDate.year());\n if (startDate.hour() > date.hour() && date.date() === startDate.date()) {\n date = date.set('hour', date.hour() + 12);\n }\n }\n\n return date.isValid() ? date : undefined;\n};\n\n\n/**\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 3. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n * @param step The step between time slots.\n * @param input The input text.\n */\nexport const nearestStepToInput = (\n step: number,\n input: string,\n currentStartDate: number,\n start: number = 0\n): string => {\n let date = extractDateFromInput(input, false, dayjs(currentStartDate));\n if (date) {\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, step, start);\n return closestDate.toFormat(dayJsHoursMinutes());\n } else {\n return input;\n }\n};\n/**\n * Similiar to {@link nearestStepToInput} instead:\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds which duration group is closest to the currentStartDate. If not found\n * return vanilla text.\n * 3. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 4. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n */\nexport const nearestDurationToInput = (durationGroups: DurationGroup[],\n currentStartDate: number,\n value: string): string => {\n\n let date = extractDateFromInput(value, false, dayjs(currentStartDate));\n\n if (!date) {\n // Check if the input is a duration \n const duration = parseInt(value);\n if (typeof (duration) === 'number' && value.indexOf(':') === -1 && duration > 12) {\n date = dayjs(currentStartDate).add(duration, 'm');\n }\n }\n\n if (date) {\n const minutes = date.diff(currentStartDate, 'minute');\n const closestDurationGroup = durationGroups.find(d => {\n return (minutes <= d.max);\n });\n if (closestDurationGroup) {\n const offset = [closestDurationGroup].reduce((previousValue, currentValue) => {\n return previousValue + currentValue.start;\n }, 0);\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, closestDurationGroup.step, 0);\n return closestDate.toFormat(dayJsHoursMinutes());\n }\n }\n\n return value;\n};\n\nexport const resetSecondsOnTimestamp = (timestamp: number) => {\n return DateTime.fromMillis(timestamp).set({ second: 0, millisecond: 0 }).toMillis();\n}\n\nexport const formatDateWithSuffix = (date: string): string => {\n const dateObj = new Date(date);\n const day = dateObj.getDate();\n const month = dateObj.toLocaleString(\"default\", { month: \"short\" });\n const year = dateObj.getFullYear();\n return `${day}${nthNumber(day)} ${month} ${year}`; //this.event.date_string;\n}\n\nconst nthNumber = (number) => {\n return number > 0\n ? [\"th\", \"st\", \"nd\", \"rd\"][\n (number > 3 && number < 21) || number % 10 > 3 ? 0 : number % 10\n ]\n : \"\";\n};\n\nexport const getListOfDateFormat = () => {\n return [\t\n 'MMMM dd y', \t//March 07 2023\n 'MMM dd, y',\t//Mar 07 2023\n 'MMMM dd',\t\t//March 07\n 'MMM dd', \t\t//Mar 07\n 'MM dd', \t\t//03 07\n\n 'MM-dd-yy',\t\t//03-07-23\n 'MM-dd-yyyy',\t//03-07-2023\n 'MMMM-dd-yyyy', //March-07-2023\n 'MMMM-dd-yy',\t//March-07-23\n\n 'MMMM-dd',\t\t//March-07\n 'MMM-dd',\t\t//Mar-07\n \n 'MMM-dd-y',\t\t//Mar-07-2023\n\n 'MM/dd',\t\t//03/07\n 'MM/dd/yy',\t\t//03/07/23\n 'MM/dd/yyyy',\t//03/07/2023\n \n 'dd/MM',\t\t//07/03\n 'dd/MM/yy',\t\t//07/03/23\n 'dd/MM/yyyy',\t//07/03/2023\n \n 'dd-MMMM',\t\t//07-March\n 'dd MMMM',\t\t//07 March\n 'dd-MMM',\t\t//07-Mar\n 'dd MMM',\t\t//07 Mar\n\n 'dd-MM-y',\t\t//07-03-23\n 'dd MMMM yy',\t//07 March 23\n \n 'dd/MMM/y',\t //07/Mar/2023\n 'dd/MMMM/y', //07/March/2023\n 'dd/MMM/yy', //07/Mar/23\n 'dd/MMMM/yy', //07/March/23\n \n\n 'dd-MMMM-yy',\t//07-March-23\n 'dd-MMM-yy',\t//07-Mar-23\n 'dd-MM-yy',\t\t//07-03-23\n 'MMMM-dd-yy',\t//March-07-23\n 'MMM-dd-yy',\t//Mar-07-23\n\n 'MMMM dd yy',\t//March 07 23\n 'MMM dd, yy',\t//Mar 07 23\n 'MM dd, yy',\t//03 07 23\n\n 'dd MMMM y',\t//07 March 2023\n 'dd MMM, y',\t//07 Mar 2023\n 'dd MM, yy',\t//07 03, 23\n 'dd-MMM-y',\t//07-Mar-2023\n\n 'h:mm a', // 3:30 pm\n 'h:mma' // 3:30 pm\n\n ];\n}","import { HashMap, Point } from './types.utilities';\n\nimport * as dayjs from 'dayjs';\nimport * as utc from 'dayjs/plugin/utc';\nimport * as timezone from 'dayjs/plugin/timezone';\nimport * as isToday from 'dayjs/plugin/isToday';\nimport * as weekday from 'dayjs/plugin/weekday';\nimport * as customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n// TODO: this is not the best place to import this timezone addition\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isToday);\ndayjs.extend(weekday);\ndayjs.extend(customParseFormat);\n\n/** Available console output streams. */\nexport type ConsoleStream = 'debug' | 'warn' | 'log' | 'error' | 'info';\n\n/**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\nexport function log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false,\n app_name: string = 'STAFF'\n) {\n if ((window as any).debug || force) {\n const colors: string[] = [\n 'color: #E91E63',\n 'color: #3F51B5',\n 'color: default',\n ];\n if (args) {\n console[stream](\n `%c[${app_name}]%c[${type}] %c${msg}`,\n ...colors,\n args\n );\n } else {\n console[stream](`%c[${app_name}]%c[${type}] %c${msg}`, ...colors);\n }\n }\n}\n\n/**\n * Get item from the nested object\n * @param keys List of sub-keys to search for\n * @param map Object to search\n */\n export function getItemWithKeys(keys: string[], map: HashMap) {\n const key = keys[0];\n if (map && key in map) {\n return keys.length > 1\n ? getItemWithKeys(keys.slice(1), map[key] || {})\n : map[key];\n }\n return null;\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the platform is a mobile device.\n */\nexport function isMobileDevice(): boolean {\n const r = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n return !!navigator.userAgent.match(r);\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Mobile Safari.\n */\nexport function isMobileSafari(): boolean {\n const agent = navigator.userAgent;\n return !!(\n agent.match(/iPhone|iPad|iPod/) &&\n agent.match(/AppleWebKit/) &&\n !agent.match('CriOS')\n );\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Android Chrome.\n */\nexport function isAndroidChrome(): boolean {\n const agent = navigator.userAgent;\n return !!(agent.match(/Android/) && agent.match(/Chrome/));\n}\n\n/**\n * Generate string representation of a number with zeros padding the length\n * @param value Number to pad with zeros\n * @param length Length of the resulting string\n */\nexport function padZero(value: number, length: number): string {\n let str = value.toString();\n while (str.length < length) {\n str = '0' + str;\n }\n return str;\n}\n\n/**\n * Remove duplicates from the given array\n * @param array List of items to remove duplicates from\n * @param key Key on array objects to compare for uniqueness\n */\nexport function unique(array: T[], key: keyof T | undefined = undefined) {\n return array.filter(\n (el, pos, arr) =>\n el &&\n arr.indexOf(\n key\n ? arr.find((i) => i && i[key] === el[key])\n : arr.find((i) => i === el)\n ) === pos\n );\n}\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as h\n */\nexport function humaniseDuration(durationInput: number, size: string = 'long') {\n const duration = Math.floor(durationInput);\n if (!duration || duration < 0) {\n return '';\n }\n let singular = false;\n let format = { hours: ' hour', minutes: ' minute' };\n switch (size) {\n case 'medium':\n format = { hours: 'hr', minutes: 'min' };\n break;\n case 'short':\n format = { hours: 'h', minutes: 'm' };\n singular = true;\n break;\n }\n const h = Math.floor(duration / 60);\n let d = `${\n h >= 1\n ? h +\n (singular ? format.hours : format.hours + (h === 1 ? '' : 's'))\n : ''\n }`;\n if (duration % 60 !== 0) {\n if (d) {\n d += singular ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${\n m >= 1\n ? m +\n (singular\n ? format.minutes\n : format.minutes + (m === 1 ? '' : 's'))\n : ''\n }`;\n }\n return d;\n}\n\n/**\n * Get a filtered list of items\n * @param filter Value to filter on\n * @param items List of results to filter\n * @param fields Fields to check for matches on each item\n */\nexport function filterList(\n filter: string,\n items?: T[],\n fields: string[] = ['id']\n): T[] {\n let results: any[];\n // Tokenise filter string\n const filters = (filter || '').toLowerCase().split(' ');\n const list = {};\n for (const f of filters) {\n /* istanbul ignore else */\n if (f) {\n /* istanbul ignore else */\n if (!list[f]) {\n list[f] = 0;\n }\n list[f]++;\n }\n }\n // Group similar tokens\n const parts = [];\n for (const f in list) {\n /* istanbul ignore else */\n if (list.hasOwnProperty(f)) {\n parts.push({ word: f, count: list[f], regex: new RegExp(f, 'gi') });\n }\n }\n parts.sort(\n (a, b) => b.word.length - a.word.length || a.word.localeCompare(b.word)\n );\n const item_list = JSON.parse(JSON.stringify(items || []));\n /* istanbul ignore else */\n if (filter) {\n results = item_list.filter((item) => {\n let match_count = 0;\n item.match_index = 65535;\n item.match = '';\n const field_list = {};\n // Initialise field match variables\n for (const f of fields) {\n field_list[f] = {\n value: (item[f] || '').toLowerCase(),\n index: 65536,\n matched: 0,\n };\n }\n // Search for matches with the tokenised filter string\n for (const i of parts) {\n /* istanbul ignore else */\n if (i.word) {\n // Check fields for matches\n for (const f of fields) {\n const field = field_list[f];\n const index = field.value.indexOf(i.word);\n field.index = index < field.index ? index : field.index;\n field.matches = (\n field.value.match(i.regex) || []\n ).length;\n field.value = field.value.replace(i.regex, ' ');\n }\n // Update token match count\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.matches >= i.count) {\n match_count++;\n // Update field matches\n let changed = 0;\n const tokens = (\n item[`match_${f}`] ||\n item[f] ||\n ''\n ).split(' ');\n for (const k of tokens) {\n /* istanbul ignore else */\n if (changed >= i.count) {\n break;\n }\n /* istanbul ignore else */\n if (\n k.toLowerCase().indexOf(i.word) >= 0 &&\n k.indexOf('`') < 0\n ) {\n tokens[tokens.indexOf(k)] = k.replace(\n i.regex,\n '`$&`'\n );\n changed++;\n }\n }\n item[`match_${f}`] = tokens.join(' ');\n break;\n }\n }\n }\n }\n // Get field with the most relevent match\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.index < item.match_index && field.index >= 0) {\n item.match_index = field.index;\n item.match = f;\n }\n }\n return (\n item.match_index >= 0 &&\n item.match &&\n match_count >= parts.length\n );\n });\n } else {\n results = item_list;\n }\n // Sort by order of relevence then name\n results.sort((a, b) => {\n const diff = a.match_index - b.match_index;\n return diff === 0 ? a.name.localeCompare(b.name) : diff;\n });\n return results;\n}\n\n/**\n * Convert a match string from `filterList` to renderable HTML\n * @param str Match string to change\n */\nexport function matchToHighlight(str: string): string {\n /* istanbul ignore else */\n if (str) {\n str = str.replace(\n /\\`[a-zA-Z0-9\\@\\.\\_]*\\`/g,\n '$&'\n );\n str = str.replace(/\\`/g, '');\n }\n return str;\n}\n\n/**\n * Convert time string to ms from UTC epoch for today\n * @param time Time string in the format `HH:mm`\n */\nexport function timeToDate(time: string): number {\n const parts = time.split(':');\n const date = DateNow(new Date())\n .setValue({\n hour: +parts[0],\n minute: +parts[1],\n })\n .startOfValue('minute');\n return date.ms;\n}\n\n/**\n * Generate a random number\n * @param ceil Biggest value to generate not inclusive\n * @param floor Smallest value to generate. Defaults to 0\n */\nexport function randomInt(ceil: number, floor: number = 0) {\n return Math.floor(Math.random() * (ceil - floor)) + floor;\n}\n\n/**\n * Get time format string for locale\n * @param isLowerCaseAmPm - if true, we use lowercase for am/pm.\n */\nexport function timeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const hoursMinutes = (): string => (is24HourTime() ? 'HH:mm' : 'h:mma');\n\nexport function dayJsTimeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const dayJsHoursMinutes = (): string =>\n is24HourTime() ? 'HH:mm' : 'h:mm';\n\n/**\n * Converts a timeZone name into a date object.\n * @param timeZoneName - name of timezone\n */\nexport const timezoneNameToDate = (\n timeZoneName: string | undefined\n): DateTZ | undefined => {\n let zone: DateTZ | undefined;\n if (timeZoneName) {\n try {\n zone = DateNow(new Date()).toZone(timeZoneName);\n } catch (e) {\n // invalid timezone. Suppress logs here.\n // console.error(e);\n }\n }\n return zone;\n};\n\nexport const timezoneDisplay = (date: DateTZ) =>\n !!date ? `${date.formatDate('ZZZZ')}` : '';\nexport const gmtOffsetDisplay = (date: DateTZ) =>\n !!date ? `(GMT${date.formatDate('ZZ')})` : '';\n\n/**\n * Returns a full time with timezone.\n * @param date\n */\nexport function timeWithZoneFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${timezoneDisplay(date)}`;\n}\n\nexport function timeWithGmtOffsetFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(date)}`;\n}\n\n/**\n * Returns a full start end range.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}`;\n}\n\n/**\n * Returns a full start end range with timezone.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeWithZoneFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(startDateTz)}`;\n}\n\n/**\n * Returns a full date with weekday day month year.\n * @param date\n * @param comma optional boolean to display a comma after the month\n */\nexport function dateLocalFormatString(date: DateTZ, comma?: boolean): string {\n if (comma) {\n return date.formatLocalDate('cccc d MMMM, yyyy');\n }\n return date.formatLocalDate('cccc d MMMM yyyy');\n}\n\nexport function dateBuildingFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('cccc d MMMM, yyyy');\n }\n return date.formatDate('cccc d MMMM yyyy');\n}\n\nexport function shorterLocalDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatLocalDate('ccc d MMM, yyyy');\n }\n return date.formatLocalDate('ccc d MMM yyyy');\n}\n\nexport function shorterBuildingDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('ccc d MMM, yyyy');\n }\n return date.formatDate('ccc d MMM yyyy');\n}\n\n/** Whether locale string is displayed in 24 hour time */\nexport function is24HourTime(): boolean {\n const date = new Date();\n const localeString = date\n .toLocaleTimeString(\n document.querySelector('html').getAttribute('lang') ||\n navigator.language\n )\n .toLowerCase();\n return localeString.indexOf('am') < 0 && localeString.indexOf('pm') < 0;\n}\n\n/* istanbul ignore next */\n/**\n * Downloads a file to the users computer with the given filename and contents\n * @param filename Name of the file to download\n * @param contents Contents of the file to download\n */\nexport function downloadFile(filename: string, contents: string) {\n const element = document.createElement('a');\n element.setAttribute(\n 'href',\n 'data:text/plain;charset=utf-8,' +\n encodeURIComponent('\\uFEFF' + contents)\n );\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n}\n\n/**\n * Parse raw CSV data into a JSON object\n * @param csv CSV data to parse\n */\nexport function csvToJson(csv: string) {\n const lines = csv.split('\\n');\n let fields = lines.splice(0, 1)[0].split(',');\n fields = fields.map((v) => v.replace('\\r', ''));\n const list: any[] = [];\n for (const line of lines) {\n let parts = line.split(',');\n parts = parts.map((v) => v.replace('\\r', ''));\n /* istanbul ignore else */\n if (parts.length >= fields.length) {\n const item: any = {};\n for (let i = 0; i <= parts.length; i++) {\n let part = null;\n part = parts[i];\n /* istanbul ignore else */\n if (part !== undefined) {\n item[(fields[i] || '').split(' ').join('_').toLowerCase()] =\n part;\n }\n }\n list.push(item);\n }\n }\n\n return list;\n}\n\n/**\n * Convert javascript array to CSV string\n * @param json Javascript array to convert\n */\nexport function jsonToCsv(json: HashMap[]) {\n /* istanbul ignore else */\n if (json instanceof Array && json.length > 0) {\n const keys = Object.keys(json[0]);\n const valid_keys = keys.filter((key) => json[0].hasOwnProperty(key));\n return `${valid_keys.join(',')}\\n${json\n .map((item) =>\n valid_keys\n .map((key) => {\n return typeof item[key] !== 'boolean'\n ? `\"${item[key] || ''}\"`\n : item[key];\n })\n .join(',')\n )\n .join('\\n')}`;\n }\n return '';\n}\n\n/* istanbul ignore next */\n/**\n * detect IE\n * returns version of IE or false, if browser is not Internet Explorer\n */\nexport function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n/**\n * Grab point details from mouse or touch event\n * @param event Event to grab details from\n */\nexport function eventToPoint(event: MouseEvent | TouchEvent): Point {\n if (!event) {\n return { x: -1, y: -1 };\n }\n if (event instanceof MouseEvent) {\n return { x: event.clientX, y: event.clientY };\n } else {\n return event.touches && event.touches.length > 0\n ? { x: event.touches[0].clientX, y: event.touches[0].clientY }\n : { x: -1, y: -1 };\n }\n}\n\n/* istanbul ignore next */\n/**\n * Flatten nested array\n * @param an_array Array to flatten\n */\nexport function flatten(an_array: T[]) {\n const stack = [...an_array];\n const res = [];\n while (stack.length) {\n // pop value from stack\n const next = stack.pop();\n if (Array.isArray(next)) {\n // push back array items, won't modify the original input\n stack.push(...next);\n } else {\n res.push(next);\n }\n }\n // reverse to restore input order\n return res.reverse();\n}\n\nconst seed = xmur3('PlaceOS');\nconst rand = sfc32(0x9e3779b9, 0x243f6a88, 0xb7e15162, seed());\n\nexport function predictableRandomInt(ceil: number = 100, floor: number = 0) {\n return Math.floor(rand() * (ceil - floor)) + floor;\n}\n\n// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript\nfunction xmur3(str) {\n for (var i = 0, h = 1779033703 ^ str.length; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)),\n (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n var t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n\nexport function isLessThanBreakpoint(breakpoint: number): boolean {\n if (window) {\n return window.innerWidth < breakpoint;\n }\n return false;\n}\n\nexport function toTitleCase(str: string): string {\n return typeof str === 'string'\n ? str\n .toLowerCase()\n .split(' ')\n .map(function (word) {\n return word.replace(word[0], word[0].toUpperCase());\n })\n .join(' ')\n : '';\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\nimport { SpaceImageObject } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\n\n@Directive({\n selector: 'a-very-basic-component-image-that-should-not-be-used'\n})\nexport class ImageDirective extends BaseClass implements OnDestroy {\n public foundImages?: SpaceImageObject[];\n public loadImages?: BehaviorSubject\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import {\n Directive,\n ElementRef,\n HostListener\n} from '@angular/core';\n\n@Directive({\n selector: 'input[type=number], input[numbersOnly]'\n})\nexport class NumbersOnlyDirective {\n\n constructor(private _el: ElementRef) {\n }\n\n @HostListener('input', ['$event']) onInputChange(event) {\n const initalValue = this._el.nativeElement.value;\n this._el.nativeElement.value = initalValue.replace(/[^0-9]*/g, '');\n if (initalValue !== this._el.nativeElement.value) {\n event.stopPropagation();\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'replace'\n})\nexport class ReplacePipe implements PipeTransform {\n\n transform(value: string, from: string = '_', to: string = ' '): string {\n return (value|| '').split(from).join(to);\n }\n}\n","export * from './lib/bookings.module';\nexport * from './lib/bookings.actions'\nexport * from './lib/bookings.reducer'\nexport * from './lib/bookings.types'\nexport * from './lib/bookings.utils'\n","\nimport { IBookingQueryOptions, PaginatedBooking } from '@mckinsey-converge/data-common';\nimport { \n createLoadingAction\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n MyBookingsState,\n MyBookingsStoreState,\n} from './bookings.types';\nimport {\n createAction,\n props\n} from '@ngrx/store';\n\nexport const bookingStateSelector = (state: MyBookingsStoreState) => state.bookings;\n\nexport const loadBookingsWithQuery = createAction('[Bookings] Load Bookings with query', props());\n\nexport const loadHomepageBookingsResults = createLoadingAction('HomepageBookings', 'homepage');\n\nexport const loadUpcomingBookingsResults = createLoadingAction('UpcomingBookings', 'upcoming');\n\nexport const loadPastBookingsResults = createLoadingAction('PastBookings', 'past');\n\nexport const loadCancelledBookingsResults = createLoadingAction('CancelledBookings', 'cancelled');\n\nexport const loadBookingByIdResults = createLoadingAction('BookingById', 'bookingById');\n\nexport const clearBookingByIdResults = createAction('[BookingById] Clear Booking Data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n IBookingQueryOptions,\n BookingsPaginatedService\n} from '../../../data-common/src/lib/bookings';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadHomepageBookingsResults,\n loadPastBookingsResults,\n loadUpcomingBookingsResults,\n loadCancelledBookingsResults,\n loadBookingsWithQuery,\n loadBookingByIdResults\n} from './bookings.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n\n} from './bookings.utils';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Injectable()\nexport class BookingsEffects {\n constructor(private actions: Actions,\n private bookingService: BookingsPaginatedService) {\n }\n\n @Effect()\n public afterBookingsRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadBookingsWithQuery),\n mergeMap((action: LoadingAction) => {\n const date = new DateTZ({date: action.from})\n const yourBookingsRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.subtractValue({ minutes: 5 }).seconds}`,\n },\n include_rooms: true\n };\n const upcomingRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.seconds}`,\n },\n include_rooms: true\n };\n const pastRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n end_epoch: `<${date.seconds}`,\n },\n include_rooms: true\n };\n const cancelledRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: true,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n },\n include_rooms: true\n };\n const byIdRequest = {\n email: action.email,\n id: action.id,\n pagination: true,\n limit: 1,\n include_rooms: true\n };\n\n const effects = [];\n switch(action.target) {\n case 'upcoming':\n effects.push(loadUpcomingBookingsResults.request(upcomingRequest));\n break;\n case 'past':\n effects.push(loadPastBookingsResults.request(pastRequest));\n break;\n case 'cancelled':\n effects.push(loadCancelledBookingsResults.request(cancelledRequest));\n break;\n case 'bookingById':\n effects.push(loadBookingByIdResults.request(byIdRequest));\n break\n case 'homepage':\n effects.push(loadHomepageBookingsResults.request(yourBookingsRequest));\n // effects.push(loadPastBookingsResults.request(pastRequest));\n break\n default:\n }\n return effects;\n })\n );\n\n @Effect()\n public loadHomepageBookingsResultsEffect = createLoadingEffect(this.actions, loadHomepageBookingsResults,\n (action) => this.bookingService.userBookings(action, `homepage-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadUpcomingBookingsResultsEffect = createLoadingEffect(this.actions, loadUpcomingBookingsResults,\n (action) => this.bookingService.userBookings(action, `upcoming-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n \n @Effect()\n public loadPastBookingsResultsEffect = createLoadingEffect(this.actions, loadPastBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `past-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadCancelledBookingsResultsEffect = createLoadingEffect(this.actions, loadCancelledBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `cancelled-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadBookingByIdResultsEffect = createLoadingEffect(this.actions, loadBookingByIdResults,\n (action) => \n this.bookingService.userBookings(action, `bookingById-${action.id}`));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingsReducer } from './bookings.reducer';\nimport { BookingsEffects } from './bookings.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([BookingsEffects]),\n StoreModule.forFeature('bookings', bookingsReducer)\n ]\n})\nexport class BookingsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n createReducer,\n on\n} from '@ngrx/store';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n clearBookingByIdResults,\n} from './bookings.actions';\nimport { MyBookingsState } from './bookings.types';\n \nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\n\n\nexport const initialBookingsState: MyBookingsState = {\n query: LoadingModel.empty(),\n homepage: LoadingModel.empty(),\n upcoming: LoadingModel.empty(),\n past: LoadingModel.empty(),\n cancelled: LoadingModel.empty(),\n bookingById: LoadingModel.empty(),\n};\n\nexport const bookingsReducer = createReducer(initialBookingsState,\n on(clearBookingByIdResults, (state: MyBookingsState) => ({\n ...state,\n bookingById: LoadingModel.empty(),\n }) as MyBookingsState),\n ...loadHomepageBookingsResults.ons,\n ...loadUpcomingBookingsResults.ons,\n ...loadPastBookingsResults.ons,\n ...loadCancelledBookingsResults.ons,\n ...loadBookingByIdResults.ons,\n );\n\n\n\n export const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n };\n \n export const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: undefined\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n );\n \n","import { Booking } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport const mapBookingToSelectOption = (booking?: Booking): SelectOption => booking ? ({\n value: booking.id,\n display: booking.name\n}) : undefined;\n","export * from './lib/buildings.module';\nexport * from './lib/buildings.actions'\nexport * from './lib/buildings.types'\nexport * from './lib/buildings.reducer'\n","import { \n createLoadingAction,\n} from '../../../loading/src/lib/loading.actions';\nimport {\n Building,\n BuildingCity,\n} from '../../../data-common/src/lib/organisation/building.class';\nimport {\n BuildingLevel,\n} from '../../../data-common/src/lib/organisation/level.class'\nimport {\n Organisation,\n} from '../../../data-common/src/lib/organisation/organisation.class'\nimport { createSelector } from '@ngrx/store';\nimport {\n BuildingState,\n BuildingStoreState\n} from './buildings.types';\n\nexport const loadBuildings = createLoadingAction('Buildings', 'data');\n\nexport const buildingStateSelector = (state: BuildingStoreState) => state.buildings;\n\nexport const selectLoadBuildingsSuccess = createSelector(buildingStateSelector, loadBuildings.selectors.optionalSuccess);\n\n/**\n * Groups buildings by city\n */\nexport const selectBuildingOptionsGroupedByCity = createSelector(loadBuildings.selectors.optionalSuccess, (success) => {\n if (success) {\n const mapped = new Map();\n success.forEach(s => {\n const found = Array.from(mapped.keys()).find(c => c.name === s.city);\n let list = found ? mapped.get(found) : undefined;\n if (!list) {\n list = [];\n mapped.set({\n name: s.city,\n timezone: s.timezone\n }, list);\n }\n list.push(s);\n });\n return mapped;\n }\n return new Map();\n});\n\nexport const selectLevelByZoneId = createSelector(selectLoadBuildingsSuccess,\n (buildings, param: string) => {\n if (buildings) {\n return buildings.map(b => b.levels.find((l: BuildingLevel) => l.id === param))\n ?.[0] ?? undefined;\n }\n return undefined;\n });\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n Organisation,\n OrganisationService\n} from '../../../data-common/src/lib/organisation';\nimport { loadBuildings } from './buildings.actions';\nimport {\n createLoadingEffect,\n LoadingAction,\n Payload\n} from '@mckinsey-converge/loading';\nimport { loadOrganisations } from '../../../organisation/src/lib/organisation.actions';\nimport { map } from 'rxjs/operators';\n\n\n@Injectable()\nexport class BuildingsEffects {\n\n constructor(private actions: Actions,\n private organizationService: OrganisationService) {\n\n }\n\n @Effect()\n public loadBuildings = createLoadingEffect(this.actions, loadBuildings,\n (action) => this.organizationService.loadBuildingsWithOrg(action));\n\n @Effect()\n public loadBuildingsAfterOrg = this.actions.pipe(\n ofType(loadOrganisations.success),\n map((action: LoadingAction>) => loadBuildings.request(action.payload)));\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { BuildingsEffects } from './buildings.effects';\nimport { StoreModule } from '@ngrx/store';\nimport { buildingsReducer } from './buildings.reducer';\n\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n BuildingsEffects\n ]),\n StoreModule.forFeature('buildings', buildingsReducer)\n ]\n})\nexport class BuildingsModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadBuildings } from './buildings.actions';\nimport { BuildingState } from './buildings.types';\n\nexport const initialBuildingState: BuildingState = {\n data: LoadingModel.empty()\n};\n\nexport const buildingsReducer = createReducer(initialBuildingState,\n ...loadBuildings.ons\n);\n","export * from './lib/data-common.module';\nexport * from './lib/booking';\nexport * from './lib/bookings';\nexport * from './lib/catering';\nexport * from './lib/location';\nexport * from './lib/organisation';\nexport * from './lib/spaces';\nexport * from './lib/users';\nexport * from './lib/app.service';\nexport * from './lib/hotkeys.service';\nexport * from './lib/base.service';\nexport * from './lib/base-api.class';\nexport * from './lib/reports'\nexport * from './lib/service-manager.class';\nexport * from './lib/settings.service';\nexport * from './lib/spec-helpers';\nexport * from './lib/settings.interfaces';\nexport * from './lib/validation.utilities';\nexport * from './lib/status.interfaces';\nexport * from './lib/recurrence/recurrence.utils';\nexport * from './lib/close-modal-dialog-service';\nexport * from './lib/validation.utilities';\nexport * from './lib/collapse-accordion-service';","import { HashMap } from '@mckinsey-converge/base';\n\n/**\n * Convert map into a query string\n * @param map Key value pairs to convert\n */\nexport function toQueryString(map: HashMap) {\n let str = '';\n if (map) {\n for (const key in map) {\n if (map.hasOwnProperty(key) && map[key] !== undefined && map[key] !== null) {\n str += `${(str ? '&' : '')}${key}=${map[key]}`;\n }\n }\n }\n return str;\n}\n","import {\n ApplicationRef,\n Injectable,\n NgZone,\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { take, first } from 'rxjs/operators';\n\nimport { ComposerService } from '@placeos/composer';\nimport { PlaceOSOptions } from '@placeos/ts-client';\nimport { HeapIoService } from '@acaprojects/ngx-heap-io';\n\nimport {\n BehaviorSubject,\n Observable,\n Subject\n} from 'rxjs';\n\nimport {\n ApplicationLoadingState,\n BaseClass,\n ConsoleStream,\n log\n} from '@mckinsey-converge/base';\nimport { SettingsService } from './settings.service';\n\nimport { HotkeysService } from './hotkeys.service';\nimport {\n ApplicationIcon,\n ComposerSettings\n} from './settings.interfaces';\nimport { EnvironmentService } from '../../../environment/src/lib/environment.service'; // '@mckinsey-converge/environment';\nimport {\n Store\n} from '@ngrx/store';\nimport { selectCurrentUser } from '../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../user/src/lib/user.types';\nimport { Booking } from './bookings';\nimport { filter } from 'rxjs/operators';\nimport { SnackBarService } from '../../../ui/src/lib/custom-snackbar-component/custom-snackbar-component.service';\n\ndeclare global {\n interface Window {\n application: ApplicationService;\n mock: {\n enabled: boolean;\n backend: any;\n };\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationService extends BaseClass {\n /** Map of state variables for Service */\n protected _subjects: {\n [key: string]: BehaviorSubject | Subject;\n } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n _kioskFormFilter: boolean;\n\n constructor(\n public store: Store,\n public analytics: HeapIoService,\n private _app_ref: ApplicationRef,\n private _zone: NgZone,\n private _title: Title,\n private _settings: SettingsService,\n private _hotkeys: HotkeysService,\n private _composer: ComposerService,\n private _snackbar: MatSnackBar,\n private _environment: EnvironmentService,\n private snack: SnackBarService\n\n ) {\n super();\n this.set('system', null);\n this.set('title', 'Home');\n this.set('loading', {});\n this.set('CONCIERGE.day_view.viewing', null);\n this.set('undo', new BehaviorSubject<{\n action: 'series' | 'booking',\n booking: Booking\n } | null>(null));\n\n this.set('APP.breakdown', false);\n\n this._app_ref.isStable.pipe(first(_ => _)).subscribe(() => {\n this._zone.run(() => {\n this.log('APP', `Application has stablised.`);\n this.waitForSettings();\n });\n });\n }\n\n public set kioskFormFilter(isIt: boolean) {\n this._kioskFormFilter = isIt;\n }\n\n public get kioskFormFilter():boolean {\n return this._kioskFormFilter \n }\n\n /** Analytics service */\n public get Analytics() {\n return {};\n }\n\n /** Hotkeys service */\n public get Hotkeys() {\n return this._hotkeys;\n }\n\n /**\n * Get a setting from the settings service\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n return this._settings.get(key);\n }\n\n /**\n * Title of the page\n */\n public set title(value: string) {\n const title_suffix = this.setting('app.title');\n this.set('title', value);\n this._title.setTitle(`${value ? value + ' | ' : ''}${title_suffix}`);\n }\n\n /**\n * Title of the page\n */\n public get title(): string {\n return this._title.getTitle();\n }\n\n /** Root API Endpoint */\n public get endpoint() {\n return `/api/staff/`;\n }\n\n /** Root API Endpoint for engine */\n public get engine_endpoint() {\n return this._composer.auth.api_endpoint + '/';\n }\n\n /** Whether settings has been loaded */\n public get has_settings(): boolean {\n return this._settings.is_initialised;\n }\n\n /**\n * Create notification popup\n * @param type CSS Class to add to the notification\n * @param message Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n * @param icon Icon to render to the left of the notification message\n */\n public notify(\n type: string,\n message: string,\n action: string = 'OK',\n on_action?: () => void,\n icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'info'\n }\n ): void {\n this.openSnack(message, type);\n // const snackbar_ref = this._snackbar.open(message, action, {\n // panelClass: [type],\n // duration: 5000\n // });\n // this.subscription(\n // 'snackbar_close',\n // snackbar_ref.afterDismissed().subscribe(() => {\n // this.unsub('snackbar_close');\n // this.unsub('notify');\n // })\n // );\n // if (action) {\n // on_action = on_action || (() => snackbar_ref.dismiss());\n // this.subscription(\n // 'notify',\n // snackbar_ref.onAction().subscribe(() => on_action())\n // );\n // }\n }\n\n public openSnack(message, type) {\n this.snack.openSnackBar(message, type, 5000);\n }\n \n /**\n * Create success notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifySuccess(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'done'\n };\n this.notify('success', msg, action, on_action, icon);\n }\n\n /**\n * Create error notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyError(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'error'\n };\n this.notify('error', msg, action, on_action, icon);\n }\n\n /**\n * Create warning notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyWarn(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'warning'\n };\n this.notify('warn', msg, action, on_action, icon);\n }\n\n /**\n * Create info notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyInfo(msg: string, action?: string, on_action?: () => void): void {\n this.notify('info', msg, action, on_action);\n }\n\n /**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\n public log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false\n ): void {\n log(type, msg, args, stream, force);\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n return this._subjects[name] && this._subjects[name] instanceof BehaviorSubject\n ? (this._subjects[name] as BehaviorSubject).getValue()\n : null;\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n public set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /** Wait for settings to be initialised before setting up the application */\n private waitForSettings() {\n // Wait until the settings have loaded before initialising\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => this.init());\n }\n\n /**\n * Initialise application services\n */\n private init(): void {\n this.setupComposer();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe( filter(user => user !== undefined) )\n .pipe(take(1))\n .subscribe((user: any) => {\n // Once we know we have the user loaded.\n this.setupAnalytics(user?.fmno);\n })\n );\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n this._initialised.next(true);\n });\n // Add service to window if in debug mode\n if (window.debug) {\n window.application = this;\n }\n }\n\n /**\n * Initialise the composer library comms\n */\n private setupComposer(): void {\n this.log('SYSTEM', 'Setup up composer...');\n const loading: ApplicationLoadingState = this.get('loading');\n loading.composer = {\n message: 'Initialising service connection',\n state: 'loading'\n };\n this.set('loading', loading);\n // Get application settings\n const settings: ComposerSettings = this._settings.get('composer') || {};\n const protocol = settings.protocol || location.protocol;\n const host = settings.domain || location.hostname;\n const port = settings.port || location.port;\n const url = settings.use_domain ? `${protocol}//${host}:${port}` : location.origin;\n const route = host.includes('localhost') && port === '4200' ? '' : settings.route || '';\n const mock =\n this._settings.get('mock') ||\n location.href.includes('mock=true') ||\n localStorage.getItem('mock') === 'true';\n // Generate configuration object\n const config: PlaceOSOptions = {\n scope: 'public',\n host: `${host}:${port}`,\n auth_uri: `${url}/auth/oauth/authorize`,\n token_uri: `${url}/auth/token`,\n redirect_uri: `${location.origin}${route}/oauth-resp.html`,\n handle_login: !settings.local_login,\n mock\n };\n this._composer.setup(config);\n loading.composer = {\n message: 'Initialising service connection',\n state: 'complete'\n };\n this.set('loading', loading);\n }\n\n private setupAnalytics(fmno: string) {\n this.log('HEAP', `Loading heap ${this._environment?.heap_io_id}`);\n // Default Heap app ID via the default setting\n const heapIo = this._settings.get('app.heap_io');\n if (this._environment?.heap_io_id) {\n // Apply Heap app ID via the environmental setting\n heapIo.app_id = this._environment.heap_io_id;\n }\n if (heapIo) {\n this.analytics.load(heapIo);\n if (fmno) {\n this.analytics.identify(fmno);\n }\n } else {\n this.log('HEAP', `Heap could not be found for the current frontend ${this._settings.frontend}`);\n }\n }\n\n}\n","import { Subject } from 'rxjs';\n\nimport {\n BaseClass,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n ServiceLike,\n ServiceManager\n} from './service-manager.class';\n\nexport type ApiEventType = 'value_change' | 'item_saved' | 'reset' | 'other';\n\nexport interface ApiEvent {\n type: ApiEventType;\n metadata: T;\n}\n\n\nexport class BaseDataClass extends BaseClass {\n /** Subject for emitting events on the object */\n protected readonly event_subject = new Subject();\n /** Observable for events on this object */\n public readonly events = this.event_subject.asObservable();\n /** Unique Identifier of the object */\n public readonly id: string;\n /** Human readable name of the object */\n public readonly name: string;\n /** Email address associated with the object */\n public readonly email: string;\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(BaseDataClass);\n }\n\n constructor(raw_data: HashMap) {\n super();\n this.id = raw_data.id || raw_data.zone_id || raw_data.email || '';\n this.name = raw_data.name || '';\n this.email = `${raw_data.email || ''}`.toLowerCase();\n }\n\n /**\n * Save pending changes to server\n */\n public save(): Promise {\n if (this._service) {\n const form = this.toJSON();\n return new Promise((resolve, reject) => {\n const promise = this.id\n ? this._service.update(this.id, form)\n : this._service.add(form);\n promise.then(\n (d) => {\n this.event_subject.next({ type: 'item_saved', metadata: d });\n resolve(d);\n },\n (_) => reject(_)\n );\n });\n } else {\n Promise.reject('No service to process request');\n }\n }\n\n /**\n * Delete this item from the server\n */\n public delete(): Promise {\n if (this.id) {\n return this._service.delete(this.id);\n }\n }\n\n /**\n * Run task for this item on the service\n * @param task_name Name of the task\n * @param parameters Parameters to pass to the task request\n */\n public runTask(task_name: string, parameters: HashMap): Promise {\n if (this.id) {\n return this._service.task(this.id, task_name, parameters);\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: BaseDataClass): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._service;\n delete obj._changes;\n delete obj.event_subject;\n delete obj.events;\n // Remove parent private members\n delete obj._timers;\n delete obj._intervals;\n delete obj._subscriptions;\n delete obj._server_names;\n delete obj._initialised;\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substring(1)] || key.substring(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): BaseDataClass {\n return new BaseDataClass(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): BaseDataClass {\n return new BaseDataClass({ ...this, id: null, email: null });\n }\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseDataClass } from './base-api.class';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class BaseAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = typeof query_params.cache !== 'boolean' ? query_params.cache || 1000 : 1000;\n typeof query_params.cache !== 'boolean' && delete query_params.cache;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n // Bring back once implemented in the API\n // if (this.settingsService.concierge) {\n // query = query + '&check_access=true';\n // }\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: T[] | HashMap[] = [];\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n result =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryObsr(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );;\n }\n\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse | HashMap[]{\n let result: IEngineResponse | HashMap[] =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n return result;\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryRoomsForQR(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url);\n }\n \n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public \n task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * V-2\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public taskObsr( \n id: string, \n task_name: string, \n form_data: HashMap = {}, \n method: 'post' | 'get' = 'post' ):Observable{\n const query = toQueryString(this.injectConcierge(form_data));\n let engine = false;\n let cache = 1000;\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n\n const request = method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n \n return request;\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param id url id with respect to update api\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public updateObsr(id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n \n return this.http.put(url, body)\n .pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) \n ),\n catchError((error: any, result?: T) => {\n console.log(error);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n return of(error as T);\n })\n );\n\n }\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public uploadSpacePhotos(apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${apiSubRoute}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n\n const token = sessionStorage.length ? JSON.parse(sessionStorage.getItem('OAUTH.params')).access_token : '';\n\n const headers = new HttpHeaders({\n 'Authorization': `Bearer ${token}`,\n });\n \n const requestOptions = { headers: headers };\n\n // return this.httpClient.post(url, body, {\n // ...requestOptions \n // });\n\n return this.http.post(url, body);\n\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { Building } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { User } from '../users';\nimport { Space } from '../spaces';\nimport { SpaceBookingRuleOptions } from '../spaces/space.class';\nimport {\n BookingFormData,\n} from './booking.form.data';\nimport { statusFromBookings } from '../bookings/booking.utilities';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { SpaceStatus } from '../bookings/space.types';\nimport { SpaceFeatures } from '../spaces/space.class';\nimport { HashMap } from 'libs/base/src/lib/types.utilities';\n\nexport const spaceExtraFeatureToDisplayName = (feature: SpaceFeatures) => {\n switch (feature) {\n case SpaceFeatures.VideoConference:\n return 'Video conference (VC)';\n case SpaceFeatures.ConferencePhone:\n return 'Conference phone';\n case SpaceFeatures.WirelessContentSharing:\n return 'Wireless content sharing';\n case SpaceFeatures.FlipChart:\n return 'Flip chart';\n case SpaceFeatures.Glassboard:\n return 'Glassboard';\n case SpaceFeatures.ElectronicWhiteboard:\n return 'Whiteboard';\n case SpaceFeatures.ConferenceRoom:\n return 'Conference';\n case SpaceFeatures.TeamRoom:\n return 'Team';\n case SpaceFeatures.PartnerOffice:\n return 'Partner';\n case SpaceFeatures.PhoneBooth:\n return 'Phone booth';\n case SpaceFeatures.NaturalLight:\n return 'Room with window only (natural light)';\n case SpaceFeatures.BoardRoom:\n return 'Boardroom room style';\n case SpaceFeatures.CocktailRoom:\n return 'Cocktail room style';\n case SpaceFeatures.TheatreRoom:\n return 'Theatre room style';\n case SpaceFeatures.WorkshopRoom:\n return 'Workshop room style';\n case SpaceFeatures.UShapeRoom:\n return 'U Shape room style';\n case SpaceFeatures.Miscellaneous:\n return 'Miscellaneous room style'\n case SpaceFeatures.Catering:\n return 'Rooms with catering';\n // TODO: add any special display handling here.\n default:\n return feature;\n }\n};\n\n\nexport const instantBookOption: SelectOption = {\n value: 'instant-book',\n display: 'Listing you can book without waiting for a host approval',\n shortDisplay: 'Instant book'\n};\nexport const instantBookOptions: SelectOption[] = [\n instantBookOption\n];\n\nexport const mapSpaceFeaturesToSelectOption = (f: SpaceFeatures): SelectOption => {\n const display = spaceExtraFeatureToDisplayName(f);\n return ({\n value: f,\n display,\n // Useful for long text, like that of the instant-book\n // option.\n //\n // We do not expect this option object to be modified\n // at any further point before it appears on screen -\n // although that may change in future releases.\n shortDisplay: display\n });\n};\n\nexport const roomEquipmentRequiredOptions: SelectOption[] = [\n SpaceFeatures.VideoConference,\n SpaceFeatures.ConferencePhone,\n SpaceFeatures.WirelessContentSharing,\n SpaceFeatures.FlipChart,\n SpaceFeatures.Glassboard,\n SpaceFeatures.ElectronicWhiteboard\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const internalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.PartnerOffice,\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom,\n SpaceFeatures.PhoneBooth\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const externalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomDetailsRequired: SelectOption[] = [\n SpaceFeatures.NaturalLight,\n SpaceFeatures.BoardRoom,\n SpaceFeatures.CocktailRoom,\n SpaceFeatures.TheatreRoom,\n SpaceFeatures.WorkshopRoom,\n SpaceFeatures.UShapeRoom,\n SpaceFeatures.Miscellaneous\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomCateringAvailable: SelectOption[] = [\n SpaceFeatures.Catering,\n].map(mapSpaceFeaturesToSelectOption);\n\n/**\n * Defines the reason by which spaces are filtered out / missing.\n */\nexport enum SpaceFilterReason {\n /**\n * Spaces were shown and not all filtered out.\n */\n None = 'None',\n\n /**\n * If room filters are applied to the set of rooms,\n * and rooms are available if not applied by filtering.\n */\n Filters = 'Filters',\n\n /**\n * We check office rules first to determine if its been filtered.\n */\n OfficeRules = 'OfficeRules',\n\n /**\n * Fallback as the end case if no results are found.\n */\n DateTime = 'DateTime',\n\n /**\n * In case there are no results for a buiding but there are other office buidings in the same city.\n */\n AlternateBuildingsFound = 'AlternateBuildingsFound',\n\n /**\n * If room is non-bookable in the system\n */\n NonBookable = 'NonBookable'\n}\n\nexport interface FilteredSpaces {\n spaces: Space[] | undefined;\n reason: SpaceFilterReason;\n statusMap: HashMap;\n specificReason?: SpaceFilterReason;\n}\n\n/**\n * Filter spaces by filters locally. TBD in the future for real API pagination.\n *\n * @param formFilters - the set of filters to apply on the list of spaces.\n * @param spaces - the list of spaces to filter\n * @param activeForm - the landing page set of filters.\n * @param buildings - the list of buildings loaded, used to retrieve building-specific booking rules.\n * @param currentUser - the current user\n */\nexport const filterSpacesByAppliedFilters = (\n formFilters: SelectOption[],\n spaces: Space[] | undefined, // the resultshere are raw JSON Spaces, not an array of the Space class\n activeForm: BookingFormData,\n buildings: Building[] = [],\n currentUser: User | undefined,\n isStaffMap: boolean = false): FilteredSpaces => {\n const instantBook: boolean = formFilters.some(f => f.value === instantBookOption.value);\n const onlyCatering: boolean = formFilters.some(f => f.value === SpaceFeatures.Catering);\n // Drop incompatible spaces. If no filters were given, just return the array unchanged.\n const featureFilters = formFilters.filter(filter => ![instantBookOption.value, SpaceFeatures.Catering].includes(filter.value));\n const formFiltersEmpty = featureFilters.length === 0;\n\n // R--- refactor activeForm? Only after forms can handle dateTz\n // Blocked by date time input refactor\n const options: SpaceBookingRuleOptions = {\n duration: activeForm.duration,\n host: currentUser,\n dateTz: activeForm.dateTz,\n };\n let rulesCount = 0;\n let ruleReason = '';\n let excludedByFiltersCount = 0;\n const statusMap: HashMap = {};\n // console.group();\n const filteredSpaces = spaces?.map(space => space instanceof Space ? space : new Space(space)).filter(raw_space => {\n const space = new Space(raw_space); // Construct the full fledged space\n const building = buildings.find(b => space.zones.includes(b.id));\n const rules = rulesForSpace({\n time: options?.dateTz?.ms,\n duration: options.duration,\n user: options.host,\n rules: building?.booking_rules,\n space\n });\n ruleReason = rules.reason;\n let valid = !rules.hide;\n if (!valid) {\n rulesCount++;\n return false;\n }\n\n\n // Check for all the form filters ( except 'catering' )\n let hasAllFeatures: boolean;\n const internalRoomTypeFilters = [\n 'conference',\n 'meeting_room',\n 'partner',\n 'phone_booth',\n 'team_room',\n ];\n\n if (featureFilters.length === 0) {\n hasAllFeatures = true;\n } else if(featureFilters.every(f => internalRoomTypeFilters.includes(f.value))) { // If all featureFilters(selected filters) are present in internalRoomTypeFilters, make the filtering inclusive(return on first true) \n hasAllFeatures = featureFilters.some(f => space.featuresArray.includes(f.value));\n } else { // If any featureFilters(selected filters) are not present in internalRoomTypeFilters, make the filtering exclusive(return on first false)\n hasAllFeatures = featureFilters.every(f => space.featuresArray.includes(f.value));\n }\n\n const canBook = instantBook ? space.bookable : true;\n const matchesType = activeForm?.bookingType?.value === 'allRooms'\n ? true\n : space?.internal_or_external?.length\n ? space.internal_or_external === activeForm?.bookingType?.value\n : true;\n valid = valid && matchesType && (formFiltersEmpty || hasAllFeatures) && canBook;\n let hasCatering = building?.has_catering;\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n // need the room catering to override.\n if (onlyCatering && !hasCatering) {\n valid = false;\n // console.log('Excluded by Catering');\n }\n\n // count this space if the only reason it can't be shown is because one of the filters excluded it\n if (!hasAllFeatures) {\n valid = false;\n // console.log('Excluded by Status');\n }\n\n const status = statusFromBookings(\n space.bookings.length ? space.bookings.map(b => new Booking(b)) : space.settings.bookings.map(b => new Booking(b)),\n space.bookable && !rules.hide,\n !rules.auto_approve,\n activeForm.dateTz,\n space\n );\n\n // only compute room availability here right now if instant book option is chosen and room still valid.\n if (instantBook && valid) {\n valid = status.status === SpaceStatus.Available;\n if (!valid) console.group('Excluded by Status');\n \n }\n\n\n /** \n * If there are rooms that are recurring but not available at all during the queried times, we filter them out from the results displayed on the page.\n * The \"Available\" status indicates whether a room can be booked during the queried times.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\n if(activeForm.is_recurrent && !space.availableOccurrences && !isStaffMap) {\n valid = false;\n }\n /** */\n\n // cache space status\n if (valid) {\n if(activeForm.is_recurrent && space.availableOccurrences && space.availableOccurrences<= space.totalOccurrences) {\n // space is available and requested for recurrence booking and few occurences are available to book then let the space select/bookable from map with limited availability\n statusMap[space.id] = !rules.auto_approve ? SpaceStatus.Requestable : SpaceStatus.Available;\n }else\n {\n statusMap[space.id] = status.status;\n }\n \n } else {\n excludedByFiltersCount++;\n }\n // console.log('Valid:', valid);\n return valid;\n });\n\n const buildingsInSameCity = buildings.filter(\n (_) =>activeForm?.location!==undefined && activeForm?.location?.length && _.city === activeForm?.location[0]?.meta?.building?.city\n ) || [];\n const alternateBuildings = buildingsInSameCity.filter(building =>\n !activeForm.location.some(locationItem =>\n locationItem.meta?.building?.id === building.id\n )\n );\n\n // console.groupEnd();\n let reason, specificReason = SpaceFilterReason.None;\n // console.log('Spaces:', filteredSpaces?.length, excludedByFiltersCount, rulesCount, ruleReason)\n if (filteredSpaces?.length === 0) {\n if (excludedByFiltersCount > 0 && (!formFiltersEmpty || onlyCatering)) {\n reason = SpaceFilterReason.Filters;\n } else if (rulesCount > 0) {\n reason = SpaceFilterReason.OfficeRules;\n } else if(alternateBuildings){\n reason = SpaceFilterReason.AlternateBuildingsFound;\n }\n else {\n reason = SpaceFilterReason.DateTime;\n }\n\n if (ruleReason === SpaceFilterReason.OfficeRules) {\n specificReason = SpaceFilterReason.OfficeRules;\n }\n }\n\n return { spaces: filteredSpaces, reason, statusMap, specificReason };\n};\n","import { BookingFormData } from './booking.form.data';\nimport {\n createAction,\n props\n} from '@ngrx/store';\nimport { Payload } from '../../../../loading/src/lib/loading.actions';;\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\n\nexport const storeBookingFormData = createAction('[BookingForm] Store Form Data',\n props>>());\n\nexport const clearBookingFormData = createAction('[BookingForm] Clear Form Data');\n\nexport const storeRoomFilters = createAction('[BookingForm] Store Room Filters',\n props[]>>());\n\nexport const clearRoomFilters = createAction('[BookingForm] Clear Room Filters');\n\nexport const openBookingSurvey = createAction('[BookingSurvey] Open Survey Modal');\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { RoomQueryOptions } from '../../../../rooms/src/lib/rooms.types';\nimport { User } from '../users/user.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { Building } from '../organisation';\n\nexport const DEFAULT_BOOKING_DURATION = 30;\n\nexport const internalBookingTypeOption = {\n value: 'internal',\n display: 'Internal',\n};\n\nexport const allBookingTypeOption = {\n value: 'allRooms',\n display: 'All Rooms',\n};\n\nexport const bookingTypeOptions: SelectOption[] = [\n internalBookingTypeOption,\n {\n value: 'external',\n display: 'External',\n }\n];\n\nexport const defaultRoomSizeOption = {\n value: '2',\n display: '3-9 People',\n};\n\nexport const roomSizeOptions: SelectOption[] = [\n {\n value: '1',\n display: '1-2 People',\n },\n defaultRoomSizeOption,\n {\n value: '3',\n display: '10+ People',\n }\n];\n\nexport const roomSizeOptionsKiosk: SelectOption[] = [\n ...roomSizeOptions,\n {\n value: '4',\n display: 'All Rooms',\n },\n];\n\nexport const roomCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 1;\n case '2':\n return 3;\n case '3':\n return 10;\n case '4':\n return null;\n }\n};\n\nexport const roomMaxCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 2;\n case '2':\n return 9;\n default:\n return null;\n }\n};\n\nexport interface BookingFormData {\n // R--- off the rails, define these \"any's\"\n id?: string;\n location: SelectOption[];\n dateTz: DateTZ;\n /**\n * Duration, in minutes.\n */\n duration: number;\n bookingType: SelectOption;\n roomSize: SelectOption;\n selectedRoom?: any;\n organiser?: SelectOption;\n title?: string;\n attendees?: any[];\n code?: string;\n notes?: string;\n head_count?: number;\n creator?: User;\n company?: any[];\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n action?: string; // helping to set staff app recurring action flag for edit/clone in the active form\n ignore?: string; // helping while editing - recurring series rooms search api call\n bookable?: boolean; // set while editing - recurring series rooms search api call\n occurrence_edits?: string[];\n opt_out?:boolean;\n nextBusinessDay?: boolean; // set property if user room selection from next business day section on result page\n outlook_opt_out?:boolean;\n expanded_section_ids?: string[]; // set property if user room selection from next business day section on result page\n resultLoaded?: number; // set property if user room selection from any section on result page after clicking load more button\n}\n\n/**\n * Converts form data into API query parameters.\n */\nexport const roomFormDataToQuery = (\n data: BookingFormData\n): RoomQueryOptions => {\n // remove all buildings chip from query\n const filteredLocationIds = data?.location\n .filter((l) => l.groupChild)\n .map((l) => l.value)\n .join(',');\n return {\n dateTz: data?.dateTz,\n duration: data?.duration,\n locations: filteredLocationIds,\n capacity: roomCapacityToValue(data?.roomSize?.value),\n capacity_max: roomMaxCapacityToValue(data?.roomSize?.value),\n\n is_recurrent: data?.is_recurrent,\n is_multiroom: data?.is_multiroom,\n merged: data?.merged,\n recurrence_period: data?.recurrence_period,\n recurrence_interval: data?.recurrence_interval,\n recurrence_endTz: data?.recurrence_endTz,\n recurrence_count: data?.recurrence_count,\n recurrence_starts: data?.recurrence_starts,\n recurrence_exceptions: data?.recurrence_exceptions, //SHOULD BE DATETZ\n recurrence_days: data?.recurrence_days,\n timezone: data?.timezone,\n offset: data?.offset,\n buildings: data?.buildings,\n bookable: data?.bookable,\n ignore: data?.ignore\n };\n};\n","import { BookingFormState } from './booking.form.types';\nimport {\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption\n} from './booking.form.data';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nconst now = DateNow(new Date())\n\nexport const defaultTestBookingForm = (): BookingFormState => ({\n activeForm: {\n dateTz: now,\n duration: 2 * DEFAULT_BOOKING_DURATION,\n location: [],\n bookingType: internalBookingTypeOption,\n roomSize: defaultRoomSizeOption\n },\n activeFormFilters: []\n});\n","import { createSelector } from '@ngrx/store';\nimport {\n RoomStoreState\n} from '../../../../rooms/src/lib/rooms.types';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n roomStateSelector,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from '../../../../rooms/src/lib/rooms.actions';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n bookingStateSelector\n} from '../../../../bookings/src/lib/bookings.actions';\nimport { Building } from '../organisation/building.class';\nimport { BuildingStoreState } from '../../../../buildings/src/lib/buildings.types';\nimport { selectLoadBuildingsSuccess } from '../../../../buildings/src/lib/buildings.actions';\nimport { Space } from '../spaces/space.class';\nimport { User } from '../users/user.class';\nimport { selectCurrentUser } from '../../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../../user/src/lib/user.types';\nimport { LoadingModel } from '../../../../loading/src/lib/loading.model';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\nimport {\n SpaceFilterReason,\n filterSpacesByAppliedFilters,\n FilteredSpaces\n} from './booking-filter.utils';\nimport {\n BookingFormData,\n internalBookingTypeOption,\n} from './booking.form.data';\nimport {\n BookingFormState,\n BookingStoreState,\n} from './booking.form.types';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\n\n\nexport const selectBookingFormsData =\n (state: BookingStoreState | RoomStoreState | BuildingStoreState | UserStoreState) =>\n (state as any).bookingForm as BookingFormState;\n\nexport const selectActiveForm = createSelector(selectBookingFormsData, state => {\n // Recreate because serialized form dateTz doesn't have DateTZ class methods\n if (!state.activeForm?.dateTz) {\n return state.activeForm\n }\n const { date, is_local_tz, building_tz} = state.activeForm?.dateTz;\n const endTzDate = state.activeForm?.recurrence_endTz?.date;\n const recurrence_endTz = endTzDate ? {\n recurrence_endTz : new DateTZ({ date: endTzDate.valueOf(), is_local_tz, building_tz })\n } : {};\n\n const recurrence_starts = state.activeForm?.recurrence_starts\n\t\t\t? {\n\t\t\t\t\trecurrence_starts: state.activeForm?.recurrence_starts.map( el =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// at final step of booking creation process recurrence_start becomes Array which need to be Array\n\t\t\t\t\t\t\t// To Do: Refactor - apps/staff/src/app/booking/booking-create/booking-form-base.component.ts lno: 186\n\t\t\t\t\t\t\treturn new DateTZ({ date: typeof el === 'number' ? el * 1000 : el.date.valueOf(), is_local_tz, building_tz })\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\n\n const recEditingSearchPayload = (state.activeForm.action === SeriesAction.EDIT && state.activeForm.is_recurrent)\n\t\t\t?\n\t\t {\n\t\t\t\tid: state.activeForm.id,\n\t\t\t\tignore: state.activeForm.ignore,\n\t\t\t\tbookable: state.activeForm.bookable\n\t\t\t}\n\t\t\t: {};\n\n\n\n\n return {\n ...state.activeForm,\n dateTz: new DateTZ({ date: date.valueOf(), is_local_tz, building_tz }),\n ...recurrence_endTz,\n ...recurrence_starts,\n\t\t\t\t...recEditingSearchPayload\n }\n});\n\nexport const selectBookingType = createSelector(selectActiveForm,\n (form) => form?.bookingType);\n\nexport const selectBookingLocations = createSelector(selectActiveForm,\n (form) => (form?.location || []).filter(f => !f.groupHeader));\n\nexport const selectIsInternal = createSelector(selectBookingType,\n (type) => type?.value === internalBookingTypeOption.value);\n\nexport const selectFormFilters = createSelector(selectBookingFormsData,\n (state) => state.activeFormFilters || []);\n\nconst selectRoomResultsFromState = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.model);\n\nconst selectRoomResultsFromState_map = createSelector(roomStateSelector,\n loadRoomsForResultsMap.selectors.model);\n\nconst selectLaterThatDayResultsFromState = createSelector(roomStateSelector,\n loadLaterThatDayResults.selectors.model);\nconst selectNextDayResultsFromState = createSelector(roomStateSelector,\n loadNextDayResults.selectors.model);\nconst selectByIdResultsFromState = createSelector(roomStateSelector,\n loadByIdResults.selectors.model);\nconst selectDiffSizeResultsFromState = createSelector(roomStateSelector,\n loadDiffSizeResults.selectors.model);\n\nexport const selectHomepageBookingsResultsFromState = createSelector(bookingStateSelector,\n loadHomepageBookingsResults.selectors.model);\nexport const selectUpcomingBookingsResultsFromState = createSelector(bookingStateSelector,\n loadUpcomingBookingsResults.selectors.model);\nexport const selectPastBookingsResultsFromState = createSelector(bookingStateSelector,\n loadPastBookingsResults.selectors.model);\nexport const selectCancelledBookingsResultsFromState = createSelector(bookingStateSelector,\n loadCancelledBookingsResults.selectors.model);\nexport const selectBookingByIdResultsFromState = createSelector(bookingStateSelector,\n loadBookingByIdResults.selectors.model);\n\n/**\n * Wraps {@link filterSpacesByAppliedFilters} with {@link LoadingModel} interop.\n * This will only filter data if there is data to filter, and returns a success {@link LoadingModel}.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\nconst filterSpacesByAppliedFiltersIfSuccess = (\n results: LoadingModel,\n formFilters: SelectOption[],\n activeForm: BookingFormData,\n buildings: Building[] | undefined,\n currentUser: User | undefined,\n isStaffMap: boolean = false): LoadingModel => {\n const data = results.optionalSuccess;\n\n // don't filter model if no success found\n return !activeForm ? results.mutate({\n spaces: data, // the result here is a raw JSON Space, not the Space class\n reason: SpaceFilterReason.None,\n statusMap: {}\n }) : results.mutate(\n filterSpacesByAppliedFilters(formFilters, data, activeForm, buildings || activeForm.buildings, currentUser, isStaffMap));\n};\n\nexport const selectFilteredResults = createSelector(selectRoomResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectMapFilteredResults = createSelector(selectRoomResultsFromState_map,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser, isStaffMap) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser, true));\n\nexport const selectFilteredLaterDayResults = createSelector(selectLaterThatDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectFilteredNextDayResults = createSelector(selectNextDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n\nexport const selectFilteredByIdResults = createSelector(selectByIdResultsFromState,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser));\n\nexport const selectFilteredDiffSizeResults = createSelector(selectDiffSizeResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n/**\n * Maps selected options by loaded buildings.\n */\nexport const selectSelectedBuildingOptions = createSelector(\n selectBookingLocations,\n selectLoadBuildingsSuccess,\n (locations, buildings) => (locations\n .map(l => buildings?.find(b => b.id === l.value))\n .filter(f => !!f) as Building[])\n);\n\n","import { Building, BuildingCity } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { BuildingLevel } from '../organisation/level.class';\nimport { Space } from '../spaces/space.class';\nimport { SpacesService } from '../spaces/spaces.service';\nimport {\n timezoneDisplay,\n timezoneNameToDate,\n unique,\n ImageDirective,\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * If more than 3 are selected, we truncate location display.\n */\nconst MAX_ABBREV_LOCATIONS = 3;\n\nexport const mapBuildingToSelectOption = (\n city: string,\n building: Building\n): SelectOption => ({\n display: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n dropdownOverride: `${building.code}-${building.name}, ${building.address}`,\n value: building.id,\n groupId: city,\n groupChild: true,\n shortDisplay: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n meta: { building, city },\n});\n\nexport const mapCityToAllSelectOption = (\n city: BuildingCity\n): SelectOption => ({\n display: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n value: city.name,\n groupHeader: true,\n groupId: city.name,\n shortDisplay: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n meta: { city },\n});\n\n/**\n * Flattens a map of {@link BuildingCity} to {@link Building} array into a list of {@link SelectOption}.\n * @param grouped The grouping\n */\nexport const flattenDisplayOffices = (\n grouped: Map\n) => {\n const options: SelectOption[] = [];\n grouped.forEach((value, key) => {\n options.push(mapCityToAllSelectOption(key));\n value.forEach((b) =>\n options.push(mapBuildingToSelectOption(key.name, b))\n );\n });\n return options;\n};\n\n/**\n * This method will either add or remove a selected option from the selectedOptions list based on\n * these conditions:\n * 1. If the option EXISTS in the list AND is a groupHeader, de-select all of its children.\n * 2. If the option EXISTS in the list AND is a groupChild, remove it and its associated header from the list.\n * 3. If the option does NOT EXIST in the list AND is a groupHeader, select all other children.\n * 4. If the option does NOT EXIST in the list AND is a groupChild, add it to the list.\n *\n * Special note regarding item 4:\n * 4a. If that selection completes the children selection, select its associated header as well.\n */\nexport const toggleSelectedByGroup = (\n options: SelectOption[],\n selectedOptions: SelectOption[],\n option: SelectOption\n) => {\n if (selectedOptions.find((s) => s.value === option.value)) {\n return selectedOptions.filter((s) => {\n let filter = s.value !== option.value;\n // if group header, also remove any option that is the child of it.\n if (option.groupHeader) {\n filter =\n filter &&\n (!s.groupChild ||\n (s.groupChild && s.groupId !== option.groupId));\n } else if (option.groupChild) {\n // if child removing, remove the associated header.\n filter =\n filter &&\n (!s.groupHeader ||\n (s.groupHeader && s.groupId !== option.groupId));\n }\n return filter;\n });\n }\n // option does NOT EXIST\n // if adding header, add the other children to the selected list, ensuring no dupes.\n if (option.groupHeader) {\n const toSelect = options.filter(\n (v) =>\n v.groupChild &&\n v.groupId === option.value &&\n !selectedOptions.find((selected) => selected.value === v.value)\n );\n return [...selectedOptions, option, ...toSelect];\n }\n // add group child, add the group header if all satisfied\n const newGroup = [...selectedOptions, option];\n\n // check if we have selected all children from options by filtering down by city and checking if\n // they're in the selected options list.\n const remainingChildrenInGroup = options.filter(\n (o) =>\n o.groupChild &&\n o.groupId === option.groupId &&\n !newGroup.find((ng) => ng.value === o.value)\n );\n // if we dont have remaining children, add the group\n if (remainingChildrenInGroup.length === 0) {\n return [\n ...newGroup,\n options.find((o) => o.groupHeader && o.groupId === option.groupId),\n ];\n }\n return newGroup;\n};\n\n/**\n * If the list of locations are larger than {@link MAX_ABBREV_LOCATIONS}, then truncate\n * and display the remaining count.\n */\nexport const truncateLocationList = (\n locations: readonly SelectOption[]\n): string => {\n // comma separate the locations\n let truncatedLocations = [...locations];\n const shouldTruncate = locations.length > MAX_ABBREV_LOCATIONS;\n if (shouldTruncate) {\n truncatedLocations = truncatedLocations.splice(0, MAX_ABBREV_LOCATIONS);\n }\n let display = truncatedLocations\n .map((l) => l.shortDisplay || l.display)\n .join(', ');\n if (shouldTruncate) {\n display += `...(${locations.length})`;\n }\n return display;\n};\n\nexport const mapBuildingLevelToOption = (\n level?: BuildingLevel\n): SelectOption =>\n level\n ? {\n value: level.id,\n display: level.name,\n }\n : undefined;\n\n/**\n * Returns all levels included with the building, deduped.\n * @param buildings\n */\nexport const flattenBuildingsWithLevels = (buildings: Building[]) => {\n const flattenedLevels = unique(\n buildings.reduce((next: BuildingLevel[], building: Building) => {\n next.push(...building.levels);\n return next;\n }, []),\n 'id'\n );\n return {\n flattenedLevels,\n buildings,\n };\n};\n\n/** Gets route to image placeholder if room image isn't found */\n\nexport const placeholderRoute = (num: number): string => {\n let index: number;\n if (num <= 3) {\n index = num;\n } else if (num % 3 === 0) {\n index = 3;\n } else {\n index = 1;\n }\n return `assets/img/rooms/placeholder-${index}.png`;\n};\n\n/**\n * Method takes the rootFolderURL and fileSlug to create an array of three images\n * that should exist. If a room image exists, it replaces the placehoder image.\n */\nexport const setupRoomImages = (\n componentReference: ImageDirective,\n image_positions: number[],\n rootFolderURL: string,\n fileSlug: string,\n imagesLoaded: boolean = false\n): void => {\n let foundImages: any[] = image_positions.map((i) =>\n i ? { path: placeholderRoute(i) } : false\n );\n image_positions.forEach((n) => {\n const desiredImageName = `${rootFolderURL}${fileSlug}-part-${n}.png`;\n const desiredImage = location.pathname.includes('concierge') ? `${location.origin}/staff/${desiredImageName}` : desiredImageName;\n if (!imagesLoaded) {\n const tester = new Image();\n tester.onload = () => {\n // Will never run on unit test\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = [...foundImages.slice()];\n componentReference?.loadImages && componentReference?.loadImages.next([...foundImages.slice()]);\n };\n tester.src = desiredImage;\n }\n\n // Force valid image output on unit test\n if (imagesLoaded) {\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = foundImages.slice();\n }\n });\n};\n\nexport const bookingStatusDetails = (booking: Booking) => {\n const now = DateNow(new Date());\n let image = '';\n let text = '';\n let title = '';\n\n if (booking?.status) {\n const status = now > booking.endDateTz ? 'expired' : booking.status;\n switch (status) {\n case 'unavailable':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Unavailable';\n text = 'Unavailable';\n break;\n case 'declined':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'cancelled':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'expired':\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n case 'tentative':\n image = 'assets/icon/booking_pending.svg';\n title = 'Requested';\n text = 'Pending';\n break;\n case 'accepted':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n case 'approved':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n default:\n // TODO\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n }\n }\n return { text, title, image };\n};\n\nexport const roomHasCateringHours = (building: Building, space: Space) => {\n let hasCatering = building\n ? building.has_catering && building.catering_hours\n : false;\n // Room catering status as false overrides building status\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n};\n\nexport const cateringAllowed = (booking: Booking, building: Building) => {\n const status = bookingStatusDetails(booking);\n const disallowedStatus = ['declined', 'cancelled', 'expired'].includes(\n status.text\n );\n const opens = building?.catering_hours?.start;\n const closed = building?.catering_hours?.end;\n\n if (disallowedStatus) {\n return false;\n }\n\n if (typeof opens === 'undefined' || typeof closed === 'undefined') {\n return false;\n }\n\n // Catering time could be a decimal so convert to a date\n const openMinutes = opens * 60;\n const closeMinutes = closed * 60;\n\n const startOfDay = booking.startDateTz.startOfValue('day');\n const cateringOpenTime = startOfDay.addValue({ minutes: openMinutes });\n const cateringCloseTime = startOfDay.addValue({ minutes: closeMinutes });\n\n if (\n cateringOpenTime.ms <= booking.startDateTz.ms ||\n cateringCloseTime.ms > booking.startDateTz.ms\n ) {\n // Booking ends before catering opens\n if (booking.endDateTz.ms <= cateringOpenTime.ms) {\n return false;\n }\n // Booking starts after catering closes\n if (booking.startDateTz.ms > cateringCloseTime.ms) {\n return false;\n }\n\n // Start time is OK\n if (booking.startDateTz.ms > DateNow(new Date()).ms) {\n // Due to COVID, no orders are available once a meeting begins.\n return true;\n }\n }\n\n return false;\n};\n\nexport const checkCollisions = (\n service: SpacesService,\n booking: Booking\n): Promise => {\n return new Promise((resolve, reject) => {\n\n let availabilityParams: {\n room_ids: string;\n dateTz: DateTZ;\n duration: number;\n setup: number;\n breakdown: number;\n hide_bookings: boolean;\n [key: string]: any;\n } = {\n room_ids: booking.space.id,\n dateTz: booking.startDateTz,\n duration: booking.duration,\n setup: booking.setup[booking.space.email],\n breakdown: booking.breakdown[booking.space.email],\n hide_bookings: false,\n };\n\n if (booking.recurrence_type === \"master\" || booking.recurrence_type === null) {\n availabilityParams = {\n ...availabilityParams,\n ignore: booking?.icaluid,\n recurrence_count: booking?.recurrence_count,\n recurrence_period: booking?.recurrence_period,\n recurrence_endTz: booking?.recurrence_endTz,\n recurrence_interval: booking?.recurrence_interval,\n recurrence_starts: booking?.recurrence_starts,\n is_recurrent: booking?.is_recurrent,\n recurrence_days: booking?.recurrence_days\n } as typeof availabilityParams;\n }\n\n service\n .available(\n availabilityParams,\n null,\n false\n )\n .then(\n (list) => {\n const space = list.length ? list[0] : null;\n if (space) {\n if (!space.bookable) return reject('Has conflict');\n const setup = booking?.setup[space?.email] || 0;\n const breakdown = booking?.breakdown[space?.email] || 0;\n const start_time = booking?.startDateTz.seconds - setup;\n const end_time = booking.endDateTz.seconds + breakdown;\n\n const bookings = space.settings.bookings;\n // console.log('Bookings:', bookings);\n // Compare the existing bookings to see if any truely conflict.\n if (bookings.length) {\n const has_conflict = bookings.find(bkn => {\n const b_setup = bkn.setup[space.email] || 0;\n const b_breakdown = bkn.setup[space.email] || 0;\n const start = (bkn.start_epoch || bkn.start) - b_setup;\n const end = (bkn.end_epoch || bkn.end) + b_breakdown;\n return (\n (end_time > start && end_time <= end) || // Booking ends during the meeting\n (start_time >= start && start_time < end) || // Booking starts during a meeting\n (start_time <= start && end_time >= end) // Booking overlaps entire meeting\n ) && \n ( \n bkn.id !== booking.id \n || \n ( !!booking.is_recurrent && (booking.recurrence_type === \"master\" || booking.recurrence_type === null ) ) \n ?\n bkn.recurrence_master_id !== booking.id\n :\n false\n \n )\n\n\n\n });\n // Conflicts found, reject\n if (has_conflict) return reject('has booking conflict');\n }\n return resolve(space.bookable);\n }\n reject('space not found');\n },\n () => reject('available error')\n );\n });\n};\n\nexport const getStatusErrorMessage = (status?: number) => {\n let msg = '';\n switch (status) {\n\t\t\tcase 400:\n\t\t\t\tmsg = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\tbreak;\n\t\t\tcase 403:\n\t\t\t\tmsg = 'Your do not have permission to update this booking.';\n\t\t\t\tbreak;\n\t\t\tcase 409:\n\t\t\t\tmsg = 'Sorry, your booking time conflicts with another booking.';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmsg = 'Your booking failed to update, please try again';\n }\n return msg;\n};\n","export * from './room-results/room-results.viewmodel'\nexport * from './booking-filter.utils'\nexport * from './booking.form.actions'\nexport * from './booking.form.data'\nexport * from './booking.form.spec-helpers'\nexport * from './booking.form.types'\nexport * from './booking.selectors'\nexport * from './booking.utils'","import { Space } from '../../spaces/space.class';\nimport { BuildingLevel } from '../../organisation/level.class';\nimport { Building } from '../../organisation/building.class';\n\nexport class RoomResultsViewModel {\n\n public levelDisplay: string;\n public title: string;\n public office: string;\n public capacity: string;\n\n constructor(public space: Space,\n public level?: BuildingLevel,\n public building?: Building) {\n\n this.levelDisplay = `Level ${this.space?.level?.short_name}`;\n this.title = this.space.local_name;\n this.office = this.building ? `(${this.building?.code}) ${this.building?.name}` : '';\n this.capacity = `Capacity: ${this.space.capacity} people`;\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Space[],\n flattenedLevels: BuildingLevel[],\n buildings: Building[]): RoomResultsViewModel[] =>\n results.map((r: Space) => {\n const level = flattenedLevels.find(l => r.zones.includes(l.id));\n const building = buildings.find(b => r.zones.includes(b.id));\n return new RoomResultsViewModel(\n r,\n level,\n building\n );\n });\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, combineLatest, of, Observable } from 'rxjs';\nimport {\n catchError,\n debounceTime,\n filter,\n first,\n map,\n shareReplay,\n switchMap,\n} from 'rxjs/operators';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { replaceBookings, timePeriodsIntersect } from './booking.utilities';\nimport { SpacesService } from '../spaces/spaces.service';\nimport { Booking } from '../bookings/booking.class';\nimport { Space } from '../spaces/space.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { OrganisationService } from '../organisation/organisation.service';\n\nexport type BookingType =\n | 'internal'\n | 'client'\n | 'external'\n | 'setup'\n | 'training'\n | 'interview'\n | 'declined';\n\nexport interface BookingFilters {\n /** List of zone ids to get bookings for */\n zone_ids?: string[];\n space_emails?: string[];\n hide_type?: BookingType[];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class BookingStateService extends BaseClass {\n /** List of bookings */\n private _poll = new BehaviorSubject(false);\n /** List of bookings */\n private _long_poll = new BehaviorSubject<'month' | ''>('');\n private _long_poll_week = new BehaviorSubject<'week' | ''>('');\n /** List of bookings */\n private _bookings = new BehaviorSubject([]);\n /** List of meeting count per date */\n public _noOfMeetings = new BehaviorSubject<{}>({});\n /** Filter details for bookings */\n private _filters = new BehaviorSubject({});\n /** Currently active date */\n private _dateTz = new BehaviorSubject(DateNow(new Date()));\n /** Currently displayed zone */\n private _zone = new BehaviorSubject(' ');\n /** Whether booking data is being loaded */\n private _loading = new BehaviorSubject(false);\n /** Observable for filter and booking list changes */\n private _state = combineLatest(\n this._bookings,\n this._filters,\n this._dateTz,\n this._zone\n );\n\n /** Observable for list of bookings */\n public readonly bookings = this._bookings.asObservable();\n /** Observable for active date */\n public readonly dateTz = this._dateTz.asObservable();\n /** Observable for active zone */ // R-- zone was this._date.asObservable(); this looks like a mistake but it exists from the beginning of time\n public readonly zone = this._dateTz.asObservable();\n /** Observable for loading state of bookings */\n public readonly loading = this._loading.asObservable();\n\n public get booking_date() {\n // When this class is initialized this._dateTz is local timezone\n return this._dateTz.value;\n }\n\n public get timezone() {\n return localStorage.getItem('CONCIERGE.timezone');\n }\n\n /** Obsevable for filtered list of bookings */\n public readonly filtered = this._state.pipe(\n map((state) => {\n const bdTz = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const startTz = bdTz.startOfValue('day');\n const endTz = startTz.addValue({}).endOfValue('day');\n return this.filterBookings(startTz, endTz);\n }),\n shareReplay(1)\n );\n\n /** Obsevable for filtered list of bookings of the active week */\n public readonly filtered_week = this._state.pipe(\n map(() => {\n // Tested to be valid in building time now.\n const bd = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const start = bd.startOfValue('week').startOfValue('day');\n const end = this.getEndOfWeek(bd);\n return this.filterBookings(start, end);\n })\n );\n\n /** Obsevable for filtered list of bookings for active month */\n public readonly filtered_month = this._state.pipe(\n map(() => {\n const start = this.booking_date.startOfValue('month');\n const end = this.booking_date.endOfValue('month');\n return this.filterBookings(start, end);\n })\n );\n\n /** Active filters */\n public get filters() {\n return this._filters.getValue();\n }\n\n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private ngZone: NgZone,\n ) {\n super();\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Just to get the timezone correct\n this._dateTz.next(\n new DateTZ({\n date: this._dateTz.value.ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone,\n })\n );\n });\n\n /** Generate observable for updating bookings */\n const search = combineLatest(this._poll, this._zone, this._dateTz).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap(() => {\n const fzone = this._zone.getValue();\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n const start = this.booking_date.startOfValue('day');\n const end = start.endOfValue('day');\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start.seconds,\n available_to: end.seconds,\n });\n }),\n catchError(() => of([]))\n );\n\n const search_long_week = combineLatest(\n this._long_poll_week,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, false);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n\n //TO DO: make sure both spaces have same booking\n /** Subscribe to update observable */\n search.subscribe((space_list) => {\n this.processBookings(space_list);\n this._loading.next(false);\n });\n search_long_week.subscribe((space_list) => {\n this.processBookings(space_list, this._long_poll_week.getValue() as any);\n this._loading.next(false);\n });\n }\n\n /**\n * Function to build\n */\n private buildSpaceLongQuery(dailyCount: boolean = false): Observable {\n return combineLatest(\n this._long_poll,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = dailyCount ? this._org.building.id : props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, dailyCount);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n }\n\n private querySpace(type: string, fzone: string, dateTz: DateTZ, dailyCount: boolean = false) : Observable | Observable{\n const start = () => {\n const s = dateTz;\n if (type === 'week') {\n return s.startOfValue('week');\n } else {\n return s.startOfValue('month');\n }\n };\n\n const end = () => {\n const e = start();\n if (type === 'week') {\n /**\n * To Do: date-tz.class.ts endOfValue subtracts 1 day from end of week for 7 days a week type which returns Friday instead of Saturday\n * below is the adjustment -\n */\n return e.addValue({ days: 1 }).endOfValue('week');\n } else {\n return e.endOfValue('month');\n }\n /**\n * R--- when testing March 2022 London offices, the month is an hour short.\n * Is this a Luxon bug or London DST?\n */\n };\n\n // dates here are ok\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start().seconds,\n available_to: end().seconds,\n ...(dailyCount) ? { daily_count: true } : ''\n });\n }\n\n\n public getDailyMeetingCount() : void {\n this._long_poll.next('month');\n this.buildSpaceLongQuery(true).subscribe((counts) => {\n this._noOfMeetings.next(counts);\n this._loading.next(false);\n });\n }\n\n /**\n * Update the booking filters\n * @param details\n */\n public setFilters(details: BookingFilters) {\n this._filters.next(details);\n }\n\n /**\n * Update the booking date\n * @param details\n */\n public setDate(dateTz: DateTZ) {\n this._dateTz.next(dateTz);\n }\n\n /**\n * Update the booking's zone\n * @param details\n */\n public setZone(zone: string) {\n this._zone.next(zone);\n }\n\n /**\n * update day view once\n */\n public pollOnce(){\n this._poll.next(true);\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPolling(delay: number = 30 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingWeek(delay: number = 4 * 30 * 1000 ) {\n this._long_poll_week.next('week');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll_week.next('week'),\n delay\n );\n });\n }\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingEveryFiveMin(delay: number = 60 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingMonth(delay: number = 5 * 60 * 1000) {\n this._long_poll.next('month');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll.next('month'),\n delay\n );\n });\n }\n\n\n /**\n * Stop polling to update bookings;\n */\n public stopPolling() {\n this._poll.next(false);\n this.clearInterval('polling');\n this._long_poll.next('');\n this.clearInterval('polling_long');\n }\n\n public updateRoomList() {\n this._spaces.updateRoomList();\n }\n\n /**\n * Add booking to bookings listing\n * @param booking\n */\n public add(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Update booking in the bookings list\n * @param booking\n */\n public replace(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings\n .filter(\n (bkn) =>\n bkn.icaluid !== booking.icaluid && bkn.id !== booking.id\n )\n .concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Remove booking in the bookings list\n * @param booking\n */\n public remove(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.filter(\n (bkn) => bkn.icaluid !== booking.icaluid\n );\n this._bookings.next(new_bookings);\n }\n\n public attentToDelete(\n booking: Booking,\n action: 'series' | 'booking' = 'booking',\n undo: boolean = false\n ) {\n const bookings = this._bookings.getValue();\n const attempted_to_delete = ((action) => {\n return (bkg: Booking) => {\n switch (action) {\n case 'booking': {\n const booking_master = bookings.find(\n (bkn) => bkn.icaluid === booking.icaluid\n );\n if (!booking_master) return false;\n return bkg.id === booking.id;\n }\n case 'series': {\n const booking_master = bookings.find(\n (bkg) =>\n bkg.id ===\n (booking.recurrence_type === 'occurrence'\n ? booking.recurrence_master_id\n : booking.id)\n );\n if (!booking_master) return false;\n return (\n booking_master.id === bkg.id ||\n bkg.recurrence_master_id === booking_master.id\n );\n }\n default:\n false;\n }\n };\n })(action);\n\n const new_bookings = [...bookings].map((bkg) => {\n if (!undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = action;\n }\n\n if (undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = null;\n }\n\n return bkg;\n });\n\n this._bookings.next(new_bookings);\n }\n\n private processBookings(\n space_list: Space[],\n period: 'day' | 'week' | 'month' = 'day'\n ) {\n const start = () => {\n switch (period) {\n case 'month':\n return this.booking_date.startOfValue('month');\n case 'week':\n return this.booking_date.startOfValue('week');\n default:\n return this.booking_date.startOfValue('day');\n }\n };\n const end = () => {\n const s = start();\n switch (period) {\n case 'month':\n return s.endOfValue('month');\n case 'week':\n return s.endOfValue('week');\n default:\n return s.endOfValue('day');\n }\n };\n\n let bookings = this._bookings.getValue();\n space_list.forEach((space) => {\n return (bookings = replaceBookings(\n bookings,\n space.bookings.map((bkn) => new Booking(bkn)),\n {\n room_email: space.email,\n fromTz: start(),\n toTz: end(),\n }\n ));\n });\n this._bookings.next(bookings);\n }\n\n // private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n // const filters = this._filters.getValue();\n // const bookings = this._bookings.getValue();\n // const fzone = this._zone.getValue();\n // return bookings.filter((bkn) => {\n // const intersects = timePeriodsIntersect(\n // startTz.ms,\n // endTz.ms,\n // bkn.startDateTz.ms,\n // bkn.endDateTz.ms\n // );\n // const in_zone = bkn.room.zones.includes(fzone);\n // const has_space =\n // !filters.space_emails?.length ||\n // filters.space_emails.includes(bkn.room.email);\n // const in_zones =\n // !filters.zone_ids?.length ||\n // !!bkn.room.zones.find((zone) =>\n // filters.zone_ids.includes(zone)\n // );\n // const type = bkn.declined ? 'declined' : bkn.getType();\n\n // const show =\n // !filters.hide_type?.length ||\n // !filters.hide_type.includes(type as any);\n // return intersects && has_space && in_zone && in_zones && show;\n // });\n // }\n\n private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n const filters = this._filters.getValue();\n const bookings = this._bookings.getValue();\n const fzone = this._zone.getValue();\n return bookings.filter((bkn) => {\n const intersects = timePeriodsIntersect(\n startTz.ms,\n endTz.ms,\n bkn.startDateTz.ms,\n bkn.endDateTz.ms\n );\n // Check if any room in the booking satisfies the conditions\n const roomSatisfiesConditions = bkn.multi_rooms.some((room) => {\n const in_zone = room.zones.includes(fzone);\n const has_space =\n !filters.space_emails?.length ||\n filters.space_emails.includes(room.email);\n const in_zones =\n !filters.zone_ids?.length ||\n !!room.zones.find((zone) => filters.zone_ids.includes(zone));\n return in_zone && has_space && in_zones;\n });\n \n const type = bkn.declined ? 'declined' : bkn.getType();\n \n const show =\n !filters.hide_type?.length ||\n !filters.hide_type.includes(type as any);\n return intersects && roomSatisfiesConditions && show;\n });\n } \n\n /**If Sunday add one day to get Saturday as end of week */\n private getEndOfWeek(date: DateTZ): DateTZ {\n return date.dateWeekday === 7\n ? date.addValue({ days: 1 }).endOfValue('week').endOfValue('day')\n : date.endOfValue('week').endOfValue('day');\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport { CateringOrder } from '../catering';\nimport { User } from '../users';\nimport {\n flatten,\n HashMap,\n humaniseDuration,\n shorterBuildingDateFormatString,\n shorterLocalDateFormatString,\n toTitleCase,\n unique\n} from '@mckinsey-converge/base';\nimport { Space } from '../spaces/space.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport {\n BookingNote,\n} from './booking.types';\nimport { convertLocalTimestampToTimezonedDateTz, DateNow, DateTZ, getTimezoneOffsetString } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, getLastDateFromList, handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { findSpace } from '../spaces';\nimport { DateTime } from 'luxon';\n\n\nexport interface IBookingQueryOptions {\n /** booking ID */\n id?: string;\n email?: string;\n target?: string;\n from?: number; // R--- depreciate\n until?: number; // R--- depreciate\n fromTz?: DateTZ;\n untilTz?: DateTZ;\n show_cancelled?: boolean;\n pagination?: boolean;\n limit?: number;\n offset?: number;\n sort?: string,\n filters?: any;\n include_rooms?: boolean;\n building_zone?: string;\n}\n\nexport class Booking extends BaseDataClass {\n /** Unique calendar event ID */\n // public readonly icaluid: string;\n /** Subject or title of the booking */\n public title: string;\n /** Luxon based date class of the booking start time */\n public startDateTz: DateTZ;\n /** Luxon based date class of the booking start time */\n public endDateTz: DateTZ;\n /** Description or details of the booking */\n public readonly body: string;\n /** Type of booking */\n public readonly booking_type: string;\n /** List of catering orders for the booking */\n public catering: readonly CateringOrder[];\n /** Whether booking's duration covers all day */\n public readonly all_day: boolean;\n /** Mapping of emails to approval statuses */\n public approval_status: HashMap;\n /**\n * New booking approval status set in constructor\n *\n * timeBasedStatusLabel is a getter calculated via current time, some parts of the application\n * may use status when it should use timeBasedStatusLabel\n */\n public status: 'tentative' | 'accepted' | 'approved' | 'declined' | 'cancelled' | 'expired' | 'unavailable';\n /** Host/Organiser of the booking */\n public organiser: User;\n /** List of people invited to attend the booking */\n public attendees: User[];\n /** Author of the booking */\n public readonly creator: User;\n\n /** List of notes associated with the booking */\n public notes: readonly BookingNote[];\n /** Mapping of spaces to equipment charge codes */\n public equipment_codes: HashMap;\n /** Mapping of spaces to expected number of attendees */\n public expected_attendees: HashMap;\n /** Map of space emails to the setup time before the meeting in minutes */\n public setup: HashMap;\n /** List of checked in attendees */\n public check_ins: object;\n /** Map of space emails to the breakdown time before the meeting in minutes */\n public breakdown: HashMap;\n /** List of fields edited since creation */\n public readonly edits: string[];\n /** List of users to be notified on visitor arrivals */\n public readonly notify_users: readonly string[];\n /** Whether the time or duration has changed */\n public time_changed = false;\n /**\n * Booking Space\n * Bookings only have one room on MCK\n */\n public room: Space;\n /** building_zone */\n public building_zone: string;\n /** Initialized Timezone */\n public timezone: string;\n /** Array of company names */\n public company?: string[];\n /** Flag for multiroom booking */\n public is_multiroom: boolean;\n /** Multiroom booking ID */\n public multiroom_master_id: string; \n /** Merged - field holds flag for merged-multiroom booking which tightly coupled with multiroom booking only */\n public merged: boolean;\n /** Type of recurrence, Shows whether this is a master or an occurence in the series. */\n public readonly recurrence_type: string;\n /** The frequency of the recurring booking. */\n public readonly recurrence_period: RecurrencePeriod;\n /** The interval time between each period. Defaults to 1. For example, with a period of \"weekly\" and an interval of 2, the recurrencd happen every 2 weeks. */\n public readonly recurrence_interval: number;\n /** Unix epoch in seconds of the recurrence end date */\n private _recurrence_endTz: DateTZ;\n /** The number of times to repeat the recurring booking. */\n public readonly recurrence_count: number;\n /** ID of the booking considered the master */\n public readonly recurrence_master_id: string;\n /** An array of booking IDs which belong to this recurring series. This INCLUDES the master booking ID. */\n public readonly occurrence_ids: string[];\n /** A list of INDIVIDUAL edits to any of the bookings in the series. This is so we can prompt the user if they are going to override previously updated bookings with a whole-series update. */\n public readonly occurrence_edits: string[];\n /** A list of Ocurrences */\n public readonly occurrence_details: { id: string, start_epoch: number }[];\n /** When the booking was created */\n public created_epoch: number;\n /** Is the Application concierge */\n public is_concierge: boolean;\n /**helper to know if recurring toggle is on */\n public is_recurrent: boolean;\n /**array of start dates of each ocurrence in the series */\n public recurrence_starts: Array\n /**array of conflicting dates not to be included in the recurrence series */\n public recurrence_exceptions: Array\n\n public recurrence_days?: Array\n\n /** Master recurrence start */\n public recurrence_start: number;\n\n /** Start Epoch */\n public start_epoch: number;\n public end_epoch: number;\n public level_zone: string;\n public opt_out: boolean;\n public outlook_opt_out: boolean;\n public multi_rooms: Space[];\n public room_setup: any;\n public room_breakdown: any;\n public headcount: number;\n public equipment_code: string;\n\n /** Currently back-end is not properly setting the recurrence_end property, this is a workaround */\n public get recurrence_endTz(): DateTZ {\n return this._recurrence_endTz;\n }\n\n public set recurrence_endTz(date: DateTZ) {\n this._recurrence_endTz = date;\n }\n\n /** Mark a booking for deleting */\n public attempted_to_delete?: 'series' | 'booking' | null;\n\n // No specific reason to set readonly but canm be change if needed to update in future\n public readonly booked_by : string | { name: string };\n public readonly booker: Object;\n public readonly booker_concierge: Object\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = settingsService.concierge;\n\n /**\n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = new DateTZ();\n\n const defaultTitle = ''; // Blank since the create booking form will init with test values.\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n const defaultBuildingZone = null // R --- no idea, should be a building.id but which and how\n const defaultOrgainiser = User.active_user || new User(); // meh, non American use.\n const defaultBookingType = 'internal';\n\n /**\n * Process the simple raw_data with defaults mixed in\n */\n this.title = raw_data.title || defaultTitle;\n this.timezone = raw_data.timezone || defaultLocalTimezone;\n // Used by components to get the building details\n this.building_zone = raw_data.building_zone || defaultBuildingZone;\n this.body = raw_data.body || '';\n // Provided booking type\n this.booking_type = raw_data.booking_type || defaultBookingType;\n // Attendees provided in API booking data\n this.attendees = (raw_data.attendees || []).map((i) => new User(i));\n // Provided organiser, active user, or empty user?\n this.organiser = raw_data.organiser ? new User(raw_data.organiser) : defaultOrgainiser;\n // Creator is provided or defaults to the organizer\n this.creator = (raw_data.booked_by ? new User(raw_data.booked_by) : defaultOrgainiser) || this.organiser;\n // Setup and breakdown times can conflict but not the true event start and end times\n this.setup = raw_data.setup || {};\n this.breakdown = raw_data.breakdown || {};\n this.room_setup = raw_data.room_setup;\n this.room_breakdown = raw_data.room_breakdown;\n // Notes are assigned by room but we only support a single room\n this.notes = raw_data.notes || [];\n this.equipment_codes = raw_data.equipment_codes || {};\n this.equipment_code = raw_data.equipment_code || '';\n this.expected_attendees = raw_data.expected_attendees || {};\n this.headcount = raw_data.headcount;\n this.check_ins = raw_data.check_ins || {};\n this.notify_users = raw_data.notify_users?.length ? raw_data.notify_users : [this.organiser?.name];\n this.company = raw_data.company || [];\n // retain booked by if there : helps to get correct creator above\n this.booked_by = raw_data.booked_by;\n this.booker = raw_data.booker;\n this.booker_concierge = raw_data.booker_concierge;\n this.level_zone = raw_data.level_zone;\n this.opt_out = raw_data.opt_out;\n this.outlook_opt_out = raw_data.outlook_opt_out;\n\n /**\n * \n */\n this.merged = raw_data?.merged || null;\n\n /**\n * Multiroom fields\n */\n this.is_multiroom = raw_data.is_multiroom || null;\n this.multiroom_master_id = raw_data.multiroom_master_id || null;\n\n /**\n * Setup Defaults when raw_data values are not provided\n *\n * all room_ids and space_list inputs can be refactored into just room like an API booking\n *\n * raw_data.room can be provides as the Space class or JSON object\n */\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n // this.room = raw_data?.room ? (Array.isArray(raw_data?.room) && raw_data.room.length > 0) ? raw_data?.room.map((element) => new Space(element))[0]: [new Space(raw_data.room)][0] : [new Space()][0];\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n\n if (raw_data && raw_data.room) {\n if (Array.isArray(raw_data.room) && raw_data.room.length) {\n this.room = raw_data.room.map((element) => new Space(element))[0];\n } else if (Array.isArray(raw_data.room) && raw_data.room.length === 0) {\n this.room = [new Space()][0];\n } else {\n this.room = [new Space(raw_data.room)][0];\n }\n } else {\n this.room = [new Space()][0];\n }\n\n\n const room_id = raw_data.room_id || raw_data.room_ids // Not sure why we have room_id and room_ids\n if (!this.room?.id && room_id?.length) {\n this.room = findSpace(room_id[0]) || this.room;\n }\n\n const roomsData = raw_data?.multi_rooms || raw_data?.room;\n this.multi_rooms = roomsData\n ? Array.isArray(roomsData)\n ? roomsData.map((element) => new Space(element))\n : [new Space(roomsData)]\n : [new Space()];\n\n \n const room_ids = [...(raw_data?.room_id || []), ...(raw_data?.room_ids || [])];\n\n room_ids.forEach(roomId => {\n const newRoom = findSpace(roomId);\n // Check if the room is found and not already included in this.room\n if (newRoom && !this.multi_rooms.some(room => room.id === newRoom.id)) {\n // Add the new room to this.room\n this.multi_rooms.push(newRoom);\n }\n });\n\n // this.room is sometimes getting set to undefined when raw_data?.room is coming as an object\n if(this.multi_rooms.length && this.room === undefined){\n this.room = this.multi_rooms[0];\n }\n \n /**\n * Setup the booking start and end time\n *\n *\n * Booking defaults to now if start is not defined.\n * Booking durration is now a getter\n */\n // now rounded to the next 5 minute increment\n const defaultStartTz = new DateTZ({ date: nowTz.ms, is_local_tz: false, building_tz: this.timezone }).setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n\n /**\n * When saving a booking the BaseDataClass doens't know to use the toAPIJson\n * so startDateTz isn't being convert to the epoch timestamp\n *\n * I'm not testing for the end time values because we can assume those follow the same pattern.\n */\n const startEpochProvided = !!(raw_data.start_epoch || raw_data.start);\n const startDateTzProvided = !!raw_data.startDateTz;\n\n /**\n * Not trying to be fancy here, just clear.\n */\n if (!startEpochProvided && startDateTzProvided) {\n /**\n * Once a booking is saved the BaseDataClass recreates the Booking\n * but doesn't use the toApiJSON method adapt the class input, mainly the\n * startDateTz isn't converted to the start_epoch timestamp.\n */\n this.startDateTz = raw_data.startDateTz;\n this.endDateTz = raw_data.endDateTz;\n } else if (startEpochProvided) {\n /**\n * A Booking created from the API responses arrives with the booking\n * start_epoch and end_epoch timestamps.\n */\n this.startDateTz = new DateTZ({\n date: ((raw_data.start_epoch || raw_data.start) * 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n this.endDateTz = new DateTZ({\n date: ((raw_data.end_epoch || raw_data.end)* 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n } else {\n /**\n * And there are uses of new Booking where there are no inputs\n * and defaults are necessary.\n */\n this.startDateTz = defaultStartTz;\n this.endDateTz = defaultStartTz.addValue({ minutes: 60 });;\n }\n\n /**\n * End time was by design ending at one minute before, IE 4:00PM is 3:59PM,\n * because of calendar and conflcit checking\n *\n * Check and finesse it.\n * Not sure why but some booking endtime added extra seconds\n */\n if ((this.endDateTz.minutes % 5) !== 0 || this.endDateTz.second > 0) {\n // Not sure of the source but some bookings do not conform.\n this.endDateTz = this.endDateTz.setValue({ second: 0, minute: Math.round(this.endDateTz.minutes / 5) * 5 });\n }\n\n\n\n /**\n * Setup the booking created_date\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n this.created_epoch = raw_data.created_epoch || nowTz.seconds;\n\n\n /**\n * Setup the booking all_day boolean\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n if ('all_day' in raw_data) {\n this.all_day = raw_data.all_day;\n } else {\n this.all_day = !!raw_data.all_day || this.duration > 23 * 60;\n }\n\n\n // R--- TODO Concierge will use startDateTz so i'm not sure if this is needed.\n if (!this.is_concierge && this.all_day && this.timezone) {\n /**\n * Concierge has a all_day form field, I can see it may need this for that, does it really?\n */\n this.startDateTz = this.startDateTz.startOfValue('day')\n }\n\n /**\n * Setup the booking approval status\n */\n let status = raw_data.status;\n // If not provided default to approved.\n if (!raw_data.status) {\n status = 'accepted';\n }\n // \"show_as\" is a special rule to override how the applications display the status\n if (raw_data.show_as && raw_data.show_as === 'cancelled') {\n status = 'declined';\n }\n const approvalStatus = {};\n this.multi_rooms.forEach(room => {\n approvalStatus[room.email] = status;\n });\n // Tracking new \"status\" and legacy \"approval_status\" from raw_data.status.\n this.status = status;\n this.approval_status = raw_data.approval_status || {};\n\n /**\n * Catering setup\n *\n * Bring in and sort the catering order by delivery time\n */\n\n this.catering = (raw_data.catering instanceof Array ? raw_data.catering : []).map(\n (i) => new CateringOrder(i)\n );\n\n\n\n /**\n * Edited fields setup\n *\n * Bring in and sort the catering order by delivery time\n *\n * cateringOrders can return the order sorted\n */\n const edited_fields = Array.isArray(raw_data.edits)\n ? raw_data.edits\n : unique(\n flatten(\n Object.keys(raw_data.edits || {}).map((room) => {\n return flatten(Object.values(raw_data.edits[room]));\n })\n )\n );\n this.edits = edited_fields;\n\n /**\n * New Recurring booking feilds\n *\n * New fields do not match the BookingRecurrenceDetails type\n * and are simpler to manage this way\n */\n this.recurrence_count = raw_data.recurrence_count || null;\n this.recurrence_days = raw_data.recurrence_days || null;\n this.occurrence_edits = raw_data.occurrence_edits || null;\n this.recurrence_endTz = raw_data.recurrence_end ? new DateTZ({date: raw_data.recurrence_end * 1000, is_local_tz: false, building_tz: this.timezone}) : null;\n this.recurrence_exceptions = raw_data.recurrence_exceptions || null;\n this.occurrence_ids = raw_data.occurrence_ids || null;\n this.recurrence_interval = raw_data.recurrence_interval || null;\n this.recurrence_period = raw_data.recurrence_period || null;\n this.recurrence_type = raw_data.recurrence_type || null;\n this.recurrence_master_id = raw_data.recurrence_master_id\n this.occurrence_details = raw_data.occurrence_details\n this.is_recurrent = raw_data.is_recurrent || (!!this.recurrence_type && !!this.recurrence_period) || null;\n this.recurrence_starts = raw_data.recurrence_starts || []\n this.start_epoch = raw_data.start_epoch\n this.end_epoch = raw_data.end_epoch\n\n /**\n * I'm not clear why, but the booking body, aka description is copied into the notes.\n * R--- In concerge data description is only a key when saving, also in the note array?\n */\n if (raw_data.body && !this.notes.find((i) => i.type === 'description')) {\n this.notes = [\n ...this.notes,\n {\n type: 'description',\n date: 0,\n message: raw_data.body,\n author: this.organiser.email\n }\n ];\n }\n\n /**\n * In case there is a cancellation in progress the property attempted_to_delete is set to false\n * And it is persisted until the booking is gone\n */\n this.attempted_to_delete = raw_data.attempted_to_delete || null;\n }\n\n\n /** Service for managing Bookings */\n protected get _service() {\n return ServiceManager.serviceFor(Booking);\n }\n\n /** Alias to approval_status */\n public get auto_approve(): boolean {\n // if concierge we auto_approve always.\n if (this.is_concierge) {\n return true;\n }\n return !this.multi_rooms.some(room => room.byRequest({\n dateTz: this.startDateTz,\n duration: this.duration,\n host: this.organiser\n }));\n }\n\n /** Whether booking has been approved */\n public get approved(): boolean {\n return !this.declined && !this.tentative;\n }\n\n /** All of the booking attendees including the organizer */\n public get allAttendees(): User[] {\n return unique([this.organiser].concat(this.attendees), 'email');\n }\n\n /** Computer format for booking type */\n public get bookingTypeId(): string {\n return this.booking_type.toLowerCase();\n }\n\n /** Human format for booking type */\n public get bookingTypeLabel(): string {\n return toTitleCase(this.booking_type);\n }\n\n /** Get accessor for the check in object, app expect array */\n public get checkInsArray(): string[] {\n return Object.keys(this.check_ins || {})\n }\n\n /** Legacy getter for \"class\" */ // R-- TODO remove\n public get class(): string {\n return this.booking_type;\n }\n\n /** */\n public get displayEndDateTz(): DateTZ {\n if ((this.endDateTz.minutes % 5) !== 0) {\n // All the bookings should end in 59 seconds\n return this.endDateTz.addValue({ seconds: 1 });\n }\n // but if not they return 00\n return this.endDateTz;\n }\n\n /** Whether booking has been declined */\n public get declined(): boolean {\n /**\n * I'm not sure, nor is Cam if this is ever used to decline\n * all booking for a specific room\n */\n const isAnyRoomDeclined = this.multi_rooms.some(room => room.name.toLowerCase().includes('decline'));\n if (isAnyRoomDeclined) {\n return true;\n }\n\n if (this.status.includes('decline')) {\n return true;\n }\n\n return false;\n }\n\n /** Description of the booking purpose */\n public get description(): string {\n const note = (this.notes || []).find((i) => i.type === 'description');\n return note ? note.message : '';\n }\n\n /** Catering getter */\n public get cateringOrders() {\n // Return the catering orders sorted by delivery time\n return this.catering ? this.catering.slice().sort((a, b) => {\n if (a?.delivery_time > b?.delivery_time) return 1;\n if (b?.delivery_time > a?.delivery_time) return -1;\n\n return 0;\n }) : [];\n }\n\n /** Get the created date as DateTz */\n public get creationDateTz() {\n return new DateTZ({ date: this.created_epoch * 1000, is_local_tz: false, building_tz: this.timezone })\n }\n\n public get tz_offset() {\n return getTimezoneOffsetString(this.timezone);\n }\n\n /** Display value for the date */\n public get date_string(): string {\n return this.startDateTz.formatDate('dd MMM yyyy');\n }\n\n /**\n * Get the booking durration based on start and end times\n */\n public get duration(): number {\n return Math.abs(this.startDateTz.startOfValue('minute').dateDiff(this.displayEndDateTz, 'minutes'));\n }\n\n /** Unix timestamp of the booking start */\n public get date() { // R--- remove if not necessary\n return this.startDateTz.ms;\n }\n\n /** Whether booking contains external visitors in the attendee list */\n public get has_visitors(): boolean {\n return this.attendees.reduce((a, v) => a || v.external, false);\n }\n\n /** Does the booking have catering orders */\n public get has_catering(): boolean {\n return !!this.catering.length;\n }\n\n /**\n * Unique calendar event ID\n * same as this.id, used to support existing component usage\n */\n public get icaluid(): string {\n return this.id;\n }\n\n /**\n * Get the booking room id\n */\n public get room_id(): string {\n return this.room.id;\n }\n\n /** Legacy getter of room, aka space */\n public get space(): Space {\n return this.room;\n }\n\n /** Status of the booking */\n public get timeBasedStatusLabel(): 'future' | 'upcoming' | 'done' | 'started' | 'in_progress' | 'expired_yesterday' {\n const buildingTzDt = DateNow(new Date()).toZone(this.timezone) ; // building time\n\n if (DateNow(new Date()).isBeforeDate(this.startDateTz.subtractValue({ minutes: 15 }))) {\n return 'future';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz)) {\n return 'upcoming';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: 15 }))) {\n return 'started';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: this.duration }))) {\n return 'in_progress';\n }\n // if current time is 12 AM (as per timezone) and booking expired yesterday\n else if(buildingTzDt.startOfValue('day').addValue({ minutes: 1 }).isAfterDate(this.startDateTz, 'day') ) {\n return 'expired_yesterday'\n }\n\n return 'done';\n }\n\n /** Whether booking is tentative */\n public get tentative(): boolean {\n if (\n this.status &&\n this.status.indexOf('tentative') >= 0\n ) {\n return true;\n }\n\n return false;\n }\n\n /** Display valuie for the start and end times of the booking */\n public get time_period(): string {\n return `${this.startDateTz.formatDate('h:mma')} - ${this.displayEndDateTz.formatDate('h:mma')}`;\n }\n\n /** Display value for the start time of the booking */\n public get start_time(): string {\n return this.startDateTz.formatDate('h:mma');\n }\n\n /** Display value for the end time of the booking */\n public get end_time(): string {\n return this.endDateTz.formatDate('h:mma');\n }\n\n /** Display value for the duration of the booking */\n public get length_string(): string {\n return humaniseDuration(this.duration);\n }\n\n /** Display value for the location of the booking */\n // public get local_room_name(): string {\n // return this.room?.local_name || 'No location';\n // }\n public get local_room_name(): string {\n if (this.multi_rooms.length === 0) {\n return 'No location';\n } else {\n return this.multi_rooms.map(room => room.local_name).join(', ');\n }\n } \n\n /** Display value for the level of the first space in the booking */\n public get level(): string {\n return this.space.level.name;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Booking {\n return new Booking(this.toJSON());\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(isEdit = false): Booking {\n return new Booking({\n ...this.toJSON(),\n id: isEdit ? this.id : null,\n });\n }\n\n /**\n *\n * @param status\n * @returns void\n */\n public undo(status?: 'accept' | 'decline', opts: { series?: boolean } = {}): Promise {\n return this._service.undo(\n this.id, status || 'accept',\n opts\n );\n }\n\n /**\n * Delete booking from the server\n */\n public delete(opts: { series?: boolean } = {}): Promise {\n if (this.id) {\n return this._service.delete(this.id, { ...opts });\n\n // R-- ask Cam again is he's positive these extra params are not needed for anything\n // return this._service.delete(this.id, {\n // concierge: this.is_concierge,\n // host: this.organiser.email,\n // room_id: this.space?.id,\n // icaluid: this.icaluid,\n // start: json.start,\n // end: json.end\n // });\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Booking): HashMap {\n let data = super.toJSON();\n // Remove the description from the notes\n data.notes = Array.isArray(data.notes) ? data.notes.filter((note) => note.type !== 'description') : data.notes;\n // Encode the nested objects\n data.room = data.room.toJSON();\n\n\n\n data.organiser = data.organiser.toJSON();\n data.creator = data.creator?.toJSON ? data.creator.toJSON(): data.creator;\n // Map the attendees User objects\n data.attendees = data.attendees.map((i: User) => i.toJSON());\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n return data;\n }\n\n /**\n * Convert object into plain object\n */\n public toApiJSON(this: Booking): HashMap {\n let data = super.toJSON();\n\n // Update booking payload contains additional fields\n data.icaluid = \"\";\n if (data.id) {\n data.icaluid = data.id;\n data.location_name = this.multi_rooms.map((item)=>{return item.local_name}).join(', ');\n data.from_room = this.multi_rooms.map((item)=>{return item.email}).join(', ');\n data.building_zone = this.room?.building?.id;\n }\n\n /**\n * These fields are rather in flux\n * According to Cam \"approve\" will be the prefered field\n * and auto_approve and approval_status can be removed.\n */\n data.approve = this.auto_approve; // this value appear incorrect on update\n data.auto_approve = [this.auto_approve]; // Needed to update approval status until BE accepts \"approve\"\n // delete data.approval_status;\n\n // Booking start and end data\n delete data.startDateTz;\n delete data.endDateTz;\n data.start = this.startDateTz.seconds;\n data.end = this.endDateTz.seconds;\n data.old_start = this.startDateTz.seconds; // remove is not necessary\n data.old_end = this.endDateTz.seconds; // remove is not necessary\n\n // Creation date value\n delete data.created_epoch;\n data.creation_date = this.creationDateTz.seconds;\n\n // Catering fields\n // data.catering = data.catering.toJSON();\n data.catering = this.cateringOrders;\n data.has_catering = this.has_catering;\n delete data.cateringOrders\n\n // Attendees appear quite incomplete\n // Map the attendees User objects\n data.attendees = this.allAttendees.map((i: User) => i.toJSON ? i.toJSON() : i);\n\n // Orgainizer and Creator data\n data.organiser = data.organiser.toJSON ? data.organiser.toJSON() : data.organiser;\n data.creator = data.creator.toJSON ? data.creator.toJSON() : data.creator;\n\n // Convert check_ins to checked_in array\n delete data.check_ins;\n data.checked_in = this.checkInsArray;\n\n // edits - edit booking is showing all fields even w/o an edit :(\n\n // Room data\n data.room_ids = this.multi_rooms.map((item)=>{return item.email});\n delete data.room;\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n // Not found in dev data\n delete data.name;\n delete data.email;\n delete data.is_concierge;\n // delete data.building_zone;\n // delete data.status;\n\n return data;\n }\n\n public getType(): string {\n if (!this || this.status?.includes('decline')) {\n return 'cancelled';\n }\n const booking_type = this.booking_type;\n if (booking_type === 'internal' && this.has_visitors) {\n return 'external';\n }\n return booking_type;\n }\n\n /** fallback for a booking when the recurrence_end is null but it's a series booking */\n public recurrenEndFromOcurrences(occurrence_details: { id: string, start_epoch: number }[]): DateTZ {\n const date = occurrence_details?.map(occurence => occurence)\n .sort((a, b) => new Date(a.start_epoch * 1000).getTime() - new Date(b.start_epoch * 1000).getTime())\n .reverse()\n .shift()\n .start_epoch * 1000\n return new DateTZ({date, is_local_tz: false, building_tz: this.timezone});\n }\n\n public get dateString() {\n return shorterLocalDateFormatString(this.startDateTz);\n }\n public get dateBuildingString() {\n return shorterBuildingDateFormatString(this.startDateTz);\n }\n\n public get endDateString(): string {\n return shorterLocalDateFormatString(this.recurrenEndFromOcurrences(this.occurrence_details));\n }\n}\n\n/**\n * Merge catering orders with same time and location\n * @param order_list List of catering orders\n */\nexport function mergeCateringOrders(order_list: CateringOrder[]) {\n // R--- investigate when this is used. Staff doesn't use it when adding catering orders.\n for (let i = 0; i < order_list.length; i++) {\n const orders = order_list.filter(\n (order) =>\n order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time\n );\n if (orders.length > 1) {\n const new_list = order_list.filter(\n (order) =>\n !(order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time)\n );\n new_list.push(new CateringOrder({\n ...order_list[i],\n items: flatten(orders.map(order => order.items)),\n booking_date: this.startDateTz.ms,\n booking_timezone: this.booking_timezone,\n }));\n order_list = new_list;\n i = 0;\n }\n }\n return order_list;\n}\n","import { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport interface SpaceRules {\n auto_approve: boolean; // if false sapce is requestable else bookable\n hide: boolean;\n max_length?: number;\n min_length?: number;\n reason?: string // specially for non-bookable rooms\n}\n\nexport interface BookingNote {\n /** Type of note */\n type: 'equipment' | 'catering' | 'description' | 'private' | 'other' | 'catering-private';\n /** Name of the note's author */\n author: string;\n /** Contents of the note */\n message: string;\n /** Time the note was added to the booking */\n date: number;\n /** Display value for the time */\n time?: string;\n /** ID of the space associated with the note */\n space?: string;\n /** ID of the catering order associated with the note */\n order_id?: string;\n}\n\nexport interface DateDurationData {\n dateTz: DateTZ,\n duration: number,\n mobile: boolean,\n save?: boolean,\n}\n\nexport enum BOOKING_STATUS {\n approved = 'approved',\n declined = 'declined',\n tentative = 'tentative',\n unavailable = 'unavailable'\n}","import {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AvailableBookingFields } from '../settings.interfaces';\nimport {\n HashMap,\n humaniseDuration,\n mockDate as mockDateBase,\n resetDate as resetDateBase,\n timeFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { CateringOrder } from '../catering/catering-order.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { User } from '../users/user.class';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport {\n BookingRule,\n SpaceStatus\n} from './space.types';\nimport { validateEndTime } from '../validation.utilities';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\nimport { Space } from '../spaces';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\nconst MINUTE = 1;\nconst HOUR = 60;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\nconst MONTH = 30 * DAY;\n\nconst DURATION_MAP: { [duration: string]: number } = {\n month: MONTH,\n months: MONTH,\n week: WEEK,\n weeks: WEEK,\n day: DAY,\n days: DAY,\n hour: HOUR,\n hours: HOUR,\n minute: MINUTE,\n minutes: MINUTE\n};\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const mockDate = mockDateBase;\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const resetDate = resetDateBase;\n\nexport interface IBookingSlot {\n start: number;\n end: number;\n}\n\n\nexport function bookingOptionsToQuery(options: IBookingQueryOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n delete query.type;\n if (options.filters) {\n delete query.filters;\n for (const property in options.filters) {\n if (!query[property]) {\n query[property] = options.filters[property]\n }\n }\n }\n\n // id?: string;\n // cancelled?: boolean;\n if (options.until) {\n query.to = options.until;\n delete query.until;\n }\n \n }\n return query;\n}\n\n\n/**\n * Generate a list of free time slots between the given bookings\n * @param list List of bookings to find slots between\n * @param min_size Minimum length of a free slot in minutes\n */\nexport function getFreeBookingSlots(list: Booking[]=[], min_size: number = 30, dateTzMs: number = DateNow(new Date()).ms,): IBookingSlot[] {\n /* istanbul ignore else */\n if (!list.length) {\n return [\n {\n start: 0,\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n }\n ];\n }\n const slots: IBookingSlot[] = [];\n let start = new DateTZ({ date: dateTzMs });\n list.sort((a, b) => a.date - b.date);\n for (const booking of list) {\n const bkn_start = booking.startDateTz;\n const bkn_end = booking.endDateTz;\n if (bkn_start.isAfterDate(start)) {\n const diff = Math.abs(bkn_start.dateDiff(start, 'minutes'));\n /* istanbul ignore else */\n if (diff >= min_size) {\n slots.push({ start: start.ms, end: bkn_start.ms });\n }\n start = bkn_end;\n } else if (start.startOfValue('minute').ms === bkn_start.startOfValue('minute').ms) {\n start = bkn_end;\n }\n }\n slots.push({\n start: start.ms,\n // R--- these X 10's make no sense. why not + 2 years?\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n });\n\n return slots;\n}\n\n/**\n * Get the next free time slot from the given bookings\n * @param list List of bookings to find the next slot\n * @param date Date to find next slot after in ms since UTC epoch\n * @param min_size Minimum length of the free slot in minutes\n * \n * R--- Possibly depreciate, I don't see it used anywhere except for its own test\n */\nexport function getNextFreeBookingSlot(\n list: Booking[],\n date: number = DateNow(new Date()).ms,\n min_size: number = 15\n): IBookingSlot {\n const slots = getFreeBookingSlots(list, min_size, date);\n const date_ = new DateTZ({date})\n const time = date_.startOfValue('minute').setValue({ second: 1 });\n for (const block of slots) {\n const start = new DateTZ({date: block.start});\n const end = new DateTZ({date: block.end});\n if (start.startOfValue('minute').isAfterDate(time)) {\n return block;\n } else if (time.isBeforeDate(end.startOfValue('minute'))) {\n const duration = end.startOfValue('minute').dateDiff(time, 'minutes');\n /* istanbul ignore else */\n if (duration >= min_size) {\n return block;\n }\n }\n }\n return slots[slots.length - 1];\n}\n\n/**\n * Generate form fields for the given booking\n * @param booking Booking to generate form for\n * @param current_user Current user of the system to default as the host\n */\nexport function generateBookingForm(\n booking: Booking,\n use_fields: AvailableBookingFields[],\n isConcierge: boolean = false,\n manualTimezone?: string,\n action?: SeriesAction | BookingAction | null\n ): FormGroup {\n if (!booking) {\n throw Error('No booking passed');\n }\n\n const user_service = ServiceManager.serviceFor(User);\n const current_user =\n user_service.current ||\n new User({ id: 'local-user', name: 'Local User', email: 'local@place.tech' });\n\n const fields: HashMap = {\n id: new FormControl(booking.id || ''),\n space_list: new FormControl( booking.is_multiroom? booking.multi_rooms : [booking.room], []),\n room: new FormControl(booking.room, {}),\n dateTz: new FormControl({ value: booking.startDateTz || DateNow(), disabled: false }, [Validators.required]),\n duration: new FormControl({ value: booking.duration, disabled: false }),\n organiser: new FormControl(booking.organiser || current_user, [Validators.required]),\n attendees: new FormControl(booking.attendees, []),\n title: new FormControl(booking.title || '', { validators: [ Validators.required, Validators.minLength(1) ], updateOn: 'blur' }), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n booking_type: new FormControl(booking.booking_type),\n body: new FormControl(booking.body),\n notes: new FormControl(booking.notes),\n equipment_codes: new FormControl(booking.equipment_codes),\n expected_attendees: new FormControl(booking.expected_attendees),\n company: new FormControl(booking.company),\n is_multiroom: new FormControl(booking.is_multiroom),\n merged: new FormControl({value: booking?.merged, disabled: true}),\n catering: new FormControl(\n booking.cateringOrders.map(\n (order) => new CateringOrder({\n ...order,\n booking_date: booking.startDateTz.ms,\n booking_timezone: booking.timezone,\n })\n )\n ),\n all_day: new FormControl(!!booking.all_day),\n has_catering: new FormControl(!!booking.has_catering),\n needs_space: new FormControl(true),\n action: new FormControl(''),\n timezone: new FormControl(manualTimezone || \"\"),\n is_before_date: new FormControl(false)\n };\n if (!isConcierge) {\n fields.duration.setValidators([Validators.required, validateEndTime(fields.dateTz)]);\n }\n /* istanbul ignore else */\n if (booking.id && booking.id !== 'ad-hoc') {\n fields.organiser.disable();\n /* istanbul ignore else */\n if (booking.endDateTz.ms < DateNow(new Date()).ms) {\n fields.dateTz.disable();\n }\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n fields.dateTz.setValidators(dateValidators);\n fields.dateTz.updateValueAndValidity();\n }\n let list_length = -1;\n fields.space_list.valueChanges.subscribe((list) => {\n const expected = fields.expected_attendees.value || {};\n const matches = Object.keys(expected).filter((key) =>\n list?.find((space) => space.email === key)\n ).length;\n if (list && list.length && matches === 0) {\n const codes = fields.equipment_codes.value || {};\n if (Object.keys(expected).length >= 0 || Object.keys(codes).length >= 0) {\n const key = Object.keys(expected)[0] || Object.keys(codes)[0];\n const new_expected = {};\n const new_codes = {};\n const notes = fields.notes.value;\n notes.forEach((note) => (note.space === key ? (note.space = list[0].email) : ''));\n new_expected[list[0].email] = expected[key];\n new_codes[list[0].email] = codes[key];\n fields.expected_attendees.setValue(new_expected);\n fields.equipment_codes.setValue(new_codes);\n }\n }\n list_length = list?.length;\n });\n fields.dateTz.valueChanges.subscribe((_) => {\n fields.duration.updateValueAndValidity();\n });\n fields.needs_space.valueChanges.subscribe((space_needed) => {\n if (!space_needed) {\n fields.space_list.setValue([]);\n }\n });\n fields.has_catering.valueChanges.subscribe((has_catering) => {\n if (!has_catering) {\n fields.catering.setValue([]);\n }\n });\n const simplified_fields: HashMap = [\n 'id',\n 'space_list',\n 'space_ids',\n 'notes',\n 'dateTz',\n 'booking_type',\n 'equipment_codes',\n 'expected_attendees',\n 'timezone',\n 'is_before_date',\n ...use_fields\n ].reduce((map, key) => {\n /* istanbul ignore else */\n if (fields[key]) {\n map[key] = fields[key];\n }\n return map;\n }, {});\n \n if (simplified_fields.all_day) {\n const handleAllDay = (value) => {\n if (value) {\n let startOfDay = simplified_fields.dateTz.value.clone();\n // When the booking space isn't set we still need a way to determine midnight\n // and here we use the current concierge building selection's timezone.\n if (manualTimezone) {\n startOfDay = startOfDay.toZone(manualTimezone);\n }\n\n simplified_fields.dateTz.setValidators([Validators.required]);\n simplified_fields.dateTz.setValue(simplified_fields.all_day.value\n ? startOfDay.startOfValue('day')\n : simplified_fields.dateTz.value);\n simplified_fields.duration.setValue(simplified_fields.all_day.value\n ? 24 * 60\n : simplified_fields.duration.value);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.disable();\n // simplified_fields.dateTz.disable();\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n simplified_fields.dateTz.setValidators(dateValidators);\n simplified_fields.duration.setValue(booking.duration || 30);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.enable();\n simplified_fields.dateTz.enable();\n }\n };\n simplified_fields.all_day.valueChanges.subscribe(handleAllDay);\n handleAllDay(simplified_fields.all_day.value);\n }\n\n const occurrences = booking.occurrence_details || [];\n\n //Add recurrence fields\n if(action && booking.recurrence_period === RecurrencePeriod.LIST){\n booking.recurrence_starts = occurrences\n .filter(occurrence => occurrence.id !== booking.recurrence_master_id)\n .map((occurrence) => new DateTZ({date: occurrence.start_epoch * 1000, is_local_tz: false, building_tz: booking.timezone})\n ) \n }\n /**If series exists then set the start and end dates from the first and last bookings in the occurrences array\n * this prevents prefilled form errors due to individual edits\n */\n if(action && action !== SeriesAction.CLONE && action !== BookingAction.CLONE && occurrences && occurrences.length && !booking.id){\n const start_dateTz = new DateTZ({\n date: occurrences.sort((d1, d2) => d1.start_epoch - d2.start_epoch)[0].start_epoch * 1000, \n is_local_tz: false, building_tz: booking.timezone\n })\n simplified_fields.dateTz.setValue(start_dateTz)\n const end = occurrences.sort((d1, d2) => d2.start_epoch - d1.start_epoch)[0].start_epoch * 1000\n booking.recurrence_endTz = new DateTZ({date: end, is_local_tz: false, building_tz: booking.timezone}) \n }\n\n // R-- needs TZ aware fields\n const _recurr_end = simplified_fields.dateTz?.value || new DateTZ({ date: 1 }); // new DateTZ({date: simplified_fields.date?.value}) \n const fields_with_recurrence = {\n ...simplified_fields,\n recurrence_period: new FormControl(booking.recurrence_period || RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl(booking.recurrence_interval || 1),\n recurrence_endTz: new FormControl(booking.recurrence_endTz || _recurr_end.addValue({days: 1})),\n recurrence_count: new FormControl(booking.recurrence_count || 0),\n is_recurrent: new FormControl(booking.is_recurrent),\n recurrence_starts: new FormControl(booking.recurrence_starts || []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl(booking.recurrence_days || [])\n }\n\n if(booking.is_recurrent && action !== BookingAction.CLONE){\n fields_with_recurrence.recurrence_starts.setValidators([arrayWithValues])\n fields_with_recurrence.recurrence_starts.updateValueAndValidity()\n fields_with_recurrence.recurrence_endTz.setValidators([Validators.required, validDateTZ]);\n }\n // Generate form group for booking item\n const form = new FormGroup(fields_with_recurrence);\n return form;\n}\n\n/**\n * Validate whether date is in the future\n * @param control Control to check value\n */\nexport function isFuture(control: AbstractControl) {\n const dateTz = control.value; // new DateTZ({date: control.value});\n return dateTz.isBeforeDate(DateNow(new Date()).subtractValue({ minutes: 5 }))\n ? { dateTz: 'Date needs to be in the future' }\n : null;\n}\n\n/**\n * Validate whether an array has values\n * @param control Control to check value\n */\nexport function arrayWithValues (control: AbstractControl) {\n return control.value.length !== 0 ? null : { field: 'Needs at least one value'}\n}\n\n/**\n * Validate whether a date has a valid value (future or current date)\n * @param control Control to check value\n */\n export function validDate (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = new DateTZ({date: control.value})\n const now = DateNow(new Date())\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Validate whether a date has a valid DateTZ value (future or current date)\n * @param control Control to check value\n */\n export function validDateTZ (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = DateNow(control.value.JSDate);\n const now = DateNow(new Date());\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Get minimum duration from ruleset in minutes\n * Default to 5min\n */\nexport function getMinLength(rule_list: HashMap): number {\n return Object.values(rule_list).reduce((min, block) => {\n const min_block = block.reduce((min_length, el) => {\n if (el.conditions.min_length && stringToMinutes(el.conditions.min_length) > min) {\n return stringToMinutes(el.conditions.min_length);\n } else {\n return min_length;\n }\n }, 5);\n if (min_block > min) {\n return min_block;\n } else {\n return min;\n }\n }, 5) as number;\n}\n\n/**\n * Whether the first input is greater than the last. Converts duration strings into minutes\n * @param duration_1 First input can be a number in minutes or a duration string e.g. `1 hour`\n * @param duration_2 Second input can be a number in minutes or a duration string e.g. `30 minutes`\n */\nexport function durationGreaterThanOrEqual(\n duration_1: string | number,\n duration_2: string | number\n) {\n const first: number = typeof duration_1 === 'string' ? stringToMinutes(duration_1) : duration_1;\n const second: number =\n typeof duration_2 === 'string' ? stringToMinutes(duration_2) : duration_2;\n return first >= second;\n}\n\n/**\n * Conver time string into minutes\n * @param str timestring e.g. `'1 day'`, `'15 minutes'`, `'2 weeks'`\n */\nexport function stringToMinutes(str: string): number {\n const parts = str.split(' ');\n return +parts[0] * DURATION_MAP[parts[1]];\n}\n\n/**\n * Get current status within bookings\n * @param bookings List of bookings\n * @param host Host of the new event\n * @param date Datetime of the new event\n */\nexport function statusFromBookings(\n bookings: Booking[] = [],\n bookable: boolean = true,\n requestable: boolean = false,\n dateTz: DateTZ = DateNow(),\n space?: Space\n) {\n const free_slots = getFreeBookingSlots(bookings.filter((bkn) => !bkn.declined));\n const now = DateNow() // new DateTZ({date}); // now should be now\n // commeted bellow piece as correct way to get next free booking slot is at line- 488\n // const next_free_slot = free_slots.find((slot) => {\n // return slot && (slot.start > now.ms || now.ms > slot.start - slot.start % 1000 || now.ms < slot.end - slot.end % 60 * 1000);\n // // const start = new DateTZ({date: slot?.start || 0 });\n // // const end = new DateTZ({date: slot?.end || 0}); // slot end isn't late enough? or after now/\n // // return start.isAfterDate(now) || (now.isAfterDate(start.startOfValue('second')) && now.isBeforeDate(end.startOfValue('minute')))\n // });\n\n const next_free_slot = getNextFreeBookingSlot(bookings.filter((bkn) => !bkn.declined), dateTz.ms);\n \n const start = new DateTZ({date: next_free_slot?.start || 0});\n const end = new DateTZ({date: next_free_slot?.end || 0});\n const currently_free = dateTz.isAfterDate(start.startOfValue('second')) && dateTz.isBeforeDate(end.startOfValue('minute'));\n const time_until_next_block = humaniseDuration(\n currently_free ? end.dateDiff(dateTz, 'minutes') : start.dateDiff(dateTz, 'minutes'),\n 'short'\n );\n\n const free_tomorrow = !currently_free && !start.isSameDate(dateTz, 'day');\n const free_today = currently_free && !end.isSameDate(dateTz, 'day');\n \n return {\n status: (!bookable\n ? SpaceStatus.NotBookable\n : currently_free\n ? requestable\n ? SpaceStatus.Requestable\n : SpaceStatus.Available\n : SpaceStatus.InProgress) as SpaceStatus,\n available_until: free_today\n ? 'No meetings today'\n : currently_free\n ? `Free until ${end.formatDate(timeFormatString())}(${time_until_next_block})`\n : free_tomorrow\n ? 'Unavailable today'\n : `Free at ${start.formatDate(timeFormatString())}(${time_until_next_block})`\n };\n}\n\n/**\n * V1 version display.\n */\nexport const spaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'Unavailable';\n case SpaceStatus.InProgress:\n return 'Meeting in Progress';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nexport function replaceBookings(\n list: Booking[],\n new_bookings: Booking[],\n filter_options: { room_email: string; fromTz: DateTZ; toTz: DateTZ }\n) {\n const filtered_list = list.filter((booking) => {\n return (\n !(booking.multi_rooms.some(room => room?.email === filter_options.room_email)) ||\n !timePeriodsIntersect(filter_options.fromTz.ms, filter_options.toTz.ms, booking.startDateTz.ms, booking.endDateTz.ms)\n );\n });\n const updated_list = filtered_list.concat(new_bookings);\n updated_list.sort((a, b) => a.date - b.date);\n return unique(updated_list, 'icaluid');\n}\n\nexport function timePeriodsIntersect(\n start1: number,\n end1: number,\n start2: number,\n end2: number,\n type = ''\n) {\n return (\n (start1 >= start2 && start1 < end2) ||\n (end1 > start2 && end1 <= end2) ||\n (start2 >= start1 && start2 < end1) ||\n (end2 > start1 && end2 <= end1)\n );\n}\n\nexport function formatWhen({\n all_day,\n startTZ,\n endTZ,\n displayEndTZ\n}): string {\n if (all_day) {\n return `${startTZ.formatDate('dd MMM yyyy')} - All Day`;\n } else {\n if (startTZ.isSameDate(endTZ, 'day')) {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('h:mma')}`;\n } else {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('dd MMM yyyy, h:mma')}`;\n }\n }\n}\n\nexport const isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\nexport function searchRoomsAndBookings(allItems: (Space | Booking)[], searchValue: string, isConcierge:boolean = false) {\n\n let relevantItems: (Space | Booking)[] = [];\n\n if(isConcierge) {\n relevantItems = allItems.filter( (item: any ) => \n isIncludes(item, 'title', searchValue) ||\n isIncludes(item.creator, 'name', searchValue) ||\n isIncludes(item.organiser, 'name', searchValue) ||\n isIncludes(item, 'simple_name', searchValue) || // search with room name \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n } else {\n relevantItems = allItems.filter( (item: any ) => \n this.isIncludes(item.creator, 'name', searchValue) ||\n this.isIncludes(item.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'simple_name', searchValue) \n );\n }\n\n const filteredItems = this.duplicateMultiroomEntriesIfAny(relevantItems);\n \n return filteredItems;\n} \n\nexport function duplicateMultiroomEntriesIfAny(bookings) {\n // Initialize an array to hold the original and duplicated entries \n const updatedBookings = [...bookings];\n\n // Loop through the original bookings array \n [...bookings].forEach(booking => {\n if(booking?.is_multiroom) {\n // calculate the number of times to duplicates the booking\n const duplicatesCount = booking.multi_rooms.filter(el => el.id !== booking.space.id);\n\n // Create the duplicate and add them to the updatedBookings array.\n for(let i = 0; i < duplicatesCount.length; i++) {\n // Deep copy the booking to ensure references are not copied\n const duplicatedBooking = cloneDeep(booking); \n duplicatedBooking.room = duplicatesCount[i]; \n updatedBookings.push(duplicatedBooking);\n }\n }\n });\n\n // Return the array with duplicated entries \n return updatedBookings;\n\n}\n \n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { DateNow } from \"@mckinsey-converge/date-tz\";\nimport { Observable } from 'rxjs/internal/Observable';\nimport { forkJoin } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n const now = DateNow(new Date())\n if (!options.from) {\n options.from = now\n .startOfValue('day')\n .subtractValue({ days: 2 })\n .ms;\n }\n if (!options.until) {\n options.until = null;\n }\n\n const key = `bookings|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Booking[]) => {\n delete this._promises[key];\n resolve(list);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking, series?: boolean): Promise {\n const body = booking.toApiJSON()\n if(series){\n body.series = true\n }\n return booking.id ? this.update(booking.id, body) : this.add(body);\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n public checkinIndividualVisitor(id: string, fields: BookingCheckinParams) {\n return this.taskObsr(id, 'checkin', fields); \n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n public declineMultiple(bookings: Booking[]): Observable {\n const requests = [];\n bookings.forEach(bkg => {\n const booking = bkg.toJSON();\n const id = booking.id;\n const fields = {\n booking_id: booking.id,\n organiser: booking.organiser.email,\n room_email: booking.space?.email,\n icaluid: booking.icaluid,\n start: booking.startDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n end: booking.endDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n };\n if (bkg.is_recurrent && bkg.recurrence_type === 'master') {\n // Add series=true for recurrent bookings\n fields['series'] = true;\n } \n requests.push(this.taskObsr(id, 'concierge_decline', fields) ); \n });\n return forkJoin(requests);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { PaginatedAPIService } from '../paginated.service';\nimport { Booking, IBookingQueryOptions, } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { Observable } from 'rxjs';\n\nexport interface PaginatedBooking {\n results: Booking[];\n total: number;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsPaginatedService extends PaginatedAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n\n const key = `bookingsPaginated|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (response: any) => {\n delete this._promises[key];\n resolve(response);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking): Promise {\n return booking.id ? this.update(booking.id, booking.toJSON()) : this.add(booking.toJSON());\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n // public getHoldingBay(query: IBookingQueryOptions): Promise {\n // const key = `bookingsPaginated|holding-bay`;\n // if (!this._promises[key]) {\n // this._promises[key] = new Promise((resolve, reject) => {\n // const respond = (response: any) => {\n // delete this._promises[key];\n // resolve(response);\n // };\n // const error = e => {\n // reject(e);\n // delete this._promises[key];\n // }; \n // this.query(query, { url: '/api/staff/bookings/holding_bay' }).then(respond, error);\n // });\n // }\n\n // return this._promises[key];\n // }\n\n public getHoldingBay = (query: IBookingQueryOptions): Observable => this.queryHoldingBay(query, { url: '/api/staff/bookings/holding_bay' });\n}\n","export * from './booking.class'\nexport * from './space.types'\nexport * from './bookings.service'\nexport * from './bookingsPaginated.service'\nexport * from './booking.utilities'\nexport * from './booking-state.service'\nexport * from './space.utilities'\nexport * from './booking.types'\n","import { SpaceRules } from './booking.types';\n\nimport {\n durationGreaterThanOrEqual,\n stringToMinutes\n} from './booking.utilities';\nimport {\n SpaceCheckOptions,\n SpaceRuleOptions\n} from './space.types';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * Get booking rules for the given user and space\n * @param options\n */\nexport function rulesForSpace(options: SpaceRuleOptions): SpaceRules {\n if (!options) {\n throw Error('Options are needed to check for rule matches');\n }\n const space_rules_for_user: SpaceRules = {\n auto_approve: true,\n hide: true,\n reason: ''\n };\n let match = false;\n /* istanbul ignore else */\n if (options.space) {\n for (const type in options.rules) {\n if (\n options.rules.hasOwnProperty(type) &&\n options.rules[type] instanceof Array &&\n options.space.zones.find((zone) => zone === type)\n ) {\n for (const rule_block of options.rules[type]) {\n /* istanbul ignore else */\n if (\n checkRules({\n user: options.user,\n space: options.space,\n time: options.time,\n duration: options.duration,\n rules: rule_block.conditions\n })\n ) {\n const ruleset = rule_block.rules;\n const conditions = rule_block.conditions;\n space_rules_for_user.hide = false;\n /* istanbul ignore else */\n if (conditions.max_length) {\n space_rules_for_user.max_length = stringToMinutes(\n conditions.max_length as string\n );\n }\n /* istanbul ignore else */\n if (conditions.min_length) {\n space_rules_for_user.min_length = stringToMinutes(\n conditions.min_length as string\n );\n }\n // NOTE: use max_length in conditions instead of book_length in rules\n // if (ruleset.book_length) {\n // space_rules_for_user.max_length = stringToMinutes(ruleset.book_length as string);\n // }\n /* istanbul ignore else */\n if (ruleset.auto_approve !== undefined) {\n space_rules_for_user.auto_approve = ruleset.auto_approve;\n }\n match = true;\n space_rules_for_user.reason = '';\n break;\n }\n else {\n space_rules_for_user.reason = 'OfficeRules';\n }\n }\n }\n \n /* istanbul ignore else */\n if (!space_rules_for_user.hide) {\n break;\n }\n }\n }\n if (!match) {\n space_rules_for_user.hide = true;\n }\n return space_rules_for_user;\n}\n\n\n/**\n * Check if user matches the given ruleset\n * @param options\n */\nfunction checkRules(options: SpaceCheckOptions): boolean {\n /* istanbul ignore else */\n if (options.rules) {\n const time = new DateTZ({date: options.time});\n const count = Object.keys(options.rules).length;\n let matches = 0;\n Object.keys(options.rules).forEach((key) => {\n let counter = 0;\n const condition: string[] =\n options.rules[key] instanceof Array\n ? (options.rules[key] as [])\n : [options.rules[key] as string];\n switch (key) {\n case 'groups':\n /* istanbul ignore else */\n if (options.user && options.user.groups) {\n counter = 0;\n condition.forEach((i) =>\n options.user.groups.find((j) => j === i) ? counter++ : null\n );\n /* istanbul ignore else */\n if (counter > 0) {\n matches++;\n }\n }\n break;\n case 'locations':\n /* istanbul ignore else */\n if (options.user && options.user.location) {\n counter = 0;\n condition.forEach((i) =>\n (options.user.last_location.name || '').indexOf(i) >= 0\n ? counter++\n : null\n );\n /* istanbul ignore else */\n if (counter >= options.rules[key].length) {\n matches++;\n }\n }\n break;\n case 'is_before':\n /* istanbul ignore else */\n if (options.time) {\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date()).addValue({ minutes: duration });\n let match = time.isBeforeDate(check);\n /* istanbul ignore else */\n matches += match ? 1 : 0;\n }\n break;\n case 'is_after':\n /* istanbul ignore else */\n if (options.time) {\n\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date());\n time.isAfterDate(check.addValue({ minutes: duration })) ? matches++ : '';\n }\n break;\n case 'min_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(options.duration, condition[0])\n ) {\n matches++;\n }\n break;\n case 'max_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(condition[0], options.duration)\n ) {\n matches++;\n }\n break;\n }\n });\n return matches >= count;\n }\n return false;\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringCategoriesService extends BaseAPIService {\n\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringCategory, this);\n this._name = 'catering category/group';\n this._api_route = 'catering/category';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering categories. Use catering menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering categories. Use catering menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringCategory(raw_item);\n }\n\n public format(item: CateringCategory) {\n return { ...item };\n }\n}\n","import { CateringItem } from \"./catering-item.class\";\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport class CateringCategory extends CateringItem {\n /** Whether item is a category */\n public is_category = true;\n public admin_only: boolean;\n public restricted_from: number;\n\n constructor(data: HashMap) {\n super(data);\n this.is_category = true;\n (this as any).must_select = this.must_select || 0;\n (this as any).order_anytime = !!data.order_anytime && this.package;\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj = super.toJSON();\n obj.order_anytime = !!obj.order_anytime && obj.package;\n return obj;\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport interface CateringAvailability {\n /** Month of the year that the item starts being available */\n readonly from_month: number;\n /** Month of the year that the item ends being available */\n readonly to_month: number;\n}\n\nexport class CateringItem {\n /** Unique ID of the catering item */\n public readonly id: string;\n /** Display name of the catering item */\n public readonly name: string;\n /** Description of the item */\n public readonly description: string;\n /** URL to the image associated with the item */\n public readonly image_path: string;\n /** Type of catering item */\n public readonly catering_type: string;\n /** Availability of the item */\n public readonly available: CateringAvailability;\n /** Time in hours that is needed to prepare the item beforehand */\n public readonly prior_notice: number;\n /** Cost of the item without decimals */\n private unit_price: number;\n /** Cost of the item without decimals */\n public readonly supplier_cost: number;\n /** Minimum number this item allowed in an order */\n public readonly minimum_quantity: number;\n /** Maximum number this item allowed in an order */\n public readonly maximum_quantity: number;\n /** List of categories that the item is contained in */\n public readonly parent_categories: readonly string[];\n /** Allegen information associated with the item */\n public readonly allergy: string;\n /** Whether the supply of this item has run out */\n public out_of_stock: boolean;\n /** Whether item can be ordered within the time limit set by the building */\n public readonly order_anytime: boolean;\n /** Number of child items that must be selected as part of the package */\n public readonly must_select: number;\n /** List of associated items */\n public readonly items: CateringItem[];\n public readonly availableItems: CateringItem[];\n /** Whether child items are part of a package */\n public readonly package: boolean;\n /** List of zone ids associated with the category */\n public readonly zones: readonly string[];\n /** Number of this item in the assoicated order */\n private _amount = 0;\n /** Unique ID of the catering item */\n private instance_id: string;\n /** Whether item is a category */\n public is_category: boolean = false;\n /** Whether item is disabled in Staff App */\n public admin_only: boolean;\n /** restricted_from indicates category restriction from hours ahead of delivery time */\n public restricted_from: number;\n\n public get can_order_anytime(): boolean {\n return (\n this.order_anytime ||\n !this.package && this.items.reduce(\n (anytime, item) => anytime || item.can_order_anytime,\n false,\n )\n );\n }\n\n /** Number of this item in the assoicated order */\n public get amount(): number {\n return this._amount || 0;\n }\n\n /** Unit price in the assoicated order */\n public get price(): number {\n return this.unit_price || 0;\n }\n\n /** Total cost of the amount of items set */\n public get total(): number {\n return (this._amount * this.unit_price) || 0;\n }\n\n constructor(data: HashMap) {\n this.instance_id = `item-${Math.floor(Math.random() * 999_999_999)}`;\n this.id = data.id || '';\n this.name = data.name || '';\n this.is_category = this.id.includes('category-');\n this.available = {\n from_month: (data.available ? data.available.from_month : data.available_from) || -1,\n to_month: (data.available ? data.available.to_month : data.available_to) || -1,\n };\n this.description = data.description || '';\n this.prior_notice = data.prior_notice || data.notice;\n this.unit_price = data.unit_price || data.price || 0;\n this.supplier_cost = data.supplier_cost;\n this.minimum_quantity = Math.max(0, data.minimum_quantity || 0);\n this.maximum_quantity = Math.max(1, data.maximum_quantity || 999);\n this.parent_categories = data.category_ids || data.parent_categories || data.categories;\n this.order_anytime = !!data.order_anytime;\n this.image_path = data.image_path || '';\n this.admin_only = data.admin_only;\n this.restricted_from = data.restricted_from || data?.root_category_restricted_from || 0;\n \n this.catering_type = data.catering_type;\n this.must_select = data.must_select ?? 0;\n this._amount = data._amount || data.amount || 0;\n this.allergy = data.allergy || '';\n const cateringItems: CateringItem[] = (data.items || []).map(item => new CateringItem(item));\n this.items = cateringItems;\n const filteredCateringItems = cateringItems.filter(c => !c.out_of_stock);\n this.availableItems = filteredCateringItems;\n this.out_of_stock = !!data.out_of_stock ||\n // if original items are empty, we hit the bottom, so if we filter out items then its out of stock.\n (cateringItems.length > 0 && filteredCateringItems.length === 0);\n this.package = data.package === 'true' || data.package === true;\n this.zones = data.zones && data.zones.length ? [...data.zones] : [];\n }\n\n public setAmount(amount: number = 0): void {\n if (amount <= this._amount) {\n if (amount < this.minimum_quantity) {\n amount = 0;\n }\n } else {\n if (amount < this.minimum_quantity) {\n amount = this.minimum_quantity;\n }\n }\n this._amount = Math.max(0, Math.min(this.maximum_quantity, amount));\n }\n\n /**\n * Updates the unit_price in the assoicated order if necessary\n * @param price value to compare to unit_price\n */\n public setPrice(price: number = 0): void {\n if(this.unit_price !== price) this.unit_price = price;\n }\n\n /**\n * Increase amount of the item the order\n * @param amount Amount to increase by\n */\n public addToOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount += amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = this.minimum_quantity;\n } else if (this._amount > this.maximum_quantity) {\n this._amount = this.maximum_quantity;\n }\n }\n\n /**\n * Decrease amount of the item the order\n * @param amount Amount to decrease by\n */\n public removeFromOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount -= amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = 0;\n }\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._changes;\n delete obj._server_names;\n // Convert remaining members to be public\n obj.price = obj.unit_price;\n obj.categories = obj.parent_categories;\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n return obj;\n }\n\n\n\n public within_category_restricted_time(dateTz): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!this?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: this?.restricted_from }).startOfValue('minute');\n return dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { CateringItem } from './catering-item.class';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringItemsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringItem, this);\n this._name = 'Catering Menu';\n this._api_route = 'catering/item';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering items. Use menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering items. Use menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringItem(raw_item);\n }\n\n public format(item: CateringItem) {\n return item instanceof CateringItem ? item.toJSON() : item;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { CateringItem } from './catering-item.class';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringMenuService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Catering Menu';\n this._api_route = 'menu';\n }\n\n /**\n * Convert user data to local format\n * @param user User data\n */\n protected processItem(item: HashMap) {\n return item.items ? new CateringCategory(item) : new CateringItem(item);\n }\n}\n","\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringNotesService {\n\n public cateringNotes = [];\n\n \n public setNotes(notes) {\n this.cateringNotes = notes;\n }\n\n public getNotes() {\n return this.cateringNotes;\n }\n}","import { CateringItem } from './catering-item.class';\nimport { HashMap } from '@mckinsey-converge/base';\n\nimport { CateringCategory } from './catering-category.class';\nimport { Booking } from '../bookings';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport type CateringOrderMutableProperties =\n | 'items'\n | 'location_id'\n | 'location'\n | 'delivery_time'\n | 'charge_code'\n | 'notes'\n | 'status';\n\nexport type CateringOrderStatus = 'accepted' | 'preparing' | 'ready' | 'delivered' | 'cancelled';\n\nconst now = DateNow(new Date());\n\n// R--- refactor booking date to be dateTz\nexport class CateringOrder {\n /**\n * Booking fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Unique Booking ID for the catering order */\n readonly booking_id: string;\n /** \n * Timestamp based booking time of the booking associated with the order\n * \n * Must be provide as the true Booking startDateTz or as a new DateTZ with \n * the correct date: timestamp, local_tz = false and bulding_tz values\n */\n readonly booking_date: number;\n /**\n * Timezone of the booking associated with the order\n */\n readonly booking_timezone: string;\n /** ID of the location to deliver the items to */\n location_id: string = '';\n /** Display text for the location to deliver the items to */\n location: string = '';\n /**\n * Smart timezone aware catering datetime with timezone\n */\n readonly bookingDateTz: DateTZ;\n\n /** \n * Booking associated with the order \n * \n * The booking attached to the CateringOrder is a special case used \n * mainly on the Concierge catering reports because someone created \n * a bad pattern to save catering changes to the booking. \n * \n * Avoid when possible.\n */\n public booking: Booking = null;\n\n /**\n * Catering specific fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Whether the order status change is loading */\n public loading: boolean;\n /** Unique ID for the catering order */\n readonly id: string;\n /** Number of minutes after the start of the associated meeting to delivery the order */\n readonly delivery_time: number = 0;\n /** Status of the catering order */\n readonly status: CateringOrderStatus;\n /** Whether items in the order need to be prepared in the kitchen */\n readonly kitchen: boolean;\n /** Whether items in the order are in the pantry */\n readonly pantry: boolean;\n /** List of items */\n readonly items: readonly (CateringItem | CateringCategory)[] = [];\n /** Creation time of the order */\n readonly created_at: number;\n /** Charge code associated with the order */\n readonly charge_code: string;\n /** Notes associated with the order */\n readonly notes: string;\n // /** Mapping of properties to their changes */\n // private _changes: HashMap = {};\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n /** Currency code for the location of the order */\n public symbol: string;\n /** Whether the is an error with the order */\n public error: boolean;\n\n\n constructor(data: HashMap) {\n /** \n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = DateNow(new Date());\n // now rounded to the next 5 minute increment\n const defaultStartTz = nowTz.setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n\n this.id = data.id || `order-${Math.floor(Math.random() * 999_999_999)}`;\n\n // If the booking is provided default the booking values to the true booking values\n this.booking = data.booking || null;\n\n \n // Has a booking so init with those values\n if (this.hasBookingAttached) {\n this.booking_date = this.booking.startDateTz.ms;\n this.booking_timezone = this.booking.timezone;\n this.bookingDateTz = this.booking.startDateTz;\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n } else {\n this.booking_date = data.booking_date || defaultStartTz.ms;\n this.booking_timezone = data.booking_timezone || defaultLocalTimezone;\n this.bookingDateTz = new DateTZ({ date: this.booking_date, is_local_tz: false, building_tz: this.booking_timezone });\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n }\n \n this.delivery_time = typeof data.delivery_time === 'number' ? data.delivery_time : 0;\n this.status = data.status || 'accepted';\n this.charge_code = data.charge_code || data.code;\n this.notes = data.notes;\n this.kitchen = data.kitchen instanceof Array ? !!data.kitchen.length : data.kitchen;\n this.pantry = data.pantry instanceof Array ? !!data.pantry.length : data.pantry;\n this.symbol = data.symbol || 'USD';\n this.items = (data.items || [])\n .map(item => (item.items ? new CateringCategory(item) : new CateringItem(item)))\n .filter(item => !!item.amount);\n }\n\n /** Special Case, check if a full booking is attached */\n public get hasBookingAttached(): boolean {\n return !!this.booking;\n }\n\n /** Display string for the types of items in the order */\n public get type(): string {\n let type = '';\n /* istanbul ignore else */\n if (this.kitchen) type += 'Kitchen';\n /* istanbul ignore else */\n if (this.pantry) {\n /* istanbul ignore else */\n if (type) type += ' + ';\n type += 'Pantry';\n }\n return type;\n }\n\n /** Total cost of the order */\n public get total(): number {\n return this.items.reduce((total, item) => total + (item.total || 0), 0);\n }\n\n /** Total number of items in the order */\n public get item_count(): number {\n return this.items.reduce((total, item) => total + (item.amount || 0), 0);\n }\n\n public get deliver_date(): DateTZ {\n return (this.bookingDateTz || this.booking?.startDateTz).addValue({ minutes: this.delivery_time })\n }\n\n /** Display string for the delivery time of the order (short version) */\n public get deliver_at(): string {\n return this.deliver_date.formatDate('h:mm a');\n }\n\n /** Display string for the delivery time of the order */\n public get deliver_at_time(): string {\n return this.deliver_date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Display string for the delivery date of the order */\n public get deliver_on_date(): string {\n return this.deliver_date.formatDate('dd MMM yyyy');\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): CateringOrder {\n return new CateringOrder(this.toJSON());\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringOrder): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._server_names;\n // Remove local public members\n delete obj.booking;\n delete obj.loading;\n delete obj.bookingDateTz;\n\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substr(1)] || key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n\n return obj;\n }\n}\n","import { CateringItem } from './catering-item.class';\n\nexport const mergeCateringItemWithFormData = (existing: CateringItem, override: any) =>\n new CateringItem({\n ...(existing instanceof CateringItem ? existing.toJSON() : existing),\n ...override\n });\n","export * from './catering-item.class';\nexport * from './catering-category.class';\nexport * from './catering-menu.service';\nexport * from './catering-order.class';\nexport * from './catering-categories.service';\nexport * from './catering-items.service';\nexport * from './catering.utilities';\nexport * from './catering-notes.service';\n","import { Injectable } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CloseDialogService {\n private dialogRefMap = new Map>();\n\n constructor() { }\n\n // Register a dialog with its ID\n registerDialog(id: string, dialogRef: MatDialogRef): void {\n this.dialogRefMap.set(id, dialogRef);\n }\n\n // Close a specific dialog by ID\n closeDialog(id: string): void {\n const dialogRef = this.dialogRefMap.get(id);\n if (dialogRef) {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n }\n }\n\n // Optional: Close all dialogs\n closeAllDialogs(): void {\n this.dialogRefMap.forEach((dialogRef, id) => {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n });\n }\n}\n\nexport enum DialogIds {\n MeetingDetails = 'meetingDetailsDialogId',\n BookingConfirmation = 'bookingConfirmationDialogId',\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapseService {\n private collapseSubject = new BehaviorSubject(false);\n collapse$ = this.collapseSubject.asObservable();\n\n collapsePanel() {\n this.collapseSubject.next(false);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class DataCommonModule {}\n","import { Injectable } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n Subscription\n} from 'rxjs';\n\nimport {\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\n/** List of keys that cannot be in a combination by themselves or with each other */\nconst INVALID_STANDALONE_KEYS: string[] = ['control', 'shift', 'alt', 'meta', 'os'];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class HotkeysService {\n /** Map of subjects which store press states of keys */\n private keydown_states: HashMap> = {};\n /** Map of obserers for key state subjects */\n private keydown_observers: HashMap> = {};\n /** List of keys at the end of a combination */\n private combo_end: string[] = [];\n /** List of registered hotkey combinations */\n private registered_combos: string[][] = [];\n /** Counter for the number of keydown events. Used for checking order of key presses */\n private counter: number = 0;\n /** Last key code to be pressed */\n private last_down: string;\n\n constructor() {\n window.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.last_down !== code) {\n /* istanbul ignore else */\n if (!this.keydown_states[code]) {\n this.keydown_states[code] = new BehaviorSubject(null);\n this.keydown_observers[code] = this.keydown_states[code].asObservable();\n }\n this.keydown_states[code].next(++this.counter);\n /* istanbul ignore else */\n if (this.combo_end.indexOf(code) >= 0) {\n event.preventDefault();\n }\n this.last_down = code;\n }\n });\n\n window.addEventListener('keyup', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.keydown_states[code]) {\n this.keydown_states[code].next(null);\n }\n /* istanbul ignore else */\n if (this.last_down === code) {\n this.last_down = null;\n }\n });\n }\n\n /**\n * Listen to the given key combination\n * @param combo Array of key codes to listen to or a hotkey string e.g. `Alt+Shift+KeyK`\n * @param next Callback for combination presses\n */\n public listen(combo: string | string[], next: () => void): Subscription {\n combo = (combo instanceof Array ? combo : combo.split('+'));\n const combination: string[] = combo.map(i => this.mapKey(i.toLowerCase()));\n /* istanbul ignore else */\n if (combination.length > 0 && this.validCombination(combination)) {\n this.registered_combos.push(combination);\n const last_key = combination[combination.length - 1];\n /* istanbul ignore else */\n if (!this.keydown_states[last_key]) {\n this.keydown_states[last_key] = new BehaviorSubject(null);\n this.keydown_observers[last_key] = this.keydown_states[last_key].asObservable();\n }\n this.updateCombinationEndList();\n return this.keydown_observers[last_key].subscribe((count) => {\n /* istanbul ignore else */\n if (count) {\n const presses: number[] = [];\n /* istanbul ignore else */\n if (combination.length > 0) {\n // Check that keys are pressed\n for (const key of combination) {\n const state = this.keydown_states[key];\n presses.push(state ? state.getValue() || -1 : -1);\n }\n // Check that keys are pressed in the correct order\n for (let i = 0; i < combination.length - 1; i++) {\n if (presses[i] > presses[i + 1]) {\n return;\n }\n }\n }\n const total = presses.reduce((a, v) => a + (v > 0 ? 1 : -1), 0);\n /* istanbul ignore else */\n if (total >= combination.length) {\n next();\n }\n }\n });\n }\n return null;\n }\n\n /**\n * Map key codes with multiple versions to simple form\n * @param code Code to transform\n */\n private mapKey(code: string): string {\n /* istanbul ignore else */\n if (code.indexOf('alt') >= 0 || code.indexOf('shift') >= 0 || code.indexOf('control') >= 0) {\n return code.replace('left', '').replace('right', '');\n }\n return code;\n }\n\n /**\n * Update the list of the last keys in combinations to allow for prevent default actions on pre-existing hotkeys\n */\n private updateCombinationEndList(): void {\n const key_list = [];\n for (const combo of this.registered_combos) {\n this.combo_end.push(combo[combo.length - 1]);\n }\n this.combo_end = unique(key_list);\n }\n\n /**\n * Checks if the given hotkey combination is allowed and valid\n * @param combo Array of key codes\n */\n private validCombination(combo: string[]): boolean {\n let non_meta = 0;\n for (const key of combo) {\n /* istanbul ignore else */\n if (INVALID_STANDALONE_KEYS.indexOf(key) < 0) {\n non_meta++;\n }\n }\n return non_meta > 0;\n }\n}\n","export * from './location.class';\nexport * from './location.service';\n","import { HashMap } from '@mckinsey-converge/base';\n\nimport { Organisation } from '../organisation/organisation.class';\nimport {\n ServiceLike,\n ServiceManager\n} from '../service-manager.class';\nimport { BuildingLevel } from '../organisation/level.class';\n\nexport class MapLocation {\n /** ID of the element on the associated map */\n public readonly id?: string;\n /** Name of the location */\n public readonly name?: string;\n /** X coordinate of the location */\n public readonly x?: number;\n /** Y coordinate of the location */\n public readonly y?: number;\n /** Level details for the location */\n public readonly level: BuildingLevel;\n /** Whether the position is fixed */\n public readonly fixed: boolean;\n /** Accuracy of the location when not fixed */\n public readonly confidence?: number;\n /** Whether location is at a desk */\n public readonly at_desk?: boolean;\n /** Whether location is set */\n public readonly empty: boolean;\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(MapLocation);\n }\n\n /** Display string for the building and level of the location */\n public get display(): string {\n const service = ServiceManager.serviceFor(Organisation);\n if (!service) {\n return this.level.name;\n }\n const bld = service.buildings.find((bld) => bld.id === this.level.building_id);\n return bld ? `${bld.name}, ${this.level.name}` : this.level.name;\n }\n\n /** Whether location is in a different building from the active one */\n public get in_another_building(): boolean {\n const service = ServiceManager.serviceFor(Organisation);\n return service && service.building.id !== this.level.building_id;\n }\n\n constructor(raw_data: HashMap) {\n this.id = raw_data.id || raw_data.map_id || raw_data.desk_id;\n this.name = raw_data.name || '';\n this.x = raw_data.x\n ? Math.floor(this.normalise(raw_data.x, raw_data.x_max || 10000) * 10000)\n : null;\n this.y = raw_data.y\n ? Math.floor(this.normalise(raw_data.y, raw_data.x_max || 10000) * 10000)\n : null;\n const service = ServiceManager.serviceFor(Organisation);\n this.level =\n raw_data.level instanceof BuildingLevel\n ? raw_data.level\n : service\n ? service.levelWithID(raw_data.level)\n : new BuildingLevel(raw_data.level);\n this.fixed = this.x === null && this.y === null;\n this.confidence = Math.max(5, Math.min(15, raw_data.confidence || 0));\n this.at_desk = this.id && this.id.indexOf('area-') === 0;\n this.empty = !(this.name && this.level && (this.id || this.x || this.y));\n }\n\n /** Normalise the given value within the max */\n private normalise(value: number, max: number): number {\n return value / (max * 1.0);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { MapLocation } from './location.class';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(MapLocation, this);\n this._name = 'Location';\n this._api_route = 'people';\n }\n\n public add(...args): never {\n throw new Error('Create not allowed for location service')\n }\n\n public update(...args): never {\n throw new Error('Update not allowed for location service')\n }\n\n public delete(...args): never {\n throw new Error('Delete not allowed for location service')\n }\n\n public process(item: HashMap) {\n return new MapLocation(item) as any;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { BookingRule } from '../bookings';\nimport { ServiceManager } from '../service-manager.class';\n\nexport interface BuildingCity {\n timezone: string\n name: string\n}\n\nexport interface IBuildingRoleUser {\n name: string;\n email: string;\n phone: string;\n}\n\nexport interface LockerMap {\n [zone: string]: {\n [area: string]: {\n [type: string]: (string | boolean)[][];\n };\n };\n}\n\nexport interface ICoordinates {\n longitude: number;\n latitude: number;\n}\n\nexport interface LevelFeature {\n id: string;\n level_id: string;\n name: string;\n}\n\nexport interface BookingRuleDetails {\n /** List of booking rules details for the building */\n readonly rules: readonly string[];\n /** Custom booking rules for the map */\n readonly map_rules?: readonly string[];\n /** Custom booking rules for the map */\n readonly other_rules?: readonly string[];\n /** Contact email address for the building */\n readonly contact?: string;\n /** Information string to display before the rule listings */\n readonly info?: string;\n /** Link for more details */\n readonly link?: { url?: string, name?: string };\n /**\n * Allow buildings to define their own rules formats where needed or for special messages.\n */\n readonly custom_html?: string;\n}\n\nexport class Building extends BaseDataClass {\n /** Service for managing buildings */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Engine Zone ID for the building */\n public readonly zone_id: string;\n /** Organisation Code for the building */\n public readonly code: string;\n /** Geographical address of the building */\n public readonly address: string;\n /** Details about the booking rules for the building */\n public readonly booking_details: BookingRuleDetails;\n /** Details about the booking rules for the building */\n public readonly booking_rules: HashMap;\n /** Number of hour before a booking catering is restricted */\n public readonly catering_restricted_from: number;\n /** Currency code for the country assoicated with the building */\n public readonly currency: string;\n /** Map of fields that are required on the form */\n public readonly required: HashMap;\n /** IANA timezone database string for the location the building resides */\n public readonly timezone: string;\n /** Whether catering is available in this building */\n public readonly has_catering: boolean;\n /** ID of the system used for the holding bay */\n public readonly holding_bay: string;\n /** ID of the system used for standalone visitors bookings */\n public readonly visitor_space: string;\n /** List of zones to determine sort order spaces */\n public readonly sort_order: readonly string[];\n /** Searchable map features */\n public readonly searchables: readonly LevelFeature[];\n /** List of available extras for the building */\n public readonly extras: readonly Identity[];\n /** List of available extra equipment for loan at the building */\n public readonly loan_items: readonly Identity[];\n /** List of available levels for the building */\n public readonly levels: readonly BuildingLevel[];\n /** The city the building belongs in **/\n public readonly city: string;\n\n public readonly catering_hours: { readonly start: number, readonly end: number };\n /** Map of custom settings for the building */\n private _settings: HashMap;\n /** Map of roles and list of the associated users */\n private _roles: HashMap;\n /** Map of the locker ID arrays */\n private _lockers: LockerMap;\n /** Map of important system ids for the building */\n private _systems: HashMap;\n /** Map of important phone numbers for the building */\n private _phone_numbers: HashMap;\n /** Globe coordiates for the build */\n private _location: ICoordinates;\n /** List of zones associated with the building */\n public readonly zones: readonly string[];\n\n constructor(raw_data: HashMap) {\n super(raw_data);\n const settings = raw_data.settings || {};\n const disc_info = settings.discovery_info || {};\n this.zone_id = raw_data.zone_id || raw_data.zone;\n this.extras = (raw_data.extras || disc_info.extras || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.loan_items = (raw_data.loan_items || disc_info.loan_items || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.levels = (raw_data.levels || disc_info.levels || []).map(i => new BuildingLevel({\n ...i,\n building_id: this.id\n }));\n this._roles = raw_data.roles || disc_info.roles || {};\n this._lockers = raw_data.lockers || raw_data.locker_structure || disc_info.locker_structure || {};\n this._systems = raw_data.systems || disc_info.systems || {};\n this._settings = settings;\n this._phone_numbers = raw_data.phone_numbers || disc_info.phone_numbers || {};\n this._location = raw_data.location || disc_info.location || { longitude: null, latitude: null };\n this.catering_hours = raw_data.catering_hours || disc_info.catering_hours || settings.catering_hours || {\n start: 7,\n end: 20\n };\n const searchables = [];\n if (raw_data.neighbourhoods) {\n for (const lvl in raw_data.neighbourhoods) {\n if (raw_data.neighbourhoods.hasOwnProperty(lvl)) {\n const lvl_features = raw_data.neighbourhoods[lvl] || {};\n for (const feature in lvl_features) {\n if (lvl_features.hasOwnProperty(feature)) {\n searchables.push({\n id: lvl_features[feature],\n name: feature,\n level_id: lvl\n });\n }\n }\n }\n }\n }\n this.searchables = searchables;\n this.code = raw_data.code || disc_info.code || settings.code || '';\n this.address = raw_data.address || disc_info.address || settings.address || '';\n this.booking_details = raw_data.booking_details || disc_info.booking_details || settings.booking_details || {};\n this.booking_rules = raw_data.booking_rules || disc_info.booking_rules || settings.booking_rules || {};\n this.catering_restricted_from = raw_data.catering_restricted_from || disc_info.catering_restricted_from || settings.catering_restricted_from || 0;\n this.currency = raw_data.currency || disc_info.currency || settings.currency || 'USD';\n this.required = raw_data.required || disc_info.required || settings.required || {};\n if (disc_info.requires_equipment_code) {\n this.required.equipment_code = true;\n }\n if (disc_info.requires_expected_attendees) {\n this.required.expected_attendees = true;\n }\n this.timezone = raw_data.timezone || disc_info.timezone || settings.timezone || '';\n this.has_catering = raw_data.has_catering || disc_info.has_catering || settings.has_catering || false;\n this.holding_bay = raw_data.holding_bay || disc_info.holding_bay || settings.holding_bay || '';\n this.visitor_space = raw_data.visitor_space || disc_info.visitor_space || settings.visitor_space || '';\n this.sort_order = raw_data.sort_order || disc_info.sort_order || settings.sort_order || [];\n this.city = raw_data.city || disc_info.city || 'No City';\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings) || getItemWithKeys(['discovery_info', ...keys], this._settings);\n return value;\n }\n\n /**\n * Get list of users with the associated role\n * @param name Role to find users for\n */\n public role(name: string): IBuildingRoleUser[] {\n return [...(this._roles[name] || [])];\n }\n\n /**\n * Get list of the names of available user role lists\n */\n public get role_names(): string[] {\n return Object.keys(this._roles).filter(i => this._roles.hasOwnProperty(i));\n }\n\n /** Map of the locker ID arrays */\n public get lockers(): LockerMap {\n return { ...(this._lockers || {}) };\n }\n\n /** Map of important system ids for the building */\n public get systems(): HashMap {\n return { ...(this._systems || {}) };\n }\n\n /** Map of important phone numbers for the building */\n public get phone_numbers(): HashMap {\n return { ...(this._phone_numbers || {}) };\n }\n\n /** Real coordinates */\n public get location(): ICoordinates {\n return { ...this._location };\n }\n\n /**\n * Get search map feature for the given level ID\n * @param level_id ID of level to grab features for\n */\n public featuresForLevel(level_id: string): LevelFeature[] {\n return (this.searchables || []).filter(i => i.level_id === level_id);\n }\n\n /**\n * Building objects are readonly and cannot be changed\n */\n public async save(): Promise {\n throw new Error('Building objects are readonly and cannot be changed');\n }\n\n /**\n * Building objects are readonly and cannot be deleted\n */\n public async delete(): Promise {\n throw new Error('Building objects are readonly and cannot be deleted');\n }\n}\n","export * from './building.class';\nexport * from './level.class';\nexport * from './organisation.class';\nexport * from './organisation.service';\n","import { HashMap } from 'libs/base/src/lib/types.utilities';\n\n/** Building Level data */\nexport class BuildingLevel {\n /** ID of the building level zone */\n readonly id: string;\n /** ID of the building zone associated with the level */\n readonly building_id: string;\n /** Name of the level */\n readonly name: string;\n /** Number or short identifier of the level */\n readonly short_name: string;\n /** Map URL for the level */\n readonly map_url: string;\n /** Usage type for the level */\n readonly type: 'staff' | 'client' | 'any';\n /** Setting for the level */\n readonly settings: HashMap;\n\n constructor(_data: HashMap = {}) {\n this.id = _data.id || _data.level_id || '';\n this.building_id = _data.bld_id || _data.building_id || '';\n this.name = _data.name || _data.level_name || '';\n const lower_name = this.name.toLowerCase();\n const num = lower_name.indexOf('level') >= 0 ? lower_name.replace(/ ?level ?/gi, '') : lower_name.substr(0, 1).toUpperCase();\n this.short_name = _data.short_name || num || '';\n this.map_url = _data.map_url || '';\n this.type = _data.type || _data.floor_type || 'any';\n this.settings = _data.settings;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap\n} from '@mckinsey-converge/base';\n\n/* istanbul ignore next */\n\nexport class Organisation extends BaseDataClass {\n /** List of available building zone ids for the organisation */\n public readonly available_buildings: readonly string[];\n /** Map of custom settings for the building */\n private _settings: HashMap;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this._settings = raw_data.settings || {};\n this.available_buildings = (raw_data.settings?.discovery_info?.buildings || []).map(\n (bld) => bld.zone_id\n );\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings);\n return value;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { Organisation } from './organisation.class';\nimport { Building } from './building.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { first } from 'rxjs/operators';\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { UsersService } from '../users';\nimport { SettingsService } from '../settings.service';\nimport { Observable, Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OrganisationService extends BaseAPIService {\n /** Organisation data for the application */\n private _organisation: Organisation;\n /** Actively displayed building */\n private _active_building: string;\n\n private _spaceTypesSubject: Subject = new Subject();\n\n constructor(\n protected _composer: ComposerService,\n private _service: ApplicationService,\n private _users: UsersService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Organisation, this);\n ServiceManager.setService(Building, this);\n this._name = 'Organisation';\n this._api_route = 'zones';\n this.set('buildings', []);\n this.set('active_building', null);\n this._users.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /**\n * Add is not available on organisation service\n */\n public async add(form_data: HashMap, query_params?: HashMap): Promise {\n throw new Error('Add is not available on the organisation service');\n }\n\n /**\n * Update is not available on organisation service\n */\n public async update(\n id: string,\n form_data: HashMap,\n query_params?: HashMap\n ): Promise {\n throw new Error('Update is not available on the organisation service');\n }\n\n /**\n * Delete is not available on organisation service\n */\n public async delete(id: string): Promise {\n throw new Error('Delete is not available on the organisation service');\n }\n\n /**\n * Get list of levels for the given building ID\n * @param bld_id Building ID\n */\n public levels(bld_id: string): readonly BuildingLevel[] {\n return (this.buildings.find((i) => i.id === bld_id) || ({} as Building)).levels;\n }\n\n /**\n * Get a setting from the organisation or active building\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string) {\n return this.building.setting(key) || this._organisation.setting(key);\n }\n\n /** Active building */\n public get building(): Building {\n return this.buildings.find((i) => i.id === this._active_building);\n }\n\n /** List of types of spaces */\n public get space_types(): Identity[] {\n return this.get('space_types') || [];\n }\n\n public set building(bld: Building) {\n if (bld instanceof Building) {\n this._active_building = bld.id;\n } else {\n this._active_building = bld;\n }\n this.set('active_building', this.building);\n this.loadSpaceTypes();\n localStorage.setItem('PlaceOS.building', this._active_building);\n localStorage.setItem('CONCIERGE.timezone', bld.timezone);\n }\n\n /** List of buildings for the organisation */\n public get buildings(): Building[] {\n return this.get('buildings') || [];\n }\n\n /**\n * Get list of available equipment\n * @param id ID of the building to get the list from. i.e. Defaults to the active building\n */\n public getExtras(id: string, bld_id?: string) {\n const bld = this.buildings.find((i) => i.id === bld_id) || this.building;\n if (bld && id) {\n return bld.extras.filter((i) => `${i.id}`.indexOf(id) >= 0);\n }\n return [];\n }\n\n /**\n * Get the first level matching the list of given IDs\n * @param ids List of ID to search with\n */\n public levelWithID(ids: string | string[]): BuildingLevel {\n const list = ids instanceof Array ? ids : [ids];\n const bld_list = this.buildings;\n for (const id of list) {\n for (const bld of bld_list) {\n for (const lvl of bld.levels) {\n if (lvl.id === id) {\n return lvl;\n }\n }\n }\n }\n return null;\n }\n\n /**\n * Initialise service data\n */\n protected async load(): Promise {\n /* istanbul ignore else */\n if (localStorage) {\n this._active_building = localStorage.getItem(`${this.settingsService.frontend.toUpperCase()}.building`);\n }\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.organisation = { message: 'Loading organisation data', state: 'loading' };\n await this.loadOrganisation();\n loading.organisation = { message: 'Loading organisation data', state: 'complete' };\n loading.buildings = { message: 'Loading building data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadBuildings();\n loading.buildings = { message: 'Loading building data', state: 'complete' };\n loading.levels = { message: 'Loading building floor data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadLevels();\n loading.levels = { message: 'Loading building floor data', state: 'complete' };\n this._service.set('loading', loading);\n loading.space_types = { message: 'Loading space type data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadSpaceTypes();\n loading.space_types = { message: 'Loading space type data', state: 'complete' };\n this._service.set('loading', loading);\n const user = this._users.current;\n\n if (user) {\n const id = localStorage.getItem('PlaceOS.building');\n const building = this.buildings.find(bld => id && bld.id === id) || this.buildings.find((bld) => bld.code === user.location);\n if (building) {\n this._active_building = building.id;\n this.set('active_building', building);\n } else if(this.building) {\n // This conditional solves a problem of infinite loop when user building doesn't exist.\n this._active_building = this.building.id;\n this.set('active_building', this.building);\n }\n }\n }\n\n /**\n * Load organisation data for application\n */\n public async loadOrganisation(): Promise {\n const org_data = await this.query({ tags: 'org', engine: true });\n this._organisation = new Organisation(org_data[0]);\n this.set('organisation', this._organisation);\n return this._organisation;\n }\n\n /**\n * Load building data for the organisation already stored in the service..\n */\n public async loadBuildings(): Promise {\n return this.loadBuildingsWithOrg(this._organisation);\n }\n\n /**\n * Load building data for the organisation passed.\n */\n public async loadBuildingsWithOrg(organisation: Organisation): Promise {\n const bld_data = await this.query({ tags: 'building', engine: true, limit: 1000 });\n const buildings = (bld_data as HashMap[])\n .map((i) => new Building(i))\n .filter((bld) => organisation.available_buildings.includes(bld.id));\n this.set('buildings', buildings);\n /* istanbul ignore else */\n if (!this._active_building && buildings && buildings.length > 0) {\n this._active_building = buildings[0].id;\n }\n return buildings;\n }\n\n /**\n * Load level data for the buildings\n */\n public async loadLevels(): Promise {\n const lvl_data = await this.query({ tags: 'level', engine: true, limit: 1000 });\n const levels = (lvl_data as HashMap[]).map((i) => new BuildingLevel(i));\n this.set('levels', levels);\n return levels;\n }\n\n /**\n * Load space type data for the buildings\n */\n public async loadSpaceTypes(): Promise {\n const type_data = await this.query({ tags: 'room', engine: true, limit: 1000, building_id: this._active_building });\n const types = (type_data as HashMap[]).map((i) => ({ id: i.id, name: i.name }));\n this.set('space_types', types);\n // Emit the updated space_types\n this._spaceTypesSubject.next(types);\n }\n\n /**\n * Observable to listen for changes in space_types\n */\n public get spaceTypesObservable(): Observable {\n return this._spaceTypesSubject.asObservable();\n }\n\n public getOrganizationFiltersByRoomType(key: string) {\n if (!this._organisation) {\n return {}\n }\n const discovery_info = this._organisation.setting('discovery_info')\n\n return discovery_info && discovery_info[key] ? discovery_info[key] : {}\n }\n\n public getRoomTypeSubsetDDOptions(type:string) {\n const filters = this.getOrganizationFiltersByRoomType(type) || {}\n return [...Object.keys(filters).map((key) => {\n const display = filters[key].toString();\n return {\n display,\n value: key,\n meta: {}\n }\n }) ];\n }\n\n\n\n /**\n * The function will generate filter options, excluding London. London has its own set of options as per the request. \n * The filter options pertain to a subset of room type options managed by the room admin module.\n * @returns filterOptions: filter options for day view space type filter\n */\n public getRoomFilterOptionsPerLocation() {\n let internalSubSet = this.getRoomTypeSubsetDDOptions('internal_room_types');\n if(this.building.name.toLowerCase().includes('london')) {\n internalSubSet = internalSubSet.filter(e => !e.value.includes('meeting') && !e.value.includes('partner') );\n }\n const filterOptions = [];\n internalSubSet.forEach(el => filterOptions.push({name: el.display, id: el.value} ) ); \n return filterOptions\n }\n\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseAPIService } from './base.service';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class PaginatedAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}, config: { url?: string } = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = query_params.cache || 1000;\n delete query_params.cache;\n }\n const query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = config && config.url ? `${config.url}${query ? '?' + query : ''}` : `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: IEngineResponse;\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * \n * @param query_params \n * @param config \n * @returns \n */\n queryHoldingBay(query_params: HashMap = {}, config: { url?: string } = {}):Observable {\n const query = toQueryString(query_params);\n const url = `${config.url}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );\n }\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse{\n let result: IEngineResponse;\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n return result;\n }\n \n\n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => {\n result = this.process(d); \n },\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { FormGroup } from \"@angular/forms\";\nimport { HashMap } from \"@mckinsey-converge/base\"\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\"\n\nexport enum RecurrencePeriod {\n LIST = 'list',\n DAILY = 'daily',\n WEEKLY = 'weekly',\n //RELATIVE_MONTHLY = 'relativeMonthly', for the moment we will only support absoluteMonthly\n ABSOLUTE_MONTHLY = 'monthly'\n}\n\nexport enum DaysOfWeek {\n SUNDAY = 'sunday',\n MONDAY = 'monday',\n TUESDAY = 'tuesday',\n WEDNESDAY = 'wednesday',\n THURSDAY = 'thursday',\n FRIDAY = 'friday',\n SATURDAY = 'saturday'\n\n}\n\nexport enum SeriesAction {\n EDIT = 'edit',\n CLONE = 'clone'\n}\n\nexport enum BookingAction {\n CLONE = 'booking_clone',\n EDIT = 'booking_edit'\n}\n\nexport interface WeekDays {\n id: string;\n active: boolean;\n day_index: number;\n full_name: string;\n}\n\nexport interface RepeatPeriod {\n id: RecurrencePeriod;\n label: string\n}\n\nexport enum RepeatsOn {\n PATTERN = 'pattern',\n DATE = 'date'\n}\n\nexport interface RecurrenceType {\n type: RepeatsOn;\n label: string;\n}\n\nexport interface RecurrenceDetails {\n period: RecurrencePeriod,\n end: DateTZ,\n list: Array\n interval: number\n}\n\nexport interface RecurrenceRecurringDetails extends RecurrenceDetails {\n start: number\n}\n\nexport const recurrencePeriodToDurationType = (period: RecurrencePeriod) =>{\n switch (period) {\n case RecurrencePeriod.DAILY:\n return 'days'\n case RecurrencePeriod.WEEKLY:\n return 'weeks' \n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return 'months' \n default:\n return 'days'\n }\n}\n\n/**\n * Generate weekdays from monday to saturday\n */\nexport const generateWeekDays = (date: number, params: { building_tz?: string } = {}): Array=> {\n const { building_tz } = params;\n let start_week = DateNow(new Date()).startOfValue('week').addValue({days : 1}); //set monday as start of week\n const week_days: Array = []\n for (let i = 1; i <= 7; i++) {\n const activeDate = new DateTZ({date, building_tz, is_local_tz: false })\n const active = activeDate.dateWeekday === i\n const full_name = start_week.formatDate('EEEE')\n const day_index = i === 7 ? 0 : i //Sunday must be indexed as day 0\n week_days.push({id: full_name.substring(0, 1), active, day_index, full_name: full_name.toLocaleLowerCase()});\n start_week = start_week.addValue({ days : 1 });\n }\n return week_days\n}\n\nexport const getFirstDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isBeforeDate(b) ? a : b; });\n}\n\nexport const getLastDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isAfterDate(b) ? a : b; });\n}\n\nexport const recurrenceDetails = (recurr: RecurrenceDetails): string => {\n const end = getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `Occurs Every ${period} until ${end}`\n }else{\n return `Occurs Every ${recurr.interval} ${period}s until ${end}`\n }\n } \n \n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `Occurs on Specific Dates until ${getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')}`\n default:\n return ''\n }\n}\n\nexport const recurrenceRecurringDetails = (recurr: RecurrenceRecurringDetails): string => {\n const end = recurr.end\n const start = new DateTZ({ date: recurr.start })\n\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `occurs every ${period} effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }else{\n return `occurs every ${recurr.interval} ${period}s effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }\n }\n\n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `occurs on Specific Dates`\n default:\n return ''\n }\n}\n\nexport const handleRecurrenceFields = (data: HashMap) => {\n if(data.is_recurrent){\n if(data.recurrence_period !== RecurrencePeriod.LIST){\n delete data.recurrence_starts\n delete data.recurrence_endTz\n if(data.recurrence_period !== RecurrencePeriod.WEEKLY){\n delete data.recurrence_days\n }\n } else if(data.recurrence_period){\n data.recurrence_list = [...(data.recurrence_starts || []).map((date: DateTZ) => date.startOfValue('minute').seconds)]\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.recurrence_days\n }\n delete data.is_recurrent\n }else{\n delete data.recurrence_period;\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.is_recurrent\n delete data.recurrence_exceptions\n delete data.recurrence_days\n }\n\n return data\n}\n\n/** Removes expired occurrences and updates start and end dates when cloning a series */\nexport const removeExpiredOcurrences = (form: FormGroup) =>{\n if(form.controls.action?.value === SeriesAction.CLONE ){\n const tz = form.controls.space_list.value[0].timezone\n const date_now = new DateTZ({ is_local_tz: false, building_tz: tz });\n const occurrences = form.controls.recurrence_starts.value.filter((date: DateTZ) =>\n date_now.isBeforeDate(date, 'day') || date_now.isSameDate(date, 'day')\n )\n form.controls.recurrence_starts.setValue(occurrences)\n const { start, end } = setStartAndEndDateFromArray(occurrences, tz)\n form.controls.dateTz.setValue(start)\n form.controls.recurrence_endTz.setValue(end)\n }\n}\n\n/** \n * Returns starts and end dates from an array of dates in milliseconds \n **/\n export const setStartAndEndDateFromArray = (dates: Array, tz: string): {start: DateTZ, end: DateTZ} =>{\n if(dates.length !== 0){\n return {\n start: dates.sort((d1, d2) => d1.ms - d2.ms)[0] ,\n end: dates.sort((d1, d2) => d2.ms - d1.ms)[0]\n }\n }\n //if the dates array is empty set the start and end dates as the current and next day\n const now = DateNow(new Date()).toZone(tz)\n return {start: now, end: now.addValue({days: 1})}\n}\n\nexport const setRecurrenceStartsTime = (form: FormGroup) => {\n const { recurrence_starts, dateTz } = form.value\n const list = (recurrence_starts || []).map((date: DateTZ) => date.setValue({hour: dateTz.dateHour, minute: dateTz.minutes}))\n form.controls.recurrence_starts.setValue(list)\n}","export * from './report.class'\nexport * from './reports.service'\n","import { CurrencyPipe } from '@angular/common';\n\nimport {\n csvToJson,\n downloadFile,\n HashMap,\n humaniseDuration,\n jsonToCsv,\n} from '@mckinsey-converge/base';\n\nimport { ServiceManager } from '../service-manager.class';\nimport { Space } from '../spaces';\nimport { Organisation } from '../organisation';\n\nexport class Report {\n /** Type of report */\n public readonly type: string;\n /** List of data associated with the report */\n public readonly data: T[];\n\n constructor(raw_data: HashMap = {}) {\n this.type = raw_data.type || '';\n this.data = this.cleanData(raw_data.data);\n }\n\n /** Create report data structure from CSV */\n public static fromCSV(type: string, data: string): Report {\n const csv_json = csvToJson(data);\n return new Report({ type, data: csv_json });\n }\n\n /** Download report data as CSV format */\n public downloadCSV(name: string = 'unnamed.csv'): void {\n downloadFile(name, jsonToCsv(this.data));\n }\n\n /** Download report data as JSON format */\n public downloadJSON(name: string = 'unnamed.json'): void {\n downloadFile(name, JSON.stringify(this.data, undefined, 4));\n }\n\n public formatCancelledBy(email: string) {\n if (email !== null && email !== undefined) {\n let name = email.split('@')[0];\n name = name.split('_').join(' '); //get name from email and convert it to title case\n name = name.replace(/\\w\\S*/g, function (txt) {\n return `${txt\n .charAt(0)\n .toUpperCase()}${txt.substr(1).toLowerCase()}`;\n });\n return name;\n } else {\n return email;\n }\n }\n\n public timeConverter( UNIX_timestamp: number ){\n if(!UNIX_timestamp) return '';\n let a = new Date(UNIX_timestamp * 1000);\n let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n let year = a.getFullYear();\n let month = months[a.getMonth()];\n let date = a.getDate();\n let hour = ((a.getHours() + 11) % 12 + 1);\n let suffix = a.getHours() >= 12 ? \"PM\":\"AM\";\n let min = a.getMinutes() === 0 ? '00':a.getMinutes();\n let time = date + ' ' + month + ' ' + year + ' - ' + hour + ':' + min + ' ' + suffix;\n return time;\n }\n\n private cleanData(data: T[] = []) {\n if (data.length > 0 && this.type === 'day') {\n for (let i = 0; i < data.length; i++) {\n data[i]['booker'] = data[i]['booker'].name;\n data[i]['expected_attendees'] = Object.values(data[i]['expected_attendees'])[0];\n }\n } else if (data.length > 0 && this.type === 'audit') {\n for (let i = 0; i < data.length; i++) {\n data[i]['created_at'] = this.timeConverter(data[i]['created_at']);\n }\n } else if (data.length > 0 && this.type === 'catering') {\n for (let i = 0; i < data.length; i++) {\n data[i]['Cancelled By'] = this.formatCancelledBy(\n data[i]['Cancelled By']\n );\n }\n const fields = Object.keys(data[0]);\n const room_field = fields.find(\n (key) =>\n key.toLowerCase().includes('room') &&\n key.toLowerCase().includes('email')\n );\n const price_field = fields.find((key) =>\n key.toLowerCase().includes('price')\n );\n\n for (let row of data) {\n /* istanbul ignore else */\n const space_service = ServiceManager.serviceFor(Space);\n if (room_field && price_field && space_service) {\n const room = space_service.find(\n row[room_field].toLowerCase()\n );\n const org_service = ServiceManager.serviceFor(Organisation);\n const bld = org_service.buildings.find(\n (bld: { id: any }) =>\n bld.id === room?.level?.building_id\n );\n row[price_field] = new CurrencyPipe('en_us').transform(\n row[price_field] / 100,\n bld?.currency\n );\n }\n /* istanbul ignore else */\n for (let field of fields) {\n row[field] =\n typeof row[field] === 'string'\n ? row[field].replace(/\\,/g, '٫')\n : row[field];\n }\n }\n } else if (this.type === 'bookings') {\n data = data.map((i: HashMap) => {\n const booking = i;\n try {\n if (booking.setup instanceof Object) {\n booking.setup = booking.setup[booking.room_email];\n }\n if (booking.breakdown instanceof Object) {\n booking.breakdown =\n booking.breakdown[booking.room_email];\n }\n booking.setup = humaniseDuration((booking.setup || 0) / 60);\n booking.breakdown = humaniseDuration(\n (booking.breakdown || 0) / 60\n );\n booking.description = (booking.description || '')\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ');\n booking['Meeting Host'] =\n booking.organizer?.name || booking.organizer;\n booking['Booked By'] =\n booking.booked_by?.name ||\n booking.booked_by?.email ||\n '';\n booking.charge_code =\n booking.equipment_codes[booking.room_email] || '';\n // booking.expected_attendees = Object.keys(booking.expected_attendees).map(key => booking.expected_attendees[key]).join(', ');\n booking.attendees = (booking.attendees || [])\n .map((person) => person.name || person.email || person)\n .join('٫ ');\n booking.notes = (booking.notes || [])\n .map((note) =>\n note.author &&\n (note.type === 'description' ||\n note.type === 'private')\n ? `[${note.author}|${note.type}]${note.message\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ')}`\n : ''\n )\n .join(' | ');\n booking.cancelled = booking.isCancelled;\n booking.status = booking.status[booking.room_email] || '';\n booking.company = booking.company.join(', ');\n if (booking.cancelled_by) {\n booking.cancelled_by = this.formatCancelledBy(\n booking.cancelled_by\n );\n }\n booking.cancelled_date = this.timeConverter(booking.cancelled_at_epoch);\n\n } catch (e) {}\n const remove_fields = [\n 'id',\n 'icaluid',\n 'accepted_at',\n 'accepted_by',\n 'check_ins',\n 'changeKey',\n 'created',\n 'booking_type',\n 'edit_history',\n 'end_epoch',\n 'old_attendees',\n 'start_epoch',\n 'expected_attendees',\n 'isAllDay',\n 'isCancelled',\n 'body',\n 'is_free',\n 'lastModifiedDateTime',\n 'locationType',\n 'locations',\n 'organizer',\n 'booked_by',\n 'originalEndTimeZone',\n 'originalStartTimeZone',\n 'room_booking_status',\n 'room_email',\n 'room_emails',\n 'room_id',\n 'sensitivity',\n 'seriesMasterId',\n 'show_as',\n 'notes',\n 'subject',\n 'type',\n 'previous_booking',\n 'catering',\n 'responseStatus',\n 'equipment_codes',\n 'cancelled_at_epoch',\n ];\n for (const field of remove_fields) {\n if (booking[field] !== undefined) {\n delete booking[field];\n }\n }\n const output = {};\n const order = [\n 'title',\n 'start',\n 'end',\n 'location',\n 'Meeting Host',\n 'Booked By',\n 'booked_at',\n 'booked_ahead_by',\n 'all_day',\n 'attendees',\n 'company',\n 'description',\n 'cancelled',\n 'cancelled_by',\n 'cancelled_date',\n ];\n const keys = Object.keys(booking);\n keys.sort((a, b) => {\n const idx_a = order.indexOf(a);\n const idx_b = order.indexOf(b);\n return (\n (idx_a === -1 ? keys.length : idx_a) -\n (idx_b === -1 ? keys.length : idx_b)\n );\n });\n for (const key of keys) {\n output[key] = booking[key];\n }\n return output;\n }) as any;\n }\n return data;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { Report } from './report.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ReportsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Reports';\n this._api_route = 'reports';\n }\n\n protected process(raw_data: any): Report {\n return raw_data instanceof Array\n ? new Report({ data: raw_data })\n : Report.fromCSV('', raw_data);\n }\n}\n","import { Type } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { HashMap } from '@mckinsey-converge/base';\n\n\nexport interface ServiceLike extends HashMap {\n parent: any;\n add: (_: HashMap) => Promise;\n update: (id: string, _: HashMap) => Promise;\n delete: (id: string, params?: HashMap) => Promise;\n task: (id: string, name: string, data: HashMap) => Promise;\n listen: (prop: string) => Observable;\n}\n\nexport interface ServiceProvider {\n provideFor: Type;\n useValue: T;\n}\n\nexport class ServiceManager {\n /** Map of available services for child classes */\n private static _service_list: ServiceProvider[] = [];\n\n /** Set the services used to handle data model requests */\n public static setService(type: Type, service: any): void {\n if (window.debug) {\n (window as any).ServiceManager = this._service_list;\n }\n const index = ServiceManager._service_list.findIndex(provider => provider.provideFor === type);\n if (index >= 0) {\n ServiceManager._service_list.splice(index, 1, { provideFor: type, useValue: service });\n } else {\n ServiceManager._service_list.push({ provideFor: type, useValue: service });\n }\n }\n\n /** Get the services used to handle data model requests */\n public static serviceFor(type: Type): ServiceLike {\n const provider = ServiceManager._service_list.find(provider => provider.provideFor === type) || { useValue: null };\n return provider.useValue;\n }\n\n constructor() {\n throw new Error('ServiceMananger is static class');\n }\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\n\nimport { VERSION } from '@mckinsey-converge/environment';\nimport {\n BaseClass,\n getItemWithKeys,\n HashMap,\n log\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from './service-manager.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ndeclare global {\n interface Window {\n debug: boolean;\n }\n}\n\nexport const SETTINGS_TOKEN = 'settings_service_data';\n\ntype SettingsAppData = T & {\n title: string;\n description: string;\n short_name: string;\n logo_light: {\n type: string;\n src: string;\n background: string;\n }\n logo_dark: {\n type: string;\n src: string;\n background: string;\n }\n heap_io: {\n app_id: number;\n force_ssl: boolean;\n secure_cookie: boolean;\n disable_text_capture: boolean;\n cookie_path: string;\n }\n}\n\nexport interface SettingsData {\n debug: boolean;\n mock: boolean;\n frontend: 'staff' | 'concierge' | 'booking';\n composer: {\n domain: string;\n route: string;\n protocol: string;\n port: string;\n use_domain: boolean;\n local_login: boolean;\n }\n app: SettingsAppData;\n}\n\nexport class SettingsObject {\n constructor(public data: SettingsData) {\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SettingsService extends BaseClass {\n /** Name of the application */\n private _app_name = 'Converge';\n /** List of override settings in order of priority */\n private _overrides = new BehaviorSubject([]);\n /** Mapping of behaviour subjects */\n private _subjects: HashMap> = {};\n /** Mapping of observables */\n private _observables: HashMap> = {};\n /** Which frontend we're in. staff, concierge, or bookings **/\n public readonly frontend: string;\n private _bypass_bookings: boolean = false;\n\n /**\n * @hidden\n */\n public set overrides(value: HashMap[]) {\n this._overrides.next(value);\n }\n\n /** Get observable for key */\n public listen(name: string): Observable {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n return this._observables[name];\n }\n\n /** Update observable value for key */\n public post(name: string, value: T): void {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n this._subjects[name].next(value);\n }\n\n public value(name: string): T {\n return !this._observables[name] ? null : this._subjects[name].getValue();\n }\n\n /** Page title */\n public get title() {\n return this._title.getTitle();\n }\n\n public set title(value: string) {\n this._title.setTitle(`${value} | ${this._app_name}`);\n }\n\n constructor(private _title: Title,\n @Inject(SETTINGS_TOKEN)\n private settings: SettingsObject) {\n super();\n ServiceManager.setService(SettingsService, this);\n const time = new DateTZ({date: VERSION.time});\n const built = DateNow(new Date()).isSameDate(time, 'day')\n ? `Today at ${time.formatDate('h:mma')}`\n : time.formatDate('do MMM yyyy, h:mma');\n const frontend = this.get('frontend') || 'Unknown';\n this.frontend = frontend;\n log('CORE', `${VERSION.semver}`, null, 'debug', true, frontend?.toUpperCase());\n log('APP', `${VERSION.hash} | Built: ${built}`, null, 'debug', true, frontend?.toUpperCase());\n this.init();\n }\n\n /**\n * Initialise the settings\n */\n public async init() {\n if (this.get('debug')) {\n window.debug = true;\n }\n if (this.get('app')?.name) {\n this._app_name = this.get('app').name;\n }\n log('Settings', 'Successfully loaded settings');\n this._initialised.next(true);\n }\n\n /** Whether settings service has initialised */\n public get app_name() {\n return this._app_name;\n }\n\n public get concierge() {\n return this.frontend === 'concierge';\n }\n\n public set bypass_bookings(value: boolean) {\n this._bypass_bookings = value;\n }\n\n public get bypass_bookings() {\n return this._bypass_bookings;\n }\n\n /**\n * Get a setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public get(key: string): any {\n const keys = key.split('.');\n if (keys[0] !== 'app') {\n return getItemWithKeys(keys, this.settings.data);\n }\n const override_settings = this._overrides.getValue();\n for (const override of override_settings) {\n const value = getItemWithKeys(keys.slice(1), override);\n if (value != null) {\n return value;\n }\n }\n return getItemWithKeys(keys, this.settings.data);\n }\n}\n","export * from './space.class';\nexport * from './spaces.service';\nexport * from './space.utilities';\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n} from '@mckinsey-converge/base';\nimport {\n Building,\n BuildingLevel,\n Organisation\n} from '../organisation';\nimport { User } from '../users';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { SpaceRules } from '../bookings/booking.types';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { DateTime } from 'luxon';\n\nexport interface ISpaceAvailabilityOptions {\n /** Start date and time of the availability block */\n dateTz?: DateTZ;\n /** Length of the availability block */\n duration: number;\n /** */\n id?: string;\n /** List of spaces to look at the availability for */\n room_ids?: string;\n /** Whether the spaces looked at should be bookable */\n bookable?: boolean;\n /** List of spaces or zones to ignore */\n ignore?: string;\n /** List of zones to look at the availability for */\n zone_ids?: string | string[];\n /** Whether space bookings should not be returned */\n hide_bookings?: boolean;\n /** Min capacity on the room **/\n capacity?: number\n clear?: boolean;\n /** Length of the setup */\n setup?: number;\n /** Length of the breakdown */\n breakdown?: number;\n /** Hide declined bookings */\n hide_declined?: boolean;\n /** Max capacity on the room **/\n capacity_max?: number\n\n diff_capacity?: boolean\n\n /** Fields to include recurrence in the availability search */\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array\n is_recurrent?: boolean\n is_multiroom?: boolean\n merged?: boolean\n recurrence_days?: Array\n}\n\nexport interface SpaceBookingRuleOptions {\n dateTz: DateTZ;\n duration: number;\n host: User;\n}\n\nexport const OPTION_DEFAULTS: ISpaceAvailabilityOptions = {\n duration: 60\n};\n\nexport interface RecurrenceAvailability {\n /** Unix epoch in seconds */\n readonly date: number;\n /** Whetehr space is available at this time */\n readonly available: boolean;\n}\n\n/**\n * Room Settings Type\n *\n * Exmaple:\n * available: true\n * available_until: 1644344999\n * bookings: []\n * catering: false\n * charge_code: false\n * extra_features: \"meeting_room boardroom\"\n * internal_or_external: \"internal\"\n * map_id: \"08.8.15\"\n * natural_light: false\n * room_booking_screen: true\n * room_name: \"8.15 Meeting\"\n * vc: false\n * recurrence_availability: {\n * date: \"1642596300\",\n * available: false,\n * }\n */\nexport interface RoomSettings {\n // Local room name is required.\n room_name?: string\n // TBD if anything else should be required\n available?: boolean\n available_until?: number\n bookings?: HashMap[]\n catering?: boolean\n charge_code?: boolean\n extra_features?: string\n internal_or_external?: string\n map_id?: string\n natural_light?: boolean\n room_booking_screen?: boolean\n vc?: boolean\n recurrence_availability?: RecurrenceAvailability[]\n equipment_code?: boolean\n external?: boolean\n}\n\n/**\n * List of space features that come from settings.\n *\n * Im sure this list will grow. It is not the most comprehensive list.\n */\nexport enum SpaceFeatures {\n BoardRoom = 'boardroom',\n Catering = 'catering',\n CocktailRoom = 'cocktail',\n ConferencePhone = 'conference_phone',\n ConferenceRoom = 'conference',\n ElectronicWhiteboard = 'whiteboard',\n FlipChart = 'flipchart',\n Glassboard = 'glassboard',\n PartnerOffice = 'partner',\n PhoneBooth = 'phone_booth',\n TheatreRoom = 'theatre',\n TeamRoom = 'team_room',\n VideoConference = 'vc',\n NaturalLight = 'natural_light',\n WirelessContentSharing = 'wireless_content_sharing',\n WorkshopRoom = 'workshop',\n UShapeRoom = 'u_shape',\n Miscellaneous = 'miscellaneous'\n}\n\nexport enum SpaceEquipments {\n conference_phone,\n whiteboard,\n vc,\n flipchart,\n glassboard,\n wireless_content_sharing\n}\nexport enum SpaceStyles {\n boardroom,\n cocktail,\n conference,\n partner,\n theatre,\n team_room,\n // natural_light,\n workshop,\n u_shape,\n miscellaneous\n}\n\nconst EMPTY_ARRAY = [];\n\nexport class Space extends BaseDataClass {\n /** Whether space can be booked by users */\n public readonly bookable: boolean;\n /** People capacity of the space */\n public readonly capacity: number;\n /** Index to force order when sorting multiple spaces */\n public readonly sort_priority: number;\n /** Settings has extensive info displayed in the app. */\n public readonly settings: RoomSettings;\n /** URL for the control interface of the space */\n public readonly support_url: string;\n /** Engine zones associated with the space */\n public readonly zones: readonly string[];\n /** Is the Application concierge */\n public is_concierge: boolean = false;\n /** To allow bookings with rooms for staff calendar view only */\n public allowStaffRoomWithBookings: boolean = false;\n\n /** Simple name == local name being using in seeting.room_name\n\t\t *\n\t\t*/\n public simple_name: string;\n\n /** Room style set of all room style one room has\n * [\"boardroom\", \"cocktail\", \"miscellaneous\", \"natural_light\", \"theatre\", \"u-shape\", \"workshop\"] */\n public room_style: string[] = [];\n\n /** Equipment set of all room equipment one room has\n * [\"conference_phone\", \"whiteboard\", \"vc\", \"flipchart\", \"glassboard\", \"whiteboard\", \"wireless_content_sharing\"] */\n public equipment: string[] = [];\n\n /** Filters has charge code settings for booking and catering */\n public filters: RoomSettings;\n\n /** room_type subset of internal or external rooms */\n public room_type: string[] | string;\n /**\n * Features used in identifying room types.\n *\n * Both features and extra_features are space delimited strings.\n *\n * There is a getter featuresArray that returns the\n * combination of the two as an array.\n */\n public readonly features: string;\n public readonly extra_features: string;\n public map_id: string;\n\n\n /** Service for managing spaces */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Return the rooms' building */\n public get building() {\n return this._service?.buildings.find((bld) => {\n return this.zones.includes(bld.id);\n });\n }\n\n /** Return building timezone */\n public get timezone() {\n return this.building?.timezone;\n }\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = !!settingsService?.concierge;\n this.allowStaffRoomWithBookings = settingsService?.bypass_bookings || false;\n\n const defaultGlobalName = raw_data.name || raw_data.email || 'Meeting Room';\n const defaultSettings = {\n room_name: defaultGlobalName\n }\n /**\n * Duplicate of base-api.class just for readability\n * .name is the full, mckinsey standardised name of the room.\n * You can think of it was what people would call the room when\n * considering every office and room globally.\n *\n * this.name = raw_data.name;\n */\n /**\n * Settings has extensive info displayed in the app.\n * setting.room_name is always used when displaying the room name in the applications\n * setting.room_name is the more office-specific room name, you can think of this as\n * the one people in that office would refer to the room as.\n *\n */\n this.settings = raw_data.settings || defaultSettings;\n this.filters = raw_data?.filters;\n // Room fields\n this.bookable = raw_data.bookable || false;\n this.capacity = raw_data.capacity || 0;\n this.support_url = raw_data.support_url;\n this.zones = raw_data.zones instanceof Array ? raw_data.zones : [];\n // Feature fields\n this.features = raw_data.features || '';\n this.extra_features = raw_data.settings?.extra_features || '';\n\n\t\tthis.room_type = raw_data?.room_type;\n this.simple_name = raw_data?.simple_name;\n this.map_id = raw_data?.map_id || raw_data.settings?.map_id || '';\n this.room_style = raw_data?.room_style || [];\n this.equipment = raw_data?.equipment || [];\n\n }\n\n /**\n * Return the global room name\n * IE LDN-4-408-06\n */\n public get global_name(): string {\n return this.name || ''\n }\n\n /**\n * Return the local room name\n * i.e. 4.08\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.room_name\n */\n public get local_name(): string {\n return this.simple_name || this.name || ''; // this.settings?.room_name\n }\n\n public get street_and_city(): string {\n return this.building ? `${this.building.address}, ${this.building.city}` : '';\n }\n\n /**\n * Return the map_id from settings\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.map_id and use map_id from space modal( after testing over prod)\n */\n // public get map_id(): string {\n // return this?.map_id || this.settings?.map_id || '';\n // }\n\n /** Internal / External status */\n public get internal_or_external(): string {\n const external = this.filters?.external;\n return external ? 'external' : 'internal'; // ( external ? 'external' : this.settings?.internal_or_external ) || 'internal';\n }\n\n /**\n * Works in conjunction with available_until.\n *\n * If a room is bookable that only means you can make a booking but not when.\n * Available indicates that it is available to be booked durring the queried times.\n */\n public get available(): boolean {\n return this.settings?.available ?? false;\n }\n\n public get currently_in_use(): boolean {\n const nowMs = new DateTZ({ date: DateTime.now(), is_local_tz: false, building_tz: this.timezone }).ms;\n const runningBookings = this.settings?.bookings?.filter( bks => {\n const startEpoch = new DateTZ({ date: bks.start_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n const endEpoch = new DateTZ({ date: bks.end_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n return startEpoch <= nowMs && endEpoch >= nowMs;\n })\n // console.log(raw_data.settings.room_name+' : '+ nowMs.ms);\n // console.log('IS IN USER CURRENTLY : ', isinUsernow);\n return !!runningBookings.length;\n }\n\n /** Last returned availability time */\n public get available_until(): number {\n return this.settings?.available_until;\n }\n\n /** Bookings associated with the space */\n public get bookings(): HashMap[] {\n // We should need to care if a room as bookings in Staff\n if (!this.is_concierge && !this.allowStaffRoomWithBookings) {\n return EMPTY_ARRAY;\n }\n\n if (this.settings?.bookings?.length) {\n /**\n * When we're dealing with Concierge the API data arriving is rooms, and those rooms contain booking,\n * but those bookings don't contain a room since the room is the root.\n * In order for Concierge to filter bookings by room we need to reattach this room\n * to each of the bookings, with it's own bookings.\n *\n * It's loopy and kooky but correcting for this pattern is beyond the scope of this refactor.\n */\n const spaceWithBookings = new Space(this.toJSON());\n return this.settings?.bookings.map(b => {\n b.room = spaceWithBookings;\n return b;\n });\n }\n return EMPTY_ARRAY;\n }\n\n /**\n\t\t * Whether space has catering\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.catering and use filters?.catering instead\n\t\t */\n public get has_catering(): boolean {\n return this.filters?.catering || this.settings?.catering || false;\n }\n\n /** Returns an array of the space delimited feature and extra_feature strings.\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove features, extra_features\n */\n public get featuresArray(): (SpaceFeatures | string)[] {\n // (this.simple_name === \"Entresol M-06\" ) && console.log('raw_data : ', this)\n const roomType = Array.isArray(this.room_type) ? this.room_type : [this.room_type]\n const features = [\n ...this.features.split(' '),\n ...this.extra_features?.split(' '),\n\n ...roomType, // required to work with staff>result>filters\n ...this?.room_style,\n ...this?.equipment,\n\n (this.filters?.natural_light) && SpaceFeatures.NaturalLight || undefined, // || this.settings?.natural_light\n // this.settings?.natural_light && SpaceFeatures.NaturalLight || undefined,\n // this.settings?.vc && SpaceFeatures.VideoConference || undefined,\n ].filter(f => !!f).map(f => f.toLowerCase());\n //will be an array... new Set() turns it into a set, but [... ] turns it back into an array again\n return [ ...new Set(features) ];\n }\n\n /** Level in which the space is associated */\n public get level(): BuildingLevel {\n const service = ServiceManager.serviceFor(Organisation);\n return (service ? service.levelWithID(this.zones as any) : null) || new BuildingLevel({});\n }\n\n /**\n * Return the new recurrence_availability from settings\n */\n public get recurrence_availability(): RecurrenceAvailability[] {\n return this.settings?.recurrence_availability || [];\n }\n\n public get availableOccurrences(): number {\n if(this?.recurrence_availability) {\n return this?.recurrence_availability?.filter(recurr => recurr.available).length;\n }\n }\n\n public get totalOccurrences(): number {\n return this?.recurrence_availability.length;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Space {\n return new Space(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): Space {\n const space = { ...this };\n space.settings.bookings = []; // clear out bookings\n return new Space({ ...space, id: null, email: null });\n }\n\n /**\n * Generate the booking rules for space with given options\n * @param options Conditions for generating the space rules\n */\n public rulesFor(options: SpaceBookingRuleOptions): SpaceRules {\n if (!this._service || !this.level) {\n return { auto_approve: true, hide: false };\n }\n\n const building = this.is_concierge ? this.level.building_id : this.building\n\n if (!building) {\n return { auto_approve: true, hide: false };\n }\n const { dateTz, duration, host } = options;\n const rules: SpaceRules = rulesForSpace({\n time: dateTz.ms,\n duration,\n space: this,\n user: host,\n rules: building.booking_rules\n });\n return rules;\n }\n\n /**\n * Whether space can only be booked by request\n * @param options Conditions for checking the space rules\n */\n public byRequest(options: SpaceBookingRuleOptions) {\n const rules = this.rulesFor(options);\n return !rules.auto_approve;\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Space): HashMap {\n return { ...super.toJSON(), settings: { ...this.settings, bookings: [] }, filters: { ...this.filters }, equipment: [ ...this.equipment] };\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport {\n ISpaceAvailabilityOptions,\n Space\n} from './space.class';\nimport { Building } from '../organisation/building.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\n\nexport function availabilityOptionsToQuery(options: ISpaceAvailabilityOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n if (options.dateTz) {\n const date = options.dateTz.startOfValue('minute');\n query.available_from = date.seconds; // Add one second or API will not allow end to end booking\n query.available_to = date.addValue({ minutes: options.duration || 60 }).subtractValue({ seconds: 1 }).seconds;\n\n if (options.setup) query.setup = options.setup ;\n if (options.breakdown) query.breakdown = options.breakdown;\n \n delete query.dateTz;\n delete query.duration;\n }\n\n if (!options.capacity_max) delete query.capacity_max\n\n if (options.hide_declined) query.hide_declined = options.hide_declined;\n query = handleRecurrenceFields(query)\n }\n return query;\n}\n\n/**\n * Compare two spaces to determine order\n * @param first\n * @param second\n */\nexport function sort(first: Space, second: Space, blds: Building[] = []) {\n const bld = blds.find(bld => first.zones.includes(bld.id));\n const bld_b = blds.find(bld => second.zones.includes(bld.id));\n if (bld) {\n if (bld !== bld_b) {\n return (bld.name).localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = first.zones.indexOf(zone_id) >= 0;\n const b_has_zone = second.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n }\n return first.name.localeCompare(second.name);\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { BaseAPIService } from '../base.service';\nimport { ISpaceAvailabilityOptions, Space } from './space.class';\nimport { ApplicationLoadingState, HashMap } from '@mckinsey-converge/base';\nimport { availabilityOptionsToQuery } from './space.utilities';\nimport { ServiceManager } from '../service-manager.class';\nimport { OrganisationService } from '../organisation';\nimport { ApplicationService } from '../app.service';\nimport { SettingsService } from '../settings.service';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\n\nlet SPACE_LIST = [];\n\nexport function findSpace(id: string) {\n return SPACE_LIST.find((_) => _.id === id || _.email === id);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SpacesService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n private _org: OrganisationService,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n \n super(_composer, settingsService);\n ServiceManager.setService(Space, this);\n this._name = 'Space';\n this._api_route = 'rooms';\n this._compare = (a, b) =>\n !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this._list_filter = (a: Space) => {\n const bld = this._org.building;\n return a.level.building_id === bld.id;\n };\n this._org.initialised\n .pipe(first((_) => _))\n .subscribe(() => this.init());\n }\n\n public async query(query: HashMap = {}, setList:boolean = false) {\n const list = await super.query(query);\n if ( (query.hasOwnProperty('cache') && query.cache === false) || !Object.keys(query).length || setList) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n return list;\n }\n\n public filterAvailableSpaces(list: Space[]) {\n return list.filter((i) => {\n if (i.recurrence_availability?.length) return i; //if recurrence, send the space regardless of availability (needed for edit and cloning series)\n return i.available;\n });\n }\n\n /**\n * Get available spaces\n * @param options\n */\n public available(\n options: ISpaceAvailabilityOptions,\n uniqueId?: string,\n filter: boolean = true\n ): Promise {\n if (!options) {\n throw new Error('Space avilability requires request options');\n }\n\n const now = DateNow(new Date());\n if (!options.dateTz) {\n options.dateTz = now.startOfValue('minute');\n }\n\n if (options.hide_declined === undefined) {\n options.hide_declined = true;\n }\n\n const key = `available|${options.id ? options.id : ''}|${\n uniqueId ?? ''\n }`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Space[]) => {\n delete this._promises[key];\n resolve(filter ? this.filterAvailableSpaces(list) : list);\n };\n const error = (e) => {\n reject(e);\n delete this._promises[key];\n };\n const query = availabilityOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(\n (i) => respond([i]),\n error\n );\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n const loading: ApplicationLoadingState =\n this._service.get('loading') || {};\n if (!loading.spaces) {\n loading.spaces = {\n message: 'Loading space data',\n state: 'loading',\n };\n this._service.set('loading', loading);\n }\n // Adjusted the query by incorporating the \"zone_ids\" option to filter rooms based on specific zone IDs instead of considering all thousands of rooms.\n const option = {\n zone_ids: this._org.building.id\n }\n await this.query(option, true).catch(() => {\n loading.spaces = { message: 'Loading space data', state: 'failed' };\n this._service.set('loading', loading);\n });\n loading.spaces = { message: 'Loading space data', state: 'complete' };\n this._service.set('loading', loading);\n }\n\n /**\n * Convert raw data into API object\n * @param raw_data Raw API data\n */\n public process(raw_data: HashMap): Space {\n return new Space(raw_data);\n }\n /**\n * \n * Special observable function to make http call for rooms\n * @param query \n * @returns observable\n */\n public queryRooms = (query: HashMap = {}): Observable => super.queryRoomsForQR(query);\n\n public setSpaceList(list) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n\n public queryBooking = (query: HashMap = {}) : Observable | Observable => super.queryObsr(query);\n public updateSpace = (id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.updateObsr(id, form_data, should_inject_concierge, query_params);\n public uploadSpacePhotos = (apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.uploadSpacePhotos(apiSubRoute, form_data, should_inject_concierge, query_params);\n \n public updateRoomList() {\n this.load().then((_) => null)\n }\n}\n","import {\n BehaviorSubject,\n of\n} from 'rxjs';\nimport {\n Building,\n Organisation\n} from './organisation';\nimport { BaseDataClass } from './base-api.class';\nimport { MapLocation } from './location';\nimport { User } from './users';\nimport { Booking } from './bookings';\nimport {\n RoomSettings,\n Space,\n SpaceFeatures\n} from './spaces';\nimport { ServiceManager } from './service-manager.class';\nimport {\n CateringCategory,\n CateringItem\n} from './catering';\nimport {\n HashMap,\n padZero,\n predictableRandomInt,\n unique\n} from '@mckinsey-converge/base';\n\nimport * as faker from 'faker';\n\nimport {\n SETTINGS_TOKEN,\n SettingsData,\n SettingsObject,\n SettingsService\n} from './settings.service';\nimport { Report } from './reports';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nfaker.seed(2560);\n\nlet SERVICE: any;\n\ndeclare global {\n interface Jest {\n fn: () => any\n }\n}\n\n\ndeclare let jest: Jest;\n\n/* istanbul ignore file */\n\nexport function generateMockOrganisationService(): HashMap {\n return {\n levelWithID: jest.fn(),\n listen: jest.fn(),\n loadOrganisation: jest.fn(),\n initialised: of(true),\n building: new Building(generateMockBuilding({ id: 'bld-01' })),\n loadBuildingsWithOrg: jest.fn(),\n getOrganizationFiltersByRoomType: jest.fn(),\n getRoomTypeSubsetDDOptions: jest.fn(),\n getRoomFilterOptionsPerLocation: jest.fn(),\n ...generateMockDataService('OrganisationService')\n };\n}\n\nexport const generateMockSpacesService = (): HashMap => ({\n available: jest.fn(),\n ...generateMockDataService('SpacesService')\n});\n\nexport const generateMockUsersService = (): HashMap => ({\n loadCurrentUser: jest.fn(),\n ...generateMockDataService('UsersService')\n});\n\nexport const bookingState = () => ({\n bookings: of([]),\n filtered: of([]),\n filtered_week: of([]),\n filtered_month: of([]),\n setZone: jest.fn(),\n setDate: jest.fn(),\n setFilters: jest.fn(),\n add: jest.fn(),\n replace: jest.fn(),\n remove: jest.fn(),\n startPolling: jest.fn(),\n startPollingMonth: jest.fn(),\n startPollingWeek: jest.fn(),\n startPollingEveryFiveMin: jest.fn(),\n _noOfMeetings: of([])\n});\n\nconst test_app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n }\n};\n\nexport const TEST_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/test',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app: test_app,\n mock: false,\n frontend: 'staff'\n};\n\nexport const generateMockSettingsService = (overrides: Partial> = {}) => new SettingsService({ getTitle: () => jest.fn() } as any,\n new SettingsObject({\n ...TEST_SETTINGS,\n ...overrides\n }));\n\n/**\n * Provides an injectable instance for settings.\n */\nexport const provideMockSettingsObject = (settings: Partial> = {}) => ({\n provide: SETTINGS_TOKEN,\n useValue: new SettingsObject({\n ...TEST_SETTINGS,\n ...settings\n })\n});\n\n/**\n * Generate a mocked version of the application service\n */\nexport function generateMockAppService(settingsOverrides: Partial> = {}) {\n SERVICE = {\n setting: jest.fn(),\n notify: jest.fn(),\n notifyInfo: jest.fn(),\n notifyWarn: jest.fn(),\n notifySuccess: jest.fn(),\n notifyError: jest.fn(),\n log: jest.fn(),\n navigate: jest.fn(),\n navigateBack: jest.fn(),\n get: jest.fn(),\n listen: jest.fn(),\n set: jest.fn(),\n Composer: { auth: { token: 'test' } },\n Hotkeys: { listen: jest.fn() },\n Users: generateMockUsersService(),\n Organisation: generateMockOrganisationService(),\n Locations: generateMockDataService('LocationsService'),\n Base: generateMockDataService('BaseService'),\n Menu: generateMockDataService('CateringMenuService'),\n Spaces: generateMockSpacesService(),\n Bookings: generateMockDataService('BookingsService'),\n Reports: generateMockDataService('ReportsService'),\n CateringItems: generateMockDataService('CateringItemsService'),\n CateringCategories: generateMockDataService('CateringCategoriesService'),\n Settings: generateMockSettingsService(settingsOverrides),\n initialised: of(true)\n };\n ServiceManager.setService(BaseDataClass, SERVICE.Base);\n ServiceManager.setService(Organisation, SERVICE.Organisation);\n ServiceManager.setService(Building, SERVICE.Organisation);\n ServiceManager.setService(User, SERVICE.Users);\n ServiceManager.setService(Booking, SERVICE.Bookings);\n ServiceManager.setService(Space, SERVICE.Spaces);\n ServiceManager.setService(MapLocation, SERVICE.Locations);\n ServiceManager.setService(Report, SERVICE.Reports);\n ServiceManager.setService(CateringItem, SERVICE.CateringItems);\n ServiceManager.setService(CateringCategory, SERVICE.CateringCategories);\n SERVICE.Organisation.buildings = [SERVICE.Organisation.building];\n SERVICE.Users.current = new User(generateMockUser());\n SERVICE.Users.initialised = of(true);\n SERVICE.Bookings.booking_list = new BehaviorSubject(new Array(10).fill(0).map(_ => new Booking(generateMockBooking())));\n SERVICE.listen.mockReturnValue(of(null, []));\n return SERVICE;\n}\n\nexport function generateMockDataService(name: string) {\n const service = {\n find: jest.fn(),\n filter: jest.fn(),\n listen: jest.fn(),\n get: jest.fn(),\n set: jest.fn(),\n setting: jest.fn(),\n query: jest.fn(),\n show: jest.fn(),\n add: jest.fn(),\n save: jest.fn(),\n remove: jest.fn(),\n delete: jest.fn(),\n update: jest.fn(),\n addFrom: jest.fn(),\n removeFrom: jest.fn(),\n task: jest.fn(),\n available: jest.fn(),\n process: jest.fn(),\n updateList: jest.fn(),\n clearList: jest.fn(),\n removeFromList: jest.fn(),\n accept: jest.fn(),\n decline: jest.fn(),\n checkin: jest.fn(),\n is_logged_in: false,\n initialised: of(true),\n getHoldingBay: jest.fn(),\n name,\n queryRooms: of(true),\n queryRoomsForQR: of([]),\n queryObsr: of([]),\n queryBooking: of(true),\n checkinIndividualVisitor: jest.fn(),\n taskObsr: of(true),\n updateSpace: jest.fn(),\n updateObsr: of([]),\n uploadSpacePhotos: of([])\n\n };\n\n service.getHoldingBay.mockImplementation(_ => Promise.resolve([new Booking({})]));\n service.save.mockImplementation(_ => Promise.resolve(new Booking({})));\n\n service.listen.mockReturnValue(of(null));\n service.filter.mockReturnValue([]);\n return service;\n}\n\nlet SPACE_COUNT: number = 0;\n\nexport function generateMinimalRoomDetails(count: number) {\n return {\n name: `space-0${count}`,\n email: `space-0${count}@test.com`,\n settings: {\n name: `localname-0${count}`,\n catering: true\n }\n }\n}\n\nexport function generateMockSpace(overrides: HashMap = {}, space_id: number = null, recurring_search: boolean = false ): Space {\n const id = `space-${space_id || SPACE_COUNT++}`;\n const name = overrides.name || `${faker.name} ${faker.name.lastName()} Space`;\n const startOfDay = DateNow(new Date()).startOfValue('day');\n let settings: RoomSettings = {\n available: true,\n available_until: startOfDay.addValue({ days: 1 }).seconds, // (Date.now() / 1000) + (60 * 60 * 24), // now plus 24 hrs\n bookings: Array(10).fill(0).map(i => generateMockBooking()),\n catering: true,\n charge_code: true,\n extra_features: \"meeting_room boardroom\",\n internal_or_external: \"internal\",\n map_id: \"1\",\n natural_light: false,\n room_booking_screen: true,\n room_name: `${name} - Local Name`,\n vc: false,\n }\n if (overrides.settings) {\n settings = { ...settings, ...overrides.settings };\n delete overrides.settings;\n }\n if (recurring_search) {\n settings.recurrence_availability = [\n {\n date: startOfDay.seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 1 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 2 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 3 }).seconds,\n available: false,\n },\n ]\n }\n\n const linked = Math.floor(predictableRandomInt(99999)) % 2 === 0 && SPACE_COUNT > 1;\n return new Space({\n id,\n name: `${name} - Global Name`,\n map_id: `${space_id || SPACE_COUNT}`,\n type: faker.commerce.productName(),\n searchable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n controlable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n hourly_rate: Math.floor(predictableRandomInt(300)) * 100,\n bookable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n capacity: 15,\n sort_priority: 0,\n setup: Math.floor(predictableRandomInt(6)) * 5,\n breakdown: Math.floor(predictableRandomInt(6)) * 5,\n support_url: `/control/#/${id}`,\n image: faker.image.business(),\n zones: ['zone_lvl-0'],\n features: `${SpaceFeatures.BoardRoom} ${SpaceFeatures.ElectronicWhiteboard}`,\n email: `${name.toLowerCase().split(' ').join('.')}@${USER_DOMAIN}`,\n settings,\n ...overrides\n });\n}\n\nlet BOOKING_COUNT = 0;\nlet BOOKING_DATE = DateNow(new Date()).setValue({ hour: 6 }).setValue({minute: 0}).subtractValue({ days: 10 }).startOfValue('minute');\n\n/**\n * Set the initial time used for generating mock bookings\n * @param time New initial time as ms from UTC epoch\n */\nexport function setMockBookingStartDatetime(time: number) {\n const date = new DateTZ({date: time})\n BOOKING_DATE = date.startOfValue('minute');\n}\n\n/**\n * Create mock raw API data for a booking\n * @param override Overrides the properties of the generated booking with it's own\n */\nexport function generateMockBooking(override: HashMap = {}) {\n const id = `booking-${BOOKING_COUNT++}`;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4) + 2) * 15 });\n const start = BOOKING_DATE.ms;\n const duration = Math.floor(predictableRandomInt(4) + 2) * 15;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4)) * 15 });\n const organiser = generateMockUser({ external: false, visitor: false });\n const orders = Array(Math.floor(predictableRandomInt(5)))\n .fill(0)\n .map(_ => generateMockCateringOrder({ booking_date: start }, override.room_ids, override.menu));\n const hasCatering = Math.floor(predictableRandomInt(34567)) % 3 === 0;\n const date_start = new DateTZ({date: start})\n return {\n id,\n title: `${faker.commerce.productName()} Meeting`,\n attendees: Array(Math.floor(predictableRandomInt(5) + 2))\n .fill(0)\n .map((_, i) => generateMockUser(override.users)),\n organiser,\n start_epoch: date_start.seconds,\n end_epoch: date_start.addValue({ minutes: duration }).seconds,\n body: faker.lorem.paragraph(),\n notes: [{ type: 'other', message: faker.lorem.paragraph() }],\n location: faker.address.city(),\n // Mckinsey only has internal or external meetings\n booking_type: ['internal', 'external'][predictableRandomInt(2)],\n setup: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n breakdown: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n status: 'accepted',\n catering: hasCatering ? orders : [],\n room: new Space(generateMinimalRoomDetails(1)), // returns space-01 type values\n equipment_codes: {},\n company:[],\n ...override\n };\n}\n\nlet BLD_COUNT = 0;\nlet LVL_COUNT = 0;\n\n/**\n * Generate raw mock data for creating a building\n * @param id Forced ID for the mock\n * @param overrides Supply object value overrides in place. Supports a levelGenerator function\n * to stabilize level ids for testing.\n */\nexport function generateMockBuilding(overrides: HashMap = {}): HashMap {\n const id = `zone_bld-${BLD_COUNT++}`;\n const levels = Array(10)\n .fill(0)\n .map((_, i) => generateMockLevel(undefined, overrides.levelGenerator?.(i)));\n const features: any = {};\n for (const lvl of levels) {\n const count = Math.floor(predictableRandomInt(3) + 2);\n features[lvl.level_id] = {};\n for (let i = 0; i < count; i++) {\n features[lvl.level_id][faker.commerce.productName()] = `feature-${i + 1}`;\n }\n }\n return {\n id,\n zone_id: id,\n extras: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n code: 'NYO',\n name: faker.name.firstName(),\n address: 'building address field',\n city: 'building city',\n loan_items: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n levels,\n roles: {\n 'first-aiders': Array(10)\n .fill(0)\n .map(i => generateMockUser())\n },\n neighbourhoods: features,\n settings: {\n test: {\n nested: {\n level2: true,\n org: false\n }\n },\n city: faker.address.city()\n },\n timezone: 'America/Chicago',\n ...overrides\n };\n}\n\n/**\n * Generate raw mock data for a building level\n * @param id Forced ID for the mock\n * @param overrides value overrides\n */\nexport function generateMockLevel(id?: string, overrides: HashMap = {}): HashMap {\n if (!id) {\n id = `zone_lvl-${LVL_COUNT++}`;\n }\n return {\n id,\n level_id: id,\n level_name: `Level ${LVL_COUNT}`,\n short_name: `L ${LVL_COUNT}`,\n ...overrides\n };\n}\n\nlet USER_COUNT = 0;\n\nexport let USER_DOMAIN = 'acaprojects.com';\n\nconst USER_EMAILS: string[] = [];\n\n/**\n * Generate raw mock data for a user\n * @param id Forced ID for the mock\n * @param name Forced name for the user\n * @param external Whether user is external of the organisation\n */\nexport function generateMockUser(override: HashMap = {}): HashMap {\n const id = `user-${USER_COUNT++}`;\n const name = `${faker.name.firstName()} ${faker.name.lastName()}`;\n const external = override.external || !(predictableRandomInt(99999) % 2);\n const organisation = external ? faker.company.companyName() : USER_DOMAIN.split('.')[0];\n let delegates: {email: string, opt_out: boolean}[] = [];\n const delegate_count = Math.min(predictableRandomInt(4) + 1, USER_EMAILS.length);\n for (let i = 0; i < delegate_count; i++) {\n delegates.push({email: USER_EMAILS[Math.floor(predictableRandomInt(USER_EMAILS.length))], opt_out: false});\n }\n delegates = unique(delegates);\n const email = `${name\n .split(' ')\n .join('.')\n .toLowerCase()}@${external ? 'not-' : ''}${USER_DOMAIN}`;\n USER_EMAILS.push(email);\n return {\n id,\n name,\n first_name: name.split(' ')[0],\n last_name: name.split(' ')[1],\n email,\n phone: faker.phone.phoneNumber(),\n visitor: external,\n organisation: {\n id: organisation\n .split(' ')\n .join('.')\n .toLowerCase(),\n name: organisation\n },\n department: faker.commerce.department(),\n staff_code: padZero(Math.floor(predictableRandomInt(99999)), 5),\n delegates,\n image: faker.image.avatar(),\n ...override\n };\n}\n\nexport function generateMockCateringOrder(overrides: HashMap = {}, room_id: string = '', menu: HashMap = {}) {\n return {\n id: `order-${predictableRandomInt(9999_9999)}`,\n delivery_time: predictableRandomInt(6) * 5,\n location_id: room_id, // R--- could be undefined\n items: new Array(predictableRandomInt(5, 1)).fill(0).map(i => pickMenuItem(menu)),\n ...overrides\n };\n}\n\nfunction pickMenuItem(menu_map: HashMap = {}) {\n const zones = Object.keys(menu_map);\n const menu = menu_map[zones[predictableRandomInt(zones.length)]] || [];\n const category = menu[predictableRandomInt(menu.length)] || { items: [] };\n const group = { ...(category.items[predictableRandomInt(category.items.length)] || {}) };\n if (!group.package && group.items?.length) {\n const item = { ...group.items[predictableRandomInt(group.items.length)] };\n item.amount = predictableRandomInt(5, 1);\n return item;\n }\n group.amount = predictableRandomInt(5, 1);\n return group;\n}\n\nexport function generateMockLocation(overrides: HashMap, fixed_locations: string[], maps: string[]): HashMap {\n const fixed = predictableRandomInt(999_999_999) % 2 === 0;\n if (fixed && (!overrides || overrides.fixed)) {\n return {\n map_id: fixed_locations[predictableRandomInt(fixed_locations.length)],\n level: maps[predictableRandomInt(maps.length)],\n ...overrides\n };\n } else {\n return {\n x: predictableRandomInt(900, 100),\n x_max: 1000,\n y: predictableRandomInt(500, 100),\n level: maps[predictableRandomInt(maps.length)],\n confidence: predictableRandomInt(30),\n ...overrides\n };\n }\n}\n\nlet ORG_COUNT = 0;\n\nexport function generateMockOrganisation(): HashMap {\n const buildings = Array(3).fill(0).map(i => generateMockBuilding());\n return {\n id: `zone_org-${ORG_COUNT++}`,\n name: `Organisation ${ORG_COUNT}`,\n buildings,\n settings: {\n discovery_info: {\n buildings\n },\n test: {\n nested: {\n org: true\n }\n }\n }\n };\n}\n\n\nexport const generateMockBuildingSetByCity = () => {\n const buildings: Building[] = Array(10).fill(0)\n .map(() => new Building(generateMockBuilding()));\n buildings.push(...Array(2).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'Auckland'\n },\n city: 'Auckland'\n }))));\n buildings.push(...Array(5).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'NYC'\n },\n city: 'NYC'\n }))));\n return buildings;\n};\n\nexport function generateMockModalData(data: HashMap = null) : HashMap {\n if (data) {\n return data;\n }\n return {\n pendingDate: new Date(1603087100 + (1000 * 60 * 15)),\n pendingDuration: 60,\n date: 1603087100,\n duration: 30,\n }\n}\n\nexport const mockDateToBuildingTz = (date?: number) =>{\n return new DateTZ({date, building_tz: 'America/Chicago', is_local_tz: false})\n}","export * from './user.class'\nexport * from './user.utilities'\nexport * from './users.service'\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { MapLocation } from '../location';\nimport { ServiceManager } from '../service-manager.class';\n\nexport class User extends BaseDataClass {\n \n /** Currently logged in user */\n public static get active_user(): User {\n const service = ServiceManager.serviceFor(User);\n return service ? service.current : null;\n }\n\n /** First name of the user */\n public readonly first_name: string;\n /** Last name of the user */\n public readonly last_name: string;\n /** Windows user ID */\n public readonly windows_id: string;\n /** FMNO */\n public readonly fmno: string;\n /** Type of user */\n public readonly type: 'partner' | 'external' | 'internal';\n /** Contact phone number of the user */\n public readonly phone: string;\n /** Organisational department the user is part of */\n public readonly business_unit: string;\n /** Whether user is external from the application's organisation */\n public readonly external: boolean;\n /** Whether user is a visitor */\n public readonly visitor: boolean;\n /** Organisational Identifier for the user */\n public readonly staff_code: string;\n /** Basic location descriptor for the user */\n public readonly location: string;\n /** List of users that this user can act on behalf */\n public readonly delegates: readonly {email: string, opt_out: boolean}[];\n /** URL of the user's avatar image */\n public readonly image: string;\n /** List of user groups associated with this user */\n public readonly groups: readonly string[];\n /** Organisation the user is associated with */\n private _organisation: Identity;\n\n /** Map location of the user */\n private _location: MapLocation;\n /** List of desk bookings */\n // private _desk_bookings: HashMap = {}; // R--- can't explain why this is here.\n /** Host/Organisawe email notification opt out/in setting */\n public opt_out: boolean;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this.first_name = raw_data.first_name || '';\n this.last_name = raw_data.last_name || '';\n this.windows_id = raw_data.email || '';\n this.fmno = raw_data.fmno;\n this.external = raw_data.external || false;\n this.visitor = raw_data.visitor || false;\n\n\n this.type = this.visitor ? 'external' : 'internal';\n this.phone = raw_data.phone || raw_data.mobile || '';\n this.business_unit = raw_data.business_unit || raw_data.department || '';\n this._organisation = raw_data.organisation || {\n id: raw_data.organisation_id,\n name: raw_data.organisation_name\n };\n\n this._location = null;\n this.image = raw_data.image || '';\n this.staff_code = raw_data.staff_code || raw_data.fmno || '';\n this.delegates = raw_data.delegates || [];\n this._location = new MapLocation(\n raw_data.location && raw_data.location instanceof Object\n ? raw_data.location\n : { name: raw_data.location }\n );\n this.groups = raw_data.groups || [];\n this.location = raw_data.location || raw_data.officeLocation || '';\n this.opt_out = raw_data.opt_out;\n }\n\n /** Organisation the user is associated with */\n public get organisation() {\n return this._organisation;\n }\n\n /** Map location of the user */\n public get last_location(): MapLocation {\n return new MapLocation(this._location || {});\n }\n\n /**\n * Ask the server for the users current location\n */\n public locate(): Promise {\n const service: any = ServiceManager.serviceFor(MapLocation);\n return new Promise((resolve, reject) => {\n if (service) {\n service.show(this.id, { desk: this.email }).then(\n l => {\n this._location = l;\n resolve(l);\n },\n e => reject(e)\n );\n } else {\n resolve(null);\n }\n });\n }\n\n /**\n * Whether user is available during the given period\n * @param start Start time as a unix timestamp with milliseconds\n * @param end End time as a unix timestamp with milliseconds\n */\n public available(start?: number, end?: number): Promise {\n return new Promise(resolve => {\n this._service.query({ email: this.email, start, end }).then(\n l => resolve(l && l.length > 0),\n _ => resolve(false)\n );\n });\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): User {\n return new User(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): User {\n return new User({ ...this, id: null, email: null });\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: User): HashMap {\n const data = super.toJSON();\n delete data.location;\n return data;\n }\n}\n\n// R--- Might need an toApiJSON due to visitor field.","import {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { HashMap } from '@mckinsey-converge/base';\nimport { User } from './user.class';\n\n/**\n * Generate form fields for the given user\n * @param user User to generate form for\n */\nexport function generateUserForm(user: User): FormGroup {\n if (!user) {\n throw Error('No user passed');\n }\n const fields: HashMap = {\n id: new FormControl(user.id || ''),\n name: new FormControl(user.name || ''),\n first_name: new FormControl(user.first_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n last_name: new FormControl(user.last_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n email: new FormControl(user.email || '', [Validators.email])\n };\n // Generate form group for booking item\n return new FormGroup(fields);\n}\n","import { Injectable } from '@angular/core';\nimport { Location } from '@angular/common';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { Md5 } from 'ts-md5/dist/md5';\n\nimport { BaseAPIService } from '../base.service';\nimport { User } from './user.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface ILoginOptions {\n /** URL to post login request to */\n url?: string;\n /** Whether form data is passed in the body of the request */\n form?: boolean;\n /** Custom headers to pass into the post request */\n headers?: HashMap;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UsersService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n protected uhttp: HttpClient,\n protected location: Location,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(User, this);\n this._name = 'Users';\n this._api_route = 'users';\n this._compare = (a, b) => !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this.set('list', []);\n this.set('current_user', new User({ id: 'local_user', name: 'Local User' }));\n this.set('delegates', null);\n this._composer.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /** Currently logged in user */\n public get current(): User {\n return this.get('current_user');\n }\n\n /** Whether the user has properly logged in */\n public get is_logged_in(): boolean {\n return this.current && this.current.id !== 'local_user';\n }\n\n /* istanbul ignore next */\n /**\n * Sets the access token and expiry for the user\n * @param token OAuth bearer token\n * @param expiry Expiry epoch timestamp in ms\n * @param reload Whether to reload the page after setting tokens\n */\n public setToken(token: string, expiry?: number, reload: boolean = true) {\n if (!expiry) {\n const now = DateNow(new Date())\n expiry = now.addValue({ days: 7 }).endOfValue('day').ms;\n }\n const path = `${location.origin}${\n this._service.setting('composer.route') || ''\n }/oauth-resp.html`;\n const client_id = Md5.hashStr(path);\n if (sessionStorage) {\n sessionStorage.setItem(`${client_id}_access_token`, token);\n sessionStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (localStorage) {\n localStorage.setItem(`${client_id}_access_token`, token);\n localStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (reload) {\n this.location.go(this.location.path());\n }\n return path;\n }\n\n /**\n * Post login request to the API\n * @param query_params Key value pairs to pass into\n * @param options Options for the login request\n */\n public async login(query_params: HashMap, options: ILoginOptions = {}): Promise {\n if (this.settingsService.concierge) {\n if (!this._promises['login']) {\n this._promises['login'] = new Promise((resolve, reject) => {\n this.set('status', 'loading');\n let headers = new HttpHeaders();\n if (!options || options.form !== false) {\n headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');\n }\n const url = (options ? options.url : '') || '/auth/signin';\n this.uhttp.post(url, query_params, { headers }).subscribe(\n (_) => null,\n (e) => reject(e),\n () => {\n this._composer.auth.authorise();\n resolve();\n }\n );\n });\n }\n return this._promises['login'];\n }\n }\n\n\n /**\n * Logout of user and redirect to logout URL\n */\n public logout() {\n this._composer.auth.logout();\n }\n\n /**\n * Loads current user from API. This diverges from {@link load} in order to simply return\n * the user object instead of setting it on the service.\n */\n public async loadCurrentUser(): Promise {\n return this.show('current')\n }\n\n /**\n * Load initial data for the service\n */\n protected load(tries: number = 0): Promise {\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.user = { message: 'Loading user credentials', state: 'loading' };\n this._service.set('loading', loading);\n this.set('status', 'loading');\n return new Promise((resolve) => {\n // this is due to unclear nature of the merge between concierge and staff\n // concierge has the retries enabled, while staff continuously retries.\n if (this.settingsService.concierge && tries > 4) {\n this.set('status', 'invalid');\n loading.user = { message: 'Loading user credentials', state: 'failed' };\n this._service.set('loading', loading);\n return resolve();\n }\n this.show('current').then(\n async (current_user) => {\n this.set('status', 'available');\n this.set('current_user', current_user);\n this._initialised.next(true);\n if (this._service && this._service.setting('app.user.grab_api_details')) {\n this.show(current_user.email).then(\n async (user) => {\n this.set('current_user', user);\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = {\n message: 'Loading user credentials',\n state: 'complete'\n };\n this._service.set('loading', loading);\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n } else {\n \n // is after process\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => current_user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = { message: 'Loading user credentials', state: 'complete' };\n this._service.set('loading', loading);\n }\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n });\n }\n\n private async loadDelegates() {\n const delegates = this.current.delegates;\n if (!delegates || !delegates.length) {\n return [];\n }\n const promises: Promise[] = [];\n for (const del of delegates) {\n promises.push(this.show(del.email));\n }\n const list = await Promise.all(promises);\n this.set('delegates', list);\n this.set('list', unique((this.get('list') || []).concat(list)));\n return list;\n }\n\n /**\n * Convert raw API data into a valid User Object\n * @param raw_item Raw API data\n */\n protected process(raw_data: any): User {\n return new User(raw_data);\n }\n}","import { AbstractControl } from '@angular/forms';\n\nimport { User } from './users';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n\nconst HAS_ERROR = true;\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n */\nexport function buildValidateDate(date?: number) {\n const from = new DateTZ({ date });\n return (c) => validateDate(c, date);\n}\n\n/**\n * Check that control value is a date that is the same or after from date\n * @param control Angular form control\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateDate(control: AbstractControl, is_from?: number) {\n const from = new DateTZ({date: is_from})\n const date = new DateTZ({date: control.value})\n return date.isBeforeDate(from) ? { date: HAS_ERROR, message: 'Booking needs to be made in the future' } : null;\n}\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function buildValidateStartTime(date: number, is_from?: number) {\n const from = new DateTZ({date: is_from})\n return (c) => validateStartTime(c, date, from.ms);\n}\n\n/**\n * Check that control value time is after the comparison date time\n * @param control Angular form control\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateStartTime(control: AbstractControl, date: number, is_from?: number) {\n const now = new DateTZ({date: is_from});\n const parts = control.value.split(':');\n const date_obj = new DateTZ({date});\n return date_obj.setValue({ hour: +parts[0], minute: +parts[1] }).isBeforeDate(now) ? {\n start: HAS_ERROR,\n message: 'Booking time needs to be made in the future'\n } : null;\n}\n\nexport function buildValidateDuration(min: number = 30, max: number = 240) {\n return (c) => validateDuration(c, min, max);\n}\n\nexport function validateDuration(control: AbstractControl, min: number = 30, max: number = 240) {\n if (control.value < (min || 30)) {\n return { duration: HAS_ERROR, message: `Minimum booking duration is ${min} minute${min === 1 ? 's' : ''}` };\n } else if (control.value > (max || 480)) {\n return { length: HAS_ERROR, message: `Maximum booking duration is ${max} minute${max === 1 ? 's' : ''}` };\n }\n return null;\n}\n\nexport function buildValidateAttendees(host: User, min: number = 0) {\n return (c) => validateAttendees(c, host, min);\n}\n\nexport function validateAttendees(control: AbstractControl, host: User, min: number = 0) {\n if (!control || !(control.value instanceof Array)) {\n return min > 0\n ? { invalid: true, message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you` }\n : null;\n }\n const list: User[] = control.value;\n if (host) {\n const result = list.find(a => a.email === host.email);\n if (result) {\n list.splice(list.indexOf(result), 1);\n }\n }\n return list.length >= min ? null : {\n count: true,\n message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you`\n };\n}\n\nexport function validateEndTime(dateControlTz: AbstractControl) {\n return (control: AbstractControl) => {\n // const date = new DateTZ({date: date_control ? date_control.value : undefined})\n const now = DateNow(new Date())\n return dateControlTz.value.addValue({ minutes: control.value || 60 }).isBeforeDate(now)? { end_time: true } : null;\n };\n}\n\nexport function noWhitespaceValidator(control: AbstractControl) {\n const value = control?.value;\n if ( value === '') {\n return null; // Return null if control value is undefined or null\n }\n const isWhitespace = value.trim().length === 0;\n // const isValid = !isWhitespace;\n return !isWhitespace ? null : { whitespace: true };\n}\n\n","export * from './lib/date-tz.class'","import { DateObjectUnits, DateTime, DateTimeUnit, DurationLike, DurationUnits } from 'luxon';\nimport { getTimezoneOffset } from 'date-fns-tz';\n\nfunction padZero(value: number, length: number): string {\n let str = `${value}`;\n while (str.length < length) str = `0${str}`;\n return str;\n}\n\ninterface DateTZParams {\n date?: number | DateTime\n building_tz?: string\n is_local_tz?: boolean\n all_day?: boolean\n}\n\nconst now = new Date()\n\nexport class DateTZ {\n date: DateTime\n date_org: DateTime\n building_tz: string\n is_local_tz: boolean = true\n all_day: boolean\n local_tz: string\n valid: boolean\n\n constructor(data?: DateTZParams) { \n this.date_org = typeof data?.date === 'number' ? DateTime.fromMillis(data?.date) : data?.date ? data?.date : DateTime.fromMillis(now.valueOf())\n this.is_local_tz = data?.is_local_tz === false ? data?.is_local_tz : true\n this.all_day = data?.all_day || false\n this.local_tz = DateTime.now().zoneName\n this.building_tz = data?.building_tz || this.local_tz\n this.date = !this.is_local_tz ? this.date_org.setZone(this.building_tz) : this.date_org\n this.valid = this.date.isValid\n }\n\n //get epoch milliseconds\n public get ms(): number {\n return this.date.valueOf()\n }\n\n //get epoch seconds\n public get seconds(): number {\n return Math.trunc(this.date.toSeconds())\n }\n\n //get the second of the minute\n public get second(): number {\n return this.date.second\n }\n\n //get the minutes of the hour\n public get minutes(): number {\n return this.date.minute\n }\n\n //get the minutes of the hour\n public get hours(): number {\n return this.date.hour\n }\n\n public get utc(): number {\n const newDate = new DateTZ({...this, date: this.date.toUTC()})\n return newDate.seconds\n }\n\n public get dateDay(): number {\n return this.date.day\n }\n\n public get dateHour(): number {\n return this.date.hour\n }\n\n public get dateYear(): number {\n return this.date.year\n }\n\n public get dateWeekday(): number {\n try {\n return this.date.weekday;\n } catch (e) {\n return this.date.toJSDate().getDay();\n }\n }\n\n public get dateMonth(): number {\n return this.date.month\n }\n\n public dateDiff (compare_to: DateTZ, unit: DurationUnits, ans_unit = 'minutes'): number {\n return this.date.diff(compare_to.date, unit)[ans_unit]\n }\n\n //set the date to the begining of the given unit\n public startOfValue (unit: DateTimeUnit) {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 7) {\n // Don't change, we want sunday as the start of the week even though luxon thinks it is Monday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 1) {\n // If this.date is monday, just subtract one more day to make it Sunday\n const monday = new DateTZ({ ...this, date: this.date })\n newDate = monday.subtractValue({ days: 1 });\n } else {\n // If later than monday, startOfWeek back to monday and then subtact another day to get to Sunday.\n const monday = new DateTZ({...this, date: this.date.startOf(unit)})\n newDate = monday.subtractValue({ days: 1 })\n }\n }\n\n return newDate\n }\n\n //set the date to the end of the given unit\n public endOfValue (unit: DateTimeUnit) : DateTZ {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 6) {\n // Don't change, we want saturday as the end of the week even though luxon thinks it is Sunday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 7) {\n // If this.date is Sunday, this alone is the luxon end of week so add a day\n // to get to monday, then endOfWeek to Sunday, and subtract 1 day to Saturday\n const sunday = new DateTZ({ ...this, date: this.date }).addValue({ days: 1 })\n newDate = sunday.endOfValue(unit).subtractValue({ days: 1 }); // return next saturday\n } else {\n // If not saturday or sunday\n // endOfWeek to Sunday and then subtact a day to get to Saturday.\n const later = new DateTZ({...this, date: this.date.endOf(unit)})\n newDate = later.subtractValue({ days: 1 })\n }\n } else {\n newDate = new DateTZ({...this, date: this.date.endOf(unit)})\n }\n\n return newDate\n }\n \n public startEpoch (): number {\n const org = new DateTZ({date: this.date_org})\n return this.all_day\n ? this.startOfValue('day').ms - this.dateDiff(org, 'minutes')\n : this.ms\n }\n\n //clone the given value and unit to the date\n public clone (): DateTZ {\n // return new DateTZ({...this})\n return this.addValue({ seconds: 0 })\n }\n\n //adds the given value and unit to the date\n public addValue (duration: DurationLike, isLastDayOfMonth?: boolean): DateTZ {\n return new DateTZ({...this, date: isLastDayOfMonth ? this.date.plus(duration).endOf('month') : this.date.plus(duration)});\n }\n\n //subtracts the given value and unit to the date\n public subtractValue (duration: DurationLike): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.minus(duration)})\n return newDate\n }\n\n public setValue (obj: DateObjectUnits): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.set(obj)})\n return newDate\n }\n\n public formatDate (format: string): string {\n // Return new immuatable via \"plus\" to prevent \n // TypeError: Cannot assign to read only property 'weekData' of object\n // https://github.com/moment/luxon/issues/601\n return this.date.plus({ seconds: 0 }).toFormat(format)\n }\n\n public formatLocalDate (format: string): string {\n // setZone already returns new immutable so it doesn't have the formatDate issue.\n return this.date.plus({ seconds: 0 }).setZone(this.local_tz).toFormat(format)\n }\n\n public isSameDate(compare_to: DateTZ, value: DateTimeUnit): boolean {\n return this.date.hasSame(compare_to.date, value)\n }\n\n public isAfterDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear > compare_to.dateYear\n case 'month':\n if(this.isAfterDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth > compare_to.dateMonth\n }\n case 'day':\n if(this.isAfterDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay > compare_to.dateDay\n }\n case 'hour':\n if(this.isAfterDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour > compare_to.dateHour\n }\n case 'minute':\n if(this.isAfterDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes > compare_to.minutes\n }\n default:\n return this.ms > compare_to.ms;\n }\n }\n\n public isBeforeDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear < compare_to.dateYear\n case 'month':\n if(this.isBeforeDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth < compare_to.dateMonth\n }\n case 'day':\n if(this.isBeforeDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay < compare_to.dateDay\n }\n case 'hour':\n if(this.isBeforeDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour < compare_to.dateHour\n }\n case 'minute':\n if(this.isBeforeDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes < compare_to.minutes\n }\n default:\n return this.ms < compare_to.ms;\n }\n }\n\n public toZone(tz: string): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: this.date.setZone(tz), \n building_tz: tz, \n is_local_tz: false\n })\n return newDate\n }\n\n public setTimestamp(timestamp: number): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: timestamp,\n })\n return newDate\n }\n\n public get JSDate(): Date {\n return this.date.toJSDate()\n }\n\n // helper to log out the dateTZ values\n public logDateTz (label: string = ''): void {\n console.log(`${label} local tz/date/time`, this.addValue({ seconds: 0 }).formatLocalDate(\"cccc d MMMM,yyyy h:mma\"), this.local_tz)\n console.log(`${label} building tz/date/time`, this.addValue({ seconds: 0 }).formatDate(\"cccc d MMMM,yyyy h:mma\"), this.building_tz)\n }\n}\n\nexport const DateNow = (date: Date = new Date()) => {\n return new DateTZ({date: date.valueOf()})\n} \n\n// input the local time and the building timezone\nexport const convertLocalTimestampToTimezonedDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const date = new Date(timestamp);\n return new DateTZ({ date: timestamp, building_tz: buildingTimezone, is_local_tz: false }).setValue({\n day: date.getDate(),\n hour: date.getHours(),\n minute: date.getMinutes()\n });\n}\n\n// input the building time and the building timezone\nexport const convertTimezonedTimestampToLocalDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const local_tz = DateTime.now().zoneName;\n const localOffset = getTimezoneOffset(local_tz, new Date(timestamp));\n const desiredOffset = getTimezoneOffset(buildingTimezone, new Date(timestamp));\n if (localOffset > desiredOffset) {\n const eleA = timestamp + (localOffset - desiredOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n } else {\n const eleA = timestamp + (desiredOffset - localOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n }\n}\n\nexport const localTimezone = () => {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n}\n\nexport const getTimezoneOffsetString = (tz: string) => {\n const offset_minutes = Math.floor(getTimezoneOffset(tz) / 1000 / 60);\n const hours = Math.floor(offset_minutes/60);\n const minutes = offset_minutes % 60;\n return `${offset_minutes > 0 ? '+' : '-'}${padZero(Math.abs(hours), 2)}${padZero(minutes, 2)}`;\n}\n\nexport function toMiddayUTC(value: DateTZ = DateNow()) {\n // exclude Auckland from rouding up timezone as it has 12+ hours UTC timezone difference\n return value.building_tz.includes('Auckland') ? value : new DateTZ({\n date: value.setValue({ hour: 12, minute: 0 }).ms,\n is_local_tz: false,\n building_tz: 'UTC',\n }).setValue({ hour: 12, minute: 0 });\n}\n\n/**returns the offset between two timezones in minutes and hours */\nexport function timezoneOffset(tz: string){\n const nowTz = DateNow(new Date())\n const offset = nowTz.date.offset - nowTz.toZone(tz).date.offset\n return {minutes: offset, hours: offset/60}\n}\n\nexport function isToday (date, timezone) {\n\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: timezone\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: timezone,\n }),\n 'day'\n );\n}\n","export * from './lib/environment.module';\nexport * from './lib/version';\nexport * from './lib/environment.service'\nexport * from './lib/types'\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n providers: []\n})\nexport class EnvironmentModule {\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { EnvironmentData } from './types';\n\nexport const ENVIRONMENT_TOKEN = 'environments_service_data';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class EnvironmentService {\n\n public get production(): boolean {\n return this.environment.production;\n }\n\n public get heap_io_id(): number {\n return this.environment.heap_io_id;\n }\n\n constructor(@Inject(ENVIRONMENT_TOKEN) private environment: EnvironmentData) {\n }\n}\n","// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\n/* tslint:disable */\nexport const VERSION = {\n \"dirty\": false,\n \"raw\": \"9bc1456e2\",\n \"hash\": \"9bc1456e2\",\n \"distance\": null,\n \"tag\": null,\n \"semver\": null,\n \"suffix\": \"9bc1456e2\",\n \"semverString\": null,\n \"version\": \"0.0.0\",\n \"time\": 1734038699575\n};\n/* tslint:enable */\n","export * from './lib/legacy-overlays.module';\nexport * from './lib/space-select-modal/space-select-modal.component';\nexport * from './lib/new-user-modal/new-user-modal.component';\nexport * from './lib/confirm-modal/confirm-modal.component';\nexport * from './lib/catering-confirm-modal/catering-confirm-modal.component';\nexport * from './lib/catering-details-modal/catering-details-modal.component';\nexport * from './lib/requirement-details-modal/requirement-details-modal.component';\nexport * from './lib/booking-confirm/booking-confirm.component';\nexport * from './lib/user-form/user-form.component'\nexport * from './lib/booking-form/booking-form.component'\nexport * from './lib/no-catering-modal/no-catering-modal.component'\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n Renderer2,\n ViewChild\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport { Router } from '@angular/router';\n\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n CateringOrder,\n getFirstDateFromList,\n OrganisationService,\n rulesForSpace,\n recurrenceDetails,\n SeriesAction,\n SettingsService,\n Space,\n SpacesService,\n User,\n UsersService,\n formatWhen,\n BOOKING_STATUS,\n CloseDialogService,\n DialogIds\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent,\n HashMap,\n humaniseDuration\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport interface BookingConfirmModalData {\n old_booking: Booking;\n booking: Booking;\n action?: SeriesAction\n}\n\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\n\n@Component({\n selector: 'a-booking-confirm-modal',\n templateUrl: './booking-confirm.component.html',\n styleUrls: ['./booking-confirm.component.scss']\n})\nexport class BookingConfirmComponent extends BaseDirective implements OnInit{\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** Display string for changes are being processed */\n public loading: string;\n /** Whether space availability is being checked */\n public checking_available: boolean;\n /** Whether to show all attendees */\n public show_attendees: boolean = false;\n /** Whether to show all locations */\n public show_locations: boolean;\n /** Whether to show all catering orders */\n public show_orders: boolean;\n /** Whether booking has succeeded */\n public success: boolean;\n /** Whether booking needs to be accepted */\n public readonly is_request: boolean;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n lastMomentConflict: boolean = false;\n \n @ViewChild('attendeesListRef') attendeesListRef: ElementRef;\n @ViewChild('locationsListRef') locationsListRef: ElementRef;\n @ViewChild('cateringListRef') cateringListRef: ElementRef;\n\n /** Booking to confirm changes to */\n public get old_booking(): Booking {\n return this._data.old_booking;\n }\n\n /** Booking to confirm changes to */\n public get booking(): Booking {\n return this._data.booking;\n }\n\n /** Active user */\n public get user(): User {\n return this._users.current;\n }\n\n /** Title of the displayed event */\n public get title(): string {\n return this.booking.title;\n }\n\n /** Comapny names */\n public get company(): string[] {\n return this.booking.company;\n }\n \n\n /** Display string of when the event will occur */\n public get when(): string {\n const duration_value = this.booking.duration;\n const all_day = this.booking.all_day && duration_value < 25 * 60;\n if(this.booking.is_recurrent && this.booking.recurrence_starts && this.booking.recurrence_starts.length){\n return formatWhen({all_day, ...this.recurrenceDates })\n }\n return formatWhen({\n all_day,\n startTZ: this.booking.startDateTz,\n endTZ: this.booking.endDateTz,\n displayEndTZ: this.booking.displayEndDateTz})\n }\n\n public get recurrenceDates(){\n const startTZ = getFirstDateFromList(this.booking.recurrence_starts)\n const endTZ = startTZ.addValue({minutes: this.booking.duration})\n return {startTZ, endTZ, displayEndTZ: endTZ}\n }\n\n /** Display string for the recurrence value of the booking */\n public get recurrence(): string {\n return recurrenceDetails({\n period: this.booking.recurrence_period,\n end: this.booking.recurrence_endTz,\n list: this.booking.recurrence_starts,\n interval: this.booking.recurrence_interval\n });\n }\n\n /** Display string for the event's duration */\n public get duration(): string {\n const duration_value = this.booking.duration;\n return this.booking.all_day ? 'All Day' : humaniseDuration(duration_value);\n }\n\n /** List of spaces associated with the event */\n public get spaces(): Space[] {\n return this.booking.multi_rooms;\n }\n\n /** List of attendees associated with the event not including the host */\n public get attendees(): User[] {\n const attendees = this.booking.attendees;\n return attendees.filter((i) => i.email !== this.organiser.email);\n }\n\n /** Host of the event */\n public get organiser(): User {\n return this.booking.organiser || this._users.current;\n }\n\n /** Host of the event */\n public get equipment_codes(): HashMap {\n return this.booking.equipment_codes || {};\n }\n\n /** Host of the event */\n public get catering_codes(): HashMap {\n const catering = this.catering;\n const codes = {};\n for (const order of this.catering) {\n codes[order.location_id] = order.charge_code;\n }\n return codes;\n }\n\n /** Host of the event */\n public get equipment_notes(): HashMap {\n return this.booking.notes\n .filter((note) => note.type === 'equipment')\n .reduce((map, notes) => {\n map[notes.space] = notes.message;\n return map;\n }, {});\n }\n\n /** Details about the event */\n public get notes(): string {\n return this.booking.body;\n }\n\n /** List of catering orders in the booking */\n public get catering(): CateringOrder[] {\n return (this.booking.catering || []).map((order) => {\n const space: any = this.spaces.find(\n (a_space) => a_space.email === order.location_id\n ) || {\n level: {}\n };\n const building: any =\n this._org.buildings.find((bld) => bld.id === space.level.building_id) || {};\n return new CateringOrder({\n ...order,\n location: space.local_name,\n symbol: building.currency,\n booking_date: this.booking.startDateTz.ms,\n booking_timezone: this.booking.timezone,\n });\n });\n }\n\n /** Map of changes to the booking */\n public get changes(): HashMap {\n return {};\n }\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _org: OrganisationService,\n private _bookings: BookingsService,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private _router: Router,\n private _dialog: MatDialog,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: BookingConfirmModalData,\n public settings: SettingsService,\n private closeDialogService: CloseDialogService, \n private renderer: Renderer2,\n ) {\n super();\n this.booking.time_changed =\n this.old_booking &&\n (this.old_booking.startDateTz.ms !== this.booking.startDateTz.ms ||\n this.old_booking.duration !== this.booking.duration);\n // in concierge, all bookings are acceptable without explicit approval.\n\n const rules = rulesForSpace({ user: this.user, space: this.booking.room, duration: 60 });\n this.is_request = this.settings.concierge ? false : rules.auto_approve;\n }\n\n ngOnInit(): void {\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined; \n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && (booker_concierge !== null && booker_concierge !==undefined ) && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && (booker_concierge['email'] && organiser.email !==booker_concierge['email']) ) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = 'Checking availability of selected spaces';\n this._dialog_ref.disableClose = true;\n this.checkSpaceAvailability().then(\n () => {\n this.loading = 'Processing booking request...';\n // Change the unchanged settings to the selected room\n const newEmail = this.booking.space.email;\n const replaceObjects = ['setup', 'breakdown', 'approval_status']\n replaceObjects.forEach(key => {\n const obj = this.booking[key];\n if (obj && obj.constructor === Object) {\n const keys = Object.keys(obj);\n if (keys.length > 0) {\n const replacement = {};\n keys.forEach(nk => {\n replacement[newEmail] = obj[nk];\n })\n this.booking[key] = replacement;\n }\n }\n });\n\n const buffer = {};\n this.booking.multi_rooms.map(room => room.email).forEach(elem => buffer[elem] = 900);\n\n // // if no setup or breakdown time already added and notes or catering exist? add 15 min buffer setup and breakdown to booking\n // if(this.booking.setup === null || this.booking.breakdown === null){\n // const has_note_buffer = (this.booking.notes && this.booking.notes?.length) || (this.booking.catering && this.booking.catering?.length) ? \n // buffer : null; // 900 seconds = 15 min\n // if (has_note_buffer) {\n // this.booking.setup = has_note_buffer;\n // this.booking.breakdown = has_note_buffer; \n // this.booking.room_setup = has_note_buffer; \n // this.booking.room_breakdown = has_note_buffer; \n // }\n // }\n\n // if no setup time already added and notes or catering exist? add 15 min buffer setup time to booking\n if (this.booking.setup === null || this.booking.setup === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.setup = has_note_buffer;\n this.booking.room_setup = has_note_buffer;\n }\n }\n\n // if no breakdown time already added and notes or catering exist? add 15 min buffer breakdown time to booking\n if (this.booking.breakdown === null || this.booking.breakdown === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.breakdown = has_note_buffer;\n this.booking.room_breakdown = has_note_buffer;\n }\n }\n\n\n this._bookings.save(this.booking, this._data.action === SeriesAction.EDIT).then(\n async (bkn) => {\n this.loading = null;\n this.success = true;\n this._dialog_ref.disableClose = false;\n const updated = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this._booking_state_service.replace(updated);\n \n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(updated.recurrence_master_id !== null)\n { \n const master_booking = await this._bookings.show(updated.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n if (bkn.is_recurrent && bkn.recurrence_type === 'master') {\n this._booking_state_service.pollOnce();\n this.closeDialogService.closeDialog(DialogIds.MeetingDetails);\n }\n\n localStorage.removeItem('ACA_STAFF.booking_form_data');\n this.event.emit({ reason: 'done' });\n this._service.notifySuccess(\n `Successfully ${this.booking.id ? 'updated' : 'created'} booking`\n );\n },\n (err) => {\n\n this._dialog_ref.disableClose = false;\n let erroMessage: string = '';\n switch(err.status){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 400:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 409:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.lastMomentConflict = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n },\n (err) => {\n\n this.lastMomentConflict = true;\n this._dialog_ref.disableClose = false;\n const erroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n }\n\n /**\n * Staff only\n */\n public newBooking() {\n this._router.navigate(['/book', 'spaces']);\n this._dialog_ref.close();\n }\n\n /**\n * Staff only\n */\n public toSchedule() {\n this._router.navigate(['/schedule'], {\n queryParams: { email: this.booking.organiser.email }\n });\n this._dialog_ref.close();\n }\n\n /**\n * Check whether the selected spaces are available for the selected time period\n */\n public checkSpaceAvailability(): Promise {\n const spaces: Space[] = this.spaces;\n if (\n (this.booking.id &&\n (this.booking.startDateTz.ms === this.old_booking.startDateTz.ms &&\n this.booking.duration === this.old_booking.duration)) ||\n (spaces && spaces.length <= 0)\n ) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n // Use of this.booking.timezone is unreliable, use booking space instead.\n const all_day = this.booking.all_day;\n // R--- should be nothing to do with date as a timestamp getter\n this._spaces\n .available({\n room_ids: spaces.map((space) => space.id).join(','),\n dateTz: this.booking.startDateTz,\n duration: all_day ? 24 * 60 : this.booking.duration,\n ignore: this.booking.icaluid,\n recurrence_count: this.booking.recurrence_count,\n recurrence_period: this.booking.recurrence_period,\n recurrence_endTz: this.booking.recurrence_endTz,\n recurrence_interval: this.booking.recurrence_interval,\n recurrence_starts: this.booking.recurrence_starts,\n is_recurrent: this.booking.is_recurrent,\n recurrence_days: this.booking.recurrence_days\n })\n .then(\n (space_list) => {\n for (const space of space_list) {\n if (!space.bookable) {\n this.lastMomentConflict = true;\n return reject(\n `${space.name} is not available at the select time period.`\n );\n }\n }\n if (space_list.length < spaces.length) {\n this.lastMomentConflict = true;\n return reject(\n `${spaces[0].name} is not available at the select time period.`\n );\n }\n resolve();\n },\n (err) => reject(err)\n );\n });\n }\n\n public openConflictsModal(){\n const ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: this.booking.local_room_name,\n conflicts: this.booking.recurrence_exceptions,\n copy_conflicts: true,\n timezone: this.booking.timezone\n }\n });\n\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n if(event.reason === 'close'){\n ref.close();\n }else if(event.reason === 'action'){\n navigator.clipboard.writeText(this.conflictsText)\n }\n \n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public get conflictsText(){\n let text = ''\n this.booking.recurrence_exceptions.map((date)=>{\n const dateTZ = new DateTZ({date: date*1000});\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n text = `${text}\\n${display}${dateTZ.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n })\n return text\n }\n\n public toggleList(listType: 'attendees' | 'locations' | 'catering') {\n if (listType === 'attendees') {\n this.show_attendees ? this.collapseList(this.attendeesListRef) : this.expandList(this.attendeesListRef);\n this.show_attendees = !this.show_attendees;\n } else if (listType === 'locations') {\n this.show_locations ? this.collapseList(this.locationsListRef) : this.expandList(this.locationsListRef);\n this.show_locations = !this.show_locations;\n } else if (listType === 'catering') {\n this.show_orders ? this.collapseList(this.cateringListRef) : this.expandList(this.cateringListRef);\n this.show_orders = !this.show_orders;\n }\n }\n\n public expandList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n const listItems = listElement.getElementsByClassName('list-item');\n let totalHeight = 0;\n\n for (let i = 0; i < listItems.length; i++) {\n totalHeight += listItems[i].offsetHeight;\n }\n\n this.renderer.setStyle(listElement, 'max-height', `${totalHeight}px`);\n this.renderer.addClass(listElement, 'shown');\n }\n\n public collapseList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n this.renderer.setStyle(listElement, 'max-height', '4.5em');\n this.renderer.removeClass(listElement, 'shown');\n }\n}\n","\n \n\n\n
\n \n \n \n \n
\n
\n\n
\n
\n
\n \n
\n
\n {{ loading }}\n
\n
\n
\n
\n\n \n \n \n
My Day\n \n\n","import {\n Component,\n Input,\n OnInit, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter \n} from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { MatDialog } from '@angular/material/dialog';\nimport { distinctUntilChanged, first, skip } from 'rxjs/operators';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n arrayWithValues,\n BookingAction,\n CateringOrder,\n SeriesAction,\n SettingsService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\n\nimport { NewUserModalComponent } from '../new-user-modal/new-user-modal.component';\nimport {\n SpaceSelectModalComponent,\n SpaceSelectModalData\n} from '../space-select-modal/space-select-modal.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { MatChipsModule} from '@angular/material/chips';\n\n\n@Component({\n selector: 'a-booking-form',\n templateUrl: './booking-form.component.html',\n styleUrls: ['./booking-form.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingFormComponent extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n /** List of available users to host bookings */\n public user_list: User[] = [];\n public nowTz: DateTZ = DateNow(new Date());\n /** From date input for date field */\n public fromDateTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n /** Last bookable date, concierge only */\n public readonly untilDateTz = DateNow(new Date()).addValue({ days: 365 }).endOfValue('day');\n public isConcierge: boolean;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\";\n // Define an array to store selected company options\n public chipOptions: any[] = [];\n public showTimeCateringWarning: boolean = false;\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _dialog: MatDialog,\n private settingsService: SettingsService,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n this.isConcierge = this.settingsService.concierge;\n }\n\n public ngOnInit(): void {\n // Trim title \n // this.form.get('title').setValue(this.form.get('title').value.trim());\n\n this.chipOptions = [...this.form.controls.company.value];\n\n this.localTimezone = DateNow(new Date()).building_tz;\n const building_tz = (\n this.form.controls.action &&\n (\n this.form.controls.action.value === 'booking_clone' ||\n this.form.controls.action.value === 'clone' ||\n this.form.controls.action.value === 'edit' ||\n this.form.controls.action.value === 'booking_edit'\n ) &&\n this.form.controls.dateTz &&\n this.form.controls.dateTz.value\n ) ? this.form.controls.dateTz.value.building_tz : this.localTimezone;\n\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz });\n this.fromDateTz = closestToTimeSlotTz(this.nowTz, 15);\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map(\n (del) => this._users.find(del.email) || new User({ email: del.email, name: del.email.split('@')[0] })\n );\n this.user_list = [user].concat(delegates);\n });\n\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n this.subscription('formChanges', this.form.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe(() => {\n this.timeout('update_coachmark', () => {\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n }, 500);\n })\n );\n\n this.subscription('isRecurrentChanges', this.form.controls.is_recurrent.valueChanges\n .subscribe(() => {\n const recurrenceStarts = this.form.controls.recurrence_starts\n if(!this.form.controls.is_recurrent.value){\n recurrenceStarts.clearValidators() \n }else{\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n recurrenceStarts.setValidators(arrayValidators);\n }\n recurrenceStarts.updateValueAndValidity()\n })\n ); \n\n /**Disable Inputs */\n this.disableInputs();\n\n /**turn is_recurrent to false if editing or cloning a stand-alone/occurrence */\n if(this.form.controls.id?.value && !this.form.controls.action?.value){\n this.form.controls.is_recurrent.setValue(false)\n }\n\n // Subscribe to changes in dateTz, duration, and has_catering\n this.subscription('dateTz_changes', this.form.controls.dateTz.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n this.subscription('duration_changes', this.form.controls.duration.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // No need to subscribe to catering_changes since we're now handling has_catering\n this.subscription('has_catering_changes', this.form.controls.has_catering.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // Initial check\n this.checkTimeCateringWarning();\n}\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.form.get(key).setValue(this.form.get(key).value.trim());\n }\n\n /** Whether notes and description should use the HTML editor */\n public get use_html(): boolean {\n return this._service.setting('app.booking.html_body') || false;\n }\n\n /** List of available types for bookings */\n public get booking_types(): Identity[] {\n return this._service.setting('app.booking.booking_types') || [];\n }\n\n /** Display string for the list of active spaces */\n public get spaces(): string {\n const spaces = this.form.controls.space_list.value;\n return spaces.length === 1\n ? spaces[0].local_name\n : spaces.length > 1\n ? `${spaces.length} spaces selected`\n : 'No Spaces selected';\n }\n\n public disableInputs() {\n const { id, action, needs_space, is_recurrent } = this.form.value;\n const has_id = !!id;\n const is_edit = action === BookingAction.EDIT;\n if (has_id) {\n this.form.get('is_recurrent')?.disable();\n }\n\n if(is_edit){\n this.form.get('is_multiroom')?.disable();\n }\n\n if (!this.isConcierge && !needs_space) {\n this.form.get('has_catering')?.disable();\n }\n if(has_id && is_edit && is_recurrent){\n this.form.get('dateTz')?.disable()\n this.form.patchValue({ action: null });\n }\n }\n\n /**\n * Open modal to change the space details for the booking\n */\n public openSpacesModal(): void {\n const ref = this._dialog.open(\n SpaceSelectModalComponent,\n {\n width: 'auto',\n height: 'auto',\n maxWidth: '95vw',\n data: {\n spaces: this.form.controls.space_list.value,\n dateTz: this.form.controls.dateTz.value,\n duration: this.form.controls.duration.value,\n host: this.form.controls.organiser.value,\n multiple: true,\n needsCatering: !!this.form.controls.catering?.value?.length,\n }\n }\n );\n this.subscription(\n 'new_spaces',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n let space_list = this.form.controls.space_list.value;\n space_list = event.metadata;\n this.form.controls.space_list.setValue(unique(space_list, 'id'));\n if (event.noCatering) {\n // Set has_catering to false and clear the catering list\n this.form.controls.has_catering.setValue(false);\n this.form.controls.catering?.setValue([]);\n } else {\n const catering = this.form.controls?.catering?.value.map((order: CateringOrder) => {\n order.location = space_list[0].name;\n order.location_id = space_list[0].email;\n return order;\n });\n this.form.controls.catering?.setValue(catering || []);\n }\n ref.close();\n this.unsub('new_spaces');\n }\n if (event.reason === 'close') {\n ref.close();\n this.unsub('new_spaces');\n }\n })\n );\n }\n\n /**\n * Open modal to change the recurrence details for the booking\n */\n public openNewUserModal() {\n const ref = this._dialog.open(NewUserModalComponent, {\n width: 'auto',\n height: 'auto'\n });\n this.subscription(\n 'new_user',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const attendees = this.form.controls.attendees?.value;\n attendees.push(event.metadata);\n this.form.controls.attendees.setValue(unique(attendees, 'email'));\n ref.close();\n this.unsub('new_user');\n this.cdRef.detectChanges();\n }\n })\n );\n }\n\n // Add & Remove chip and set the value of the form control accordingly\n addCompany(event, company): void {\n if (company) {\n this.chipOptions.push(company);\n this.form.controls.company.setValue(this.chipOptions);\n }\n event.preventDefault();\n }\n\n removeOption(option: any): void {\n const index = this.chipOptions.indexOf(option);\n if (index >= 0) {\n this.chipOptions.splice(index, 1);\n }\n this.form.controls.company.setValue(this.chipOptions);\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (!timezone) timezone = this.localTimezone;\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n const dateTz = this.form.controls.dateTz.value;\n if (dateTz && localTzOffset !== buildingTzOffset) {\n const startDate = dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.form.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n this.cdRef.detectChanges();\n }\n\n public get isSeriesAction(){\n return this.form.value.action === SeriesAction.CLONE || this.form.value.action === SeriesAction.EDIT\n }\n\n onToggleChange(toggledControlName: string, is_multiroom: boolean): void {\n if (toggledControlName === 'is_recurrent') {\n // If the is_recurrent toggle is being activated, deactivate is_multiroom\n if (this.form.controls.is_recurrent?.value) {\n this.form.controls.is_multiroom?.setValue(false);\n this.form.controls.merged?.setValue(false);\n this.form.get('merged')?.disable();\n\n }\n } else if (toggledControlName === 'is_multiroom') {\n // If the is_multiroom toggle is being activated, deactivate is_recurrent\n if (this.form.controls.is_multiroom?.value) {\n this.form.controls.is_recurrent?.setValue(false);\n }\n if(is_multiroom) { \n this.form.get('merged').setValue(false);\n this.form.get('merged')?.enable() \n } else {\n this.form.get('merged').setValue(false); \n this.form.get('merged')?.disable(); }\n }\n }\n \n private checkTimeCateringWarning() {\n const dateTz = this.form.controls.dateTz.value;\n const duration = this.form.controls.duration.value;\n const hasCatering = this.form.controls.has_catering?.value;\n const cateringOrders = this.form.controls.catering?.value;\n \n if (dateTz && duration && hasCatering && cateringOrders && cateringOrders.length > 0) {\n // Create DateTime object for the start time\n const startDateTime = DateTime.fromISO(dateTz.date, { zone: dateTz.building_tz });\n \n // Calculate the end time\n const endDateTime = startDateTime.plus({ minutes: duration });\n \n // Get the date part of the startDateTime\n const bookingDate = startDateTime.startOf('day');\n\n // Define 7 am and 8 pm on the booking date\n const dayStartAt7am = bookingDate.set({ hour: 7 });\n const dayEndAt8pm = bookingDate.set({ hour: 20 });\n\n // Check if booking ends before or at 7 am, or starts at or after 8 pm\n if (endDateTime <= dayStartAt7am || startDateTime >= dayEndAt8pm) {\n // Booking is outside of catering hours and has catering selected\n this.showTimeCateringWarning = true;\n } else {\n this.showTimeCateringWarning = false;\n }\n } else {\n this.showTimeCateringWarning = false;\n }\n\n // Inform Angular that the component needs to be checked\n this.cdRef.markForCheck();\n }\n\n}\n","
\n \n \n \n
\n
\n \n Title*:\n \n \n \n\n \n {{ ( form?.get('title').errors && form?.get('title').hasError('pattern')) \n ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Title is required'}} \n \n \n
\n\n
\n \n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n \n \n
\n \n
\n Duration is invalid. End time must be in the future\n
\n
\n
\n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n Warning: Changing the booking time outside of catering hours will drop your catering order.\n
\n
\n
\n
\n
\n Recurring booking\n
\n \n
\n Multiroom\n
\n
\n \n
\n
Merged
\n
\n \n
\n
\n \n \n
\n \n \n \n \n \n {{ user.name || user.email }}\n \n \n \n
\n
\n \n \n \n {{ form?.get('attendees').errors?.customError }}\n \n
\n
\n \n
\n \n
\n \n
\n \n \n {{ ( form?.get('company').errors && form?.get('company').hasError('pattern'))\n ? 'Some special characters (^=`~@#$%*{};:_\\\",.\\<>) are not allowed' : ''}}\n \n
\n \n
\n \n \n {{ selected }}\n
\n
\n
\n
\n\n
1\">\n \n \n \n \n {{ type.name }}\n \n \n \n
\n
\n Need a meeting space?\n \n
\n
\n \n \n Need catering?\n \n
\n
\n \n \n \n \n \n \n \n
\n\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringItem,\n OrganisationService,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringConfirmModalData {\n all_day: boolean;\n form: FormGroup;\n dateTz: DateTZ;\n}\n\n@Component({\n selector: 'a-catering-confirm-modal',\n templateUrl: './catering-confirm-modal.component.html',\n styleUrls: ['./catering-confirm-modal.component.scss']\n})\nexport class BookingCateringConfirmModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** List of selected items for the order */\n public item_list: CateringItem[] = [];\n\n /** Space selected for delivery */\n public get space(): Space {\n return this._spaces.find(this._data.form?.controls?.location_id?.value);\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n let date = this._data.dateTz;\n if (this._data.form && this._data.form.controls.delivery_time) {\n date = date.addValue({ minutes: this._data.form.controls.delivery_time.value });\n }\n return date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Form field for order items */\n public get item_field(): FormControl {\n return this._data.form.controls.items as any;\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n return this.item_list.reduce((amount, item) => {\n const price = item.price\n return amount + item.amount * price\n }, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.space || !this.space.level) {\n return 'USD';\n }\n const building = this._org.buildings.find(\n (bld) => bld.id === this.space.level.building_id\n ) || { currency: 'USD' };\n return building.currency;\n }\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: CateringConfirmModalData\n ) {\n super();\n if (!this._data.form) {\n this._service.notifyError('No form data for order');\n this._dialog_ref.close();\n }\n }\n\n public ngOnInit(): void {\n /* istanbul ignore else */\n if (this._data.form.controls.items) {\n this.subscription(\n 'item_list',\n this._data.form.controls.items.valueChanges.subscribe((items) => {\n /* istanbul ignore else */\n if (!items || items.length <= 0) {\n this._dialog_ref.close();\n }\n })\n );\n }\n this.item_list = this._data.form.controls.items.value.map((item) => new CateringItem(item.toJSON()));\n }\n}\n","
\n
Confirm Catering Order
\n \n
\n\n
\n
\n Delivering to {{ space?.local_name || space?.simple_name || space?.settings?.room_name }} at {{ delivery_time }}\n
\n
\n \n
\n
\n \n
{{ order_cost / 100 | currency:symbol }}
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n OrganisationService,\n BookingNote,\n CateringOrder,\n Space,\n UsersService,\n CateringNotesService,\n Booking\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n catering: AbstractControl;\n booking: Booking\n}\n\n@Component({\n selector: 'a-catering-details-modal',\n templateUrl: './catering-details-modal.component.html',\n styleUrls: ['./catering-details-modal.component.scss']\n})\nexport class CateringDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: HashMap = {};\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return (this._data.spaces || []).filter((space) =>\n this._data.catering.value.find((order) => order.location_id === space.email)\n );\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.pattern || this.active_form.controls.code.errors?.minlength;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n return this.space_list.reduce(\n (valid, space) => valid && this.form[space.email].valid,\n true\n );\n }\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _cateringNotesService: CateringNotesService,\n @Inject(MAT_DIALOG_DATA) private _data: CateringDetailsModalData\n ) {\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type === 'catering'\n );\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = this._data.catering.value.reduce((map, order: CateringOrder) => {\n map[order.location_id] = order.charge_code;\n return map;\n }, {});\n this.generateFormFields();\n }\n\n public submit(): void {\n this.space_list.forEach((space) => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes\n const notes = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type !== 'catering'\n );\n const new_notes = this.space_list.map(\n (space) =>\n ({\n author: this._data.booking.booked_by ? this._data.booking.booked_by['name'] : this._users.current.name,\n type: 'catering',\n message: this.form[space.email].controls.notes.value,\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote)\n );\n this._cateringNotesService.setNotes(new_notes);\n this._data.notes_field.setValue(notes.concat(new_notes).filter((note) => note.message));\n // Save the notes\n const orders = this._data.catering.value.map(\n (order) =>\n new CateringOrder({\n ...order,\n charge_code: this.form[order.location_id]\n ? this.form[order.location_id].controls.code.value\n : ''\n })\n );\n\n this._data.catering.setValue(orders);\n // This should go to the next\n this.event.emit({ reason: 'done' });\n } else {\n this._scrollToBottom();\n }\n }\n\n /** Generate form fields for each space */\n private generateFormFields(): void {\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space.level.building_id\n );\n \n this.needs_charge_code[space.email] = space?.filters?.charge_code || space?.settings?.charge_code || false;\n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(this.codes[space.email] || '',\n this.needs_charge_code[space.email] ?\n [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4), Validators.required ] : [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4)])\n });\n }\n }\n\n /** Scroll the content container to the bottom */\n private _scrollToBottom(): void {\n this._content_el?.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n}\n","
\n
\n \n \n \n
\n \n
\n\n
\n
\n \n
Please specify any allergies or gluten intolerances
\n
\n
\n
\n \n \n \n \n
\n
\n \n Charge Code\n *\n \n \n \n \n Note: Your booking will be confirmed before you are charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\nexport interface ConfirmModalData {\n /** Title of the modal */\n title: string;\n /** Contents of the modal */\n content: string;\n /** Text displaed on the confirmation button */\n action?: string;\n /** Icon to display on the modal */\n icon: ApplicationIcon;\n}\n\nexport const CONFIRM_METADATA = {\n height: 'auto',\n width: '24em',\n maxHeight: 'calc(100vh - 2em)',\n maxWidth: 'calc(100vw - 2em)'\n};\n\n@Component({\n selector: 'confirm-modal',\n templateUrl: './confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss']\n})\nexport class ConfirmModalComponent extends BaseDirective {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Loading state */\n public loading: string;\n\n /** Title of the confirm modal */\n public get title(): string {\n return (this._data ? this._data.title : null) || 'Confirm';\n }\n\n /** Body of the confirm modal */\n public get content(): string {\n return (this._data ? this._data.content : null) || 'Are you sure?';\n }\n\n /** Display text on the confirm button */\n public get action(): string {\n return (this._data ? this._data.action : null) || 'Ok';\n }\n\n /** Display icon properties */\n public get icon(): ApplicationIcon {\n return (this._data ? this._data.icon : null) || null;\n }\n\n constructor(\n private _dialog: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: ConfirmModalData\n ) {\n super();\n }\n\n /**\n * User confirmation of the content of the modal\n */\n public accept() {\n this.event.emit({ reason: 'done' });\n }\n}\n","
\n

{{ title || 'Confirm' }}

\n
\n\n
\n \n
\n

\n
\n
\n
\n\n
\n \n \n
\n
\n\n
\n
\n
\n \n
\n
{{ loading }}
\n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { LegacyUiModule } from '@mckinsey-converge/legacy-ui';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SpaceSelectModalComponent } from './space-select-modal/space-select-modal.component';\nimport { NewUserModalComponent } from './new-user-modal/new-user-modal.component';\nimport { ConfirmModalComponent } from './confirm-modal/confirm-modal.component';\nimport { NoCateringModalComponent } from './no-catering-modal/no-catering-modal.component';\nimport { BookingCateringConfirmModalComponent } from './catering-confirm-modal/catering-confirm-modal.component';\nimport { CateringDetailsModalComponent } from './catering-details-modal/catering-details-modal.component';\nimport { RequirementDetailsModalComponent } from './requirement-details-modal/requirement-details-modal.component';\nimport { BookingConfirmComponent } from './booking-confirm/booking-confirm.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UserFormComponent } from './user-form/user-form.component';\nimport { BookingFormComponent } from './booking-form/booking-form.component';\nimport { EditorModule } from '@tinymce/tinymce-angular';\n\nconst DECLARATIONS = [\n SpaceSelectModalComponent,\n NewUserModalComponent,\n ConfirmModalComponent,\n NoCateringModalComponent,\n BookingCateringConfirmModalComponent,\n CateringDetailsModalComponent,\n RequirementDetailsModalComponent,\n BookingConfirmComponent,\n UserFormComponent,\n BookingFormComponent,\n];\n\n@NgModule({\n imports: [\n LegacyUiModule,\n FormsModule,\n ReactiveFormsModule,\n CommonModule,\n UiModule,\n BaseModule,\n EditorModule,\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ...DECLARATIONS,\n BaseModule\n ]\n})\nexport class LegacyOverlaysModule {\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\n\nimport { BaseDirective, DialogEvent } from '@mckinsey-converge/base';\nimport { generateUserForm, User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'new-user-modal',\n templateUrl: './new-user-modal.component.html',\n styleUrls: ['./new-user-modal.component.scss'],\n})\nexport class NewUserModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Form fields for the new user */\n public form: FormGroup;\n /** New user data store */\n public user: User;\n /** Whether user details are being saved */\n public loading: boolean;\n\n public ngOnInit(): void {\n this.user = new User();\n this.form = generateUserForm(this.user);\n }\n\n public saveChanges() {\n this.form.markAllAsTouched();\n if (this.form.valid) {\n if (!this.form.controls.email.value) {\n this.form.controls.email.setValue(\n `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`\n );\n }\n const firstName = this.form.value.first_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n const lastName = this.form.value.last_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n \n const new_user = new User({\n ...this.form.value,\n name: `${firstName} ${lastName}`,\n type: 'external',\n external: true,\n visitor: true,\n });\n this.event.emit({ reason: 'done', metadata: new_user });\n }\n }\n}\n","
\n

Add External Attendee

\n \n
\n
\n \n
\n
\n \n \n
\n\n
\n
\n
\n \n
\n
\n Saving attendee...\n
\n
\n
\n
\n\n","import {\n Component,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'no-catering-modal',\n templateUrl: './no-catering-modal.component.html',\n styleUrls: ['./no-catering-modal.component.scss']\n})\nexport class NoCateringModalComponent extends BaseDirective {\n constructor(\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n // /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n\n // Submit the Survey in it's current state.\n public confirm() {\n this.event.emit({ reason: 'done', noCatering: true });\n this._dialog_ref.close();\n }\n\n // Close the modal\n public cancel() {\n this.event.emit({ reason: 'close' });\n this._dialog_ref.close();\n }\n}\n","
\n \n
\n
\n
\n \n

Catering is not available for your new room selection. \n
Are you sure you want to drop order and change rooms?

\n
\n
\n \n \n \n
\n
\n
","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n BookingNote,\n OrganisationService,\n SettingsService,\n Space,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface RequirementDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n codes_field: AbstractControl;\n head_counts_field: AbstractControl;\n standalone?: boolean;\n}\n\n@Component({\n selector: 'a-requirement-details-modal',\n templateUrl: './requirement-details-modal.component.html',\n styleUrls: ['./requirement-details-modal.component.scss']\n})\nexport class RequirementDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: boolean;\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return this._data.spaces;\n }\n\n public get has_recurrence(): boolean {\n return false\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.minlength || this.active_form.controls.code.errors?.pattern;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n // return this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n return this.space_list.length > 0 && this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n }\n\n public isConcierge: boolean;\n public frontend: string;\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n @Inject(MAT_DIALOG_DATA) private _data: RequirementDetailsModalData,\n private _settings: SettingsService,\n ) {\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value\n .filter((note: BookingNote) => note.type === 'equipment');\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = { ...this._data.codes_field.value };\n this.head_counts = { ...this._data.head_counts_field.value };\n this.generateFormFields();\n }\n\n public submit(): void {\n // Get the email of the first space\n const firstSpaceEmail = this.space_list[0].email;\n\n // Copy values from the first space's form controls to all other spaces\n this.space_list.forEach(space => {\n if (space.email !== firstSpaceEmail) {\n this.form[space.email].controls.notes.setValue(this.form[firstSpaceEmail].controls.notes.value);\n this.form[space.email].controls.code.setValue(this.form[firstSpaceEmail].controls.code.value);\n this.form[space.email].controls.head_count.setValue(this.form[firstSpaceEmail].controls.head_count.value);\n }\n });\n\n this.space_list.forEach(space => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes \n const notes = this._data.notes_field.value\n .filter((note: BookingNote) => note.type !== 'equipment');\n const new_notes = this.space_list.map(space => ({\n author: this._users.current.name,\n type: 'equipment',\n message: this.form[space.email].controls.notes.value.trim(),\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote));\n this._data.notes_field.setValue(notes.concat(new_notes).filter(note => note.message));\n this._data.codes_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.code.value;\n return map;\n }, {}));\n this._data.head_counts_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.head_count.value;\n return map;\n }, {}));\n this.event.emit({ reason: 'done' });\n } else {\n this._content_el.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n }\n\n /** Generate form fields for each space */\n // private generateFormFields(): void {\n // for (const space of this.space_list) {\n // const building = this._org.buildings.find(\n // bld => bld.id === space[0]?.level.building_id\n // );\n // // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n // const { filters, settings } = space;\n // const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n // const officeBasedEqCode = building?.required?.equipment_code;\n // this.needs_charge_code[space.email] = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n\n // this.form[space.email] = new FormGroup({\n // notes: new FormControl(this.notes[space.email] || ''),\n // code: new FormControl(\n // this.codes[space.email] || '',\n // this.needs_charge_code[space.email] ?\n // [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] : [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n // ),\n // head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n // });\n // }\n // }\n \n private generateFormFields(): void {\n // Initialize a variable to determine if any space needs a charge code\n let anySpaceNeedsChargeCode = false;\n \n // First pass to determine if any space needs a charge code\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space?.level.building_id\n );\n const { filters, settings } = space;\n const roomBasedEqCode = filters?.equipment_code;\n const officeBasedEqCode = building?.required?.equipment_code;\n \n // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n if (roomBasedEqCode || officeBasedEqCode) {\n anySpaceNeedsChargeCode = true;\n this.needs_charge_code = true;\n break;\n } else{\n this.needs_charge_code = false;\n }\n }\n \n // Second pass to create form groups with the determined charge code requirement.\n // We show only the first space, but if one of the selected spaces needs a mandatory charge code,\n // then all spaces need a mandatory charge code\n for (const space of this.space_list) { \n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(\n this.codes[space.email] || '',\n anySpaceNeedsChargeCode ?\n [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] :\n [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n ),\n head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n });\n }\n }\n}\n","
\n
\n \n \n \n \n {{\n this.space_list.length > 1 ? this.space_list.length + ' spaces selected' :\n this.space_list[0]?.local_name || 'No spaces selected'\n }}\n \n \n \n \n
\n \n
\n\n
\n
\n \n
\n {{\n has_recurrence && !isConcierge\n ? 'To update headcount information, add equipment or catering, please edit individual meeting occurences in My Day'\n : \"Would you like to add equipment to your booking's spaces?\"\n }}\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n Charge Code*\n \n \n \n \n Note: Your booking will be confirmed before you are\n charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n \n Headcount Estimate*\n \n \n \n \n Note: This estimate is used to calculate catering and/or\n assign rooms. Please keep updated of any changes.\n \n \n Headcount Estimate is required\n \n \n
\n \n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n Building,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n OrganisationService,\n SettingsService,\n Space,\n SpaceBookingRuleOptions,\n SpacesService,\n toggleSelectedByGroup,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n DialogEvent,\n HashMap,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport { NoCateringModalComponent } from '../no-catering-modal/no-catering-modal.component'\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport interface SpaceSelectModalData {\n /** List of selected spaces */\n spaces: Space[];\n /** Start time for availability of spaces */\n dateTz: DateTZ;\n /** Duration of the availability block to look for */\n duration: number;\n /** Host of the booking being made */\n host: User;\n /** Whether multiple spaces can be selected */\n multiple: boolean;\n /** Force zone ids */\n zone_ids?: string;\n /** Booking needs catering */\n needsCatering?: boolean,\n}\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'a-space-select-modal',\n templateUrl: './space-select-modal.component.html',\n styleUrls: ['./space-select-modal.component.scss']\n})\nexport class SpaceSelectModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Whether space list is being loaded */\n public loading: boolean;\n /** List of available spaces to select from */\n public spaces: Space[] = [];\n /** Active building to filter spaces on */\n public active_building: Building;\n /** Active building to filter spaces on */\n public active_type: Identity;\n /** List of items from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public readonly change$ = new Subject();\n /** List of currently selected spaces */\n public selected_spaces: Space[] = [];\n /** Mapping as to whether a space is by request */\n public request_map: HashMap = {};\n /** Whether selected list should be shown on mobile */\n public show_list: boolean;\n\n /** host to load (only in staff) **/\n public host: User;\n\n /** List of available buildings */\n public types: Identity[] = [];\n\n public isConcierge: boolean;\n public frontend: string;\n\n /** List of available buildings */\n public get buildings(): Building[] {\n return this._org.buildings;\n }\n\n /** Whether multiple spaces can be selected */\n public get multiple(): boolean {\n return false;\n }\n\n public get has_zone(): boolean {\n return !!this._data.zone_ids;\n }\n\n public formGroup = new FormGroup({\n location: new FormControl([]),\n });\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n\n public noCateringDialogRef: MatDialogRef;\n\n /** List of zones to filter the spaces on */\n public zone_ids: string[] = [];\n\n\n public get initialBuildingIds(): string[] {\n return this._org.building ? [this._org.building.id] : [];\n }\n\n public savedSelection\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _spaces: SpacesService,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n @Inject(MAT_DIALOG_DATA) private _data: SpaceSelectModalData\n ) {\n super();\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n let request_id = 0;\n // Listen for input changes\n this.search_results$ = this.change$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap((bld) => {\n this.loading = true;\n const zone_ids: string[] = [];\n /* istanbul ignore else */\n if (this.active_building) {\n zone_ids.push(this.active_building.id);\n }\n\n if (bld?.includes('|')) {\n bld = this.savedSelection\n }\n\n const id = request_id;\n return this._spaces.available({\n zone_ids: bld?.length ? bld : this._data.spaces[0].building.id || zone_ids.join(','),\n dateTz: this._data.dateTz,\n duration: this._data.duration\n }).then(async (list) => ({ id, list }));\n }),\n catchError((_) => of({ id: request_id, list: [], error: _ })),\n map((resp: { id: number, list: Space[] }) => {\n this.loading = false;\n const filtered_list = resp.list.filter((space: Space) => {\n // if concierge skip rules check.\n if (this._settings.concierge) {\n return (this.active_type && this.active_type.id ? space.zones.includes(`${this.active_type.id}`) : true) &&\n !this.selected_spaces.find((s) => s.id === space.id);\n }\n\n const rules = space.rulesFor({\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this.host || this._data.host\n });\n return (\n rules.hide !== true &&\n (this.active_type && this.active_type.id\n ? space.zones.includes(`${this.active_type.id}`)\n : true) &&\n !this.selected_spaces.find((_space) => _space.id === space.id)\n );\n });\n return resp.id === request_id ? filtered_list : this.spaces;\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.spaces = list.filter((space) => {\n if (!space.available) {\n return false;\n }\n for (const zone of this.zone_ids) {\n if (space.zones.includes(zone)) {\n return true;\n }\n }\n return !this.zone_ids.length;\n });\n this.spaces.sort((a, b) => this.sort(a, b));\n if (!this.selectedOptions.value.length) {\n this.setDefaultBuilding()\n }\n })\n );\n this.active_building = this._data.spaces?.length\n ? this._org.buildings.find((i) => i.id === this._data.spaces[0].level.building_id)\n : this._org.building;\n this.types = [{ id: '', name: 'Any Space Type' } as any].concat(\n this._org.space_types || []\n );\n this.active_type = this.types[0];\n this.change$.next('');\n });\n\n this.subscription('buildings', this._org.listen('buildings').subscribe((bld_list) => {\n const city = this._org.building.city\n const timezone = this._org.building.timezone\n const grouped_by_city = {\n key: { name: city, timezone },\n value: bld_list?.filter((bld) => bld.city === city) || []\n }\n const city_buildings = grouped_by_city.value.map(\n (bld) => mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n )\n const buildings = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings\n ]\n this.options.next(buildings)\n }));\n\n }\n\n /** Add space to selected list */\n public addSpace(space: Space) {\n this.selected_spaces.push(space);\n this.selected_spaces = unique(this.selected_spaces, 'id');\n }\n\n /** Remove space from selected list */\n public removeSpace(space: Space) {\n this.selected_spaces = this.selected_spaces.filter((a_space) => a_space.id !== space.id);\n }\n\n /** Emit current state of the selected list */\n public save(list: Space[]) {\n if (!this._data.needsCatering) {\n // No catering order to warn about\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // Check if the room has catering \n if (list[0].has_catering) {\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // If not warn that the room doesn't have catering\n this.noCateringDialogRef = this._dialog.open(NoCateringModalComponent, {\n panelClass: 'mck-modal-mini',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.subscription(\n 'no-catering-modal',\n this.noCateringDialogRef.componentInstance.event.subscribe((event) => {\n if (event.reason === 'done') {\n this.event.emit({ reason: 'done', metadata: list, noCatering: event.noCatering });\n }\n if (event.reason === 'close') {\n this.event.emit({ reason: 'close' });\n }\n })\n );\n }\n\n private update() {\n const map = {};\n const options: SpaceBookingRuleOptions = {\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this._data.host\n };\n this.selected_spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.request_map = map;\n }\n\n public setDefaultBuilding() {\n const defaultBld = this.options.value.filter(opt => opt.value === this._org.building.id)\n this.selectedOptions.next(defaultBld)\n }\n\n /**\n * Compare two spaces to determine order\n * @param space_a\n * @param space_b\n */\n public sort(space_a: Space, space_b: Space) {\n const bld = this._org.buildings.find((bld) => space_a.zones.includes(bld.id)) || { name: '', sort_order: [] };\n const bld_b = this._org.buildings.find((bld) => space_b.zones.includes(bld.id));\n if (bld && bld !== bld_b) {\n return bld.name.localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = space_a.zones.indexOf(zone_id) >= 0;\n const b_has_zone = space_b.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n return space_a.name.localeCompare(space_b.name);\n }\n\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n const formData = this.formGroup.value;\n this.formGroup.setValue({\n location: formData.location,\n });\n this.selectedOptions.next(next);\n this.savedSelection = next.map((bld) => bld.value)\n\n });\n }\n\n /**\n * Update the selected space list\n * @param space Space to add/toggle in the selected list\n */\n public selectSpace(space: Space) {\n const list = this.spaces;\n if (list.find((item) => item.id === space.id)) {\n this.spaces = list.filter((item) => item.id !== space.id);\n } else {\n this.spaces = [space];\n }\n }\n\n public clearList() {\n this.spaces = []\n this.savedSelection = []\n }\n\n public triggerSearch = () => {\n if (this.savedSelection.length) {\n this.change$.next(this.savedSelection)\n } else {\n this.spaces = []\n }\n }\n\n}\n","
\n
Select meeting space{{ multiple ? 's' : '' }}
\n \n
\n\n
\n
\n \n \n 1\">Type\n 1\">\n \n \n {{ type?.name }}\n \n \n \n \n
\n \n \n
\n
\n
{{ space.local_name }}
\n
{{ space.level.name }}
\n
\n
\n \n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n {{ (!isConcierge && request_map[space.id]) ? 'Request' : 'Select' }}\n \n
\n
\n
\n
\n
\n
\n
\n

Selected spaces

\n
\n \n
\n \n \n
\n
\n
{{ space.name }}
\n
{{ space.level.name }}
\n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n \n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
Loading available spaces...
\n
\n
\n\n
\n
\n \n
\n
No results available, please select another office.
\n
\n
\n\n
\n
\n \n
\n
No selected spaces
\n
\n
\n","import { Component, Input } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'user-form',\n templateUrl: './user-form.component.html',\n styleUrls: ['./user-form.component.scss']\n})\nexport class UserFormComponent {\n /** Group of form fields used for creating the system */\n @Input() public form: FormGroup;\n}\n","
\n
\n
\n First Name:\n \n \n First name is required\n \n \n
\n
\n Last Name:\n \n \n Last name is required\n \n
\n
\n Email:\n \n \n A valid email is required\n \n
\n
\n
\n","export * from './lib/legacy-ui.module';\nexport * from './lib/custom-fields';\nexport * from './lib/icon/icon.component';\nexport * from './lib/feedback/feedback.component';\nexport * from './lib/action-icon/action-icon.component';\nexport * from './lib/user-avatar/user-avatar.component';\nexport * from './lib/bookings/catering/item/item.component';\nexport * from './lib/cng-search-bar/cng-search-bar.component';\n","import { Component, OnInit, Input } from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'action-icon',\n templateUrl: './action-icon.component.html',\n styleUrls: ['./action-icon.component.scss']\n})\nexport class ActionIconComponent implements OnInit {\n /** Icon to display */\n @Input() public icon: ApplicationIcon;\n /** Whether action is being processed */\n @Input() public loading: boolean;\n /** State of the action */\n @Input() public state: 'success' | 'error' | '' = '';\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","
\n \n
\n \n
\n
\n \n
\n
\n","import {\n Component,\n Input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { FormControl } from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringCategory,\n CateringItem,\n SettingsService\n} from '@mckinsey-converge/data-common';\nimport { ANIMATION_SHOW_CONTRACT_EXPAND } from '@mckinsey-converge/animations';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { PackageOptionsModalComponent } from '../package-options-modal/package-options-modal.component';\n\nfunction hasSelectionRequirements(category: CateringCategory) {\n return (\n category.must_select < category.items.length ||\n (category.must_select === category.items.length &&\n category.items.find((item: any) => item.items && item.must_select < item.items.length))\n );\n}\n\nfunction getActiveList(category: CateringCategory) {\n const items = category.items || [];\n let list = items.filter((item) => item.amount > 0).map((item) => item.id);\n for (const item of items) {\n if ((item as any).items && (item as any).items.length) {\n list = list.concat(getActiveList(item as any));\n }\n }\n return list;\n}\n\n@Component({\n selector: 'a-catering-menu-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss'],\n animations: [ANIMATION_SHOW_CONTRACT_EXPAND]\n})\nexport class CateringMenuItemComponent extends BaseDirective implements OnChanges {\n /** Whether item is a child of another */\n @Input() public subitem: boolean;\n /** Item to display */\n @Input() public item: CateringCategory;\n /** Field for storing items */\n @Input() public field: FormControl;\n /** Current symbol for the selected space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Whether to show children items */\n public show_children: boolean;\n public initial_state = null;\n\n /** List of contents of the package */\n public get contents(): string {\n return this.item.items\n ? this.item.items.reduce((list, item) => {\n /* istanbul ignore else */\n if (list) {\n list += '\\n\\n';\n }\n return (list += `${item.name}${\n (item as any).items\n ? (item as any).items.reduce(\n (a_list, an_item) =>\n (a_list += `\\n ${an_item.amount ? '✓' : '•'} ${an_item.name} `),\n ''\n )\n : ''\n } ${item.amount ? '✓' : ''}`);\n }, '')\n : '';\n }\n\n constructor(private _service: ApplicationService, private _dialog: MatDialog,\n public settings: SettingsService) {\n super();\n // on the item selection set the revert/close state\n this.initial_state = this.item;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.field && this.field) {\n const list = this.field.value;\n // check the category\n let item = list.find((an_cat) => an_cat.id === this.item.id);\n if (item) {\n // update the category level amount\n this.item.setAmount(item ? item.amount : 0);\n } else {\n // find a category item\n for (var cat of list) {\n item = cat?.items.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(item ? item.amount : 0);\n break;\n }\n }; \n } \n\n // On the confirm catering order modal set the revert/close state\n if (!this.initial_state && this.item.amount) {\n this.initial_state = this.item;\n }\n\n this.subscription(\n 'field_change',\n this.field.valueChanges.subscribe((list) => {\n const item = list.find((an_item) => an_item.id === this.item.id);\n this.item.setAmount(item ? item.amount : 0);\n this.updatePackageSelection();\n })\n );\n }\n }\n\n /**\n * Update the amount of the item in the order\n * @param value New amount\n */\n public updateAmount(value: number) {\n /* istanbul ignore else */\n if (this.field) {\n const list: CateringItem[] = this.field.value;\n const item = list.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(value);\n item.setAmount(value);\n // MCK-1550 fix\n const price = this.item.price;\n item.setPrice(price)\n } else {\n const amount = this.item.amount;\n this.item.setAmount(value);\n if (\n this.item.package &&\n amount < value &&\n this.item.items &&\n this.item.items.length &&\n hasSelectionRequirements(this.item)\n ) {\n this.selectPackageOptions().then(\n (confirmed_item) => {\n list.push(new CateringCategory(confirmed_item));\n this.field.setValue(list.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n } else {\n list.push(new CateringItem(this.item));\n }\n }\n this.field.setValue(list.filter((an_item) => an_item.amount));\n }\n }\n\n public updatePackageSelection() {\n const cart_item = this.field.value.find((item) => item.id === this.item.id);\n if (cart_item) {\n const active_items = getActiveList(cart_item);\n this.timeout(\n 'update_package',\n () => {\n this.item.items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n if ((item as any).items) {\n (item as any).items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n });\n }\n });\n },\n 5\n );\n }\n }\n\n /** Reselect package options */\n public updatePackageOptions(): void {\n let updatedList: CateringItem[] = [];\n this.selectPackageOptions().then(\n (confirmed_item) => {\n // Update the existing category package\n this.field.value.forEach((category: CateringCategory) => {\n if (category.id === confirmed_item.id) {\n updatedList.push(new CateringCategory(confirmed_item))\n } else {\n updatedList.push(category)\n }\n })\n this.field.setValue(updatedList.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n }\n\n /**\n * Open modal for user to select package options\n */\n private selectPackageOptions(): Promise {\n return new Promise((resolve, reject) => {\n const ref = this._dialog.open(PackageOptionsModalComponent, {\n maxWidth: '95vw',\n data: {\n item: new CateringCategory(this.item)\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n let done = false;\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n done = true;\n resolve(ref.componentInstance.item);\n this.initial_state = this.item;\n ref.close();\n }\n });\n ref.afterClosed().subscribe(() => {\n /* istanbul ignore else */\n if (!done) {\n if (this.initial_state) {\n resolve(this.initial_state);\n } else {\n reject();\n }\n }\n });\n });\n }\n}\n","\n \n
\n
{{ item.name }}
\n
{{ item.package ? '[Package] ' : '' }}{{ item.description }}
\n
\n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n { item.availableItems.length, plural, =1 { Contains {{ item.availableItems.length }} item } other {\n Contains {{ item.availableItems.length }} items } }\n
\n 0\"\n [matTooltip]=\"contents\"\n >\n {{ item.must_select }}\n \n Selected\n \n
\n 0\"\n (click)=\"updatePackageOptions()\"\n i18n=\"Catering order item options change action\"\n >\n Customise\n \n \n \n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n \n \n \n\n
\n \n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n CateringCategory,\n CateringItem\n} from '@mckinsey-converge/data-common';\n\nexport interface PackageOptionsModalData {\n item: CateringCategory;\n}\n\nexport function checkItemRequirements(category: CateringCategory): boolean {\n const items = category.items || [];\n return category.must_select >= items.length\n ? items.reduce((valid, item) => valid && checkItemRequirements(item as any), true)\n : items.reduce((amount, item) => amount + (item.amount ? 1 : 0), 0) ===\n category.must_select;\n}\n\nexport function getActiveItems(category: CateringCategory): HashMap {\n let map = {};\n if (category.items) {\n const item = category.items.find(item => item.amount > 0);\n if (item) {\n map[category.id] = item.id;\n }\n category.items.forEach(item => map = { ...map, ...getActiveItems(item as any) });\n }\n return map;\n}\n\n@Component({\n selector: 'a-package-options-modal',\n templateUrl: './package-options-modal.component.html',\n styleUrls: ['./package-options-modal.component.scss']\n})\nexport class PackageOptionsModalComponent {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n\n /** Item to select options for */\n public get item(): CateringCategory {\n return this._data.item;\n }\n\n /** Whether package requirements have been met */\n public get requirements_met(): boolean {\n return checkItemRequirements(this.item);\n }\n\n public get active_items(): HashMap {\n return getActiveItems(this.item);\n }\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: PackageOptionsModalData) {\n }\n\n /**\n * Update the list of selected items\n */\n public updateAmount(a_package: CateringCategory, option: CateringItem, state: boolean) {\n if (state) {\n const needed = a_package.must_select;\n const active = a_package.items.filter(an_item => an_item.amount > 0).length;\n if (active >= needed) {\n const item = a_package.items.find(an_item => an_item.amount > 0);\n item.setAmount(0);\n }\n option.setAmount(1);\n } else {\n option.setAmount(0);\n }\n }\n}\n","
\n

Package Options

\n \n
\n\n
\n \n
\n
\n\n
\n \n
\n
\n\n \n \n
\n \n 1\"\n [checked]=\"!!option.amount\"\n (change)=\"updateAmount(package, option, $event.checked)\"\n >\n {{ option.name }}\n \n \n {{ option.name }}\n \n \n = package.items.length || option.must_select\">\n {{ option.name }}\n \n \n
\n
\n
\n
\n","import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n// Interface to define the structure of the configuration object for the search bar\nexport interface SearchBarConfig {\n placeholder?: string;\n totalFoundItem?: number;\n showSrchWarning?: boolean;\n}\n\n@Component({\n selector: 'cng-search-bar',\n templateUrl: './cng-search-bar.component.html',\n styleUrls: ['./cmg-search-bar.component.scss']\n})\nexport class CngSearchBarComponent implements OnChanges {\n // Input property to accept configuration for the search bar\n @Input() config: SearchBarConfig = {\n placeholder: 'Search ...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n // Output event emitter to emit search strings to parent components\n @Output() search = new EventEmitter();\n\n // Local variable to store the search string entered by the user\n searchStr: string = '';\n\n // Lifecycle hook that is called when any data-bound property of a directive changes\n ngOnChanges(changes: SimpleChanges): void {\n // Check if the config property has changed\n if (changes.config) {\n const configChanges = changes.config.currentValue;\n // Update the config with new values or fallback to defaults\n this.config = {\n placeholder: configChanges.placeholder || 'Search ...',\n totalFoundItem: configChanges.totalFoundItem || 0,\n showSrchWarning: configChanges.showSrchWarning || false\n };\n }\n }\n\n // Method to handle the search action\n onSearch(value: string): void {\n // Emit the search string if it's not empty\n if (value) {\n this.search.emit(value);\n } else {\n this.clearSearch();\n }\n }\n\n // Method to clear the search input and reset related configurations\n clearSearch(box: HTMLInputElement | null = null): void {\n this.searchStr = '';\n if (box) {\n box.value = '';\n }\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n this.search.emit('');\n }\n\n // Method to reset the search-related warnings and item count\n resetSearch(): void {\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n }\n}\n","
\n \n \n
{{ config.totalFoundItem }}
\n \n \n \n
\n \n No search found!\n
\n
\n ","import { Directive, ElementRef, HostListener, Input } from '@angular/core';\n\n@Directive({\n selector: '[hover-class]'\n})\nexport class HoverClassDirective {\n @Input('hover-class') hoverClass: string;\n\n constructor(private elementRef: ElementRef) {}\n\n @HostListener('mouseenter') onMouseEnter() {\n this.update('add');\n }\n\n @HostListener('mouseleave') onMouseLeave() {\n this.update('remove');\n }\n\n @HostListener('blur') onBlur() {\n this.update('remove');\n }\n\n private update(action: string): void {\n this.hoverClass.split(' ').forEach(item => this.elementRef.nativeElement.classList[action](item));\n }\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'an-action-field',\n templateUrl: './action-field.component.html',\n styleUrls: ['./action-field.component.scss']\n})\nexport class ActionFieldComponent extends BaseDirective {\n /** Name of the field */\n @Input() public name: string;\n /** Value to display on the field */\n @Input() public placeholder: string;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Emitter for user interaction events */\n @Output('onAction') public on_action = new EventEmitter();\n /** Whether to show tooltip */\n public show_tooltip = false;\n\n /**\n * Emit that the user has performed an action on the field\n */\n public performAction() {\n this.show_tooltip = !this.show_tooltip;\n this.on_action.emit();\n }\n}\n","\n
{{ placeholder }}
\n
\n \n
\n\n","import { Component, forwardRef, Input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'a-counter',\n templateUrl: './counter.component.html',\n styleUrls: ['./counter.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n /* istanbul ignore next */\n useExisting: forwardRef(() => CounterComponent),\n multi: true,\n },\n ],\n})\nexport class CounterComponent implements ControlValueAccessor {\n /** Maximum amount for the counter */\n @Input() public max: number = 10;\n /** Minimum amount for the counter */\n @Input() public min: number = 0;\n\n @Input() public useInput = false;\n\n /** Current value of the counter */\n public value: number;\n public previous_value: number = 0;\n /** Whether shift key is being held by the user */\n public shift_key: boolean;\n /** Whether control key is being held by the user */\n public ctrl_key: boolean;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /**\n * Add the `step` to the current value\n */\n public add() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value += step;\n if (this.value > this.max) {\n this.value = this.max || 10;\n }\n this.setValue(this.value);\n }\n\n /** Remove the `step` from the current value */\n public remove() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value -= step;\n if (this.value < this.min) {\n this.value = this.min || 0;\n }\n this.setValue(this.value);\n }\n\n public handleTimeout = null;\n\n public onInputChange(new_value: string) {\n if (this.handleTimeout) {\n clearTimeout(this.handleTimeout);\n this.handleTimeout = null;\n }\n this.handleTimeout = setTimeout(() => this.changeInput(new_value), 500);\n }\n\n public changeInput(new_value: string) {\n let value = Number(new_value);\n if (isNaN(value)) {\n value = this.previous_value;\n }\n if (value < this.min) {\n value = this.min || 0;\n }\n if (value > this.max) {\n value = this.max || 10;\n }\n this.setValue(value);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.previous_value = new_value;\n this.value = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.value = value;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","\n \n \n
\n {{value || '0'}}\n
\n \n\n","import { Component, OnInit, forwardRef, Input, ViewChild, Output, EventEmitter } from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { MatMenuTrigger } from '@angular/material/menu';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-date-field',\n templateUrl: './date-field.component.html',\n styleUrls: ['./date-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateFieldComponent),\n multi: true\n }\n ]\n})\nexport class DateFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n /** Optional event emitter for changes */\n @Output() public onChange = new EventEmitter();\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Currently selected date */\n public date: number;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n /** Display value for the current date */\n public get date_string(): string {\n // R--- Needs TZ aware inputs\n const date = new DateTZ({date: this.date})\n return date.formatDate('dd MMM yyyy');\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public ngOnInit() {\n this.date = DateNow(new Date()).ms;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = new DateTZ({date: this.date });\n const new_d = new DateTZ({date: new_value})\n let new_date = new_d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n this.date = new_date;\n if (this._onChange) {\n this._onChange(new_date);\n this.onChange.emit(new_date);\n }\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","\n
{{ date_string }}
\n
\n \n
\n\n\n
\n \n
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport {\n humaniseDuration,\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-duration-field',\n templateUrl: './duration-field.component.html',\n styleUrls: ['./duration-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ]\n})\nexport class DurationFieldComponent extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor {\n /** Maximum duration option available */\n @Input() public max: number = 240;\n /** Minimum duration option available */\n @Input() public min: number = 15;\n /** Step value between options */\n @Input() public step: number = 15;\n /** Reference time for displaying next to durations */\n @Input() public time: number;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Special case prepopulation i.e. out of step options */\n @Input() public specialPreprops: Array = [];\n /** Whether form all_day is enabled. */\n @Input() public all_day: boolean = false;\n\n public duration: number = 60;\n /** List of available duration options */\n public duration_options: Identity[];\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n public ngOnInit(): void {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.max || changes.min || changes.step || changes.time || changes.all_day) {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.duration = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(+new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.duration = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n private generateDurationOptions(max: number, min: number, step: number, all_day: boolean = false): Identity[] {\n const blocks: Identity[] = [];\n let time = min;\n // R--- Change input to dateTz\n let date = this.time ? new DateTZ({date: this.time}) : null;\n\n // Add special case for 10min duration/prepropulation\n for (const option of this.specialPreprops) {\n blocks.push({\n id: option,\n name: date\n ? `${date.addValue({ minutes: option }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(option)})`\n : `${humaniseDuration(option)}`\n });\n }\n\n\n while (time <= max) {\n blocks.push({\n id: time,\n name: date\n ? `${date.addValue({ minutes: time }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(time)})`\n : `${humaniseDuration(time)}`\n });\n time += step;\n }\n if (all_day) {\n blocks.push({ id: 24 * 60, name: 'All Day' }); \n }\n blocks.push({ id: 7 * 24 * 60, name: '1 week' });\n return blocks;\n }\n}\n","
\n \n \n \n {{ option.name }}\n \n \n \n
\n","export * from './action-field/action-field.component'\nexport * from './counter/counter.component'\nexport * from './date-field/date-field.component'\nexport * from './duration-field/duration-field.component'\nexport * from './time-field/time-field.component'\nexport * from './user-search-field/user-search-field.component'\nexport * from './user-list-field/user-list-field.component'\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-time-field',\n templateUrl: './time-field.component.html',\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ]\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n /** Time step between each allowed time option */\n @Input() public step: number = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public no_past_times: boolean = true;\n /** String representing the currently set time */\n public date: number = DateNow(new Date()).ms;\n /** String representing the currently set time */\n public time: string = DateNow(new Date()).formatDate('HH:mm');\n /** Available time blocks for the selected date */\n public _time_options: Identity[];\n /** Whether select field should be shown */\n public show_select: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n // R--- This is the form input that needs to be TZ active.\n public ngOnInit(): void {\n this.show_select = true;\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n this.timeout('hide', () => this.show_select = false);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step) {\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n }\n\n public get date_(){\n return new DateTZ({date: this.date})\n }\n\n /** Available time blocks for the selected date */\n public get time_options() {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] });\n if (date.minutes % 15 !== 0 && !this._time_options.find(time => time.id === date.formatDate('HH:mm'))) {\n this._time_options.push({\n name: `${date.formatDate(timeFormatString())}`,\n id: date.formatDate('HH:mm')\n });\n this._time_options.sort((a, b) => `${a.id}`.localeCompare(`${b.id}`));\n }\n return this._time_options;\n }\n\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.time = new_value;\n if (this._onChange) {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] }).startOfValue('minute');\n this._onChange(date.ms);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n if (!value) {\n return;\n }\n this.date = value;\n let date = this.date_.startOfValue('minute');\n date = date.setValue({ minute: Math.ceil(date.minutes / 5) * 5 });\n this.time = date.formatDate('HH:mm');\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Show select field for time options\n */\n public showSelect() {\n this.show_select = true;\n this.timeout('on_shown', () => {\n if (this.select_field) {\n this.select_field.focus();\n this.select_field.open();\n this.subscription('listen_close', this.select_field.openedChange.subscribe((state) => {\n if (!state) {\n this.show_select = false;\n }\n }));\n }\n });\n }\n\n /**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n private generateAvailableTimes(datestamp: number, show_past: boolean, step: number = 15): Identity[] {\n let date = new DateTZ({date: datestamp});\n const blocks = [];\n if (show_past || date.isAfterDate(DateNow(new Date()))) {\n date = date.startOfValue('day');\n } else if (date.isAfterDate(DateNow(new Date()))) {\n date = DateNow(new Date());\n }\n date = date.setValue({ minute: Math.ceil(date.minutes / step) * step });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n name: `${date.formatDate(timeFormatString()).toLocaleLowerCase()}`,\n id: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n }\n}\n","\n
\n \n
\n
\n \n
\n\n\n \n \n {{ option.name }}\n \n \n\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n tap,\n map,\n switchMap,\n finalize\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n csvToJson,\n downloadFile,\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-list-field',\n templateUrl: './user-list-field.component.html',\n styleUrls: ['./user-list-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserListFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserListFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Number of characters needed before a search will start */\n @Input() public limit: number = 3;\n /** Emitter for action to make a new user */\n @Output('newUser') public new_user = new EventEmitter();\n\n /** User list to display */\n public user_list: User[];\n /** List of active selected users on the list */\n public active_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** String */\n public search_str: string;\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User[]) => void;\n /** Form control on touch handler */\n private _onTouch: (_: User[]) => void;\n\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n\n constructor(private _service: ApplicationService, private _users: UsersService, private cdRef: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit() {\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(100),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query.slice(0, Math.max(this.limit, 3)),\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n })\n );\n }\n\n /**\n * Add user to the user list\n * @param user\n */\n public addUser(user: User) {\n /* istanbul ignore else */\n if (!this.active_list) {\n this.active_list = [];\n }\n const index = this.active_list.findIndex((a_user) => a_user.id === user.id);\n /* istanbul ignore else */\n if (index < 0) {\n this.active_list = [...this.active_list, user];\n }\n this.setValue(this.active_list);\n this.search_str = '';\n }\n\n /**\n * Remove user from the user list\n * @param user\n */\n public removeUser(user: User) {\n this.active_list = this.active_list.filter((a_user) => a_user.id !== user.id);\n this.setValue(this.active_list);\n }\n\n /**\n * Load CSV file and populate the user list with the contents\n * @param event File input field event\n */\n public addUsersFromFile(event) {\n /* istanbul ignore else */\n if (event.target) {\n const file = event.target.files[0];\n /* istanbul ignore else */\n if (file) {\n const reader = new FileReader();\n reader.readAsText(file, 'UTF-8');\n reader.addEventListener('load', (evt) => {\n this.processCsvData((evt.srcElement as any).result);\n event.target.value = '';\n this.cdRef.detectChanges();\n });\n reader.addEventListener('error', (_) =>\n this._service.notifyError('Error reading file.')\n );\n }\n }\n }\n\n /**\n * Process raw CSV data and save user data to attendee list\n * @param data CSV data\n */\n private processCsvData(data: string) {\n const list = csvToJson(data) || [];\n const id = this._users.current.staff_code; \n list.forEach((el) => {\n const firstName = el.first_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n const lastName = el.last_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n\n el.name = el.name || `${firstName} ${lastName}`;\n const display = (el.name || `${Math.floor(Math.random() * 9999_9999)}`)\n .split(' ')\n .join('_')\n .toLowerCase();\n /* istanbul ignore else */\n if (!el.email) {\n el.email = `${display}+${id}@guest.mckinsey.com`;\n }\n el.type = 'external';\n el.external = !el.email.endsWith(\"@mckinsey.com\") && !el.email.endsWith(\"@external.mckinsey.com\");\n this.addUser(new User(el));\n });\n }\n\n /* istanbul ignore next */\n /** Download template CSV file */\n public downloadCSVTemplate() {\n const template = `Organisation Name,First Name,Last Name,Email,Phone\\nFake Org,John,Smith,john.smith@example.com,01234567898`;\n downloadFile('template.csv', template);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User[]): void {\n this.active_list = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User[]) {\n this.active_list = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User[]) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: User[]) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n \n \n \n
\n
\n \n \n {{ user.name }}\n \n \n \n
\n
\n\n
No attendees
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n map,\n switchMap\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-search-field',\n templateUrl: './user-search-field.component.html',\n styleUrls: ['./user-search-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserSearchFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserSearchFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Limit available options to these */\n @Input() public options: User[];\n /** Currently selected user */\n public active_user: User;\n /** User list to display */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Current display value of the search input field */\n public search_str: string = '';\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User) => void;\n /** Form control on touch handler */\n private _onTouch: () => void;\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n \n constructor(private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap(query => {\n this.loading = true;\n return this.options && this.options.length > 0\n ? Promise.resolve(this.options)\n : query.length >= 3\n ? (this._users.query({ q: query, cache: 60 * 1000 }) as Promise)\n : Promise.resolve([]);\n }),\n catchError((err) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription('search_results', this.search_results$.subscribe(list => {\n this.user_list = list;\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n }));\n }\n\n /** Handle input changes */\n public onInputChange(value: string): void {\n this.search_str = value;\n this.search$.next(value);\n }\n\n /**\n * Reset the search string back to the name of the active user\n */\n public resetSearchString(): void {\n if (this.active_user) {\n this.search_str = this.active_user.name;\n } else {\n this.search_str = '';\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User): void {\n this.active_user = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n this.resetSearchString();\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User): void {\n this.active_user = value;\n this.search_str = value ? value.name : '';\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: () => void): void {\n this._onTouch = fn;\n }\n\n /** Function to display the user's name in the input field */\n public displayFn(user?: User): string {\n return user ? user.name : '';\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n","import { Component, OnInit } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'feedback',\n templateUrl: './feedback.component.html',\n styleUrls: ['./feedback.component.scss'],\n})\nexport class FeedbackComponent extends BaseDirective implements OnInit {\n /** Name of the currently active page */\n public current_page: string;\n\n constructor(private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title), 1000);\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.current_page = location;\n }\n}\n","\n
\n Feedback\n \n \n \n
\n
\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-icon',\n templateUrl: './icon.component.html',\n styleUrls: ['./icon.component.scss']\n})\nexport class IconComponent extends BaseDirective {\n @Input() public icon: ApplicationIcon;\n}\n","
\n {{ icon.content }}\n \n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n ActionFieldComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserListFieldComponent,\n UserSearchFieldComponent\n} from './custom-fields';\nimport { IconComponent } from './icon/icon.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { ACA_PIPES_MODULE } from '@acaprojects/ngx-pipes';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { FeedbackComponent } from './feedback/feedback.component';\nimport { ActionIconComponent } from './action-icon/action-icon.component';\nimport { PopoutMenuComponent } from './popout-menu/popout-menu.component';\nimport { SearchbarComponent } from './searchbar/searchbar.component';\nimport { UserAvatarComponent } from './user-avatar/user-avatar.component';\nimport { CateringMenuItemComponent } from './bookings/catering/item/item.component';\nimport { PackageOptionsModalComponent } from './bookings/catering/package-options-modal/package-options-modal.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { CngSearchBarComponent } from './cng-search-bar/cng-search-bar.component';\nimport { HoverClassDirective } from './cng-search-bar/hover-class.directive';\n\nconst DECLARATIONS = [\n ActionFieldComponent,\n IconComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserSearchFieldComponent,\n UserListFieldComponent,\n FeedbackComponent,\n ActionIconComponent,\n PopoutMenuComponent,\n SearchbarComponent,\n UserAvatarComponent,\n CateringMenuItemComponent,\n PackageOptionsModalComponent,\n CngSearchBarComponent,\n HoverClassDirective\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\n@NgModule({\n imports: [\n CommonModule,\n ACA_PIPES_MODULE,\n FormsModule,\n ReactiveFormsModule,\n ...MATERIAL_MODULES,\n BaseModule,\n UiModule\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ACA_PIPES_MODULE,\n ...DECLARATIONS,\n ...MATERIAL_MODULES,\n BaseModule,\n ]\n})\nexport class LegacyUiModule {\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nexport interface PopoutAction extends ApplicationIcon {\n /** ID of the action */\n id: string;\n}\n\n@Component({\n selector: 'a-popout-menu',\n templateUrl: './popout-menu.component.html',\n styleUrls: ['./popout-menu.component.scss']\n})\nexport class PopoutMenuComponent extends BaseDirective {\n /** List of available actions */\n @Input() public actions: PopoutAction[] = [];\n /** Emitter for user actions */\n @Output() public action = new EventEmitter();\n /** Whether actions should show */\n public show: boolean;\n\n public close() {\n this.timeout('close', () => {\n this.show = false;\n });\n }\n}\n","\n \n\n\n","import { Component, OnInit, Input, EventEmitter, Output, ViewChild, ElementRef, SimpleChanges, OnChanges } from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'a-searchbar',\n templateUrl: './searchbar.component.html',\n styleUrls: ['./searchbar.component.scss']\n})\nexport class SearchbarComponent extends BaseDirective implements OnChanges {\n /** Current contents of the searchbar input */\n @Input('value') public value: string;\n /** Current contents of the searchbar input */\n @Input() public placeholder: string;\n /** Whether external changes are being processed */\n @Input() public loading: boolean;\n /** Whether external changes are being processed */\n @Input() public autofocus: boolean;\n /** Emitter for changes to the searchbar value */\n @Output() public valueChange = new EventEmitter();\n /** Input field reference */\n @ViewChild('input', { static: true }) private input_field: ElementRef;\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.autofocus && this.autofocus) {\n this.focusField()\n }\n }\n\n public focusField() {\n /* istanbul ignore else */\n if (this.input_field && this.input_field.nativeElement) {\n this.input_field.nativeElement.focus();\n }\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n","import { Component, Input } from '@angular/core';\nimport { User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-user-avatar',\n templateUrl: './user-avatar.component.html',\n styleUrls: ['./user-avatar.component.scss']\n})\nexport class UserAvatarComponent {\n /** User to display avatar for */\n @Input() public user: User;\n\n public get initials(): string {\n if (!this.user) {\n return 'NA';\n }\n const parts = this.user.name.split(' ');\n return parts.length > 1\n ? `${parts[0][0]}${parts[parts.length - 1][0]}`\n : this.user.name.slice(0, 2);\n }\n}\n","
\n
{{ initials }}
\n
\n\n \n\n","export * from './lib/loading.actions'\nexport * from './lib/loading.model'\nexport * from './lib/loading.effects'\nexport * from './lib/loading.selectors'\nexport * from '../testing'\n","import {\n createAction,\n createSelector,\n on,\n On,\n props\n} from '@ngrx/store';\nimport {\n LoadingModel,\n wrapLoading\n} from './loading.model';\nimport {\n selectIsLoading,\n selectOptionalError,\n selectOptionalSuccess,\n selectSuccess\n} from './loading.selectors';\nimport { MemoizedSelector } from '@ngrx/store/src/selector';\nimport {\n ActionCreator,\n NotAllowedCheck,\n TypedAction\n} from '@ngrx/store/src/models';\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport interface Payload {\n payload: T\n}\n\nexport type LoadingAction = T & TypedAction\nexport type LoadingActionCreator = T extends null | undefined ?\n ActionCreator TypedAction>\n : ActionCreator) => LoadingAction>\n\ntype ClearAction = ActionCreator TypedAction>\n\ninterface Selectors {\n success: MemoizedSelector\n optionalSuccess: MemoizedSelector\n error: MemoizedSelector\n loading: MemoizedSelector\n model: (TState) => LoadingModel\n}\n\nexport interface LoadingActionObject {\n request: LoadingActionCreator\n success: LoadingActionCreator>\n error: LoadingActionCreator>\n clear: ClearAction,\n ons: On[],\n selectors: Selectors\n}\n\n/**\n * Creates a {@link LoadingActionObject} that contains a set of ActionCreators\n * for request, success, error, loading, and clear data. Also, it contains\n * the necessary On reducers and selectors in order to properly connect them in\n * a standardized way to data in the application.\n *\n * `TState` is the type of data on your reducer, not global store.\n * `TRequest` is an object type to use in request methods.\n * `TSuccess` is the object type of the T parameter on `LoadingModel`.\n *\n * This assumes you have state represented by:\n * ```typescript\n * interface SomeState {\n * stateKey: LoadingModel\n * }\n * ```\n *\n * To dispatch an action:\n * ```typescript\n *\n * // request parameters depend on the object type used as second type parameter\n * // in createLoadingAction\n * this.store.dispatch(someLoadingAction.request())\n *\n * // action created with createLoadingAction\n * this.store.dispatch(someLoadingAction.request({\n * name: 'Andrew G',\n * age: 24\n * }))\n *\n * ```\n *\n * The generated selectors only select data from its fractured state, not the global\n * store. In order to use them, make sure you {@link select} the global state\n * before using them:\n *\n * ```typescript\n *\n * this.store.pipe(\n * select(selectSomeState),\n * select(someLoadingAction.selectors.success)\n * ).subscribe(next => {\n *\n * })\n *\n * ```\n *\n * @param actionPrefix - Prefixes actions to uniquely identify them.\n * @param stateKey - The field within the reducer state to set data on.\n */\nexport const createLoadingAction = (\n actionPrefix: string,\n stateKey: keyof TState\n): LoadingActionObject => {\n const buildAction = (postfix: string) => `[${actionPrefix}] ${postfix}`;\n // @ts-ignore\n const request = createAction(buildAction('request'), props());\n const success = createAction(buildAction('success'), props>());\n const error = createAction(buildAction('error'), props>());\n const clear = createAction(buildAction('clear'));\n const ons: On[] = [\n on(request, (state: TState & HashMap>, action: LoadingAction) =>\n ({\n ...state,\n [stateKey]: wrapLoading(state[stateKey]).loading()\n })),\n on(success, (state: TState & HashMap>, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.success(action.payload)\n })),\n // some reason specifying state like in success and request does not work.\n on(error, (state: any, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.error(action.payload)\n })),\n on(clear, () => ({\n ...this.state,\n [stateKey]: LoadingModel.empty()\n }))\n ];\n const selectData = (state: TState) => {\n if (!state) {\n console.warn('[LoadingActions] State is empty for key', stateKey);\n }\n return wrapLoading(state?.[stateKey] as unknown as LoadingModel);\n };\n const selSuccess = createSelector, TSuccess>(\n selectData,\n selectSuccess\n );\n const selOptionalSuccess = createSelector(\n selectData,\n selectOptionalSuccess\n );\n const selError = createSelector(\n selectData,\n selectOptionalError\n );\n const selLoading = createSelector(\n selectData,\n selectIsLoading\n );\n return {\n request,\n success,\n error,\n clear,\n ons,\n selectors: {\n success: selSuccess,\n optionalSuccess: selOptionalSuccess,\n error: selError,\n loading: selLoading,\n model: selectData\n }\n };\n};\n","import {\n Actions,\n ofType\n} from '@ngrx/effects';\n\nimport { \n LoadingAction,\n LoadingActionObject\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n catchError,\n flatMap,\n map\n} from 'rxjs/operators';\nimport {\n Observable,\n of\n} from 'rxjs';\nimport { TypedAction } from '@ngrx/store/src/models';\n\n/**\n * This creates an effect to use in Effects classes. This coordinates a simple\n * success and error payload effect.\n * @param actions - The actions object\n * @param actionObject - The created createLoadingAction object.\n * @param caller - Define what API method or asynchronous operation is needed to\n * run this. Return TSuccess.\n */\nexport const createLoadingEffect = (\n actions: Actions, actionObject: LoadingActionObject,\n caller: (action: LoadingAction) => Promise): Observable> => actions.pipe(\n ofType(actionObject.request),\n flatMap((action) => caller(action as LoadingAction)),\n map((response: TSuccess) => actionObject.success({ payload: response })),\n catchError(err => {\n return of(actionObject.error({ payload: err }));\n })\n);\n","/* eslint-disable no-underscore-dangle,no-useless-constructor */\n/**\n * Wraps around the typical data objects we write for success, error, loading, and empty state. This convenience\n * wrapper consolidates all of that logic into a handy wrapper.\n */\nexport class LoadingModel {\n static empty = () => new LoadingModel(false, false, false, undefined);\n\n static success = (success?: T): LoadingModel =>\n new LoadingModel(false, false, true, success);\n\n static error = (error?: Error, optionalSuccess?: T): LoadingModel =>\n new LoadingModel(false, true, false, optionalSuccess, error);\n\n /**\n * Mutates the model with a success state, preserving other state fields.\n * @param success - override success state.\n */\n mutate = (\n success: T2 | null) => new LoadingModel(\n this.isLoading,\n this.hasError,\n !!success,\n !success ? undefined : success\n );\n\n loading = (success: T | null = this.success) =>\n new LoadingModel(\n true,\n false,\n !!success && this.hasSuccess,\n !success ? undefined : success\n );\n\n public get success(): T {\n return this._success as T;\n }\n\n public get optionalSuccess(): T | undefined {\n return this._success;\n }\n\n constructor(\n public isLoading: boolean,\n private hasError: boolean,\n private hasSuccess: boolean,\n private _success?: T,\n public error?: Error\n ) {\n }\n\n isEmpty = () => !this.isSuccess() && !this.isError();\n\n hasLoaded = () => !this.isEmpty() && !this.isLoading;\n\n isSuccess = () => this.hasSuccess;\n\n isError = () => this.hasError;\n\n shouldLoad = () => !this.isSuccess() && !this.isLoading;\n\n public toString = () =>\n `Loading: ${this.isLoading}, Success: ${this.hasSuccess}:**${this._success}**, ` +\n `Error: ${this.hasError}:${this.error}`;\n}\n\n/**\n * Wraps an object that conforms to LoadingModel to restore object loss from\n * hydrating state during development.\n */\nexport const wrapLoading = (loading: any): LoadingModel => {\n if (loading instanceof LoadingModel) {\n return loading;\n } else {\n if (!loading) {\n return LoadingModel.empty();\n } else {\n return new LoadingModel(\n loading.isLoading || false,\n loading.hasError || false,\n loading.hasSuccess || false,\n loading._success,\n loading.error\n );\n }\n }\n};\n","import { LoadingModel, wrapLoading } from './loading.model';\n\nexport const selectSuccess = (state: LoadingModel) =>\n wrapLoading(state).success;\nexport const selectOptionalSuccess = (state: LoadingModel) =>\n wrapLoading(state).optionalSuccess;\nexport const selectIsLoading = (state: LoadingModel) =>\n wrapLoading(state).isLoading;\nexport const selectIsSuccess = (state: LoadingModel) =>\n wrapLoading(state).isSuccess();\nexport const selectOptionalError = (state: LoadingModel) =>\n wrapLoading(state).error;\nexport const selectIsError = (state: LoadingModel) =>\n wrapLoading(state).isError();\nexport const selectHasLoaded = (state: LoadingModel) =>\n wrapLoading(state).hasLoaded();\nexport const selectIsEmpty = (state: LoadingModel) =>\n wrapLoading(state).isEmpty();\n\n","import {\n Observable,\n Subject\n} from 'rxjs';\nimport { Action } from '@ngrx/store';\nimport { Actions } from '@ngrx/effects';\nimport { TypedAction } from '@ngrx/store/src/models';\nimport { take } from 'rxjs/operators';\nimport {\n LoadingActionObject\n} from '../src/lib/loading.actions';\n\nexport const generateMockActions = () => {\n const dispatcher = new Subject();\n return {\n dispatcher,\n actions: new Actions(dispatcher)\n };\n};\n\n/**\n * Simple verifier that checks if the request action results in a success returned.\n */\nexport const verifyActionSuccess = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n data: TSuccess,\n payload?: TRequest,\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.success({ payload: options.data }));\n};\n\n/**\n * Simple verifier that checks if the request action results in a failure returned.\n */\nexport const verifyActionError = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n error: Error,\n payload?: TRequest\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.error({ payload: options.error }));\n};\n","export * from './effects.testing'\n","export * from './lib/organisation.module';\nexport * from './lib/organisation.actions';\n","import { OrganisationState } from './organisation.reducer';\nimport { createLoadingAction } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\n\nexport const organisationStateSelector = (state: { organisation: OrganisationState }) => state.organisation;\n\nexport const loadOrganisations = createLoadingAction('Organisation', 'data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadOrganisations } from './organisation.actions';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\n\n\n@Injectable()\nexport class OrganisationEffects {\n\n constructor(private actions: Actions,\n private organisationService: OrganisationService) {\n }\n\n @Effect()\n public loadOrganisations = createLoadingEffect(this.actions, loadOrganisations,\n () => this.organisationService.loadOrganisation())\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { organisationReducer } from './organisation.reducer';\nimport { OrganisationEffects } from './organisation.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n OrganisationEffects\n ]),\n StoreModule.forFeature('organisation', organisationReducer)\n ]\n})\nexport class OrganisationModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\nimport { createReducer } from '@ngrx/store';\nimport { loadOrganisations } from './organisation.actions';\n\nexport interface OrganisationState {\n data: LoadingModel\n}\n\nconst initialState: OrganisationState = {\n data: LoadingModel.empty()\n};\n\nexport const organisationReducer = createReducer(initialState,\n ...loadOrganisations.ons);\n","export * from './lib/rooms.module';\nexport * from './lib/rooms.actions'\nexport * from './lib/rooms.reducer'\nexport * from './lib/rooms.types'\nexport * from './lib/rooms.utils'\n","import { createLoadingAction } from '../../../loading/src/lib/loading.actions';\nimport { Space } from '../../../data-common/src/lib/spaces/space.class';\nimport {\n RoomQueryOptions,\n RoomState,\n RoomStoreState\n} from './rooms.types';\nimport {\n createAction,\n createSelector,\n props\n} from '@ngrx/store';\n\nexport const roomStateSelector = (state: RoomStoreState) => state.rooms;\n\nexport const loadRoomsWithQuery = createAction('[Rooms] Load Rooms with query', props());\n\nexport const loadRoomsForResults = createLoadingAction('Rooms', 'query');\n\nexport const loadRoomsForResultsMap = createLoadingAction('Rooms for map', 'query');\n\n\nexport const loadLaterThatDayResults = createLoadingAction('Later Rooms', 'later');\n\nexport const loadNextDayResults = createLoadingAction('Next Day Rooms', 'next');\n\nexport const loadByIdResults = createLoadingAction('By Id Rooms', 'byid');\n\nexport const selectRoomResultsSuccess = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.optionalSuccess);\n\nexport const loadDiffSizeResults = createLoadingAction('Different Size Rooms', 'size');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n loadRoomsWithQuery,\n loadByIdResults,\n loadDiffSizeResults\n} from './rooms.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n laterThatDayFromDateTz,\n nextBusinessDay,\n} from './rooms.utils';\nimport {\n RoomQueryOptions,\n roomQueryOptionsToSpaceAvailabilityOptions,\n roomByIdQueryOptionsToSpaceAvailabilityOptions\n} from './rooms.types';\n\n@Injectable()\nexport class RoomsEffects {\n constructor(private actions: Actions,\n private spaceService: SpacesService) {\n }\n\n @Effect()\n public afterRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadRoomsWithQuery),\n mergeMap((action: LoadingAction) => {\n return [\n loadRoomsForResults.request({\n ...action,\n dateTz: action.dateTz\n }),\n // loadRoomsForResultsMap.request({\n // ...action,\n // dateTz: action.dateTz\n // }),\n loadLaterThatDayResults.request({\n ...action,\n dateTz: laterThatDayFromDateTz(action.dateTz)\n }),\n loadNextDayResults.request({\n ...action,\n dateTz: nextBusinessDay(action.dateTz)\n }),\n loadDiffSizeResults.request({\n ...action,\n dateTz: action.dateTz,\n diff_capacity: true\n }),\n ];\n })\n );\n\n @Effect()\n public loadRoomsForResultsEffect = createLoadingEffect(this.actions, loadRoomsForResults,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms'));\n \n @Effect() \n public loadRoomsForResultsMapEffect = createLoadingEffect(this.actions, loadRoomsForResultsMap,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms for maps', false));\n\n @Effect()\n public loadLaterThatDayResultsEffect = createLoadingEffect(this.actions, loadLaterThatDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'laterResults'));\n\n @Effect()\n public loadNextDayResultsEffect = createLoadingEffect(this.actions, loadNextDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'nextDay'));\n\n @Effect()\n public loadDiffSizeResultsEffect = createLoadingEffect(this.actions, loadDiffSizeResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'diffSize'));\n\n @Effect()\n public loadRoomByIdResultsEffect = createLoadingEffect(this.actions, loadByIdResults,\n (action) => \n this.spaceService.available(roomByIdQueryOptionsToSpaceAvailabilityOptions(action), 'byId', false));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { roomsReducer } from './rooms.reducer';\nimport { RoomsEffects } from './rooms.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([RoomsEffects]),\n StoreModule.forFeature('rooms', roomsReducer)\n ]\n})\nexport class RoomsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { createReducer } from '@ngrx/store';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from './rooms.actions';\nimport { RoomState } from './rooms.types';\n\nexport const initialRoomsState: RoomState = {\n query: LoadingModel.empty(),\n later: LoadingModel.empty(),\n next: LoadingModel.empty(),\n byid: LoadingModel.empty(),\n size: LoadingModel.empty(),\n};\n\nexport const roomsReducer = createReducer(initialRoomsState,\n ...loadRoomsForResults.ons,\n ...loadRoomsForResultsMap.ons,\n\n ...loadLaterThatDayResults.ons,\n ...loadNextDayResults.ons,\n ...loadByIdResults.ons,\n ...loadDiffSizeResults.ons);\n","import { LoadingModel } from '../../../loading/src/lib/loading.model';\nimport {\n Building,\n DaysOfWeek,\n ISpaceAvailabilityOptions,\n RecurrencePeriod,\n Space\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface RoomStoreState {\n rooms: RoomState;\n}\n\nexport interface RoomState {\n query: LoadingModel\n later: LoadingModel\n next: LoadingModel\n byid: LoadingModel\n size: LoadingModel\n}\n\nexport interface RoomQueryOptions {\n dateTz: DateTZ;\n duration: number;\n locations: string;\n capacity?: number;\n capacity_max?: number;\n diff_capacity?: boolean;\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n bookable?: boolean;\n ignore?: string;\n}\n\nexport const roomQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n zone_ids: options.locations,\n capacity_max: options.capacity_max,\n diff_capacity: options.diff_capacity,\n /** Fields to include recurrence in the availability search */\n is_recurrent: options?.is_recurrent,\n is_multiroom: options?.is_multiroom,\n merged: options?.merged,\n recurrence_period: options?.recurrence_period,\n recurrence_interval: options?.recurrence_interval,\n recurrence_endTz: options?.recurrence_endTz,\n recurrence_count: options?.recurrence_count,\n recurrence_starts: options?.recurrence_starts,\n recurrence_days: options?.recurrence_days,\n bookable: options?.bookable,\n ignore: options?.ignore\n});\n\nexport const roomByIdQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n room_ids: options.locations,\n capacity_max: options.capacity_max\n});\n","import { Space } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport const todayFromDate = (date: number) => new DateTZ({date});\n\n/**\n * Adds 60 mins.\n */\nexport const laterThatDayFromDateTz = (dateTz: DateTZ) => {\n return dateTz.addValue({ minutes: 60 })\n};\n\n/**\n * Next business day. In most cases 1 day, but on Fridays, it follows to the monday.\n * @param date\n */\nexport const nextBusinessDay = (dateTz: DateTZ) => {\n let retDate = dateTz.addValue({ days: 1 });\n if (retDate.dateWeekday >= 6) {\n retDate = retDate.setValue({ weekday: 8 });\n }\n return retDate;\n};\n\nexport const mapRoomToSelectOption = (room?: Space): SelectOption => room ? ({\n value: room.id,\n shortDisplay: room.local_name,\n display: `${room.local_name}, ${room.level?.name}`\n}) : undefined;\n","export * from './lib/rx-utils.module';\nexport * from './lib/operators'\nexport * from './lib/loading-model.utils'\n","import {\n combineLatest,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\n\n/**\n * Generates the results count based on if data has loaded or not. If not, undefined is returned.\n * Otherwise, it'll return the count of the results.\n */\nexport const resultCountObservable = (loadingObservable: Observable>,\n resultsObservable: Observable\n): Observable => combineLatest([\n loadingObservable.pipe(map(r => r.hasLoaded())),\n resultsObservable.pipe(map(v => v?.length))\n]).pipe(map(([isLoading, viewModelLength]) => isLoading ? viewModelLength : undefined));\n","import {\n distinctUntilChanged,\n filter\n} from 'rxjs/operators';\nimport * as deepEqual from 'fast-deep-equal';\n\n/**\n * Useful for nested objects to prevent unnecessary triggers in RX chain.\n */\nexport const deepDistinctUntilChanged = () => distinctUntilChanged(deepEqual);\n\n/**\n * Won't emit if value is undefined.\n */\nexport const filterUndefined = () => filter(f => !!f);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class RxUtilsModule {}\n","export * from './lib/ui.module';\nexport * from './lib/types';\nexport * from './lib/base-template.component';\nexport * from './lib/recurrence-pattern-form/recurrence-pattern-form.component';\nexport * from './lib/recurrence-booking-form/recurrence-booking-form.component';\nexport * from './lib/conflicts-modal/conflicts-modal.component'\nexport * from './lib/override-changes-modal/override-changes-modal.component'\nexport * from './lib/date-tz-calendar-widget/date-tz-calendar-widget.component';\nexport * from './lib/date-tz-date-picker/date-tz-date-picker.component';\nexport * from './lib/date-tz-duration-field/date-tz-duration-field.component';\nexport * from './lib/date-tz-time-field/date-tz-time-field.component';\nexport * from './lib/aca-date-picker/aca-date-picker.component';\nexport * from './lib/conflict-alert-modal/conflict-alert-modal.component';\nexport * from './lib/tooltip/tooltip.enums';\nexport * from './lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nexport * from './lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n","import { Component, OnInit, Input, Output, OnChanges, SimpleChanges, forwardRef, EventEmitter } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDatePickerOptions {\n /** Unix timestamp with millisecond. First selectable date */\n from?: number;\n /** Unix timestamp with millisecond. Last selectable date */\n to?: number;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: number;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'aca-date-picker',\n templateUrl: './aca-date-picker.component.html',\n styleUrls: ['./aca-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AcaDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class AcaDatePickerComponent implements OnInit, OnChanges, ControlValueAccessor {\n /** CSS class to add to the root element of the component */\n @Input() public klass = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDatePickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n /** Display the last selected day as active */\n @Input() public show_last_selection?: boolean = true\n\n public date: number = DateNow(new Date()).ms;\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private from: DateTZ;\n /** Last selectable date */\n private to: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n /** ID of the timer used for changing the month */\n private _change_timer: number;\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.date = item.value;\n if (this._onChange) {\n this._onChange(this.date);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date\n */\n public updateDate(): void {\n \n if (!this.date) {\n return;\n }\n const now = DateNow(new Date()).startOfValue('month');\n const date_ = new DateTZ({date: this.date})\n const date = date_.startOfValue('month');\n if (date.valid) {\n const difference = date.dateDiff(now, 'months', 'months');\n if (this.offset !== difference) {\n this.offset = difference;\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.from) {\n const date_ = new DateTZ({date: this.options.from})\n this.from = date_.startOfValue('day');;\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.from.startOfValue('month');\n this.min_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.from) {\n this.from = null;\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.to) {\n const date_ = new DateTZ({date: this.options.to})\n this.to = date_.startOfValue('day');\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.to.startOfValue('month');\n this.max_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.to) {\n this.to = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n if (!this.date) {\n return;\n }\n const date = DateNow(new Date()).addValue({ months : this.offset });\n const active = new DateTZ({date: this.date});\n let start = date.setValue({ day: 1 }).setValue({ weekday: 7 }).subtractValue({ weeks: 1 });\n const end_ = new DateTZ({date: start.ms})\n const end = end_.addValue({ weeks: 1 }).endOfValue('month').addValue({ days: 2 }).endOfValue('week');\n this.date_list = [];\n while (start.isBeforeDate(end) || start.isSameDate(end, 'day')) {\n this.date_list.push({\n value: start.ms,\n display: start.formatDate('d'),\n active: this.show_last_selection && active.isSameDate(start, 'day'),\n non_month: !date.isSameDate(start, 'month'),\n count: this.counters ? this.counters[start.formatDate('yyyy-MM-dd')] || 0 : 0,\n disabled: (this.from ? start.isBeforeDate(this.from, 'day') : false) || (this.to ? start.isAfterDate(this.to, 'day') : false),\n today: DateNow(new Date()).isSameDate(start, 'day')\n });\n start = start.addValue({ days : 1 });\n }\n this.month_name = date.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = DateNow(new Date()).startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days : 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n if (this._change_timer) {\n clearTimeout(this._change_timer);\n }\n this._change_timer = setTimeout(() => {\n const new_offset = this.offset + value;\n const now = DateNow(new Date())\n const date = now.addValue({ months : new_offset, days: now.dateMonth === 2 ? 2 : 0 }); //add 2 days if month is february to avoid calc errors\n if (this.from && date.isBeforeDate(this.from, 'month')) { return; }\n if (this.to && date.isAfterDate(this.to, 'month')) { return; }\n this.offset = new_offset;\n this.month.emit(this.offset);\n this.generateMonth();\n this._change_timer = null;\n }, 100);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const date = new DateTZ({date: this.date});\n const offset = this.offset;\n this.offset = DateNow(new Date()).dateDiff(date, 'months', 'months');\n if (offset !== this.offset) {\n this.generateMonth();\n }\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.updateDate();\n this.generateMonth();\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n
\n
\n
\n
\n
{{month_name}}
\n
= max_offset\" (click)=\"changeMonth(1)\" (touchend)=\"changeMonth(1)\">\n
\n
\n
\n
\n
{{item}}
\n
\n
\n
\n
\n {{item.display}}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nexport enum AlertMode {\n Warning = 'warning',\n Coachmark = 'coachmark',\n BlueCoachmark = 'blue-coachmark',\n Error = 'error'\n}\n\nexport enum AlertBannerDisplay {\n /**\n * New UI\n */\n V2 = 'v2',\n\n /**\n * Default, legacy ui.\n */\n V1 = 'v1',\n}\n\n@Component({\n selector: 'mck-alert-banner',\n template: `\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n `,\n styleUrls: ['./alert-banner.component.scss']\n})\nexport class AlertBannerComponent implements OnInit, OnChanges {\n\n @Input()\n public mode: AlertMode = AlertMode.Warning;\n\n @Output()\n public close = new EventEmitter();\n\n @Output()\n public action = new EventEmitter();\n\n @Input()\n public message: string;\n\n @Input()\n public buttonText: string;\n\n @Input()\n public showClose = true;\n\n @Input()\n public display: AlertBannerDisplay = AlertBannerDisplay.V1;\n\n public iconPath: string = 'assets/icon/warning-yellow.svg';\n public materialColor: string = 'black';\n public closeIcon: string = 'close_outline.svg';\n\n public ngOnInit(): void {\n this._onModeChange();\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.mode) {\n this._onModeChange();\n }\n }\n\n private _onModeChange() {\n this.iconPath = 'assets/icon/warning-yellow.svg';\n this.closeIcon = 'close_outline.svg';\n switch (this.mode) {\n case AlertMode.Warning:\n this.materialColor = 'black';\n break;\n case AlertMode.Coachmark:\n this.materialColor = 'coachmark';\n this.closeIcon = 'close_outline_coachmark.svg';\n break;\n case AlertMode.BlueCoachmark:\n this.iconPath = 'assets/icon/info-bg-dark.svg'\n this.materialColor = 'blue-coachmark'\n break;\n case AlertMode.Error:\n this.iconPath = 'assets/img/error-icon.svg'\n this.materialColor = 'white'\n break;\n default:\n this.materialColor = 'black';\n }\n }\n\n}\n","import {\n Component,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n Self,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NgControl\n} from '@angular/forms';\nimport { SelectOption } from '../types';\nimport {\n BehaviorSubject,\n combineLatest,\n from,\n Subject\n} from 'rxjs';\nimport {\n COMMA,\n ENTER\n} from '@angular/cdk/keycodes';\nimport { MatChipInputEvent } from '@angular/material/chips';\nimport {\n distinctUntilChanged,\n map,\n take\n} from 'rxjs/operators';\nimport { MatCheckboxChange } from '@angular/material/checkbox';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'mck-autocomplete-chip-select-item',\n template: `\n
\n \n {{label}}\n \n
\n \n
\n
\n \n
\n \n
\n \n
\n
\n
\n \n \n \n \n {{selected.shortDisplay}}\n close\n \n \n \n \n
\n \n \n {{option.dropdownOverride || option.display}}\n \n \n
\n
\n \n Clear\n \n \n Confirm\n \n
\n \n \n {{errorMessage}}\n
\n `,\n styleUrls: ['./auto-complete-chip-select-item.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class AutoCompleteChipSelectItemComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor, OnDestroy {\n\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n @ViewChild('componentInput')\n componentInput: HTMLInputElement;\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n feedbackInput?: boolean;\n\n @Input()\n loading?: boolean;\n\n @Input()\n placeHolder: string;\n\n @Input()\n options: Subject[]>;\n\n @Input()\n selectedOptions: Subject[]>;\n\n @Input()\n useCTAs?: boolean;\n\n @Output()\n optionSelected = new EventEmitter>();\n\n @Output()\n feedbackOutput = new EventEmitter();\n\n @Output()\n chipsCleared: EventEmitter = new EventEmitter();\n\n @Output()\n onClickConfirm: EventEmitter = new EventEmitter();\n\n /**\n * If true, only allow 1 group at a time to get selected. Show others as disabled.\n */\n @Input()\n selectOnlyOneGroup = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input() public localFilter: boolean = true;\n\n /**\n * If error exists, a message.\n */\n @Input()\n errorMessage?: string;\n\n @Input()\n hideDropdownCarret?: boolean;\n\n @Input()\n displayCTA?: boolean;\n\n private selectOnlyOneGroupChange = new BehaviorSubject(false);\n\n separatorKeysCodes = [ENTER, COMMA];\n\n public filterFormControl: FormControl = new FormControl();\n\n public focused = false;\n public mobileFullScreen = false;\n\n public autocompleteOptions = new BehaviorSubject[]>([]);\n public filteredAutocompleteOptions = new BehaviorSubject[]>([]);\n\n /** List shown to user, filters children if a group header is added **/\n public chipOptions = new BehaviorSubject[]>([]);\n\n /** Form control on change handler */\n private _onChange?: (_: SelectOption[]) => void;\n /** Form control on touch handler */\n private _onTouch?: (_: string) => void;\n\n private value = new BehaviorSubject[]>([]);\n\n public enableCTAs: boolean = false\n\n public hasChips: boolean = false;\n\n constructor(@Self() @Optional() private control: NgControl) {\n super();\n if (this.control) {\n this.control.valueAccessor = this;\n }\n }\n\n public get invalid(): boolean {\n return this.control ? this.control.invalid : false;\n }\n\n public get showError(): boolean {\n if (!this.control) {\n return false;\n }\n\n const { dirty, touched } = this.control;\n\n return this.invalid ? (dirty && touched) : false;\n }\n\n public iconFillClass(color?: string): string {\n return color === 'external' ? 'mck-icon-fill-gray' : 'mck-icon-fill-white'\n }\n\n ngOnInit() {\n this.subscription('autoCompleteOptions', combineLatest([\n this.options,\n this.selectedOptions,\n this.selectOnlyOneGroupChange\n ])\n .pipe(\n map(([options, selectedOptions, selectOnlyOneGroup]) => {\n this.hasChips = !!selectedOptions.length;\n return options.map(option => {\n const selected = !!selectedOptions.find(s => s.value === option.value);\n let enabled = true;\n if (selectOnlyOneGroup) {\n // find first group item in selection\n const selectedGroupHeader = selectedOptions.find(s => s.groupHeader || s.groupId === option.groupId);\n\n // if no options chosen, enable it, otherwise only allow selections from other options.\n enabled =\n selectedOptions.length === 0 ||\n (selectedGroupHeader ? selectedGroupHeader.groupId === option.groupId : false);\n this.enableCTAs = selectedOptions.length !== 0\n }\n\n return {\n ...option,\n enabled,\n selected\n } as SelectOption;\n });\n })\n ).subscribe(next => {\n const options = next.sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n this.autocompleteOptions.next(options);\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(this.filterFormControl.value?.trim()));\n }));\n this.subscription('filterFormControlChanges',\n this.filterFormControl.valueChanges.subscribe(value => {\n if (this.localFilter && value.length) {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(value));\n } else {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions());\n }\n }));\n this.subscription('chipOptions', this.selectedOptions\n .pipe(map(selectedOptions => {\n // find group headers and check if children are part of that group.\n // if part of group, filter them out as redundant.\n const groupHeaders = selectedOptions.filter(s => s.groupHeader) || [];\n return selectedOptions.filter(s => s.groupHeader || s.groupChild && !(groupHeaders.find(g => g.groupId === s.groupId)));\n }))\n .subscribe(next => {\n this.chipOptions.next(next);\n }));\n\n this.subscription('formData', this.selectedOptions\n .pipe(map(selected => {\n // group headers always contain children, so only pick out children for data\n return selected;\n }))\n .subscribe(next => {\n this.value.next(next);\n }));\n\n // tie value changes to change.\n this.subscription('valueChanges', this.value\n .pipe(distinctUntilChanged())\n .subscribe(next => {\n if (this._onChange) {\n // rewrote this to avoid read only error\n const values = [];\n next.forEach((v, i) => {\n const value = { ...v };\n if (v.meta?.user) {\n value.display = v.meta.user.name;\n }\n values.push(value);\n });\n this._onChange(values);\n }\n }));\n\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n getFilteredAutocompleteOptions(searchString: string = '') {\n // Exact matches of the groupId or display value\n const exactMatches = this.autocompleteOptions.value.filter(o => {\n if (searchString && searchString.length) {\n return o.groupId.toLowerCase().indexOf(searchString.toLowerCase()) === 0 || o.display.toLowerCase().indexOf(searchString.toLowerCase()) === 0;\n }\n return o.groupId && o.display;\n });\n // Fuzzier search of the dropdownOverride field\n const moreOptions = this.autocompleteOptions.value.filter(o => {\n if (o?.dropdownOverride?.length && searchString) {\n const match = o.dropdownOverride?.toLowerCase().indexOf(searchString.toLowerCase()) > -1;\n // only return found locations that don't exist in exactMatches.\n return match && !exactMatches.find(e => {\n return e.value === o.value\n });\n }\n return false;\n });\n\n // Merge the two result sets\n let joinedOptions = exactMatches.concat(moreOptions).sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n\n // Create a 1D array of the groupId\n const groupIds = joinedOptions.map(o => o.groupId);\n // Get a deduped list of the group parents\n const parents = this.autocompleteOptions.value.filter(o => {\n return o?.groupHeader && groupIds.indexOf(o.groupId) !== -1;\n });\n\n // Remove the parents from the joinedOptions and merge with the reduced parents set, and then sort by groupId.\n // Resulting array sets the parents first in order so the widget renders properly.\n const filteredAutocompleteOptions = parents.concat(joinedOptions.filter(jo => !!jo.dropdownOverride)).sort((a, b) => {\n return b.groupId > a.groupId ? -1 : 1;\n });\n return filteredAutocompleteOptions;\n }\n\n loseFocus(): void {\n this.mobileFullScreen = false;\n this.focused = false;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selectOnlyOneGroup) {\n this.selectOnlyOneGroupChange.next(this.selectOnlyOneGroup);\n }\n }\n\n keyedInput(matInput: string) {\n if (this.feedbackInput) {\n this.feedbackOutput.emit(matInput);\n }\n }\n\n selectOption(value: string) {\n this.options.pipe(\n take(1),\n map((options: SelectOption[]) => options.find(o => o.value === value))\n ).subscribe(next => {\n if (next) {\n this.optionSelected.emit(next);\n }\n });\n }\n\n removeOption(value: SelectOption) {\n this.optionSelected.emit(value);\n if (this.useCTAs) {\n this.onClickConfirm.emit();\n }\n\n }\n\n clearSelections() {\n this.selectedOptions.next([]);\n this.chipsCleared.emit();\n }\n\n onClickArrow() {\n // only close events we allow arrow to close panel.\n if (this.focused) {\n this.onFocus(false);\n }\n }\n\n onPanelFocusChange(focusIn: boolean) {\n this.onFocus(focusIn, true);\n }\n\n onFocus(focusIn: boolean, fromPanel?: boolean) {\n if (!focusIn && this.useCTAs) {\n this.onClickConfirm.emit();\n }\n // Only for location input???\n if (this.localFilter && fromPanel && focusIn) {\n // open on focus, mobile needs a refocus\n this.mobileFullScreen = true;\n this.timeout('showDefaults', () => {\n // All results do not show as expected unless I focus again.\n // Something about the mobile styles.\n this.onFocus(true);\n }, 100)\n }\n\n if (this.feedbackInput && !fromPanel) {\n // clear input when input creates options\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n this.feedbackOutput.emit('');\n }\n\n if (this.focused !== focusIn) {\n this.focused = focusIn;\n // clear on close\n if (!focusIn) {\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n }\n if (!fromPanel) {\n if (focusIn) {\n this.trigger.openPanel();\n } else {\n this.trigger.closePanel();\n // close the mobile full screen\n this.loseFocus();\n }\n }\n }\n }\n\n onChanged(value: SelectOption, event: MatCheckboxChange) {\n this.optionSelected.emit(value);\n }\n\n add(event: MatChipInputEvent) {\n // reset\n if (event.input) {\n event.input.value = '';\n }\n this.filterFormControl.setValue('');\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n // TODO: disabled not implemented yet.\n this.disabled = isDisabled;\n }\n\n writeValue(obj: SelectOption[] | undefined): void {\n // update selected options when this value is written\n this.options?.pipe(\n take(1),\n map((options: SelectOption[]) => {\n return options.filter(o => obj ? !!obj.find(spl => o.value === spl.value) : false );\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null && !event.srcElement.classList.contains('mat-form-field-autofill-control')) {\n this.onFocus(false);\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n}\n\n\n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\nimport { SelectOption } from '../types';\n\n/**\n * Patch orphaned SelectOption children into acting as their own group headers.\n *\n * This intends to help in the common scenario where filters have (for whatever\n * reason) prevented the child's usual group header from appearing.\n */\n@Pipe({\n name: 'groupHeaderPatch',\n})\nexport class GroupHeaderPipe implements PipeTransform {\n transform(items: SelectOption[]): SelectOption[] {\n if (!items) {\n return [];\n }\n\n return items.map(v => {\n const hasHeader = !!items.find(i => i.groupHeader && i.groupId === v.groupId);\n return {\n ...v,\n displayAsHeader: !hasHeader,\n }\n })\n }\n\n}\n","import { Component, Input, Output, forwardRef, SimpleChanges, OnChanges, OnInit, EventEmitter, ViewChild, OnDestroy } from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\nimport {\n BehaviorSubject\n} from 'rxjs';\n\n/**\n * @title Autocomplete filtering select of a single option via text search.\n */\n@Component({\n selector: 'mck-autocomplete-select-option',\n templateUrl: 'auto-complete-select-option.component.html',\n styleUrls: ['auto-complete-select-option.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AutoCompleteSelectOptionComponent),\n multi: true\n }\n ],\n})\nexport class AutoCompleteSelectOptionComponent implements OnInit, OnChanges, ControlValueAccessor, OnDestroy{\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n @Input()\n public resetInput: number | undefined;\n\n @Input()\n public placeholder: string;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Output()\n public filteredOptionsChange = new EventEmitter[]>();\n\n @Output()\n public inputTextChange = new EventEmitter();\n\n @Output() emptyBoxEvent = new EventEmitter();\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n filterFormControl = new FormControl();\n filteredOptions: Observable[]>;\n\n /** The selected value */\n public value = new BehaviorSubject('');\n\n /** Available options to search / select from */\n public _options = new BehaviorSubject[]>(this.options);\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n ngOnInit() {\n this.updateFilteredOptions();\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n // Watch and apply changes from the parent component.\n if (changes.options || changes.selectedValue) {\n if (changes.options && !changes.selectedValue) {\n this.filterFormControl.setValue('')\n }\n this.updateFilteredOptions();\n }\n if (changes.resetInput) {\n this.filterFormControl.setValue('');\n this.updateFilteredOptions();\n }\n \n }\n\n private updateFilteredOptions() {\n this.filteredOptions = this.filterFormControl.valueChanges\n .pipe(\n startWith(''),\n map(value => typeof value === 'string' ? value : value && value?.display ? value.display : ''),\n map(name => name ? this._filter(name) : this.options.slice())\n );\n }\n\n displayFn(data: SelectOption): string {\n return data && data?.display ? data.display : '';\n }\n\n private _filter(display: string): SelectOption[] {\n const filterValue = display.toLowerCase();\n // return all the matches found\n const filtered = this.options.filter(option => {\n // split this input and index both, if both\n // match return true.\n if (filterValue.includes(' ')) {\n const filterValues =filterValue.split(' ');\n let matchesAll = true;\n for (let x = 0; x < filterValues.length; x++) {\n if (option.display.toLowerCase().indexOf(filterValues[x]) === -1) {\n matchesAll = false;\n }\n }\n if (matchesAll) {\n return true;\n }\n }\n // match the whole string\n return option.display.toLowerCase().indexOf(filterValue) > -1;\n });\n this.inputTextChange.emit(filterValue);\n this.filteredOptionsChange.emit(filtered);\n return filtered;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: SelectOption): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value.value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n public onChangeInput() {\n if (this.filterFormControl.value === '') {\n this.emptyBoxEvent.emit(true);\n }\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null ) {\n this.trigger.closePanel();\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n\n}","
\n {{label}}\n \n \n \n \n {{option.shortDisplay || option.display}}\n \n \n \n
","import {\n AfterViewInit,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n/**\n * A helper class for rendering embedded views (ng-template) as standalone components.\n *\n * If the view is lazy and does not render upon initialization,\n * it attempts embedding view again later.\n *\n * When testing a component directly that extends this class, its best to wrap the component\n * in a wrapper component for testing so that it can render itself.\n */\nexport class BaseTemplateComponent extends BaseDirective implements AfterViewInit, OnInit, OnDestroy {\n @ViewChild(TemplateRef, { static: true })\n public template: TemplateRef;\n\n private isRendered = false;\n\n constructor(private vcRef: ViewContainerRef) {\n super();\n }\n\n public ngOnInit(): void {\n // try early rendering\n this.attemptViewEmbed();\n }\n\n public attemptViewEmbed() {\n if (this.template && !this.isRendered) {\n this.isRendered = true;\n this.vcRef.createEmbeddedView(this.template);\n return true;\n }\n return false;\n }\n\n public ngAfterViewInit(): void {\n if (!this.isRendered) {\n console.log('View not rendered yet, attempting to post initialization');\n setTimeout(() => {\n console.log('Timeout ended, trying again', this.template);\n if (!this.attemptViewEmbed()) {\n console.log('Attempting render in after view initialization');\n setTimeout(() => {\n if (!this.attemptViewEmbed()) {\n console.error('FAILED TO LOAD TEMPLATE');\n }\n }, 1000);\n }\n });\n }\n }\n\n public ngOnDestroy(): void {\n super.ngOnDestroy();\n this.isRendered = false;\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'catering-drop-modal',\n templateUrl: './catering-drop-modal.component.html',\n styleUrls: ['./catering-drop-modal.component.scss']\n})\nexport class CateringDropComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onConfirm(): void {\n this.dialogRef.close(true);\n}\n\nonCancel(): void {\n this.dialogRef.close(false);\n}\n}\n","
\n

Catering conflict

\n
\n\n
\n
\n

New proposed meeting time is outside catering hours. Proceed without catering?

\n
\n
\n
\n\n
\n \n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input\n } from \"@angular/core\";\n import { DropdownPanel } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select-options\",\n templateUrl: \"./cng-select-options.component.html\",\n styleUrls: [\"./cng-select-options.component.scss\"]\n })\n export class CngSelectOptionsComponent implements DropdownPanel {\n @ViewChild(TemplateRef) templateRef: TemplateRef;\n @Output() closed = new EventEmitter();\n @Input() ddWidth: string;\n \n constructor() {}\n }\n ","\n
\n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input,\n OnInit\n } from \"@angular/core\";\n import { DropdownPanel, DropdownOpion } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select\",\n templateUrl: \"./cng-select.component.html\",\n styleUrls: [\"./cng-select.component.scss\"]\n })\n export class CngSelectComponent implements OnInit {\n @Input() data: any;\n public isClosed: boolean = false;\n public selected: DropdownOpion;\n constructor() {\n\n }\n ngOnInit(): void {\n this.selected = this.data.defaultSelected;\n }\n\n public optionSelected(item: DropdownOpion) {\n // this.selected = item;\n this.data.defaultSelected = item;\n this.data?.onChangeCallback && this.data?.onChangeCallback(item);\n }\n }\n ","\n\n
\n {{data?.defaultSelected?.display}}\n
\n \n
\n
\n\n
{{item?.display}}
\n
","import {\n AfterViewInit,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n ViewContainerRef\n } from '@angular/core';\n import { DropdownPanel } from './dropdown-panel';\n import { Overlay, OverlayRef } from '@angular/cdk/overlay';\n import { TemplatePortal } from '@angular/cdk/portal';\n import { merge, Observable, Subscription } from 'rxjs';\n \n @Directive({\n selector: '[dropdownTriggerFor]',\n host: {\n '(click)': 'toggleDropdown()'\n }\n })\n export class DropdownTriggerForDirective implements OnDestroy, AfterViewInit, OnInit {\n private isDropdownOpen = false;\n private overlayRef: OverlayRef;\n private dropdownClosingActionsSub = Subscription.EMPTY;\n \n @Input('dropdownTriggerFor') public dropdownPanel: DropdownPanel;\n @Output() isPanelOpened = new EventEmitter();\n constructor(\n private overlay: Overlay,\n private elementRef: ElementRef,\n private viewContainerRef: ViewContainerRef,\n private renderer: Renderer2\n ) {\n \n }\n ngOnInit(): void {\n // const cngSelectEl = this.elementRef.nativeElement.nextElementSibling; \n // const parentWidth = this.elementRef.nativeElement.offsetWidth; \n // this.renderer.setStyle(cngSelectEl, 'width', `${parentWidth}px`);\n }\n ngAfterViewInit(): void {\n \n }\n\n \n toggleDropdown(): void {\n this.isDropdownOpen ? this.destroyDropdown() : this.openDropdown();\n \n }\n \n openDropdown(): void {\n let {ddWidth} = this.dropdownPanel;\n this.dropdownPanel.ddWidth = ddWidth !=='' ? ddWidth : `${this.elementRef.nativeElement.offsetWidth}px`;\n this.isDropdownOpen = true;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.close(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions([\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8\n }\n ])\n });\n \n const templatePortal = new TemplatePortal(\n this.dropdownPanel.templateRef,\n this.viewContainerRef\n );\n this.overlayRef.attach(templatePortal);\n \n this.dropdownClosingActionsSub = this.dropdownClosingActions().subscribe(\n () => this.destroyDropdown()\n );\n }\n \n private dropdownClosingActions(): Observable {\n const backdropClick$ = this.overlayRef.backdropClick();\n const detachment$ = this.overlayRef.detachments();\n const dropdownClosed = this.dropdownPanel.closed;\n \n return merge(backdropClick$, detachment$, dropdownClosed);\n }\n \n private destroyDropdown(): void {\n if (!this.overlayRef || !this.isDropdownOpen) {\n return;\n }\n \n this.dropdownClosingActionsSub.unsubscribe();\n this.isDropdownOpen = false;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef.detach();\n }\n \n ngOnDestroy(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n }\n }\n }\n ","import {\n Component,\n Input,\n OnInit,\n OnDestroy,\n ViewChild,\n AfterViewInit,\n Output,\n EventEmitter\n} from '@angular/core';\nimport { MatExpansionPanel } from '@angular/material/expansion';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { CollapseService } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'mck-collapse-header',\n template: `\n \n \n {{title}} \n
\n
\n \n
\n \n
\n
\n {{description}}\n \n \n \n \n `,\n styleUrls: ['./collapse-header.component.scss'],\n})\nexport class CollapseHeaderComponent implements OnInit, OnDestroy {\n\n @Input() title: string;\n @Input() description: string;\n @Input() isLoading = false;\n @Input() expandedIds: string[] = [];\n @Output() updateSectionIdOnOpen = new EventEmitter<{ status: string, id: string }>(); // Emit the id of the opened result section\n\n @ViewChild('expansionPanel') expansionPanel: MatExpansionPanel;\n\n public isExpanded = new BehaviorSubject(false);\n private collapseSubscription: Subscription;\n\n constructor(private collapseService: CollapseService) {}\n\n ngOnInit(): void {\n this.collapseSubscription = this.collapseService.collapse$.subscribe(() => {\n if (this.expansionPanel) {\n this.expansionPanel.close(); // Close the panel\n }\n });\n }\n\n // Update opened section id and emit the id of the opened result section to the parent component \n public updateOpenedSectionId(isOpen: string) {\n this.updateSectionIdOnOpen.emit({ status: isOpen, id: this.expandedTitleId });\n }\n\n\n \n /**\n * Gets the expanded title as an id by removing parentheses and replacing spaces with underscores.\n * @returns The expanded title.\n */\n public get expandedTitleId(): string {\n return this.title?.split('(')[0]?.split(' ')?.join('_') ;\n }\n\n ngOnDestroy(): void {\n this.collapseSubscription.unsubscribe();\n }\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nexport interface RoomAvaibilityModalData {\n\theaderText: string,\n\tmessage: string,\n\tbuttonLabel: string,\n\tcallback: Function,\n shouldClose: boolean\n}\n\n@Component({\n selector: 'conflict-alert-modal',\n templateUrl: 'conflict-alert-modal.component.html',\n styleUrls: ['./conflict-alert-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConflictAlertModalComponent implements OnInit {\n constructor(public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public dialogData: RoomAvaibilityModalData) {\n }\n ngOnInit(): void {}\n\n public done() {\n this.dialogData?.callback(); this.dialogRef.close()\n }\n}\n","
\n \n
\n\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{dialogData?.headerText}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{dialogData?.message}}
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\t\t \n\t\t\t\n
","import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {DialogEvent} from '@mckinsey-converge/base';\nimport {DateTZ, isToday} from '@mckinsey-converge/date-tz';\n\nexport interface ConflictsModalComponentData {\n room_name: string;\n conflicts: number[];\n copy_conflicts?: boolean;\n timezone: string;\n status?: string;\n}\n\n@Component({\n selector: 'app-conflicts-modal',\n templateUrl: './conflicts-modal.component.html',\n styleUrls: ['./conflicts-modal.component.scss']\n})\nexport class ConflictsModalComponent implements OnInit{\n public room_name: string;\n public conflicts: number[];\n public copy_conflicts: boolean;\n public timezone;\n public status: string;\n\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: ConflictsModalComponentData){\n\n }\n\n public ngOnInit(){\n this.timezone = this._data.timezone;\n this.room_name = this._data.room_name\n this.conflicts = this._data.conflicts\n this.copy_conflicts = this._data.copy_conflicts\n this.status = this._data.status\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone});\n const dateIsToday = isToday(dateTZ, this.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n\n public copy(): void {\n this.event.emit({ reason: 'action' });\n }\n\n\n}\n","
\n \n
\n\n
\n

Conflicts ({{conflicts.length}})

\n
\n The {{room_name}} room is not available on the following dates.\n Do you want to proceed without booking these days?\n
\n
\n The {{room_name}} room is not available on the following dates.\n You need to make individual bookings to cover these days, please.\n
\n
\n
\n
\n Date\n
\n
\n
\n {{formatDate(conflict)}}\n
\n
\n
\n
\n\n \n {{copy_conflicts ? 'Copy to clipboard' : 'Close'}}\n \n \n {{copy_conflicts ? 'Close' : 'Continue'}}\n \n\n","import { Component, OnInit, Inject } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'custom-snackbar',\n templateUrl: './custom-snackbar-component.component.html',\n styleUrls: ['./custom-snackbar-component.component.scss'],\n})\nexport class CustomSnackbarComponent implements OnInit {\n constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any) {\n }\n\n ngOnInit() {}\n\n get getIcon() {\n switch (this.data.snackType) {\n case 'success':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-success.svg',\n };\n case 'error':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-failure.svg',\n };\n case 'warn':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-warning.svg',\n };\n case 'info':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-info.svg',\n };\n default:\n return { type: 'info', iconPath: 'assets/icon/toast-info.svg' };\n }\n }\n\n closeSnackbar() {\n this.data.snackBar.dismiss();\n }\n}\n","
\n
\n
\n \"{{getIcon.type}}\n
\n
\n {{data.message}}\n
\n
\n
\n
close
\n
\n
","import { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { CustomSnackbarComponent } from './custom-snackbar-component.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarService {\n messageText: string[];\n constructor(public snackBar: MatSnackBar) {}\n\n public openSnackBar(\n message,\n type,\n duration?,\n verticalPosition?,\n horizontalPosition?\n ) {\n const _snackType = type !== undefined ? type : 'success';\n this.snackBar.openFromComponent(CustomSnackbarComponent, {\n duration: duration || 4000,\n horizontalPosition: horizontalPosition || 'end',\n verticalPosition: verticalPosition || 'top',\n data: {\n message: message,\n snackType: _snackType,\n snackBar: this.snackBar,\n },\n });\n }\n}\n","import {\n Component,\n OnInit,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n forwardRef,\n EventEmitter,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDateTzPickerOptions {\n /** DateTZ object. First selectable date */\n fromDateTz?: DateTZ;\n /** DateTZ object. Last selectable date */\n untilDateTz?: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: DateTZ;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'date-tz-calendar-widget',\n templateUrl: './date-tz-calendar-widget.component.html',\n styleUrls: ['./date-tz-calendar-widget.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzCalendarWidgetComponent),\n multi: true,\n },\n ],\n})\nexport class DateTzCalendarWidgetComponent\n extends BaseClass\n implements OnInit, OnChanges, ControlValueAccessor\n{\n /** CSS class to add to the root element of the component */\n @Input() public className = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDateTzPickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n\n public readonly weeks = new Array(6).fill(0);\n public selectedDateTz: DateTZ = DateNow();\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private fromTz: DateTZ;\n /** Last selectable date */\n private toTz: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n private _today = DateNow();\n\n public get timezone() {\n return this.selectedDateTz?.building_tz || '';\n }\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.selectedDateTz = item.value;\n if (this._onChange) {\n this._onChange(this.selectedDateTz);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date 2\n */\n public updateDate(): void {\n if (!this.selectedDateTz) {\n return;\n }\n const now = this._today.startOfValue('month');\n const startOfMonthDateTz = this.selectedDateTz.startOfValue('month');\n if (startOfMonthDateTz.valid) {\n const difference = startOfMonthDateTz.dateDiff(\n now,\n 'months',\n 'months'\n );\n if (this.offset !== difference) {\n this.offset = Math.round(difference);\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.fromDateTz) {\n const today = this._today.startOfValue('month');\n this.fromTz = this.options.fromDateTz.startOfValue('day');\n this.min_offset = Math.round(\n this.fromTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months')\n );\n } else if (this.fromTz) {\n this.fromTz = null; // R-- check if ok\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.untilDateTz) {\n const today = this._today.startOfValue('month');\n this.toTz = this.options.untilDateTz.startOfValue('day');\n this.max_offset = this.toTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months');\n } else if (this.toTz) {\n this.toTz = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n this._today = new DateTZ({ date: Date.now(), is_local_tz: !this.timezone, building_tz: this.timezone });\n const startOfMonthDateTz = this._today.addValue({ months: this.offset });\n const active = this.selectedDateTz || DateNow();\n let startDate = startOfMonthDateTz\n .setValue({ day: 1 })\n .setValue({ weekday: 7 })\n .subtractValue({ weeks: 1 });\n this.date_list = [];\n for (let i = 0; i < 42; i++) {\n this.date_list.push({\n value: startDate,\n display: startDate.formatDate('d'),\n active: active.isSameDate(startDate, 'day'),\n non_month: !startOfMonthDateTz.isSameDate(startDate, 'month'),\n count: this.counters\n ? this.counters[startDate.formatDate('yyyy-MM-dd')] || 0\n : 0,\n disabled:\n (this.fromTz ? startDate.ms < this.fromTz.ms : false) ||\n (this.toTz ? startDate.ms > this.toTz.ms : false),\n today: this._today.isSameDate(startDate, 'day'),\n });\n startDate = startDate.addValue({ days: 1 });\n }\n this.month_name = startOfMonthDateTz.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = this._today.startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days: 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n const new_offset = Math.min(\n this.max_offset,\n Math.max(this.min_offset, this.offset + value)\n );\n this.offset = Math.round(new_offset);\n this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const offset = this.offset;\n this.offset = Math.round(\n this._today.dateDiff(this.selectedDateTz, 'months', 'months')\n );\n if (offset !== this.offset) this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: DateTZ) {\n if (value) {\n this.selectedDateTz = value;\n this.updateDate();\n this.generateMonth();\n }\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n}\n","
\n
\n \n
\n \n
{{ month_name }}
\n = max_offset\"\n (click)=\"changeMonth(1)\"\n >\n
\n \n
\n \n \n \n \n \n \n \n \n \n
{{ item }}
\n \n {{ item.display }}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTzCalendarWidgetComponent } from '../date-tz-calendar-widget/date-tz-calendar-widget.component';\n\n@Component({\n selector: 'date-tz-date-picker',\n template: `\n \n {{label}}\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./date-tz-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class DateTzDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n @Input() public label?: string;\n /** Earliest date available the user is allowed to pick */\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n /** Latest date available the user is allowed to pick */\n @Input() public untilDateTz: DateTZ = DateNow(new Date()).endOfValue('day').addValue({ years: 1 });\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n // R-- possible TODO, address all_day that disables this input and displays \"Add Day for the value like the time picker\"\n @Input() public all_day: boolean = false;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public counters: any;\n\n @Input() public initialDateSelectionTz?: DateTZ;\n\n @Output() public onSelect = new EventEmitter();\n\n @Input() public invalid?: boolean;\n\n @Input() public timezone?: string;\n\n @Input() public can_pick_today: boolean = true;\n\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n\n public ngOnInit(): void {\n if (this.initialDateSelectionTz) {\n this.writeValue(this.initialDateSelectionTz)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(DateTzCalendarWidgetComponent, {static: true }) private _acaDatePicker: DateTzCalendarWidgetComponent;\n /** Currently selected date */\n public selectedDateTzValue = new BehaviorSubject(DateNow(new Date()));\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(new DateTZ({ is_local_tz: false, building_tz: d.building_tz }), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n // date\n public get dateTzObservable(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n return d \n }));\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(newValueTz: DateTZ) {\n // Keep hours and minutes of the old date\n const old_date = this.selectedDateTzValue.value;\n let newDateTz = newValueTz.setValue({ hour: old_date.dateHour, minute: old_date.minutes, second: old_date.second });\n\n // Check that new date is before from\n if (newDateTz.ms < this.fromDateTz.ms) {\n newDateTz = this.fromDateTz;\n }\n\n this.selectedDateTzValue.next(newDateTz);\n if (this._onChange) {\n this._onChange(newDateTz);\n }\n\n this.onSelect.emit(newDateTz);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n const building_tz = this.timezone || this.fromDateTz.building_tz\n const is_local_tz = DateNow(new Date()).building_tz === building_tz\n this.setValue(new DateTZ({ is_local_tz, building_tz }));\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(selectedDateTz: DateTZ) {\n this.selectedDateTzValue.next(selectedDateTz);\n this.show_tooltip = false;\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n DurationGroup,\n nearestDurationToInput,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators'; \nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'date-tz-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DateTzDurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input() public label?: string;\n @Input() public required: boolean;\n @Input() max_length?: number;\n\n // /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDateTz: DateTZ;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Whether form all_day is enabled. */\n // R-- need to address all_day that disables this input and displays \"Add Day for the value\"\n @Input() public all_day: boolean = false;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** Component will return a number of minutes */\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDateTz = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDateTz]).pipe(\n \n map(([value, currentStartDate]) => { \n /**\n * convert current start date/time to building time zone first\n * \n */\n const ms = convertTimezonedTimestampToLocalDateTz(currentStartDate.ms, currentStartDate.building_tz).ms;\n return nearestDurationToInput(this.durationGroups, ms, value); \n }\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDateTz.pipe(\n map(d => generateDurationOptionsFromGroups(d, this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDateTz.value, this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDateTz) {\n this.currentStartDateTz.next(changes.startDateTz.currentValue);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n nearestStepToInput,\n timeWithGmtOffsetFormatString,\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n generateAvailableTimes,\n generateAvailableTimesTz,\n} from '../utils/time.utils';\nimport { BehaviorSubject, combineLatest } from 'rxjs';\nimport { filter, map, withLatestFrom } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'date-tz-time-field',\n template: `\n
\n {{\n label\n }}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzTimeFieldComponent),\n multi: true,\n },\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DateTzTimeFieldComponent\n extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor\n{\n @Input() public label?: string;\n @Input() public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the DateTZ object datetime to start time options from **/\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n // Disables this input and displays R--- \"All Day\" for the value\n @Input() public all_day: boolean = false;\n @Input() public show_current: boolean = false;\n @Input() public startFromDateTz: boolean = false;\n\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n /** DateTZ object representing the currently set datetime */\n public selectedDateTz = new BehaviorSubject(\n closestToTimeSlotTz(DateNow(new Date()), this.step)\n );\n\n /** string representing the currently set datetime display value, needed for the input to display the slected value */\n public selectedTimeString = new BehaviorSubject(\n timeWithGmtOffsetFormatString(this.selectedDateTz.value)\n );\n\n public filterFormControl: FormControl = new FormControl();\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(\n generateAvailableTimesTz(\n DateNow(),\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(DateNow())]\n : [],\n this.startFromDateTz\n )\n );\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // Subscribe to selected option changes\n this.subscription(\n 'dateTimeChanges',\n combineLatest([this.selectedDateTz])\n .pipe(\n map(([selectedDateTz]) => {\n /**\n * The selectedDateTz should already be pegged to the closest time slot, but\n * if the selected time rolls into the past this can correct it. // R--- verify this statement\n */\n return closestToTimeSlotTz(selectedDateTz, this.step);\n }),\n withLatestFrom(this.options),\n filter(\n ([date, timeOptions]: [\n DateTZ,\n SelectOption[]\n ]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(\n (t) => t.value === date.formatDate('HH:mm')\n );\n }\n ),\n map(([dateTz, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz,\n });\n\n // Sort the time options\n timeOptions.sort((a, b) =>\n `${a.value}`.localeCompare(`${b.value}`)\n );\n return timeOptions;\n })\n )\n .subscribe((next) => {\n return this.options.next(next);\n })\n );\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (\n changes.no_past_times ||\n changes.step ||\n changes.fromDateTz ||\n changes.all_day\n ) {\n // If there's a new date value then update the time options\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // If today and all day goes from on to off the selected value isn't going to be available.\n if (\n changes.all_day &&\n !changes.all_day.currentValue &&\n changes.all_day.previousValue\n ) {\n this.setValue(this.options.value[0].display);\n }\n }\n }\n\n /**\n * Getter if the time picker options are visiable or not\n */\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n /**\n * Getter to return the current form timestamp from the from date object\n */\n public get timezone(): string {\n return this.fromDateTz.building_tz;\n }\n\n /**\n * A filter for finding a matching value when using the input text search\n */\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.selectedDateTz,\n ]).pipe(\n map(([value, selectedDateTz]) => {\n return nearestStepToInput(\n this.step,\n value,\n DateTime.now().valueOf()\n );\n })\n );\n\n /**\n * Default text displayed in the search field when the component initializes\n */\n public placeHolderOption = this.options.pipe(\n map((os) => os.length > 0 && os[0])\n );\n\n /**\n * Returns the selected option object by matching the selectedDateTz formated string with the option.display string\n */\n public selectedOption = combineLatest([\n this.options,\n this.selectedDateTz,\n ]).pipe(\n map(([options, selectedDateTz]) =>\n options.find(\n (o) =>\n o.display === timeWithGmtOffsetFormatString(selectedDateTz)\n )\n )\n );\n\n /**\n * Determines the visually selected value when the options list is visible.\n *\n * @param option DateTZ\n * @returns boolean\n */\n public isSelected(option: SelectOption) {\n return this.selectedTimeString.value === option.display;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: DateTZ) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: DateTZ) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Method just used in unit tests to test disabling the input\n * @param disabled\n */\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Update the selected values\n * @param dateTz the DateTz object for the new time\n */\n public setSelectedValues(dateTz: DateTZ) {\n // Update the selected DateTz and string representations\n this.selectedTimeString.next(timeWithGmtOffsetFormatString(dateTz));\n this.selectedDateTz.next(dateTz);\n if (this._onChange) {\n this._onChange(dateTz);\n }\n }\n\n /**\n * Update the form field value\n * @param displayString The \"display\" value of this.options set by the time picker\n */\n public setValue(displayString: string): void {\n // Convert the display time string to the actual option object via an array find.\n const newTimeTz = this.options.value.find(\n (opt) => opt.display === displayString\n ).value;\n // Update the selected DateTz and string representations\n this.setSelectedValues(newTimeTz);\n // Send the\n if (newTimeTz) {\n if (this._onChange) {\n this._onChange(newTimeTz);\n }\n }\n }\n\n /**\n * Fires when the form control value is changed\n * @param dateTz The new value for the component\n */\n public writeValue(dateTz: DateTZ | null) {\n // Init is null ?\n if (dateTz != null) {\n // Update the selected DateTz and string representations\n this.setSelectedValues(dateTz);\n // Update the available options\n this.options.next(\n generateAvailableTimesTz(\n dateTz,\n !this.noPastTimes,\n this.step,\n dateTz.building_tz,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(dateTz)]\n : [],\n this.startFromDateTz\n )\n );\n }\n }\n}\n\nfunction generateOptionForDateTz(dateTz: DateTZ): SelectOption {\n return {\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n nearestDurationToInput,\n DurationGroup,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map\n} from 'rxjs/operators';\nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'mck-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n @Input() max_length?: number;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDate: number;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDate = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDate]).pipe(\n map(([value, currentStartDate]) => nearestDurationToInput(this.durationGroups, currentStartDate.ms, value)\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDate.pipe(\n map(d => generateDurationOptionsFromGroups(d.toZone(this.timezone), this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDate.value.toZone(this.timezone), this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDate) {\n // R--- refactor input param\n const date = new DateTZ({date: this.startDate})\n this.currentStartDate.next(date);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'mck-error-message',\n template: `\n
\n
\n
\n \n \n \n
\n
\n `,\n styleUrls: ['./error-message.component.scss']\n})\nexport class ErrorMessageComponent {\n\n constructor() {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-calendar-icon',\n template: `\n \n \n \n \n \n `,\n})\nexport class CalendarIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-chevron-icon',\n template: `\n \n \n
\n \n \n \n
\n
\n \n
\n `\n})\nexport class ChevronIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n @Input()\n up?: boolean;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit\n} from '@angular/core';\n\n@Component({\n selector: 'mck-close-icon',\n template: `\n \n \n \n \n `\n})\nexport class CloseIconComponent implements OnInit {\n\n @Input()\n fillClass?: string;\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component(\n {\n selector: 'mck-informational-image',\n template: `\n \n
\n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./informational-image.component.scss'],\n encapsulation: ViewEncapsulation.None\n }\n)\nexport class InformationalImageComponent extends BaseTemplateComponent {\n\n @Input()\n public src: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-label',\n template: `\n \n \n \n *\n \n \n `,\n styleUrls: ['./label.component.scss']\n})\nexport class LabelComponent extends BaseTemplateComponent implements OnInit {\n\n @Input()\n required = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { MatSelect } from '@angular/material/select';\nimport { SelectOption } from '../options/select-option';\n\n@Component({\n selector: 'mck-legend-dropdown',\n template: `\n
\n \n \n \n \n
\n \n \n \n {{ buildPlaceholder() }}\n \n
\n \n
\n \n
\n `,\n styleUrls: ['./legend-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class LegendDropdownComponent {\n\n @Input()\n public placeholder: string;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public placeholderOpen?: string\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public buildPlaceholder(){\n return this.isOpen && this.placeholderOpen ? this.placeholderOpen : this.placeholder\n }\n}\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { AcaDatePickerComponent } from '../aca-date-picker/aca-date-picker.component';\n\n@Component({\n selector: 'mck-date-picker',\n template: `\n \n Date\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./mck-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MckDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class MckDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public initialDateSelection?: number;\n\n @Input() public invalid?: boolean;\n\n @Output() public onSelect = new EventEmitter();\n\n // R--- or is this the date picker to refactor. too tired.\n public ngOnInit(): void {\n if (this.initialDateSelection) {\n this.writeValue(this.initialDateSelection)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(AcaDatePickerComponent, {static: true }) private _acaDatePicker: AcaDatePickerComponent;\n\n /** Currently selected date */\n public dateValue = new BehaviorSubject(DateNow(new Date()));\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.dateValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public get date(): Observable {\n return this.dateValue;\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = this.dateValue.value;\n const d = new DateTZ({date: new_value})\n let new_date = d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n const new_d = new DateTZ({ date: new_date })\n this.dateValue.next(new_d);\n if (this._onChange) {\n this._onChange(new_date);\n }\n this.onSelect.emit(new_date);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n this.setValue(DateNow(new Date()).ms);\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n const date = new DateTZ({date: value})\n this.dateValue.next(date);\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-modal-button-row',\n template: `\n \n \n \n \n
\n \n {{secondaryLabel}}\n \n \n {{primaryLabel}}\n\n \n
\n \n
\n `,\n styleUrls: ['./modal-button-row.component.scss']\n})\nexport class ModalButtonRowComponent extends BaseTemplateComponent {\n\n @Input()\n primaryLabel?: string;\n\n /**\n * Specify if you want to disable the primary button\n */\n @Input()\n primaryDisabled?: boolean = false;\n\n /**\n * Used only if primaryLabel is specified.\n */\n @Output()\n public primarySubmit = new EventEmitter();\n\n /**\n * Specify if you want to show a secondary label button\n */\n @Input()\n secondaryLabel?: string;\n\n @Input()\n disableFixed: boolean = false;\n\n /**\n * Specify if you want to disable the secondary button\n */\n @Input()\n secondaryDisabled?: boolean = false;\n\n /**\n * Used only if secondaryLabel is specified.\n */\n @Output()\n public secondarySubmit = new EventEmitter();\n\n @Input()\n smallButtons?: boolean = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-modal',\n template: `\n \n
\n
\n \n
\n
\n

{{header}}

\n
\n
\n \n
\n `,\n styleUrls: ['./modal.component.scss']\n})\nexport class ModalComponent {\n\n @Input()\n header?: string;\n @Input() shouldClose?: boolean = true;\n\n constructor(private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n}\n","import { Component, EventEmitter, Inject, OnInit, Output } from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\nimport { DateTZ, isToday } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'override-changes-modal',\n templateUrl: './override-changes-modal.component.html',\n styleUrls: ['./override-changes-modal.component.scss']\n})\nexport class OverrideChangesModalComponent implements OnInit{\n\n public edits;\n public timezone;\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: OverrideChangesModalComponent){\n\n }\n\n public ngOnInit(){\n // this.edits = this._data.edits.sort((a, b) => a - b);\n\n // Function to convert epoch to 'YYYY-MM-DD' format\n const getDateString = (epoch) => {\n return new Date(epoch * 1000).toISOString().split('T')[0];\n };\n\n // Set to store unique date strings\n const uniqueDates = new Set();\n\n // Filter the edits array\n const filteredEdits = this._data.edits.filter(epoch => {\n const dateString = getDateString(epoch);\n if (!uniqueDates.has(dateString)) {\n uniqueDates.add(dateString);\n return true;\n }\n return false;\n });\n\n this.edits = filteredEdits;\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone });\n const dateIsToday = isToday(dateTZ, this._data.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n}","
\n \n \n
\n\n \n \n \n\n

Overriding Changes

\n

Editing the series here will override all previous changes made to individual occurrences. Are you sure you want to proceed?

\n\n \n \n \n \n \n \n \n \n \n \n \n
Dates
{{formatDate(edit)}}
\n
\n\n\n \n \n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\n\n/**\n * Transforms input by returning a subset of items based on if the\n * any items include the search text based on passed objectKey.\n *\n * objectKey can be pipe separated keys. e.g: 'name|age'. Then it will check against all.\n */\n@Pipe({\n name: 'filter'\n})\nexport class FilterPipe implements PipeTransform {\n transform(items: any[], searchText: string, objectKey?: string): any[] {\n if (!items) return [];\n if (!searchText) return items;\n searchText = searchText.toLowerCase();\n const splitKeys = objectKey?.split('|') ?? [];\n return items.filter(it => {\n let included = false;\n splitKeys.forEach((key) => {\n if (it[key]?.toLowerCase().includes(searchText)) {\n included = true;\n }\n });\n if (splitKeys.length === 0) {\n return it.toLowerCase().includes(searchText);\n }\n return included;\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport {\n DomSanitizer,\n SafeHtml,\n SafeResourceUrl,\n SafeScript,\n SafeStyle,\n} from '@angular/platform-browser';\n\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n@Pipe({\n name: 'sanitize',\n})\nexport class SanitizePipe implements PipeTransform {\n constructor(private sanitizer: DomSanitizer) {}\n\n transform(\n value: string,\n type: 'resource' | 'url' | 'script' | 'style' | 'html' = 'html'\n ): SafeHtml | SafeResourceUrl | SafeScript | SafeStyle {\n switch (type) {\n case 'resource':\n return (\n this.sanitizer.sanitize(\n SecurityContext.RESOURCE_URL,\n value\n ) || ''\n );\n case 'url':\n return (\n this.sanitizer.sanitize(SecurityContext.URL, value) || ''\n );\n case 'script':\n return (\n this.sanitizer.sanitize(SecurityContext.SCRIPT, value) || ''\n );\n case 'style':\n return (\n this.sanitizer.sanitize(SecurityContext.STYLE, value) || ''\n );\n }\n return this.sanitizer.sanitize(SecurityContext.HTML, value) || '';\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { SelectOption } from '../types';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'mck-radio-select',\n template: `\n \n
\n {{label}}\n \n {{option.display}}\n \n
\n
\n `,\n styleUrls: ['./radio-select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioSelectComponent),\n multi: true\n }\n ]\n})\nexport class RadioSelectComponent extends BaseTemplateComponent implements OnInit, ControlValueAccessor {\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n options: SelectOption[];\n\n public value = new BehaviorSubject | undefined>(undefined);\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public setValue(value: string) {\n const obj = this.options.find(o => o.value === value);\n this.writeValue(obj);\n if (this._onChange) {\n this._onChange(obj)\n }\n }\n\n writeValue(obj: SelectOption): void {\n this.value.next(obj);\n }\n}\n","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { OrganisationService, RecurrencePeriod, RecurrenceType, removeExpiredOcurrences, RepeatsOn } from \"@mckinsey-converge/data-common\";\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { first } from \"rxjs/operators\";\nimport { RecurrencePatternForm } from \"../recurrence-pattern-form/recurrence-pattern-form.component\";\n\n@Component({\n selector: 'recurrence-booking-form',\n templateUrl: './recurrence-booking-form.component.html',\n styleUrls: ['./recurrence-booking-form.component.scss']\n})\n\nexport class RecurringBookingForm implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n\n public current_type: RecurrenceType; \n public recurrence_types: Array = [\n {type: RepeatsOn.PATTERN, label: 'Repeats on'},\n {type: RepeatsOn.DATE, label: 'Repeats on specific date'}\n ]\n\n public building_tz = \"\";\n\n @ViewChild(RecurrencePatternForm) pattern_form: RecurrencePatternForm;\n\n constructor(\n private _org: OrganisationService,\n ) {}\n\n public get recurrencePeriod(){\n return this.form.get('recurrence_period')\n }\n\n public ngOnInit(): void {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.building_tz = this._org?.building?.timezone || 'America/Chicago';\n })\n if(this.recurrencePeriod.value === RecurrencePeriod.LIST){\n this.current_type = this.recurrence_types[1];\n removeExpiredOcurrences(this.form)\n }else{\n this.current_type = this.recurrence_types[0];\n }\n }\n\n public onChangeType(value: string) {\n this.current_type = this.recurrence_types.filter((type) => type.type === value)[0]\n if(this.current_type.type === RepeatsOn.PATTERN){\n this.recurrencePeriod.setValue(this.pattern_form.recurrencePatternFormControl.value)\n }else{\n this.recurrencePeriod.setValue(RecurrencePeriod.LIST)\n }\n }\n\n public dateToBuildingTz(date?: number){\n return new DateTZ({date, building_tz: this.building_tz, is_local_tz: false})\n }\n\n public get error(){\n const recurrence_starts = this.form.controls.recurrence_starts\n const recurrence_days = this.form.controls.recurrence_days\n return recurrence_starts.invalid || recurrence_days.invalid\n }\n\n}\n","
\n \n
\n \n \n {{recurrence_types[0].label}}\n \n \n \n
\n
\n \n \n {{recurrence_types[1].label}}\n \n \n \n
\n
\n
\nThe recurrence pattern is not valid.","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { MatMenuTrigger } from \"@angular/material/menu\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { OrganisationService } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ,toMiddayUTC } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-date-form',\n templateUrl: './recurrence-date-form.component.html',\n styleUrls: ['./recurrence-date-form.component.scss']\n})\n\nexport class RecurrenceDateForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n public selected_dates: Array = []\n public timezone: string = '';\n public nowTz: DateTZ = DateNow(new Date());\n public fromDateTz: DateTZ = this.nowTz.clone();\n public untilDateTz: DateTZ = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n public dateTz: DateTZ = DateNow(new Date());\n\n public get recurrenceStarts(){\n return this.form.get('recurrence_starts');\n }\n\n public get formDateTz(){\n return this.form.get('dateTz');\n }\n\n constructor (private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The fromDateTz is curious, would it make sense to be based on the form dateTz?\n this.fromDateTz = this.nowTz.clone()\n this.untilDateTz = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n\n if(this.recurrenceStarts.value){\n const tempForSort = [...this.recurrenceStarts.value]; // due to cannot assign to read only property '0' of object '[object Array]'\n this.selected_dates = tempForSort.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n this.subscription('ocurrenceChanges', this.recurrenceStarts.valueChanges\n .subscribe(() => {\n this.selected_dates = [...this.recurrenceStarts.value]\n })\n ); \n }\n\n /**\n * Add value to the list of selected dates\n * @param newDateTz\n */\n public addDate(newDateTz: DateTZ) {\n const d = newDateTz.clone();\n const start_date = this.formDateTz.value;\n let new_date = d.setValue({hour: start_date.dateHour, minute: start_date.minutes})\n \n /** Prevent user from selecting past dates */\n if (new_date.isBeforeDate(this.fromDateTz)) {\n new_date = this.fromDateTz;\n }\n\n /** Prevent user from selecting the same date more than once */\n const is_selected = this.selected_dates.filter((date: DateTZ)=> new_date.isSameDate(date, 'day'))\n if(is_selected.length){\n return\n }\n \n this.selected_dates.push(new_date);\n this.recurrenceStarts.setValue(this.selected_dates.sort((d1, d2) => d1.ms - d2.ms));\n this.setDateTzForm();\n }\n\n /**\n * \n * @param dateMsValue: number\n * @returns \n */\n public setPickerToGivenDate(dateTsValue: DateTZ) {\n this.fromDateTz = dateTsValue.clone();\n }\n\n /**\n * Function calls on close of date picker without date selection\n */\n public onDatePickerClose = () => {\n this.setPickerToGivenDate(this.nowTz)\n };\n\n public goToToday() {\n this.addDate(this.nowTz);\n this.setPickerToGivenDate(this.nowTz);\n }\n\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n public openDatePicker() {\n this._trigger.openMenu();\n }\n\n public deleteDate(date: DateTZ) {\n const index = this.selected_dates.map((d: DateTZ) => d.ms).indexOf(date.ms)\n this.selected_dates.splice(index, 1)\n this.recurrenceStarts.setValue(this.selected_dates)\n this.setDateTzForm()\n }\n\n public isToday(date) {\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: this.timezone,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone,\n }),\n 'day'\n );\n }\n\n public formatDate(date: DateTZ){\n const isToday = this.isToday(date);\n const display = date.formatDate('ccc dd MMM yyyy');\n\n return `${display}${isToday ? ' (Today)' : ''}`;\n }\n\n private setDateTzForm(): void {\n if (this.selected_dates.length === 0)\n return;\n\n const tz = this._org.building.timezone;\n const date_now = DateNow(new Date()).toZone(tz);\n let dateTz = this.selected_dates[0].clone();\n\n dateTz = dateTz.setValue({\n hour: (this.formDateTz.value as DateTZ).hours,\n minute: (this.formDateTz.value as DateTZ).minutes\n });\n\n if (this.selected_dates[0].isSameDate(this.nowTz, \"day\") && dateTz.hours < date_now.hours) {\n const { minutes: minute, hours: hour } = closestToTimeSlotTz(this.nowTz, 15);\n dateTz = dateTz.setValue({ minute, hour, second: 0 });\n }\n\n this.formDateTz.setValue(dateTz);\n }\n}\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
DateAction
{{formatDate(date)}}Delete
\n
[+] Add another date
\n \n
\n \n Today\n \n
\n
\n
\n
","import { Component, Input, OnInit } from \"@angular/core\";\nimport { FormGroup, Validators } from \"@angular/forms\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { arrayWithValues, generateWeekDays, RecurrencePeriod, recurrencePeriodToDurationType, RepeatPeriod, validDateTZ, WeekDays } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-pattern-form',\n templateUrl: './recurrence-pattern-form.component.html',\n styleUrls: ['./recurrence-pattern-form.component.scss']\n})\n\nexport class RecurrencePatternForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n\n /** Range of dates for the Start Date Picker*/\n public nowTz: DateTZ = DateNow(new Date());\n public fromStartTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n public untilTz: DateTZ = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n public timezone: string = '';\n \n\n /** Range of dates for the End Date Picker*/\n public fromEndTz: DateTZ;\n\n public repeat_period_options: Array = [\n {label: 'Day', id: RecurrencePeriod.DAILY},\n {label: 'Week',id: RecurrencePeriod.WEEKLY},\n {label: 'Month', id: RecurrencePeriod.ABSOLUTE_MONTHLY}\n ]\n public week_days: Array = []\n\n public repeat_every_options\n\n\n public get recurrenceDateStartTzFormControl() {\n return this.form.get('dateTz')\n }\n\n public get recurrenceEndFormControl(){\n return this.form.get('recurrence_endTz')\n }\n\n public get recurrencePeriodFormControl(){\n return this.form.get('recurrence_period')\n }\n\n public get recurrenceIntervalFormControl(){\n return this.form.get('recurrence_interval')\n }\n\n public get recurrencePatternFormControl(){\n return this.form.get('recurrence_pattern')\n }\n\n public get recurrenceDaysFormControl(){\n return this.form.get('recurrence_days')\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The from date is curious, why isn't it based on the form dateTz?\n this.repeat_every_options = new Array(1)\n this.fromStartTz = closestToTimeSlotTz(this.nowTz, 15)\n this.untilTz = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n this.fromEndTz = this.fromStartTz.addValue({days: 1})\n\n this.setEndDateFromStartDate(this.recurrenceDateStartTzFormControl.value) //make sure end date is after start date\n\n if(!this.recurrencePeriodFormControl.value){\n this.recurrencePeriodFormControl.setValue(RecurrencePeriod.WEEKLY)\n }\n\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.recurrencePatternFormControl.setValue(this.recurrencePeriodFormControl.value)\n }\n\n this.week_days = generateWeekDays(this.recurrenceDateStartTzFormControl.value.ms, { building_tz: this.fromStartTz.building_tz })\n this.generateMaxIntervals()\n\n if(this.recurrenceDaysFormControl.value.length > 0){\n this.week_days = this.week_days.map((day) => \n ({...day, active: this.recurrenceDaysFormControl.value.includes(day.full_name)})\n )\n }\n\n if(!this.recurrenceDaysFormControl.value.length && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n const current_days = this.week_days.filter((day) => day.active).map((day)=>day.full_name)\n this.recurrenceDaysFormControl.setValue(current_days)\n }\n\n this.generateOcurrenceList()\n\n this.subscription('startTimeChanges', this.recurrenceDateStartTzFormControl.valueChanges\n .subscribe((next) => {\n this.setEndDateFromStartDate(next) \n })\n );\n\n this.subscription('endTimeChanges', this.recurrenceEndFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n );\n \n this.subscription('recurrencePeriodFormControlChanges', this.recurrencePeriodFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n ); \n }\n\n public setEndDateFromStartDate(startDateTz: DateTZ){\n let end_date = this.recurrenceEndFormControl.value.setValue({hour: startDateTz.dateHour, minute: startDateTz.minutes})\n\n /**Update the End date picker range */\n this.fromEndTz = startDateTz.isSameDate(this.untilTz,'day') ? startDateTz : startDateTz.addValue({days: 1})\n\n if(end_date.isBeforeDate(this.fromEndTz)){\n end_date = this.fromEndTz\n }\n\n this.recurrenceEndFormControl.setValue(end_date)\n\n this.generateMaxIntervals()\n this.updateActiveWeekday() \n }\n\n public setRepeatPeriod(value: RecurrencePeriod){\n this.updateValidators(value)\n this.recurrencePeriodFormControl.setValue(value);\n this.recurrencePatternFormControl.setValue(value);\n this.recurrenceIntervalFormControl.setValue(1)\n this.generateOcurrenceList();\n }\n\n public setRepeatEvery(value: number){\n this.recurrenceIntervalFormControl.setValue(value)\n this.generateOcurrenceList()\n }\n\n public repeatTimeString(value: string){\n return this.recurrenceIntervalFormControl.value !== 1 ? `${value}(s)` : value\n }\n\n public get displayWeekdays(){\n return this.recurrencePatternFormControl.value === RecurrencePeriod.WEEKLY\n }\n\n /* Check if selected interval is valid and reset to 1 if not*/\n private validateRecurrenceInterval = () => {\n if(this.repeat_every_options.length < this.recurrenceIntervalFormControl.value){\n this.recurrenceIntervalFormControl.setValue(1)\n } \n };\n\n /**\n * Generate max value for dorpdown interval\n */\n public generateMaxIntervals(){\n const start = this.recurrenceDateStartTzFormControl.value;\n const date_diff = this.recurrenceEndFormControl.value.dateDiff(start, this.periodToDurationType, this.periodToDurationType)\n //If no diff default to 1\n this.repeat_every_options = new Array(Math.round(date_diff) || 1)\n this.validateRecurrenceInterval();\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.generateOcurrenceList()\n }\n }\n\n /**\n * Generate ocurrence list base on the selected interval\n */\n public generateOcurrenceList() {\n\n /**If selected period is list then we don't want \n * to generate a list based on the repeats on selections*/\n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.LIST){\n return\n }\n\n const occurrence = []\n const first_date = this.recurrenceDateStartTzFormControl.value;\n let start = first_date\n const end = this.recurrenceEndFormControl.value;\n const interval = this.recurrenceIntervalFormControl.value\n const recurr_days = this.week_days.filter(day => day.active)\n /**\n * isLastDayOfMonth : Boolean\n * flag - to generate last day of every month in case of day or month reccuring booking if start date is last day of month\n */\n // const isLastDayOfMonth = first_date.date.day === first_date.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY;\n const isLastDayOfMonth = first_date.dateDay === 31 && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY ;\n \n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n start = start.startOfValue('week')\n }\n\n while (end.dateDiff(start.startOfValue('day'), this.periodToDurationType, this.periodToDurationType) >= 0) {\n \n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n occurrence.push(start) \n start = start.addValue({[this.periodToDurationType]: interval}, isLastDayOfMonth);\n /**\n * IF - should only consider resetting start under mentioned condition of ticket - https://acaprojects.atlassian.net/browse/MCK-2085\n * In summery - If user select any date except 31st, other months in the series (no matter 30 or 31 day month) should have same date select as start date.\n * If user select 31st as an start date, other month in the seleries should have select last day of the month (30th/31st/28th/29th).\n * Exception for February - February should select 28th or 29th If in above both selection includes date between 28th - 31st.\n * \n */\n if(start.dateDay !== first_date.dateDay && start.dateDay !== start.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY) {\n start = start.setValue({day: first_date.dateDay});\n } \n }else {\n recurr_days.forEach((day)=>{\n const date = start.addValue({days: day.day_index})\n if((date.isAfterDate(first_date) || date.isSameDate(first_date, 'day')) && \n (date.isBeforeDate(end) || date.isSameDate(end, 'day'))){\n occurrence.push(date)\n }\n })\n start = start.addValue({[this.periodToDurationType]: interval})\n }\n }\n\n this.form.controls.recurrence_count.setValue(occurrence.length)\n this.form.controls.recurrence_starts.setValue(occurrence.sort((d1, d2) => d1.ms - d2.ms))\n \n }\n\n public get periodToDurationType(){\n const period = this.recurrencePeriodFormControl.value\n return recurrencePeriodToDurationType(period)\n }\n\n /**\n * Update active weekday in the weekdays array\n */\n private updateActiveWeekday() {\n const _week_days = this.week_days.map((day)=>{\n if(this.recurrenceDaysFormControl.value.includes(day.full_name)){\n return {...day, active: true}\n }else{\n return {...day, active: false}\n }\n })\n this.week_days = [..._week_days] \n }\n\n public setWeekDays(new_day: WeekDays){\n const days = this.recurrenceDaysFormControl.value\n if(this.disabled){\n return\n }\n\n if(!new_day.active){\n days.push(new_day.full_name)\n }else{\n const current_index = days.indexOf(new_day.full_name)\n days.splice(current_index,1)\n }\n this.recurrenceDaysFormControl.setValue([...days])\n this.updateActiveWeekday()\n this.generateOcurrenceList()\n }\n\n /**Update the recurrence days validator if period changes */\n public updateValidators(value: RecurrencePeriod){\n if(value === RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n this.recurrenceDaysFormControl.setValidators(arrayValidators);\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }else if(value !== RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n this.recurrenceDaysFormControl.clearValidators();\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }\n }\n}\n","
\n
\n \n \n \n Date and time must be in the future\n
\n
\n \n \n \n Date and time must be in the future\n
\n
\n
\n \n
\n \n \n \n {{ i + 1}}\n \n \n \n \n \n \n {{ repeatTimeString(option.label) }}\n \n \n \n
\n
\n
\n \n
\n
\n {{day.id}}\n
\n
\n
\n
\n
","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { SelectOption } from '../types';\n\n@Component({\n selector: 'mck-select-option',\n template: `\n \n \n \n \n {{ option.display }}\n \n \n `,\n styleUrls: ['./select-option.component.css']\n})\nexport class SelectOptionComponent extends BaseTemplateComponent {\n\n @Input()\n option: SelectOption;\n\n @Input()\n selected: boolean;\n\n /**\n * If true, we still display as if it wasn't disabled.\n */\n @Input()\n ignoreDisabled = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators';\nimport { MatSelect } from '@angular/material/select';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\n@Component({\n selector: 'mck-select',\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class SelectComponent implements OnInit, OnChanges, ControlValueAccessor {\n\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n /**\n * When true, can filter by searching on the input.\n */\n @Input()\n public searchEnabled = false;\n\n @Input()\n public splitDisplay = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Input()\n public showDivider: boolean = false\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n public filterFormControl: FormControl = new FormControl();\n\n public value = new BehaviorSubject(this.selectedValue || this.options[0]?.value);\n\n /** Available time blocks for the selected date */\n public _options = new BehaviorSubject[]>(this.options);\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public selectedOption = combineLatest([this._options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this._options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n\n constructor() {\n }\n\n public ngOnInit(): void {\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this._options.next(this.options);\n this.value.next(this.selectedValue || this.options?.[0]?.value);\n }\n if (changes.selectedValue) {\n this.value.next(this.selectedValue?.value);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n}\n","
\n {{label}}\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\n@Component({\n selector: 'mck-selected-chip-count',\n template: `\n \n {{count}}\n \n \n `,\n styleUrls: ['./selected-chip-count.component.scss']\n})\nexport class SelectedChipCountComponent {\n\n @Input()\n count: number;\n\n @Output()\n close = new EventEmitter();\n\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\nexport enum SpacerMode {\n /**\n * If vertical, it expands in the vertical direction. Size is width.\n */\n Vertical = 'vertical',\n /**\n * If horizontal, it expands in the horizontal direction. Size is height.\n */\n Horizontal = 'horizontal',\n}\n\n@Component({\n selector: 'mck-spacer',\n template: `\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./spacer.component.css'],\n})\nexport class SpacerComponent extends BaseTemplateComponent implements OnInit {\n SpacerMode = SpacerMode;\n\n @Input()\n size: string;\n\n @Input()\n mode: SpacerMode = SpacerMode.Horizontal;\n\n @Input()\n autoSize?: boolean;\n\n @Input()\n spacerClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-switch-group',\n template: `\n
\n {{title}}\n {{option.display}}\n
\n `,\n styleUrls: ['./switch-group.component.scss']\n})\nexport class SwitchGroupComponent implements OnInit {\n\n @Input()\n title: string;\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selectedOptions: SelectOption[] = [];\n\n @Output()\n optionChecked = new EventEmitter>();\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n public onCheckedChange(option: SelectOption) {\n this.optionChecked.emit(option);\n }\n\n public isSelected(option: SelectOption) {\n return !!this.selectedOptions.find(s => s.value === option.value);\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlot,\n nearestStepToInput,\n timeWithGmtOffsetFormatString\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { generateAvailableTimes } from '../utils/time.utils';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport {\n filter,\n map,\n withLatestFrom\n} from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'mck-time-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n `,\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the date from start **/\n @Input() public from: number;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n // R-- Which time field is going to be used, there's too many\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** String representing the currently set date */\n public date = new BehaviorSubject(DateNow(new Date()).ms);\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.date]).pipe(\n map(([value, date]) => nearestStepToInput(this.step, value, DateTime.now().valueOf()))\n );\n\n /** String representing the currently set time */\n public value = new BehaviorSubject(closestToTimeSlot(DateTime.now(), this.step).toFormat('HH:mm'));\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(generateAvailableTimes(DateNow(new Date()).ms, !this.noPastTimes, this.step, this.timezone));\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this.options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n\n // Subscribe to selected option changes\n this.subscription('dateTimeChanges',\n combineLatest([\n this.date\n ]).pipe(\n map(([date]) => {\n // R--- The time input needing to be TZ aware.\n const closestTimeSlot = closestToTimeSlot(DateTime.fromMillis(date.valueOf()), this.step);\n // Need to return the date with building timezone or the HH:mm representation will no match the option values\n return new DateTZ({date: closestTimeSlot.valueOf(), is_local_tz:false, building_tz: this.timezone});\n }),\n withLatestFrom(this.options),\n filter(([date, timeOptions]: [DateTZ, SelectOption[]]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(t => t.value === date.formatDate('HH:mm'));\n }),\n map(([date, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(date),\n value: date.formatDate('HH:mm')\n });\n // Sort the time options\n timeOptions.sort((a, b) => `${a.value}`.localeCompare(`${b.value}`));\n return timeOptions;\n })\n ).subscribe(next => this.options.next(next)));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step || changes.timezone) {\n // If there's a new date value then update the time options\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n const buildingDate = new DateTZ({date: this.from, is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.value.next(buildingDate.formatDate('HH:mm'));\n }\n if (changes.from) {\n // When the from input param changes update the date value\n this.date.next(this.from);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n // value comes in as a HH:mm string\n const newTime = (new_value.indexOf(':') > 0 ? new_value : '00:00').split(':');\n // need the date with the building timezone so the hour set is relative to there and not local.\n const d = new DateTZ({ date: this.date.value, is_local_tz: false, building_tz: this.timezone });\n const date = d.setValue({ hour: parseInt(newTime[0]), minute: parseInt(newTime[1]) });\n if (date) {\n if (this._onChange) {\n this._onChange(date.ms);\n }\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number | null) {\n if (value != null) {\n // Time input value in building time milliseconds\n this.date.next(value);\n // Get the closest time to slot in case the browser was idle and elapse the valid times\n const date = closestToTimeSlot(DateTime.fromMillis(value).startOf('minute'), this.step);\n // Need the building time so HH:mm is correct\n const buildingDate = new DateTZ({date: date.valueOf(), is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.options.next(generateAvailableTimes(buildingDate.ms, !this.noPastTimes, this.step, this.timezone));\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-toggle',\n template: `\n
\n \n
\n `,\n styleUrls: ['./toggle.component.scss']\n})\nexport class ToggleComponent {\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selected: SelectOption;\n\n @Output()\n selectedChange = new EventEmitter>();\n\n public onTapOption(option: SelectOption) {\n this.selectedChange.emit(option);\n }\n\n isSelected(option: SelectOption) {\n return this.selected === option;\n }\n}\n","import { Component, Input } from '@angular/core';\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Component({\n selector: 'app-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss']\n})\nexport class TooltipComponent {\n isVisible: boolean = false; // To control the visibility of the tooltip\n position: TooltipPosition = TooltipPosition.DEFAULT;\n theme: TooltipTheme = TooltipTheme.DEFAULT;\n tooltip = '';\n left = 0;\n top = 0;\n visible = false;\n}","
\n
\n
\n {{string}}\n
\n
\n
","import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n HostListener,\n Injector,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport {TooltipComponent} from \"./tooltip.component\";\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Directive({\n selector: '[tooltip]'\n})\nexport class TooltipDirective {\n\n @Input() tooltip = '';\n @Input() position: TooltipPosition = TooltipPosition.DEFAULT;\n @Input() theme: TooltipTheme = TooltipTheme.DEFAULT;\n @Input() trigger: ('hover' | 'click' | 'touch')[] = ['hover']; // Now an array of trigger types\n @Input() showDelay = 0;\n @Input() hideDelay = 0;\n @Input() show: boolean = true;\n\n private componentRef: ComponentRef | null = null;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n\n constructor(\n private elementRef: ElementRef, \n private appRef: ApplicationRef,\n private componentFactoryResolver: ComponentFactoryResolver, \n private injector: Injector) {\n }\n\n // Helper function to check if the tirgger type is present \n private hasTrigger(triggerType: 'hover' | 'click' | 'touch'): boolean {\n return this.trigger.includes(triggerType);\n }\n\n //Mouse and hover events\n @HostListener('mouseenter')\n onMouseEnter(): void {\n if (this.hasTrigger('hover') ) {\n this.initializeTooltip();\n }\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n if (this.hasTrigger('hover') ) {\n this.setHideTooltipTimeout();\n }\n }\n\n // Click event\n @HostListener('click')\n onClick(): void {\n if (this.hasTrigger('click') ) {\n if (this.componentRef === null) {\n this.initializeTooltip();\n } else {\n this.destroy(); // Hide tooltip if it is already shown\n }\n }\n }\n\n // Touch event\n\n\n @HostListener('touchstart', ['$event'])\n onTouchStart($event: TouchEvent): void {\n // Prevent default to avoid click event fire immedieatly \n // $event.preventDefault();\n if(this.hasTrigger('touch')) {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = window.setTimeout(this.initializeTooltip.bind(this), 150); // show the tooltip after short delay\n }\n \n }\n\n @HostListener('touchend')\n onTouchEnd(): void {\n // Hide the tooltip when touch end \n if(this.hasTrigger('touch') ){\n window.clearTimeout(this.touchTimeout);\n // this.setHideTooltipTimeout();\n setTimeout(() => {\n this.setHideTooltipTimeout();\n }, 500); \n }\n \n }\n\n // Initialization of the tooltip\n private initializeTooltip() {\n if (this.componentRef === null) {\n window.clearInterval(this.hideDelay);\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);\n this.componentRef = componentFactory.create(this.injector);\n\n this.appRef.attachView(this.componentRef.hostView);\n const [tooltipDOMElement] = (this.componentRef.hostView as EmbeddedViewRef).rootNodes;\n\n this.setTooltipComponentProperties();\n\n document.body.appendChild(tooltipDOMElement);\n this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);\n }\n }\n\n private setTooltipComponentProperties() {\n if (this.componentRef !== null) {\n this.componentRef.instance.tooltip = this.tooltip;\n this.componentRef.instance.position = this.position;\n this.componentRef.instance.theme = this.theme;\n\n const {left, right, top, bottom} = this.elementRef.nativeElement.getBoundingClientRect();\n\n switch (this.position) {\n case TooltipPosition.BELOW: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(bottom);\n break;\n }\n case TooltipPosition.ABOVE: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(top);\n break;\n }\n case TooltipPosition.RIGHT: {\n this.componentRef.instance.left = Math.round(right);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n case TooltipPosition.LEFT: {\n this.componentRef.instance.left = Math.round(left);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n default: {\n break;\n }\n }\n }\n }\n\n private showTooltip() {\n if (this.componentRef !== null) {\n this.componentRef.instance.visible = this.show ? true : false;\n }\n }\n\n private setHideTooltipTimeout() {\n this.hideTimeout = window.setTimeout(this.destroy.bind(this), this.hideDelay);\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n\n destroy(): void {\n if (this.componentRef !== null) {\n window.clearInterval(this.showTimeout);\n window.clearInterval(this.hideDelay);\n this.appRef.detachView(this.componentRef.hostView);\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","export enum TooltipPosition {\n ABOVE = 'above',\n BELOW = 'below',\n LEFT = 'left',\n RIGHT = 'right',\n DYNAMIC = 'dynamic',\n DEFAULT = 'below'\n}\n\nexport enum TooltipTheme {\n DARK = 'dark',\n LIGHT = 'light',\n DEFAULT = 'dark'\n}\n","export { AlertMode, AlertBannerDisplay } from './alert-banner/alert-banner.component';\nexport { SelectOption } from './options/select-option';\nexport * from './cng-select/dropdown-panel';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatSelectModule } from '@angular/material/select';\nimport { AutoCompleteChipSelectItemComponent } from './auto-complete-chip-select-item/auto-complete-chip-select-item.component';\nimport { AutoCompleteSelectOptionComponent } from './auto-complete-select-option/auto-complete-select-option.component';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { RadioSelectComponent } from './radio-select/radio-select.component';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FilterPipe } from './pipes/filter.pipe';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TimeFieldComponent } from './time-field/time-field.component';\nimport { DateTzTimeFieldComponent } from './date-tz-time-field/date-tz-time-field.component';\nimport { SpacerComponent } from './spacer/spacer.component';\nimport { DurationFieldComponent } from './duration-field/duration-field.component';\nimport { DateTzDurationFieldComponent } from './date-tz-duration-field/date-tz-duration-field.component';\nimport { AcaDatePickerComponent } from './aca-date-picker/aca-date-picker.component'; // the old widget\nimport { MckDatePickerComponent } from './mck-date-picker/mck-date-picker.component'; // the old form field \nimport { DateTzCalendarWidgetComponent } from './date-tz-calendar-widget/date-tz-calendar-widget.component'; // the new widget\nimport { DateTzDatePickerComponent } from './date-tz-date-picker/date-tz-date-picker.component'; // the new form field \nimport { CalendarIconComponent } from './icons/calendar/calendar-icon.component';\nimport { ChevronIconComponent } from './icons/calendar/chevron-icon.component';\nimport { SelectOptionComponent } from './select-option/select-option.component';\nimport { CloseIconComponent } from './icons/close/close-icon.component';\nimport { SelectedChipCountComponent } from './selected-chip-count/selected-chip-count.component';\nimport { AlertBannerComponent } from './alert-banner/alert-banner.component';\nimport { ErrorMessageComponent } from './error-message/error-message.component';\nimport { ToggleComponent } from './toggle/toggle.component';\nimport { LabelComponent } from './label/label.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { CollapseHeaderComponent } from './collapse-header/collapse-header.component';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { SwitchGroupComponent } from './switch-group/switch-group.component';\nimport { ModalButtonRowComponent } from './modal-button-row/modal-button-row.component';\nimport { InformationalImageComponent } from './informational-image/informational-image.component';\nimport { GroupHeaderPipe } from './auto-complete-chip-select-item/groupHeader.pipe';\nimport { SelectComponent } from './select/select.component';\nimport { LegendDropdownComponent } from './legend-dropdown/legend-dropdown.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RecurrencePatternForm } from './recurrence-pattern-form/recurrence-pattern-form.component'; \nimport { RecurrenceDateForm } from './recurrence-date-form/recurrence-date-form.component';\nimport { ConflictsModalComponent } from './conflicts-modal/conflicts-modal.component';\nimport { RecurringBookingForm } from './recurrence-booking-form/recurrence-booking-form.component';\nimport { OverrideChangesModalComponent } from './override-changes-modal/override-changes-modal.component';\nimport { SanitizePipe } from './pipes/sanitise.pipe';\nimport { ConflictAlertModalComponent } from './conflict-alert-modal/conflict-alert-modal.component';\nimport { CngSelectComponent } from './cng-select/cng-select.component';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { DropdownTriggerForDirective } from './cng-select/dropdown-trigger-for.directive';\nimport { CngSelectOptionsComponent } from './cng-select/cng-select-options.component';\nimport { TooltipComponent } from './tooltip/tooltip.component';\nimport { TooltipDirective } from './tooltip/tooltip.directive';\nimport { ZoomWarningComponent } from './zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nimport { CustomSnackbarComponent } from './custom-snackbar-component/custom-snackbar-component.component';\nimport { SnackBarService } from './custom-snackbar-component/custom-snackbar-component.service';\nimport { CateringDropComponent } from './catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n\nexport const MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule,\n MatExpansionModule,\n OverlayModule\n];\n\n@NgModule({\n imports: [CommonModule,\n ...MATERIAL_MODULES,\n ReactiveFormsModule,\n FormsModule,\n NgxMatSelectSearchModule, \n NgxSkeletonLoaderModule,\n MatSnackBarModule],\n declarations: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n GroupHeaderPipe,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n SelectOptionComponent,\n CloseIconComponent,\n SelectedChipCountComponent,\n AlertBannerComponent,\n ErrorMessageComponent,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n CustomSnackbarComponent,\n CateringDropComponent\n ],\n exports: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n AlertBannerComponent,\n ReactiveFormsModule,\n FormsModule,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n ],\n entryComponents: [\n CustomSnackbarComponent,\n CateringDropComponent\n ]\n \n})\nexport class UiModule {\n}\n","/**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n\nimport {\n closestToTimeSlot,\n closestToTimeSlotTz,\n DurationGroup,\n durationHumanized,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../types';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { DateTime } from 'luxon';\n\n// 24 hours\nexport const ALL_DAY_BOOKING_VALUE = 60 * 24;\n\nexport const DEFAULT_DURATION = 30;\n\n// R--- depreciate.\nexport const generateAvailableTimes = (\n datestamp: number,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz\n): SelectOption[] => {\n // R--- refactor to only used dateTz input and drop timezone param.\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let date = new DateTZ({ date: datestamp, is_local_tz: false, building_tz: timezone });\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || date.isAfterDate(now, 'day')) {\n // later than today\n date = date.startOfValue('day');\n } else {\n // today\n date = now;\n }\n // Get the closest timeslot to the start time\n const inputDate = DateTime.fromMillis(date.ms);\n const closestDate = closestToTimeSlot(inputDate, step);\n // Date changed to the closest time\n date = new DateTZ({ date: closestDate.valueOf(), is_local_tz: false, building_tz: timezone });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(date),\n shortDisplay: date.formatDate('hh:mma'),\n value: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n};\n\n\nexport const generateAvailableTimesTz = (\n fromDateTz: DateTZ,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz,\n all_day: boolean = false,\n extras: SelectOption[] = [],\n startFromDateTz: boolean = false\n): SelectOption[] => {\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let dateTz = fromDateTz.clone();\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || dateTz.isAfterDate(now, 'day')) {\n // later than today\n dateTz = dateTz.startOfValue('day');\n } else {\n // today/fromDateTz using the flag\n dateTz = startFromDateTz ? dateTz : now;\n }\n // Get the closest timeslot to the start time\n dateTz = closestToTimeSlotTz(dateTz, step);\n // Date changed to the closest time\n const end = dateTz.endOfValue('day');\n // Add the all day option for today\n if (all_day && dateTz.isSameDate(now, 'day')) {\n const startOfDay = dateTz.startOfValue('day');\n blocks.push({\n display: timeWithGmtOffsetFormatString(startOfDay),\n shortDisplay: startOfDay.formatDate('hh:mma'),\n value: startOfDay\n })\n }\n // Add options for the rest of the day\n while (dateTz.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n });\n \n dateTz = dateTz.addValue({ minutes: step });\n }\n\n return unique(extras.concat(blocks), 'shortDisplay');\n};\n\n/**\n * Generates list of duration options for new booking flow.\n * @param date - The start dateTime\n * @param max - The max number of minutes to go to from the date param.\n * @param min - The min number of minutes to display first time from.\n * @param step - The number of minutes to step up by for timeslots.\n */\nexport const generateDurationOptions = (\n date: DateTZ,\n max: number,\n min: number,\n step: number,\n extended: boolean): SelectOption[] => {\n const blocks: SelectOption[] = [];\n let value = min;\n while (value <= max) {\n let duration: string;\n if (extended) {\n const d = durationHumanized(value - min, true);\n duration = d ? `+${d}` : 'Current';\n } else {\n duration = durationHumanized(value, true);\n }\n\n blocks.push({\n value,\n display: `${date.addValue({ minutes: value }).formatDate(timeFormatString()).toLocaleLowerCase()} (${duration})`,\n });\n value += step;\n }\n return blocks;\n};\n\nexport const allDayOption: SelectOption = ({\n value: ALL_DAY_BOOKING_VALUE,\n display: 'All Day'\n});\n\nexport const oneWeekOption: SelectOption = ({\n value: 60 * 24 * 7, // 1 week\n display: 'One Week'\n});\n\nexport const defaultDurationGroups: DurationGroup[] = [\n {\n start: 15,\n step: 15,\n max: 60 * 24\n }\n // , {\n // start: 60,\n // step: 30,\n // max: (60 * 8) - 1 // 8 hours\n // }, {\n // start: 60 * 8,\n // step: 60,\n // max: 60 * 24 // 24 hours\n // }\n];\n\n/**\n * Maps the {@link DurationGroup} to {@link SelectOption} and appends the default all day and week options.\n */\nexport const generateDurationOptionsFromGroups = (date: DateTZ, durationGroups: DurationGroup[], extended: boolean): SelectOption[] => [\n ...(durationGroups.map(duration => generateDurationOptions(date, duration.max, duration.start, duration.step, extended)).reduce(((previousValue, currentValue) => {\n previousValue.push(...currentValue);\n return previousValue;\n }), [])),\n // allDayOption,\n // oneWeekOption\n ];\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-zoom-warning',\n templateUrl: './zoom-warning.component.html',\n styleUrls: ['./zoom-warning.component.scss']\n})\nexport class ZoomWarningComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onCloseClick(): void {\n this.dialogRef.close();\n }\n}\n","
\n

Excessive zoom warning

\n
\n\n
\n
\n

\n
\n
\n
\n\n
\n \n
\n
","export * from './lib/user.module';\nexport * from './lib/user.actions'\nexport * from './lib/user.types'\nexport * from './lib/user.reducer'\n","import { \n createLoadingAction\n } from '../../../loading/src/lib/loading.actions';\nimport {\n UserState,\n UserStoreState\n} from './user.types';\nimport { User } from '../../../data-common/src/lib/users/user.class';\nimport { createSelector } from '@ngrx/store';\n\nexport const loadUser = createLoadingAction('CurrentUser', 'current');\n\nexport const selectUserState = ({ user }: UserStoreState) => user;\n\nexport const selectHasUserData = createSelector(createSelector(selectUserState, loadUser.selectors.model), (state) => !!state.optionalSuccess);\n\nexport const selectCurrentUser = createSelector(selectUserState, loadUser.selectors.optionalSuccess);\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\nimport { UsersService } from '../../../data-common/src/lib/users/users.service';\n\n\n@Injectable()\nexport class UserEffects {\n\n constructor(private actions: Actions,\n private userService: UsersService) {\n }\n\n @Effect()\n loadUser = createLoadingEffect(this.actions, loadUser, () => this.userService.loadCurrentUser());\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { StoreModule } from '@ngrx/store';\nimport { userReducer } from './user.reducer';\nimport { EffectsModule } from '@ngrx/effects';\nimport { UserEffects } from './user.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n StoreModule.forFeature('user', userReducer),\n EffectsModule.forFeature([UserEffects])\n ]\n})\nexport class UserModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { UserState } from './user.types';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\n\n\nexport const initialUserState: UserState = {\n current: LoadingModel.empty()\n};\n\nexport const userReducer = createReducer(initialUserState,\n ...loadUser.ons);\n","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./$$_lazy_route_resource lazy recursive\";","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { ShellWrapperComponent } from './shell/shell.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: ShellWrapperComponent,\n children: [\n {\n path: 'home',\n loadChildren: () => import('./booking/booking.module').then((m) => m.BookingModule),\n },\n { path: '**', redirectTo: 'home' },\n ],\n },\n { path: '**', redirectTo: 'home' },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, { useHash: true })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective, detectIE } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingsService,\n OrganisationService,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { environment } from 'src/environments/environment';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ZoomWarningComponent } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: [\n './styles/app.component.scss',\n './styles/custom-element.styles.scss',\n './styles/native-element.styles.scss'\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class AppComponent extends BaseDirective implements OnInit {\n constructor(\n private _app: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private _router: Router,\n private _route: ActivatedRoute,\n private _dialog: MatDialog,\n ) {\n super();\n\n // ensure app is trusted in dev mode so we can preserve login.\n if (!environment.production) {\n localStorage.setItem('trusted', 'true');\n }\n\n\n if (detectIE() && detectIE() < 12) {\n location.href = `${location.origin}${location.pathname}assets/not-supported.html`;\n return;\n }\n }\n\n public ngOnInit(): void {\n this._router.events.subscribe((val: NavigationStart) => {\n const bookingForm = JSON.parse(localStorage.getItem('bookingForm'));\n if (val && val.navigationTrigger && val.url) {\n // Redirect everyone who doesn't have an active bookingForm back to the home page.\n const cleanHash = location?.hash.split('?')[0];\n const isLoadBookingUrl = cleanHash.indexOf('#/home/booking/') === 0;\n const isLoadCateringUrl = cleanHash.indexOf('#/home/catering/') === 0;\n if (!isLoadBookingUrl && !isLoadCateringUrl && cleanHash && ['#/home', '#/home/manage', '#/home/create', '#/home/edit'].indexOf(cleanHash) === -1 && bookingForm && !bookingForm?.activeForm) {\n location.href = `${location.origin}`;\n return;\n }\n }\n\n })\n this.adjustZoom();\n }\n\n private adjustZoom() {\n const clientWidth = document.body.clientWidth;\n if (this.isMobileOrTablet()) { // Do not show the warning if it's a mobile or tablet device\n return;\n }\n if (clientWidth < 1300) {\n this._dialog.open(ZoomWarningComponent);\n }\n }\n private isMobileOrTablet(): boolean {\n const userAgent = navigator.userAgent || navigator.vendor;\n const maxTouchPoints = navigator.maxTouchPoints || 0; // Check for touch points \n if (maxTouchPoints > 0 && window.innerWidth <= 1024) {\n return true;\n } // Check for common mobile/tablet user agent strings \n const mobileAgents = ['Android', 'webOS', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'IEMobile', 'Opera Mini'];\n for (const agent of mobileAgents) {\n if (userAgent.indexOf(agent) > -1) {\n return true;\n }\n }\n return false;\n }\n}\n","
\n \n
\n","// remove after trigger build\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { NgModule } from '@angular/core';\nimport { HttpClientModule } from '@angular/common/http';\nimport { FormsModule } from '@angular/forms';\nimport { MAT_LABEL_GLOBAL_OPTIONS } from '@angular/material/core';\n\nimport { ComposerModule } from '@placeos/composer';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { environment } from '../environments/environment';\nimport { SharedContentModule } from './shared/shared.module';\n\nimport { ShellWrapperComponent } from './shell/shell.component';\nimport {\n ActionReducer,\n MetaReducer,\n StoreModule\n} from '@ngrx/store';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport { BookingModule } from 'src/app/booking/booking.module';\nimport { BookingsModule } from '@mckinsey-converge/bookings';\nimport { BuildingsModule } from '@mckinsey-converge/buildings';\nimport { EffectsModule } from '@ngrx/effects';\nimport { DEFAULT_SETTINGS } from 'src/environments/settings';\nimport { provideMockSettingsObject } from '@mckinsey-converge/data-common';\nimport { OrganisationModule } from '@mckinsey-converge/organisation';\nimport { localStorageSync } from 'ngrx-store-localstorage';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { RoomsModule } from '@mckinsey-converge/rooms';\nimport { ENVIRONMENT_TOKEN } from '@mckinsey-converge/environment';\nimport { LegacyOverlaysModule } from '@mckinsey-converge/legacy-overlays';\nimport { UserModule } from '@mckinsey-converge/user';\nimport { MapModule } from 'src/app/map/map.module';\n\n/**\n * Cache some state in local storage. Not for use in production.\n */\nexport function localStorageSyncReducer(reducer: ActionReducer): ActionReducer {\n // Keys needed to fix prod reloading. MCK-1229\n let keys = [\n 'buildings',\n 'bookingForm',\n 'rooms',\n ];\n\n if (!environment.production) {\n keys = [\n 'bookings',\n 'buildings',\n 'organisation',\n 'bookingForm',\n 'rooms',\n 'user'\n ];\n }\n\n return localStorageSync({\n keys,\n rehydrate: true,\n })(reducer);\n}\n\nconst metaReducers: Array> = [localStorageSyncReducer];\n\n\n@NgModule({\n declarations: [\n AppComponent,\n ShellWrapperComponent\n ],\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n AppRoutingModule,\n HttpClientModule,\n FormsModule,\n ComposerModule,\n SharedContentModule,\n LegacyOverlaysModule,\n StoreModule.forRoot({}, { metaReducers }),\n StoreDevtoolsModule.instrument({\n maxAge: 100,\n logOnly: environment.production\n }),\n EffectsModule.forRoot(),\n BookingsModule,\n BookingModule,\n BuildingsModule,\n MapModule,\n OrganisationModule,\n RoomsModule,\n UiModule,\n UserModule\n ],\n providers: [\n { provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: { float: 'nevet' } },\n provideMockSettingsObject(DEFAULT_SETTINGS),\n { provide: ENVIRONMENT_TOKEN, useValue: environment }\n ],\n bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n","import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { BookingStateService, OrganisationService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, getTimezoneOffsetString, toMiddayUTC } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'calendar-date-widget',\n templateUrl: './calendar-date-widget.component.html',\n styleUrls: ['./calendar-date-widget.component.scss'],\n})\nexport class CalendarDateWidgetComponent extends BaseDirective implements OnInit {\n /** Currently selected date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Currently building timezone */\n @Input() public timezone: string;\n /** Currently active zone */\n @Input() public zone: string;\n /** Whether to show new item button */\n @Input() public show_add_item = false;\n /** Whether to show the events for the active month */\n @Input() public show_events: boolean = false;\n /** Preserve last selected date */\n @Input() public retainSelectedDate: boolean = false;\n /** Emitter for changes selected date */\n @Output() public dateChangeTz = new EventEmitter();\n /** Emitter for add item button */\n @Output() public event = new EventEmitter();\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n public event_map: { [date: string]: number };\n\n public fromDateTz = DateNow().subtractValue({ months: 6 });\n\n public get now() {\n return DateNow();\n }\n\n /** Display string for the currently selected date */\n public get tz(): string {\n return getTimezoneOffsetString(this.timezone_value);\n }\n\n public get timezone_value() {\n return localStorage.getItem('CONCIERGE.timezone') || this.timezone || this.now.building_tz;\n }\n\n public get is_today() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone_value,\n }),\n 'day'\n );\n }\n\n constructor(private _bookings: BookingStateService, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // CONCIERGE.date: Get the localstorage date and timezone when changing pages.\n let date: any;\n if(!this.retainSelectedDate) {\n date = +localStorage.getItem('CONCIERGE.date') || this.now.ms;\n } else {\n date = this.now.ms;\n }\n\n \n /* istanbul ignore else */\n if (date && (date !== this.dateTz.ms || this.timezone_value !== this.dateTz.building_tz)) {\n // CONCIERGE.date Reapply the localstorage date and timezone when changing pages.\n this.timeout(\n 'init',\n () => {\n this.dateTz = new DateTZ({\n date,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n this.updateDate();\n },\n 10\n );\n }\n this.subscription(\n 'events',\n this._bookings._noOfMeetings.subscribe((list) => {\n this.event_map = {};\n this.event_map = list[0];\n })\n );\n }\n\n public noOfCount(event) {\n // Disabling bellow until find more reliable way to call as it is been called multiple times on hover/click\n // this._bookings.getDailyMeetingCount();\n // event.stopPropogation();\n }\n\n /**\n * Change the selected date with the arrow controls\n *\n */\n public changeDate(value: number) {\n let date = new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n date = date.addValue({ days: value });\n this.dateTz = date;\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n /**\n * Change the selected date with the calendar widget\n *\n */\n public applyDatePickerValue(dateInputTz: DateTZ) {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(dateInputTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n this.closeDatePicker();\n }\n\n public updateDate() {\n this.timeout('update_date', () => this._bookings.setDate(this.dateTz));\n }\n\n /** Reset date to the current date */\n public resetDate() {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(this.now).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n public closeDatePicker() {\n this.updateDate();\n }\n\n /** New Item button click */\n public newItem(): void {\n this.event.emit('new_item');\n }\n}\n","
\n\n \n
\n
\n \n
\n

Today

\n

{{ dateTz.ms | date: 'mediumDate':tz }}

\n
\n \n
\n
\n \n \n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\n\nconst routes: Routes = [\n { path: '', component: BookingCalendarWrapperComponent },\n { path: ':level', component: BookingCalendarWrapperComponent },\n { path: '**', redirectTo: '' }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingCalendarRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingFormData,\n BookingsService,\n Building,\n OrganisationService,\n SettingsService,\n SpacesService,\n selectActiveForm\n} from '@mckinsey-converge/data-common';\nimport { Store, select } from '@ngrx/store';\nimport { distinctUntilChanged, first } from 'rxjs/operators';\n\nimport { RoutePayload, TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'booking-calendar-wrapper',\n templateUrl: './booking-calendar-wrapper.html',\n styleUrls: ['./booking-calendar.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookingCalendarWrapperComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n orgBuildings: Building[] = [];\n \n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private settingService: SettingsService,\n private store: Store,\n ) {\n super();\n\n \n }\n\n public ngOnInit(): void {\n /** allow booking bypass to receive bookings for staff calendar view only */\n this.settingService.bypass_bookings = true;\n\n this.orgBuildings = this._org.buildings;\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz) {\n localStorage.setItem('CONCIERGE.date', `${next.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${next.timezone}`);\n const building = this._org.buildings.find(\n (_) => _.id === next.location.filter(el => el.groupChild)[0]?.meta?.building?.id\n );\n if(building) {\n this._org.building = building;\n }\n \n }\n }));\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.orgBuildings = this._org.buildings;\n })\n\n \n }\n\n public onBackCallback() {}\n\n public ngOnDestroy(): void {\n /** disallowed booking bypass when you are moving from staff app calendar view*/\n this.settingService.bypass_bookings = false;\n }\n\n}\n","
\n\t
\n\t\t \n\t\t\n\t
\n\t\n\t\n
","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\nimport { StaffCalendarComponent } from './staff-calendar/staff-calendar.component';\nimport { CalendarDateWidgetComponent } from './booking-calendar-date-widget/calendar-date-widget.component';\nimport { DayViewTimelineComponent } from './staff-calendar/timeline/timeline.component';\nimport { DayViewSpaceComponent } from './staff-calendar/space/space.component';\nimport { DayViewSpaceEventComponent } from './staff-calendar/space/event/event.component';\n\n\nimport { BookingCalendarRoutingModule } from './booking-calendar-routing.module';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { UiModule } from '@mckinsey-converge/ui';\n\nimport {CngMenuItemComponent} from './cng-menu-item/cng-menu-item.component';\n\nexport const bookingModuleDeclarations = [\n BookingCalendarWrapperComponent,\n StaffCalendarComponent,\n CalendarDateWidgetComponent,\n DayViewTimelineComponent,\n DayViewSpaceComponent,\n DayViewSpaceEventComponent,\n CngMenuItemComponent\n ];\n\nexport const bookingModuleImports = [\n CommonModule,FormsModule,\n ReactiveFormsModule,\n SharedContentModule,\n UiModule,\n \n \n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingCalendarRoutingModule,\n // StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingCalendarModule {\n}","import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NavItem} from './nav-item';\nimport { MatMenu } from '@angular/material/menu';\n\n@Component({\n selector: 'cng-menu-item',\n templateUrl: './cng-menu-item.component.html',\n styleUrls: ['./cng-menu-item.component.scss']\n})\nexport class CngMenuItemComponent implements OnInit {\n @Input() items: NavItem[];\n @Input() activeOption: string;\n @ViewChild('childMenu', {static: true}) public childMenu: any;\n\n @Output() public onChildSelect = new EventEmitter<{}>();\n \n constructor(public router: Router) {\n }\n\n ngOnInit() {\n }\n\n public notifySelection(node) {\n this.onChildSelect.emit(node);\n }\n}\n","\n \n \n 0\">\n \n \n \n \n \n \n \n \n \n ","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space, BOOKING_STATUS, CloseDialogService, DialogIds, BookingStoreState, User } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { CateringOrder } from '@mckinsey-converge/data-common';\n\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState, selectCurrentUser } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { take } from 'rxjs/operators';\n\n/** Details about the associated event overlapping with other events */\nexport interface IEventOverlap {\n /** Index of this item with the overlapping items */\n index: number;\n /** Total number of items overlapping with this one */\n total: number;\n}\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n \n@Component({\n selector: 'day-view-space-event',\n templateUrl: './event.component.html',\n styleUrls: ['./event.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewSpaceEventComponent extends BaseDirective implements OnInit, OnChanges {\n /** Event to display */\n @Input() public booking: Booking;\n /** Date to display bookings for */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Space associated with the booking */\n @Input() public space: Space;\n /** Whether the item is a fixed size */\n @Input() public fixed: boolean;\n /** Overlap details for the booking */\n @Input() public overlap: IEventOverlap;\n /** Whether an action is being processed for this booking */\n @Input() public loading: boolean;\n /** Emitter for the current position of the booking within the timeline */\n @Output() public position = new EventEmitter<{ top: number; height: number }>();\n\n /** Position of the booking start time in the day */\n public top: number;\n /** Position of the booking relative to overlapping bookings */\n public left: number;\n /** Height based of the duration of the booking */\n public height: number;\n /** Size of the booking when overlapping with other bookings */\n public width: number;\n /** Offset from the booking's top that the setup time starts */\n public overflow_top: number;\n /** Offset from the booking's bottom that the breakdown time ends */\n public overflow_bottom: number;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n currentUser: User;\n constructor(\n private _service: ApplicationService,\n public store: Store,\n private _dialog: MatDialog,\n private _router: Router,\n private cdRef: ChangeDetectorRef,\n private closeDialogService: CloseDialogService\n ) {\n super();\n }\n\n ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n public get local_id(): string {\n return this.booking.icaluid.substr(0, 6);\n }\n\n /** Type of booking */\n public get type(): string {\n const userEmail = this.currentUser.email;\n const { creator, organiser } = this.booking;\n if(userEmail === creator.email || userEmail === organiser.email) \n return this.booking.getType();\n else \n return 'others-booking';\n }\n\n /** Period that the booking will occur during the day */\n public get period(): string {\n // the booking time is being pass in as the local timezone version.\n return this.booking.time_period;\n }\n\n /** Number attendees expected to turn up to the booking */\n public get expected(): number {\n const expected = this.booking.expected_attendees;\n return this.space ? expected[this.space.email] || 0 : 0;\n }\n\n /** Whether the meeting has catering attached */\n public get has_catering(): boolean {\n return !!this.order;\n }\n\n public get order(): CateringOrder {\n return this.booking.catering.find((order) => order.location_id === this.space.email);\n }\n\n /** Whether booking is active */\n public get active(): boolean {\n const booking = this._service.get('CONCIERGE.day_view.viewing');\n return !booking || booking.id === this.booking.id;\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.booking || changes.overlap || changes.dateTz) {\n this.calculatePosition();\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n }\n }\n\n /** Store the order details for viewing in another component */\n public storeOrder(order: CateringOrder) {\n const booking_details = this.booking.toApiJSON();\n localStorage.setItem('CONCIERGE.view_order', JSON.stringify(order.toJSON()));\n localStorage.setItem('CONCIERGE.view_booking', JSON.stringify(booking_details));\n localStorage.setItem('CONCIERGE.date', `${this.booking.startDateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.booking.startDateTz.building_tz}`);\n }\n\n /**\n * View catering order for the booking\n */\n public viewOrder(order: CateringOrder) {\n /* istanbul ignore else */\n if (this.booking && this.booking.catering) {\n /* istanbul ignore else */\n if (localStorage) {\n this.storeOrder(order);\n }\n this._router.navigate(['/catering', 'orders'], {\n queryParams: { booking: this.booking.id, view: order.id },\n });\n }\n }\n\n /** Calculate the position */\n private calculatePosition() {\n /* istanbul ignore else */\n if (this.booking) {\n const overlap = this.overlap || { index: 0, total: 1 };\n const shown_date = this.dateTz.startOfValue('day');\n const date = this.booking.startDateTz.startOfValue('minute');\n const end = this.booking.endDateTz.startOfValue('minute');\n const from_previous_day = !date.isSameDate(shown_date, 'day');\n if (end.isBeforeDate(shown_date, 'day')) { // Hide booking if not on shown date\n this.top = -100;\n this.height = 1;\n return;\n }\n\n //R-- Stragest thing, but one time this was logging bookings form different timezones?\n // this.dateTz.logDateTz('calculatePosition this.dateTz')\n // this.booking.startDateTz.logDateTz('calculatePosition this.booking.startDateTz')\n\n const start = from_previous_day ? 0 : Math.abs(+date.dateDiff(shown_date, 'hours', 'hours').toFixed(3));\n const duration = Math.min(\n this.booking.duration,\n Math.abs(shown_date.dateDiff(date.addValue({ minutes: this.booking.duration }), 'minutes'))\n );\n this.top = Math.max(0, (start / 24) * 100);\n this.height = Math.min(\n 100 - this.top,\n this.fixed ? duration / 60 : (duration / 60 / 24) * 100\n );\n this.position.emit({ top: this.top, height: (duration / 60 / 24) * 100 });\n this.width = Math.min(100, 100 / overlap.total + 5);\n this.left = Math.min(100 - this.width, this.width * overlap.index - 5 * overlap.index);\n this.overflow_top =\n (this.booking.setup[this.space.email]\n ? (this.booking.setup[this.space.email] / 60) / duration\n : -0.1) * 100;\n this.overflow_bottom =\n (this.booking.breakdown[this.space.email]\n ? (this.booking.breakdown[this.space.email] / 60) / duration\n : -0.1) * 100;\n if (this.booking.all_day) {\n this.top = 0;\n this.height = 100;\n }\n }\n }\n\n public get emailURL() {\n const userEmail = this.currentUser.email;\n const userName = this.currentUser.name\n const { creator, organiser } = this.booking;\n\t\treturn `mailto:${encodeURIComponent(organiser.email)}?cc=${encodeURIComponent(userEmail)}&subject=Request%20to%20release%20room%20reservation%20-%20${encodeURIComponent(this.space.simple_name)}`;\n\t}\n\n /** Whether booking has been ended */\n public expired(): boolean {\n return ['started','in_progress','expired_yesterday', 'done'].includes(this.booking.timeBasedStatusLabel);\n }\n}\n","\n \n \n 50 ? ' low' : '')\"\n [style.z-index]=\"(overlap?.index || 0) + 2\"\n \n >\n
\n
{{ booking.all_day ? 'All Day' : period }}
\n
\n \n\n \n \n
\n
\n
\n
\n
Host: 
\n
\n {{ booking.organiser?.name || booking.organiser }}\n
\n
\n \n
Booked by: 
\n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n
\n
{{ booking.title }}
\n
\n
\n
\n {{ booking.attendees ? booking.attendees.length || 'No' : 'No' }} Attendee{{\n booking.attendees?.length === 1 ? '' : 's'\n }}{{ expected ? '(' + expected + ' Expected)' : '' }}\n
\n
\n
0\">\n
\n Company: {{ booking.company.length }}\n
\n
\n
\n
Welcomed by: {{ booking.organiser?.name || booking.organiser }}
\n
\n
\n
Catered
\n
\n
\n \n \n \n \n\n","import {\n Component,\n OnChanges,\n Input,\n SimpleChanges,\n Output,\n EventEmitter,\n ViewChild,\n ElementRef,\n OnInit,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { CdkDragMove, CdkDragDrop } from '@angular/cdk/drag-drop';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first } from 'rxjs/operators';\n\nimport { IEventOverlap } from './event/event.component';\nimport { BaseDirective, closestToTimeSlotTz, Identity } from '@mckinsey-converge/base';\nimport { OrganisationService, Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { ConfirmModalComponent } from '@mckinsey-converge/legacy-overlays';\nimport { DialogEvent, HashMap } from '@mckinsey-converge/base';\nimport { DayViewSettings } from '@mckinsey-converge/data-common';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { BookingsService } from '@mckinsey-converge/data-common';\n\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\n@Component({\n selector: 'day-view-space',\n templateUrl: './space.component.html',\n styleUrls: ['./space.component.scss'],\n})\nexport class DayViewSpaceComponent extends BaseDirective implements OnInit, OnChanges {\n /** List of space dropzones connected to */\n @Input() public space_list: string[];\n /** Date to display events for */\n @Input() public dateTz: DateTZ;\n /** Space to display events for */\n @Input() public space: Space;\n /** Scroll value of the day view */\n @Input() public scroll: number;\n /** Only show events with setup and/or breakdown times */\n @Input() public overflow_only: boolean;\n /** Mapping of whether to show events with a given legend id */\n @Input() public legend: HashMap = {};\n /** Scroll value to add to drop placeholders */\n @Input('scrollTop') public scroll_top: number;\n /** Last update time of the displayed bookings */\n @Input('lastUpdate') public last_update: number;\n\n @Input() public eventMovingLoader : HashMap = {};\n /** Emitter for whether the space column is in view */\n @Output() public inView = new EventEmitter();\n /** Emitter for whether an event is being dragged */\n @Output() public dragging = new EventEmitter();\n /** Emitter for whether an event is being dropped and moving in progress */\n @Output() public moving = new EventEmitter<{}>();\n /** List of bookings for the current date and space */\n public event_list: Booking[] = [];\n /** Mapping of event IDs to overlap details */\n public overlap_details: HashMap = {};\n /** Mapping of positions of event in the day */\n public position_list: HashMap<{ top: number; height: number }> = {};\n /** Override for mapped position */\n public top: number;\n /** Client Rectangle for the container element box */\n public box: ClientRect;\n /** Whether the space list is in view */\n public in_view: boolean;\n /** ID of the booking with an action processing */\n public override_state: string;\n /** Map of bookings to whether they are loading */\n public loading: HashMap = {};\n /** Settings for day view */\n public settings: DayViewSettings = {} as any;\n\n /** Container element for the component contents */\n @ViewChild('view', { static: true }) private view: ElementRef;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _bookings: BookingsService,\n private _dialog: MatDialog,\n private cdr: ChangeDetectorRef,\n private _org: OrganisationService,\n ) {\n super();\n }\n\n /** Events to display for the active date */\n public events: Booking[] = []\n\n public ngOnInit(): void {\n this.events = this.filterEvents();\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.settings = this._service.setting('app.day_view') || {};\n // this.subscription(\n // 'breakdown',\n // this._service\n // .listen('APP.breakdown')\n // .subscribe((state) => {\n // this.overflow_only = state;\n // this.events = [...this.filterEvents()];\n // })\n // );\n // this.subscription(\n // 'legend',\n // this._service\n // .listen('CONCIERGE.legend')\n // .subscribe((state) => (this.legend = state || {}))\n // );\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...list];\n this.events = [...this.filterEvents()];\n this.cdr.detectChanges();\n })\n );\n this.checkInView();\n });\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.scroll) {\n this.checkInView();\n }\n if (changes.space) {\n this.event_list = [...this.event_list];\n this.timeout('in_view', () => this.checkInView(), 100);\n }\n /* istanbul ignore else */\n if (changes.last_update) {\n this.timeout('update_overlaps', () => this.calculateOverlaps(), 1000);\n }\n }\n\n //replace this with concierge space.comp filterEvents\n // private filterEvents(): Booking[] {\n // if (this.space) {\n // const bookings = this.event_list;\n // const list = bookings.filter((event) => {\n // if (this.override_state && this.override_state === event.icaluid) {\n // this.loading[event.id] = true;\n // }\n\n // const ignore = event.is_recurrent && event.recurrence_type === 'master';\n\n // return (\n // !ignore && !event.declined && // filtered declied bookings\n // event.room.email === this.space.email &&\n // (!this.overflow_only ||\n // event.setup[event.room.email] ||\n // event.breakdown[event.room.email])\n // );\n // }).map(e => new Booking({...e.toJSON()}) );\n\n // return list;\n // }\n // return [];\n // }\n\n private filterEvents(): Booking[] {\n if (!this.space) {\n return [];\n }\n \n return this.event_list.filter((event) => {\n // Mark as loading if override state matches.\n if (this.override_state && this.override_state === event.icaluid) {\n this.loading[event.id] = true;\n }\n \n const isRecurrentMaster = event.is_recurrent && event.recurrence_type === 'master';\n const isRoomEmailMatch = event.multi_rooms.some(room => room.email === this.space.email);\n \n // Determine if the event should be included based on setup or breakdown conditions.\n const isIncludedInSetupOrBreakdown = event.multi_rooms.some(room => {\n return event.setup[room.email] || event.breakdown[room.email];\n });\n \n return !isRecurrentMaster && isRoomEmailMatch && (!this.overflow_only || isIncludedInSetupOrBreakdown);\n }).map(event => new Booking({...event.toJSON()}));\n }\n\n /* istanbul ignore next */\n /**\n * Track by function for ngFor optimisation\n * @param index Index of the item\n * @param item Data associated with the item at the given index\n */\n public trackByFn(index: number, item: Booking) {\n return item.id || index;\n }\n\n /**\n * Calculate to overlap details for the booking events on the space\n */\n private calculateOverlaps() {\n const events = this.events.sort(\n (a, b) =>\n a.startDateTz.ms - b.startDateTz.ms ||\n a.duration - b.duration ||\n (a.title || '').localeCompare(b.title || '')\n );\n events.forEach((i) => (this.overlap_details[i.id] = { index: 0, total: 1 }));\n for (const bkn of events) {\n const bkn_start = bkn.startDateTz.startOfValue('minute');\n const bkn_end = bkn.endDateTz.startOfValue('minute');\n let count = 1;\n let index = 0;\n const collisions: Booking[] = [];\n for (const cmp of events) {\n /* istanbul ignore else */\n if (bkn.id !== cmp.id) {\n const cmp_start = cmp.startDateTz.startOfValue('minute');\n const cmp_end = cmp.endDateTz.startOfValue('minute');\n /* istanbul ignore else */\n if (\n bkn_start.isSameDate(cmp_start, 'minute') ||\n (bkn_start.isAfterDate(cmp_start) && bkn_start.isBeforeDate(cmp_end)) ||\n bkn_end.isSameDate(cmp_end, 'minute') ||\n (bkn_end.isAfterDate(cmp_start) && bkn_end.isBeforeDate(cmp_end))\n ) {\n count++;\n collisions.push(bkn);\n /* istanbul ignore else */\n if (\n events.findIndex((i) => i.id === bkn.id) >\n events.findIndex((i) => i.id === cmp.id)\n ) {\n index++;\n }\n }\n }\n }\n this.overlap_details[bkn.id] = { index: Math.max(0, index), total: count };\n }\n }\n\n /**\n * Check whether the space column is with the view of the\n */\n private checkInView() {\n /* istanbul ignore else */\n if (this.view && this.view.nativeElement) {\n const el = this.view.nativeElement;\n this.in_view =\n el.offsetLeft + this.scroll >= -240 &&\n el.offsetLeft + this.scroll <= window.innerWidth;\n this.inView.emit(this.in_view);\n }\n }\n\n /**\n * Initialise drag events\n */\n public initDrag() {\n this.box = this.view.nativeElement.getBoundingClientRect();\n this.dragging.emit(true);\n }\n\n /**\n * Cleanup after drag\n */\n public endDrag() {\n this.timeout('end_drag', () => (this.top = 0), 10);\n this.dragging.emit(false);\n }\n\n /**\n * Update top position of the dragged event placeholder\n * @param booking Booking being dragged\n * @param event Drag event\n */\n public updateDragTop(event: CdkDragMove) {\n /* istanbul ignore else */\n if (event.delta.y) {\n const y = event.pointerPosition.y;\n const top = (y - this.box.top - this.scroll_top) / this.box.height;\n const top_minutes = (Math.round((top * 24 * 60) / 15) * 15) / 60;\n this.top = (top_minutes / 24) * 100;\n\n }\n }\n\n\n\n\n\n public checkAvailabilityOnGivenTime(selectedBlockStart, selectedBlockEnd) {\n const runningBookings =\n this.events?.filter((bks) => {\n const startEpoch = new DateTZ({\n date: bks.start_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const endEpoch = new DateTZ({\n date: bks.end_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const hasValidBreakdown: boolean =\n bks.breakdown &&\n Object.values(bks.breakdown).some((value) => value !== null);\n if (selectedBlockStart.ms === endEpoch && hasValidBreakdown) {\n return true;\n } else\n return (\n (selectedBlockStart.ms >= startEpoch && selectedBlockStart.ms < endEpoch) ||\n (selectedBlockEnd.ms > startEpoch && selectedBlockEnd.ms < endEpoch)\n );\n }) || [];\n return !!runningBookings.length;\n }\n\n\t\t/** Whether booking has been ended */\n public expired(booking): boolean {\n\t\t\treturn booking.timeBasedStatusLabel === 'done';\n\t\t}\n\n\t\t\n}\n","\n\n
\n
\n
\n
\n
\n\n \n \n \n\t\t\n
\n
\n \n
\n
\n
\n \n\n\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first, take } from 'rxjs/operators';\n\nimport { BaseDirective, HashMap, Identity } from '@mckinsey-converge/base';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\nexport interface NavItem {\n\tdisplayName: string;\n\ticonName?: string;\n\troute?: string;\n\tmeta?:{}; \n\tchildren?: NavItem[];\n}\n\n\nimport {\n ApplicationService,\n BookingStateService,\n BookingStoreState,\n BuildingLevel,\n OrganisationService,\n selectBookingByIdResultsFromState,\n User,\n Booking,\n SpacesService,\n Space,\n Building,\n searchRoomsAndBookings\n} from '@mckinsey-converge/data-common';\n\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { BuildingStoreState } from 'libs/buildings/src';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { Subscription } from 'rxjs';\nimport { DropdownOpion } from '@mckinsey-converge/ui';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'staff-calendar',\n templateUrl: './staff-calendar.component.html',\n styleUrls: ['./staff-calendar.component.scss']\n})\nexport class StaffCalendarComponent extends BaseDirective implements OnInit {\n /** Currently selected date, starts out with no timezone data, gets updated later */\n public dateTz: DateTZ = DateNow(new Date());\n\n /** ID of the currently selected level */\n public active_level: string = '';\n /** ID of the currently selected type */\n public active_type: string = '';\n /** List of levels available for the active building */\n public levels: BuildingLevel[] = [];\n /** List of space types available for the active building */\n public space_types: Identity[] = [];\n /** Whether to show only items with a setup and/or breakdown time */\n public only_overflow: boolean;\n \n\n\t\tprivate spaceTypesSubscription: Subscription;\n\n\t\tevent_list: Booking[] = [];\n\t\tsearchStr: any;\n\t\tfoundSearchLength: number = 0;\n\t\tsearchedCounter: any = 1;\n\t\tshowSrchWarning: boolean;\n\t\ttotalFoundItem: number = 0;\n spaces: Space[] = [];\n\t\tbuildingsInSameCity: Building[];\n\t\tbuildingMenuItems: NavItem[];\n\t\tactiveBuildingName: string;\n\t levelsDD: any = [];\n\t roomLevelDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; };\n \n\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _dialog: MatDialog,\n private _router: Router,\n private _route: ActivatedRoute,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this._service.title = 'Day View';\n\n\t\t\t\tthis._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Init dateTz here once the organization data is loaded.\n this.dateTz = new DateTZ({ date: this.dateTz.ms, is_local_tz: false, building_tz: this.timezone });\n this.subscription(\n 'route.params',\n this._route.paramMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('level') && this.active_level !== params.get('level')) {\n const level = this._org.levelWithID(params.get('level'));\n /* istanbul ignore else */\n if (level) {\n const building = this._org.buildings.find(\n (bld) => bld.id === level.building_id\n );\n /* istanbul ignore else */\n if (building) {\n this.active_level = level.id;\n this._org.building = building;\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n }\n }\n }\n })\n );\n this.subscription(\n 'building',\n this._org.listen('active_building').subscribe(() => {\n this._booking_state_service.updateRoomList();\n // Update dateTz here when the building is changed.\n\t\t\t\t\t\t\t\t\t\tthis.dateTz = new DateTZ({\n\t\t\t\t\t\t\t\t\t\t\tdate: this.dateTz.ms,\n\t\t\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\t\t\tbuilding_tz: this.timezone,\n\t\t\t\t\t\t\t\t\t\t});\n const building = this._org.building;\n\n /* istanbul ignore else */\n if (!building.levels.find((lvl) => lvl.id === this.active_level)) {\n this.active_level = building?.levels[0]?.id;\n this.updateLevel();\n }\n\t\t\t\t\t\t\t\t\t\tthis.initSpace();\n\n this.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\t\t\t\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\t\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\t\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.levelsDD = [];\n\t\t\t\t\t\t\t\t\t\tthis.levels.forEach(el => {\n\t\t\t\t\t\t\t\t\t\t\tthis.levelsDD.push({\n\t\t\t\t\t\t\t\t\t\t\t\t display: el.name, value: el.id, meta: {} \n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\tthis.roomLevelDD = {\n\t\t\t\t\t\t\t\t\t\t\tddBoxClass: 'room-level',\n\t\t\t\t\t\t\t\t\t\t\toptions: this.levelsDD,\n\t\t\t\t\t\t\t\t\t\t\tdefaultSelected: this.levelsDD.filter(el => el.value === this.active_level )[0],\n\t\t\t\t\t\t\t\t\t\t\tonChangeCallback: this.onChangeActiveLevel.bind(this)\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\tthis.buildingsInSameCity = this._org.buildings.filter(\n\t\t\t\t\t\t\t\t\t\t\t(_) => _.city === building.city\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.generateBuildingMenu();\n\n \n })\n );\n \n });\n\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...this.filterEvents(list)];\n\n })\n );\n }\n\n private filterEvents(list): Booking[] {\n\t\t\tconst bookings = list;\n\t\t\tconst filterd_booking = bookings.filter((event) => {\n\t\t\t\t\tconst ignore = event.is_recurrent && event.recurrence_type === 'master';\n\t\t\t\t\treturn ( !ignore );\n\t\t\t});\n\n\t\t\treturn filterd_booking || [];\n }\n\n public initSpace() {\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.active_level ? this._org.building.id : this.active_level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0 && _.bookable);\n })\n );\n }\n\n // isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n \n searchBooking(value) {\n\n // Resetting warning flag\n this.showSrchWarning = false;\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = value.toLowerCase().trim();\n \n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.event_list, ...this.spaces];\n // Filtering the combine array to find matching room or booking\n const filteredItems = searchRoomsAndBookings(allItems, searchValue);\n \n // Updating the total number of found items in serach\n this.totalFoundItem = filteredItems.length;\n\n // Setting showSrchWarning flag if no result were found \n this.showSrchWarning = !this.totalFoundItem;\n\n // Updating lenght of found items for later use\n this.foundSearchLength = this.totalFoundItem - 1;\n\n if(this.searchStr !== value) {\n // Setting the first found as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[0]);\n // Resetting the search counter\n this.searchedCounter = 0;\n }\n else {\n // Handling case where seached string is the same as previou one \n // Incrementing search counter, loopoing back to 0 if it exceed the length of found items\n this.searchedCounter = ( this.searchedCounter < this.foundSearchLength ) ? this.searchedCounter + 1 : 0\n // Setting the next found items as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[this.searchedCounter]);\n }\n\n // Storing the current search string for future camparison\n this.searchStr = value;\n }\n\n\n public ngOnDestroy(): void {\n this._service.set('CONCIERGE.day_view.viewing', []);\n }\n\n\n \n\n // that encapsulates the common elements.\n public get timezone() {\n return this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone');\n }\n\n public updateDateTz(dateTz: DateTZ) {\n this.dateTz = dateTz;\n }\n\n public updateLevel() {\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n\t\t\t\tthis.initSpace();\n // this._router?.url?.includes('/booking-calendar') && this._router.navigate(['/home/results/booking-calendar', this.active_level], {relativeTo: this._route});\n }\n\n\t\tpublic generateBuildingMenu() {\n\n\n\t\t\tif(this.buildingsInSameCity.length) {\n\n\t\t\t\tconst menuItem: NavItem[] = [{\n\t\t\t\t\tdisplayName: this._org.building.name,\n\t\t\t\t\ticonName: 'close',\n\t\t\t\t\tchildren:[]\n\t\t\t\t}];\n\n\n\t\t\t\tthis.buildingsInSameCity.forEach(el => {\n\t\t\t\t\tconst buildingLevels: NavItem[] = [];\n\n\t\t\t\t\tel.levels.forEach(lvl => buildingLevels.push({\n\t\t\t\t\t\tdisplayName: lvl.name,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tlevel_id : lvl.id,\n\t\t\t\t\t\t\tbuilding_id: lvl.building_id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tbuildingLevels.push({ displayName: 'All Levels', children: [], meta: {\n\t\t\t\t\t\t\tlevel_id : '',\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t} \n\t\t\t\t\t});\n\n\t\t\t\t\tmenuItem[0].children.push({\n\t\t\t\t\t\tdisplayName: el.name,\n\t\t\t\t\t\tchildren: buildingLevels,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\tthis.buildingMenuItems = menuItem;\n\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\tpublic updateActiveBuilding (node) {\n\t\t\t// console.log(node);\n\t\t\tconst building = this.buildingsInSameCity.filter(bld => bld.id === node.meta.building_id)[0];\n\t\t\tthis._org.building = building;\n\t\t\tthis.activeBuildingName = building.name;\n\n\t\t\n\t\t\t\tthis.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\n\n\t\t\t\tthis.active_level = node.meta.level_id;\n\t\t\t\tthis.roomLevelDD.defaultSelected = this.levelsDD.filter(el => el.value === this.active_level )[0];\n\t\t\t\tthis.updateLevel();\n\t\t}\n\n\t\tonChangeActiveLevel(level:any) {\n\t\t\tthis.active_level = level.value;\n\t\t\t\n\t\t\tthis.updateLevel();\n\n\t\t}\n\n\t\t\n}\n\n","
\n
\n \n
\n \n
\n \n \n 0\">\n
\n {{activeBuildingName || item.displayName}}\n
\n \n
\n
\n \n
\n \n \n
\n
\n \n 1\">\n\n
\n \n \n \n
{{ totalFoundItem }}
\n \n
\n \n No search found!\n
\n
\n
\n\n \n \n \n \n
\n\n
\n \n
\n
\n
\n\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewChild, NgZone, DoCheck, ChangeDetectionStrategy, ChangeDetectorRef\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { filter, first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { HashMap, Identity } from '@mckinsey-converge/base';\n// import { MeetingDetailsModalComponent } from 'src/app/calendar/meeting-details-modal/meeting-details-modal.component';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, toMiddayUTC } from '@mckinsey-converge/date-tz';\nimport { isToday } from 'date-fns';\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n\n\nconst UPDATE_INTERVAL = 10;\n\n@Component({\n selector: 'day-view-timeline',\n templateUrl: './timeline.component.html',\n styleUrls: ['./timeline.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewTimelineComponent\n extends BaseDirective\n implements OnInit, OnChanges, OnDestroy\n{\n /** DateTZ object of the active date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** ID of the active level */\n @Input() public level: string;\n /** ID of the room type to filter displayed spaces by */\n @Input() public space_type: string;\n /** List of shown legend items */\n @Input() public legend: HashMap = {};\n /** Whether to show only items with a setup and/or breakdown time */\n @Input() public overflow_only: boolean;\n /** Whether space bookings are being loaded */\n @Input() public loading: boolean;\n\n @Input() undo_action;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n /** Top value of the content scroll */\n public scroll_top: number = 0;\n /** Left value of the content scroll */\n public scroll_left: number = 0;\n /** Offset of the scroll value when starting a drag */\n public scroll_offset: number = 0;\n /** List of spaces to display for */\n public spaces: Space[] = [];\n /** List of spaces to display for */\n public filtered_spaces: Space[] = [];\n /** Mapping of space ids to whether they are in view */\n public in_view: { [id: string]: boolean } = {};\n /** Percent of the day that is now */\n public now: number;\n /** Currently active hour of the day */\n public active_hour: string;\n /** Mapping of spaces loading booking date */\n public loading_space: { [id: string]: boolean } = {};\n /** Booking ID to open modal for */\n public view_id: string;\n /** Last update time for the space bookings */\n public last_update: number = 0;\n /** Whether an event is being dragged */\n public is_dragging: boolean;\n /** Client rectangle for the scroll area */\n public box: ClientRect;\n /** Whether to show the holding bay */\n // public show_holding_bay: boolean = true;\n\n public space_zones: string[] = [];\n\n public is_today: boolean = this.isToday();\n public modalInitialized = false;\n\n /** Scrollable area of the day view */\n @ViewChild('scroll_area', { static: true }) private scroll_area: ElementRef;\n\n @ViewChild(CdkVirtualScrollViewport) virtualScroll: CdkVirtualScrollViewport;\n isEventMoving: boolean = false;\n bookingEl: any;\n timeoutID: any;\n column: any;\n\n /** Update scroll box when the window is resized */\n @HostListener('window:resize')\n public onResize() {\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n public get is_loading() {\n return this._booking_state_service.loading;\n }\n\n public isToday() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }),\n 'day'\n );\n }\n\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _org: OrganisationService,\n private _route: ActivatedRoute,\n private _renderer: Renderer2,\n private _dialog: MatDialog,\n private _zone: NgZone,\n private cdr: ChangeDetectorRef,\n ) {\n super();\n }\n\n public get holding_bay(): Space {\n const bld = this._org.building;\n /* istanbul ignore else */\n if (bld && bld.holding_bay) {\n return this._spaces.find(bld.holding_bay);\n }\n return null;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this._booking_state_service.startPollingEveryFiveMin();\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n this._zone.runOutsideAngular(() => {\n this.interval('time', () => this.updateTime(), 15 * 1000);\n });\n // R--- return to see if the booking service needs updating\n this.subscription(\n 'dateTz',\n this._booking_state_service.dateTz.subscribe((dateTz) => {\n // const dateTz = new DateTZ({date});\n this.dateTz = dateTz;\n })\n );\n });\n });\n this.is_today = this.isToday();\n\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n })\n );\n\n }\n\n ngAfterViewInit() {\n const d2 = this._renderer.createElement('div');\n this._renderer.addClass(d2, 'adjustable-room-block-2');\n this.virtualScroll.elementRef && this._renderer.appendChild(this.virtualScroll.elementRef.nativeElement, d2);\n }\n\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.level && this._org.building) {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.updateTime();\n this.initSpaces();\n }\n if (changes.space_type) {\n this.initSpaces();\n }\n }\n\n public ngOnDestroy() {\n if (this._booking_state_service?.stopPolling) this._booking_state_service?.stopPolling();\n }\n\n public init() {\n this._service.title = 'Day View';\n this.subscription(\n 'viewing',\n this._service\n .listen('CONCIERGE.day_view.viewing')\n .subscribe((event) => this.scrollIntoView(event) )\n );\n // Subscribe to route query changes\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('view') || localStorage.getItem('CONCIERGE.view_booking')) {\n this.view_id = params.get('view');\n const details = localStorage.getItem('CONCIERGE.view_booking');\n const spaceJson = localStorage.getItem('CONCIERGE.view_booking_space');\n /* istanbul ignore else */\n if (details) {\n const space: Space | undefined = spaceJson\n ? new Space(JSON.parse(spaceJson))\n : undefined;\n const booking = new Booking({ ...JSON.parse(details), room: space });\n if(!this.modalInitialized) {\n this.modalInitialized = true;\n // this.view(booking, space);\n localStorage.removeItem('CONCIERGE.view_booking');\n localStorage.removeItem('CONCIERGE.view_booking_space');\n }\n }\n }\n })\n );\n \n /* istanbul ignore else */\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n /**\n * Update scroll parameters to match the change in the scroll position\n * @param event\n */\n public updateScroll(event) {\n this.scroll_top = event.target.scrollTop;\n this.scroll_left = event.target.scrollLeft;\n }\n\n\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n\n /** Update the now line position */\n private updateTime() {\n const now = new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n });\n this.now = (now.dateHour + now.minutes / 60) / 24;\n this.active_hour = now.startOfValue('hour').formatDate('HH:mm');\n this.is_today = this.isToday();\n this.cdr.detectChanges();\n }\n\n\n /**\n * Scroll booking to the event on the day view\n * @param booking Booking to scroll into view\n */\n private scrollIntoView(searchData: Booking | Space ) {\n if (searchData && this.scroll_area && this.scroll_area['elementRef'].nativeElement) {\n this.column && this._renderer.removeClass(this.column, 'wild');\n\n /** Select space column element using space id in search data - \n * space.id if seach data is space object or data.space.id if search data is booking object\n * \n */\n const spaceId = searchData['space'] ? searchData['space'].id : searchData.id;\n const element: HTMLDivElement = this.scroll_area['elementRef']\n .nativeElement.querySelector(`#space-col-${spaceId}`);\n\n\n this.column = element;\n\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n if(searchData['space'] && searchData['space'].id) \n this.bookingEl = element?.querySelector(`#${searchData.id}`)?.querySelector('.event-container');\n\n\n /* istanbul ignore else */\n if (element) {\n this.timeoutID && clearTimeout(this.timeoutID);\n this._renderer.addClass(element, 'wild');\n this.bookingEl && this._renderer.addClass(this.bookingEl, 'wild');\n const scroll_box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n\n let date_percent;\n if(searchData['space'] && searchData['space'].id) {\n date_percent = Math.abs(\n searchData['startDateTz'].dateDiff(\n searchData['startDateTz'].startOfValue('day'),\n 'minutes'\n )\n ) / (24 * 60);\n }\n \n\n const box = element.getBoundingClientRect();\n const left = box.left - scroll_box.left + this.scroll_area['elementRef'].nativeElement.scrollLeft - 500;\n const top = (searchData['space'] && searchData['space'].id) ? \n this.scroll_area['elementRef'].nativeElement.scrollHeight * date_percent - 10 :\n 0\n\n\n this.scroll_area['elementRef'].nativeElement.scrollTo({\n left: left,\n top: top,\n behavior: 'smooth',\n });\n\n this.timeoutID = setTimeout(()=> {\n element && this._renderer.removeClass(element, 'wild');\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n }, 3000);\n }\n }\n }\n\n /**\n * Setup an auto-scroll for the display view\n * @param x\n * @param y\n */\n public scrollView(x: number, y: number) {\n /* istanbul ignore else */\n if (x || y) {\n this.scroll_area['elementRef'].nativeElement.scrollTop += y || 0;\n this.scroll_area['elementRef'].nativeElement.scrollLeft += x || 0;\n /* istanbul ignore else */\n if (\n (y &&\n this.scroll_area['elementRef'].nativeElement.scrollTop >=\n this.scroll_area['elementRef'].nativeElement.scrollHeight) ||\n (x &&\n this.scroll_area['elementRef'].nativeElement.scrollLeft >=\n this.scroll_area['elementRef'].nativeElement.scrollWidth) ||\n (y && this.scroll_area['elementRef'].nativeElement.scrollTop <= 0) ||\n (x && this.scroll_area['elementRef'].nativeElement.scrollLeft <= 0)\n ) {\n this.clearInterval('auto_scroll');\n }\n // this.updateScroll({ target: this.scroll_area['elementRef'].nativeElement });\n }\n }\n\n public clearSelected() {\n this._service.set('CONCIERGE.day_view.viewing', null);\n }\n\n public cancelScroll() {\n this.clearInterval('auto_scroll');\n }\n\n /** */\n\n // public dragChange(is_dragging: boolean) {\n // if (is_dragging) {\n // this.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop; \n // this.subscription(\n // 'listen_move',\n // this._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n // const position = { x: event.clientX, y: event.clientY };\n // const y = position.y > this.box.bottom - this.box.height * 0.05\n // ? 1\n // : position.y < this.box.top + this.box.height * 0.05\n // ? -1\n // : 0;\n // const x = position.x > this.box.right - this.box.width * 0.05\n // ? 1\n // : position.x < this.box.left + this.box.height * 0.05\n // ? -1\n // : 0;\n // this.scrollView(x * 5, y * 5);\n // this._zone.runOutsideAngular(() => {\n // this.interval('auto_scroll', () => {\n // return this.scrollView(x * 40, y * 40) \n // }, 15);\n // });\n // this.cdr.detectChanges();\n // })\n // );\n // this.clearInterval('bookings');\n // } else {\n // this.cancelScroll();\n // this.unsub('listen_move');\n // }\n // }\n\n private initSpaces() {\n const holding_bay = this.holding_bay;\n this.filtered_spaces = this.spaces.filter(\n (i) =>\n (!this.space_type || i.zones.indexOf(this.space_type) >= 0) &&\n (!holding_bay || i.id !== holding_bay.id) &&\n i.bookable\n );\n this.filtered_spaces.sort((a, b) => a.local_name.localeCompare(b.local_name));\n this.space_zones = this.spaces.map((i) => `space-col-${i.id}`);\n }\n\n\n\n\t// public onEventDragging(isDragging: boolean): void {\n\t// \t\t// Check if dragging is initiated\n\t// \t\tif (isDragging) {\n\t// \t\t\t// Store the current scroll position\n\t// \t\t\tthis.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop;\n\t// \t\t\t// Subscribe to mouse move events\n\t// \t\t\tthis.subscribeToMouseMove();\n\t// \t\t\t// Clear existing interval for bookings\n\t// \t\t\tthis.clearInterval('bookings');\n\t// \t\t} else {\n\t// \t\t\t// Cancel scroll operation\n\t// \t\t\tthis.cancelScroll();\n\t// \t\t\t// Unsubscribe from mouse move events\n\t// \t\t\tthis.unsubscribeFromMouseMove();\n\t// \t\t}\n\t// }\n\n\t// Subscribe to mouse move events and handle scroll logic\n\t// private subscribeToMouseMove(): void {\n\t// \tthis.subscription(\n\t// \t\t'listen_move',\n\t// \t\tthis._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n\t// \t\t\t// Get mouse position\n\t// \t\t\tconst position = { x: event.clientX, y: event.clientY };\n\t// \t\t\t// Calculate scroll direction based on mouse position\n\t// \t\t\tconst [x, y] = this.calculateScrollDirection(position);\n\t// \t\t\t// Scroll the view based on calculated direction\n\t// \t\t\tthis.scrollView(x * 5, y * 5);\n\t// \t\t\t// Run auto-scroll logic\n\t// \t\t\tthis.runAutoScroll(x, y);\n\t// \t\t\t// Detect changes to update the view\n\t// \t\t\tthis.cdr.detectChanges();\n\t// \t\t})\n\t// \t);\n\t// }\n\n\t// Calculate scroll direction based on mouse position\n\t// private calculateScrollDirection(position: { x: number, y: number }): [number, number] {\n\t// \tconst tolerance = 0.05;\n\t// \tconst x = this.calculateDirection(position.x, this.box.left, this.box.right, tolerance);\n\t// \tconst y = this.calculateDirection(position.y, this.box.top, this.box.bottom, tolerance);\n\t// \treturn [x, y];\n\t// }\n\n\t// Calculate direction based on mouse position and element boundaries\n\t// private calculateDirection(pos: number, min: number, max: number, tolerance: number): number {\n\t// \tif (pos > max - this.box.width * tolerance) {\n\t// \t\t\treturn 1; // Scroll right\n\t// \t} else if (pos < min + this.box.width * tolerance) {\n\t// \t\t\treturn -1; // Scroll left\n\t// \t} else {\n\t// \t\t\treturn 0; // Do not scroll\n\t// \t}\n\t// }\n\n\t// Run auto-scroll logic\n\t// private runAutoScroll(x: number, y: number): void {\n\t// \tthis._zone.runOutsideAngular(() => {\n\t// \t\t\tthis.interval('auto_scroll', () => this.scrollView(x * 10, y * 10), 10);\n\t// \t});\n\t// }\n\n\t// Unsubscribe from mouse move events\n\t// private unsubscribeFromMouseMove(): void {\n\t// \tthis.unsub('listen_move');\n\t// }\n\n // public movingEvent(booking) {\n // this.isEventMoving = booking.isMoving;\n // this.loading_space[booking.movingId] = booking.isMoving;\n \n // }\n\n}\n\n","
\n\t
\n\t\t\n\t
\n\n\t
\n\t\t
\n\t\t\t\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Time
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ timeslot.name }}
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ room.local_name }}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tCapacity - {{ room.capacity || '0' }}\n\t\t\t\t\t\t\t{{ room.capacity === 1 ? 'person' : 'people' }}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t
\n
\n
\n
\n\t
\n\t\t
Moving meeting
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n
\n","import {\n Component,\n Input,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n Router\n} from '@angular/router';\nimport {\n BaseDirective, shorterBuildingDateFormatString,\n} from '@mckinsey-converge/base';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n Booking,\n Building,\n BookingStoreState,\n clearBookingFormData,\n cateringAllowed,\n openBookingSurvey,\n roomHasCateringHours\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface statusObject {\n text: string,\n title: string,\n image: string,\n}\n\n@Component({\n selector: 'booking-confirmation',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n \n

{{ data?.isEditSeries || (booking.is_recurrent && booking.recurrence_type === 'master') ? 'Recurring Series' : 'Booking' }} {{data?.status.title}}

\n
\n \n \n \n
\n
\n
\n

{{ booking.title }}

\n

Room is no longer available for your chosen date and time

\n
\n \n
\n
Status: {{data?.status.text}}
\n
Date: {{data?.dateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.typeString}} meeting ({{data?.durationString}})
\n
\n
\n
\n \n {{booking?.recurrence_period === 'list' ? 'Specific dates' : booking?.recurrence_period | titlecase}}\n \n - Conflicts({{data?.isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{data?.dateString}}
\n
End date: {{data?.endDateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.type}} meeting ({{data?.durationString}})
\n
\n\n
\n \n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n Address: {{building.address}},\n {{building.city}}\n
\n
Room: {{booking.space.local_name}}
\n
Room Capacity: {{booking.space.capacity}}
\n
\n \n
\n \n \n \n \n
\n
\n
\n
\n \n
\n \n

{{ data?.status.text }}

\n
\n
\n \n
\n \n

\n \n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n

{{booking.organiser.name}}

\n

{{attendees}}

\n

{{company}}

\n

{{charge_code}}

\n

{{headcount}}

\n

{{notes}}

\n

\n
\n \n

\n

\n

\n

\n

\n

\n \n \n \n

\n
\n
\n
\n
\n

Catering is available for this meeting room

\n Add catering\n\n \n
\n
\n
\n
\n \n

\n

\n

 

\n \n
\n\n
\n
\n
\n

Ooops - we're sorry!

\n

Unfortunately your selected room has been booked by another user

\n

Please try searching for another room.

\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./booking-confirmation.component.scss']\n})\nexport class BookingConfirmationComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n\n @Input() public confirmed: boolean;\n @Input() public loading: boolean;\n\n @Input() public modal: boolean;\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\t\t@Input('dataForConfirmation') public data: any; // consolidated data using for confirmation template\n\n /** Emitter for close events */\n @Output() public callback = new EventEmitter();\n\n public currentPage: string;\n\n\t\tpublic get booking(): Booking {\n\t\t\treturn this.data?.booking\n\t\t};\n\n\n public get building(): Building {\n return this.data?.booking.room.building;\n };\n\n public get disableCateringButton(): boolean {\n return !cateringAllowed(this.data?.booking, this.building);\n }\n\n public get charge_code() {\n return (this.data?.booking.equipment_codes || {})[\n this.data?.booking.room.email\n ] || 'No Charge Code'\n }\n\n public get headcount() {\n return (this.data?.booking.expected_attendees || {})[\n this.data?.booking.room.email\n ] || 0\n }\n\n public get attendees() {\n const a = Array.isArray(this.data?.booking.attendees) ? this.data?.booking.attendees.map(u => u?.name ? u.name : '') : [];\n return a.join(', ');\n }\n\n public get company() {\n return this.data?.booking.company.join(', ');\n }\n\n public get notes() {\n const note = this.data?.booking.notes.find(n => n.type === 'equipment');\n return note ? note.message : '';\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get roomHasCatering() {\n return roomHasCateringHours(this.building, this.data?.booking?.space) && cateringAllowed(this.data?.booking, this.building);\n }\n\n public listItems(order) {\n return order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.data?.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n }\n\n constructor(\n private store: Store,\n private _router: Router,\n ) {\n super();\n }\n\n public getStatusColor (statusText: string): string {\n switch (statusText) {\n case 'confirmed':\n return 'approved'\n case 'unavailable':\n return 'cancelled'\n default:\n return statusText;\n }\n }\n\n public hasData() {\n return (this.confirmed && !this.loading) || this.isUnavailable();\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public async returnHome() {\n \n if (this.modal || this.placeIntoModal) {\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n } else {\n if(!this.isUnavailable()){\n this.store.dispatch(openBookingSurvey());\n // Clear everything out\n this.store.dispatch(clearBookingFormData());\n this._router.navigate(['/', 'home']);\n } else {\n await this._router.navigate(['/home', 'results'], { queryParams: { display: 'list' }});\n }\n }\n }\n\n public async startCatering() {\n this.store.dispatch(clearBookingFormData());\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n await this._router.navigate(['/', 'home', 'catering', this.data?.booking.id]);\n }\n\n public isUnavailable() {\n return this.data?.status.text.toLowerCase() === 'unavailable'\n }\n\n getTooltipText() { \n return this.data.booking.occurrence_details?.filter(ocurrence => ocurrence.id !== this.data.booking.id).map((item)=>{\n let date = item.start_epoch * 1000;\n let specificDates = new DateTZ({date, is_local_tz: false, building_tz: this.data.booking.timezone});\n return shorterBuildingDateFormatString(specificDates).slice(3);\n })\n }\n\n \n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n Booking,\n BookingFormData,\n selectActiveForm,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n\t\tSpace,\n\t\tgetLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent, shorterLocalDateFormatString } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-booking-create',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingCreateComponent extends BookingFormBaseComponent implements OnInit {\n\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.booking = this.bookingFormToBooking(next);\n }\n }));\n\n\t\t\t\t// in the parent component\n\t\t\t\tthis.updateConfimatinModal();\n }\n\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n this.booking = this.bookingFormToBooking(this.data.value);\n // const booking_form_data = this.data.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n if (!bookable) {\n // Refactored for\n //\thttps://acaprojects.atlassian.net/browse/MCK-1498\n //\thttps://mckinsey.atlassian.net/browse/CNG-97\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n\t\t\t\t\t\t\t\t\t// update template properties and booking\n\t\t\t\t\t\t\t\t\tthis.handleBookingSuccessResponse(bkn);\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n\t\t\t\t\t\t\t\t\t\t\tthis.loading = false;\n \tthis.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n },(err) => {\n this.timeout('error', () => {\n\t\t\t\t\t\t\t\t\tthis.handleBookingErrorMessage();\n }, 500);\n }\n );\n }\n\n}\n","
\n
\n \n

{{ warningMessage }}

\n \n
\n
\n \n \n \n \n
\n
\n
\n
\n
\n
\n

Book {{booking?.space?.local_name}}

\n
\n
\n \n
\n
\n
\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Details

\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
{{type}} meeting ({{durationString}})
\n
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' : data?.value?.recurrence_period | titlecase}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t - Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Start date: {{dateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
End date: {{endDateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Time: {{timeString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{type}} meeting ({{durationString}})
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\n
\n
Address: {{building?.address}},\n {{building?.city}}
\n
Room: {{booking?.space?.local_name}}
\n
Capacity: {{booking?.space?.capacity}}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n","import {Component,OnInit,Input,Output,EventEmitter,\n } from '@angular/core';\n import {\n Booking,\n selectActiveForm,\n BookingFormData,\n\t\tBookingStoreState,\n } from '@mckinsey-converge/data-common';\n import {\n\t\tStore,\n select,\n } from '@ngrx/store';\n import {\n distinctUntilChanged, take,\n } from 'rxjs/operators';\n import { BaseDirective } from '@mckinsey-converge/base';\n\timport {\n\t\tRoomStoreState,\n\t} from '@mckinsey-converge/rooms';\n\timport {\n\t\tBuildingStoreState\n\t} from '@mckinsey-converge/buildings';\n\timport { UserStoreState } from '@mckinsey-converge/user';\n\n\texport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n\n @Component({\n selector: 'app-booking-edit-wrapper',\n template: `
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
`,\n styleUrls: ['./booking-create.component.scss']\n })\n export class BookingEditWrapperComponent extends BaseDirective implements OnInit {\n\n\t\tpublic booking: Booking;\n\t\tpublic loading: boolean = true;\n\n constructor(\n public store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n this.subscription('activeForm',\n this.store.pipe(take(1),\n\t\t\t\t\tselect(selectActiveForm),\n \tdistinctUntilChanged()\n\t\t\t\t\t).subscribe((next: BookingFormData | undefined) => {\n\t\t\t\t\t\tthis.loading = false;\n \t\tif (next && next?.dateTz) {\n \t\tthis.booking = new Booking(next);\n \t\t}\n }));\n\n }\n\n }\n","import {\n Component,\n OnInit,\n Input,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport {\n Booking,\n selectActiveForm,\n storeBookingFormData,\n BookingFormData,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n getLastDateFromList,\n Space,\n SeriesAction\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\n@Component({\n selector: 'app-booking-edit',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingEditComponent extends BookingFormBaseComponent implements OnInit {\n @Input() public booking: Booking;\n @Output() public updateCallback = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n public roomEmail: string;\n\n public ngOnInit(): void {\n super.ngOnInit();\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n\n this.modal = !this.isEditSeries && !this.placeIntoModal;\n this.roomEmail = this.booking.space.email;\n const attendees = (this.data?.value?.attendees?.length && this.data?.value?.attendees[0]?.meta)\n ? this.data.value.attendees\n : this.booking.attendees.filter(bk => bk.name !== '' && bk.email !=='').map(u => {\n return {\n value: u.email,\n display: u.name,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: u.name,\n meta: { external: u.external, user: u, color: u.email.toLowerCase().includes('mckinsey.') ? 'internal' : 'external' },\n }\n });\n\n const company = (this.data?.value?.company?.length && this.data?.value?.company[0]?.groupId)\n ? this.data?.value?.company\n : this.booking.company.map(u => {\n return {\n value: u,\n display: u,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: u,\n }\n });\n\n const head_count = this.booking?.expected_attendees[this.roomEmail] ? this.booking?.expected_attendees[this.roomEmail] : 0;\n const code = this.booking?.equipment_codes[this.roomEmail] ? this.booking?.equipment_codes[this.roomEmail] : '';\n const organiser = (this.data?.value?.organiser && this.data?.value?.organiser?.meta)\n ? this.data?.value?.organiser\n : {\n display: this.booking.organiser.name,\n value: this.booking.organiser.email,\n meta: { user: this.booking.organiser }\n };\n const notes = Array.isArray(this.booking.notes) ? this.booking.notes.find(n => n.type === 'equipment')?.message : this.booking.notes;\n const selectedRoom = this.data?.value?.selectedRoom\n ?\n this.data?.value?.selectedRoom\n :\n {\n space: this.booking.room, // this.building,\n };\n\n const payload = {\n ...this.booking.toJSON(),\n attendees,\n code,\n head_count,\n notes,\n organiser,\n selectedRoom,\n company\n };\n this.store.dispatch(storeBookingFormData({\n payload: payload\n }));\n \n if(this.isEditSeries) {\n this.booking = this.bookingFormToBooking(this.data.value, this.isEditSeries); \n }\n // in parent component\n this.updateConfimatinModal();\n\n\n }\n\n public updateNotes(booking, note, room) {\n const notes = [];\n const cateringNotes = this._cateringNotesService.getNotes();\n const isEquipmentNote = booking.notes.find(note => note.type === 'equipment');\n const isCateringNote = booking.notes.find(note => note.type === 'catering');\n\n if (cateringNotes.length && !isCateringNote) {\n notes.push(cateringNotes[0]);\n }\n\n if (isEquipmentNote) {\n booking.notes.map(item => {\n const message = cateringNotes.length && item.type === 'catering' ? cateringNotes[0].message : item.message;\n\n notes.push({\n ...item,\n author : this.currentUser.name,\n message : item.type === 'equipment' ? note : message,\n space: item.type === 'equipment' ? room : item.space,\n date: item.type === 'equipment' ? new Date().getTime() : item.date\n })\n });\n } else {\n if (note) {\n notes.push({\n author: this.currentUser.name,\n type: \"equipment\",\n message: note,\n space: room,\n date: new Date().getTime()\n })\n }\n }\n return notes;\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n const booking_form_data = this.data.value;\n\n if(!this.isEditSeries) {\n\t\t\t // clone booking to allow editing\n const booking = cloneDeep(this.booking);\n \n\t\t\tbooking.title = booking_form_data.title;\n\t\t\tbooking.attendees = this.formToAttendees(booking_form_data.attendees);\n\t\t\tbooking.company = this.formToCompany(booking_form_data.company);\n\t\t\tbooking.notes = this.updateNotes(this.booking, booking_form_data.notes, this.roomEmail);;\n\t\t\tbooking.equipment_codes = { [this.roomEmail]: booking_form_data.code };\n\t\t\tbooking.expected_attendees = { [this.roomEmail]: booking_form_data.head_count };\n\t\t\tbooking.organiser = booking_form_data.organiser?.meta.user;\n\t\t\tconst has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom?.space?.email || booking?.space?.email]: 900} : null; // 900 seconds = 15 min\n\t\t\t// Removing the note does not remove the existing setup / breakdown\n\t\t\tif (has_note_buffer) {\n\t\t\t booking.setup = has_note_buffer;\n\t\t\t booking.breakdown = has_note_buffer;\n\t\t\t}\n booking.opt_out = booking_form_data.opt_out;\n // booking.outlook_opt_out = booking_form_data.outlook_opt_out;\n\t\t\tthis.booking = booking;\n\t\t }\n\t\t else {\n\t\t\tthis.booking = this.bookingFormToBooking(booking_form_data, this.isEditSeries);\n\t\t }\n\n\n this.loading = true;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n // We expect the current booking to be returned form this api call,\n if (bookable) {\n\n this._bookings_service.save(this.booking, this.isEditSeries).then(\n (bkn) => {\n // update template properties and booking\n this.handleBookingSuccessResponse(bkn);\n // update callback in case of standard booking edit\n this.updateCallback && this.updateCallback.emit(this.booking);\n\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n this.loading = false;\n this.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n } else {\n this.handleBookingErrorMessage();\n return;\n }\n },\n (err) => {\n this.handleBookingErrorMessage();\n }\n );\n }\n\n public callback() {\n this.closeCallback.emit(true);\n }\n\n}\n","import {\n Component,\n OnInit,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport { TopBarHeaderMode, RoutePayload } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n dateLocalFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase,\n dateBuildingFormatString,\n shorterLocalDateFormatString,\n DialogEvent,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n Space,\n SpacesService,\n User,\n BookingNote,\n BookingFormData,\n BookingStoreState,\n storeBookingFormData,\n bookingStatusDetails,\n clearBookingFormData,\n CateringNotesService,\n getLastDateFromList,\n BOOKING_STATUS,\n DataForConfirmation,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n take,\n} from 'rxjs/operators';\nimport {\n BuildingStoreState\n} from '@mckinsey-converge/buildings';\nimport {\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport {\n Router\n} from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-booking-base',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingFormBaseComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results', 'room'],\n queryParams: {}\n };\n\n @Output() public closeCallback = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n public placeIntoModal = false;\n // Eliminate selectedRoom (room building capacity )\n public modal = false;\n public data = new BehaviorSubject(undefined);\n public submitTimestamp: number;\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public updated: boolean;\n /** Display loading template */\n public loading: boolean= false;\n public booking: Booking = new Booking({});\n /** Current User */\n public currentUser: User;\n public invalidForm: boolean = true;\n public showWarningBanner: boolean = false;\n public warningMessage: string;\n\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n\n constructor(\n public _service: ApplicationService,\n public store: Store,\n public router: Router,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _spaces: SpacesService,\n public _cateringNotesService: CateringNotesService,\n public dialog: MatDialog,\n private _users: UsersService\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n\n }\n\n public get building(){\n return this.booking.room.building;\n }\n\n public get type() {\n return this.booking.bookingTypeLabel;\n }\n\n public get internal_external_type() {\n return this.booking.room?.[0].filters.external === true? \"External\" : \"Internal\";\n }\n\n public get date(){\n // R--- remove if no longer used.\n return this.booking.startDateTz;\n }\n\n public get dateString() {\n return this.booking.startDateTz.formatDate('ccc d MMM yyyy'); //shorterLocalDateFormatString(this.booking.startDateTz);\n \n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n public async goToBackRoute() {\n await this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n /**\n * Continue to Booking Form\n */\n public createBooking() { // todo change links based on usage\n // trigger the booking form submit\n this.submitTimestamp = new Date().getTime();\n }\n\n // submit the booking form\n public submitForm(formGroup: any) {\n let creator: User;\n if (formGroup.has_delegate) {\n if (formGroup.organiser.value !== this.currentUser.email) {\n creator = this.currentUser;\n }\n }\n\n // Combines booking with selected form fields and not the entire formGroup like other places.\n // to combine booking with selected form fields on submit - WHY IS THIS NEEDED TO DISPACH TO STORE BOOKING FORM DATA ???\n // THIS ISSUE IS SPILLING INTO - libs/data-common/src/lib/booking/booking.selectors.ts lno: 70\n // - due to .toJSON recurrence_starts becomes Array ?!?\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...this.booking.toJSON(),\n attendees: formGroup.attendees,\n code: formGroup.code,\n head_count: formGroup.head_count,\n notes: formGroup.notes,\n organiser: formGroup.organiser,\n creator,\n title: formGroup.title,\n company: formGroup.company,\n opt_out: formGroup.opt_out,\n outlook_opt_out: formGroup.outlook_opt_out\n }\n }));\n this.saveChanges();\n }\n\n // submit the booking form\n public validateForm(valid: boolean) {\n this.invalidForm = !valid;\n }\n\n public setupNotes(note: string, roomEmail: string) {\n if (note && note.length ) {\n // this note was required to update setup and breakdown\n return [{\n author: this.currentUser.name,\n type: \"equipment\",\n message: !Array.isArray(note) ? note : note[0].message,\n space: roomEmail,\n date: new Date().getTime()\n }] as BookingNote[];\n }\n\n return [];\n }\n\n public formToAttendees(attendees: any[]) {\n return !attendees ? [] : attendees.map(a => {\n let raw_user = {\n first_name: '',\n last_name: '',\n email: '',\n name: '',\n type: 'internal',\n external: false,\n visitor: false,\n };\n if (a.meta?.external) {\n // External users get assigned a random email\n const nameParts = a.display.split(' ');\n const length = nameParts.length;\n if (length) {\n raw_user.first_name = nameParts[0];\n raw_user.name = nameParts.join(' ');\n }\n if (length > 1) {\n nameParts.shift();\n raw_user.last_name = nameParts.join(' ');\n }\n raw_user.email = a.value ?? `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n raw_user.type = 'external'; // retain external identity\n raw_user.external = true;\n raw_user.visitor = true;\n } else if (a.meta?.user) {\n raw_user = a.meta.user;\n }\n else {\n raw_user = a;\n }\n return new User(raw_user);\n });\n }\n\n public formToCompany(companies: any[]) {\n return !companies ? [] : companies.map(a => {\n return a.value;\n });\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n const booking_form_data = this.data.value;\n // override in child class\n }\n\n public callback() {\n // mock interface\n }\n\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n return space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser\n });\n }\n\n public displayWarningBanner(custom: string) {\n this.warningMessage = custom;\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n\n public discardChanges() {\n this.store.dispatch(clearBookingFormData());\n this.closeCallback.emit(true)\n }\n\n\n\n setupOrganiser(booking_form_data: BookingFormData) {\n if(booking_form_data.organiser?.meta?.user){\n return booking_form_data.organiser?.meta?.user;\n }\n else{\n booking_form_data.organiser = {...booking_form_data.organiser, meta: {user: this.currentUser}}\n return booking_form_data.organiser?.meta.user;\n }\n }\n\n public bookingFormToBooking(bookingData, isEditSeries: boolean = false): Booking {\n let booking_form_data = bookingData;\n const has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom.space.email]: 900} : {}; // 900 seconds = 15 min\n const attendees = this.formToAttendees(booking_form_data.attendees);\n const company = this.formToCompany(booking_form_data.company);\n const start_epoch = booking_form_data?.dateTz?.seconds;\n const end_epoch = booking_form_data.dateTz.addValue({ minutes: booking_form_data.duration }).seconds;\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = booking_form_data?.nextBusinessDay || false\n\n const raw_data = {\n id: isEditSeries ? booking_form_data.id : '',\n all_day: booking_form_data.all_day || false,\n attendees,\n booking_type: booking_form_data.bookingType.value,\n catering: booking_form_data.catering || [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data.timezone,\n equipment_codes: {[booking_form_data.selectedRoom.space.email]: booking_form_data.code},\n expected_attendees: {[booking_form_data.selectedRoom.space.email]: booking_form_data.head_count},\n has_catering: booking_form_data.has_catering || false,\n needs_space: booking_form_data.needs_space || false,\n organiser: this.setupOrganiser(booking_form_data),\n notes: this.setupNotes(booking_form_data.notes, booking_form_data.selectedRoom.space.email),\n creator: booking_form_data.creator,\n room: booking_form_data.selectedRoom.space,\n title: booking_form_data.title,\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n /* Staff Recurring form fields */\n is_recurrent: booking_form_data.is_recurrent,\n recurrence_count: booking_form_data.recurrence_count,\n recurrence_days: booking_form_data.recurrence_days,\n recurrence_endTz: booking_form_data.recurrence_endTz,\n recurrence_exceptions: booking_form_data.recurrence_exceptions,\n recurrence_interval: booking_form_data.recurrence_interval,\n recurrence_period: booking_form_data.recurrence_period,\n recurrence_starts: booking_form_data.recurrence_starts,\n\n occurrence_details: booking_form_data.occurrence_details,\n // occurrence_edits: booking_form_data.occurrence_edits || null,\n // occurrence_ids: booking_form_data.occurrence_ids || null,\n recurrence_type: booking_form_data.recurrence_type || null,\n recurrence_master_id: booking_form_data.recurrence_master_id,\n edits: booking_form_data?.edits,\n ignore: booking_form_data?.ignore,\n\n opt_out: bookingData.opt_out,\n \n //outlook_opt_out: true //bookingData.outlook_opt_out keeping always true for now (will never send outlook invite) until feature fully tested and released to prod \n\n\n };\n\n return new Booking(raw_data);\n }\n\n\n public async handleBookingSuccessResponse(bkn) {\n\n // const user: User = this._users.current;\n // if(this._users.current.email === bkn.organiser.email) {\n // this._users.current.opt_out = true;\n // }else {\n // this._users.current.delegates.map(el => { \n // if(el.email === bkn.organiser.email) {\n // el.opt_out = true;\n // }\n // return el;\n // })\n // }\n \n\n //const responceBkn = new Booking({...bkn}); // \n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this.updateConfimatinModal();\n this._booking_state_service.replace(this.booking);\n\n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(this.booking.recurrence_master_id !== null && this.isEditSeries)\n {\n const master_booking = await this._bookings_service.show(this.booking.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n\n // Heap track event\n this._service.analytics.track('update', {\n booking_id: this.booking.id,\n office: this.booking.room.building.name, // this.building.name,\n room: this.booking.room.simple_name,\n start_time: this.booking.startDateTz.ms,\n end_time: this.booking.endDateTz.ms,\n catering: !!this.booking.catering.length,\n headcount: this.data.value.head_count,\n });\n\n }\n\n\n public handleBookingErrorMessage() {\n this.loading = false;\n this.booking.status = BOOKING_STATUS.unavailable\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n this.updateConfimatinModal();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n\n if (this.booking.multi_rooms && this.booking.multi_rooms.length > 0) {\n this.booking.multi_rooms.forEach((room) => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n } \n if (this.booking.room) {\n totalConflicts =\n this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n }\n\n const result = {\n is_conflict: totalConflicts > 0,\n total_Conflicts: totalConflicts,\n };\n return result;\n}\n\n\n/**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details?.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n const requestedEndDateTz = getLastDateFromList(recurrenceStart); //shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n \n // add one day if user room selection from next business day section on result page\n const endDatestring = this.nextBusinessDay ? requestedEndDateTz.addValue({ minutes: this.data?.value.offset }) : requestedEndDateTz;\n\n return endDatestring.formatDate('ccc d MMM yyyy');\n }\n\n /**\n * Opens a modal to display recurrence conflicts for a given room.\n *\n * @param {Space} room - The room for which recurrence conflicts are being displayed.\n *\n * This function opens a modal dialog to show recurrence exceptions (conflicts)\n * for the specified room.\n *\n * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n * and mckinsey-converge/apps/staff/src/app/booking/catering/catering.component.ts\n */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n status: 'confirmed'\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\n}\n","import {BehaviorSubject,fromEvent,\n} from 'rxjs';\nimport {take,throttleTime,tap,distinctUntilChanged,map\n} from 'rxjs/operators';\nimport {select,Store\n} from '@ngrx/store';\nimport {Component,Inject,OnInit,\n} from '@angular/core';\nimport { BaseDirective, dateBuildingFormatString, startEndTimeWithZoneFormatString, humaniseDuration, toTitleCase, closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { User,\n\tApplicationService,\n\tAvailableBookingFields,\n\tBooking,\n\tBookingFormData,\n\tBookingFlowSettings,\n\tSpacesService,\n\tstoreBookingFormData,\n\tDateDurationData,\n\tselectFilteredByIdResults,\n\tgenerateBookingForm,\n\tcateringAllowed,\n\trulesForSpace,\n\tgetStatusErrorMessage,\n\troomHasCateringHours,\n\tBookingsService,\n\tSpaceConflictAlertModalData,\n\tSpaceFilterReason,\n\tBuilding,\n\tBuildingCity,\n\tflattenDisplayOffices,\n\troomSizeOptions,\n\tDEFAULT_BOOKING_DURATION,\n\tbookingTypeOptions,\n\troomFormDataToQuery,\n\tclearBookingFormData,\n\tBookingStateService,\n\tRecurrencePeriod,\n\tselectActiveForm,\n\tSeriesAction\n} from '@mckinsey-converge/data-common';\nimport { first } from 'rxjs/operators';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { CancelBookingModalComponent } from '../cancel-booking-modal/cancel-booking-modal.component';\nimport { BookingDurationModalComponent } from '../booking-duration-modal/booking-duration-modal.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport {\n\tloadByIdResults, loadRoomsForResults, loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { FormGroup } from '@angular/forms';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictAlertModalComponent, SelectOption } from '@mckinsey-converge/ui';\nimport { buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { RoomBookingModalComponent } from '../room-booking-modal/room-booking-modal.component';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { CateringDropComponent } from '@mckinsey-converge/ui';\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n\tselector: 'app-booking-details-modal',\n\ttemplateUrl: 'booking-details-modal.component.html',\n\tstyleUrls: ['./booking-details-modal.component.scss']\n})\nexport class BookingDetailsModalComponent extends BaseDirective implements OnInit {\n\tpublic TopBarHeaderMode = TopBarHeaderMode;\n\tpublic title: string;\n\tpublic roomName: string;\n\tpublic roomLocation: string;\n\tpublic host: string;\n\tpublic hostEmail: string;\n\tpublic type: string;\n\tpublic status: string;\n\tpublic statusText: string = '';\n\tpublic statusImage: string;\n\tpublic durationString: string;\n\tpublic dateString: string;\n\tpublic timeString: string;\n\tpublic capacity: number;\n\tpublic attendeesString: string;\n\tpublic chargeCode: string;\n\tpublic headcount: number;\n\tpublic requirements: string;\n\tpublic showDetails: boolean;\n\tpublic warningMessage: string;\n\tpublic mapUrl: string;\n\tpublic focusedRoom: string;\n\tpublic expandedLocation = false;\n\tpublic isRecurrentBooking = false;\n\tpublic isMultiroomBooking:boolean = false;\n\n\tpublic checkingExtendable: boolean;\n\tpublic extendableMaximum: number;\n\n\tpublic receiptionEmail: string;\n\n\tpublic data = new BehaviorSubject(undefined);\n\tpublic byIdResults = new BehaviorSubject(undefined);\n\n\t// Track event date changes in the UI in this param\n\tpublic alternativeWeekStartDateTz: DateTZ;\n\t/** Current User */\n\tpublic currentUser: User;\n\tpublic expandedAvailability: boolean = false;\n\t// Set in the room availablity callback\n\tpublic mobile: boolean = false;\n\tpublic loading: boolean = false;\n\tpublic showInfoBanner: boolean = false;\n\tpublic showWarningBanner: boolean = false;\n\tpublic showCatering: boolean = false;\n\t/** Application settings for bookings */\n\tpublic settings: BookingFlowSettings;\n\tpublic form: FormGroup;\n\tpublic companyString: string;\n\n\tinvalidDueToOfficeRule: boolean;\n\tbuildings: SelectOption[];\n\tmaster_booking: Booking;\n\n\tprivate recurrence_period: RecurrencePeriod;\n\tprivate recurrence_interval: number;\n\toccurrence_details: { start_epoch: number; dateTz: DateTZ; id: string; }[];\n\tdisableSeriesEditButton: boolean = false;\n\topt_out: boolean;\n\toutlook_opt_out: boolean;\n\t/** List of available booking fields for the form */\n\tpublic get available_fields(): AvailableBookingFields[] {\n\t\treturn this.settings?.show_fields || [];\n\t}\n\n\tpublic get emailURL() {\n\t\treturn `mailto:${encodeURIComponent(this.receiptionEmail)}?cc=${encodeURIComponent(this.hostEmail)}&subject=Enquiry%3A%20${encodeURIComponent(this.roomName)}&body=Details%3A%0ADate%3A%20${encodeURIComponent(this.dateString)}%0ATime%3A%20${encodeURIComponent(this.timeString)}%0A${encodeURIComponent(this.type)}%20meeting%20(${encodeURIComponent(this.durationString)})%0AAddress%3A%20${encodeURIComponent(this.roomLocation)}%0ARoom%3A%20${encodeURIComponent(this.roomName)}%0ACapacity%3A%20${encodeURIComponent(this.capacity)}%20people%0A%0ANeeding%20assistance%20with%3A%0A`;\n\t}\n\n\tpublic disableCancelButton: boolean = false;\n\tpublic disableEditTimeButton: boolean = false;\n\tpublic disableUpdateDetailsButton: boolean = false;\n\n\tprivate _specific_dates = false;\n\n\n\tconstructor(\n\t\t private router: Router,\n private route: ActivatedRoute,\n\t\t@Inject(MAT_DIALOG_DATA) public _data: any,\n\t\tprivate dialogRef: MatDialogRef,\n\t\tprivate store: Store,\n\t\tpublic _bookings: BookingsService,\n\t\tprivate _service: ApplicationService,\n\t\tprivate _spaces: SpacesService,\n\t\tprivate dialog: MatDialog,\n\t) {\n\t\tsuper();\n\t\tthis.roomLocation = this._data.booking.room.street_and_city;\n\t\tthis.initDisplayValues(this._data.booking);\n\t\tthis.timeout('slowinit', () => {\n\t\t\tthis.initDisplayValues(this._data.booking);\n\t\t\tif (this._data.cancel && this.displayCancelModal()) {\n\t\t\t\tthis.cancelBooking();\n\t\t\t}\n\t\t\tif (this._data.addCatering && this.roomHasCatering) {\n\t\t\t\tthis.addCatering();\n\t\t\t}\n\t\t\t// Close up the loader panel\n\t\t\tthis.timeout('hide modal mask', () => {\n\t\t\t\tthis._data.hasLoaderUrl = false;\n\t\t\t}, 300);\n\t\t}, 1000);\n\t}\n\n\n\tpublic ngOnInit() {\n\n\t\t/**\n\t\t * Update booking recurrence and occurrence details based on master booking data.\n\t\t *\n\t\t * This code block checks if there is a master booking available in the data.\n\t\t * If a master booking exists, it extracts recurrence period and interval information,\n\t\t * and processes occurrence details, excluding the current booking itself. Occurrence\n\t\t * start epochs are converted to milliseconds and date-time strings are created in the\n\t\t * building's timezone.\n\t\t */\n\t\tif(this._data?.master_booking !== null) {\n\t\t\tthis.recurrence_period = this._data?.master_booking?.recurrence_period;\n\t\t\tthis.recurrence_interval = this._data?.master_booking?.recurrence_interval;\n\n\t\t\tconst bookingData = this._data?.master_booking || this._data?.booking;\n\n\t\t\tthis.occurrence_details = bookingData.occurrence_details && bookingData.occurrence_details\n\t\t\t\t.filter(ocurrence => ocurrence.id !== bookingData.id)\n\t\t\t\t.map(ocurrence => ({\n\t\t\t\t\t...ocurrence,\n\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000, // Convert start epoch to milliseconds\n\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000, // Create a DateTZ object with the converted epoch\n\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\tbuilding_tz: bookingData.timezone\n\t\t\t\t\t})\n\t\t\t\t}));\n\t\t}\n\n\n\t\tthis.subscription('currentUser', this.store.select(selectCurrentUser)\n\t\t\t.pipe(take(1))\n\t\t\t.subscribe((user: User | undefined) => {\n\t\t\t\t// Once we know we have the user loaded.\n\t\t\t\tthis.currentUser = new User(user);\n\t\t\t})\n\t\t);\n\n\t\tthis.subscription('byId', this.store.pipe(\n\t\t\tselect(selectFilteredByIdResults)\n\t\t).subscribe(next => {\n\t\t\t// Should be fired when loading by ID in URL\n\t\t\tthis.byIdResults.next(next.success?.spaces?.length ? next.success.spaces[0].settings.bookings : EMPTY_ARRAY);\n\t\t}));\n\n\t\tthis._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n\t\t\tthis.settings = this._service.setting('app.booking');\n\t\t\tthis.form = generateBookingForm(this._data.booking, this.available_fields);\n\t\t});\n\n\t\tconst breakpoint = 450;\n\t\tif (window) {\n\t\t\tthis.mobile = window.innerWidth < breakpoint;\n\t\t}\n\n\t\tfromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n\t\t\tnext: val => {\n\t\t\t\tconst target = val.target as Window;\n\t\t\t\tthis.mobile = target.innerWidth < breakpoint;\n\t\t\t}\n\t\t})).subscribe();\n\n\n\t\tthis.subscription('buildings', this.store.pipe(\n\t\t\tselect(buildingStateSelector),\n\t\t\tselect(selectBuildingOptionsGroupedByCity),\n\t\t\tmap((grouped: Map) => {\n\t\t\t\treturn flattenDisplayOffices(grouped);\n\t\t\t}),\n\t\t\tdistinctUntilChanged()\n\t\t).subscribe(next => {\n\t\t\tthis.buildings = next;\n\t\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t\t}));\n\n\n\t}\n\n\t// public get isCateringAdded()\n\n\tpublic get disableCateringButton() {\n\t\tswitch (this.status) {\n\t\t\tcase 'cancelled':\n\t\t\tcase 'declined':\n\t\t\tcase 'expired':\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\treturn !cateringAllowed(this._data?.booking, this._data.booking.room.building);\n\t\t}\n\t}\n\n\tpublic get roomHasCatering() {\n\t\treturn roomHasCateringHours(this._data.booking.room.building, this._data.booking?.room);\n\t}\n\n\tpublic get catering() {\n\t\treturn this._data.booking?.catering || [];\n\t}\n\n\tpublic formatDeliveryTime(order) {\n\t\treturn this._data.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n\t}\n\n\tpublic initDisplayValues(booking: Booking) {\n\t\tconst roomEmail = booking.room.email || '';\n\t\tthis.dateString = dateBuildingFormatString(booking.startDateTz, true);\n\t\tthis.timeString = startEndTimeWithZoneFormatString(booking.startDateTz, booking.displayEndDateTz);\n\t\tthis.host = booking.organiser.name;\n\t\tthis.opt_out = booking.opt_out;\n\t\tthis.outlook_opt_out = booking.outlook_opt_out;\n\t\tthis.hostEmail = booking.organiser.email;\n\t\tthis.title = booking.title;\n\t\tthis.type = toTitleCase(booking.booking_type);\n\t\tthis.roomName = booking.local_room_name || '';\n\t\tthis.durationString = humaniseDuration(booking.duration);\n\t\tthis.capacity = booking.room.capacity; // in case of multiroom booking should we sum the capacity for all the rooms?\n\t\tthis.attendeesString = booking.attendees.map(a => a.name).join(', ');\n\t\tthis.chargeCode = booking.equipment_codes[roomEmail];\n\t\tthis.headcount = booking.expected_attendees[roomEmail];\n\t\tthis.mapUrl = booking.room.level.map_url;\n\t\tthis.extendableMaximum = 0;\n\t\tthis.focusedRoom = `area-${booking.room.map_id}-status`;\n\t\tthis.checkingExtendable = false;\n\t\tthis.receiptionEmail = this._data.booking.room.building?._settings?.discovery_info?.reception_email || '';\n\t\tthis.companyString = booking.company.join(', ');\n\t\t// UI button availability\n\t\tthis.disableCancelButton = true; // CSS hide disabled\n\t\tthis.disableEditTimeButton = true;\n\t\tthis.disableUpdateDetailsButton = true;\n\t\tthis.isRecurrentBooking = (booking.recurrence_type !== null || booking.recurrence_type === '') && booking.recurrence_period !== null ? true : false;\n\t\tthis.isMultiroomBooking = booking.is_multiroom ? true : false\n\n\t\t// Room Availability modal start date\n\t\tthis.setAlternativeWeekStartDate(booking.startDateTz);\n\n\t\t// Get the equiptment notes\n\t\tconst requirements = booking.notes.find(n => {\n\t\t\tif (n.type === 'equipment') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\tthis.requirements = requirements ? requirements.message : '';\n\n\t\t// Setup the UI status based on the booking approval status\n\t\tif (booking.status) {\n\t\t\t// mark bookings before today expired\n\t\t\tconst orgStatus = booking.status;\n\t\t\tthis.status = booking.status;\n\t\t\tconst recentlyExpired = DateNow(new Date()).subtractValue({ minutes: 5 }).isBeforeDate(booking.startDateTz.addValue({ minutes: booking.duration }));\n\t\t\tif (!['declined', 'cancelled'].includes(booking.status)) {\n\t\t\t\tthis.status = DateNow(new Date()).isAfterDate(booking.startDateTz.addValue({ minutes: booking.duration })) ? 'expired' : booking.status;\n\t\t\t}\n\n\t\t\tif(this._data.master_booking && this._data.master_booking.status === 'tentative' ) {\n\t\t\t\tthis.disableSeriesEditButton = true;\n\t\t\t}\n\n\t\t\tswitch (this.status) {\n\t\t\t\tcase 'tentative':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_pending.svg';\n\t\t\t\t\tthis.statusText = 'Pending';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accepted':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on but returns to tenative on save\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'approved':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false; // BLOCKED: API doesn't update 'approval_status' on save.\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on, back to pending on change.\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'declined':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\t// you can edit time and go back to pending\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cancelled':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'expired':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\n\t\t\t\t\tif (recentlyExpired && ['accepted', 'approved'].includes(orgStatus)) {\n\t\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // TODO What is an appropriate default ? And refactor where else this is common.\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic listItems(order) {\n\t\treturn order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n\t}\n\n\tpublic expandLocation() {\n\t\tthis.expandedLocation = true;\n\t}\n\n\tpublic handleClose(fetchRooms: boolean = false) {\n\t\tthis.expandedLocation = false;\n\t\tthis.expandedAvailability = false;\n\t\tif (fetchRooms) {\n\t\t\tthis.fetchRooms(false);\n\t\t\tthis.invalidDueToOfficeRule && this.alertIfItHasConflict(false, true);\n\t\t\tthis.invalidDueToOfficeRule = false;\n\t\t}\n\t}\n\n\tpublic close(flag: string = '') {\n\t\tthis.dialogRef.close(flag);\n\t}\n\n\t/**\n\t * Check if there are any booking collisions with the new booking time\n\t * @param room_id 'sys-' id of room in question\n\t * @param date proposed booking time\n\t * @param duration proposed booking length (in minutes)\n\t */\n\tprivate async findMaxExtension(): Promise {\n\t\tconst setupInSeconds = this._data.booking.setup[this._data.booking.room.email] || 0;\n\t\tconst breakdownInMinutes = this._data.booking.breakdown[this._data.booking.room.email] ? this._data.booking.breakdown[this._data.booking.room.email] / 60 : 0;\n\n\t\t// Add a seconds, since the end time ends in :59, and add the setup time\n\t\tconst endTz = this._data.booking.endDateTz.addValue({ seconds: setupInSeconds + 1 });// (this._data.booking.date + this._data.booking.duration*60000)*0.001 -1\n\t\tconst params = {\n\t\t\troom_ids: this._data.booking.room.id,\n\t\t\tdateTz: endTz, // (((end + 60 + setupSeconds) * 1000)),\n\t\t\tduration: 60 + breakdownInMinutes,\n\t\t\thide_bookings: true,\n\t\t};\n\n\t\treturn await this._spaces\n\t\t\t.available(params, null, false)\n\t\t\t.then(\n\t\t\t\t(list) => {\n\t\t\t\t\t// measure gap in booking instead and have options\n\t\t\t\t\tconst gapInMinutes = ((list[0].available_until - (endTz.seconds - 60)) / 60);\n\t\t\t\t\tconst value = Math.min(60, gapInMinutes);\n\t\t\t\t\treturn value >= 15 ? value : 0;\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t);\n\t}\n\n\tpublic toggleUpdateView() {\n\t\tthis.showDetails = !this.showDetails;\n\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t}\n\n\n\n\n\tpublic getLocation(booking: Booking): any {\n\n\t\tif (this.buildings && booking.building_zone) {\n\t\t\treturn this.buildings.find(b => booking.building_zone === b.value);\n\t\t}\n\t\treturn [];\n\t}\n\n\n\t/**\n * Dispatches data for getting the current status of the booking floor.\n *\n * This function prepares and dispatches necessary data to retrieve the current status\n * of the booking floor.\n *\n * @param {Object} booking - The booking details object, containing room, date, duration, etc.\n * @param {boolean} editingSeries - A boolean indicating whether the booking is part of a series and being edited.\n\n */\n\tpublic dispatchToGetFloorCurrentStatus(booking, editingSeries: boolean = false) {\n\t\tconst timezone = booking.timezone;\n\t\tconst { capacity, internal_or_external } = booking.room;\n\t\tconst roomOption = capacity < 3 ? 0 : (capacity > 2 && capacity < 10) ? 1 : 2;\n\t\tconst roomSize = roomSizeOptions[roomOption];\n\n\t\t// Process recurrence data if the booking is part of a series being edited\n\t\tlet recurringBookingData = {};\n\t\tlet recurrenceStart = [];\n\t\tif(booking.is_recurrent && editingSeries) {\n\n\t\t\tthis._data.master_booking.occurrence_details.forEach(element => {\n\t\t\t\trecurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n\t\t\t});\n\t\t\trecurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n\n\t\t\tconst {\n\t\t\t\tid,\n\t\t\t\trecurrence_period,\n\t\t\t\trecurrence_interval,\n\t\t\t\trecurrence_count,\n\t\t\t\tis_recurrent,\n\t\t\t\trecurrence_exceptions,\n\t\t\t\trecurrence_pattern,\n\t\t\t\trecurrence_days,\n\t\t\t\trecurrenEndFromOcurrences,\n\t\t\t\toccurrence_details,\n\t\t\t\toccurrence_edits,\n\t\t\t\toccurrence_ids,\n\t\t\t\trecurrence_type,\n\t\t\t\trecurrence_master_id,\n\t\t\t\tedits } = this._data.master_booking\n\n\t\t\tconst rec_endTz = recurrenEndFromOcurrences.bind(this._data.master_booking);\n\t\t\tconst recurrence_endTz = rec_endTz(occurrence_details)\n\n\n\n\n\t\t\trecurringBookingData = {\n\t\t\t\tid:id,\n\t\t\t\trecurrence_period: recurrence_period,\n\t\t\t\trecurrence_interval: recurrence_interval || 1,\n\t\t\t\trecurrence_endTz: recurrence_endTz, //this._data.master_booking.recurrence_endTz,\n\t\t\t\trecurrence_count: recurrence_count || 1,\n\t\t\t\tis_recurrent: is_recurrent,\n\t\t\t\trecurrence_starts: recurrenceStart,\n\t\t\t\trecurrence_exceptions: recurrence_exceptions || [],\n\t\t\t\trecurrence_pattern: recurrence_pattern || \"weekly\", //Helper value to store the last selected pattern (daily, weekly, monthly),\n\t\t\t\trecurrence_days: recurrence_days || [],\n\n\t\t\t\toccurrence_details: occurrence_details,\n occurrence_edits: occurrence_edits || null,\n occurrence_ids: occurrence_ids || null,\n recurrence_type: recurrence_type || null,\n recurrence_master_id: recurrence_master_id,\n\t\t\t\tedits: edits\n\t\t\t}\n\t\t};\n\n\n\t\tconst formGroup: BookingFormData = {\n\t\t\tlocation: [this.getLocation(booking)],\n\t\t\t//date: booking.date,\n\t\t\t// dateTz: recurrenceStart[0], //building_tz: timezone\n\t\t\tdateTz: recurrenceStart.length >=1 ? recurrenceStart[0] : closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }),\t15\t).toZone(timezone),\n\t\t\tduration: booking.duration,\n\t\t\tbookingType: internal_or_external === 'internal' ? bookingTypeOptions[0] : bookingTypeOptions[1],\n\t\t\troomSize: roomSize,\n\t\t\tselectedRoom: null,\n\t\t\ttimezone: timezone,\n\t\t\t// buildings: buildings,\n\t\t\t...this._data?.master_booking?.toJSON(),\n\t\t\t...recurringBookingData,\n\t\t\topt_out:booking.opt_out,\n\t\t\toutlook_opt_out: booking.outlook_opt_out,\n\t\t\taction: 'edit_booking'\n\n\t\t};\n\n\t\t// Clear existing form and result data, then dispatch the updated form data\n\t\tthis.clearFormAndResultData();\n\t\tthis.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n\t\t// Dispatch a request to load available rooms based on the updated form data\n\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(formGroup)))\n\t}\n\n\t/**\n * Opens a modal for editing a recurring series of bookings.\n */\n\tpublic editRecurringSeries() {\n\t\t// Dispatch the current status of the booking floor for editing the recurring series\n\t\tthis.dispatchToGetFloorCurrentStatus(this._data.booking, true);\n\n\t\tconst dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n\t\t\t\tpanelClass: 'mck-modal',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdata: {\n\t\t\t\t\tnavigateTo: this.navigateT0Search.bind(this),\n\t\t\t\t\taction: SeriesAction.EDIT, // Indicates the action type (editing a series)\n\t\t\t\t}\n\t\t});\n\n\t\t// Subscribe to the modal's closed event to handle the result\n\t\tdialog_ref.afterClosed().subscribe((flag) => {\n\t\t\t// Close the modal if the operation was successful (flag is truthy)\n\t\t\tflag && this.close(flag); //console.log('ROOM MODAL CLOSED')\n\t\t});\n\n\t}\n\n\tnavigateT0Search() {\n\t\tthis.router.navigate(['../home/results'], { relativeTo: this.route });\n\t}\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n\n\tpublic toggleEditView() {\n\t\tthis.fetchRooms(true);\n\t\tthis.expandedAvailability = true;\n\t}\n\n\tpublic updateBookingState(booking: Booking) {\n\t\tthis._data.booking = booking;\n\t\tthis.initDisplayValues(booking);\n\t\tthis.store.dispatch(loadBookingsWithQuery({ 'id': booking.id, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n\t\t// reload all booking for user from - apps/staff/src/app/booking/room-booking/room-booking.component.ts\n\t\tthis._data.refresh(); //\n\t}\n\n\tpublic cancelBooking(opts: { series?: boolean } = {}) {\n\t\t// Open the cancel booking modal\n\t\tthis.dialog.open(CancelBookingModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\t...this._data,\n\t\t\t\t...opts,\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst booking = this._data.booking.clone();\n\t\t\t\t\tthis._data.booking.delete(opts).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tthis.close();\n\t\t\t\t\t\t\t// @TODO:API The deleted record is still being returned for quite some time regardless of timeout.\n\t\t\t\t\t\t\tthis._data.refresh()\n\t\t\t\t\t\t\t// this.timeout('refresh', () => this._data.refresh(), 1000);\n\t\t\t\t\t\t\t// Heap track event\n\t\t\t\t\t\t\tthis._service.analytics.track('delete', {\n\t\t\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\t\t\troom: booking.room.name,\n\t\t\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\t\t\tcatering: !!booking.catering.legth,\n\t\t\t\t\t\t\t\theadcount: booking?.expected_attendees[booking.room.email],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err) => {\n\t\t\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\t}\n\n\tpublic extendBooking() {\n\t\t// open the extend booking modal\n\t\tconst dialogRefX = this.dialog.open(BookingDurationModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\tbooking: this._data.booking,\n\t\t\t\tmaximum: this.extendableMaximum,\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\n\t\tdialogRefX.afterClosed().subscribe((booking?: Booking) => {\n\t\t\tif (booking) {\n\t\t\t\tthis.updateBookingState(booking);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic displayCancelModal() {\n\t\t// Can the display cancel modal open? If it isn't one of these statuses\n\t\treturn !['cancelled', 'expired', 'declined'].includes(this.status);\n\t}\n\n\n\tpublic confirmChanges(data: DateDurationData) {\n\t\t// Confirm the changes returned from the room availability modal.\n\t\tthis.mobile = data.mobile;\n\t\tthis.setAlternativeWeekStartDate(data.dateTz);\n\n\t\t// New booking flow has this.data\n\t\tif (this.data.value) {\n\t\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t\t\t// submit\n\t\t\tthis.store.dispatch(storeBookingFormData({\n\t\t\t\tpayload: {\n\t\t\t\t\t...this.data.value,\n\t\t\t\t\tdateTz: data.dateTz,\n\t\t\t\t\tduration: data.duration,\n\t\t\t\t}\n\t\t\t}));\n\t\t} else if (data.save) {\n\t\t\t// update booking date/duration\n\t\t\tconst booking = this._data.booking.clone();\n\t\t\tconst pendingChanges = booking.duration !== data.duration || booking.startDateTz.ms !== data.dateTz.ms;\n\t\t\t// booking.duration = data.duration;\n\t\t\tbooking.startDateTz = data.dateTz; // date = data.dateTz.ms;\n\t\t\tbooking.endDateTz = data.dateTz.addValue({ minutes: data.duration });\n\t\t\tthis.loading = true;\n\n\t\t\tconst roomRules = rulesForSpace({\n\t\t\t\ttime: booking.date,\n\t\t\t\tduration: booking.duration,\n\t\t\t\tuser: this.currentUser,\n\t\t\t\trules: this._data.booking.room.building?.booking_rules,\n\t\t\t\tspace: booking.room\n\t\t\t});\n\n\t\t\t// Rooms requiring approval are reset to tentative when the time changes.\n\t\t\tif (pendingChanges && !roomRules?.auto_approve) {\n\t\t\t\t// https://acaprojects.atlassian.net/browse/MCK-1481\n\t\t\t\t/**\n\t\t\t\t * Having 2 ways of containing the status is icky but until PlaceOS\n\t\t\t\t * depreciates approval_status it's necessry.\n\t\t\t\t */\n\t\t\t\t// booking.approval_status[booking.room.email] = \"tentative\";\n\t\t\t\tbooking.status = \"tentative\";\n\t\t\t\tbooking.time_changed = true;\n\t\t\t}\n\t\t\telse if (roomRules.reason === SpaceFilterReason.OfficeRules) {\n\t\t\t\t// this.alertIfItHasConflict(false, true);\n\t\t\t\tthis.invalidDueToOfficeRule = true;\n\t\t\t\tthis.loading = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// -----------------------------------------------------------\n\t\t\t// Check if catering is outside allowed hours before saving\n\t\t\t// -----------------------------------------------------------\n\t\t\tif (this.hasCateringOutsideHours(booking)) {\n\t\t\t\tthis.dialog.open(CateringDropComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-mini',\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\t})\n\t\t\t\t.afterClosed().subscribe((confirm_drop: boolean) => {\n\t\t\t\t\tif (confirm_drop) {\n\t\t\t\t\t\t// User chose to drop catering and proceed\n\t\t\t\t\t\tbooking.catering = [];\n\t\t\t\t\t\tthis.saveBooking(booking);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// User cancelled - do not save, just stop here\n\t\t\t\t\t\tthis.loading = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// If catering is within hours or no catering issue, just save\n\t\t\t\tthis.saveBooking(booking);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate saveBooking(booking: Booking) {\n\t\t\t// booking.save() won't use the toAPIJSON conversion so use the booking service.\n\t\t\tthis._bookings.save(booking).then(\n\t\t\t\t(bkn) => {\n\t\t\t\t\t// update booking\n\t\t\t\t\tthis.updateBookingState(booking);\n\t\t\t\t\tthis.form = generateBookingForm(booking, this.available_fields);\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.displayInfoBanner();\n\t\t\t\t\tbooking.room.building.name\n\t\t\t\t\tthis._service.analytics.track('update', {\n\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\troom: booking.room.global_name,\n\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\tcatering: !!booking.catering.length,\n\t\t\t\t\t\theadcount: booking.headcount,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.expandedAvailability = false;\n\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\n\t/**\n\t * Check if the booking has catering and if it's outside allowed hours.\n\t */\n\tprivate hasCateringOutsideHours(booking: Booking): boolean {\n\t\tif (!booking?.catering || !booking.catering.length) return false;\n\t\n\t\t// Extract the hour from startDateTz\n\t\tconst hour = booking.startDateTz.date.hour;\n\t\t// Check if hour is outside 7 AM - 8 PM\n\t\treturn hour < 7 || hour >= 20;\n\t}\n\n\t/**\n\t * Open dialog if booking date and time is out of office rule\n\t * TO DO : Redundant code - same validaiton been applied over room detail while creating new booking - need to handle more graceful way. better if user been prohibited from choose future date if out of office rule on show avaialability calender itself\n\t * related to - https://acaprojects.atlassian.net/browse/MCK-2419\n\t */\n\n\talertIfItHasConflict(isBookable, isAvailable) {\n\t\t// this.isAlertDisplayed = true;\n\t\tconst data = {\n\t\t\theaderText: !isBookable ? SpaceConflictAlertModalData.NotBookableHeaderText : !isAvailable ? SpaceConflictAlertModalData.NotAvailableHeaderText : '',\n\t\t\tmessage: SpaceConflictAlertModalData.NotBookableDueToOfficeRule,\n\t\t\tbuttonLabel: 'Close',\n\t\t\tcallback: () => null,\n\t\t\tshouldClose: false\n\t\t};\n\t\tconst dialog = this.dialog.open(ConflictAlertModalComponent,\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tpanelClass: 'mck-alert',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdisableClose: !isBookable\n\t\t\t});\n\t}\n\n\n\n\tpublic displayInfoBanner() {\n\t\tthis.showInfoBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showInfoBanner = false;\n\t\t}, 3000);\n\t}\n\n\tpublic displayWarningBanner(custom: string) {\n\t\tthis.warningMessage = custom;\n\t\tthis.showWarningBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showWarningBanner = false;\n\t\t}, 10000);\n\t}\n\n\tpublic hideInfoBanner() {\n\t\tthis.showInfoBanner = false;\n\t}\n\n\tpublic hideWarningBanner() {\n\t\tthis.showWarningBanner = false;\n\t}\n\n\tpublic setAlternativeWeekStartDate(bookingDate: DateTZ) {\n\t\tif (!bookingDate) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mobile) {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone();\n\t\t} else {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone().startOfValue('week').startOfValue('day');\n\t\t}\n\t}\n\n\tpublic updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n\t\tthis.alternativeWeekStartDateTz = alternativeWeekStartDateTz.clone();\n\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t}\n\n\tpublic fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n\t\tif (!this._data?.booking?.space?.id) {\n\t\t\treturn\n\t\t}\n\n\t\tconst day = 24 * 60;\n\t\tconst week = day * 7;\n\t\tconst date = (alternativeWeekStartDateTz || this._data?.booking?.startDateTz).clone(); // new DateTZ({date: alternativeWeekStartDateTz || this._data?.booking?.date});\n\t\tconst startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n\t\tconst startOfWeek = date.startOfValue('week');\n\n\t\t// Query for the entire day for this room\n\t\tconst query = {\n\t\t\tdateTz: allWeek ? startOfWeek : startOfDay,\n\t\t\tduration: allWeek ? week : day,\n\t\t\tlocations: this._data?.booking?.space?.id,\n\t\t\tcapacity: this._data?.booking?.space?.capacity,\n\t\t};\n\t\tthis.store.dispatch(loadByIdResults.request(query));\n\t}\n\n\tpublic addCatering() {\n\t\t// For the Add Catering button\n\t\tthis.showCatering = true;\n\t}\n\n\tpublic saveBookingWithCatering(form: FormGroup) {\n\t\t// Response from the catering modal closing\n\t\t// Close catering and confirmation modals and just show booking details modal\n\t\tif (!form) {\n\t\t\tthis.showCatering = false;\n\t\t\tthis.showDetails = false;\n\t\t\treturn;\n\t\t}\n\t\t// Update the booking state.\n\t\tconst booking = this._data.booking.clone();\n\t\tbooking.catering = form.controls.catering.value;\n\n\t\tif (booking.catering.length) {\n\t\t\tconst setup = {};\n\t\t\tsetup[booking.room.email] = booking.setup[booking.room.email] || 900;\n\t\t\tconst breakdown = {};\n\t\t\tbreakdown[booking.room.email] = booking.breakdown[booking.room.email] || 900;\n\n\t\t\tbooking.setup = setup\n\t\t\tbooking.breakdown = breakdown\n\t\t}\n\n\t\tthis.updateBookingState(booking);\n\t}\n\n\tpublic set specific_dates(val: boolean) {\n\t\tthis._specific_dates = val;\n\t}\n\n\tpublic get specific_dates(): boolean {\n\t\treturn this._specific_dates;\n\t}\n\n\n\tpublic toggleSpecificDates() {\n\t\tthis.specific_dates = !this.specific_dates;\n\t}\n\n\n}\n","\n
\n
\n
 
\n
\n \n

Your booking date and/or time was successfully updated

\n \n
\n
\n \n

{{ warningMessage }}

\n \n
\n \n \n
\n
\n
\n
\n \n Recurring booking status: {{ statusText }} \n
\n
\n \n
\n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Days' : 'Day'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Weeks' : 'Week'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Months' : 'Month'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs on Specific Dates effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}\n
\n
\n
\n
{{ occurrence.dateTz.formatDate('dd MMM yyyy') }}
\n
\n
\n
\n
\n
\n
\n
\n \n Edit series\n \n \n \n
\n
\n\n
\n
\n

{{statusText}}

\n {{timeString}} \n
\n
\n
\n \n
\n

This is a multiroom booking. To request edits, please contact your local backoffice team.

\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n \n
\n\n
\n
\n {{roomName}}\n
\n
\n {{roomLocation}}\n
\n
\n Capacity: {{capacity}}\n
\n \n
\n\n\n\n
\n\n \n
\n \n Reception\n \n
\n
\n \n Cancel booking\n \n
\n \n
\n\n\n
\n \n\n
\n \n
\n \n
\n
\n
\n

\n \n Schedule\n

\n \n \n
\n\n

\n Date: {{dateString}}
\n Time: {{timeString}}
\n {{type}} meeting ({{durationString}})\n

\n \n {{ checkingExtendable ? 'Checking availability...' : 'Extend booking duration'}}\n \n
\n \n
\n
\n

\n \n

\n

\n \n \n \n

\n
\n \n\n \n
\n
\n
\n

\n Meeting\n

\n \n \n
\n \n
\n
Meeting title:   {{ title}}
\n
Host:   {{ host}}
\n
Attendees:   {{attendeesString}}\n
\n
Company:   {{companyString}}
\n
Charge code:   {{chargeCode}}
\n
Headcount estimate:   {{headcount}}
\n
Additional requirements:   {{requirements}}
\n
Email notification for this booking has been opt out.
\n
Outlook calendar invite for this booking has been opted out of.
\n \n
\n \n
\n
\n\n
\n
\n

\n \n

\n \n \n \n \n \n \n
\n
\n \n\n
\n
\n
\n \n
\n
\n \n
\n\n \n
\n\n \n
\n
\n \n \n \n

\n \n \n \n

\n \n \n
\n\n
\n
\n \n
\n

\n \n Catering\n

\n \n \n
\n Catering available for this room\n
\n \n \n
\n
\n\n \n
\n \n
\n

\n \n

\n

\n \n

\n \n
\n
\n
\n\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n \n
\n
\n\n
\n \n
\n \n \n
\n
\n
\n\n
\n \n
\n\n
\n \n
\n \n
\n
\n
\n\n
\n\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n } from '@mckinsey-converge/base';\nimport {\n Booking,\n BookingsService,\n DEFAULT_BOOKING_DURATION,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\ninterface extendData {\n booking: Booking;\n maximum: number\n}\n\n@Component({\n selector: 'app-booking-duration-modal',\n template: `\n \n
\n \n

Your booking failed to update, please try again

\n \n
\n
\n \n
Extend booking duration
\n
\n
\n \n \n
\n
\n \n
\n
\n `,\n styleUrls: ['./booking-duration-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class BookingDurationModalComponent extends BaseDirective implements OnInit {\n\n public loading: string;\n public showWarningBanner: boolean = false;\n\n public get durationGroups() {\n const step = 15;\n const steps = Math.floor(this.data.maximum / step);\n const max = (steps * step) + this.data.booking.duration;\n\n return [{\n start: this.data.booking.duration,\n step,\n max\n }];\n }\n\n public formGroup = new FormGroup({\n date: new FormControl(this.data.booking.date, [Validators.required]),\n dateTz: new FormControl(this.data.booking.startDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n });\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: extendData,\n private dialogRef: MatDialogRef,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n ngOnInit() {\n this.formGroup.setValue({\n date: this.data.booking.date,\n dateTz: this.data.booking.startDateTz,\n duration: this.data.booking.duration,\n });\n }\n\n public closeModal(booking?: Booking) {\n this.dialogRef.close(booking);\n }\n\n public updateBookingDuration() {\n const formData = this.formGroup.getRawValue();\n this.loading = 'Saving...';\n\n // clone booking to allow editing\n // const booking = this.data.booking.clone(); // this line commented for bug appearing in CNG-352. Used cloneDeep instead\n const booking = cloneDeep(this.data?.booking);\n booking.endDateTz = booking.startDateTz.addValue({ minutes: formData.duration });\n this._bookings.save(booking).then(\n () => {\n this.loading = null;\n this.closeModal(booking);\n },\n (err) => {\n this.loading = null;\n this.displayWarningBanner()\n }\n );\n }\n\n\n public displayWarningBanner() {\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { BookingResultsViewModel } from '../manage-bookings/manage-bookings.viewmodel';\nimport {\n BaseDirective,\n shorterLocalDateFormatString,\n timeWithZoneFormatString,\n startEndTimeFormatString,\n humaniseDuration,\n closestToTimeSlotTz,\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ, localTimezone } from \"@mckinsey-converge/date-tz\";\nimport { Booking, BookingFormData, BookingStoreState, bookingTypeOptions, Building, BuildingCity, clearBookingFormData, defaultRoomSizeOption, DEFAULT_BOOKING_DURATION, flattenDisplayOffices, roomFormDataToQuery, roomSizeOptions, storeBookingFormData } from '@mckinsey-converge/data-common';\nimport { buildingStateSelector, BuildingStoreState, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BehaviorSubject,\n} from 'rxjs';\n\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n@Component({\n selector: 'app-booking-result-item',\n templateUrl: './booking-result-item.component.html',\n styleUrls: ['./booking-result-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingResultItemComponent extends BaseDirective implements OnInit {\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: BookingResultsViewModel | undefined;\n \n @Input()\n public bookings: BookingResultsViewModel[];\n\n @Input()\n public list: string;\n\n @Input() public index: number;\n\n @Input() public small: boolean = false;\n\n @Output()\n public bookingSelect = new EventEmitter();\n\n public buildings = new BehaviorSubject[]>([]);\n\n public roomName: string;\n public roomLocation: string;\n public host: string;\n public status: string;\n public timeStringParts: string[] = [' ', ' '];\n public localTimeStringParts: string[] = [' ', ' '];\n public isAnotherTimezone: boolean = false;\n public statusText: string;\n public statusImage: string;\n public durationString: string;\n public timeRangeString: string;\n public building: any;\n public get dateString() {\n if (!this.bookings || !this.bookings.length) return '';\n const bkn1 = this.bookings[this.index].booking;\n const d1 = new DateTZ({ date: bkn1.startDateTz.ms, is_local_tz: false, building_tz: bkn1.startDateTz.building_tz });\n if (this.index === 0) {\n return shorterLocalDateFormatString(d1);\n }\n const bkn2 = this.bookings[this.index - 1].booking;\n const d2 = new DateTZ({ date: bkn2.startDateTz.ms, is_local_tz: false, building_tz: bkn2.startDateTz.building_tz });\n if (!d1.isSameDate(d2, 'day')) {\n return shorterLocalDateFormatString(d1);\n }\n return '';\n }\n public get todayString() {\n if (!this.bookings || !this.bookings.length) {\n return '';\n }\n \n // Strip the booking of it's timezone infomation so isSameDate is just based on timestamp and local time.\n const d1 = new DateTZ({ date: this.bookings[this.index].booking.startDateTz.ms });\n return DateNow(new Date()).isSameDate(d1, 'day') ? '(Today)' : '';\n }\n\n public get attendeesCount(): number {\n // allAttendees is booking.attendees + 1 (booking.organizer)\n return this.viewModel.booking?.allAttendees.length; \n }\n\n public get has_catering(): number {\n return this.viewModel.booking?.has_catering && this.viewModel.booking?.catering?.length;\n }\n\n public get upcoming() {\n return ['tentative', 'accepted', 'approved'].includes(this.status);\n }\n\n constructor(private store: Store,\n private cdRef: ChangeDetectorRef) {\n super();\n }\n\n public ngOnInit(): void {\n this.setupDisplayFields();\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n }));\n this.cdRef.detectChanges();\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public getTooltipText(){\n return this.viewModel.booking.local_room_name.split(',');\n }\n\n public setupDisplayFields() { \n if (!this.viewModel?.booking) {\n return;\n }\n this.timeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz).split(' ');\n this.timeRangeString = startEndTimeFormatString(this.viewModel.booking.startDateTz, this.viewModel.booking.displayEndDateTz);\n this.isAnotherTimezone = !this.viewModel.booking.startDateTz.is_local_tz;\n this.localTimeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz.toZone(localTimezone())).split(' ');\n this.host = this.viewModel.booking.organiser.name;\n this.roomName = this.viewModel.booking.local_room_name.split(',')[0];\n this.roomLocation = this.viewModel.booking.room.street_and_city;\n this.durationString = humaniseDuration(this.viewModel.booking.duration, 'medium');\n\n if (this.viewModel.booking.status) {\n // mark bookings before today expired\n this.status = (DateNow(new Date()).isAfterDate(this.viewModel.booking.endDateTz) && this.list !== 'cancelled') ? 'expired' : this.viewModel.booking.status;\n switch(this.status) {\n case 'tentative':\n this.statusImage = 'assets/icon/booking_pending.svg';\n this.statusText = 'Pending';\n break;\n case 'accepted':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'approved':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'declined':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'cancelled':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'expired':\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n default: // TODO\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n }\n }\n this.cdRef.detectChanges();\n return;\n }\n\n}\n","

\n {{ dateString }} {{ todayString }}\n

\n
\n
\n
\n
\n
\n {{ timeStringParts[0] }} ({{ timeStringParts[1] }}) ({{\n durationString\n }})\n
\n
\n {{ localTimeStringParts[0] }} ({{ localTimeStringParts[1] }}) in your\n local timezone\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
{{ statusText }}
\n
\n {{ timeRangeString }}\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
{{ viewModel.booking.title }}
\n {{\n viewModel.booking.bookingTypeLabel\n }}\n \n {{viewModel.booking?.merged ? 'Merged' : 'Multiroom'}} \n \n \n
\n \n \n \n
\n
\n \n {{ roomName }}\n {{ roomLocation }}\n Host: {{ host }}\n {{ attendeesCount }}pp\n Catered\n \n \n \n \n \n \n \n \n
\n
\n
\n\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { RoomBookingComponent } from 'src/app/booking/room-booking/room-booking.component';\nimport { RoomResultsComponent } from 'src/app/booking/room-results/room-results.component';\nimport { RoomDetailsComponent } from 'src/app/booking/room-details/room-details.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { OfficeFloorComponent } from './office-floor/office-floor/office-floor.component';\n\nconst routes: Routes = [\n {\n path: 'results',\n component: RoomResultsComponent,\n },\n {\n path: 'results/filter',\n component: RoomFiltersModalComponent,\n },\n {\n path: 'results/room',\n component: RoomDetailsComponent,\n },\n {\n path: 'create',\n component: BookingCreateComponent,\n },\n {\n path: 'edit',\n component: BookingEditWrapperComponent,\n },\n {\n path: 'manage',\n component: ManageBookingsComponent,\n },\n {\n path: 'catering/:id',\n data: { hasCatering: true },\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id/:verb',\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id',\n component: ManageBookingsComponent,\n },\n {\n path: 'floor-map',\n component: OfficeFloorComponent,\n },\n {\n path: 'results/booking-calendar',\n loadChildren: () => import('./booking-calendar/booking-calendar.module').then((m) => m.BookingCalendarModule),\n },\n {\n path: '**',\n component: RoomBookingComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingRoutingModule {}\n","import {\n createReducer,\n on\n} from '@ngrx/store';\nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\nimport { closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n};\n\nexport const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: \n {\n location: state?.activeForm?.location,\n timezone: state?.activeForm?.timezone,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: state?.activeForm?.timezone, }), 15)\n \n }\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { BookingRoutingModule } from './booking-routing.module';\nimport { BookingsListingComponent } from './bookings-listing/bookings-listing.component'\nimport { RoomBookingComponent } from './room-booking/room-booking.component';\nimport { RoomDetailsComponent } from './room-details/room-details.component';\nimport { BookingFormBaseComponent } from './booking-create/booking-form-base.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditComponent } from './booking-create/booking-edit.component';\nimport { BookingConfirmationComponent } from './booking-confirmation/booking-confirmation.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule } from '@angular/material/select';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { MatButtonModule } from '@angular/material/button';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingFormReducer } from 'src/app/booking/booking.form.reducer';\nimport { BookingResultItemComponent } from './booking-result-item/booking-result-item.component';\nimport { BookingDetailsModalComponent } from './booking-details-modal/booking-details-modal.component';\nimport { BookingDurationModalComponent } from './booking-duration-modal/booking-duration-modal.component';\nimport { CancelBookingModalComponent } from './cancel-booking-modal/cancel-booking-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { RoomResultsComponent } from './room-results/room-results.component';\nimport { SearchedLocationComponent } from './searched-location/searched-location.component';\nimport { ResultsHeaderComponent } from './results-header/results-header.component';\nimport { RoomAvailabilityPreviewComponent } from './room-availability-preview/room-availability-preview.component';\nimport { RoomLocationPreviewComponent } from './room-location-preview/room-location-preview.component';\nimport { RoomResultItemComponent } from './room-result-item/room-result-item.component';\nimport { RoomBookingFormComponent } from './room-booking-form/room-booking-form.component';\nimport { RoomBookingDetailsFormComponent } from './room-booking-details-form/room-booking-details-form.component';\nimport { RoomBookingModalComponent } from './room-booking-modal/room-booking-modal.component';\nimport { RoomResultsPaginatedComponent } from './room-results-paginated/room-results-paginated.component';\nimport { RoomFiltersModalComponent } from './room-filters-modal/room-filters-modal.component';\nimport { RoomFiltersFormComponent } from './room-filters-form/room-filters-form.component';\nimport { RoomAvailabilityPreviewModalComponent } from './room-availability-preview-modal/room-availability-preview-modal.component';\nimport { MapModule } from 'src/app/map/map.module';\nimport { OfficeFloorMapModule } from 'src/app/booking/office-floor/office-floor-map.module';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RoomResultsSectionComponent } from './room-results-section/room-results-section.component';\nimport { CalendarModule, DateAdapter } from 'angular-calendar';\nimport { adapterFactory } from 'angular-calendar/date-adapters/date-fns';\nimport { BookingCateringComponent } from './catering/catering.component';\nimport { OrderTableComponent } from './catering/order-table/order-table.component';\nimport { BookingCateringOrderDetailsComponent } from './catering/order-details/order-details.component';\nimport { BookingCateringOrderListComponent } from './catering/order-list/order-list.component';\nimport { CateringOrderListItemComponent } from './catering/order-list/item/item.component';\nimport { CateringMenuCategoryComponent } from './catering/order-details/category/category.component';\nimport { SurveyModalComponent } from '../components/survey-modal/survey-modal.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\n\nexport const bookingModuleDeclarations = [\n BookingFormBaseComponent,\n BookingCreateComponent,\n BookingEditComponent,\n BookingConfirmationComponent,\n BookingDetailsModalComponent,\n BookingDurationModalComponent,\n BookingsListingComponent,\n BookingResultItemComponent,\n CancelBookingModalComponent,\n ManageBookingsComponent,\n BookingCateringComponent,\n BookingCateringOrderDetailsComponent,\n BookingCateringOrderListComponent,\n CateringMenuCategoryComponent,\n CateringOrderListItemComponent,\n RoomBookingComponent,\n RoomDetailsComponent,\n RoomResultsComponent,\n SearchedLocationComponent,\n ResultsHeaderComponent,\n RoomAvailabilityPreviewComponent,\n RoomLocationPreviewComponent,\n RoomResultItemComponent,\n RoomBookingModalComponent,\n RoomBookingFormComponent,\n RoomBookingDetailsFormComponent,\n RoomResultsPaginatedComponent,\n RoomFiltersModalComponent,\n RoomFiltersFormComponent,\n RoomResultsSectionComponent,\n RoomAvailabilityPreviewModalComponent,\n CateringMenuCategoryComponent,\n OrderTableComponent,\n SurveyModalComponent,\n BookingEditWrapperComponent\n];\n\nexport const bookingModuleImports = [\n CommonModule,\n UiModule,\n MatSelectModule,\n MatButtonModule,\n NgxMatSelectSearchModule,\n ReactiveFormsModule,\n SharedContentModule,\n FormsModule,\n NgxSkeletonLoaderModule,\n MapModule,\n CalendarModule.forRoot({\n provide: DateAdapter,\n useFactory: adapterFactory,\n }),\n OfficeFloorMapModule\n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingRoutingModule,\n StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingModule {\n}","import { Component, Input, OnInit, OnChanges, ChangeDetectionStrategy, ChangeDetectorRef, NgZone } from '@angular/core';\nimport { throttleTime, tap, first, distinctUntilChanged, map } from 'rxjs/operators';\nimport { fromEvent } from 'rxjs';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BuildingStoreState, buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Booking, User, IEngineResponse, BookingStoreState, clearBookingFormData, BookingsService, UsersService, flattenDisplayOffices, BuildingCity, Building } from '@mckinsey-converge/data-common';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { loadBookingsWithQuery, loadUpcomingBookingsResults, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel,\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { BookingPagination } from '@mckinsey-converge/bookings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nexport type ManageBookingsStoreState = BookingStoreState &\n BuildingStoreState &\n MyBookingsStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-bookings-listing',\n templateUrl: './bookings-listing.component.html',\n styleUrls: ['./bookings-listing.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingsListingComponent extends BaseDirective implements OnInit, OnChanges {\n @Input() public config: any;\n @Input() public buildings: BehaviorSubject[]>;\n @Input() public searchBookingBy: string;\n @Input() public selectedHost: string;\n @Input() public activeTab: string;\n\n public bookingResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public bookings: BookingResultsViewModel[];\n public showBookings = false;\n public reloading = false;\n public TopBarHeaderMode = TopBarHeaderMode;\n public mobile: boolean = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n public pagination: BookingPagination = {\n currentPage: 1,\n totalRecords: 0,\n pageLimit: 10,\n };\n bookingPerPage: any[] = [];\n filteredByHost: any[] = [];\n\n public get lastPage() {\n return this.pages.total === this.pagination.currentPage;\n }\n\n public get pages() {\n const p = this.pagination;\n const total = Math.ceil(p.totalRecords / p.pageLimit) ;\n const group = Math.ceil(p.currentPage / 5);\n const startPosition = Math.max(\n 1,\n Math.min(group > 1 ? (group - 1) * (p.pageLimit + 1) : 1, total - 4)\n );\n let pages = [];\n for (let x = startPosition; x <= Math.min(startPosition + 4, total); x++) {\n pages.push(x);\n }\n if (!pages.length) {\n pages.push(1);\n }\n const maxed = () => {\n if (total <= 5 || p.currentPage >= total) {\n return false;\n }\n return true;\n };\n const mined = () => {\n if (total <= 5 || p.currentPage < 6) {\n return false;\n }\n return true;\n };\n const start = p.currentPage > 5;\n const end = !(p.currentPage >= total);\n return {\n total,\n pages,\n min: mined(),\n max: maxed(),\n start,\n end,\n };\n }\n\n constructor(\n private store: Store,\n private _route: ActivatedRoute,\n private _router: Router,\n private dialog: MatDialog,\n private _bookings: BookingsService,\n private _zone: NgZone,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 450;\n const selector = this.config.selector;\n const target = this.config.type;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n \n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n // this.buildings.next(next);\n if(this.activeTab === this.config.type) {\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target,\n offset: 0,\n })\n );\n }\n\n // start the timer at the top of the minute;\n const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n setTimeout(() => {\n this.refresh(target);\n this._zone.runOutsideAngular(() => {\n this.interval('refreshBookings', () => this.refresh(target, true), 60 * 1000);\n });\n\n }, offset + 5000);\n\n \n }));\n\n\n\n const sort_asc = (a, b) => a.date - b.date;\n const sort_desc = (a, b) => b.date - a.date;\n\n this.subscription(\n 'bookingResults',\n this.store.pipe(select(selector)).subscribe((next) => {\n this.bookingResults.next(next);\n if (!next.isEmpty() && Array.isArray(next?.success?.results)) {\n let results = [...next?.success?.results].sort(\n this.config.reverse_sort ? sort_desc : sort_asc\n );\n this.showBookings = !!results.length;\n this.reloading = false;\n // save all bookings to reuse later \n this.allBookings = results;\n \n /** Filter all booings of active tab by selected host if any */\n this.filterBySelectedHost(true);\n\n } else {\n this.showBookings = false;\n this.reloading = false;\n this.bookings = [];\n this.pagination.totalRecords = 0;\n this.cdRef.detectChanges();\n }\n })\n );\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n ).subscribe();\n \n this.timeout('query', () =>\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n if (params.has('page')) this.setPage(+params.get('page'), false);\n })\n )\n );\n }\n\n //For each result from results, it find its level and building from the lists and map with BookingResultsViewModel but filter all master from list.\n public getViewModel = (results) => mapResultsToViewModels(results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n\n\n public splitArrayIntoSubarrays(originalArray, subarrayLength) {\n var newArray = [];\n for (var i = 0; i < originalArray.length; i += subarrayLength) {\n newArray.push(originalArray.slice(i, i + subarrayLength));\n }\n return newArray;\n }\n\n\n public ngOnChanges($change: any) {\n \n if ($change?.buildings?.currentValue !== $change?.buildings?.previousValue || $change?.activeTab?.currentValue !== $change?.activeTab?.previousValue) {\n this.refresh(this.config.type);\n }\n if ($change?.selectedHost?.currentValue !== $change?.selectedHost?.previousValue) {\n this.filterBySelectedHost(true);\n } else\n if ($change?.searchBookingBy?.currentValue !== $change?.searchBookingBy?.previousValue) {\n this.filterBySelectedHost(false);\n }\n }\n\n\n\n public filterBySelectedHost(isHostChanged: boolean) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchHost = this.selectedHost.toLowerCase().trim();\n // this.filteredByHost = [];\n\n if(this.allBookings) {\n\n if(searchHost) {\n if(isHostChanged) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.allBookings];\n // Filtering the combine array to find matching host email \n this.filteredByHost = allItems.filter( (item: any ) => \n this.isIncludes(item?.host, 'email', searchHost) ||\n this.isIncludes(item?.organiser, 'email', searchHost)\n );\n }\n else {\n this.filteredByHost = [...this.filteredByHost];\n }\n \n }\n else {\n this.filteredByHost = [...this.allBookings];\n }\n\n //Now send filtered booking by host to filter further by search input given in the field\n this.filterBookingsBySearchValue([...this.filteredByHost]);\n\n \n }\n }\n\n \n public isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\n public filterBookingsBySearchValue(filteredByHost) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = this.searchBookingBy.toLowerCase().trim();\n let filteredItems = [];\n\n if(filteredByHost) {\n\n if(searchValue) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...filteredByHost];\n // Filtering the combine array to find matching room or booking \n filteredItems = allItems.filter( (item: any ) => \n this.isIncludes(item, 'title', searchValue) ||\n this.isIncludes(item?.creator, 'name', searchValue) ||\n this.isIncludes(item?.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'local_room_name', searchValue) || // search with room name \n this.isIncludes(item, 'simple_name', searchValue) || \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n }\n else {\n filteredItems = [...filteredByHost];\n }\n\n const filteredBookings = this.getViewModel(filteredItems);\n \n this.pagination.totalRecords = filteredBookings.length;\n this.pagination.currentPage = !this.lastPage ? 1 : this.pagination.currentPage;\n this.bookingPerPage = this.splitArrayIntoSubarrays(filteredBookings, this.pagination.pageLimit);\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n }\n \n }\n\n \n\n\n\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return this.reloading; // || !this.bookingResults?.value?.isLoading;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find((b) => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // From the Manage Bookings page\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n if(viewModel.booking.is_recurrent) {\n let booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n if (!booking) {\n booking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n }\n this.master_booking = mapResultsToViewModels([booking])[0];\n }\n this.cdRef.detectChanges();\n\n // real booking.room here.\n const dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking: viewModel.booking,\n refresh: () => {\n this.refresh('all');\n },\n\n building: this.getBuilding(viewModel.booking),\n master_booking: this.master_booking?.booking || null,\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRefX.afterClosed().subscribe((flag) => {\n flag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n this.cdRef.detectChanges();\n // this.timeout('refreshBookings', () => this.refresh('all'), 1000);\n // this.timeout('refreshBookings', () => this.refresh('all'), 5000);\n });\n }\n\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n this.cdRef.detectChanges();\n }\n\n public readonly prevPage = () => this.setPage(this.pagination.currentPage - 1);\n public readonly nextPage = () => this.setPage(this.pagination.currentPage + 1);\n public readonly prevGroup = () => this.setPage(this.pages.pages.length);\n public readonly nextGroup = () => this.setPage(this.pages.pages.length + 1);\n public readonly gotoPage = (page: number) => this.setPage(page);\n\n public setPage(page_idx: number, route: boolean = true) {\n if (!this.pages.total) return;\n const page = Math.max(1, Math.min(page_idx, this.pages.total));\n if (route) this._router.navigate([], { relativeTo: this._route, queryParams: { page } });\n this.pagination.currentPage = page;\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n // this.refresh();\n }\n\n public refresh(target: string = this.activeTab, dontShowReloading = false) {\n if (!this.currentUser?.email) {\n return;\n }\n\n \n const offset = 0 ; //(this.pagination.currentPage - 1) * this.pagination.pageLimit;\n // fetch it on one minute interval now that there is room data.\n if(this.activeTab === this.config.type) {\n\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target:this.activeTab,\n offset,\n })\n );\n this.reloading = !dontShowReloading;\n this.cdRef.detectChanges();\n }\n \n\n \n\n \n }\n\n identify(index, item) {\n return item.booking.id;\n }\n}\n","
\n \n \n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n \n

End of list. You have no upcoming bookings

\n
\n
\n \n

End of list. Past meetings are saved for up to 48 hours.

\n
\n
\n \n

End of list. Cancelled meetings are saved for up to 48 hours.

\n
\n
\n
\n \n \n \n \n
\n
\n
\n
    \n
  • \n
  • 1
  • \n
  • ...
  • \n
  • \n {{p}}\n
  • \n
  • ...
  • \n
  • \n {{pages.total}}\n
  • \n
  • \n
\n
","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { Booking, Building, RecurrencePeriod } from '@mckinsey-converge/data-common';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface data {\n booking: Booking;\n building: Building;\n callback: Function;\n master_booking?: Booking;\n hasLoaderUrl?: boolean;\n refresh?: Function;\n\t\tseries?:{};\n}\n\n@Component({\n selector: 'app-cancel-booking-modal',\n template: `\n \n
\n \n
\n
\n \n
{{ subtitle }}
\n
\n
\n

{{ data.booking.title }}

\n\n \n

\n Daily from \n \n

\n weekly on {{ data?.master_booking?.recurrence_days[0] | titlecase }}\n

\n

from

\n \n Monthly on \n\n {{ data?.master_booking?.dateString }} until\n {{ data?.master_booking?.endDateString }}\n

\n \n \n Specific Dates: \n
\n
\n
Date
\n
\n
\n {{ occurrence.dateTz.formatDate('dd MMM yyyy') }}\n
\n
\n
\n
\n
\n
\n\n

{{ dateString }}

\n

{{ timeString }}

\n

{{ buildingAddress }}

\n

{{ data.booking.room.local_room_name }}

\n \n
\n \n
\n
\n `,\n styleUrls: ['./cancel-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CancelBookingModalComponent extends BaseClass {\n public title: string;\n public roomName: string;\n public buildingAddress: string;\n public dateString: string;\n public timeString: string;\n public canceled = false;\n private _specific_dates = false;\n private recurrence_period: RecurrencePeriod;\n public occurrence_details: { start_epoch: number; dateTz: DateTZ; id: string }[];\n private recurrence_interval: number;\n\n public get subtitle() {\n return this.canceled\n ? `${this.title} booking cancelled`\n : this.data?.series\n ? 'Are you sure you want to cancel this recurring series?'\n : 'Are you sure you want to cancel this booking?';\n }\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: data,\n private dialogRef: MatDialogRef\n ) {\n super();\n this.dateString = dateBuildingFormatString(this.data.booking.startDateTz, true);\n this.timeString = startEndTimeWithZoneFormatString(this.data.booking.startDateTz, this.data.booking.displayEndDateTz);\n this.title = this.data.booking.title;\n this.buildingAddress = this.data.booking.room.street_and_city;\n\n\n\t\t\t\tif(this.data?.master_booking !== null) {\n\n\t\t\t\t\tthis.recurrence_period = this.data?.master_booking?.recurrence_period;\n\t\t\t\t\tthis.recurrence_interval = this.data?.master_booking?.recurrence_interval;\n\n\t\t\t\t\tthis.occurrence_details = this.data?.master_booking?.occurrence_details &&\n\t\t\t\t\t\tthis.data?.master_booking?.occurrence_details\n\t\t\t\t\t\t\t.filter((ocurrence) => ocurrence.id !== this.data?.master_booking?.id)\n\t\t\t\t\t\t\t.map((ocurrence) => ({\n\t\t\t\t\t\t\t\t...ocurrence,\n\t\t\t\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\tbuilding_tz: this.data.master_booking.timezone,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t}));\n\t\t\t\t}\n\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public cancelBooking() {\n this.canceled = true;\n this.data.callback();\n this.timeout('closeModal', () => this.closeModal(), 2000);\n }\n\n public set specific_dates(val: boolean) {\n this._specific_dates = val;\n }\n\n public get specific_dates(): boolean {\n return this._specific_dates;\n }\n\n public toggleSpecificDates() {\n this.specific_dates = !this.specific_dates;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n Booking,\n Building,\n CateringOrder,\n Space,\n bookingStatusDetails,\n ApplicationService,\n CateringCategory,\n BookingsService,\n DataForConfirmation,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap,\n shorterLocalDateFormatString\n} from '@mckinsey-converge/base';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase\n} from '@mckinsey-converge/base';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n CateringDetailsModalComponent,\n CateringDetailsModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface BookingFlowEvent {\n /** Type of flow event */\n type: 'previous' | 'next' | 'reset' | 'close' | 'error';\n /** Step which the event was emitted from */\n step: string;\n /** Additional metadata for the event */\n metadata?: HashMap;\n}\n\n@Component({\n selector: 'booking-catering',\n templateUrl: './catering.component.html',\n styleUrls: ['./catering.component.scss']\n})\nexport class BookingCateringComponent extends BaseDirective implements OnInit {\n /** Form fields for the booking */\n @Input() public form: FormGroup;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n @Input() public booking: Booking;\n @Input() public isOccurence: boolean;\n /** Emitter for open catering */\n @Output() public showCatering = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n\n constructor(\n private _dialog: MatDialog,\n public _service: ApplicationService,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.updateConfimatinModal();\n }\n\n /** Active order to display details for */\n public active_order: CateringOrder;\n public TopBarHeaderMode = TopBarHeaderMode;\n public confirmed: boolean = false;\n public next_disabled: boolean = true;\n\n public loading: boolean = false;\n\n\n public get building(): Building[] {\n return this.booking.room.building;\n };\n\n /** Field for storing catering details */\n public get catering_field() {\n return this.form && this.form.controls.catering ? this.form.controls.catering : null;\n }\n\n /** List of spaces selected for the booking */\n public get space_list(): Space[] {\n return this.form && this.form?.controls?.space_list?.value.length\n ? this.form.controls.space_list.value\n : [];\n }\n\n /** Date of the booking */\n public get dateTz(): number {\n return this.form && this.form.controls.dateTz\n ? this.form.controls.dateTz.value\n : DateNow(new Date()).startOfValue('minute');\n }\n\n /** Duration of the booking */\n public get duration(): number {\n return this.form && this.form.controls.duration ? this.form.controls.duration.value : 60;\n }\n\n /** Whether booking is all day */\n public get all_day(): boolean {\n return this.form && this.form.controls.all_day && this.form.controls.all_day.value;\n }\n\n\n public get type() {\n return toTitleCase(this.booking?.class);\n }\n\n public get dateString() {\n return dateBuildingFormatString(this.booking.startDateTz);\n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n /** Create a new catering order */\n public newOrder(): void {\n const order = new CateringOrder({ booking_timezone: this.booking?.timezone });\n this.active_order = order;\n }\n\n // Combine the same items for the same timeslot into the same order item\n public combineItems = (newItems: CateringCategory[], oldItems: CateringCategory[]) => {\n // Group and Sum the items in an Item ID keyed object\n const itemsObj = {};\n oldItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n });\n newItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n })\n // Convert the object to an array\n const items = [];\n for (const item in itemsObj) {\n items.push(itemsObj[item]);\n }\n // return the items consolidated by item ID.\n return items;\n }\n\n /** Handle changes to catering order */\n public handleOrderEvent(order: CateringOrder) {\n /* istanbul ignore else */\n if (order) {\n this.next_disabled = false;\n const orders = this.form.controls.catering.value;\n // When the order edit button is clicked we are editing an existing order\n const index = orders.findIndex((an_order) => {\n return order.id === an_order.id\n });\n\n // If editing an existing order row it will have an index, if not create a new row\n if (index < 0) {\n // Add the new order\n orders.push(order);\n } else {\n // Replace the existing order with the edited order\n orders.splice(index, 1, order);\n }\n\n // Setup the \"reduced\" data containers\n const reduceItems = {};\n const reduceOrders = {};\n orders.forEach((o) => {\n if (reduceItems[o.delivery_time]) {\n // An order for this timeslot already exists, combine the same items to dedupe rows\n reduceItems[o.delivery_time] = this.combineItems(o.items, reduceItems[o.delivery_time]);\n } else {\n // Since this is a new timeslot, use the existing items\n reduceItems[o.delivery_time] = o.items;\n // Copy the order and clear its item contents, placeholder for the updated items\n reduceOrders[o.delivery_time] = o;\n reduceOrders[o.delivery_time].items = [];\n }\n });\n\n // Add the reduced items to the reduced orders\n let consolidatedOrders = [];\n for (const deliveryTime in reduceOrders) {\n const order = reduceOrders[deliveryTime];\n order.items = reduceItems[deliveryTime]\n consolidatedOrders.push(order);\n }\n\n this.form.controls.catering.setValue(consolidatedOrders);\n }\n this.active_order = null;\n }\n\n public closeCallback() {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n\n public closeConfirmation() {\n this.event.emit();\n }\n\n /** Open modal for adding equipment requirements to booking */\n private openCateringDetailsModal() {\n const ref = this._dialog.open(\n CateringDetailsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n spaces: this.form.controls.space_list.value,\n notes_field: this.form.controls.notes,\n catering: this.form.controls.catering,\n booking: this.booking\n }\n }\n );\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n // Catering requirements and charge code modal closed event\n /* istanbul ignore else */\n if (event.reason === 'done') {\n // Closed with the reason done\n ref.close();\n\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n\n this.saveBooking();\n }\n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public saveBooking() {\n // Clone and append the catering and note data to the booking\n let booking = this.booking.clone();\n booking.catering = this.form.controls.catering.value;\n booking.notes = this.form.controls.notes.value;\n if(booking.notes.length || booking.catering.length) {\n\n const setup = { ...booking.setup };\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n booking.setup = setup;\n\n const breakdown = { ...booking.breakdown };\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n booking.breakdown = breakdown;\n }\n\n\n // Save to the API and respond. && !this.isOccurence\n this._bookings.save(booking, booking.is_recurrent ).then(\n (bkn) => {\n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() }); \n // Stop the loading animation and show the booking confirmation component.\n this.updateConfimatinModal();\n\n this.loading = false;\n this.confirmed = true;\n this.event.emit(this.form)\n },\n (err) => {\n // Stop the loading animation and return to the catering flow with an error.\n this.loading = false;\n this.confirmed = false;\n this._service.notifyError(\n `Error updating booking.`\n );\n }\n )\n }\n\n public handleOrderListEvent($event: any) {\n const orders = this.form.controls.catering.value;\n // Handle the Previous and Next buttons\n if ($event.type === 'previous') {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n if ($event.type === 'next') {\n // Move on to the catering details modal\n this.next_disabled = false;\n if (orders.length) {\n this.openCateringDetailsModal();\n } else {\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n this.saveBooking();\n }\n }\n }\n\n public openCatering() {\n // Start catering from the Booking Confirmation page Add Catering button\n this.confirmed = false;\n this.next_disabled = true;\n this.showCatering.emit();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n // openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n \n this.booking.multi_rooms.forEach(room => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n \n\n const result = {\n is_conflict: totalConflicts > 0, \n total_Conflicts: totalConflicts \n };\n return result;\n }\n\n /**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n return shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n }\n\n}\n","
\n
\n \n \n
\n
\n
\n
\n \n \n \n
\n \n \n \n
\n
\n \n
\n
\n
","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport { CateringCategory } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-category-display',\n templateUrl: './category.component.html',\n styleUrls: ['./category.component.scss']\n})\nexport class CateringMenuCategoryComponent {\n /** Category to display details for */\n @Input() public category: CateringCategory;\n /** Form control for the list of order items */\n @Input() public items: FormControl;\n /** Currency symbol for the active space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for close events */\n @Output() public close = new EventEmitter();\n}\n","
\n
\n \n
{{ category?.name }}
\n
\n
\n\n
\n \n
\n
\n\n
\n
\n \n
\n
\n Category contains no available items\n
\n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\nimport { BehaviorSubject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n Building,\n CateringCategory,\n CateringItem,\n CateringMenuService,\n CateringOrder,\n OrganisationService,\n Space\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n Identity\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n BookingCateringConfirmModalComponent,\n CateringConfirmModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface StartEndResponse {\n timezone: string,\n start: DateTZ;\n end: DateTZ\n}\n\n@Component({\n selector: 'a-catering-order-details',\n templateUrl: './order-details.component.html',\n styleUrls: ['./order-details.component.scss']\n})\nexport class BookingCateringOrderDetailsComponent extends BaseDirective implements OnInit {\n /** Catering order to edit details of */\n @Input() public order: CateringOrder;\n /** Booking date */\n @Input() public dateTz: DateTZ;\n /** Booking duration */\n @Input() public duration: number;\n /** Booking duration */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether top header details should be shown */\n @Input() public hide_details: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for changes to the catering order */\n @Output() public event = new EventEmitter();\n /** Form controls for order */\n public form: FormGroup;\n /** List of available catering item categories */\n public category_list: CateringCategory[] = [];\n /** Active category to display details for */\n public active_category: CateringCategory;\n /** List of available times for delivering catering */\n public available_times: Identity[] = [];\n /** Whether the menu is loading */\n public loading: boolean;\n /** Whether the search input should be shown */\n public show_search: boolean;\n /** Current search string for filtering */\n public readonly search$ = new BehaviorSubject('');\n /** List of menu items that match the search string */\n public matched_items: CateringItem[] = [];\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n @ViewChild('input') private _input_el: ElementRef;\n\n /** Whether user is able to order from the currently selected space */\n public get can_order(): boolean {\n return (\n (this.active_building.has_catering || this.category_list.length) &&\n (!this.within_restricted_time || this.has_available_items) &&\n !this.out_of_hours\n );\n }\n\n /** Building associated with the selected space */\n public get active_building(): Building {\n const form_controls = (this.form || { controls: { location_id: { value: '' } } }).controls;\n const space: Space =\n this.space_list.find((space) => space.email == form_controls.location_id.value) ||\n ({ level: {} } as any);\n return (\n this._org.buildings.find((bld) => space.level?.building_id === bld.id) ||\n ({ catering_restricted_from: 0 } as any)\n );\n }\n\n /** Currency code for the active building */\n public get symbol(): string {\n return this.active_building.currency || 'USD';\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n return this.form\n ? this.form.controls.items.value.reduce((total, item) => total + item.amount, 0)\n : 0;\n }\n\n /* istanbul ignore next */\n /** Whether booking time is outside of catering hours */\n public get out_of_hours(): boolean {\n return this.form.controls.delivery_time.value < 0;\n }\n\n /** Whether booking is with the restricted ordering period */\n public get within_restricted_time(): boolean {\n const expired = DateNow(new Date()).addValue({ hours: this.active_building.catering_restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n }\n\n /** Whether booking is with the restricted ordering period */\n public within_category_restricted_time(item?: CateringItem ): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!item?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: item?.restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n /** Whether items are available for order at anytime */\n public get has_available_items(): boolean {\n return this.category_list.reduce(\n (available, category) => available || category.can_order_anytime,\n false\n );\n }\n\n constructor(\n private _menu: CateringMenuService,\n private _org: OrganisationService,\n private _dialog: MatDialog\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.generateAvailableTimes();\n this.subscription('search', this.search$.pipe(map((str) => {\n const search = str.toLowerCase();\n const items = [];\n const available_categories = this.category_list.filter(item => !item.within_category_restricted_time(this.dateTz) )\n\n for (const category of available_categories) {\n if (category.items) {\n for (const group of category.items) {\n if ((group as any).items.length) {\n if (\n (group as any).package &&\n (group.name.toLowerCase().includes(search) ||\n (group as any).items.find((item) =>\n item.name.toLowerCase().includes(search)\n ))\n ) {\n items.push(group);\n } else {\n for (const item of (group as any).items) {\n if (item.name.toLowerCase().includes(search)) {\n items.push(item);\n }\n }\n }\n } else {\n if (group.name.toLowerCase().includes(search)) {\n items.push(group);\n }\n }\n }\n }\n }\n \n return items;\n })).subscribe((items) => this.matched_items = items));\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.date || changes.duration) {\n this.generateAvailableTimes();\n /* istanbul ignore else */\n if (\n this.form &&\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n /* istanbul ignore else */\n if (changes.space_list) {\n /* istanbul ignore else */\n if (this.form && this.space_list && !this.form.controls.location_id.value) {\n this.form.controls.location_id.setValue(this.space_list[0].email);\n }\n }\n /* istanbul ignore else */\n if (changes.order && this.order) {\n this.initForm();\n }\n }\n\n public focusSearch() {\n if (this._input_el && this.show_search) {\n this._input_el.nativeElement.focus();\n }\n }\n\n public initForm() {\n this.form = new FormGroup({\n id: new FormControl(this.order.id),\n booking_date: new FormControl(\n this.all_day ? this.dateTz.startOfValue('day').ms : this.dateTz.ms\n ),\n location_id: new FormControl(this.order.location_id || this.space_list[0]?.email),\n delivery_time: new FormControl(this.order.delivery_time || this.available_times[0].id),\n items: new FormControl(this.order.items.map((item) => new CateringItem(item)))\n });\n this.subscription(\n 'space_change',\n this.form.controls.location_id.valueChanges.subscribe((space) => {\n this.generateAvailableTimes();\n if (\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n this.form.controls.items.setValue([]);\n this.loadMenu();\n })\n );\n this.loadMenu();\n this.generateAvailableTimes();\n if (\n this.form &&\n !this.available_times.find((time) => time.id === this.form.controls.delivery_time.value)\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n\n public confirmOrder() {\n const ref = this._dialog.open(BookingCateringConfirmModalComponent, {\n maxWidth: '95vw',\n data: {\n all_day: this.all_day,\n dateTz: this.dateTz,\n form: this.form\n }\n });\n this.subscription(\n 'confirm_event',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const order = new CateringOrder({ ...this.order, ...this.form.value });\n // order is emited but who is receiving?\n this.event.emit(order);\n ref.close();\n }\n })\n );\n ref.afterClosed().subscribe(() => {\n this.unsub('confirm_event');\n });\n }\n\n private loadMenu() {\n const space = this.space_list.find(\n (space) => space.email === this.form.controls.location_id.value\n );\n\n this.loading = true;\n this._menu\n .query({ zone_id: this._org.buildings.find((bld) => space?.zones.includes(bld.id))?.id })\n .then(\n (list) => {\n this.loading = false;\n this.category_list = list.map((i) => new CateringCategory(i))\n .filter(c => !c.out_of_stock);\n },\n () => (this.loading = false)\n );\n }\n\n /** Generate a list of available delivery times for the given booking time */\n private generateAvailableTimes() {\n let { timezone, start, end } = this.generateStartAndEndTimes();\n start = start.setValue({ minute: Math.ceil(start.minutes / 5) * 5 });\n // will be different from staff in these commonly named methods.\n const start_date = this.dateTz;\n this.available_times = [];\n while (start.isBeforeDate(end)) {\n this.available_times.push({\n id: Math.abs(start_date.dateDiff(start, 'minutes')),\n name: start.formatDate('h:mma').toLocaleLowerCase(),\n });\n start = start.addValue({ minutes: 5 });\n }\n /* istanbul ignore else */\n if (this.available_times.length === 0) {\n this.available_times.push({ id: -1, name: 'Out of hours' });\n }\n }\n\n private generateStartAndEndTimes(): StartEndResponse {\n const now = DateNow(new Date())\n let timezone = now.local_tz;\n const space_email = this.form ? this.form.controls.location_id.value : null;\n let catering_hours = { start: 7, end: 20 };\n let building_time = this.dateTz.startOfValue('day');\n let cat_start_time = building_time.addValue({ hours: catering_hours.start });\n let cat_end_time = building_time.addValue({ hours: catering_hours.end });\n\n if (space_email) {\n // Fetch the Space and Building\n const space = this.space_list.find((space) => space.email === space_email);\n const building = this._org.buildings.find((bld) => space?.zones.includes(bld.id));\n if (building.timezone) {\n // Update to the building timezone if defined.\n timezone = building.timezone;\n building_time = this.dateTz.toZone(timezone).startOfValue('day');\n }\n if (building?.catering_hours) {\n // Update to the building catering hours if defined.\n catering_hours = building?.catering_hours;\n }\n // Update the hours with the currently defined timezone.\n cat_start_time = building_time.addValue({ hours: catering_hours.start });\n cat_end_time = building_time.addValue({ hours: catering_hours.end });\n }\n\n // Start Time of the Booking\n let start = this.dateTz.toZone(timezone);\n let end = this.dateTz.toZone(timezone).addValue({ minutes: this.duration });\n\n // Do the booking start and end time coincide with the catering hours?\n if (start.isBeforeDate(cat_start_time)) {\n // booking start before catering opens'\n if (cat_end_time.isAfterDate(start)) {\n // catering closes after booking starts'\n start = cat_start_time.addValue({});\n } else {\n // were just closed, catering closes before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking starts after catering is open'\n if (cat_end_time.isBeforeDate(start)) {\n // were just closed, catering closed before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n }\n\n if (end.isBeforeDate(cat_end_time)) {\n // booking ends before catering closes'\n if (cat_start_time.isAfterDate(end)) {\n // were just closed, catering opens is after booking ends'\n start = cat_start_time.addValue({});\n end = cat_start_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking ends after catering closes'\n // set the booking end to the catering close time.'\n end = cat_end_time.addValue({});\n }\n\n return { timezone, start, end };\n }\n}\n\n","
\n
\n
\n
\n
Deliver to:
\n \n \n \n {{ space.local_name }}\n \n \n \n
\n
\n
At:
\n \n \n \n {{ time.name }}\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n \n
\n \n
\n
{{ item.name }}
\n \n
\n
\n
\n
\n
\n
\n \n Back\n \n \n Confirm Order({{ item_count || '0' }})\n \n
\n
\n
\n\n
\n
\n \"No\n
\n

\n Catering is not available for this booking.
\n Catering must be ordered within business hours at {{ active_building?.name }}.\n

\n
\n
\n\n
\n
\n
\n \n
\n
\n Loading menu for {{ active_building?.name }}...\n
\n
\n
\n
\n\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\n\nimport {\n CateringOrder,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { DateNow } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'catering-order-list-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss']\n})\nexport class CateringOrderListItemComponent implements OnInit {\n /** Catering order to display */\n @Input() order: CateringOrder;\n /** */\n @Input() public space_list: Space[];\n /** Selected datetime */\n @Input() date: number = DateNow(new Date()).ms;\n /** Emitter for edit events */\n @Output() public edit = new EventEmitter();\n /** Emitter for delete events */\n @Output() public delete = new EventEmitter();\n\n public room: Space;\n\n public ngOnInit(): void {\n this.room = (this.space_list || []).find(space => space.email === this.order.location_id);\n }\n\n public get space_in_booking(): boolean {\n return !!this.room;\n }\n\n /** Space selected for delivery */\n public get local_space_name(): string {\n return this.room?.local_name || '';\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n /* istanbul ignore else */\n if (!this.order) {\n return '';\n }\n\n // R--- there's probably a helper for this calculation on the Catering Order \n return this.order.bookingDateTz.addValue({ minutes: this.order.delivery_time || 0 }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount * item.unit_price, 0);\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.room || !this.room.level) {\n return 'USD';\n }\n\n return this.room?.building?.currency || 'USD';\n }\n\n constructor(private _spaces: SpacesService) {\n }\n}\n","
\n Deliver to {{ local_space_name }} at {{ delivery_time }}\n
\n
\n
\n {{ item_count }}\n { item_count, plural, =1 { item } other { items } }\n
\n
{{ order_cost / 100 | currency: symbol }}
\n
\n
\n \n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport {\n CateringOrder,\n Space\n} from '@mckinsey-converge/data-common';\nimport { BookingFlowEvent } from '../../catering/catering.component';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'a-catering-order-list',\n templateUrl: './order-list.component.html',\n styleUrls: ['./order-list.component.scss']\n})\nexport class BookingCateringOrderListComponent {\n /** Form field for storing catering orders */\n @Input() public catering: FormControl;\n /** Selected datetime for the booking */\n @Input() public date: number;\n /** */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether booking is all day */\n @Input() public next_disabled: boolean;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n /** Emiiter for order events */\n @Output() public order = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n \n public delete: boolean = false;\n\n /** List of orders in the booking */\n public get orders(): CateringOrder[] {\n /* istanbul ignore else */\n if (!this.catering) {\n return [];\n }\n let orders = [];\n const date_ = new DateTZ({date: this.date})\n this.catering.value.forEach(\n order => {\n const newOrder = order;\n newOrder.booking_date = this.all_day\n ? date_.startOfValue('day').ms\n : this.date;\n orders.push(newOrder);\n }\n \n );\n return orders;\n }\n\n /** Emit event for a new catering order */\n public newOrder() {\n this.order.emit();\n }\n\n /** Emit event for editing existing order */\n public editOrder(order: CateringOrder) {\n this.order.emit(order);\n }\n\n /** Remove order from the list */\n public deleteOrder(order: CateringOrder) {\n const orders = this.orders;\n const index = orders.findIndex(an_order => order.id === an_order.id);\n /* istanbul ignore else */\n if (index >= 0) {\n orders.splice(index, 1);\n this.catering.setValue(orders);\n this.delete = true;\n }\n }\n\n /**\n * Proceed to the next step in the space booking flow\n */\n public next(): void {\n // Open the confirmation modal\n this.event.emit({ type: 'next', step: 'catering' });\n }\n\n /** Move flow to previous step */\n public previous(): void {\n this.event.emit({ type: 'previous', step: 'catering' });\n }\n}\n","
\n
\n

Catering Orders

\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n Back\n \n \n Next\n \n
\n
\n
\n\n
\n
\n \n
\n
No catering orders
\n \n
\n
\n","import {\n Component,\n Input,\n} from '@angular/core';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'catering-order-table',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n Delivery\n Charge CodeOrder
\n {{formatDeliveryTime(order)}}\n \n {{order?.charge_code}} \n \n {{listItems(order)}}\n
\n
\n `,\n styleUrls: ['./order-table.component.scss']\n})\nexport class OrderTableComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public booking: Booking;\n\n public listItems(order) {\n return order.items.map(i => `${i.name}${i.amount > 1 ? ` (${i.amount})` : ''}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n public oddEvenClass(x) {\n return x % 2 === 0 ? 'odd' : 'even';\n }\n}\n","import {\n Component,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnInit\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n User,\n Booking,\n Building,\n BuildingCity,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectUpcomingBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n selectBookingByIdResultsFromState,\n UsersService,\n} from '@mckinsey-converge/data-common';\nimport {\n clearBookingByIdResults,\n} from '@mckinsey-converge/bookings';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n first,\n map,\n take,\n} from 'rxjs/operators';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport {\n SelectOption\n} from '@mckinsey-converge/ui';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { RoomBookingStoreState } from '../room-booking/room-booking.component';\nimport { MatTabChangeEvent } from '@angular/material/tabs';\nimport { SearchBarConfig } from 'libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component';\n\n\n@Component({\n selector: 'app-manage-bookings',\n template: `\n
\n
 
\n
\n \n
\n
\n
\n
\n

Manage Bookings

\n\n
\n \n \n
\n \n
\n \n
\n\n\n \n \n
\n \n \n \n
\n
\n\n
\n
\n
\n
\n `,\n styleUrls: ['./manage-bookings.component.scss']\n})\nexport class ManageBookingsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public buildings = new BehaviorSubject[]>([]);\n public bookingTypes = [\n {\n type: 'upcoming',\n display: 'Upcoming',\n selector: selectUpcomingBookingsResultsFromState\n },\n {\n type: 'past',\n display: 'Past',\n selector: selectPastBookingsResultsFromState\n },\n {\n type: 'cancelled',\n display: 'Cancelled',\n reverse_sort: true,\n selector: selectCancelledBookingsResultsFromState\n },\n ];\n\n /** Current User */\n public currentUser: User;\n public dialogRef: MatDialogRef;\n public modalInitialized = false;\n public hasLoaderUrl = true;\n\n public activeTab = 'upcoming';\n\n /**\n * Configs for delegate dropdown\n */\n /* if user has no delegates, hide the dropdown */\n public has_delegate: boolean = false; \n /* Holds list of all host/delegates */\n public host_list: User[];\n public hostOptions: { display: string; value: string; meta: { user: User; }; }[];\n public delegateDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; ddOptionBoxWidth: string };\n public selectedHost: string = '';\n\n public searchBookingBy: any = '';\n\n\n searchBarConfig: SearchBarConfig = {\n placeholder: 'Search by title, room name, attendees...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n constructor(\n private dialog: MatDialog,\n private store: Store,\n private route: ActivatedRoute,\n private _router: Router,\n private _users: UsersService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Get the router params\n const bookingId = this.route.snapshot.paramMap.get('id');\n const verb = this.route.snapshot.paramMap.get('verb');\n // Load the buildings data\n this.store.dispatch(loadOrganisations.request());\n this.route.data.subscribe(initData => {\n // Determine if the cancel or booking submodal is loading\n const cancel = verb === 'cancel';\n const addCatering = initData.hasCatering;\n /**\n * When using the catering or cancel URLs,\n * Users reported the modals loading after one another was\n * jarring so, so the UI is masked out until the modal is loaded.\n */\n this.hasLoaderUrl = addCatering || cancel;\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n if (bookingId && !this.modalInitialized) {\n this.store.dispatch(clearBookingByIdResults())\n this.modalInitialized = true;\n // Once the data loads viewBooking\n this.subscription('bookingResults', this.store.pipe(\n select(selectBookingByIdResultsFromState)\n ).subscribe(next => {\n const booking = next.success ? next.success?.[0] : null;\n if (booking && booking.room) {\n // Modal Madness, close the existing booking details modals.\n if (this.dialogRef) {\n this.dialogRef.close();\n }\n if (this.dialog) {\n this.dialog.closeAll();\n }\n // Call viewBookingFromEmailLink with cancel = true to trigger the cancel modal\n // Call viewBookingFromEmailLink with addCatering = true to trigger the add Catering modal\n this.viewBookingFromEmailLink(booking, cancel, addCatering);\n\n // Remove the \"loader\" url from view\n this.timeout('rewrite url',() => {\n this._router.navigate(['/home','manage'], { replaceUrl: true });\n })\n }\n }));\n }\n }));\n\n })\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n if (bookingId) {\n // If there's a booking ID loadBookingById\n this.store.dispatch(loadBookingsWithQuery({ 'id': bookingId, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n }\n }));\n\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n\n const delegates = user.delegates.map((del) => {\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n });\n\n if (delegates.length) {\n this.has_delegate = true;\n\n this.host_list = [user].concat(delegates);\n const options = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }))\n \n this.hostOptions = [{ display: 'All', value: '', meta: { user: null } }].concat(options);\n this.selectedHost = this.hostOptions[0].value;\n this.delegateDD = {\n ddBoxClass: '',\n options: this.hostOptions,\n defaultSelected: this.hostOptions[0],\n onChangeCallback: this.onChangeDelegates.bind(this),\n ddOptionBoxWidth: '200px'\n }\n }\n \n });\n }\n\n public onChangeDelegates(del) {\n this.selectedHost = del.value;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // Only fires from an email link\n public viewBookingFromEmailLink(booking: Booking, cancel: boolean = false, addCatering: boolean = false) {\n if (this.modalInitialized && this.dialogRef) {\n this.dialogRef.close();\n this.dialogRef = null;\n }\n // R--- Verify the email links are working.\n // Open the booking details modal\n if (!this.dialogRef && booking.room) {\n this.dialogRef = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking,\n building: this.getBuilding(booking),\n cancel,\n addCatering,\n hasLoaderUrl: this.hasLoaderUrl,\n refresh: () => null\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n // Close up the loader panel\n setTimeout(() => {\n this.hasLoaderUrl = false;\n }, 1000);\n }\n }\n\n public clearPage(event : MatTabChangeEvent) {\n this.activeTab = this.bookingTypes[event.index].type;\n this._router.navigate([], { relativeTo: this.route, queryParams: { page: 1 } });\n }\n\n\n searchBooking(value) {\n this.searchBookingBy = value;\n }\n\n}\n","import {\n Booking\n} from '@mckinsey-converge/data-common';\n\n\nexport class BookingResultsViewModel {\n constructor(public booking: Booking) {\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Booking[]): BookingResultsViewModel[] => {\n if (!results || !results[0]?.space) {\n return [];\n }\n return results.map((booking: Booking) => {\n return new BookingResultsViewModel(\n booking,\n );\n }); \n}\n\n","import { Component, Inject, OnInit, ViewEncapsulation, ElementRef, Input, ViewChild, ChangeDetectorRef } from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n BookingStoreState,\n User,\n Booking,\n BookingFormData,\n BOOKING_STATUS,\n checkCollisions,\n SpacesService,\n BookingsService,\n BookingStateService,\n clearBookingFormData,\n ApplicationService,\n selectFilteredByIdResults,\n FilteredSpaces,\n selectActiveForm,\n roomFormDataToQuery,\n storeBookingFormData,\n getNextFreeBookingSlot,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\nimport { DateTime } from 'luxon';\nimport { Point, BaseDirective, closestToTimeSlot, HashMap, closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { BehaviorSubject, Observable, interval, timer, of } from 'rxjs';\nimport { CENTER_POINT, MIN_ZOOM_LEVEL } from 'src/app/map/map.utils';\nimport { Store, select } from '@ngrx/store';\nimport { RoomStoreState, loadByIdResults, loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { delay, map, take } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { WAITING_TIME } from '../floor-map.utils'; // commented and re declare below due to circular dependency overlay > util > overlay\n\nexport const WAITING_TIME = 15;\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel;\n parentComponent?: any;\n roomObs?: Observable\n}\n\ninterface InProgressRoomBookingTimeInfo {\n\tcurrentStatus: string,\n\tactiveBookings: Booking[],\n\ttimeUntilNextBooking: number,\n\ttimeRemainingInActiveBooking : number,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'foor-map-overlay',\n template: `\n
\n
\n\n
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \t\n
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tThis room is available\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tRoom {{ data.simple_name || data.name || '' }} is available for booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tBook now for:\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tUntil next booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Available if you book in the next {{minutesRemaining}}:{{secondsRemaining}} minutes\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tRefresing availability ...\n\t\t\t\t\t\t\t
\n \t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tThis room is booked\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Apologies, this room has been booked recently by another user, please try another one. \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n
\n
\n
\n `,\n styleUrls: ['./floor-map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class FloorMapOverlayComponent extends BaseDirective implements OnInit {\n public selectedRoomId = this.data.id;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public center = new BehaviorSubject(CENTER_POINT);\n\n public date = DateTime.now().valueOf();\n /** Current User */\n public currentUser: User;\n\n public availableUntil = parseInt(this.data?.settings?.available_until.toString()) * 1000;\n public diff: any;\n\n public latestBooking: any[];\n public latestBookingStartTime: string;\n public diffInHours: number;\n public diffInMinutes: number;\n public booking: Booking = new Booking({});\n public loading: boolean;\n public bookingData = new BehaviorSubject(undefined);\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public diffInMs: number;\n public futureBookingsForTheDay: HashMap[];\n public untilNextBookingFlag: boolean = false;\n public start_epoch: any;\n public end_epoch_15: any;\n public end_epoch_30: any;\n\n public userSelectedRoom: RoomResultsViewModel;\n\n // @ViewChild('time', { static: false }) public time: ElementRef;\n public isTimerActive: boolean = true;\n minutesRemaining: number | string;\n secondsRemaining: number | string;\n isAvailable: boolean = true;\n intervalCall_15: any;\n intervalCall_1: any ;\n\t\ttimerIndex = 0;\n\t\tpublic currentMin;\n\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n private elementRef: ElementRef,\n public store: Store,\n public _spaces: SpacesService,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _service: ApplicationService,\n // public cdRef: ChangeDetectorRef,\n ) {\n super();\n }\n\n public updateRoomData(space) {\n\n\t\t\t\t\t\t// get all booking of selected room\n this.fetchRoomWithBookings(false);\n\n\t\t\t\t\t\t// subscrip selected room detail with all bookings for the day\n this.subscription(\n 'bookingSpaceResults',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n if (next.success.spaces) {\n\n space.space = next.success.spaces[0];\n this.userSelectedRoom = space;\n\n this.isTimerActive = true;\n\n this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n\n\t\t\t\t\t\t\t\t\t\t\t\t//Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t\t\t\t\t\t\t\t\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t\t\t\t\t\t\t\t\t\tthis.diff = timeUntilNextBooking\n // inform user if space has been booked by other\n if( currentStatus !== 'available') {\n if(activeBookings.length && timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 ) {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n } else {\n this.isAvailable = false;\n this.intervalCall_1?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n }else {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n }\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Determine available time until next booking start time\n this.determineNextBookingStartTime();\n }\n })\n );\n\n }\n\n\t\t/**\n\t\t * Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t * @returns\n\t\t */\n\t\tpublic calculateRoomBookingTimeInfo(): InProgressRoomBookingTimeInfo {\n\n\t\t\tconst now: any = DateNow(new Date()); // current date time\n\n\t\t\t// Retirive a list of bookings and map them to booking objects\n\t\t\tconst bookings = this.userSelectedRoom.space.settings.bookings.map(b => new Booking(b));\n\n\t\t\t// Filter active/in-progress bookings based on the current time\n\t\t\tconst activeBookings = bookings.filter(booking =>\n\t\t\t\t\t\tnow.isAfterDate(booking.startDateTz.startOfValue('second')) &&\n\t\t\t\t\t\tnow.isBeforeDate(booking.endDateTz.startOfValue('second') )\n\t\t\t);\n\n\t\t\t// Retrive the status of the selected room from parent component data\n\t\t\tconst currentStatus = this.data.parentComponent.roomStatus.statusMap[this.selectedRoomId]; // \" 'available' / 'in-use'\"\"\n\n\t\t\t// Initialize the variable to track time-related information\n\t\t\tlet timeRemainingInActiveBooking = 0; // The remaining time in the active booking in milliseconds\n\t\t\tlet timeUntilNextBooking = 30; // Time until the start of the next booking minutes\n\n\t\t\t// Check if ther are active bookings (room is 'in-use')\n\t\t\tif(activeBookings.length) {\n\t\t\t\tconst nowTime: any = DateTime.now()\n\t\t\t\t// Calculate the time remaining in the active booking in minutes\n\t\t\t\ttimeRemainingInActiveBooking = Math.abs(Math.round((activeBookings[0].end_epoch * 1000 - nowTime.ts) / 60000));\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n\t\t\t\tconst addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// calculate the start time of the next booking in the same time slot\n\t\t\t\tconst nextBookingStartTime: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n\n\t\t\t\t// Filter futute booking for the day to find the next booking\n\t\t\t\tconst futureBookingsForTheDay = this.userSelectedRoom.space?.settings?.bookings.filter((item) =>\n\t\t\t\t\titem.start_epoch * 1000 >= nextBookingStartTime.ts\n\t\t\t\t);\n\n\t\t\t\t// Check if there is an futute booking for the day\n\t\t\t\tif(futureBookingsForTheDay.length) {\n\t\t\t\t\t// calculate the time until start of the next booking in minutes\n\t\t\t\t\tconst nextBookingStartTimeMs = futureBookingsForTheDay[0].start_epoch * 1000;\n\t\t\t\t\ttimeUntilNextBooking = Math.floor((nextBookingStartTimeMs - nowTime.ts) / (1000 * 60));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t\t\t\tcurrentStatus: currentStatus,\n\t\t\t\t\t\t\tactiveBookings: activeBookings,\n\t\t\t\t\t\t\ttimeUntilNextBooking: timeUntilNextBooking,\n\t\t\t\t\t\t\ttimeRemainingInActiveBooking : timeRemainingInActiveBooking,\n\t\t\t\t\t\t};\n\n\t\t}\n\n public setup15MinTimer() {\n //interval for 15 min\n !this.timerIndex && setTimeout(()=>this.setUpTime(), 1100 ) ;\n this.timerIndex++\n this.intervalCall_15 = window.setInterval(\n () => { this.intervalCall_1?.unsubscribe(); setTimeout(()=>this.setUpTime(), 1100 ) }\n , ( 1000 * 60 * WAITING_TIME ) );\n\n\n }\n\n public setUpTime() {\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute'));\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME)\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second'))\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n let start:any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n start = start.toLocaleString(DateTime.TIME_SIMPLE);\n if(start !== this.start_epoch ) {\n\n this.start_epoch = start;\n\n // this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(this.availableUntil);\n // this.diff = Math.abs(Math.round((endTime.getTime() - currentTime.getTime()) / 60000));\n\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n\n }\n\n\t\t\t\t\t\t//update up start and end epoch times for a booking button options\n\t\t\t\t\t\tthis.updateSchedulingEpochs()\n\n // let end_15: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 15 });\n // end_15 = end_15.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_15 !== this.end_epoch_15) {\n // this.end_epoch_15 = end_15\n // }\n\n // let end_30: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 30 });\n // end_30 = end_30.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_30 !== this.end_epoch_30) {\n // this.end_epoch_30 = end_30;\n // }\n }\n\n public ngOnInit(): void {\n this.fetchRoomWithBookings(false);\n\n this.data.parentComponent.childCallback = this.updateRoomData.bind(this);\n this.userSelectedRoom = this.data?.room;\n\t\t\t\tthis.updateSchedulingEpochs();\n this.updateRoomData(this.userSelectedRoom);\n\t\t\t\t// Determine available time until next booking start time\n // this.determineNextBookingStartTime();\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n //update up start and end epoch times for a booking button options\n // this.updateSchedulingEpochs();\n this.data.parentComponent.isOverlayOpened = true;\n }\n\n /**\n * This function sets up start and end epoch times for a booking scheduling system.\n * It calculates and assigns various epoch times based on the current time,\n * available until time, and user-selected room's timezone.\n */\n public updateSchedulingEpochs() {\n\n\t\t\tconst now: any = DateTime.now();\n\n\t\t\t// Calculate the time difference in minutes between current and available until time\n\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t// this.diff = Math.abs(Math.round((this.availableUntil - now.ts) / 60000)); // recheck\n\t\t\tthis.diff = timeUntilNextBooking;\n\n\t\t\t// Determine system availability based on time difference\n\t\t\tthis.isAvailable = timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 // this.diff >= 15;\n\n\t\t\t// Calculate the next time slot for scheduling\n\t\t\tconst addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\t\t\tconst adjustedTime = now.plus({ minutes: addMin, seconds: 0 }).setZone(this.userSelectedRoom?.building?.timezone);\n\n\t\t\t// Calculate and assign the start and end epoch times with 15 and 30-minute intervals\n\t\t\tconst timeSlot = closestToTimeSlot(adjustedTime, WAITING_TIME);\n\t\t\tthis.start_epoch = timeSlot.toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_15 = timeSlot.plus({ minutes: 15 }).toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_30 = timeSlot.plus({ minutes: 30 }).toLocaleString(DateTime.TIME_SIMPLE);\n }\n\n ngAfterViewInit() {\n this.setupTimer();\n }\n\n public setupTimer() {\n console.log(DateTime.now().get('second'))\n const addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n }\n\n\n // countdown timer for coachmark\n public startTimer(display = 0, addSeconds = 0) {\n\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n // const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n // let timer = availableTimeToBook; //(this.diff -35) * 60;\n // let minutes;\n // let seconds;\n let timer = 0 ;\n if(timer >= 0){\n this.intervalCall_1 = interval(1000).subscribe(x => {\n\n const currentTime = new Date(DateTime.now().valueOf());\n const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n let timer = availableTimeToBook; //(this.diff -35) * 60;\n\n this.isTimerActive = true;\n this.minutesRemaining = Math.floor(timer / 60);\n this.secondsRemaining = Math.floor(timer % 60);\n\n this.minutesRemaining = this.minutesRemaining < 10 ? \"0\" + this.minutesRemaining : this.minutesRemaining;\n this.secondsRemaining = this.secondsRemaining < 10 ? \"0\" + this.secondsRemaining : this.secondsRemaining;\n\n --timer;\n\n if (timer <= 0) {\n timer = 0\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n this.isTimerActive = false;\n !this.timerIndex && this.setup15MinTimer();\n\n\t\t\t\t\t\t\t\t\t\tthis.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t\t\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addSeconds = 60 - DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second');\n\t\t\t\t\t\t\t\t\t\t\t\t\tform['date'] = closestToTimeSlot(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).plus({ minutes: addMin, seconds:0 }), WAITING_TIME).valueOf(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tform.dateTz = closestToTimeSlotTz(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew DateTZ({ date: DateTime.now().plus({ minutes: addMin, seconds:0 }), is_local_tz: false, building_tz: form.timezone }),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWAITING_TIME\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n\n\t\t\t\t\t\t\t\t\t\t\t});\n\n }\n }) //, 1000, endTime)\n }\n }\n\n\t\t/**\n\t\t * This function updates information related to the lates booking in the selected room\n\t\t */\n public determineNextBookingStartTime() {\n\n\t\t\t\t// Get the current time using DateTime library\n const now = DateTime.now();\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n const addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// Adjust the current time by adding the calculated minutes adna setting the timezone based on the selected room's building\n const addjustedTime: any = closestToTimeSlot(\n now.plus({ minutes: addMin, seconds:0 })\n .setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME\n );\n\n\t\t\t\t\t\t// Check if room is selected and has bookings settings\n if (this.userSelectedRoom?.space) {\n\t\t\t\t\t// Returive the list of future bookings or initializem it as an empaty array\n const futureBookings = this.userSelectedRoom?.space?.settings?.bookings || [];\n\n\t\t\t\t\t\t// Calculate the end time for a 30-minute interval from the addjested time\n const endEpoch30 = addjustedTime.plus({ minutes: 30 }).ts;\n\n\t\t\t\t\t\t// Filter future booking that start after end_epoch_30\n\t\t\t\t\t\tconst futureBookingsForTheDay = futureBookings.filter(item => item.start_epoch * 1000 >= endEpoch30);\n\n\t\t\t\t\t\t// Check if there are futute bookings found\n\t\t\t\t\t\tif(futureBookingsForTheDay.length > 0) {\n\t\t\t\t\t\t\t//Extract the start time of latest booking\n\t\t\t\t\t\t\tconst latestBookingStartTime = new Date(futureBookingsForTheDay[0].start_epoch * 1000);\n\n\t\t\t\t\t\t\t// Calculate the time difference between the latest booking start time and the current time in milliseconds\n\t\t\t\t\t\t\tconst timeDiffMs = latestBookingStartTime.getTime() - now.valueOf();\n\t\t\t\t\t\t\tthis.diffInMs = timeDiffMs;\n\t\t\t\t\t\t\t// Calculate the timne differenc in hours and minutes\n\t\t\t\t\t\t\tthis.diffInHours = Math.floor(timeDiffMs / (1000 * 60 * 60));\n \tthis.diffInMinutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));\n\n\t\t\t\t\t\t\t// Set flag to indicate the wether the difference is NaN (no future booking)\n \tthis.untilNextBookingFlag = !isNaN(timeDiffMs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.untilNextBookingFlag = false;\n\t\t\t\t\t\t}\n }\n\n }\n\n //fetch all the bookings for selected room for the day to the store\n public fetchRoomWithBookings(allWeek: boolean = true) {\n const day = 24 * 60;\n const week = day * 7;\n const date = (this.booking?.startDateTz).clone();\n const startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = date.startOfValue('week');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.data?.id,\n capacity: this.booking?.space?.capacity,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public closeModal() {\n const modal = this.elementRef.nativeElement.querySelector('.map-overlay-container');\n modal.classList.add('hide');\n this.data.parentComponent.isOverlayOpened = false;\n this.timerIndex = 0;\n this.isAvailable = false;\n\t\t\t\tthis.untilNextBookingFlag = false;\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n // this.intervalCall_15?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.userSelectedRoom) {\n this.data.parentComponent.roomSelected(this.userSelectedRoom);\n }\n }\n\n public onBook(minutes: number) {\n minutes = Math.round(minutes);\n const {filters, settings} = this.userSelectedRoom.space;\n if ( (filters && filters?.equipment_code ) || (settings && settings?.equipment_code) ) {\n this.roomDataCallback();\n } else {\n this.saveChanges(minutes);\n }\n }\n\n public bookingFormToBooking(minutes): Booking {\n const booking_form_data = this.bookingData.value;\n const has_note_buffer =\n booking_form_data?.notes && booking_form_data.notes?.length\n ? { [booking_form_data.selectedRoom.space.email]: 900 }\n : {}; // 900 seconds = 15 min\n const attendees = this.booking.attendees;\n const company = this.booking.company;\n const start_epoch = closestToTimeSlot(DateTime.now(), 15).valueOf() / 1000;\n const end_epoch =\n closestToTimeSlot(DateTime.now(), 15).plus({ minutes: minutes }).valueOf() / 1000;\n\n const raw_data = {\n space: { id: this.selectedRoomId },\n all_day: false,\n attendees,\n // booking_type: booking_form_data?.bookingType.value,\n booking_type: this.userSelectedRoom.space.filters.external === true? \"External\" : \"Internal\",\n catering: [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data?.timezone,\n equipment_codes: {\n [booking_form_data?.selectedRoom.space.email]: booking_form_data?.code,\n },\n expected_attendees: {\n [this.data.email]: 1,\n },\n has_catering: false,\n needs_space: false,\n notes: this.booking.notes,\n organiser: this.currentUser,\n creator: this.currentUser,\n room: this.userSelectedRoom.space,\n title: 'Ad hoc meeting',\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n };\n console.log(new Booking(raw_data));\n return new Booking(raw_data);\n }\n\n //function for sending final booking request\n public saveChanges(minutes) {\n this.loading = true;\n this.booking = this.bookingFormToBooking(minutes);\n // const booking_form_data = this.bookingData.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(this._spaces, this.booking).then(\n (bookable: boolean) => {\n if (!bookable) {\n // TODO - Refactor for https://acaprojects.atlassian.net/browse/MCK-1498\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n this._booking_state_service.replace(bkn);\n\n // When saved, the returned booking has a null room.\n // Correct this so the rest of the code doesn't flake out.\n this.booking = new Booking({ ...bkn.toJSON(), room: this.booking.room });\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n // Heap track event\n this._service.analytics.track('create', {\n booking_id: bkn.id,\n office: this.booking.room.building.name,\n room: this.booking.local_room_name,\n start_time: bkn.startDateTz.ms,\n end_time: bkn.endDateTz.ms,\n catering: !!bkn.catering.length,\n headcount: 1,\n });\n this.data.parentComponent.confirmBooking(this.booking);\n },\n (err) => {\n this.loading = false;\n this.confirmed = false;\n if (err.status === 409) {\n // Unavailable Confirmation\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n } else {\n console.log(err);\n }\n }\n );\n },\n (err) => {\n // Unavailable Confirmation\n this.loading = false;\n this.timeout(\n 'error',\n () => {\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n },\n 500\n );\n }\n );\n }\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nexport const WAITING_TIME = 15;\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 1\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room\n }\n});\n\n// service account for office floor map view - read only\nexport const SERVICE_ACCOUNT = 'svc_kiosk_converge@mckinsey.onmicrosoft.com';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OfficeFloorComponent } from './office-floor/office-floor.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapModule } from 'src/app/map/map.module';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n MapModule,\n];\n\nexport const mapModuleDeclarations = [\n OfficeFloorComponent,\n FloorMapOverlayComponent,\n // MapControlsComponent,\n // MapFiltersComponent,\n // OfficeInformationModalComponent,\n // MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations,\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class OfficeFloorMapModule {\n}\n","import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, closestToTimeSlot, closestToTimeSlotTz, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults,\n User,\n selectMapFilteredResults,\n ApplicationService,\n clearRoomFilters,\n\t\tbookingTypeOptions,\n defaultRoomSizeOption,\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\n\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n SERVICE_ACCOUNT,\n WAITING_TIME,\n} from '../floor-map.utils';\nimport {\n loadDiffSizeResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router, RouterStateSnapshot } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-office-floor',\n templateUrl: './office-floor.component.html',\n styleUrls: ['./office-floor.component.scss'],\n})\nexport class OfficeFloorComponent extends BaseDirective implements OnInit, OnChanges {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n\n public roomStatus: any;\n public payload: any;\n /** Current User */\n public currentUser: User;\n public bookingConfirmed = false;\n public bookingData: {};\n serviceAccount: boolean;\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private route: ActivatedRoute,\n public _service: ApplicationService,\n private location: Location\n ) {\n super();\n this.payload = location.getState();\n this.payload.floorMap = false;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n throw new Error('Method not implemented.');\n }\n\n public ngOnInit(): void {\n //clear filters first if any applied previously \n this.store.dispatch(clearRoomFilters());\n\n const selection = { value: this.payload?.payload, display: '' };\n this.payload.building.value = this.payload.building[0].id;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n this.serviceAccount = this.currentUser.email === SERVICE_ACCOUNT\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n next.duration = 30;\n this.bookingFormData.next(next); /// <---- timezone setting can be done here\n }\n })\n );\n\n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n this.roomStatus = filteredSpaces;\n\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) =>\n !!s.map_id &&\n s.zones.includes(building.id) &&\n s.zones.includes(this.payload?.payload)\n );\n\n this.resultSpaces.next(cloneDeep(spacesFromSelection));\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n () => {\n if(!this.serviceAccount) {\n this.activeSpace.next(space);\n this.focusOnRoom();\n }\n \n }\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n this.isOverlayOpened && this.focusOnRoom();\n })\n );\n\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'setActiveSpace',\n this.resultSpaces\n .subscribe((next) => {\n // console.log(this.focusedRoom?.value?.space?.id);\n const space = next.find((s) => s.id === this.focusedRoom?.value?.space?.id)\n space && this.activeSpace.next(space);\n })\n );\n\n\n \n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(this.payload.building);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n \n form['date'] = closestToTimeSlot(DateTime.now().plus({ minutes: 1 }), WAITING_TIME).valueOf(),\n form.dateTz = closestToTimeSlotTz(\n new DateTZ({ date: DateTime.now().plus({ minutes: 1 }), is_local_tz: false, building_tz: form.timezone }),\n WAITING_TIME\n )\n this.store.dispatch(storeBookingFormData({ payload: form }));\n this.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n })\n );\n\n this.selectActiveBuilding(this.payload.building);\n this.selectBuildingLevel(selection);\n\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeLevel.next(next);\n });\n }\n\n public selectActiveSpace(selection?: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === this.focusedRoom?.value.space.id)),\n // take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom() {\n // this.selectedSpace = space;\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n // this.focusedRoom.next(null);\n \n this.focusedRoom.next(cloneDeep(focusedRoom[0]));\n this.isOverlayOpened && this.childCallback( cloneDeep(focusedRoom[0]) );\n\n\t\t\t\t\tconst { filters, settings } = this.focusedRoom?.value?.space; // use of new data structure fields\n if ( this.roomStatus.statusMap[this.focusedRoom.value.space.id] === 'requestable' || (filters?.equipment_code || settings?.equipment_code) ) {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.bookingFormData.value,\n selectedRoom: this.focusedRoom.value,\n },\n })\n );\n this.roomSelected(this.focusedRoom.value);\n }\n !this.isOverlayOpened && this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this));\n this.zoom.next(6);\n },\n delay\n );\n });\n }\n\n public isOverlayOpened = false;\n public childCallback;\n\n public exitFullscreen(route: string): void {\n this.store.dispatch(clearRoomFilters());\n\n this.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\tform.bookingType = bookingTypeOptions[0],\n form.roomSize = defaultRoomSizeOption,\n\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\t\t\t\t\t});\n\n const navigationExtras = {\n state: { payload: this.activeLevel.value },\n relativeTo: this.route,\n queryParams: {\n display: 'map',\n },\n };\n this._service.kioskFormFilter = true;\n this.router.navigate([route], navigationExtras);\n }\n\n // public triggerRefresh(){\n // this.subscription(\n // 'activeForm',\n // this.store\n // .pipe(select(selectActiveForm), distinctUntilChanged())\n // .subscribe((next: BookingFormData | undefined) => {\n // if (next) {\n // next.duration = 35;\n // this.bookingFormData.next(next);\n // }\n // })\n // );\n\n // this.subscription(\n // 'bookingSpaceResults',\n // combineLatest([\n // this.store.pipe(\n // select(selectMapFilteredResults),\n // map((r: LoadingModel) => r.success)\n // ),\n // this.activeBuilding.pipe(filterUndefined()),\n // this.activeLevel.pipe(filterUndefined()),\n // ]).subscribe(([filteredSpaces, building, level]) => {\n // this.roomStatus = filteredSpaces;\n\n // const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n // (s) =>\n // !!s.map_id &&\n // s.zones.includes(building.id) &&\n // s.zones.includes(this.payload?.payload)\n // );\n\n // this.resultSpaces.next(spacesFromSelection);\n\n // const listeners: MapListener[] = [];\n // const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach((space) => {\n // const status = filteredSpaces.statusMap[space.id];\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // listeners.push(\n // ...generateMapListenersForSpace(\n // space,\n // () => {},\n // () => {},\n // () => {\n // this.activeSpace.next(space);\n // this.focusOnRoom();\n // }\n // )\n // );\n // });\n // this.style_map.next(styles);\n // this.listeners.next(listeners);\n // })\n // );\n\n // this.subscription(\n // 'bookingResults',\n // this.resultSpaces\n // .pipe(withLatestFrom(this.activeSpace))\n // .subscribe(([resultSpaces, activeSpace]) => {\n // this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n // })\n // );\n // }\n\n public roomSelected(room: RoomResultsViewModel) {\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n let organiser = { display: this.currentUser.name, value: this.currentUser.email };\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n organiser: organiser,\n title: 'Ad hoc meeting',\n // attendees: [this.currentUser],\n code: '',\n notes: '',\n head_count: 1,\n selectedRoom: room,\n },\n })\n );\n\n this.router.navigate(['../create'], { relativeTo: this.route });\n }\n\n public getDayOfWeek(date: string | number | Date) {\n const dayOfWeek = new Date(date).getDay();\n return isNaN(dayOfWeek)\n ? null\n : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][\n dayOfWeek\n ];\n }\n\n public confirmBooking = (bookingData: {}) => {\n this.bookingConfirmed = true;\n this.bookingData = bookingData;\n };\n}\n","
\n
\n
\n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
Booking Confirmed
\n
\n
\n \n
Confirmed
\n
\n
\n
Status: Confirmed
\n
Date: {{this.getDayOfWeek(this.bookingData?.date_string)}}, {{this.bookingData?.date_string}}
\n
Time: {{this.bookingData?.time_period}} GMT{{this.bookingData?.tz_offset}}
\n
{{this.bookingData?.booking_type}} meeting ({{this.bookingData?.duration}} minutes)
\n
Address: {{this.activeBuilding?.value.address}}, {{this.activeBuilding?.value.city}}
\n
Room: {{this.focusedRoom.value.title}}
\n
Room {{this.focusedRoom.value.capacity}}
\n
\n
\n
\n
\n
\n
\n
Host: {{this.currentUser?.name}}
\n
Attendees: {{this.currentUser?.name}}
\n
Charge Code: {{this.focusedRoom?.value.space.filters.charge_code === false ? \"No charge code\" : \"\"}}
\n
Headcount Estimate: {{this.bookingData?.attendees.length}}
\n
Additional Requirements: {{this.bookingData?.notes[0]}}
\n
\n
\n
\n
\n \n Close\n \n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n ActivatedRoute,\n ParamMap,\n Router\n} from '@angular/router';\nimport { deepDistinctUntilChanged } from '@mckinsey-converge/rx-utils';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-results-header',\n template: `\n
\n
\n

Results

\n Matching your search criteria {{resultsCount>=0 ? '('+resultsCount+')' : ''}} \n
\n \n \n
\n `,\n styleUrls: ['./results-header.component.scss']\n})\nexport class ResultsHeaderComponent extends BaseDirective implements OnInit {\n\n public toggleOptions: SelectOption[] = [\n {\n value: 0,\n display: 'List',\n meta: { \n mobile: true\n }\n },\n {\n value: 1,\n display: 'Map',\n meta: { \n mobile: true\n }\n },\n {\n value: 2,\n display: 'Calendar',\n meta: { \n route: 'booking-calendar',\n mobile: false\n }\n }\n ];\n\n public selectedToggle = new BehaviorSubject>(this.toggleOptions[0]);\n\n @Input()\n public resultsCount: number | undefined;\n\n @Output()\n public selectedToggleChange = new EventEmitter>();\n\n constructor(private router: Router,\n private route: ActivatedRoute) {\n super();\n }\n\n public ngOnInit(): void {\n this.selectedToggleChange.next(this.selectedToggle.value);\n\n this.subscription('paramsToUI', this.route.queryParamMap\n .pipe(deepDistinctUntilChanged())\n .subscribe((next: ParamMap) => {\n const retrievedOption = this.toggleOptions.find(o => o.display.toLowerCase() === next.get('display'));\n this.onSelectedChange(retrievedOption ?? this.toggleOptions[0]);\n }));\n }\n\n public onSelectedChange(option: SelectOption) {\n this.selectedToggle.next(option);\n this.selectedToggleChange.next(option);\n\n if(option.meta?.route) {\n this.router.navigate(['booking-calendar'], { relativeTo: this.route });\n }\n else {\n // toggle route.\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n display: option.display.toLowerCase()\n },\n queryParamsHandling: 'merge'\n });\n }\n \n\n }\n\n}\n","import {\n Component,\n Inject,\n OnInit,\n Output,\n EventEmitter,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport {\n Space,\n SpacesService,\n DEFAULT_BOOKING_DURATION,\n checkCollisions,\n Booking\n} from '@mckinsey-converge/data-common';\nimport { DateTZ, convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow } from '@mckinsey-converge/date-tz';\n\ninterface ModalData {\n dateTz: DateTZ,\n duration: number,\n pendingDateTz: DateTZ,\n pendingDuration: number,\n space?: Space,\n rules?: any,\n bookingId?: string,\n currentBooking?: Booking,\n}\n\n@Component({\n selector: 'app-room-availability-preview-modal',\n template: `\n
\n \n
\n \n
New Booking Date/Time
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n

\n Room is available for selected date/time.\n \n But the following items\n \n \n \" {{ item.name }} {{ i === category.items.length - 1 ? '' : ', ' }} \"\n \n \n are restricted due to catering unavailability. Please select another time or remove these items.\n \n\n

\n

Room is unavailable for selected date/time.

\n

Checking availability for selected date/time...

\n

\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n

\n
\n
\n
\n
\n

Old

\n

Date: {{dateString}}

\n

Time: {{timeString}}

\n

({{durationString}})

\n \n
\n
\n

New

\n

Date: {{pendingDateString}}

\n

Time: {{pendingTimeString}}

\n

({{pendingDurationString}})

\n
\n
\n
\n
\n \n 0\"\n primaryLabel=\"Confirm\" (primarySubmit)=\"confirm()\"\n secondaryLabel=\"Cancel\" (secondarySubmit)=\"closeModal()\"\n >\n \n
\n `,\n styleUrls: ['./room-availability-preview-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class RoomAvailabilityPreviewModalComponent implements OnInit {\n @Output() public submitForm = new EventEmitter();\n public dateString: string;\n public timeString: string;\n public durationString: string;\n public pendingDateString: string;\n public pendingTimeString: string;\n public pendingDurationString: string;\n public mapBookingRules: readonly string[];\n public mapBookingSubtitle: string;\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ(), 15);\n public available: boolean = null;\n public formGroup = new FormGroup({\n dateTz: new FormControl(this.fromDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required])\n });\n public localTimezone = \"\";\n public buildingTimezone = \"\";\n public localStart = \"\";\n public localEnd = \"\";\n\n // Declare the restrictedDueToCatering property\n public restrictedDueToCatering: any[] = [];\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: ModalData,\n private dialogRef: MatDialogRef,\n private _spaces: SpacesService,\n ) {}\n\n public get pending_date(){\n return this.data.pendingDateTz; // new DateTZ({ date: this.data.pendingDate.valueOf(), is_local_tz: false, building_tz: this.data?.space?.timezone })\n }\n\n public ngOnInit(): void {\n this.formGroup.setValue({\n dateTz: this.data.pendingDateTz,\n duration: this.data.pendingDuration,\n });\n this.updateDisplay();\n }\n\n // Method run when the confirming the modal.\n public applyChanges(changes: any): void {\n this.data.pendingDateTz = changes.pendingDateTz; // new Date(changes.pendingDate.valueOf());\n this.data.pendingDuration = changes.pendingDuration;\n this.updateDisplay();\n }\n\n public updateDisplay() {\n // this.data.dateTz is the existing time in building time\n // this.data.pendingDateTz is the new time in building time\n const dateTz = this.data.dateTz;\n this.dateString = dateBuildingFormatString(dateTz);\n this.timeString = startEndTimeWithZoneFormatString(dateTz, dateTz.addValue({ minutes: this.data.duration }));\n this.durationString = humaniseDuration(this.data.duration);\n\n const pendingDateTz = this.data.pendingDateTz;\n this.pendingDateString = dateBuildingFormatString(pendingDateTz);\n this.pendingTimeString = startEndTimeWithZoneFormatString(pendingDateTz, pendingDateTz.addValue({ minutes: this.data.pendingDuration }));\n this.pendingDurationString = humaniseDuration(this.data.pendingDuration);\n this.fromDateTz = closestToTimeSlotTz(pendingDateTz, 15); // building value\n\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n this.updateCoachmarkTimes(this.data?.space?.timezone);\n\n // Check if any restricted catering category included \n \n\n this.restrictedDueToCatering = this.data.currentBooking?.catering.filter(order => order.items.filter(category => category.within_category_restricted_time(this.data.pendingDateTz)).length )\n\n\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: this.data.pendingDateTz.seconds,\n end_epoch: this.data.pendingDateTz.addValue({ minutes: this.data.pendingDuration }).seconds,\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n }).catch(() => {\n this.available = false;\n });\n }\n\n public closeModal() {\n this.dialogRef.close(null);\n }\n\n public updateDatePickerValue(dateTz: DateTZ) {\n const pending_date: DateTZ = this.formGroup.value.dateTz\n const day = pending_date.setValue({ \n day: dateTz.dateDay,\n month: dateTz.dateMonth,\n year: dateTz.dateYear\n });\n this.setValue(day, this.formGroup.controls.dateTz);\n }\n\n public setValue($value, formControl: AbstractControl) {\n // valid options are in building time\n formControl.setValue($value); // bulding time\n this.submitForm.emit(this.formGroup.value);\n }\n\n public confirm() {\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n const buildingDate = convertLocalTimestampToTimezonedDateTz(this.data.pendingDateTz.ms, this.data?.currentBooking?.timezone);\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: buildingDate.seconds,\n end_epoch: buildingDate.addValue({ minutes: this.data.pendingDuration }),\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n this.dialogRef.close({\n ...this.formGroup.value,\n }); \n }).catch(() => {\n this.available = false;\n });\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (timezone) {\n this.buildingTimezone = timezone;\n const localizedStartDate = this.formGroup.value.dateTz;\n const localizedEndDate = localizedStartDate.addValue({ minutes: this.formGroup.value.duration });\n this.localStart = localizedStartDate.formatLocalDate(\"h:mma\");\n this.localEnd = localizedEndDate.formatLocalDate(\"h:mma\");\n } else {\n this.buildingTimezone = this.localTimezone.slice(0);\n this.localStart = \"\";\n this.localEnd = \"\";\n } \n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n Input,\n OnInit,\n OnChanges,\n ElementRef,\n ViewChild,\n EventEmitter,\n Output,\n SimpleChanges,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { fromEvent, Subject, BehaviorSubject, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { CalendarEvent, CalendarEventTimesChangedEvent } from 'angular-calendar';\nimport { BaseClass, durationHumanized, isLessThanBreakpoint } from '@mckinsey-converge/base';\nimport {\n Booking,\n Building,\n BuildingLevel,\n Space,\n User,\n rulesForSpace,\n SpaceRules,\n} from '@mckinsey-converge/data-common';\nimport { generateFeedbackUrl, Urls } from '../../utilities/urls';\nimport { TopBarHeaderMode } from '../room-location-preview/room-location-preview.component';\nimport { RoomAvailabilityPreviewModalComponent } from '../room-availability-preview-modal/room-availability-preview-modal.component';\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n convertTimezonedTimestampToLocalDateTz,\n timezoneOffset,\n} from '@mckinsey-converge/date-tz';\nimport { utcToZonedTime } from 'date-fns-tz';\nimport { FormControl } from '@angular/forms';\nimport { DateTime } from 'luxon';\n\nconst WEEKEND_DAYS = [6, 7];\nconst colors = {\n grey: {\n secondary: '#D2D2D2',\n primary: '#A19F9F',\n },\n blue: {\n secondary: '#C0DBF5',\n primary: '#00A9F4',\n },\n red: {\n secondary: '#EB5757',\n primary: '#EB5757',\n },\n};\n\ninterface CalendarClickEvent {\n date: Date;\n}\n\nexport interface BookingBumper {\n top?: string;\n bottom?: string;\n height: string;\n backgroundColor: string;\n}\nexport interface BookingBumpers {\n top: BookingBumper;\n bottom: BookingBumper;\n}\n\nexport type BookingPlus = Booking & { start: number; end: number }; // R--- why again?\nexport type CalendarEventPlus = CalendarEvent & { bumper?: BookingBumpers; booking?: Booking };\n\n@Component({\n selector: 'room-availability-preview',\n templateUrl: './room-availability-preview.component.html',\n styleUrls: ['./room-availability-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RoomAvailabilityPreviewComponent extends BaseClass implements OnInit, OnChanges {\n @ViewChild('scrollContainer') scrollContainer: ElementRef;\n\n @Input() public alternativeWeekStartDateTz: DateTZ;\n // Used when editing a booking\n @Input() public bookingId?: string;\n @Input() public bookings: BookingPlus[];\n /** retain as mutable */\n @Input() public building: Building;\n // R--- could probably use the currentBooking ID edit,\n // The bookingId was an after thought\n @Input() public currentBooking: Booking;\n @Input() public currentUser: User;\n @Input() public dateTz: DateTZ;\n @Input() public duration: number;\n @Input() public expanded: boolean;\n @Input() public level: BuildingLevel;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n @Input() public space: Space;\n // @Input() public timezone: string;\n\n @Output() public confirmChanges: EventEmitter = new EventEmitter();\n @Output() public handleExpand: EventEmitter = new EventEmitter();\n @Output() public updateCalendarWeekView: EventEmitter = new EventEmitter();\n @Output() public warnIfItHasConflict: EventEmitter = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n constructor(public dialog: MatDialog) {\n super();\n }\n\n public breakpoint = 768;\n public mobile = false;\n public showDatePicker = false;\n public events: CalendarEventPlus[] = [];\n public dayStartHour: number;\n public dayEndHour: number;\n public viewDateTz: DateTZ;\n public weekViewDateTz: DateTZ;\n public weekViewRangeText: string;\n public showWeekend: boolean = false;\n public currentPage: string;\n public calendarPopupValue = new BehaviorSubject(DateNow(new Date()));\n public pendingChange: boolean = false;\n public pendingDateTz: DateTZ;\n public pendingDuration: number;\n public eventSnapSize: number = 15;\n public dayRefresh: Subject = new Subject();\n public weekRefresh: Subject = new Subject();\n public addMarginOnConflict: boolean = false; // helps to add html class to adjust margin top in case of QR code scan conflict\n public event: CalendarEventPlus = {\n start: new Date(),\n end: new Date(),\n title: '',\n color: colors.blue,\n cssClass: 'selected',\n actions: null,\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n };\n\n public get timezone(): string {\n return this.dateTz.building_tz;\n }\n\n public get one_day_in_millis() {\n return 86400000;\n }\n\n public get thirty_minutes_in_millis() {\n return 1800000;\n }\n public rules: SpaceRules;\n public modal_data: any = {};\n public scrollFired: boolean = false;\n\n // Values to display a span on the date picker, but the date picker doesn't support this.\n public date_span = {\n start: 0,\n end: 0,\n };\n\n // I can't think of any reason the calendar widget needs to go back further than 2 years, if even that.\n public fromDateTz = DateNow(new Date()).subtractValue({ years: 2 });\n\n public dateControl = new FormControl(new Date().valueOf());\n\n public isEventDate(d: CalendarClickEvent) {\n const date = new DateTZ({ date: d.date.valueOf() }); // local time I think.. problem TODO\n return this.pendingDateTz.isSameDate(date, 'day');\n }\n\n public get inputDate(): Observable {\n return this.calendarPopupValue.pipe(map((d) => d));\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public ngOnInit(): void {\n // R--- retrun to document\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.pendingDateTz = this.dateTz.clone();\n const date = this.dateTz.clone();\n const currentBookingStartDate = this.currentBooking\n ? this.currentBooking.startDateTz.addValue({ seconds: 0 })\n : date;\n this.alternativeWeekStartDateTz = date.startOfValue('week').startOfValue('day');\n\n // Not sure if this is correct\n this.weekViewDateTz = this.alternativeWeekStartDateTz.clone();\n\n this.calendarCenter();\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.pendingDateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 });\n this.setCalendarValue(this.pendingDateTz);\n this.showWeekend =\n WEEKEND_DAYS.includes(currentBookingStartDate.dateWeekday) ||\n WEEKEND_DAYS.includes(date.dateWeekday);\n this.setupEventName();\n this.transformBookings();\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < this.breakpoint;\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n },\n })\n )\n .subscribe();\n\n this.rules = rulesForSpace({\n time: this.dateTz.ms,\n duration: this.duration,\n user: this.currentUser,\n rules: this.building?.booking_rules,\n space: this.space,\n });\n\n // Update the display when the screen resizes.\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.calendarCenter();\n this.setDislayValues();\n },\n })\n )\n .subscribe();\n this.dateControl.setValue(this.dateTz);\n this.transformBookings();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.expanded) {\n // set if the event is editable\n this.event.draggable = this.expanded;\n this.event.resizable = {\n beforeStart: this.expanded,\n afterEnd: this.expanded,\n };\n const date = this.dateTz;\n this.setCalendarValue(date);\n }\n\n if (this.dayStartHour) this.scrollTo();\n\n if (!this.pendingDateTz) return;\n\n if (changes.bookings || changes.expanded) {\n this.transformBookings();\n }\n if (changes.alternativeWeekStartDateTz) {\n this.setDislayValues();\n }\n if (changes.expanded) {\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n }\n\n public setDislayValues() {\n const tz_offset = timezoneOffset(this.alternativeWeekStartDateTz.building_tz).hours\n const week_start_date = this.alternativeWeekStartDateTz.subtractValue({hours: tz_offset}).clone(); // Operation needed to trick the mwl-calendar-week-view to display the correct day if the day changes between timezones \n this.weekViewDateTz = this.weekViewDateTz || this.alternativeWeekStartDateTz.clone();\n let week_view_date = this.weekViewDateTz.startOfValue('week'); // new DateTZ({date: this.weekViewDate?.valueOf()}).startOfValue('week')\n if (!this.showWeekend) {\n // Advance from Sunday to Monday\n week_view_date = week_view_date.addValue({ days: 1 });\n }\n\n if (this.mobile) {\n this.weekViewDateTz = week_start_date\n this.weekViewRangeText = `${this.weekViewDateTz.formatDate('d MMMM')}`;\n this.calendarPopupValue.next(this.weekViewDateTz);\n } else {\n this.weekViewDateTz = week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }); // new Date(week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }).ms);\n this.weekViewRangeText = `${week_view_date.formatDate('d MMMM')} - ${week_view_date\n .addValue({ days: this.showWeekend ? 6 : 4 })\n .formatDate('d MMMM yyyy')}`;\n this.calendarPopupValue.next(week_view_date);\n }\n }\n\n public getBumpers(booking: Booking, selected: boolean = false) {\n const email = booking.space.email || this.space.email;\n const setup = booking.setup[email] ? booking.setup[email] / 60 : 0;\n const breakdown = booking.breakdown[email] ? booking.breakdown[email] / 60 : 0;\n\n return {\n top: {\n top: `-${setup - 1}px`,\n height: `${setup}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n bottom: {\n bottom: `-${breakdown - 1}px`,\n height: `${breakdown}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n };\n }\n\n public setupEventName() {\n this.setDislayValues();\n const pending_date = this.pendingDateTz.clone();\n const start_date = pending_date.setValue({ second: 0, millisecond: 0 });\n this.event.start = start_date.JSDate;\n this.event.end = start_date.addValue({ minutes: this.pendingDuration }).JSDate;\n const startHour = parseInt(pending_date.formatDate('H'), 10);\n\n if (startHour === 0) {\n this.dayStartHour = startHour;\n } else if (startHour < 6) {\n const offset = startHour > 3 ? startHour - 2 : startHour;\n this.dayStartHour = startHour - offset;\n } else {\n // The min of 18 is needed so start times after 6pm\n // don't push the calendar view beyond midnight.\n const offset = Math.min(18, startHour - 3);\n this.dayStartHour = offset;\n }\n\n if (!this.scrollFired && this.dayStartHour) {\n this.scrollTo();\n }\n\n this.dayEndHour = Math.max(24, this.dayStartHour + 6);\n this.event.title = `${pending_date\n .formatDate('h:mma')\n .toLocaleLowerCase()} (${durationHumanized(this.pendingDuration, true)})`;\n this.event.cssClass = `selected ${this.showWeekend ? 'show-weekend' : ''} ${\n this.mobile && this.expanded ? 'mobile' : ''\n } `;\n\n if (this.currentBooking) {\n this.event.bumper = this.getBumpers(this.currentBooking);\n this.event.booking = this.currentBooking;\n }\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n\n public transformBookings() {\n this.calendarSpan();\n const events = [];\n if (Array.isArray(this.bookings)) {\n this.bookings.forEach((raw_booking) => {\n const booking = new Booking(raw_booking);\n const { mode, duration } = this.displayClass(\n booking.startDateTz.ms,\n booking.endDateTz.ms\n );\n\n // back off a ms when end of day to avoid all day wrapping to next day.\n let end = booking.endDateTz;\n const endTime = booking.endDateTz;\n if (endTime.minutes === 0 && endTime.seconds === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n end = booking.endDateTz.subtractValue({ seconds: 1 });\n }\n\n // When editing skip over the current booking\n if (booking.id === this.bookingId) return;\n\n const utcStart = booking.startDateTz; // building time\n const utcEnd = end; // building time\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n const adjustedStartDate = utcToZonedTime(utcStart.ms, booking.timezone); // return local time\n const adjustedEndDate = utcToZonedTime(utcEnd.ms, booking.timezone); // return local time\n\n events.push({\n start: adjustedStartDate,\n end: adjustedEndDate,\n title: `Booked by ${booking.booker['name']}`,\n color: colors.grey,\n actions: null,\n cssClass: `booked ${this.mobile && 'mobile'} ${\n this.showWeekend ? 'show-weekend' : ''\n } ${mode}`,\n bumper: this.getBumpers(booking),\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n booking,\n });\n });\n }\n\n const { mode, duration } = this.displayClass(\n this.event.start.getTime(),\n this.event.end.getTime()\n );\n const event = Object.assign({}, this.event);\n const endTime = new DateTZ({ date: this.event.start.valueOf() }).addValue({\n minutes: this.pendingDuration,\n }); // building time\n if (endTime.minutes === 0 && endTime.second === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n event.end = endTime.subtractValue({ milliseconds: 1 }).JSDate; // building time\n }\n\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n // will need to adjust the other way with drag and drop and click actions.\n event.start = utcToZonedTime(event.start, this.timezone); // local time\n event.end = utcToZonedTime(event.end, this.timezone); // local time\n\n event.cssClass = `selected ${this.mobile && this.expanded ? 'mobile' : ''} ${mode}`;\n if (this.currentBooking) {\n event.bumper = this.getBumpers(this.currentBooking, true);\n event.booking = this.currentBooking;\n }\n\n events.push(event);\n this.events = events.slice();\n this.updateTileColor();\n }\n\n public updateTileColor() {\n const pending_date = this.pendingDateTz.clone();\n const start = pending_date.setValue({ second: 0, millisecond: 0 });\n const end = start.addValue({ minutes: this.pendingDuration });\n const booked = this.events.filter((e) => !e.draggable); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n const isEvents = this.events.filter((e) => e.draggable);\n if(isEvents.length ) {\n isEvents[0].color = conflict ? colors.red : colors.blue;\n this.addMarginOnConflict = conflict ? true : false;\n \n } \n !this.expanded && this.warnIfItHasConflict.emit({room: this.space, hasConflict: conflict});\n }\n public displayClass(start: number, end: number) {\n const duration = end - start;\n return {\n duration,\n mode: duration > this.thirty_minutes_in_millis ? 'extended' : 'minimal',\n };\n }\n\n public setCalendarValue(dateTz: DateTZ) {\n let toDate = DateNow().startOfValue('minute');\n if (dateTz) {\n toDate = dateTz.startOfValue('minute');\n }\n if (!this.mobile && toDate.dateWeekday !== 7) {\n toDate = toDate.startOfValue('week');\n }\n this.updateCalendarWeekView.emit(toDate);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = toDate;\n this.setDislayValues();\n }\n\n /**\n * Convert the true bulding based time object to a timestamp skewed to the local time\n *\n * @param buildingTz - DateTZ object of time in bulding timezone\n * @returns number - timestamp in local time skewed from bulding time\n */\n public convertTimezonedValueForCalendar(buildingTz: DateTZ) {\n return convertTimezonedTimestampToLocalDateTz(buildingTz.ms, this.timezone).ms;\n }\n\n public hasConflict(startTz, endTz, booked) {\n // Convert the start and end building times to the local timezone for comparison with the localized bookings.\n const localizedStartTime = startTz.ms;\n const localizedEndTime = endTz.ms;\n let email = this.space?.email || this.currentBooking?.room?.email;\n return booked.some((b) => {\n email = email || b.booking?.room?.email;\n // Booking here are local time to render on the calendar correctly\n const setup = b.booking?.setup[email] || 0;\n // R--- This weird augmented booking with start and end needs to be with DateTZ and a getter when ms is needed.\n const bookingStartTime = new DateTZ({ date: b.start.valueOf() }); // local times\n const bookingEndTime = new DateTZ({ date: b.end.valueOf() }); // local times\n const bstart = bookingStartTime.subtractValue({ seconds: setup }).ms;\n const breakdown = b.booking?.breakdown[email] || 0;\n const bend = bookingEndTime.addValue({ seconds: breakdown }).ms;\n\n if (\n (localizedStartTime >= bstart && localizedStartTime < bend) || // booking starts durring a meeting\n (localizedStartTime <= bstart && localizedEndTime > bstart) || // booking ends durring meeting\n (localizedStartTime >= bstart && localizedEndTime <= bend) || // booking starts and ends durring a meeting\n (localizedStartTime <= bstart && localizedEndTime >= bend) // booking overlaps entire meeting\n ) {\n return b.booking?.id !== this.currentBooking?.id;\n }\n return false;\n });\n }\n\n public eventTimesChanged({ event, newStart, newEnd }: CalendarEventTimesChangedEvent): void {\n const s = convertLocalTimestampToTimezonedDateTz(\n newStart.valueOf(),\n this.timezone\n );\n if (s.ms < Date.now()) return;\n // newStart and newEnd are local times from the calendar component\n // merging in with localized bookings in this.events\n this.events = this.events.map((iEvent) => {\n if (event.id && iEvent.id === event.id) {\n return {\n ...event,\n start: newStart,\n end: newEnd,\n };\n }\n return iEvent;\n }); // local times\n\n let buildingStartDateTz = new DateTZ(\n { date: newStart.valueOf()}\n );\n let buildingEndDateTz = new DateTZ(\n { date: Math.ceil(newEnd.valueOf()/900000)*900000 } //For latest bug in CNG-309, make sure end time follows a 15-min interval\n );\n\n // Clear out the seconds and miliseconds to avoid collision by seconds.\n buildingStartDateTz.setValue({ millisecond: 0, second: 0 });\n\n if (buildingStartDateTz < DateNow(new Date())) {\n // compare building time to now\n // Abandon updates if the past\n this.transformBookings();\n return;\n }\n\n let pendingDuration = Math.floor(\n (buildingEndDateTz.ms - buildingStartDateTz.ms) / 60 / 1000\n );\n // Make adjustments to the time and duration so the snap to behavior aligns\n // with the Mckinsey time and duration rules.\n const new_start = buildingStartDateTz.clone(); //new DateTZ({date: buildingNewStart.getTime()}); // building time\n if (pendingDuration >= 60) {\n // check that duration is inc of 1/2 hr\n const d = pendingDuration % 30;\n // if (d) {\n // pendingDuration = Math.floor(pendingDuration + (30 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // check that the start time is 1/2 hr\n const m = parseInt(new_start.formatDate('m'), 10);\n const md = m % 30;\n // if (md) {\n // buildingStartDateTz = new_start.addValue({ minutes: md }); // building time\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // Update snap to rules\n // this.eventSnapSize = 30; //done for CNG-309\n } else {\n // check that duration is inc of 1/4 hr\n const d = pendingDuration % 15;\n if (d) {\n // pendingDuration = Math.floor(pendingDuration + (15 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n }\n this.eventSnapSize = 15;\n }\n\n // Drag and Drop / Resize duration\n const dnd_duration = buildingEndDateTz.ms - buildingStartDateTz.ms;\n if (dnd_duration >= this.one_day_in_millis - 1) {\n // Add that millisecond back in so the angular calender drag and drop snapping still works.\n buildingEndDateTz = buildingEndDateTz.addValue({ milliseconds: 1 });\n }\n\n if (this.rules?.max_length) {\n if (dnd_duration / 60000 > this.rules?.max_length) {\n // Abandon updates if exceeeds max duration\n this.transformBookings();\n return;\n }\n }\n\n // Setup values for conflict checking, add on the setup and breakdown times form comparison\n let conflictCheckStartTime = buildingStartDateTz.clone();\n let conflictCheckEndTime = buildingEndDateTz.clone();\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n const start = buildingStartDateTz.clone();\n conflictCheckStartTime = start.subtractValue({ seconds: setup });\n }\n const breakdown = this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n const end = buildingEndDateTz.subtractValue({ seconds: 1 });\n conflictCheckEndTime = end.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const start = conflictCheckStartTime;\n const end = conflictCheckEndTime;\n const booked = this.events.filter((e) => e.draggable === false); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n this.dateControl.setValue(start);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n // check if the time or duration has changed\n if (this.pendingDateTz !== buildingStartDateTz) {\n this.pendingChange = true;\n } else if (this.pendingDuration !== pendingDuration) {\n this.pendingChange = true;\n }\n\n // set the new Pending Date\n this.pendingDateTz = convertLocalTimestampToTimezonedDateTz(buildingStartDateTz.ms, this.timezone); // building time\n this.pendingDuration = pendingDuration;\n\n this.setupEventName();\n this.transformBookings();\n }\n\n public hourClicked(event: CalendarClickEvent) {\n // convert the calender local input to the building times\n const buildingStartDate = convertLocalTimestampToTimezonedDateTz(\n event.date.valueOf(),\n this.timezone\n ); // return building time\n let startTz = buildingStartDate.clone();\n let endTz = startTz.addValue({ minutes: this.pendingDuration });\n\n if (buildingStartDate.ms < Date.now()) {\n // compare building time to now\n // Abandon past events\n return;\n }\n\n // this.pendingDate is in building time\n if (this.pendingDateTz.ms !== startTz.ms) {\n // comparing building to building\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n startTz = startTz.subtractValue({ seconds: setup });\n }\n const breakdown =\n this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n endTz = endTz.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const booked = this.events.filter((e) => e.draggable === false);\n // building start and end time but localized bookings\n const conflict = this.hasConflict(startTz, endTz, booked);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n this.pendingChange = true;\n this.pendingDateTz = buildingStartDate; // building time\n\n this.setupEventName();\n this.transformBookings();\n }\n }\n\n public displayConfirmationModal() {\n this.modal_data = {\n pendingDateTz: this.pendingDateTz, // building time , new time\n pendingDuration: this.pendingDuration,\n dateTz: this.dateTz, // building time, existing time\n duration: this.duration,\n space: new Space(this.space),\n rules: this.rules,\n bookingId: this.bookingId,\n currentBooking: this.currentBooking,\n };\n\n const dialogRef = this.dialog.open(RoomAvailabilityPreviewModalComponent, {\n data: this.modal_data,\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRef.componentInstance.submitForm.subscribe((d: any) => {\n // Apply the confirmed changes\n this.pendingChange = true;\n this.pendingDateTz = d.dateTz;\n this.pendingDuration = d.duration;\n\n dialogRef.componentInstance.applyChanges({\n dateTz: d.dateTz,\n duration: this.pendingDuration,\n pendingDateTz: this.pendingDateTz,\n pendingDuration: this.pendingDuration,\n });\n this.setupEventName();\n this.transformBookings();\n // Change View\n this.setCalendarValue(d.dateTz);\n });\n\n dialogRef.afterClosed().subscribe((d) => {\n // Update the current with pending record\n if (d) {\n // convert the local input values returned into the same time in the building timezone\n const buildingDate = convertLocalTimestampToTimezonedDateTz(\n d.dateTz.ms,\n this.timezone\n );\n this.dateTz = buildingDate;\n this.duration = d.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(buildingDate.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.confirmChanges.emit({ ...d, mobile: this.mobile, save: true });\n } else {\n // this is ok\n const md = this.modal_data;\n this.dateTz = md.dateTz;\n this.duration = md.duration;\n this.pendingDateTz = md.dateTz;\n this.pendingDuration = md.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(md.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n // This is reverting the changes\n this.confirmChanges.emit({\n dateTz: md.dateTz,\n duration: this.duration,\n mobile: this.mobile,\n save: !!d,\n });\n this.setupEventName();\n this.transformBookings();\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = this.viewDateTz;\n this.setDislayValues();\n }\n });\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public scrollTo() {\n if (this.scrollFired) return;\n this.timeout(\n 'scroll_to',\n () => {\n const ele = document.getElementById('calendarScrollContainer');\n if (ele) {\n ele.scrollTo({\n top: this.dayStartHour * 64,\n left: 0,\n behavior: 'smooth',\n });\n this.scrollFired = true;\n }\n },\n 500\n );\n }\n\n public toggleDatePicker() {\n this.showDatePicker = !this.showDatePicker;\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n // Reset to the initial view\n this.pendingDateTz = this.dateTz; // = new Date(this.date);\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.setupEventName();\n this.transformBookings();\n this.dayRefresh.next();\n }\n\n public calendarBack() {\n let today = this.alternativeWeekStartDateTz; // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.subtractValue({ days: 1 });\n } else {\n today = today.subtractValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarSpan() {\n let today = this.pendingDateTz; // new DateTZ({date: this.pendingDate.valueOf()});\n if (this.mobile || !this.expanded) {\n this.date_span.start = today.startOfValue('day').ms;\n this.date_span.end = today.endOfValue('day').ms;\n } else {\n this.date_span.start = today.startOfValue('week').ms;\n this.date_span.end = today.endOfValue('week').ms;\n }\n }\n\n public calendarCenter() {\n let today = this.pendingDateTz.startOfValue('day');\n if (!this.mobile) {\n today = today.startOfValue('week');\n }\n\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarForward() {\n let today = this.alternativeWeekStartDateTz // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.addValue({ days: 1 });\n } else {\n today = today.addValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public toggleWeekend() {\n this.showWeekend = !this.showWeekend;\n this.setupEventName();\n }\n}\n","
\n
\n \n \n
\n
\n \n \n
\n
\n
\n

Room Availability

\n

{{space.local_name}}

\n

{{building?.name}}, {{level?.name}}, {{building?.address}}

\n
\n
\n
\n
\n \n \n \n
\n
\n {{weekViewRangeText}}\n \n \n
\n \n Show Weekend\n \n
\n
\n
\n \n\n \n
\n \n {{ day.date | calendarDate:'weekViewColumnHeader':locale }} {{ day.date | calendarDate:'weekViewColumnSubHeader':locale }}\n

{{ isEventDate(day) ? '(Current Selection)' : '' }}

\n
\n
\n \n\n \n \n
\n
\n
\n
\n \n \n &ngsp;\n \n \n
\n \n
\n
\n
\n\n
\n
\n \n \n
\n
\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom,\n} from 'rxjs/operators';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n checkCollisions,\n Booking,\n User,\n UsersService,\n BookingFormData,\n selectActiveForm,\n SpacesService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n matchToHighlight\n} from '@mckinsey-converge/base';\n\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'app-room-booking-details-form',\n templateUrl: './room-booking-details-form.component.html',\n styleUrls: ['./room-booking-details-form.component.scss']\n})\nexport class RoomBookingDetailsFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n public formRef: FormGroupDirective;\n /** Number of characters needed before a search will start */\n @Input() public limit = 3;\n /** When the value changes, the form is submitted */\n @Input() public triggerSubmit = '';\n /** Need booking details */\n @Input() public booking: Booking = null;\n /** Data returned to parent */\n @Output() public submitForm = new EventEmitter();\n /** Data returned to parent */\n @Output() public validateForm = new EventEmitter();\n /** Current User */\n public currentUser: User;\n /** Host list to display */\n public host_list: User[];\n /** User list to display from the Attendees search */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Whether to show the attendees hint */\n public showHint = false;\n /** Attendee Input / Search String */\n public searchString: string;\n /** List of users from an API search */\n public searchResults: Observable;\n /** Subject holding the value of the search */\n public searchSubject = new Subject();\n /** Host field options */\n public hostOptions = [];\n /** Attendees options */\n public options = new BehaviorSubject[]>([]);\n /** Selected Attendees */\n public selectedOptions = new BehaviorSubject[]>([]);\n public selectedUsers = new BehaviorSubject[]>([]);\n public needs_charge_code = false;\n public has_delegate = false;\n public available: boolean = null;\n public notesHandle = null;\n public noteValidationClass = '';\n public selectedCompanies = new BehaviorSubject[]>([]);\n public companyOptions = new BehaviorSubject[]>([]);\n\n /** Data collected on this form */\n public bookingFormGroup = new FormGroup({\n organiser: new FormControl(),\n title: new FormControl('', [ Validators.minLength(1)]), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n attendees: new FormControl(),\n code: new FormControl('', [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]),\n notes: new FormControl(),\n head_count: new FormControl(1, [Validators.required, Validators.min(1)]),\n user_list: new FormControl(),\n host_list: new FormControl(),\n company: new FormControl(),\n opt_out: new FormControl(),\n outlook_opt_out: new FormControl(),\n\n });\n action: string;\n // Indecates that processing request to check availability of breakdown if special requirement being added by user\n checkingBreakdown: boolean = false;\n\n public get invalid_charge_error(): string {\n if (this.bookingFormGroup.controls.code.errors?.required) {\n return 'Charge Code is required';\n }\n if (this.bookingFormGroup.controls.code.errors?.minlength) {\n return 'Charge Code must be at least four characters';\n }\n if (this.bookingFormGroup.controls.code.errors?.pattern) {\n return 'Charge Code cannot contain spaces or special characters';\n }\n return '';\n }\n\n public get headCountControl(): AbstractControl {\n return this.bookingFormGroup.get('head_count');\n }\n\n constructor(\n private _spaces: SpacesService,\n private _snackBar: MatSnackBar,\n private store: Store,\n vcRef: ViewContainerRef,\n private _service: ApplicationService,\n private _users: UsersService) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map((del) => {\n // the kludgy or new User is for when the user service isn't ready.\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n\n // (del) => new User({ email: del.email, name: del.email.split('@')[0].split('_').join(' '), opt_out: del.opt_out })\n });\n if (delegates.length) {\n this.has_delegate = true;\n }\n this.host_list = [user].concat(delegates);\n this.hostOptions = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }));\n });\n\n // if we have an active form, refill the information here once.\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // Get the Equipment charge code mandatory requirement\n const { filters, settings } = next.selectedRoom?.space;\n const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n const officeBasedEqCode = next.selectedRoom?.building?.required?.equipment_code;\n this.needs_charge_code = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n \n\n if (this.needs_charge_code) {\n this.bookingFormGroup.controls.code.setValidators([Validators.required, Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]);\n }\n // build the initial options\n const options = [];\n const attendees = next?.attendees || [];\n const organiser = next?.organiser || { display: this.currentUser.name , value: this.currentUser.email, meta: { external: false, user: this.currentUser }};\n const company = next?.company || [];\n\n const opt_out = next?.opt_out || false;\n const outlook_opt_out = next?.outlook_opt_out || false;\n this.action = next.action || 'new';\n // Load the saved form\n this.bookingFormGroup.setValue({\n organiser,\n title: next.title || '',\n attendees, // options will display current user\n code: next.code || '',\n notes: next.notes || '',\n head_count: next.head_count || '',\n user_list: [],\n host_list: [],\n company,\n opt_out: opt_out,\n outlook_opt_out\n });\n this.selectedOptions.next(attendees);\n this.options.next(attendees);\n this.selectedCompanies.next(company);\n this.companyOptions.next(company);\n }\n })\n );\n\n // Listen for input changes\n this.searchResults = this.searchSubject.pipe(\n debounceTime(500),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query,\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return list;\n })\n );\n\n // Process API results\n this.subscription(\n 'search_results',\n this.searchResults.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n\n // Build options from returned users\n const options = this.user_list.map(u => {\n return {\n value: u.email,\n display: `${u.name} ${u.email}`,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: `${u.name}`,\n meta: { external: false, user: u },\n };\n });\n // Add the manual option to the beginning of the array\n options.unshift({\n value: this.searchString,\n display: this.searchString,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: this.searchString,\n meta: { external: true, user: null },\n });\n // this.loading = false;\n this.options.next(options);\n })\n );\n\n this.bookingFormGroup.valueChanges.subscribe(val => {\n\n clearTimeout(this.notesHandle);\n if (val?.notes?.length) {\n this.checkingBreakdown = true;\n \n // Check for conflicts if adding a note and default setup and breakdown times.\n this.notesHandle = setTimeout(() => {\n this.validateForm.emit(false);\n const booking = this.booking.clone();\n const setup = {};\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n const breakdown = {};\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n\n const mockBooking = new Booking({\n id: booking.id,\n room: booking.space,\n start_epoch: booking.startDateTz.seconds,\n end_epoch: booking.endDateTz.seconds,\n setup,\n breakdown,\n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.checkingBreakdown = false;\n this.available = bookable;\n // this.validateForm.emit(true);\n this.validateForm.emit(this.bookingFormGroup.valid);\n this.noteValidationClass = bookable === false ? 'booked' : 'available';\n // this.loading = false;\n }).catch(() => {\n this.checkingBreakdown = false;\n this.available = false;\n this.validateForm.emit(false);\n this.noteValidationClass = 'booked';\n // this.loading = false;\n\n return;\n });\n }, 200);\n } else {\n this.checkingBreakdown = false;\n this.available = null;\n this.noteValidationClass = '';\n this.validateForm.emit(this.bookingFormGroup.valid);\n }\n\n });\n }\n\n public setOrganiserOptOut(opt_out) {\n this.bookingFormGroup.controls.opt_out.setValue(opt_out);\n }\n\n public updateOrganiser(user) {\n console.log(user);\n }\n\n /** Listen for changes */\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.bookingFormGroup.get(key).setValue(this.bookingFormGroup.get(key).value.trim());\n }\n\n /** Toggle an attendee on/off */\n public toggle(option: SelectOption) {\n const inputValue = option.value\n .split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n let inputValueEmail = '';\n // Check if inputValue is a valid email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(inputValue)) {\n // If not, replace all spaces with underscores and append a random guest email string\n inputValueEmail = inputValue.replace(/\\s+/g, '_') + `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n }\n\n // Check for character limit\n if (\n // this.selectedOptions.value.some((option: SelectOption) => option.value === inputValue) ||\n inputValue.length > 50\n ) {\n this._service.notifyWarn('Attendee name cannot exceed 50 characters');\n return;\n }\n\n this.selectedOptions\n .pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n let opts = selectedOptions.slice();\n const found = opts.some((v) => inputValue === v.value);\n if (found) {\n opts = opts.filter((v) => inputValue !== v.value);\n } else {\n const color = inputValue.toLowerCase().includes('mckinsey.')\n ? 'internal'\n : 'external';\n opts.push({\n ...option,\n value: inputValueEmail,\n display: inputValue,\n shortDisplay: inputValue,\n meta: {\n ...option.meta,\n color,\n },\n });\n }\n\n return opts;\n })\n )\n .subscribe((next) => {\n if (!this.bookingFormGroup.controls.head_count.touched) {\n this.bookingFormGroup.controls.head_count.setValue(next.length + 1);\n }\n this.selectedOptions.next(next);\n });\n }\n\n public clearHeadcount() {\n this.headCountControl.setValue(1);\n }\n\n /** Return the data to the listening parent */\n public onSubmitForm() {\n this.bookingFormGroup.markAllAsTouched();\n // a bit of an issue that the form state isn't saved unless valid\n if (this.bookingFormGroup.valid) {\n const form_data = this.bookingFormGroup.value;\n form_data.user_list = this.user_list;\n form_data.host_list = this.host_list;\n form_data.has_delegate = this.has_delegate;\n this.submitForm.emit(form_data);\n }\n }\n\n /** Take the input and feed it back to the parent to add to attendees array */\n public updateAttendeeOptionsFromUserInput(v: string) {\n const l = v.length;\n const options = this.selectedOptions.value.slice();\n if (!l) {\n this.options.next([]);\n return;\n }\n if (l > 2) {\n // Triggers the API call to search for the user input\n this.searchSubject.next(v);\n }\n\n options.unshift({\n value: v,\n display: v,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: v,\n meta: { external: true },\n });\n this.searchString = v;\n this.options.next(options);\n }\n\n public toggleAttendeesHint() {\n this.showHint = !this.showHint;\n }\n\n public updateCompanyOptionsFromUserInput(v: string) {\n if (!v.length) {\n this.companyOptions.next([]);\n return;\n }\n this.companyOptions.next([{\n value: v,\n display: v,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: v,\n }]);\n }\n\n public toggleCompany(option: SelectOption) {\n this.selectedCompanies.pipe(\n take(1),\n withLatestFrom(this.companyOptions),\n map(([selectedCompanies, options]) => {\n let opts = selectedCompanies.slice();\n const found = opts.some(v => option.value === v.value);\n if (found) {\n opts = opts.filter(v => option.value !== v.value);\n } else {\n opts.push(option);\n }\n\n return opts;\n })\n ).subscribe(next => {\n this.selectedCompanies.next(next);\n });\n }\n}\n","\n
\n
\n
\n \n Meeting Title*\n \n \n \n \n
\n \n {{ ( bookingFormGroup?.get('title').errors && bookingFormGroup?.get('title').hasError('pattern')) ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Meeting Title is required'}}\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n Opt out email notification \n
\n \n
\n\n\n \n\n
\n \n \n \n Why do we need this?\n
\n
\n Attendee emails are used for visitor management purposes.\n Converge won't send any emails to attendees.\n
\n \n
\n\n
\n
\n \n \n
\n
\n \n Charge Code{{ needs_charge_code ? '*' : '' }}\n \n \n \n \n
\n \n {{ invalid_charge_error }}\n \n
\n
\n
\n
\n \n Headcount estimate*\n \n \n \n \n
\n \n Headcount is required\n \n
\n
\n
\n
\n\n
\n
\n \n Additional requirements (e.g room setup, equipment...)\n \n \n \n \n \n \n

Checking breakdown availability for selected date/time...

\n

\n \n A set up and breakdown time of 15 mins was added to either side\n of your booking to cater for these additional requirements.\n

\n

\n \n A set up and break down time of 15mins was added to either side of your booking to cater for these additional requirements. This has resulted in a conflict with another booking. Please adjust your booking accordingly.\n

\n
\n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\nimport { closestToTimeSlot, closestToTimeSlotTz, resetSecondsOnTimestamp } from '@mckinsey-converge/base';\n\nimport {\n distinctUntilChanged,\n map,\n skip,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingCity,\n flattenDisplayOffices,\n toggleSelectedByGroup,\n storeBookingFormData,\n BookingFormData,\n bookingTypeOptions,\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption,\n roomSizeOptions,\n selectActiveForm,\n ApplicationService,\n roomSizeOptionsKiosk,\n\t\tRecurrencePeriod,\n generateBookingForm,\n SeriesAction,\n setRecurrenceStartsTime\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Booking } from '../../../../../../libs/data-common/src';\nimport * as cloneDeep from 'lodash/cloneDeep';\n@Component({\n selector: 'app-room-booking-form',\n templateUrl: './room-booking-form.component.html',\n styleUrls: ['./room-booking-form.component.scss']\n})\nexport class RoomBookingFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n formRef: FormGroupDirective;\n\n @Output()\n public submitForm = new EventEmitter();\n\n @Input()\n public showCancel = false;\n\n @Input()\n public triggerSubmit: number;\n\n /**\n * Used only if showCancel is true.\n */\n @Output()\n public cancelSubmit = new EventEmitter();\n\n // fromDate is the selected date\n public fromDate: number = closestToTimeSlot(DateTime.now(), 15).valueOf(); // R--- depreciate\n /** DateTZ object of the date and time that the date and time picker will begin it's options from */\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15);\n public bookingTypeOptions = bookingTypeOptions;\n public roomSizeOptions = roomSizeOptions;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\"\n\n public formGroup: FormGroup = new FormGroup({\n id: new FormControl('', []), // used in case of recurring series edit\n location: new FormControl([], [Validators.required]),\n date: new FormControl(this.fromDate, [Validators.required]),\n dateTz: new FormControl(this.fromDateTz, [Validators.required]), // starts out as the next closest available time interval\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n bookingType: new FormControl(internalBookingTypeOption),\n roomSize: new FormControl(defaultRoomSizeOption),\n selectedRoom: new FormControl({}),\n timezone: new FormControl(\"\"),\n offset: new FormControl(\"\"),\n\n\t\trecurrence_period: new FormControl(RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl( 1),\n recurrence_endTz: new FormControl( new DateTZ({ date: 1 }).addValue({days: 1})),\n recurrence_count: new FormControl( 0),\n is_recurrent: new FormControl(null),\n recurrence_starts: new FormControl( []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl( []),\n\n ignore: new FormControl('', []), // used in case of recurring series edit\n // TODO, there's a few missing from interface BookingFormData, libs/data-common/src/lib/booking/booking.form.data.ts\n });\n\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n constructor(private store: Store,\n // private _service: ApplicationService,\n vcRef: ViewContainerRef, \n private _snackBar: MatSnackBar,\n private _service: ApplicationService,\n ) {\n super(vcRef);\n // if(this._service?.kioskFormFilter) {\n // this.formGroup.setValue({\n // roomSize: roomSizeOptions[3]\n // })\n // }\n }\n\n public ngOnInit(): void {\n\n\n super.ngOnInit();\n // R--- Complicated, need the TZ aware inputs and to not init those inputs until the building timezone is available.\n // R--- See if there's any way to make the timezone retrieval less fragile.\n\n // if we have an active form, refill the information here once.\n // Doesn't run on initial steps, only if you go back to the home page\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set the fromDate correctly\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15); // R--- shouldn't this actually be the current date start of day to make all the options available?\n\n const form = cloneDeep(next);\n this.formGroup.patchValue({\n ...form,\n }, { emitEvent: true });\n\n // this.formGroup.markAllAsTouched();\n // this.formGroup.updateValueAndValidity();\n\n }\n })\n );\n\n // R--- I only see this fire when the modal opens or going to the home page\n this.subscription('formChanges', this.formGroup.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe((next) => {\n const timezone = next.timezone || this.localTimezone\n /**\n * When the selected date changes update the time picker's start time\n * to the nearest available slot of the current day\n */\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15);\n\n /**\n * When the new selected date arrives, update the coachmark displayed below the date time picker\n */\n this.updateCoachmarkTimes(timezone);\n\n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n )\n .subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n public onSubmitForm() {\n if(this.formGroup.controls?.is_recurrent?.value){\n setRecurrenceStartsTime(this.formGroup)\n }\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const is_past = this._checkDateInPast();\n if (is_past) {\n this._service.notifyWarn('Start Time updated to after current time, please click search again.');\n return;\n } else {\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(formGroupData.dateTz.ms),\n dateTz: formGroupData.dateTz.setValue({ millisecond: 0, second: 0 })\n });\n }\n this.formGroup.markAllAsTouched();\n if (this.formGroup.valid) {\n this.submitForm.emit(this.formGroup.value);\n }\n }\n\n // public openSnackBar(message: string, action: string) {\n // this._snackBar.open(message, action, {\n // duration: 5000,\n // panelClass: ['yellow-snackbar']\n // });\n // }\n\n // Fires when the location selector value is changed\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n // deselecting the location option sets the timezone to local so convert.\n const formGroupDate = this.formGroup.value;\n if (!next.length) {\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: this.localTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(this.localTimezone)\n });\n } else {\n const buildingTimezone = next[0]?.meta?.building?.timezone || next[0]?.meta?.city?.timezone;\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: buildingTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(buildingTimezone)\n });\n }\n this._checkDateInPast();\n // Must fire last or location picker will be buggy.\n this.selectedOptions.next(next);\n });\n }\n\n private _checkDateInPast() {\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const date = new DateTZ({ date: this.formGroup.value.dateTz.ms, building_tz: formGroupData.timezone, is_local_tz:false }).addValue({ seconds: 30 })\n const now = DateNow(new Date())\n if (now.isAfterDate(date)) {\n // Reset the start time if in the past\n const closestTz = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: formGroupData.timezone }).addValue({ minutes: 1 }), 15)\n const prevClosestTz = closestTz.subtractValue({minutes: 15})\n const prevDateTz = prevClosestTz.addValue({ seconds: 30 });\n // R-- why do I do this on submit? move to a another method.\n if(now.isAfterDate(prevDateTz)){\n this.fromDateTz = closestTz;\n }else{\n this.fromDateTz = prevClosestTz;\n }\n\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(this.fromDateTz.ms),\n dateTz: this.fromDateTz.setValue({ millisecond: 0, second: 0 })\n });\n return true;\n }\n return false;\n }\n\n private updateCoachmarkTimes(timezone: string) {\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n\n this.fromDateTz = new DateTZ({ date: this.fromDateTz.ms, is_local_tz: false, building_tz: timezone });\n\n if (localTzOffset !== buildingTzOffset) {\n const startDate = this.formGroup.value.dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.formGroup.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n }\n}\n","\n
\n \n\n\n
\n \n\n \n \n \n \n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n\n
\n
\n Recurring booking\n
\n \n \n\n
\n\n \n\n \n \n \n \n \n
","import { Component, ViewEncapsulation, Inject } from '@angular/core';\nimport { BookingFormData, storeBookingFormData, SeriesAction} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Store } from '@ngrx/store';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n// import { Router, ActivatedRoute } from '@angular/router';\n\n@Component({\n selector: 'app-room-booking-modal',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomBookingModalComponent extends BaseDirective {\n public trigger = Date();\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: any ) {\n super();\n }\n\n public triggerSubmit() {\n this.trigger = Date();\n }\n\n public submitForm(next: BookingFormData) {\n /// submit\n\n const ignore = this._data?.action === SeriesAction.EDIT ? next.id : null;\n const bookable = this._data?.action === SeriesAction.EDIT || null;\n\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next,\n ignore, // ignore id in case of recurring edit series\n bookable, // true in case of recurring edit series\n action: this._data?.action || '' // 'edit' in case of recurring edit series\n }\n }));\n this.close('DoNotClearActiveForm'); // do not clear active form if for submit as form need forther in result module\n this._data && this._data.navigateTo && this._data.navigateTo(); // navigate to result in case of staff recurring edit\n\n }\n\n public close(flag: string = '') {\n this.dialogRef.close(flag);\n }\n}\n","import {\n Component,\n OnInit,\n OnDestroy\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n AlertMode,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BaseDirective,\n dateBuildingFormatString,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n User,\n Building,\n BuildingCity,\n IEngineResponse,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectHomepageBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n BookingStoreState,\n BookingFormData,\n clearBookingFormData,\n storeBookingFormData,\n BookingsService\n} from '@mckinsey-converge/data-common';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { Urls } from 'src/app/utilities/urls';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { loadBookingsWithQuery, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n elementAt,\n map,\n take,\n} from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'app-room-booking',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n

Meeting Room Booking

\n
\n \"Booking\n
\n
\n
\n
\n
\n \n \n \n \n
\n
\n
\n

Your Bookings

\n
\n
\n \n
You have no upcoming bookings
\n
\n
\n \n \n
\n
\n \n \n \n \n
\n
\n \n Manage\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-booking.component.scss']\n})\nexport class RoomBookingComponent extends BaseDirective implements OnInit, OnDestroy {\n public TopBarHeaderMode = TopBarHeaderMode;\n public AlertMode = AlertMode;\n\n public width = 16;\n\n // public showBanner = true;\n public showBookings = false;\n public showManageButtonA = false;\n public showManageButtonB = false;\n public showManageButtonC = false;\n public dateString: string;\n\n public homepageBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public pastBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public upcomingBookings: BookingResultsViewModel[];\n public buildings = new BehaviorSubject[]>([]);\n public reloading = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n constructor(private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _bookings: BookingsService,\n private dialog: MatDialog) {\n super();\n this.dateString = dateBuildingFormatString(DateNow(new Date()));\n }\n\n public ngOnDestroy() {\n if (typeof window === 'object') {\n window.onbeforeunload = undefined;\n }\n\t\t\t\t// clear interval\n\t\t\t\tthis.clearInterval('refreshBookings');\n }\n\n public ngOnInit(): void {\n // only run on window onload\n if (typeof window === 'object') {\n window.onbeforeunload = (event) => {\n const e = event || window.event;\n this.store.dispatch(clearBookingFormData())\n return e;\n };\n }\n\n this.store.dispatch(loadOrganisations.request());\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n // console.log('on buildings ')\n // this.refresh('homepage');\n }));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded\n this.currentUser = new User(user);\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, 'target': 'homepage' }));\n // start the timer at the top of the minute;\n // const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n // setTimeout(() => {\n // console.log('on setTimeout ')\n // this.refresh('homepage')\n this.interval('refreshBookings', () => {\n\t\t\t\t\t\t\t\t\t\t\tthis.refresh('homepage')\n\t\t\t\t\t\t\t\t\t\t}, 60 * 1000);\n // }, offset + 5000)\n\n })\n );\n\n this.reloading = true;\n this.subscription('homepageResults', this.store.pipe(\n select(selectHomepageBookingsResultsFromState)\n ).subscribe(next => {\n // this.reloading = true;\n this.homepageBookingResults.next(next);\n if (!next.isEmpty() && next.success && Array.isArray(next.success.results) && next.success.total) {\n this.reloading = false;\n this.showManageButtonA = true;\n this.upcomingBookings = mapResultsToViewModels(next.success.results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n this.allBookings = next.success.results;\n\n if (this.upcomingBookings.length) {\n this.showBookings = true;\n }\n } else {\n this.reloading = false;\n this.showManageButtonA = false;\n this.upcomingBookings = [];\n this.showBookings = false;\n }\n }));\n\n this.subscription('pastResults', this.store.pipe(\n select(selectPastBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonB = true;\n }\n }));\n\n this.subscription('cancelledResults', this.store.pipe(\n select(selectCancelledBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonC = true;\n }\n }));\n }\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return !this.reloading; //|| this.homepageBookingResults.value.hasLoaded();\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return '';\n }\n\n // public hideBanner() {\n // this.showBanner = false;\n // }\n\n public learnMore() {\n window.open(Urls.LearnMore);\n }\n\n public routeToResults(next: BookingFormData) {\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next\n }\n }));\n this.store.dispatch(loadRoomsForResults.clear());\n this.router.navigate(['results'], { relativeTo: this.route });\n }\n\n public routeToManageBookings() {\n this.router.navigate(['manage'], { relativeTo: this.route });\n }\n\n public refresh(target: string) {\n if (!this.currentUser?.email) {\n return;\n }\n\n // tslint:disable-next-line: max-line-length\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, target }));\n }\n\n\n\t\t/**\n\t\t * Displays detailed information about a booking in a modal dialog.\n\t\t * If the booking is part of a recurring series, it retrieves the master booking\n\t\t * details and displays them along with the selected booking. The modal allows\n\t\t * users to view and interact with the booking details. After the modal is closed,\n\t\t * it checks for special flags to determine if the active form and result data should be cleared.\n\t\t *\n\t\t * @param {BookingResultsViewModel} viewModel - The view model containing booking information to display.\n\t\t */\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n\t\t\t// Handle logic for recurring bookings to fetch the master booking details\n \t// and set the master_booking property for displaying in the modal\n\t\t\tif(viewModel.booking.is_recurrent) {\n\t\t\t\t\tlet booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n\t\t\t\t\tif (!booking) {\n\t\t\t\t\t\t\tbooking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n\t\t\t\t\t}\n\t\t\t\t\tthis.master_booking = mapResultsToViewModels([booking])[0];\n\t\t\t}\n\n\t\t\t// Open a modal dialog to display the booking details along with master booking (if applicable)\n\t\t\tconst dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-wide-manage-booking',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tbooking: viewModel.booking,\t// Selected booking information\n\t\t\t\t\t\t\tbuilding: this.getBuilding(viewModel.booking),\t// Building information for the booking\n\t\t\t\t\t\t\tmaster_booking: this.master_booking?.booking || null,\t// Master booking details (if available)\n\t\t\t\t\t\t\trefresh: () => {\n\t\t\t\t\t\t\t\t\tthis.refresh('homepage');\t// Function to refresh the homepage after modal closure\n\t\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t});\n\n\t\t\tdialogRefX.afterClosed().subscribe((flag) => {\n\t\t\t\t// Clear form and result data if the flag indicates it's necessary\n\t\t\t\t\tflag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n\t\t\t});\n }\n\n\t\t/**\n\t\t * Clears active form and result data from the store.\n\t\t *\n\t\t * This function dispatches actions to clear the active form data and the loaded\n\t\t * rooms data from the store. It is typically used after a modal interaction or\n\t\t * a specific user action to reset the form state and loaded room information.\n\t\t */\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n }\n\n\n}\n","import { Component, OnInit } from '@angular/core';\nimport {\n TopBarHeaderMode,\n RoutePayload,\n} from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n Booking,\n User,\n Space,\n BookingFormData,\n selectActiveForm,\n selectFilteredByIdResults,\n BookingStoreState,\n storeBookingFormData,\n DateDurationData,\n OrganisationService,\n SpaceConflictAlertModalData,\n SpaceStatus,\n filterSpacesByAppliedFilters,\n FilteredSpaces,\n Building,\n SpaceFilterReason,\n getLastDateFromList,\n RoomResultsViewModel,\n stringToMinutes,\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n DialogEvent,\n shorterLocalDateFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { distinctUntilChanged, take, throttleTime, tap, filter } from 'rxjs/operators';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { RoomStoreState, loadByIdResults } from '@mckinsey-converge/rooms';\nimport { Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n ConflictAlertModalComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n} from '@mckinsey-converge/ui';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n selector: 'app-room-details',\n templateUrl: './room-details.component.html',\n styleUrls: ['./room-details.component.scss'],\n})\nexport class RoomDetailsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public booking: Booking;\n // @TODO get this from current settings.\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n\n public data = new BehaviorSubject(undefined);\n public byIdResults = new BehaviorSubject(undefined);\n public open: boolean = true;\n // Set to a config once we know where the files are hosted.\n public rootFolderURL = 'assets/img/rooms/';\n // Set in the room availablity callback\n public mobile: boolean = false;\n public expandedLocation: boolean = false;\n public expandedAvailability: boolean = false;\n // Track event date changes in the UI in this param\n public alternativeWeekStartDateTz: DateTZ = new DateTZ();\n /** Current User */\n public currentUser: User;\n /** Display warning banner by default */\n public showInfoBanner: boolean = true;\n /** Space class created from subscribed active form room data */\n public room: Space;\n /** Requested booking start time from subscribed active form data */\n public requestedDateTz: DateTZ;\n /** Requested booking end time from subscribed active form data */\n public requestedEndDateTz: DateTZ;\n\n /** Track alert dialog should display's only once for not bookable or unavailable */\n private isAlertDisplayed: boolean = false;\n /** Update availability status of current rooom */\n public availabilityStatus: string;\n /** Space validity per rule */\n public isSpaceValidAsPerRule: FilteredSpaces;\n\n public orgBuildings: Building[] = [];\n /** Subtype of a room or space. */\n public roomSubtype: string = '';\n\n /* recurrence booking - occurence availability */\n public occurenceAvailability: string = '';\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n constructor(\n private store: Store,\n private router: Router,\n private _org: OrganisationService,\n public dialog: MatDialog\n ) {\n super();\n /**\n * Router extras expecting from\n * On navigation from result or home page after QR code scan\n */\n if ( this.router.getCurrentNavigation() !== null && this.router.getCurrentNavigation().extras?.state?.payload ) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = this.router.getCurrentNavigation().extras.state.payload?.nextBusinessDay\n this.store.dispatch(storeBookingFormData({\n payload: this.router.getCurrentNavigation().extras.state.payload,\n })\n );\n }\n }\n\n public ngOnInit(): void {\n this.availabilityStatus = 'unavailable';\n this.orgBuildings = this._org.buildings;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = next?.nextBusinessDay || false;\n\n this.data.next(next);\n // R--- selectedRoom could sure use some clarity, why is everything but the kitchen sink in there?\n if (!this.data.value?.selectedRoom || !this.data.value?.dateTz.ms) {\n return;\n }\n // Create a full fledged Space object since the selectedRoom.space is just JSON\n this.room = new Space(this.data.value?.selectedRoom?.space);\n\n // Check room validtion of selected room to maintain status on detail page\n this.checkAvailabiltyAsPerRule();\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n\n // Query for the entire day for this room\n this.fetchRooms(false);\n this.setRoomSubType();\n\n this.requestedDateTz = this.data.value?.dateTz;\n if (next.is_recurrent) {\n const { is_local_tz, building_tz} = this?.data?.value?.dateTz;\n const endDateTz = getLastDateFromList( this?.data?.value?.recurrence_starts );\n const endDate = new DateTZ({ date: endDateTz.date.valueOf(), is_local_tz, building_tz }) \n // add one day if user room selection from next business day section on result page\n this.requestedEndDateTz = this.nextBusinessDay ? endDate.addValue({ minutes: this.data?.value.offset }) : endDate;\n\n this.occurenceAvailability = `${this?.room?.availableOccurrences} out of ${this?.room?.totalOccurrences}`;\n }\n }\n })\n );\n\n this.subscription(\n 'byId',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n this.byIdResults.next(\n next.success?.spaces?.length\n ? next.success.spaces[0].settings.bookings\n : EMPTY_ARRAY\n );\n })\n );\n\n const breakpoint = 450;\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n )\n .subscribe();\n }\n\n public setRoomSubType() {\n //test\n const room_type = `${this?.room.internal_or_external}_room_types`;\n const temp: string = Array.isArray(this?.room?.room_type)\n ? this?.room?.room_type[0]\n : this?.room?.room_type;\n const type = this?._org?.getOrganizationFiltersByRoomType(room_type)[temp];\n this.roomSubtype = type !== undefined ? `( ${type} Room )` : '';\n }\n\n public isConflictWithOccurences() {\n const conflicts = this?.room?.totalOccurrences - this?.room?.availableOccurrences;\n return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n }\n\n /**\n\t\t * Opens a modal to display recurrence conflicts for a given room.\n\t\t *\n\t\t * @param {Space} room - The room for which recurrence conflicts are being displayed.\n\t\t *\n\t\t * This function opens a modal dialog to show recurrence exceptions (conflicts)\n\t\t * for the specified room.\n\t\t *\n\t\t * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n\t\t */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(\n ConflictsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n },\n }\n );\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t\t/**\n\t\t * Retrieves the end date string for the booking, considering recurrence if applicable.\n\t\t * If the booking is recurrent.\n\t\t *\n\t\t * @returns {string} The formatted end date string in a shorter local date format.\n\t\t */\n\t\t public get endDateString(): string {\n\t\t\t// if this.requestedEndDateTz is not in use anywhere here in this file than remove that property and use const here\n\t\t\tif(!this.requestedEndDateTz) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn this.requestedEndDateTz.formatDate('ccc d MMM yyyy'); // shorterLocalDateFormatString(this.requestedEndDateTz);\n\t\t}\n\n /**\n * Functino to check if room is available as per room/user rules\n */\n public checkAvailabiltyAsPerRule() {\n this.orgBuildings =\n !this.orgBuildings.length && this.data.value?.buildings\n ? this.data.value?.buildings\n : this.orgBuildings;\n this.isSpaceValidAsPerRule = filterSpacesByAppliedFilters(\n [],\n [this.room],\n this.data.value,\n this.orgBuildings,\n this.currentUser\n );\n }\n\n /**\n * Function popup advise alert dialog if scanned (QR code) room details found conflicts with other booking/s\n * @param room\n */\n alertIfItHasConflict(isBookable, isAvailable) {\n this.isAlertDisplayed = true;\n const data = {\n headerText: !isBookable\n ? SpaceConflictAlertModalData.NotBookableHeaderText\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableHeaderText\n : '',\n message:\n this.isSpaceValidAsPerRule.specificReason === SpaceFilterReason.OfficeRules\n ? SpaceConflictAlertModalData.NotBookableDueToOfficeRule\n : !isBookable\n ? SpaceConflictAlertModalData.NotBookableMessage\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableMessage\n : '',\n buttonLabel: !isBookable\n ? SpaceConflictAlertModalData.NotBookableButtonLabel\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableButtonLabel\n : '',\n callback: !isBookable\n ? this.goToBackRoute.bind(this)\n : !isAvailable\n ? this.expandAvailability.bind(this, true)\n : null,\n shouldClose: isBookable,\n };\n const dialog = this.dialog.open(ConflictAlertModalComponent, {\n data: data,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n disableClose: !isBookable,\n });\n }\n\n public warnIfItHasConflict({ room: room, hasConflict: hasConflict }) {\n if (\n (!room.bookable || !this.isSpaceValidAsPerRule.spaces.length) &&\n !this.isAlertDisplayed\n ) {\n // room is not bookable(not available to book) and no warning dialog displayed yet\n this.alertIfItHasConflict(false, true);\n this.updateAvailabilityStatus(SpaceStatus.Unavailable);\n } else if (!room.available && hasConflict && !this.isAlertDisplayed) {\n //room is not available AT THIS TIME to book (booked) and has conflict with other booking and no warning dialog displayed yet\n this.alertIfItHasConflict(room.bookable, !hasConflict); // (true, true/false)\n this.updateAvailabilityStatus(SpaceStatus.Booked);\n } else {\n /**\n * Update status of availability - Uavailable/Booked/Requestable/Bookable\n * If room is not bookable(not available to book) and warning dialog dispalyed once\n * If room is bookable but not available to boot AT THIS TIME (or and has conflict with other booking) and warning dialog displayed once\n * If room is bookable and availanle to book AT THIS TIME then check the type of room Requestable? or Bookable\n */\n const status =\n !room.bookable || !this.isSpaceValidAsPerRule.spaces.length\n ? SpaceStatus.Unavailable\n : !room.available && hasConflict\n ? SpaceStatus.Booked\n : this.is_request\n ? SpaceStatus.Requestable\n : SpaceStatus.Bookable;\n this.updateAvailabilityStatus(status);\n }\n }\n\n public updateAvailabilityStatus(primaryCheck: string, secondaryCheck?: string) {\n this.availabilityStatus =\n primaryCheck !== ''\n ? primaryCheck\n : this.data.value.is_recurrent ||\n ['unavailable', 'booked'].indexOf(this.availabilityStatus) === -1\n ? secondaryCheck\n : this.availabilityStatus;\n }\n\n public get catering(): string {\n return (\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.start })\n .formatDate('ha')\n .toLocaleLowerCase() +\n ' - ' +\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.end })\n .formatDate('ha')\n .toLocaleLowerCase()\n );\n }\n\n public get dateString(): string {\n\t\t\t\tif(!this.requestedDateTz) return '';\n return this.requestedDateTz.formatDate('ccc d MMM yyyy');; //shorterLocalDateFormatString(this.requestedDateTz);\n \n }\n\n public get focusedRoomMapKey(): string {\n return `area-${this.room?.map_id}-status`;\n }\n\n /** Whether we are only allowed to 'request' the selected space */\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n const isRequest = space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser,\n });\n this.updateAvailabilityStatus(\n '',\n isRequest ? SpaceStatus.Requestable : SpaceStatus.Bookable\n );\n return isRequest;\n }\n\n public get roomFeatures(): string[] {\n // const room_type = `${this.room.internal_or_external}_room_types`\n const combinedFeatures = {\n // ...this._org.getOrganizationFiltersByRoomType(room_type),\n ...this._org.getOrganizationFiltersByRoomType('equipment_types'),\n };\n const features = this.room !== undefined ? this.room?.featuresArray.map(\n (feature: string) => combinedFeatures[feature]\n ) : [];\n\n return [...new Set(features)].filter((f) => !!f);\n }\n\n public get roomHasCatering() {\n // Building scope catering available is true or false\n const building = this.data.value?.selectedRoom?.building;\n let hasCatering = building ? building.has_catering : false;\n // but if Room catering is false it overrides the building\n if (this.room?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n }\n\n public get roomImagesFileSlug(): string {\n return this.room?.email.split('@')[0];\n }\n\n public get mapUrl(): string {\n return this.room?.level?.map_url;\n }\n\n public get timeString(): string {\n\t\t\tif(!this.requestedDateTz) return '';\n\t\t\treturn startEndTimeWithZoneFormatString(\n\t\t\t\t\tthis.requestedDateTz,\n\t\t\t\t\tthis.requestedDateTz.addValue({ minutes: this.data.value?.duration })\n\t\t\t);\n }\n\n /**\n * Get the timezone form the subscribed activeForm\n */\n public get timezone(): string {\n // R--- this.room.timezone wasn't reliable enough on page refresh, something to look into\n return this.data.value.selectedRoom?.building.timezone;\n }\n\n public setAlternativeWeekStartDate(bookingDate: DateTZ) {\n if (!bookingDate) {\n return;\n }\n\n const booking_date = bookingDate.clone();\n if (this.mobile) {\n this.alternativeWeekStartDateTz = booking_date;\n } else {\n this.alternativeWeekStartDateTz = booking_date.startOfValue('week');\n }\n }\n\n public updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n this.alternativeWeekStartDateTz = alternativeWeekStartDateTz;\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n }\n\n public confirmChanges(data: DateDurationData) {\n // R-- refactor room-availability-preview to return DateTZ so setAlternativeWeekStartDate can use it.\n this.mobile = data.mobile;\n this.setAlternativeWeekStartDate(data.dateTz);\n\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n dateTz: data.dateTz,\n duration: data.duration,\n },\n })\n );\n }\n\n public fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n if (!this.room?.id) {\n return;\n }\n\n const day = 24 * 60;\n const week = day * 7;\n\n let start_date = (alternativeWeekStartDateTz || this.data.value.dateTz).clone();\n if (allWeek && start_date.dateWeekday !== 7) {\n start_date = start_date.startOfValue('week');\n }\n\n const startOfDay = start_date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = start_date.setValue({ second: 0, millisecond: 0 }).startOfValue('day');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.room?.id,\n capacity: this.data.value?.roomSize.value,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public removeDateOffset() {\n const data = this.data.value;\n let { dateTz, offset } = data;\n dateTz = dateTz.subtractValue({ minutes: ((typeof offset === 'string' && offset == '') || (typeof offset === 'undefined')) ? 0 : Number(offset) });\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...data,\n dateTz: dateTz,\n offset: 0,\n },\n })\n );\n }\n\n public goToBackRoute() {\n this.removeDateOffset();\n this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n public expandMap(open: boolean) {\n this.expandedLocation = open;\n }\n\n public expandAvailability(open: boolean) {\n this.fetchRooms(!this.mobile);\n this.expandedAvailability = open;\n }\n\n public handleClose() {\n this.expandedLocation = false;\n this.expandedAvailability = false;\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n this.fetchRooms(false);\n }\n\n /**\n * Continue to Booking Form\n */\n public bookRoom() {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n },\n })\n );\n\n const bookingRoute = this.data.value.id ? 'edit' : 'create';\n this.router.navigate(['/home', bookingRoute]);\n }\n\n public hideInfoBanner() {\n this.showInfoBanner = false;\n }\n}\n","
\n
\n \n \n
\n
\n \n

This room is not guaranteed until booking confirmation is received.

\n \n
\n
\n \n

This time slot is not available, drag or choose a diferent date or time.

\n
\n
\n
\n \n
\n
\n
\n {{ availabilityStatus | titlecase }} {{ occurenceAvailability }}\n
\n
\n

{{room?.local_name}}

{{data.value?.bookingType.display}}
\n \n
\n
\n \n Equipment\n
    \n
  • \n {{feature}}\n
  • \n
\n
\n
\n
\n \n Catering Available\n
    \n
  • {{catering}}
  • \n
  • (specified in the last booking step)
  • \n
\n
\n
\n
\n
\n
\n

Room Availability:

\n

{{dateString}}

\n \n
\n \n
\n
\n
\n

Room Location:

\n

{{room?.building?.name}}, {{room?.level?.name}}

\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n {{ open ? '(tap to close)' : '(tap to open)'}}\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Detail

\n
\n\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
\n
\n
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' :\n data?.value?.recurrence_period | titlecase}}\n -\n Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{dateString}}
\n
End date: {{endDateString}}
\n
Time: {{timeString}}
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n instantBookOptions,\n roomDetailsRequired,\n roomEquipmentRequiredOptions,\n selectFormFilters,\n selectIsInternal,\n roomCateringAvailable,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map,\n take\n} from 'rxjs/operators';\n\n@Component({\n selector: 'app-room-filters-form',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-form.component.scss']\n})\nexport class RoomFiltersFormComponent extends BaseDirective implements OnInit {\n\n public instantBookOptions = instantBookOptions;\n public roomEquipmentRequiredOptions = roomEquipmentRequiredOptions;\n public roomDetailsRequired = roomDetailsRequired;\n public roomCateringAvailable = roomCateringAvailable;\n public internalRoomTypeRequiredOptions = [];\n public externalRoomTypeRequiredOptions = [];\n public isInternal = false;\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n @Output()\n public cancelSubmit = new EventEmitter();\n\n @Output()\n public filtersSubmit = new EventEmitter[]>();\n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('bookingType',\n this.store.pipe(\n select(selectIsInternal)\n ).subscribe(next => {\n this.isInternal = next;\n }));\n this.subscription('filters',\n this.store.pipe(\n select(selectFormFilters)\n ).subscribe(next => {\n this.selectedOptions.next(next);\n }));\n\n this.externalRoomTypeRequiredOptions = this.getFilters('external_room_types')\n this.internalRoomTypeRequiredOptions = this.getFilters('internal_room_types')\n }\n\n public toggleOptionChecked(selectOption: SelectOption) {\n this.selectedOptions.pipe(\n take(1),\n map(options => {\n const found = options.find(o => o.value === selectOption.value);\n if (found) {\n // remove\n return options.filter(o => o.value !== selectOption.value);\n }\n // add\n return [...options, selectOption];\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n public submitFilters() {\n this.selectedOptions.pipe(\n take(1)\n ).subscribe(options => {\n this.filtersSubmit.emit(options);\n });\n }\n\n public getFilters(type:string) {\n const filters = this._org.getOrganizationFiltersByRoomType(type) || {}\n return Object.keys(filters).map((key) => {\n const display = filters[key]\n return {\n value: key,\n display,\n shortDisplay: display\n }\n })\n }\n}\n","import {\n Component,\n ViewChild\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { Store } from '@ngrx/store';\nimport { storeRoomFilters } from '@mckinsey-converge/data-common';\nimport { RoomFiltersFormComponent } from 'src/app/booking/room-filters-form/room-filters-form.component';\n\n@Component({\n selector: 'app-room-filters',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-modal.component.scss']\n})\nexport class RoomFiltersModalComponent {\n\n @ViewChild(RoomFiltersFormComponent)\n public form: RoomFiltersFormComponent;\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n\n public submitFilters(filters: SelectOption[]) {\n this.store.dispatch(storeRoomFilters({\n payload: filters\n }));\n this.close();\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n OnChanges,\n EventEmitter,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n combineLatest,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n CENTER_POINT,\n generateMapStyleForSpace,\n legendOptions,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n spaceToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n SpaceStatus,\n selectMapFilteredResults,\n FilteredSpaces\n} from '@mckinsey-converge/data-common';\nimport {\n Point,\n HashMap,\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport { MapSearchStoreState } from '../../map/map-search/map-search.component';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\n@Component({\n selector: 'room-location-preview',\n template: `\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n {{building.name}}, {{level.name}}\n
\n \n
\n
The pinpoint indicates your selected room's location on the floor. No futher interaction is available.
\n \n
\n
\n \n
\n \n \n
\n \n
\n
\n\n\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./room-location-preview.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomLocationPreviewComponent extends BaseDirective implements OnInit, OnChanges {\n public legendOptions = legendOptions();\n\n @Input()\n public mapUrl: string;\n\n @Input()\n public focus: any; // @todo fix\n\n @Input()\n public expanded: boolean;\n\n @Input()\n public building: Building;\n\n @Input()\n public space: Space;\n\n @Input()\n public level: any; // @todo fix\n\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n\n // Use \"booking_preview\" to show smaller height with zoom icon\n @Input() public viewMode: String = null;\n\n @Output()\n public handleExpand: EventEmitter = new EventEmitter();\n\n public currentPage: string;\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get zoomLevel() {\n return this.expanded ? this.minZoom.value : this.zoom.value;\n }\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService) {\n super();\n }\n\n public focusedRoom = new BehaviorSubject(undefined);\n public featuresRoom = new BehaviorSubject(undefined);\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public minZoom = new BehaviorSubject(MAX_ZOOM_LEVEL / 3);\n public features = combineLatest([this.featuresRoom]).pipe(map(items => items.filter(i => !!i)));\n public setIntervalHandle: any = null;\n public count = 0;\n public center = new BehaviorSubject(CENTER_POINT);\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n public ngOnChanges(changes: any): void {\n if (changes.expanded && changes.expanded.currentValue) {\n this.activeSpace.pipe(\n take(1),\n filterUndefined(),\n map(spaceToMapFeature)\n ).subscribe(next => {\n this.featuresRoom.next(next);\n });\n } else if (changes.expanded && changes.expanded.previousValue && !changes.expanded.currentValue) {\n this.featuresRoom.next(undefined);\n }\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n\n // MCK-1850 And it's even slower when loading form scratch via an email link, so 10 second interval.\n this.timeout('Zoom to Room', () => this.initMapZoom(), 2000);\n this.activeSpace.next(this.space);\n this.activeBuilding.next(this.building);\n this.activeLevel.next(this.level);\n\n this.subscription('bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined())\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || [])\n .filter(s => !!s.map_id && s.zones.includes(building.id) && s.zones.includes(level.id));\n\n const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach(space => {\n // const status = filteredSpaces.statusMap[space.id] || SpaceStatus.Available;\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // });\n this.style_map.next(styles);\n \n })\n );\n\n }\n\n public initMapZoom() {\n const self = this;\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n // But this alone is not enough when loading from an email link due to how slow the loading is. See the ngOnInit\n this.setIntervalHandle = setInterval(() => {\n if (!this.focus) {\n return;\n }\n \n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 1000);\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public zoomToRoom(): void {\n this.focusedRoom.next(this.focus);\n this.zoom.next(MAX_ZOOM_LEVEL);\n }\n\n public zoomIn() {\n if (this.minZoom.value < MAX_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.minZoom.value > MIN_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value - 1);\n }\n }\n\n public resetZoomLevels() {\n this.minZoom.next(MIN_ZOOM_LEVEL);\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n const self = this;\n self.count = 0;\n\n this.zoom.next(MAX_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n this.setIntervalHandle = setInterval(() => {\n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 200);\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent,\n {\n data: this.building,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport { ApplicationService, BookingFormData, RoomResultsViewModel, setupRoomImages, User } from '@mckinsey-converge/data-common';\nimport { ImageDirective, SpaceImageObject } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-room-result-item',\n template: `\n
\n
\n
\n
\n {{ availability === 'requestable' ? 'Requestable' : 'Bookable'}}\n {{ viewModel?.space?.availableOccurrences }} out of {{ viewModel?.space?.totalOccurrences }} \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n
\n \n {{viewModel.levelDisplay}}, {{viewModel.title}}\n {{type}}\n {{viewModel.office}}\n {{viewModel.capacity}}\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-result-item.component.scss']\n})\nexport class RoomResultItemComponent extends ImageDirective implements OnInit, OnChanges {\n\n public rootFolderURL: string = 'assets/img/rooms/';\n public fileSlug: string = '';\n public type: string = '';\n\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: RoomResultsViewModel | undefined;\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public user: User;\n\n @Output()\n public roomSelect = new EventEmitter();\n\n public availability: \"requestable\" | \"bookable\" | \"booked\" | \"non-bookable\" | null;\n\n public foundImages: SpaceImageObject[] = [1,2].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n constructor(\n private _appService: ApplicationService) {\n super();\n }\n\n public ngOnInit(): void {\n if (this.viewModel && this.viewModel.space) {\n this.fileSlug = this.viewModel.space.email.split('@')[0];\n setupRoomImages(this, [1,2], this.rootFolderURL, this.fileSlug);\n const t = this.viewModel.space.internal_or_external;// || 'internal';\n this.type = `${t[0]?.toUpperCase()}${t.toLocaleLowerCase().substring(1)}`\n\n // Set the viewing space in the app service so that the staff result page can receive event on loading previously selected room card \n // which will help to scroll to the selected room\n if(this.viewModel.space.id === this.data.selectedRoom?.space?.id) {\n this._appService.set('STAFF.result.card.viewing', this.viewModel.space.id);\n }\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (this.availability !== null && (\n changes.data &&\n changes.data.firstChange === true &&\n changes.data.currentValue &&\n changes.data.currentValue.dateTz &&\n changes.data.currentValue.duration\n )) {\n this.availability = this.viewModel.space.byRequest({\n dateTz: this.data.dateTz,\n duration: this.data.duration,\n host: this.user\n }) === false ? \"bookable\" : \"requestable\";\n\n }\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public get typeClass() {\n return this.type.toLocaleLowerCase();\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n }\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n NgZone,\n OnInit,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable\n} from 'rxjs';\nimport {\n RoomResultsViewModel,\n BookingFormData,\n BookingStoreState,\n selectActiveForm,\n storeBookingFormData,\n SpaceFilterReason,\n User,\n OrganisationService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n map,\n take,\n distinctUntilChanged\n} from 'rxjs/operators';\nimport {\n AlertBannerDisplay,\n AlertMode,\n BaseTemplateComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n\t\tOverrideChangesModalComponent\n} from '@mckinsey-converge/ui';\nimport { RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n RoomStoreState\n} from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-room-results-paginated',\n template: `\n \n
\n
\n \n \n \n \n \n \n \n \n \n\n
\n \n
\n
\n \n \n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-results-paginated.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RoomResultsPaginatedComponent extends BaseTemplateComponent implements OnInit {\n public ROOM_DISPLAY_STEP = 10;\n public ROOM_DISPLAY_START = 3;\n public AlertMode = AlertMode;\n public AlertBannerDisplay = AlertBannerDisplay;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n @Input()\n public viewModels: Observable;\n\n @Input()\n public coachMark: Observable | undefined;\n\n /**\n * If true, show skeleton.\n */\n @Input()\n public isLoading: Observable;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay = false;\n\n @Input() public expanded_section_ids: string[] = [];\n @Input() public headerTitle: string = '';\n\n public displayCount = new BehaviorSubject(this.ROOM_DISPLAY_START);\n\n /**\n * Fake pagination since API does not support it.\n */\n public displayViewModels: Observable;\n\n public showLoadMore: Observable;\n\n public remainingResults: Observable;\n\n public data = new BehaviorSubject(undefined);\n public currentUser: User;\n noOfResultLoaded: number;\n\n constructor(vcRef: ViewContainerRef,\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _appService: ApplicationService,\n private cdRef: ChangeDetectorRef,\n private _dialog: MatDialog) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n //test commet for to trigger build again\n this.displayViewModels = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => { this.cdRef.markForCheck(); return vm?.slice(0, displayCount) } ));\n\n this.showLoadMore = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => {\n return ((vm?.length ?? 0) > displayCount);\n })\n );\n this.remainingResults = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => vm && (vm.length - displayCount) || 0));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.data.next(next);\n this.cdRef.detectChanges();\n\n }\n }));\n\n\n\n // Load more results if the section is expanded previously and the data is loaded \n const shouldLoadMore = this.data?.value?.expanded_section_ids?.includes(this?.headerTitle?.split('(')[0].split(' ').join('_'));\n if( this.showLoadMore && this?.data?.value?.resultLoaded && shouldLoadMore) {\n this.loadMore();\n } \n \n // Scroll to the selected room card if the user has selected a room from section previously \n this.subscription(\n 'viewing',\n this._appService\n ?.listen('STAFF.result.card.viewing')\n ?.subscribe((event) => {\n // Scroll to the selected room card \n if(event === this.data?.value?.selectedRoom?.space.id) {\n const spaceId = this.data?.value?.selectedRoom?.space.id;\n document.querySelectorAll(`[space-name=\"${spaceId}\"]`)[0].scrollIntoView();\n }\n \n })\n );\n\n this.cdRef.detectChanges();\n }\n\n public loadMore(isDom: boolean = false) {\n // fake pagination\n const previouslyLoadedCount = this.data.value.resultLoaded || 0; // previously loaded results count\n this.displayCount.pipe(\n take(1),\n // if the data is loaded from the dom then do not reset the count to previously loaded count\n map(v => (previouslyLoadedCount && !isDom) ? previouslyLoadedCount : v + this.ROOM_DISPLAY_STEP)\n ).subscribe(next => {\n this.displayCount.next(next);\n this.noOfResultLoaded = next;\n this.cdRef.detectChanges();\n });\n }\n\n\n public trackViewModelById(index: number, item: RoomResultsViewModel) {\n return item.space.id;\n }\n\n\n\t\t/**\n\t\t * Handles the selection of a room from the search results.\n\t\t * Depending on the room's availability and recurrence conflicts, this function decides\n\t\t * whether to open a modal for recurrence conflicts, override changes, or navigate to the\n\t\t * room details page. It updates the state and user interface accordingly.\n\t\t *\n\t\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t\t * @param {number} availableOccurrences - The number of available occurrences of the room.\n\t\t * @param {number} totalOccurrences - The total number of occurrences of the room.\n\t\t */\n public roomSelected(room: RoomResultsViewModel, availableOccurrences: number, totalOccurrences: number) {\n\n const { is_recurrent } = this.data.value;\n this.data.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.data.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\t\t// Determine the action based on recurrence conflicts, occurrence edits, and room availability\n\t\tif(this.data.value.recurrence_exceptions.length) {\n this.openRecurrenceConflictsModal(room);\t// Open modal for recurrence conflicts\n }\n else if( this.data.value.occurrence_edits && this.data.value.occurrence_edits.length) {\n this.overrideChanges(room);\t// Open modal to override changes\n }\n else {\n this.goToRoomDetail(room);\t// Navigate to the room details page\n }\n\n }\n\n /**\n * Navigates to the room details page for the selected room.\n * It updates the URL and navigates to the room details page with appropriate query parameters.\n *\n * @param {RoomResultsViewModel} room - The selected room from the search results.\n *\n * @remarks\n * The function manages timezone offset and other necessary details to provide accurate room information.\n * The state object is used to pass relevant data for correct page rendering and form population.\n *\n * @private\n */\n private goToRoomDetail(room) {\n this.cdRef.detectChanges();\n\t\t\t// Handle timezone offset for accurate date and time information\n let { dateTz } = this.data.value;\n if (this.offset) {\n dateTz = dateTz.addValue({ minutes: this.offset });\n }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.data.value.booking.room is not and does not contain the timezone\n * this.data.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.data.value,\n buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: this.offset,\n selectedRoom: room,\n nextBusinessDay: this.nextBusinessDay,\n expanded_section_ids: this.expanded_section_ids,\n resultLoaded: this?.expanded_section_ids?.length ? this.noOfResultLoaded : 0\n }\n }});\n }\n\n\n /**\n\t * Opens a modal to display recurrence conflicts for the selected room.\n\t * It shows recurrence conflicts, allowing the user to resolve them before proceeding.\n\t * After the modal is closed, it navigates to the room details page if there are no unresolved conflicts.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private openRecurrenceConflictsModal(room: RoomResultsViewModel) {\n let { recurrence_exceptions } = this.data.value;\n\n\t\t// Open modal for recurrence conflicts\n const recurr_ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.space.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n\n\t\t\t\tif (event.reason === 'done' && !(this.data.value.occurrence_edits && !this.data.value.occurrence_edits.length) ) {\n this.goToRoomDetail(room); \t// Navigate to room details page after resolving conflicts\n\t\t\t\t}\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t/**\n\t * Opens a modal to allow the user to override changes made to the booking.\n\t * It provides options to confirm or cancel the override, depending on user preference.\n\t * After the modal is closed, it navigates to the room details page if the user confirms the override.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private overrideChanges(room: RoomResultsViewModel) {\n\t\t// Open modal for overriding changes made to the booking\n const ref = this._dialog.open(OverrideChangesModalComponent, {\n width: '576px',\n data: {\n edits: this.data.value.occurrence_edits,\n timezone: this.data.value.timezone\n }\n });\n ref.componentInstance.event.subscribe(event => {\n if (event.reason === 'done') {\n this.goToRoomDetail(room);\t// Navigate to room details page after confirming the override\n ref.close();\n } else if (event.reason === 'close') {\n ref.close();\n }\n });\n }\n\n\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, Observable, of, Subject } from 'rxjs';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { distinctUntilChanged, filter, map } from 'rxjs/operators';\nimport { BookingRulesLink, RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n Building,\n BuildingLevel,\n mapResultsToViewModels,\n RoomResultsViewModel,\n FilteredSpaces,\n SpaceFilterReason,\n selectActiveForm,\n BookingStoreState,\n BookingFormData,\n OrganisationService,\n storeBookingFormData,\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { select, Store } from '@ngrx/store';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n\n@Component({\n selector: 'app-room-results-section',\n template: `\n
\n \n
\n\n \n \n \n\n \n \n \n \n `,\n styleUrls: ['./room-results-section.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class RoomResultsSectionComponent extends BaseDirective implements OnInit {\n @Input() public rules_link?: BookingRulesLink;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay : boolean = false\n\n @Input()\n public collapsable: boolean;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseTitle: string;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseDescription: string;\n\n @Input()\n public levelBuildings: Observable<{ flattenedLevels: BuildingLevel[]; buildings: Building[] }>;\n\n @Input()\n public results: BehaviorSubject>;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n public mainResultViewModels = new BehaviorSubject(\n undefined\n );\n\n public editing_form = new BehaviorSubject(false);\n\n public resultsLoading: Observable;\n public coachMarkDisplay: Observable;\n\n public AlternateBuildings = [];\n public location: any;\n\n public activeForm: BookingFormData; // active form data\n public expanded_section_ids: string[] = []; // expanded section ids\n\n\n private subscribeResultsToViewModels = (\n subName: string,\n resultsObservable: Observable>,\n flattenLevelBuildings: Observable<{ flattenedLevels: any; buildings: Building[] }>,\n viewModelSubject: Subject\n ) => {\n this.subscription(\n subName,\n combineLatest([\n resultsObservable.pipe(map((r) => r.optionalSuccess?.spaces || [])),\n flattenLevelBuildings,\n ])\n .pipe(\n map(([results, { flattenedLevels, buildings }]) =>\n mapResultsToViewModels(\n results?.length && results[0]?.building ? results : [],\n flattenedLevels,\n buildings\n )\n )\n )\n .subscribe((next) => {\n viewModelSubject.next(next);\n })\n );\n };\n \n \n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.resultsLoading = this.results.pipe(map((m) => m.isLoading));\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.location = next.location;\n this.updateCoachMark();\n this.activeForm = next;\n } else {\n }\n })\n );\n\n this.subscription(\n 'buildings',\n this._org.listen('buildings').subscribe(() => {\n this.updateCoachMark();\n })\n );\n\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n\n // Update opened section id and send it to child component\n private updateSectionIdOnOpen (event: { status: string; id: string }) {\n // if status is opened, then push to the expanded_section_ids in the store otherwise remove from the store\n if (event.status === 'opened') {\n const ids = this.activeForm?.expanded_section_ids ? this.activeForm?.expanded_section_ids : [];\n // Remove duplicates and add the new id to the list \n this.activeForm.expanded_section_ids = Array.from(new Set([...ids, event.id]));\n \n } else if (event.status === 'closed'){\n // Remove the id from the list \n this.activeForm.expanded_section_ids = this.activeForm?.expanded_section_ids.filter(\n (id) => id !== event.id\n )\n }\n }\n \n\n updateCoachMark() {\n const buildingsInSameCity = this._org.buildings?.filter(_ => {\n // Make sure this.location is populated to pass unit tests -\n if (!this.location || this.location.length === 0) return false;\n // If all offices are selected, city name will be at this.location[0]?.meta?.city.name, otherwise use this.location[0]?.meta?.city \n const cityFromLocation = typeof this.location[0]?.meta?.city === 'object' && this.location[0]?.meta?.city !== null\n ? this.location[0]?.meta?.city.name\n : this.location[0]?.meta?.city;\n return _.city === cityFromLocation;\n });\n const AlternateBuildings = buildingsInSameCity?.filter(\n (building) =>\n !this.location.some(\n (locationItem) => locationItem.meta?.building?.id === building.id\n )\n );\n this.AlternateBuildings = AlternateBuildings;\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.results || changes.levelBuildings || changes.mainResultViewModels) {\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n this.coachMarkAction.emit(reason);\n }\n}\n","import { SpaceFilterReason } from '@mckinsey-converge/data-common';\n\nexport interface BookingRulesLink {\n name: string;\n url: string;\n}\nexport class RoomResultsCoachmarkViewmodel {\n public visible: boolean;\n public title: string;\n public actionButtonText: string;\n\n constructor(public reason: SpaceFilterReason, public rules_link?: BookingRulesLink, alternateBuildings?:any[]) {\n this.visible = true;\n switch (reason) {\n case SpaceFilterReason.DateTime:\n this.title =\n 'There are no available rooms that match your search criteria. ' +\n 'Please adjust your search criteria and try again.';\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.OfficeRules:\n this.title =\n `There are no available rooms that match your search criteria.\n Please adjust your search criteria and try again.`;\n if (alternateBuildings && alternateBuildings.length > 0) {\n this.title += ` Alternatively, you can try ${alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n }\n if (rules_link) {\n this.title +=\n `
For information on booking rules please see ` +\n `${rules_link.name}`;\n }\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.Filters:\n this.title =\n 'No rooms available for your filter criteria. ' +\n 'Try to clear the filter please.';\n this.actionButtonText = 'Clear filter';\n break;\n case SpaceFilterReason.AlternateBuildingsFound:\n this.title = `There are no available rooms that match your search criteria. Please try ${\n alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.None:\n this.visible = false;\n this.title = '';\n this.actionButtonText = '';\n break;\n }\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n laterThatDayFromDateTz,\n loadRoomsWithQuery,\n RoomStoreState,\n mapRoomToSelectOption,\n loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { BaseDirective, timeWithZoneFormatString } from '@mckinsey-converge/base';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport {\n Building,\n BuildingLevel,\n flattenBuildingsWithLevels,\n BookingStoreState,\n FilteredSpaces,\n SpaceFilterReason,\n clearRoomFilters,\n selectActiveForm,\n selectFilteredLaterDayResults,\n selectFilteredNextDayResults,\n selectFilteredResults,\n selectFormFilters,\n BookingFormData,\n roomFormDataToQuery,\n selectFilteredDiffSizeResults,\n OrganisationService,\n CollapseService\n} from '@mckinsey-converge/data-common';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { debounceTime, distinctUntilChanged, filter, map, shareReplay } from 'rxjs/operators';\nimport {\n buildingStateSelector,\n BuildingStoreState,\n loadBuildings,\n} from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport { filterUndefined, resultCountObservable } from '@mckinsey-converge/rx-utils';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { RoomBookingModalComponent } from 'src/app/booking/room-booking-modal/room-booking-modal.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\nimport {\n BookingRulesLink,\n RoomResultsCoachmarkViewmodel,\n} from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { FormControl } from '@angular/forms';\nimport { Location } from '@angular/common';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-room-results',\n template: `\n \n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n {{ open ? '(tap to close)' : '(tap to open)' }}\n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n `,\n styleUrls: ['./room-results.component.scss'],\n animations: [\n trigger('collapseHeight', [\n state(\n 'open',\n style({\n height: '*',\n opacity: 1,\n })\n ),\n state(\n 'closed',\n style({\n overflow: 'hidden',\n opacity: 0,\n height: '0px',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n trigger('expandWidth', [\n state(\n 'open',\n style({\n maxWidth: '1024px',\n })\n ),\n state(\n 'closed',\n style({\n maxWidth: '96%',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class RoomResultsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public day_offset = 1;\n\n public data = new BehaviorSubject(undefined);\n public filters = new BehaviorSubject[]>([]);\n\n public mainResults = new BehaviorSubject>(LoadingModel.empty());\n public mainResultsFiltered = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public laterThatDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public nextBusinessDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public diffSizeResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public mainResultsSpaces: SelectOption[];\n\n public laterThatDayDisplay = new BehaviorSubject(undefined);\n\n public mainCoachMarkDisplay = this.mainResults.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map((r) => new RoomResultsCoachmarkViewmodel(r, this.rules_link))\n );\n\n public rules_link?: BookingRulesLink;\n\n public mainResultsCount = resultCountObservable(\n this.mainResultsFiltered,\n this.mainResultsFiltered.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public laterThatDayCount = resultCountObservable(\n this.laterThatDayResults,\n this.laterThatDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public nextBusinessDayCount = resultCountObservable(\n this.nextBusinessDayResults,\n this.nextBusinessDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public diffSizeCount = resultCountObservable(\n this.diffSizeResults,\n this.diffSizeResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n\n public selectedToggle = new BehaviorSubject(0);\n\n public flattenLevelBuildings: Observable<{\n flattenedLevels: BuildingLevel[];\n buildings: Building[];\n }>;\n\n public open: boolean = true;\n public editing_form = new BehaviorSubject(false);\n\n public spaceControl = new FormControl();\n\n public selectedSpace: SelectOption;\n public resetInput: number;\n\n public searchStringPresent = false;\n public payload: any = {\n payload: { name: 'test', id: 'test-id' },\n building: {},\n floorMap: true,\n };\n\n public isOpen = true;\n\n public toggle() {\n this.isOpen = !this.isOpen;\n }\n\n constructor(\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private dialog: MatDialog,\n private _org: OrganisationService,\n private location: Location,\n private collapseService: CollapseService\n ) {\n super();\n this.payload = location.getState();\n }\n\n public ngOnInit(): void {\n this.subscription(\n 'filters',\n this.store.pipe(select(selectFormFilters), distinctUntilChanged()).subscribe((next) => {\n return this.filters.next(next);\n })\n );\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n const day = next.dateTz.dateWeekday - 1;\n this.day_offset = day >= 4 ? 7 - day : 1;\n const building = this._org.buildings.find(\n (_) => _.id === next.location[0]?.meta?.building?.id\n );\n this.rules_link =\n building?.setting('booking.rules_link') ||\n next.location.find(\n office => office?.meta?.building?._settings?.discovery_info?.booking?.rules_link\n )?.meta?.building?._settings?.discovery_info?.booking?.rules_link;\n // next.location[0]?.meta?.building?.settings?.discovery_info?.booking\n // ?.rules_link;\n const nday = laterThatDayFromDateTz(next.dateTz);\n this.laterThatDayDisplay.next(`at ${timeWithZoneFormatString(nday)}`);\n // this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(next)));\n this.data.next(next);\n \n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n\n // this.data.next(next);\n } else {\n // no form data, likely visiting directly. navigate back to start\n this.router.navigate(['../'], {\n replaceUrl: true,\n relativeTo: this.route,\n });\n }\n })\n );\n\n this.subscription(\n 'results',\n this.store.pipe(select(selectFilteredResults)).subscribe((next) => {\n this.mainResults.next(next);\n this.mainResultsFiltered.next(next);\n // Populate results for Search\n this.mainResultsSpaces = next.success?.spaces\n ? next.success?.spaces?.map(mapRoomToSelectOption)\n : [];\n })\n );\n\n this.subscription(\n 'laterResults',\n this.store.pipe(select(selectFilteredLaterDayResults)).subscribe((next) => {\n this.laterThatDayResults.next(next);\n })\n );\n\n this.subscription(\n 'nextDayResults',\n this.store.pipe(select(selectFilteredNextDayResults)).subscribe((next) => {\n this.nextBusinessDayResults.next(next);\n })\n );\n\n this.subscription(\n 'diffSize',\n this.store.pipe(select(selectFilteredDiffSizeResults)).subscribe((next) => {\n this.diffSizeResults.next(next);\n })\n );\n\n this.flattenLevelBuildings = this.store.pipe(\n select(buildingStateSelector),\n select(loadBuildings.selectors.optionalSuccess),\n filterUndefined(),\n map(flattenBuildingsWithLevels),\n shareReplay(1)\n );\n\n this.subscription(\n 'spaceChanges',\n this.spaceControl.valueChanges.subscribe((value) => {\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults.value.success?.spaces?.filter((s) => {\n if (s.id === value.value) {\n return true;\n }\n return false;\n });\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n })\n );\n\n // if coming from kiosk map url, route there\n if (this.payload?.floorMap) {\n this.router.navigate([`../home/floor-map`], {\n state: { ...this.payload },\n queryParams: {\n display: '',\n },\n });\n }\n\n this.subscription(\n 'spaceChanges',\n this.selectedToggle.subscribe((value) => {\n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n })\n );\n }\n\n /**\n * Dispatches actions to load rooms based on the provided value.\n * @param {number} value - The value indicating the mode of operation.\n * 0: Load rooms for regular view.\n * 1: Load rooms for results map view.\n */\n public despatchLoadRooms() {\n const selectedMenuIndex = this.selectedToggle.value; // List/Map/Calendar\n const isForFloorMap = this.payload?.floorMap;\n // If value is 0 and floorMap is not present in payload\n if(selectedMenuIndex === 0 && !isForFloorMap) {\n // Dispatch action to load rooms with query generated from form data\n this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(this.data.value)));\n }\n \n // If value is 1 or floorMap is present in payload\n if(selectedMenuIndex === 1 || isForFloorMap) {\n // Dispatch action to load rooms for results map view with query generated from form data\n this.store.dispatch( loadRoomsForResultsMap.request(roomFormDataToQuery(this.data.value)));\n }\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n const mainResults = cloneDeep(this.mainResults.value);\n this.mainResultsFiltered.next(mainResults);\n this.searchStringPresent = false;\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n\n public changeInput(event) {\n if (event) {\n this.clearRoomSearch();\n }\n }\n\n public filteredRoomsChange(event: SelectOption[]) {\n const roomIds = event.map((o) => o.value);\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults?.value?.success?.spaces\n ? this.mainResults?.value?.success?.spaces?.filter((s) => {\n if (roomIds.includes(s.id)) {\n return true;\n }\n return false;\n })\n : [];\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n }\n\n public changeSearchResults() {\n this.editing_form.next(true);\n const dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n dialog_ref.afterClosed().subscribe(() => {\n this.editing_form.next(false);\n this.collapseService.collapsePanel();\n });\n }\n\n public filterResults() {\n this.dialog.open(RoomFiltersModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n switch (reason) {\n case SpaceFilterReason.Filters:\n this.store.dispatch(clearRoomFilters());\n break;\n case SpaceFilterReason.OfficeRules:\n case SpaceFilterReason.DateTime:\n this.changeSearchResults();\n break;\n }\n }\n\n public selectedToggleChange(event: SelectOption) {\n this.selectedToggle.next(event.value);\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n humaniseDuration,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n weekDayMonthYearFormat\n} from '@mckinsey-converge/base';\nimport {\n truncateLocationList,\n BookingFormData,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\nimport { Store } from '@ngrx/store';\nimport { clearRoomFilters } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'app-searched-location',\n template: `\n
\n
\n {{name}}\n {{date}}\n {{timing}}\n {{types}}\n No filters applied\n Filtering unavailable for this view\n {{filterDisplay}}\n
\n \n
\n `,\n styleUrls: ['./searched-location.component.scss']\n})\nexport class SearchedLocationComponent implements OnInit, OnChanges {\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public filters: SelectOption[] = [];\n\n @Output()\n public changeClick = new EventEmitter();\n\n @Output()\n public filterClick = new EventEmitter();\n\n @Input()\n public canFilter = true;\n\n public name = '';\n public date = '';\n public timing = '';\n public types = '';\n public filterDisplay = '';\n public filterCount = '';\n\n constructor(private store: Store) {}\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.data || changes.filters) {\n this.computeDisplay();\n }\n }\n\n public ngOnInit(): void {\n this.computeDisplay();\n }\n\n\n public computeDisplay() {\n if (!this.data) {\n return;\n }\n const { duration, dateTz, location, roomSize, bookingType, is_recurrent, recurrence_endTz } = this.data;\n\n \n // this.requestedEndDateTz = new DateTZ({ date: endDate.date.valueOf(), is_local_tz, building_tz })\n\n const group = location.find(l => l.groupHeader);\n if (group) {\n this.name = group.shortDisplay;\n } else {\n this.name = truncateLocationList(location);\n }\n\n // R--- blocked until TZ booking form inputs\n const building_tz = location[0]?.meta?.building?.timezone || location[0]?.meta?.city?.timezone;\n const startDate = new DateTZ({date: dateTz.ms, is_local_tz: false, building_tz })\n\n if(is_recurrent) {\n const occEndDate = getLastDateFromList( this?.data?.recurrence_starts );\n \tconst endRecDate = new DateTZ({date: occEndDate.ms, is_local_tz: false, building_tz });\n this.date = `From ${weekDayMonthYearFormat(startDate)} until ${weekDayMonthYearFormat(endRecDate)}` ;\n }\n else {\n this.date = weekDayMonthYearFormat(startDate);\n }\n\n const startDisplay = startDate.formatDate(`${timeFormatString()}`).toLocaleLowerCase();\n const endDate = startDate.addValue({ minutes: duration });\n const endDisplay = timeWithGmtOffsetFormatString(endDate);\n this.timing = `${startDisplay}-${endDisplay}`; // - TODO correct for DST?\n\n const durationDisplay = humaniseDuration(duration, 'short');\n this.types = `${durationDisplay}, ${bookingType.display}, ${roomSize.display}`;\n\n this.filterDisplay = this.filters.map(f => f.shortDisplay).join(', ');\n this.filterCount = this.filters.length > 0 ? `(${this.filters.length})` : '';\n }\n\n public clearAllFilters() {\n this.store.dispatch(clearRoomFilters());\n } \n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-footer-menu',\n templateUrl: './footer-menu.component.html',\n styleUrls: ['./footer-menu.component.scss']\n})\nexport class FooterMenuComponent extends BaseDirective implements OnInit {\n\n /** Tiles to display on the home page */\n public tiles: ApplicationLink[] = [];\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Angular Component initialisation lifecycle hook */\n public ngOnInit(): void {\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.tiles = this._service.setting('app.home.tiles') || [];\n });\n }\n}\n","\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Building,\n BuildingLevel,\n OrganisationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-map-controls',\n templateUrl: './map-controls.component.html',\n styleUrls: ['./map-controls.component.scss']\n})\nexport class MapControlsComponent extends BaseDirective implements OnInit {\n /** ID of the active building */\n @Input() public building: string;\n /** ID of the active level */\n @Input() public level: string;\n /** Emitter for changes to the active level */\n @Output() public levelChange = new EventEmitter();\n /** Details of the active building */\n public building_details: Building = this._org.building;\n /** List of available buildings */\n public building_list: Building[] = [];\n /** List of available levels */\n public level_list: readonly BuildingLevel[] = [];\n\n public get can_select_building(): boolean {\n return !!this._service.setting('app.explore.can_select_building');\n }\n\n constructor(\n private _route: ActivatedRoute,\n private _router: Router,\n private _service: ApplicationService,\n private _org: OrganisationService\n ) {\n super();\n }\n\n public ngOnInit() {\n this._org.listen('buildings').pipe(first(_ => !!_ && !!_.length)).subscribe(() => {\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe(params => {\n /* istanbul ignore else */\n if (params.has('level')) {\n const level_id = params.get('level');\n const level = this._org.levelWithID(level_id);\n this.level = level.id;\n this.setBuilding(level.building_id);\n this.levelChange.emit(this.level);\n this.clearTimeout('check_building');\n }\n })\n );\n this.building_list = this._org.buildings;\n this.timeout('check_building', () => {\n /* istanbul ignore else */\n if (!this.building) {\n this.setBuilding(this._org.building.id);\n }\n this.levelChange.emit(this.level);\n });\n });\n }\n\n public setBuilding(bld_id: string) {\n const building = this._org.buildings.find(bld => bld.id === bld_id);\n /* istanbul ignore else */\n if (building) {\n this.building_details = building;\n this.building = bld_id;\n this._org.building = building;\n this.level_list = building.levels;\n /* istanbul ignore else */\n if (this.level_list.length && !this.level_list.find(lvl => lvl.id === this.level)) {\n this.updateLevel(this.level_list[0].id);\n }\n }\n }\n\n public updateLevel(lvl_id: string) {\n this.level = lvl_id;\n this.levelChange.emit(this.level);\n this._router.navigate([], {\n relativeTo: this._route,\n queryParams: { level: lvl_id }\n });\n }\n}\n","
\n 1\"\n >\n \n {{ building_details?.code }} - {{ building_details?.name }} \n \n
\n
{{ bld.code }}
\n
{{ bld.name }}
\n
{{ bld.address }}
\n
\n
\n
\n \n \n \n \n {{ level.name }}\n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'a-overlay-menu',\n templateUrl: './overlay-menu.component.html',\n styleUrls: ['./overlay-menu.component.scss']\n})\nexport class OverlayMenuComponent extends BaseDirective {\n /** Whether to show the menu */\n @Input() public show: boolean;\n /** Emitter for changes to show */\n @Output() public showChange = new EventEmitter();\n\n /** List of links to display on the menu */\n public get menu_items(): ApplicationLink[] {\n const settings = this._service.setting('app.general.menu') || { items: [] };\n return settings.items || [];\n }\n\n /** Copyright details for the application */\n public get copyright(): string {\n return (this._service.setting('app.general.menu') || {}).copyright || '';\n }\n\n public get settings() {\n const settings = this._service.setting('app.general.menu') || { position: '' };\n return settings;\n }\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Current year to display for copyright */\n public get year(): number {\n return DateNow(new Date()).dateYear;\n }\n\n /** Close the overlay menu */\n public close() {\n this.show = false;\n this.showChange.emit(this.show);\n }\n\n public delayedClose() {\n this.timeout('close', () => this.close(), 50);\n }\n\n public cancelClose() {\n this.timeout('cancel_close', () => this.clearTimeout('close'), 10);\n }\n}\n","\n
\n
\n
\n \n
\n
\n \n
\n
\n Copyright © {{ year }} {{ copyright }}\n
\n
\n\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { ImageDirective } from '@mckinsey-converge/base';\nimport { setupRoomImages } from '@mckinsey-converge/data-common';\nimport { SpaceImageObject } from 'libs/base/src/lib/types.utilities'\n\n@Component({\n selector: 'mck-responsive-inline-images',\n template: `\n
\n
\n \n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n
\n
\n `,\n styleUrls: ['./responsive-inline-images.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ResponsiveInlineImagesComponent extends ImageDirective implements OnInit {\n\n /** Input array of images */\n @Input() public rootFolderURL: string;\n @Input() public fileSlug: string;\n\n /** Ignore this param, it's only use is to bypass the image onload event in testing */\n @Input() public imagesLoaded: boolean;\n public loadImages = new BehaviorSubject([]);\n\n public foundImages: SpaceImageObject[] = [1,2,3].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n public mobile = false;\n\n constructor(private cdRef: ChangeDetectorRef,) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 768;\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n next: val => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n }\n })).subscribe();\n setupRoomImages(this, [1,2,3], this.rootFolderURL, this.fileSlug, this.imagesLoaded);\n this.subscription(\n\t\t\t\t\t\t'found_images',\n\t\t\t\t\t\tthis.loadImages.subscribe((imgArr: SpaceImageObject[]) => {\n\t\t\t\t\t\t\tif(imgArr.length) this.foundImages = imgArr;\n\t\t\t\t\t\t\tthis.cdRef.detectChanges();\n\t\t\t\t\t\t}));\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n } \n\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n MatDialogRef,\n MAT_DIALOG_DATA\n} from '@angular/material/dialog';\nimport {\n BaseClass\n} from '@mckinsey-converge/base';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'a-survey-modal',\n templateUrl: './survey-modal.component.html',\n styleUrls: ['./survey-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SurveyModalComponent extends BaseClass implements OnInit {\n constructor(\n @Inject(MAT_DIALOG_DATA) public _data: any,\n private _composer: ComposerService,\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n /* present experience question by default */\n public token = '';\n public phase = 'intro';\n public baseUrl = '';\n\n public questions = {\n created_at: 0,\n updated_at: 0,\n header_question: \"What went wrong?\",\n header_subtext: \"Select one or several options\",\n options: [],\n id: \"\"\n }\n\n public answers = {\n questions_id: \"\",\n positive: true, // Experience is positive until the questions are displayed\n option_responses: [],\n comments: \"\"\n };\n\n // Show the questions and mark the experience negative. (false positive)\n public showQuestions(): void {\n this.answers.positive = false;\n this.phase = 'questions';\n }\n\n public ngOnInit(): void {\n /* fetch the question options once composer is initialized */\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n const token = this._composer.auth.token;\n this.token = token;\n this.baseUrl = this._composer.auth.api_endpoint.replace(this._composer.auth.route, '/api/staff/feedback')\n this.getFeedbackQuestionsFromApi(token, this._data)\n });\n }\n\n public getFeedbackQuestionsFromApi(token: string, questionID: string) {\n new Promise((resolve, reject) => {\n const url = `${this.baseUrl}/questions/${questionID}`;\n let result: any = null;\n this._composer.http.get(url).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.questions = d;\n this.answers = {\n questions_id: this.questions.id,\n positive: true,\n option_responses: this.questions.options.map(q => ({ // map the questions to default answers.\n id: q.id,\n checked: false,\n })),\n comments: \"\"\n };\n }).catch(e => {\n console.log('error', e)\n });\n }\n\n // Handle the checkbox changes\n public handleChange(value: any) {\n this.answers.option_responses.some((o, i) => {\n if (o.id === value.id) {\n this.answers.option_responses[i].checked = !this.answers.option_responses[i].checked;\n return true;\n }\n });\n }\n\n // Handle the comment input changes\n public handleComment($evemt: any) {\n this.answers.comments = $evemt.target.value;\n }\n\n // Submit the Survey in it's current state.\n public confirm() {\n new Promise((resolve, reject) => {\n let result: any = null;\n this._composer.http.post(this.baseUrl, this.answers).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.phase = 'exit';\n this.closeModal(true);\n }).catch(e => {\n console.log('error', e)\n this.phase = 'exit';\n this.closeModal(true);\n });\n \n }\n\n // Close the modal\n public closeModal(delayed: boolean = false) {\n if (delayed) {\n this.timeout('closeModal', () => {\n this._dialog_ref.close();\n }, 2000);\n } else {\n this._dialog_ref.close();\n }\n }\n}\n","
\n \n
\n
\n \n
\n How was your booking experience?\n
\n
\n
\n \n \n
\n
\n\n\n
\n
\n \n
\n \n What went wrong?\n

Select one or several options

\n
\n
\n
\n
\n {{question.option}}\n
\n
\n \n \n \n \n
\n
\n \n \n \n
\n\n
\n
\n \n
\n\n \n
\n Thank you!\n
\n \n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n distinctUntilChanged,\n first,\n} from 'rxjs/operators';\nimport {\n ApplicationIcon,\n BookingFormState,\n SettingsService,\n openBookingSurvey,\n clearBookingFormData,\n BookingFormData,\n SeriesAction,\n selectActiveForm,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport {\n NavigationEnd,\n Router,\n ActivatedRoute\n} from '@angular/router';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport { SurveyModalComponent } from '../survey-modal/survey-modal.component';\nimport {\n Store, select\n} from '@ngrx/store';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface RoutePayload {\n /** IE ['/home', 'results'] */\n route: string[];\n /** IE { display: '/list' } */\n queryParams?: object;\n}\n\nexport type RoomBookingStoreState = BookingFormState & BuildingStoreState;\n\n@Component({\n selector: 'a-topbar-header',\n template: `\n
\n
\n \n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n
\n `,\n styleUrls: ['./topbar-header.component.scss'],\n // encapsulation: ViewEncapsulation.None,\n})\nexport class TopbarHeaderComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether to show menu */\n @Input() public menu: boolean;\n /** Whether to show modal close icon */\n @Input() public modal: boolean = false;\n /** Whether t show modal back icon */\n @Input() public backModal: boolean = false;\n /** Whether to disable the survey triggers */\n @Input() public noSurvey: boolean = false;\n /** Name of the page being rendered */\n @Input() public page: string;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n /** Override the home route. **/\n @Input() public homeOverride: string | undefined;\n /** Show history back instead of logo block */\n @Input() public back: RoutePayload;\n /** Emitter for changes to menu state */\n @Output() public menuChange = new EventEmitter();\n /** Emitter for the close button */\n @Output() public closeCallback = new EventEmitter();\n /** Emitter for the back button */\n @Output() public onBack = new EventEmitter();\n /** Name of the currently active page */\n public currentPage: string;\n /** Survey modal state */\n public modalOpen: boolean = false;\n isEditSeries: boolean = false;\n\n public get feedback() {\n const feedback_url = this._org.getOrganizationFiltersByRoomType('feedback_url');\n return `${feedback_url}${this.currentPage}`;\n // return generateFeedbackUrl(this.currentPage);\n }\n\n public surveyDialogRef: MatDialogRef = null;\n\n public bookingCompleted: Date = new Date();\n public feedbackId: string = null;\n\n constructor(private store: Store,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.store.dispatch(loadOrganisations.request());\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => {\n this.logo = this._settings.get(`app.logo_${this.mode}`) || { type: 'icon' };\n });\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n\n // if the survey is allowed (don't in modals! due to duplicate appearances)\n if (!this.noSurvey) {\n // get the active form values\n this.subscription('openSurveyModal', this.store.pipe(\n distinctUntilChanged()\n ).subscribe((next: any | undefined) => {\n const feedbackId = next.organisation?.data?.success?._settings?.discovery_info?.feedback_id;\n if (feedbackId && this.feedbackId !== feedbackId) {\n this.feedbackId = feedbackId;\n }\n if (next.bookingForm?.bookingCompleted && this.bookingCompleted.getTime() < next.bookingForm.bookingCompleted.getTime()) {\n this.bookingCompleted = new Date(next.bookingForm.bookingCompleted.getTime());\n this.openFeedbackModal();\n }\n }));\n }\n\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n /** Set menu state to `true` */\n public showMenu() {\n this.menu = true;\n this.menuChange.emit(this.menu);\n }\n\n public async goToHome() {\n // this.isEditSeries && this.clearFormAndResultData();\n // Clear the form and result data before navigating to home for a fresh start for all type of bookings\n this.clearFormAndResultData();\n await this._router.navigate([this.homeOverride ?? '/']);\n // await this._router.navigate(['/', 'home'], { relativeTo: this.route });\n this._dialog.closeAll();\n }\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n public goToHelp() {\n const help_url = this._org.getOrganizationFiltersByRoomType('help_url');\n window.open(help_url || Urls.Help);\n }\n\n public goToFeedback() {\n // Over-engineered button action to mimic/test booking confirmation event.\n this.store.dispatch(openBookingSurvey());\n }\n\n public openFeedbackModal() {\n if (!this.modalOpen && !this.surveyDialogRef) {\n this.modalOpen = true;\n this.surveyDialogRef = this._dialog.open(SurveyModalComponent, {\n disableClose: true,\n panelClass: 'mck-modal-survey',\n data: this.feedbackId,\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.surveyDialogRef.afterClosed().subscribe(() => {\n this.modalOpen = false;\n this.surveyDialogRef = null;\n });\n }\n\n }\n\n public async goToBackRoute() {\n this.onBack.emit();\n await this._router.navigate(this.back.route, { queryParams: this.back.queryParams });\n }\n\n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { first } from 'rxjs/operators';\n\nimport {\n ApplicationIcon,\n ApplicationService,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-login',\n templateUrl: './login.component.html',\n styleUrls: ['./login.component.scss']\n})\nexport class LoginComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether the user credentials are being checked */\n public loading: boolean;\n /** Form fields for the login form */\n public form: FormGroup;\n\n constructor(private _service: ApplicationService, private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n this.loading = true;\n this.form = new FormGroup({\n username: new FormControl('', [Validators.required]),\n password: new FormControl('', [Validators.required])\n });\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.loading = false;\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n }\n\n /** Perform user login */\n public login() {\n this.loading = true;\n const form = this.form.value;\n this._users.login({\n username: form.username,\n password: form.password\n }, { form: true }).then(() => {\n this.loading = false;\n }, () => {\n this.loading = false;\n this.form.controls.password.setErrors({ check: true });\n });\n }\n\n}\n","
\n
\n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n \n Username:\n \n \n \n Username is required\n \n
\n
\n \n Password:\n \n \n \n Invalid username or password\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n
\n \n
\n
Converge is loading
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\n@Component({\n selector: 'app-map-controls',\n template: `\n
\n
\n \n
\n \n \n
\n \n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-controls.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class MapControlsComponent implements OnInit {\n @Output()\n public zoomOutClick = new EventEmitter();\n\n @Output()\n public zoomInClick = new EventEmitter();\n\n @Output()\n public refreshClick = new EventEmitter();\n\n @Output()\n public infoClick = new EventEmitter();\n\n @Output() toggleEvent = new EventEmitter();\n\n public isClosed = true;\n\n toggle() {\n this.toggleEvent.emit();\n this.isClosed = !this.isClosed;\n }\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { FormControl } from '@angular/forms';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { legendOptions } from '../map.utils';\n\n@Component({\n selector: 'app-map-filters',\n template: `\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-filters.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapFiltersComponent extends BaseDirective implements OnInit {\n\n public legendOptions = legendOptions();\n\n @Input()\n public buildings: SelectOption[];\n\n @Input()\n public selectedBuilding: SelectOption;\n\n @Output()\n public selectedBuildingChange = new EventEmitter>();\n\n @Input()\n public levels: SelectOption[];\n\n @Input()\n public selectedLevel: SelectOption;\n\n @Output()\n public selectedLevelChange = new EventEmitter>();\n\n @Input()\n public spaces: SelectOption[];\n\n @Output()\n public selectedSpaceChange = new EventEmitter>();\n\n @Input()\n public selectedSpace: SelectOption;\n\n @Output()\n public searchClick = new EventEmitter();\n\n public buildingControl = new FormControl();\n\n public levelControl = new FormControl();\n\n public spaceControl = new FormControl();\n\n public resetInput: number;\n\n public searchStringPresent = false;\n\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('buildingChanges',\n this.buildingControl.valueChanges.subscribe(value => this.selectedBuildingChange.emit(value)));\n this.subscription('levelChanges',\n this.levelControl.valueChanges.subscribe(value => this.selectedLevelChange.emit(value)));\n this.subscription('spaceChanges',\n this.spaceControl.valueChanges.subscribe(value => {\n this.selectedSpaceChange.emit(value);\n this.searchClick.emit();\n }));\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n this.searchStringPresent = false;\n // TODO, reset the focused room if required?\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\n\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel,\n parentComponent?: any,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'app-map-overlay',\n template: `\n
\n \n
\n
\n
\n \n
\n
\n
\n {{data.simple_name || 'No Label'}}\n \n \n
{{ data.status === 'requestable' ? 'Requestable' : 'Bookable'}} {{ data?.room?.space?.availableOccurrences }} out of {{ data?.room?.space?.totalOccurrences }}
\n
\n
\n
\n\n
\n `,\n styleUrls: ['./map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapOverlayComponent implements OnInit {\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n ) {\n }\n public ngOnInit(): void {\n }\n\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.data.room) {\n this.data.parentComponent.roomSelected(this.data.room)\n }\n }\n\n public get is_recurrent () {\n return this.data.parentComponent?.bookingFormData?.value?.is_recurrent || false;\n }\n\n public closeOverlay() {\n this.data.parentComponent?.closeMapOverlayOutlet();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectMapFilteredResults,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-map-search',\n template: `\n
\n
\n \n \n
\n
\n
\n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-search.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n animations: [\n trigger('expandHeight', [\n state(\n 'open',\n style({\n height: '470px',\n })\n ),\n state(\n 'closed',\n style({\n height: 'calc(100vh - 270px)',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class MapSearchComponent extends BaseDirective implements OnInit {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n // public resultSpaces = new BehaviorSubject>(\n // LoadingModel.empty()\n // );\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n public floorData: any;\n public floorDataParam: any;\n @Output() toggleEvent = new EventEmitter();\n\n //to capture state for toggling expandHeight animation\n public isOpen = true;\n resultsLoading: any;\n\n propagateToggle() {\n this.toggleEvent.emit();\n this.isOpen = !this.isOpen;\n }\n \n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private location: Location,\n private route: ActivatedRoute\n ) {\n super();\n this.floorData = location.getState();\n }\n\n public ngOnInit(): void {\n // this.resultsLoading = this.resultSpaces.pipe(map((m) => m.isLoading));\n \n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => { \n this.resultsLoading = r.isLoading;\n return r.success;})\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) => !!s.map_id && s.zones.includes(building.id)\n );\n this.resultSpaces.next(spacesFromSelection);\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n status !== 'in-use' ? \n () => {\n this.activeSpace.next(space);\n this.focusOnRoom(status);\n } \n : ()=> {}\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n })\n );\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(buildings);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n \n if(this.activeLevel.value){\n this.floorDataParam = {\n display: this.activeLevel.value.name,\n value: this.activeLevel.value.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n \n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n this.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(form) ));\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.bookingFormData.next(next);\n }\n })\n );\n\n if (this.floorData?.payload) {\n this.floorDataParam = {\n display: this.floorData?.payload.name,\n value: this.floorData?.payload.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n }\n\n public refreshFloorNumber(): void {\n this.activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n // this.focusedMapSpace.next(undefined);\n }\n\n public closeMapOverlayOutlet = () => {\n this.focusedMapSpace.next(undefined)\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n };\n \n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n\t\t\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(this.bookingFormData.value) ));\n this.activeLevel.next(next);\n\n /**\n * update mapUrl as per active level on change of filter search\n */\n this.mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''))\n });\n }\n\n public selectActiveSpace(selection: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom(status?:string) {\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n this.focusedRoom.next(focusedRoom[0]);\n this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this, status));\n this.zoom.next(MAX_ZOOM_LEVEL);\n },\n delay\n );\n });\n }\n\n public roomSelected(room: RoomResultsViewModel) {\n\n\n const { is_recurrent } = this.bookingFormData.value;\n this.bookingFormData.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.bookingFormData.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\n // Handle timezone offset for accurate date and time information\n let { dateTz } = this.bookingFormData.value;\n // if (this.offset) {\n dateTz = dateTz.addValue({ minutes: 0 });\n // }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.bookingFormData.value.booking.room is not and does not contain the timezone\n * this.bookingFormData.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.bookingFormData.value,\n // buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: 0,\n selectedRoom: room\n }\n }});\n\n\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n // this.router.navigate(['room'], { relativeTo: this.route });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MapSearchComponent } from './map-search/map-search.component';\nimport { MapControlsComponent } from './map-controls/map-controls.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MapFiltersComponent } from './map-filters/map-filters.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { OfficeInformationModalComponent } from './office-information-modal/office-information-modal.component';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapOverlayComponent } from './map-overlay/map-overlay.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n NgxSkeletonLoaderModule\n];\n\nexport const mapModuleDeclarations = [\n MapSearchComponent,\n MapControlsComponent,\n MapFiltersComponent,\n OfficeInformationModalComponent,\n MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class MapModule {\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { MapOverlayComponent } from 'src/app/map/map-overlay/map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 0.99\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any, status?: string): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room,\n status:status\n }\n});","import {\n Component,\n Inject,\n ViewEncapsulation\n} from '@angular/core';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { \n BookingRuleDetails,\n Building,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n defaultMapBookingRules,\n defaultMapBookingSubtitle\n} from 'src/app/map/map.utils';\n\n@Component({\n selector: 'app-office-information-modal',\n template: `\n \n
\n
Booking in {{building?.name}}
\n
{{targetLinks(info)}}
\n
\n
\n
    \n \n
\n
\n
\n {{group.title}}\n
    \n \n
\n
\n
\n When booking from maps:\n
    \n \n
\n \n

\n For more info email: {{contact}}\n

\n

\n
\n
\n
\n \n
\n
\n `,\n styleUrls: ['./office-information-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OfficeInformationModalComponent {\n constructor(@Inject(MAT_DIALOG_DATA) public building: Building,\n private dialogRef: MatDialogRef) {\n }\n\n\n /** Booking rule details */\n public get rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.rules || [] as any;\n }\n\n /** Booking rule details */\n public get info(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.info || defaultMapBookingSubtitle;\n }\n\n public get customHtml(): string | undefined {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.custom_html;\n }\n\n /** Booking map rule details */\n public get map_rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.map_rules || defaultMapBookingRules as any;\n }\n\n /** Other special booking rules */\n public get other_rules(): { title: string, rules: string[] }[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n const rules: HashMap = (details as any)?.other_rules || {};\n return Object.keys(rules).reduce((a, v) => {\n \n a.push({ title: v, rules: rules[v] || [] });\n return a;\n }, []);\n }\n\n public get contact(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.contact || '';\n }\n\n public get link(): { url?: string, name?: string } {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.link || {};\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public targetLinks(info: string) {\n const regex = /[] = [\n BaseDirective,\n LoginComponent,\n TopbarHeaderComponent,\n ResponsiveInlineImagesComponent,\n OverlayMenuComponent,\n FooterMenuComponent,\n MapControlsComponent\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\nconst CDK_MODULES: any[] = [\n ScrollingModule,\n DragDropModule,\n CdkTableModule\n];\n\n\n@NgModule({\n declarations: [\n ...COMPONENTS\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n RouterModule,\n EditorModule,\n ComposerModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n IvyCarouselModule,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ],\n exports: [\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n ...COMPONENTS,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ]\n})\nexport class SharedContentModule {\n}\n","import { Component, OnInit } from '@angular/core';\nimport { filter, first, map, distinctUntilChanged, shareReplay } from 'rxjs/operators';\nimport {\n ApplicationLoadingState,\n BaseDirective,\n closestToTimeSlot,\n closestToTimeSlotTz,\n LoadingState,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationIcon,\n ApplicationService,\n Building,\n BuildingCity,\n defaultRoomSizeOption,\n DEFAULT_BOOKING_DURATION,\n flattenDisplayOffices,\n internalBookingTypeOption,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n mapResultsToViewModels,\n OrganisationService,\n SpacesService,\n storeBookingFormData,\n availabilityOptionsToQuery,\n bookingTypeOptions,\n selectFilteredDiffSizeResults,\n flattenBuildingsWithLevels,\n clearRoomFilters,\n allBookingTypeOption,\n roomSizeOptions,\n roomSizeOptionsKiosk,\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport { select, Store } from '@ngrx/store';\nimport { loadUser, selectHasUserData, UserStoreState } from '@mckinsey-converge/user';\nimport { ComposerService } from '@placeos/composer';\nimport { ActivatedRoute, Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\n\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n} from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n buildingStateSelector,\n loadBuildings,\n selectBuildingOptionsGroupedByCity,\n} from '@mckinsey-converge/buildings';\nimport { loadDiffSizeResults, loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { timeStamp } from 'console';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\n\n@Component({\n selector: 'app-shell-wrapper',\n templateUrl: './shell.component.html',\n styleUrls: ['./shell.component.scss'],\n})\nexport class ShellWrapperComponent extends BaseDirective implements OnInit {\n /** Loading state of the application */\n public loading_state: ApplicationLoadingState;\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n\n private userLoading = new BehaviorSubject(true);\n public isQRCode = new BehaviorSubject(true);\n public buildingOptions = new BehaviorSubject[]>([]);\n public zone_id: any;\n public floor: any;\n\n constructor(\n private _service: ApplicationService,\n private placeOs: ComposerService,\n private _org: OrganisationService,\n private activatedRoute: ActivatedRoute,\n private _spaces: SpacesService,\n private router: Router,\n private store: Store\n ) {\n super();\n\n // Initialize roomID\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n // roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n\n // Initialize zoneID\n let zone_id = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('zone_id')) {\n zone_id = this.activatedRoute.snapshot.queryParamMap.get('zone_id');\n } else if (\n localStorage.oauth_redirect &&\n localStorage.oauth_redirect.includes('?zone_id=')\n ) {\n zone_id = localStorage.oauth_redirect.split('=')[1];\n if (zone_id.includes('&')) {\n zone_id = zone_id.split('&')[0];\n }\n }\n\n this.zone_id = zone_id;\n\n // Initialize floor number\n let floor = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('floor')) {\n floor = this.activatedRoute.snapshot.queryParamMap.get('floor');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('&floor=')) {\n floor = localStorage.oauth_redirect.split('&floor=')[1];\n }\n this.floor = floor;\n (floor && zone_id) || roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n }\n\n /** Whether the user needs to login */\n public get show_login(): Observable {\n return this.userLoading;\n }\n\n /** Whether a module is still loading data */\n public get is_loading(): Observable {\n return this.userLoading;\n }\n\n /** List of modules with a loading state */\n public get loading_state_list(): LoadingState[] {\n const list: LoadingState[] = [];\n for (const mod in this.loading_state) {\n if (this.loading_state[mod]) {\n list.push(this.loading_state[mod]);\n }\n }\n return list;\n }\n\n /**\n * Function: To check and fetch room details if available for the scanned roomId\n * @param buildings\n * @param roomId\n */\n public checkRoomId(buildings: Building[], roomId: string) {\n let formGroup = {\n location: [],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: true }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType: bookingTypeOptions[0],\n roomSize: defaultRoomSizeOption,\n selectedRoom: null,\n timezone: null,\n buildings: buildings,\n };\n\n const params = {\n room_ids: roomId,\n };\n\n const availibityParams = {\n room_ids: roomId,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n hide_declined: true,\n };\n const query = availabilityOptionsToQuery(availibityParams);\n this._spaces.queryRooms(query).subscribe(\n (res) => {\n //Convert raw data into API object\n const list = res.map((i) => this._spaces.process(i));\n this._spaces.setSpaceList(list);\n /**\n * Building form data to resue to navigate to result page if room is not available!\n */\n const bookingRoom = mapResultsToViewModels(\n list,\n list[0].building.levels,\n buildings\n );\n const city = list[0].building.city;\n const timezone = list[0].timezone;\n const grouped_by_city = {\n key: { name: city, timezone },\n value: buildings?.filter((bld) => bld.city === city) || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [mapCityToAllSelectOption(grouped_by_city.key), ...city_buildings];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === list[0].building.id\n )[0];\n const buildingTimezone = list[0].timezone;\n // form group data\n formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({ date: Date.now(), is_local_tz: false }),\n 15\n ).toZone(buildingTimezone),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType:\n list[0].internal_or_external === 'internal'\n ? bookingTypeOptions[0]\n : bookingTypeOptions[1],\n roomSize: defaultRoomSizeOption,\n selectedRoom: bookingRoom[0],\n timezone: buildingTimezone,\n buildings: buildings,\n };\n\n this.store.dispatch(\n storeBookingFormData({\n payload: formGroup,\n })\n );\n this.router.navigate([`../home/results/room`], {\n state: { payload: { ...formGroup, offset: 0 } },\n });\n localStorage.oauth_redirect = localStorage.oauth_redirect.split('?')[0];\n this.isQRCode.next(true);\n },\n (error) => {\n // console.log(error);\n this.isQRCode.next(true);\n // this.router.navigate([`home/`]); // to navigate to default route if room dont exists\n /**\n * Navigate to room result page if no room/id exist in the db/ removed from the db in future -\n */\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n this.router.navigate([`../home/results`], {\n state: { payload: { ...formGroup, offset: 0 } },\n queryParams: { display: 'list' },\n });\n }\n );\n }\n\n public ngOnInit(): void {\n // when qr code lands on a url for the second time, reload it (to compensate for different browser/device combination default behaviors)\n this.subscription(\n 'navigationEventShell',\n this.router.events\n .pipe(filter((event) => event instanceof NavigationStart))\n .subscribe((event: NavigationEvent) => {\n if (event instanceof NavigationStart) {\n if (\n event.navigationTrigger === 'popstate' &&\n (event.url.includes('home?zone_id=') || event.url.includes('home?id='))\n ) {\n this.userLoading.next(true);\n window.location.reload();\n }\n }\n })\n );\n\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n\n if (roomId) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n this.checkRoomId(bld_list, roomId);\n })\n );\n }\n\n if (this.zone_id && this.floor) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n const building = bld_list.filter((el) => el.id === this.zone_id);\n\n const city = building[0].city;\n const timezone = building[0].timezone;\n\n const grouped_by_city = {\n key: { name: city, timezone },\n value: building || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings,\n ];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === building[0].id\n )[0];\n const buildingTimezone = building[0].timezone;\n // form group data\n const addMin = DateTime.now().get('minute') % 5 === 0 ? 1 : 0;\n const formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(\n DateTime.now().plus({ minutes: addMin }),\n 15\n ).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n bookingType: allBookingTypeOption, // all rooms (including internal and external both)\n roomSize: roomSizeOptionsKiosk[3],\n selectedRoom: null,\n timezone: buildingTimezone,\n buildings: bld_list,\n };\n\n const query2 = {\n // capacity: 3,\n locations: this.zone_id,\n // capacity_max: 9,\n // diff_capacity: true,\n hide_declined: true,\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n };\n\n //clear search filters first if any applied previously\n this.store.dispatch(clearRoomFilters());\n\n this.store.dispatch(loadRoomsForResults.clear());\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n this.store.dispatch(loadRoomsForResults.request(query2));\n localStorage.oauth_redirect = '';\n // To do: navigate to floor-map route\n this.router.navigate([`../home/results`], {\n state: {\n payload: this.floor,\n building: building,\n floorMap: true,\n url: window.location.href,\n },\n queryParams: { display: '' },\n });\n this.isQRCode.next(true);\n })\n );\n }\n\n this.subscription(\n 'loading',\n this._service.listen('loading').subscribe((loading) => {\n this.loading_state = loading;\n })\n );\n\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n\n /**\n * Load current user into redux. this is meant to remove old way of loading user from user's service.\n */\n this.subscription(\n 'currentUser',\n combineLatest([\n this.store.pipe(select(selectHasUserData)),\n this.placeOs.initialised,\n this.isQRCode, // added to track room details if QR code used to open app\n ])\n .pipe(\n filter(([_, initialized, isQRCodeScanedAndReady]) => {\n console.log(_);\n return initialized && isQRCodeScanedAndReady;\n })\n )\n .subscribe(([next]) => {\n this.userLoading.next(!next);\n if (!next) {\n this.store.dispatch(loadUser.request());\n }\n })\n );\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
Converge is loading
\n
\n
\n
\n","export enum Urls {\n LearnMore = 'https://our-firm.intranet.mckinsey.com/covid-portal/travel',\n Feedback = 'mailto:converge_feedback@mckinsey.com?subject=Feedback for page: ',\n Help = 'https://mckinsey.service-now.com/ghd?id=topic_simple&topic_id=54e8eb091bea3d1831b17449cd4bcbed',\n OfficeContacts = 'https://our-firm.intranet.mckinsey.com/ourfirm/geographies',\n}\n\nexport const generateFeedbackUrl = (page: string) => {\n return `${Urls.Feedback}${page}`;\n};\n","import { EnvironmentData } from '@mckinsey-converge/environment';\n\nexport const environment: EnvironmentData = {\n production: true,\n hmr: false,\n heap_io_id: 91016686,\n};\n","import { SettingsData } from '@mckinsey-converge/data-common';\n\n;\n/**\n * GENERAL APPLICATION SETTINGS\n */\nconst general = {\n menu: {\n items: [],\n copyright: 'McKinsey & Company',\n position: 'left'\n }\n};\n\n/**\n * HOME PAGE SETTINGS\n */\nconst home = {\n background: 'assets/img/skyline.jpg',\n tiles: [\n {\n name: 'Book',\n route: '/book/spaces',\n icon: {\n type: 'icon',\n class: 'custom-book'\n }\n },\n {\n name: 'Maps',\n route: '/explore/space',\n icon: {\n type: 'icon',\n class: 'custom-spaces'\n }\n },\n {\n name: 'My Day',\n route: '/schedule',\n icon: {\n type: 'icon',\n class: 'custom-schedule'\n }\n }\n ]\n};\n/**\n * HELP/SUPPORT SETTINGS\n */\nconst help = {\n tiles: [],\n columns: 2\n};\n/**\n * BOOKING FLOW SETTINGS\n */\nconst booking = {\n booking_types: [\n { name: 'Internal', id: 'internal' },\n { name: 'External', id: 'external' },\n ],\n show_fields: [\n 'attendees',\n 'body',\n 'catering',\n 'dateTz',\n 'duration',\n 'organiser',\n 'title',\n 'type',\n 'all_day',\n 'needs_space',\n 'has_catering'\n ],\n html_body: false,\n multiple_spaces: true,\n desk_start: 9\n};\n/*===========================*\\\n|| SPACE LISTING SETTINGS ||\n\\*===========================*/\nconst space_display = {\n show_images: false\n};\n/*===========================*\\\n|| USER DIRECTORY SETTINGS ||\n\\*===========================*/\nconst directory = {\n show_avatars: true,\n min_search_length: 3\n};\n/*===========================*\\\n|| EXPLORE MAP SETTINGS ||\n\\*===========================*/\nconst explore = {\n colors: {\n 'space-available': '#43a047',\n 'space-requestable': '#ffb300',\n 'space-unavailable': '#e53935',\n 'space-in-use': '#d4483e',\n 'space-not-bookable': '#ccc',\n 'desk-available': '#43a047',\n 'desk-available-stroke': '#1b5e20',\n 'desk-unavailable': '#e53935',\n 'desk-unavailable-stroke': '#b71c1c',\n 'desk-reserved': '#ffb300',\n 'desk-reserved-stroke': '#ff6f00',\n 'desk-not-bookable': '#fff',\n 'desk-not-bookable-stroke': '#ccc',\n 'zone-low': '#43a047',\n 'zone-medium': '#ffb300',\n 'zone-high': '#e53935'\n },\n can_select_building: true,\n show_legend_group_names: false,\n show_timeline: true,\n legend: {\n General: [\n { key: 'space-available', name: 'Available' },\n { key: 'space-requestable', name: 'Available by request' },\n { key: 'space-unavailable', name: 'In use' },\n { key: 'space-not-bookable', name: 'Not Bookable' }\n ]\n }\n};\n\n/*=========================*\\\n|| DAY VIEW SETTINGS ||\n\\*=========================*/\nconst day_view = {\n dragdrop: false,\n};\n\n\n/**\n * ROOT APPLICATION SETTINGS\n */\nconst app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n },\n general,\n home,\n help,\n booking,\n space_display,\n directory,\n explore,\n day_view\n}\n\n\n/**\n * ROOT SETTIGNS\n */\nexport const DEFAULT_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/staff',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app,\n mock: false,\n frontend: 'staff',\n};\n","import { ApplicationRef, NgModuleRef } from '@angular/core';\nimport { createNewHosts } from '@angularclass/hmr';\n\nexport const hmrBootstrap = (\n module: any,\n bootstrap: () => Promise>,\n) => {\n let ngModule: NgModuleRef;\n module.hot.accept();\n bootstrap().then(mod => (ngModule = mod));\n module.hot.dispose(() => {\n const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef);\n const elements = appRef.components.map(c => c.location.nativeElement);\n const makeVisible = createNewHosts(elements);\n ngModule.destroy();\n makeVisible();\n });\n};\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\nimport { environment } from './environments/environment';\nimport { hmrBootstrap } from './hmr';\nimport { AppModule } from './app/app.module';\n\nif (environment.production) {\n enableProdMode();\n}\n\nconst bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);\n\n// comes from https://medium.com/wizardnet972/hot-module-replacement-with-angular-cli-5fc7a3ae4a9c\nif (environment.hmr) {\n if ((module as any).hot) {\n hmrBootstrap(module, bootstrap);\n } else {\n console.error('HMR is not enabled for webpack-dev-server!');\n console.log('Are you using the --hmr flag for ng serve?');\n }\n} else {\n bootstrap().catch(err => console.log(err));\n}\n"]} \ No newline at end of file +{"version":3,"sources":["webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/lib/angular-animations.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/animations/src/lib/animations.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/base.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/cdk-drop-list-scroll-container.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/date.spec-helpers.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/date.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/general.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/image.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/numbers-only.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/base/src/lib/replace.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/bookings/src/lib/bookings.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/buildings/src/lib/buildings.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/api.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/app.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/base-api.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/base.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking-filter.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.data.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.form.spec-helpers.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.selectors.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/booking.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/booking/room-results/room-results.viewmodel.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking-state.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.types.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/booking.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/bookings.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/bookingsPaginated.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/bookings/space.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-categories.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-category.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-item.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-items.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-menu.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-notes.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering-order.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/catering.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/catering/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/close-modal-dialog-service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/collapse-accordion-service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/data-common.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/hotkeys.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/location.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/location/location.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/building.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/level.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/organisation.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/organisation/organisation.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/paginated.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/recurrence/recurrence.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/report.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/reports/reports.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/service-manager.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/settings.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/space.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/space.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spaces/spaces.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/spec-helpers.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/user.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/user.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/users/users.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/data-common/src/lib/validation.utilities.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/date-tz/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/date-tz/src/lib/date-tz.class.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/environment.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/environment.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/environment/src/lib/version.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-confirm/booking-confirm.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-confirm/booking-confirm.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-form/booking-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/booking-form/booking-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-confirm-modal/catering-confirm-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-confirm-modal/catering-confirm-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-details-modal/catering-details-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/catering-details-modal/catering-details-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/confirm-modal/confirm-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/confirm-modal/confirm-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/legacy-overlays.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/new-user-modal/new-user-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/new-user-modal/new-user-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/no-catering-modal/no-catering-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/no-catering-modal/no-catering-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/requirement-details-modal/requirement-details-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/requirement-details-modal/requirement-details-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/space-select-modal/space-select-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/space-select-modal/space-select-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/user-form/user-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-overlays/src/lib/user-form/user-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/action-icon/action-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/action-icon/action-icon.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/item/item.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/item/item.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/package-options-modal/package-options-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/bookings/catering/package-options-modal/package-options-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/cng-search-bar/hover-class.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/action-field/action-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/action-field/action-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/counter/counter.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/counter/counter.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/date-field/date-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/date-field/date-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/duration-field/duration-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/duration-field/duration-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/time-field/time-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/time-field/time-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-list-field/user-list-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-list-field/user-list-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-search-field/user-search-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/custom-fields/user-search-field/user-search-field.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/feedback/feedback.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/feedback/feedback.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/icon/icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/icon/icon.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/legacy-ui.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/popout-menu/popout-menu.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/popout-menu/popout-menu.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/searchbar/searchbar.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/searchbar/searchbar.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/user-avatar/user-avatar.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/legacy-ui/src/lib/user-avatar/user-avatar.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.model.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/src/lib/loading.selectors.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/testing/effects.testing.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/loading/testing/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/organisation/src/lib/organisation.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.reducer.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.types.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rooms/src/lib/rooms.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/loading-model.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/operators.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/rx-utils/src/lib/rx-utils.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/aca-date-picker/aca-date-picker.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/aca-date-picker/aca-date-picker.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/alert-banner/alert-banner.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-chip-select-item/auto-complete-chip-select-item.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-chip-select-item/groupHeader.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-select-option/auto-complete-select-option.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/auto-complete-select-option/auto-complete-select-option.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/base-template.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select-options.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select-options.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/cng-select.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/cng-select/dropdown-trigger-for.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/collapse-header/collapse-header.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflict-alert-modal/conflict-alert-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflict-alert-modal/conflict-alert-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflicts-modal/conflicts-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/conflicts-modal/conflicts-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/custom-snackbar-component/custom-snackbar-component.service.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-calendar-widget/date-tz-calendar-widget.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-calendar-widget/date-tz-calendar-widget.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-date-picker/date-tz-date-picker.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-duration-field/date-tz-duration-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/date-tz-time-field/date-tz-time-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/duration-field/duration-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/error-message/error-message.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/calendar/calendar-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/calendar/chevron-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/icons/close/close-icon.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/informational-image/informational-image.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/label/label.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/legend-dropdown/legend-dropdown.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/mck-date-picker/mck-date-picker.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/modal-button-row/modal-button-row.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/modal/modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/override-changes-modal/override-changes-modal.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/override-changes-modal/override-changes-modal.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/pipes/filter.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/pipes/sanitise.pipe.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/radio-select/radio-select.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-booking-form/recurrence-booking-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-booking-form/recurrence-booking-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-date-form/recurrence-date-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-date-form/recurrence-date-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-pattern-form/recurrence-pattern-form.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/recurrence-pattern-form/recurrence-pattern-form.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select-option/select-option.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select/select.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/select/select.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/selected-chip-count/selected-chip-count.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/spacer/spacer.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/switch-group/switch-group.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/time-field/time-field.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/toggle/toggle.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.directive.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/tooltip/tooltip.enums.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/types.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/ui.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/utils/time.utils.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/ui/src/lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component.html","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/index.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.actions.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.effects.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.module.ts","webpack:///home/runner/work/mckinsey-converge/mckinsey-converge/libs/user/src/lib/user.reducer.ts","webpack:///$_lazy_route_resource lazy namespace object","webpack:///src/app/app-routing.module.ts","webpack:///src/app/app.component.ts","webpack:///src/app/app.component.html","webpack:///src/app/app.module.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-date-widget/calendar-date-widget.component.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-date-widget/calendar-date-widget.component.html","webpack:///src/app/booking/booking-calendar/booking-calendar-routing.module.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-wrapper.component.ts","webpack:///src/app/booking/booking-calendar/booking-calendar-wrapper.html","webpack:///src/app/booking/booking-calendar/booking-calendar.module.ts","webpack:///src/app/booking/booking-calendar/cng-menu-item/cng-menu-item.component.ts","webpack:///src/app/booking/booking-calendar/cng-menu-item/cng-menu-item.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/space/event/event.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/space/event/event.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/space/space.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/space/space.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/staff-calendar.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/staff-calendar.component.html","webpack:///src/app/booking/booking-calendar/staff-calendar/timeline/timeline.component.ts","webpack:///src/app/booking/booking-calendar/staff-calendar/timeline/timeline.component.html","webpack:///src/app/booking/booking-confirmation/booking-confirmation.component.ts","webpack:///src/app/booking/booking-create/booking-create.component.ts","webpack:///src/app/booking/booking-create/booking-form-base.component.html","webpack:///src/app/booking/booking-create/booking-edit-wrapper.component.ts","webpack:///src/app/booking/booking-create/booking-edit.component.ts","webpack:///src/app/booking/booking-create/booking-form-base.component.ts","webpack:///src/app/booking/booking-details-modal/booking-details-modal.component.ts","webpack:///src/app/booking/booking-details-modal/booking-details-modal.component.html","webpack:///src/app/booking/booking-duration-modal/booking-duration-modal.component.ts","webpack:///src/app/booking/booking-result-item/booking-result-item.component.ts","webpack:///src/app/booking/booking-result-item/booking-result-item.component.html","webpack:///src/app/booking/booking-routing.module.ts","webpack:///src/app/booking/booking.form.reducer.ts","webpack:///src/app/booking/booking.module.ts","webpack:///src/app/booking/bookings-listing/bookings-listing.component.ts","webpack:///src/app/booking/bookings-listing/bookings-listing.component.html","webpack:///src/app/booking/cancel-booking-modal/cancel-booking-modal.component.ts","webpack:///src/app/booking/catering/catering.component.ts","webpack:///src/app/booking/catering/catering.component.html","webpack:///src/app/booking/catering/order-details/category/category.component.ts","webpack:///src/app/booking/catering/order-details/category/category.component.html","webpack:///src/app/booking/catering/order-details/order-details.component.ts","webpack:///src/app/booking/catering/order-details/order-details.component.html","webpack:///src/app/booking/catering/order-list/item/item.component.ts","webpack:///src/app/booking/catering/order-list/item/item.component.html","webpack:///src/app/booking/catering/order-list/order-list.component.ts","webpack:///src/app/booking/catering/order-list/order-list.component.html","webpack:///src/app/booking/catering/order-table/order-table.component.ts","webpack:///src/app/booking/manage-bookings/manage-bookings.component.ts","webpack:///src/app/booking/manage-bookings/manage-bookings.viewmodel.ts","webpack:///src/app/booking/office-floor/floor-map-overlay/floor-map-overlay.component.ts","webpack:///src/app/booking/office-floor/floor-map.utils.ts","webpack:///src/app/booking/office-floor/office-floor-map.module.ts","webpack:///src/app/booking/office-floor/office-floor/office-floor.component.ts","webpack:///src/app/booking/office-floor/office-floor/office-floor.component.html","webpack:///src/app/booking/results-header/results-header.component.ts","webpack:///src/app/booking/room-availability-preview-modal/room-availability-preview-modal.component.ts","webpack:///src/app/booking/room-availability-preview/room-availability-preview.component.ts","webpack:///src/app/booking/room-availability-preview/room-availability-preview.component.html","webpack:///src/app/booking/room-booking-details-form/room-booking-details-form.component.ts","webpack:///src/app/booking/room-booking-details-form/room-booking-details-form.component.html","webpack:///src/app/booking/room-booking-form/room-booking-form.component.ts","webpack:///src/app/booking/room-booking-form/room-booking-form.component.html","webpack:///src/app/booking/room-booking-modal/room-booking-modal.component.ts","webpack:///src/app/booking/room-booking/room-booking.component.ts","webpack:///src/app/booking/room-details/room-details.component.ts","webpack:///src/app/booking/room-details/room-details.component.html","webpack:///src/app/booking/room-filters-form/room-filters-form.component.ts","webpack:///src/app/booking/room-filters-modal/room-filters-modal.component.ts","webpack:///src/app/booking/room-location-preview/room-location-preview.component.ts","webpack:///src/app/booking/room-result-item/room-result-item.component.ts","webpack:///src/app/booking/room-results-paginated/room-results-paginated.component.ts","webpack:///src/app/booking/room-results-section/room-results-section.component.ts","webpack:///src/app/booking/room-results/room-results-coachmark.viewmodel.ts","webpack:///src/app/booking/room-results/room-results.component.ts","webpack:///src/app/booking/searched-location/searched-location.component.ts","webpack:///src/app/components/footer-menu/footer-menu.component.ts","webpack:///src/app/components/footer-menu/footer-menu.component.html","webpack:///src/app/components/map-controls/map-controls.component.ts","webpack:///src/app/components/map-controls/map-controls.component.html","webpack:///src/app/components/overlay-menu/overlay-menu.component.ts","webpack:///src/app/components/overlay-menu/overlay-menu.component.html","webpack:///src/app/components/responsive-inline-images/responsive-inline-images.component.ts","webpack:///src/app/components/survey-modal/survey-modal.component.ts","webpack:///src/app/components/survey-modal/survey-modal.component.html","webpack:///src/app/components/topbar-header/topbar-header.component.ts","webpack:///src/app/login/login.component.ts","webpack:///src/app/login/login.component.html","webpack:///src/app/map/map-controls/map-controls.component.ts","webpack:///src/app/map/map-filters/map-filters.component.ts","webpack:///src/app/map/map-overlay/map-overlay.component.ts","webpack:///src/app/map/map-search/map-search.component.ts","webpack:///src/app/map/map.module.ts","webpack:///src/app/map/map.utils.ts","webpack:///src/app/map/office-information-modal/office-information-modal.component.ts","webpack:///src/app/shared/shared.module.ts","webpack:///src/app/shell/shell.component.ts","webpack:///src/app/shell/shell.component.html","webpack:///src/app/utilities/urls.ts","webpack:///src/environments/environment.ts","webpack:///src/environments/settings.ts","webpack:///src/hmr.ts","webpack:///src/main.ts"],"names":["ANIMATION_SHOW_ENTER_LEAVE","trigger","transition","style","opacity","height","animate","ANIMATION_SHOW_CONTRACT_EXPAND","state","AnimationsModule","CommonModule","NgModule","imports","BaseClass","_timers","_intervals","_subscriptions","_initialised","BehaviorSubject","key","hasOwnProperty","clearTimeout","clearInterval","unsub","name","fn","delay","Function","setTimeout","Error","setInterval","Subscription","unsubscribe","getValue","BaseDirective","destroy","Directive","selector","BaseModule","NumbersOnlyDirective","declarations","exports","ScrollDirection","CdkDropListScrollContainer","_cdkDropList","_renderer","direction","X","last_scroll","x","y","changes","scrollContainer","element","nativeElement","closest","subscription","items","subscribe","list","toArray","forEach","i","index","listen","onDrop","onDrag","updateListPosition","timeout","scroll","scrollLeft","scrollTop","BOTH","Y","_dropListRef","_cacheOwnPosition","_siblings","isReceiving","CdkDrag","Input","ContentChildren","initialTime","mockDate","timeOverride","set","Date","resetDate","reset","closestToTimeSlot","date","stepMinute","start","millisecond","second","minute","Math","ceil","plus","minutes","closestToTimeSlotTz","dateTz","setValue","addValue","durationHumanized","duration","short","h","floor","d","m","weekDayMonthYearFormat","formatDate","extractDateFromInput","input","checkHour","startDate","dayjs","dayJsTimeFormatString","isValid","cleanedInput","times","split","undefined","length","dayJsHoursMinutes","month","year","hour","nearestStepToInput","step","currentStartDate","luxonDate","DateTime","fromMillis","valueOf","closestDate","toFormat","nearestDurationToInput","durationGroups","value","parseInt","indexOf","add","diff","closestDurationGroup","find","max","offset","reduce","previousValue","currentValue","resetSecondsOnTimestamp","timestamp","toMillis","formatDateWithSuffix","dateObj","day","getDate","toLocaleString","getFullYear","nthNumber","number","getListOfDateFormat","extend","utc","timezone","isToday","weekday","customParseFormat","log","type","msg","args","stream","force","app_name","window","debug","colors","console","getItemWithKeys","keys","map","slice","isMobileDevice","r","navigator","userAgent","match","isMobileSafari","agent","isAndroidChrome","padZero","str","toString","unique","array","filter","el","pos","arr","humaniseDuration","durationInput","size","singular","format","hours","filterList","fields","results","filters","toLowerCase","f","parts","push","word","count","regex","RegExp","sort","a","b","localeCompare","item_list","JSON","parse","stringify","item","match_count","match_index","field_list","matched","field","matches","replace","changed","tokens","k","join","matchToHighlight","timeToDate","time","DateNow","startOfValue","ms","randomInt","random","timeFormatString","is24HourTime","hoursMinutes","timezoneNameToDate","timeZoneName","zone","toZone","e","timezoneDisplay","gmtOffsetDisplay","timeWithZoneFormatString","toLocaleLowerCase","timeWithGmtOffsetFormatString","startEndTimeFormatString","startDateTz","endDateTz","startEndTimeWithZoneFormatString","dateLocalFormatString","comma","formatLocalDate","dateBuildingFormatString","shorterLocalDateFormatString","shorterBuildingDateFormatString","localeString","toLocaleTimeString","document","querySelector","getAttribute","language","downloadFile","filename","contents","createElement","setAttribute","encodeURIComponent","display","body","appendChild","click","removeChild","csvToJson","csv","lines","splice","v","line","part","jsonToCsv","json","Array","Object","valid_keys","detectIE","ua","msie","substring","trident","rv","edge","eventToPoint","event","MouseEvent","clientX","clientY","touches","flatten","an_array","stack","res","next","pop","isArray","reverse","seed","xmur3","rand","sfc32","predictableRandomInt","imul","charCodeAt","c","t","isLessThanBreakpoint","breakpoint","innerWidth","toTitleCase","toUpperCase","ImageDirective","_el","initalValue","stopPropagation","HostListener","ReplacePipe","from","to","Pipe","bookingStateSelector","bookings","loadBookingsWithQuery","createAction","props","loadHomepageBookingsResults","createLoadingAction","loadUpcomingBookingsResults","loadPastBookingsResults","loadCancelledBookingsResults","loadBookingByIdResults","clearBookingByIdResults","BookingsEffects","actions","bookingService","afterBookingsRequestResultsLoadOthersEffect","pipe","ofType","mergeMap","action","DateTZ","yourBookingsRequest","email","pagination","limit","show_cancelled","end_epoch","subtractValue","seconds","include_rooms","upcomingRequest","pastRequest","start_epoch","cancelledRequest","byIdRequest","id","effects","target","request","loadHomepageBookingsResultsEffect","createLoadingEffect","userBookings","loadUpcomingBookingsResultsEffect","loadPastBookingsResultsEffect","loadCancelledBookingsResultsEffect","loadBookingByIdResultsEffect","Effect","Injectable","BookingsModule","EffectsModule","forFeature","StoreModule","bookingsReducer","initialBookingsState","query","LoadingModel","empty","homepage","upcoming","past","cancelled","bookingById","createReducer","on","ons","initialBookingFormState","activeFormFilters","bookingFormReducer","storeBookingFormData","activeForm","payload","clearBookingFormData","openBookingSurvey","bookingCompleted","storeRoomFilters","clearRoomFilters","mapBookingToSelectOption","booking","loadBuildings","buildingStateSelector","buildings","selectLoadBuildingsSuccess","createSelector","selectors","optionalSuccess","selectBuildingOptionsGroupedByCity","success","mapped","Map","s","found","city","get","selectLevelByZoneId","param","levels","l","BuildingsEffects","organizationService","loadBuildingsWithOrg","loadBuildingsAfterOrg","loadOrganisations","BuildingsModule","buildingsReducer","initialBuildingState","data","toQueryString","ApplicationService","store","analytics","_app_ref","_zone","_title","_settings","_hotkeys","_composer","_snackbar","_environment","snack","_subjects","_observers","isStable","first","_","run","waitForSettings","message","on_action","icon","content","openSnack","openSnackBar","notify","asObservable","initialised","init","setupComposer","select","selectCurrentUser","user","take","setupAnalytics","fmno","application","loading","composer","settings","protocol","location","host","domain","hostname","port","url","use_domain","origin","route","includes","mock","href","localStorage","getItem","config","scope","auth_uri","token_uri","redirect_uri","handle_login","local_login","setup","heap_io_id","heapIo","app_id","load","identify","frontend","isIt","_kioskFormFilter","title_suffix","setting","setTitle","getTitle","auth","api_endpoint","is_initialised","providedIn","BaseDataClass","raw_data","event_subject","Subject","events","_server_names","zone_id","_service","form","toJSON","Promise","resolve","reject","promise","update","then","metadata","task_name","parameters","task","obj","_changes","new_key","ServiceManager","serviceFor","BaseAPIService","settingsService","_subscribers","_promises","_compare","_list_filter","_name","_api_route","form_data","concierge","err","engine","endpoint","predicate","query_params","cache","result","http","process","processApiResult","catchError","error","of","new_item","post","injectConcierge","analyticsEvent","updateList","method","post_data","_task","put","removeItem","should_inject_concierge","apiSubRoute","token","sessionStorage","access_token","headers","HttpHeaders","requestOptions","q","label","raw_item","old_list","compareFn","new_list","mixed_list","spaceExtraFeatureToDisplayName","feature","SpaceFeatures","VideoConference","ConferencePhone","WirelessContentSharing","FlipChart","Glassboard","ElectronicWhiteboard","ConferenceRoom","TeamRoom","PartnerOffice","PhoneBooth","NaturalLight","BoardRoom","CocktailRoom","TheatreRoom","WorkshopRoom","UShapeRoom","Miscellaneous","Catering","instantBookOption","shortDisplay","instantBookOptions","mapSpaceFeaturesToSelectOption","roomEquipmentRequiredOptions","internalRoomTypeRequiredOptions","externalRoomTypeRequiredOptions","roomDetailsRequired","roomCateringAvailable","SpaceFilterReason","filterSpacesByAppliedFilters","formFilters","spaces","currentUser","isStaffMap","instantBook","some","onlyCatering","featureFilters","formFiltersEmpty","options","rulesCount","ruleReason","excludedByFiltersCount","statusMap","filteredSpaces","space","Space","raw_space","building","zones","rules","rulesForSpace","booking_rules","reason","valid","hide","hasAllFeatures","internalRoomTypeFilters","every","featuresArray","canBook","bookable","matchesType","bookingType","internal_or_external","hasCatering","has_catering","status","statusFromBookings","Booking","auto_approve","group","is_recurrent","availableOccurrences","totalOccurrences","buildingsInSameCity","meta","alternateBuildings","locationItem","specificReason","None","Filters","OfficeRules","AlternateBuildingsFound","DEFAULT_BOOKING_DURATION","internalBookingTypeOption","allBookingTypeOption","bookingTypeOptions","defaultRoomSizeOption","roomSizeOptions","roomSizeOptionsKiosk","roomCapacityToValue","roomSize","roomMaxCapacityToValue","roomFormDataToQuery","filteredLocationIds","groupChild","locations","capacity","capacity_max","is_multiroom","merged","recurrence_period","recurrence_interval","recurrence_endTz","recurrence_count","recurrence_starts","recurrence_exceptions","recurrence_days","ignore","now","defaultTestBookingForm","selectBookingFormsData","bookingForm","selectActiveForm","is_local_tz","building_tz","endTzDate","recEditingSearchPayload","SeriesAction","EDIT","selectBookingType","selectBookingLocations","groupHeader","selectIsInternal","selectFormFilters","selectRoomResultsFromState","roomStateSelector","loadRoomsForResults","model","selectRoomResultsFromState_map","loadRoomsForResultsMap","selectLaterThatDayResultsFromState","loadLaterThatDayResults","selectNextDayResultsFromState","loadNextDayResults","selectByIdResultsFromState","loadByIdResults","selectDiffSizeResultsFromState","loadDiffSizeResults","selectHomepageBookingsResultsFromState","selectUpcomingBookingsResultsFromState","selectPastBookingsResultsFromState","selectCancelledBookingsResultsFromState","selectBookingByIdResultsFromState","filterSpacesByAppliedFiltersIfSuccess","mutate","selectFilteredResults","selectMapFilteredResults","selectFilteredLaterDayResults","selectFilteredNextDayResults","selectFilteredByIdResults","selectFilteredDiffSizeResults","selectSelectedBuildingOptions","MAX_ABBREV_LOCATIONS","mapBuildingToSelectOption","dropdownOverride","code","address","groupId","mapCityToAllSelectOption","flattenDisplayOffices","grouped","toggleSelectedByGroup","selectedOptions","option","toSelect","selected","newGroup","remainingChildrenInGroup","o","ng","truncateLocationList","truncatedLocations","shouldTruncate","mapBuildingLevelToOption","level","flattenBuildingsWithLevels","flattenedLevels","placeholderRoute","num","setupRoomImages","componentReference","image_positions","rootFolderURL","fileSlug","imagesLoaded","foundImages","path","n","desiredImageName","desiredImage","pathname","tester","Image","onload","loadImages","src","bookingStatusDetails","image","text","title","roomHasCateringHours","catering_hours","cateringAllowed","disallowedStatus","opens","closed","end","openMinutes","closeMinutes","startOfDay","cateringOpenTime","cateringCloseTime","checkCollisions","service","availabilityParams","room_ids","breakdown","hide_bookings","recurrence_type","icaluid","available","start_time","end_time","has_conflict","bkn","b_setup","b_breakdown","recurrence_master_id","getStatusErrorMessage","RoomResultsViewModel","levelDisplay","short_name","local_name","office","mapResultsToViewModels","BookingStateService","_org","_spaces","ngZone","_poll","_long_poll","_long_poll_week","_bookings","_noOfMeetings","_filters","_dateTz","_loading","_state","combineLatest","filtered","bdTz","booking_date","startTz","endTz","endOfValue","filterBookings","shareReplay","filtered_week","bd","getEndOfWeek","filtered_month","search","debounceTime","switchMap","fzone","queryBooking","zone_ids","available_from","available_to","search_long_week","querySpace","space_list","processBookings","dailyCount","days","daily_count","buildSpaceLongQuery","counts","details","runOutsideAngular","interval","updateRoomList","new_bookings","concat","undo","attempted_to_delete","bkg","booking_master","period","replaceBookings","room_email","fromTz","toTz","intersects","timePeriodsIntersect","roomSatisfiesConditions","multi_rooms","room","in_zone","has_space","space_emails","in_zones","declined","getType","show","hide_type","dateWeekday","time_changed","SettingsService","is_concierge","nowTz","defaultTitle","defaultLocalTimezone","Intl","DateTimeFormat","resolvedOptions","timeZone","defaultBuildingZone","defaultOrgainiser","User","active_user","defaultBookingType","building_zone","booking_type","attendees","organiser","creator","booked_by","room_setup","room_breakdown","notes","equipment_codes","equipment_code","expected_attendees","headcount","check_ins","notify_users","company","booker","booker_concierge","level_zone","opt_out","outlook_opt_out","multiroom_master_id","room_id","findSpace","roomsData","roomId","newRoom","defaultStartTz","startEpochProvided","startDateTzProvided","round","created_epoch","all_day","show_as","approvalStatus","approval_status","catering","CateringOrder","edited_fields","edits","values","occurrence_edits","recurrence_end","occurrence_ids","occurrence_details","author","isEdit","opts","note","handleRecurrenceFields","recurrence_list","location_name","from_room","approve","old_start","old_end","creation_date","creationDateTz","cateringOrders","allAttendees","checked_in","checkInsArray","has_visitors","occurence","getTime","shift","_recurrence_endTz","byRequest","tentative","isAnyRoomDeclined","delivery_time","getTimezoneOffsetString","abs","dateDiff","displayEndDateTz","external","buildingTzDt","isBeforeDate","isAfterDate","recurrenEndFromOcurrences","mergeCateringOrders","order_list","orders","order","location_id","booking_timezone","BOOKING_STATUS","MINUTE","HOUR","DAY","WEEK","MONTH","DURATION_MAP","months","week","weeks","bookingOptionsToQuery","property","until","getFreeBookingSlots","min_size","dateTzMs","slots","bkn_start","bkn_end","getNextFreeBookingSlot","date_","block","generateBookingForm","use_fields","isConcierge","manualTimezone","user_service","current_user","current","FormControl","disabled","Validators","required","validators","minLength","updateOn","needs_space","is_before_date","setValidators","validateEndTime","disable","dateValidators","isFuture","validDateTZ","updateValueAndValidity","list_length","valueChanges","expected","codes","new_expected","new_codes","space_needed","simplified_fields","handleAllDay","clone","enable","occurrences","RecurrencePeriod","LIST","occurrence","CLONE","BookingAction","start_dateTz","d1","d2","_recurr_end","fields_with_recurrence","WEEKLY","recurrence_pattern","arrayWithValues","FormGroup","control","validDate","isSameDate","JSDate","getMinLength","rule_list","min","min_block","min_length","conditions","stringToMinutes","durationGreaterThanOrEqual","duration_1","duration_2","requestable","free_slots","next_free_slot","currently_free","time_until_next_block","free_tomorrow","free_today","available_until","spaceStatusToDisplay","filter_options","filtered_list","updated_list","start1","end1","start2","end2","formatWhen","startTZ","endTZ","displayEndTZ","isIncludes","searchVaue","searchRoomsAndBookings","allItems","searchValue","relevantItems","filteredItems","duplicateMultiroomEntriesIfAny","updatedBookings","duplicatesCount","duplicatedBooking","cloneDeep","BookingsService","setService","uniqueId","respond","series","toApiJSON","taskObsr","requests","booking_id","forkJoin","BookingsPaginatedService","getHoldingBay","queryHoldingBay","response","PaginatedAPIService","space_rules_for_user","rule_block","checkRules","ruleset","max_length","counter","condition","groups","j","last_location","check","CateringCategoriesService","CateringCategory","is_category","must_select","order_anytime","CateringItem","_amount","instance_id","from_month","to_month","description","prior_notice","notice","unit_price","price","supplier_cost","minimum_quantity","maximum_quantity","parent_categories","category_ids","categories","image_path","admin_only","restricted_from","root_category_restricted_from","catering_type","amount","allergy","cateringItems","filteredCateringItems","out_of_stock","availableItems","substr","expired","anytime","can_order_anytime","CateringItemsService","CateringMenuService","CateringNotesService","cateringNotes","hasBookingAttached","bookingDateTz","charge_code","kitchen","pantry","symbol","total","deliver_date","mergeCateringItemWithFormData","existing","override","CloseDialogService","dialogRefMap","dialogRef","close","DialogIds","CollapseService","collapseSubject","collapse$","DataCommonModule","INVALID_STANDALONE_KEYS","HotkeysService","keydown_states","keydown_observers","combo_end","registered_combos","addEventListener","mapKey","last_down","preventDefault","combo","combination","validCombination","last_key","updateCombinationEndList","presses","key_list","non_meta","MapLocation","map_id","desk_id","normalise","x_max","Organisation","BuildingLevel","levelWithID","fixed","confidence","at_desk","bld","building_id","LocationService","Building","disc_info","discovery_info","extras","extra_id","extra_name","loan_items","_roles","roles","_lockers","lockers","locker_structure","_systems","systems","_phone_numbers","phone_numbers","_location","longitude","latitude","searchables","neighbourhoods","lvl","lvl_features","level_id","booking_details","catering_restricted_from","currency","requires_equipment_code","requires_expected_attendees","holding_bay","visitor_space","sort_order","_data","bld_id","level_name","lower_name","map_url","floor_type","available_buildings","OrganisationService","_users","_spaceTypesSubject","_organisation","ids","bld_list","_active_building","organisation","loadOrganisation","loadLevels","space_types","loadSpaceTypes","tags","org_data","bld_data","lvl_data","type_data","types","getOrganizationFiltersByRoomType","internalSubSet","getRoomTypeSubsetDDOptions","filterOptions","setItem","DaysOfWeek","RepeatsOn","recurrencePeriodToDurationType","DAILY","ABSOLUTE_MONTHLY","generateWeekDays","params","start_week","week_days","activeDate","active","full_name","day_index","getFirstDateFromList","getLastDateFromList","recurrenceDetails","recurr","getPeriod","recurrenceRecurringDetails","removeExpiredOcurrences","controls","tz","date_now","setStartAndEndDateFromArray","dates","setRecurrenceStartsTime","dateHour","Report","cleanData","txt","charAt","UNIX_timestamp","getMonth","getHours","suffix","getMinutes","timeConverter","formatCancelledBy","room_field","price_field","row","space_service","org_service","CurrencyPipe","transform","organizer","person","isCancelled","cancelled_by","cancelled_date","cancelled_at_epoch","remove_fields","output","idx_a","idx_b","csv_json","ReportsService","fromCSV","_service_list","findIndex","provider","provideFor","useValue","SETTINGS_TOKEN","SettingsObject","_app_name","_overrides","_observables","_bypass_bookings","VERSION","built","semver","hash","override_settings","Inject","OPTION_DEFAULTS","SpaceEquipments","SpaceStyles","EMPTY_ARRAY","allowStaffRoomWithBookings","room_style","equipment","bypass_bookings","defaultGlobalName","defaultSettings","room_name","support_url","features","extra_features","room_type","simple_name","rulesFor","nowMs","runningBookings","bks","startEpoch","endEpoch","spaceWithBookings","roomType","natural_light","Set","recurrence_availability","availabilityOptionsToQuery","hide_declined","blds","bld_b","a_has_zone","b_has_zone","SPACE_LIST","SpacesService","queryRooms","updateSpace","uploadSpacePhotos","setList","filterAvailableSpaces","faker","SERVICE","generateMockOrganisationService","jest","generateMockBuilding","getRoomFilterOptionsPerLocation","generateMockDataService","generateMockSpacesService","generateMockUsersService","loadCurrentUser","bookingState","setZone","setDate","setFilters","remove","startPolling","startPollingMonth","startPollingWeek","startPollingEveryFiveMin","test_app","logo_light","background","logo_dark","heap_io","force_ssl","secure_cookie","disable_text_capture","cookie_path","TEST_SETTINGS","app","generateMockSettingsService","overrides","provideMockSettingsObject","provide","generateMockAppService","settingsOverrides","notifyInfo","notifyWarn","notifySuccess","notifyError","navigate","navigateBack","Composer","Hotkeys","Users","Locations","Base","Menu","Spaces","Bookings","Reports","CateringItems","CateringCategories","Settings","generateMockUser","booking_list","fill","generateMockBooking","mockReturnValue","save","addFrom","removeFrom","clearList","removeFromList","accept","decline","checkin","is_logged_in","queryRoomsForQR","queryObsr","checkinIndividualVisitor","updateObsr","mockImplementation","SPACE_COUNT","generateMinimalRoomDetails","generateMockSpace","space_id","recurring_search","lastName","room_booking_screen","vc","linked","commerce","productName","searchable","controlable","hourly_rate","sort_priority","business","USER_DOMAIN","BOOKING_COUNT","BOOKING_DATE","setMockBookingStartDatetime","visitor","generateMockCateringOrder","menu","date_start","users","lorem","paragraph","BLD_COUNT","LVL_COUNT","generateMockLevel","levelGenerator","firstName","test","nested","level2","org","USER_COUNT","USER_EMAILS","companyName","delegates","delegate_count","first_name","last_name","phone","phoneNumber","department","staff_code","avatar","pickMenuItem","menu_map","category","generateMockLocation","fixed_locations","maps","ORG_COUNT","generateMockOrganisation","generateMockBuildingSetByCity","generateMockModalData","pendingDate","pendingDuration","mockDateToBuildingTz","windows_id","mobile","business_unit","organisation_id","organisation_name","officeLocation","desk","generateUserForm","pattern","maxLength","UsersService","uhttp","expiry","reload","client_id","Md5","hashStr","go","append","authorise","logout","tries","locate","loadDelegates","promises","del","all","HAS_ERROR","buildValidateDate","validateDate","is_from","buildValidateStartTime","validateStartTime","date_obj","buildValidateDuration","validateDuration","buildValidateAttendees","validateAttendees","invalid","dateControlTz","noWhitespaceValidator","isWhitespace","trim","whitespace","date_org","local_tz","zoneName","compare_to","unit","ans_unit","newDate","startOf","monday","sunday","later","endOf","isLastDayOfMonth","minus","hasSame","dateYear","dateMonth","dateDay","trunc","toSeconds","toUTC","toJSDate","getDay","convertLocalTimestampToTimezonedDateTz","buildingTimezone","convertTimezonedTimestampToLocalDateTz","localOffset","getTimezoneOffset","desiredOffset","eleA","localTimezone","offset_minutes","toMiddayUTC","timezoneOffset","EnvironmentModule","providers","ENVIRONMENT_TOKEN","EnvironmentService","environment","production","BookingConfirmComponent","_booking_state_service","_router","_dialog","_dialog_ref","closeDialogService","renderer","EventEmitter","show_attendees","lastMomentConflict","old_booking","is_request","approved","bookingDetails","bookedBy","disableClose","checkSpaceAvailability","newEmail","replaceObjects","constructor","replacement","nk","buffer","elem","has_note_buffer","updated","master_booking","pollOnce","closeDialog","MeetingDetails","emit","erroMessage","queryParams","ref","open","ConflictsModalComponent","maxWidth","width","local_room_name","conflicts","copy_conflicts","componentInstance","clipboard","writeText","conflictsText","afterClosed","listType","collapseList","attendeesListRef","expandList","show_locations","locationsListRef","show_orders","cateringListRef","listRef","listElement","listItems","getElementsByClassName","totalHeight","offsetHeight","setStyle","addClass","removeClass","duration_value","recurrenceDates","a_space","dateTZ","MAT_DIALOG_DATA","Component","templateUrl","styleUrls","Output","ViewChild","$event","BookingFormComponent","cdRef","user_list","fromDateTz","untilDateTz","localStart","localEnd","chipOptions","showTimeCateringWarning","updateCoachmarkTimes","skip","distinctUntilChanged","recurrenceStarts","clearValidators","arrayValidators","disableInputs","checkTimeCateringWarning","has_id","is_edit","patchValue","SpaceSelectModalComponent","multiple","needsCatering","noCatering","NewUserModalComponent","detectChanges","localTzOffset","buildingTzOffset","toggledControlName","startDateTime","fromISO","endDateTime","bookingDate","dayStartAt7am","dayEndAt8pm","markForCheck","changeDetection","ChangeDetectionStrategy","OnPush","BookingCateringConfirmModalComponent","CateringDetailsModalComponent","_cateringNotesService","head_counts","needs_charge_code","active_space","note_list","notes_field","generateFormFields","markAllAsTouched","is_valid","new_notes","setNotes","_scrollToBottom","_content_el","scrollTo","top","scrollHeight","left","behavior","active_form","errors","minlength","submit","CONFIRM_METADATA","maxHeight","ConfirmModalComponent","DECLARATIONS","NoCateringModalComponent","RequirementDetailsModalComponent","UserFormComponent","LegacyOverlaysModule","LegacyUiModule","FormsModule","ReactiveFormsModule","UiModule","EditorModule","new_user","confirm","cancel","codes_field","head_counts_field","firstSpaceEmail","head_count","anySpaceNeedsChargeCode","roomBasedEqCode","officeBasedEqCode","change$","selected_spaces","request_map","formGroup","triggerSearch","savedSelection","request_id","search_results$","active_building","resp","active_type","_space","setDefaultBuilding","grouped_by_city","city_buildings","noCateringDialogRef","panelClass","autoFocus","backdropClass","defaultBld","opt","space_a","space_b","withLatestFrom","formData","ActionIconComponent","hasSelectionRequirements","getActiveList","CateringMenuItemComponent","initial_state","an_cat","setAmount","cat","an_item","updatePackageSelection","setPrice","selectPackageOptions","confirmed_item","cart_item","active_items","updatedList","PackageOptionsModalComponent","done","a_list","animations","checkItemRequirements","getActiveItems","a_package","needed","CngSearchBarComponent","placeholder","totalFoundItem","showSrchWarning","searchStr","configChanges","clearSearch","box","onSearch","resetSearch","HoverClassDirective","elementRef","hoverClass","classList","ActionFieldComponent","show_tooltip","performAction","CounterComponent","useInput","previous_value","handleTimeout","ctrl_key","shift_key","new_value","changeInput","Number","isNaN","_onChange","_onTouch","NG_VALUE_ACCESSOR","useExisting","forwardRef","multi","DateFieldComponent","_from","position","onChange","old_date","new_d","new_date","_trigger","closeMenu","openMenu","_to","years","menuOpen","MatMenuTrigger","openDatePicker","closeDatePicker","DurationFieldComponent","specialPreprops","duration_options","generateDurationOptions","blocks","TimeFieldComponent","no_past_times","show_select","_time_options","generateAvailableTimes","select_field","focus","openedChange","datestamp","show_past","showSelect","UserListFieldComponent","search$","search_str","match_name","match_email","inputAutoComplete","openPanel","closePanel","active_list","a_user","file","files","reader","FileReader","readAsText","evt","processCsvData","srcElement","endsWith","addUser","template","MatAutocompleteTrigger","addUsersFromFile","downloadCSVTemplate","read","UserSearchFieldComponent","resetSearchString","onInputChange","FeedbackComponent","updateRoute","NavigationEnd","current_page","IconComponent","PopoutMenuComponent","SearchbarComponent","UserAvatarComponent","MATERIAL_MODULES","MatButtonModule","MatSnackBarModule","MatDialogModule","MatFormFieldModule","MatInputModule","MatProgressSpinnerModule","MatProgressBarModule","MatAutocompleteModule","MatSelectModule","MatChipsModule","MatRippleModule","MatMenuModule","MatCheckboxModule","MatTooltipModule","MatRadioModule","MatTabsModule","MatSlideToggleModule","ACA_PIPES_MODULE","valueChange","autofocus","focusField","input_field","actionPrefix","stateKey","buildAction","postfix","clear","wrapLoading","selectData","warn","selSuccess","selectSuccess","selOptionalSuccess","selectOptionalSuccess","selError","selectOptionalError","selLoading","selectIsLoading","actionObject","caller","flatMap","isLoading","hasError","hasSuccess","_success","isEmpty","isSuccess","isError","hasLoaded","shouldLoad","selectIsSuccess","selectIsError","selectHasLoaded","selectIsEmpty","generateMockActions","dispatcher","Actions","verifyActionSuccess","effect","expect","toBeDefined","toStrictEqual","verifyActionError","organisationStateSelector","OrganisationEffects","organisationService","OrganisationModule","organisationReducer","initialState","rooms","loadRoomsWithQuery","selectRoomResultsSuccess","RoomsEffects","spaceService","afterRequestResultsLoadOthersEffect","laterThatDayFromDateTz","nextBusinessDay","diff_capacity","loadRoomsForResultsEffect","roomQueryOptionsToSpaceAvailabilityOptions","loadRoomsForResultsMapEffect","loadLaterThatDayResultsEffect","loadNextDayResultsEffect","loadDiffSizeResultsEffect","loadRoomByIdResultsEffect","roomByIdQueryOptionsToSpaceAvailabilityOptions","RoomsModule","roomsReducer","initialRoomsState","byid","todayFromDate","retDate","mapRoomToSelectOption","resultCountObservable","loadingObservable","resultsObservable","viewModelLength","deepDistinctUntilChanged","deepEqual","filterUndefined","RxUtilsModule","AcaDatePickerComponent","klass","show_last_selection","min_offset","max_offset","date_list","month_name","days_of_week","day_format","month_format","generateMonth","generateDaysOfTheWeek","updateOptions","counters","difference","today","end_","non_month","_change_timer","new_offset","updateDate","changeMonth","AlertMode","AlertBannerDisplay","AlertBannerComponent","mode","Warning","showClose","V1","iconPath","materialColor","closeIcon","_onModeChange","Coachmark","BlueCoachmark","AutoCompleteChipSelectItemComponent","optionSelected","feedbackOutput","chipsCleared","onClickConfirm","selectOnlyOneGroup","localFilter","selectOnlyOneGroupChange","separatorKeysCodes","ENTER","COMMA","filterFormControl","focused","mobileFullScreen","autocompleteOptions","filteredAutocompleteOptions","enableCTAs","hasChips","scrollEvent","panelOpen","contains","onFocus","blur","valueAccessor","color","enabled","selectedGroupHeader","getFilteredAutocompleteOptions","groupHeaders","g","searchString","exactMatches","moreOptions","joinedOptions","groupIds","parents","jo","matInput","feedbackInput","useCTAs","focusIn","fromPanel","componentInput","loseFocus","isDisabled","spl","removeEventListener","dirty","touched","keyedInput","onPanelFocusChange","selectOption","encapsulation","ViewEncapsulation","Self","Optional","GroupHeaderPipe","hasHeader","displayAsHeader","AutoCompleteSelectOptionComponent","filteredOptionsChange","inputTextChange","emptyBoxEvent","_options","updateFilteredOptions","selectedValue","resetInput","filteredOptions","startWith","_filter","filterValue","filterValues","matchesAll","onChangeInput","BaseTemplateComponent","vcRef","isRendered","attemptViewEmbed","createEmbeddedView","TemplateRef","CateringDropComponent","onCancel","onConfirm","CngSelectOptionsComponent","CngSelectComponent","isClosed","defaultSelected","onChangeCallback","DropdownTriggerForDirective","overlay","viewContainerRef","isDropdownOpen","dropdownClosingActionsSub","EMPTY","isPanelOpened","destroyDropdown","openDropdown","ddWidth","dropdownPanel","offsetWidth","overlayRef","create","hasBackdrop","scrollStrategy","scrollStrategies","positionStrategy","flexibleConnectedTo","withPositions","originX","originY","overlayX","overlayY","offsetY","templatePortal","TemplatePortal","templateRef","attach","dropdownClosingActions","backdropClick$","backdropClick","detachment$","detachments","dropdownClosed","merge","detach","dispose","CollapseHeaderComponent","collapseService","expandedIds","updateSectionIdOnOpen","isExpanded","collapseSubscription","expansionPanel","isOpen","expandedTitleId","updateOpenedSectionId","ConflictAlertModalComponent","dialogData","callback","dateIsToday","CustomSnackbarComponent","snackBar","dismiss","snackType","MAT_SNACK_BAR_DATA","closeSnackbar","SnackBarService","verticalPosition","horizontalPosition","_snackType","openFromComponent","DateTzCalendarWidgetComponent","className","selectedDateTz","_today","registerOnChange","registerOnTouched","startOfMonthDateTz","DateTzDatePickerComponent","icon_only","onSelect","can_pick_today","selectedDateTzValue","resetToLastSelection","_acaDatePicker","initialDateSelectionTz","writeValue","newValueTz","newDateTz","onDatePickerClose","DateTzDurationFieldComponent","defaultDurationGroups","DEFAULT_DURATION","currentStartDateTz","nearestStep","placeHolderOption","selectedOption","generateDurationOptionsFromGroups","extended","dopt","DateTzTimeFieldComponent","noPastTimes","show_current","startFromDateTz","selectedTimeString","generateAvailableTimesTz","generateOptionForDateTz","os","timeOptions","displayString","newTimeTz","setSelectedValues","ErrorMessageComponent","CalendarIconComponent","ChevronIconComponent","CloseIconComponent","InformationalImageComponent","LabelComponent","LegendDropdownComponent","placeholderOpen","MckDatePickerComponent","dateValue","initialDateSelection","goToToday","secondarySubmit","primarySubmit","ModalButtonRowComponent","primaryDisabled","disableFixed","secondaryDisabled","smallButtons","ModalComponent","shouldClose","OverrideChangesModalComponent","getDateString","epoch","toISOString","uniqueDates","filteredEdits","dateString","has","FilterPipe","searchText","objectKey","splitKeys","it","included","SecurityContext","SanitizePipe","sanitizer","sanitize","RESOURCE_URL","URL","SCRIPT","STYLE","HTML","RadioSelectComponent","RecurringBookingForm","recurrence_types","PATTERN","DATE","recurrencePeriod","current_type","pattern_form","recurrencePatternFormControl","RecurrencePatternForm","onChangeType","RecurrenceDateForm","selected_dates","setPickerToGivenDate","tempForSort","start_date","formDateTz","is_selected","setDateTzForm","dateTsValue","addDate","fromStartTz","untilTz","repeat_period_options","validateRecurrenceInterval","repeat_every_options","recurrenceIntervalFormControl","fromEndTz","setEndDateFromStartDate","recurrenceDateStartTzFormControl","recurrencePeriodFormControl","generateMaxIntervals","recurrenceDaysFormControl","current_days","generateOcurrenceList","recurrenceEndFormControl","end_date","updateActiveWeekday","updateValidators","date_diff","periodToDurationType","first_date","recurr_days","daysInMonth","_week_days","new_day","current_index","setRepeatEvery","setRepeatPeriod","SelectOptionComponent","ignoreDisabled","noEntriesFoundLabel","SelectComponent","searchEnabled","splitDisplay","showDivider","SelectedChipCountComponent","SpacerMode","SpacerComponent","Horizontal","SwitchGroupComponent","optionChecked","closestTimeSlot","buildingDate","newTime","ToggleComponent","selectedChange","TooltipComponent","isVisible","TooltipPosition","DEFAULT","theme","TooltipTheme","tooltip","visible","TooltipDirective","appRef","componentFactoryResolver","injector","showDelay","hideDelay","componentRef","triggerType","hasTrigger","initializeTooltip","setHideTooltipTimeout","touchTimeout","bind","componentFactory","resolveComponentFactory","attachView","hostView","rootNodes","tooltipDOMElement","setTooltipComponentProperties","showTimeout","showTooltip","instance","getBoundingClientRect","right","bottom","BELOW","ABOVE","RIGHT","LEFT","hideTimeout","detachView","MatIconModule","MatExpansionModule","OverlayModule","NgxMatSelectSearchModule","NgxSkeletonLoaderModule","ZoomWarningComponent","entryComponents","ALL_DAY_BOOKING_VALUE","showPast","inputDate","allDayOption","oneWeekOption","onCloseClick","loadUser","selectUserState","selectHasUserData","UserEffects","userService","UserModule","userReducer","initialUserState","webpackEmptyAsyncContext","req","module","routes","component","ShellWrapperComponent","children","loadChildren","BookingModule","redirectTo","AppRoutingModule","RouterModule","forRoot","useHash","AppComponent","_app","_route","val","navigationTrigger","cleanHash","isLoadBookingUrl","isLoadCateringUrl","adjustZoom","clientWidth","isMobileOrTablet","vendor","maxTouchPoints","mobileAgents","localStorageSyncReducer","reducer","localStorageSync","rehydrate","metaReducers","AppModule","MAT_LABEL_GLOBAL_OPTIONS","DEFAULT_SETTINGS","BrowserModule","BrowserAnimationsModule","HttpClientModule","ComposerModule","SharedContentModule","StoreDevtoolsModule","instrument","maxAge","logOnly","MapModule","bootstrap","CalendarDateWidgetComponent","show_add_item","show_events","retainSelectedDate","dateChangeTz","timezone_value","event_map","dateInputTz","changeDate","noOfCount","applyDatePickerValue","BookingCalendarWrapperComponent","BookingCalendarRoutingModule","forChild","settingService","TopBarHeaderMode","backRoute","orgBuildings","onBackCallback","bookingModuleDeclarations","StaffCalendarComponent","DayViewTimelineComponent","DayViewSpaceComponent","DayViewSpaceEventComponent","CngMenuItemComponent","bookingModuleImports","BookingCalendarModule","router","onChildSelect","node","overlap","calculatePosition","storeOrder","view","shown_date","from_previous_day","toFixed","overflow_top","overflow_bottom","timeBasedStatusLabel","userEmail","time_period","userName","cdr","legend","eventMovingLoader","inView","dragging","moving","event_list","overlap_details","position_list","time_blocks","generateTimeBlocks","filterEvents","checkInView","last_update","calculateOverlaps","override_state","isRecurrentMaster","isRoomEmailMatch","isIncludedInSetupOrBreakdown","overflow_only","collisions","cmp","cmp_start","cmp_end","in_view","offsetLeft","delta","pointerPosition","scroll_top","top_minutes","selectedBlockStart","selectedBlockEnd","hasValidBreakdown","active_level","foundSearchLength","searchedCounter","levelsDD","paramMap","updateLevel","initSpace","numeric","ignorePunctuation","roomLevelDD","ddBoxClass","onChangeActiveLevel","generateBuildingMenu","filterd_booking","menuItem","displayName","iconName","buildingLevels","buildingMenuItems","activeBuildingName","searchBooking","updateDateTz","UPDATE_INTERVAL","scroll_left","scroll_offset","filtered_spaces","loading_space","space_zones","is_today","modalInitialized","isEventMoving","scroll_area","initSpaces","updateTime","virtualScroll","space_type","stopPolling","scrollIntoView","queryParamMap","view_id","spaceJson","active_hour","searchData","column","spaceId","bookingEl","timeoutID","scroll_box","date_percent","scrollWidth","CdkVirtualScrollViewport","clearSelected","updateScroll","BookingConfirmationComponent","Light","placeIntoModal","statusText","confirmed","isUnavailable","Urls","Help","modal","dispatch","ocurrence","specificDates","u","generateFeedbackUrl","currentPage","BookingCreateComponent","selectedRoom","bookingFormToBooking","updateConfimatinModal","unavailable","_bookings_service","handleBookingSuccessResponse","handleBookingErrorMessage","displayWarningBanner","BookingFormBaseComponent","BookingEditWrapperComponent","BookingEditComponent","updateCallback","isEditSeries","roomEmail","bk","getNotes","isEquipmentNote","isCateringNote","booking_form_data","formToAttendees","formToCompany","updateNotes","closeCallback","dialog","invalidForm","showWarningBanner","submitTimestamp","has_delegate","saveChanges","raw_user","nameParts","companies","custom","warningMessage","bookingData","setupOrganiser","setupNotes","track","dataForConfirmation","endDateString","timeString","durationString","isConflictWithOccurences","openRecurrenceConflictsModal","totalConflicts","is_conflict","total_Conflicts","recurr_ref","bookingTypeLabel","recurrenceStart","requestedEndDateTz","endDatestring","BookingDetailsModalComponent","expandedLocation","isRecurrentBooking","isMultiroomBooking","byIdResults","expandedAvailability","showInfoBanner","showCatering","disableSeriesEditButton","disableCancelButton","disableEditTimeButton","disableUpdateDetailsButton","_specific_dates","roomLocation","street_and_city","initDisplayValues","displayCancelModal","cancelBooking","addCatering","roomHasCatering","hasLoaderUrl","available_fields","fromEvent","throttleTime","tap","showDetails","dispatchToGetFloorCurrentStatus","hostEmail","roomName","attendeesString","chargeCode","mapUrl","extendableMaximum","focusedRoom","checkingExtendable","receiptionEmail","reception_email","companyString","setAlternativeWeekStartDate","requirements","orgStatus","recentlyExpired","statusImage","findMaxExtension","fetchRooms","invalidDueToOfficeRule","alertIfItHasConflict","flag","setupInSeconds","breakdownInMinutes","gapInMinutes","editingSeries","roomOption","recurringBookingData","rec_endTz","getLocation","clearFormAndResultData","dialog_ref","RoomBookingModalComponent","navigateTo","navigateT0Search","relativeTo","refresh","CancelBookingModalComponent","legth","dialogRefX","BookingDurationModalComponent","maximum","updateBookingState","alternativeWeekStartDateTz","pendingChanges","roomRules","hasCateringOutsideHours","confirm_drop","saveBooking","displayInfoBanner","global_name","isBookable","isAvailable","headerText","buttonLabel","allWeek","startOfWeek","specific_dates","show_fields","getRawValue","closeModal","steps","updateBookingDuration","bookingSelect","BookingResultItemComponent","small","timeStringParts","localTimeStringParts","isAnotherTimezone","setupDisplayFields","viewModel","timeRangeString","bkn1","bkn2","RoomResultsComponent","RoomFiltersModalComponent","RoomDetailsComponent","ManageBookingsComponent","OfficeFloorComponent","RoomBookingComponent","BookingRoutingModule","BookingsListingComponent","BookingCateringComponent","BookingCateringOrderDetailsComponent","BookingCateringOrderListComponent","CateringMenuCategoryComponent","CateringOrderListItemComponent","SearchedLocationComponent","ResultsHeaderComponent","RoomAvailabilityPreviewComponent","RoomLocationPreviewComponent","RoomResultItemComponent","RoomBookingFormComponent","RoomBookingDetailsFormComponent","RoomResultsPaginatedComponent","RoomFiltersFormComponent","RoomResultsSectionComponent","RoomAvailabilityPreviewModalComponent","OrderTableComponent","SurveyModalComponent","CalendarModule","DateAdapter","useFactory","adapterFactory","OfficeFloorMapModule","bookingResults","showBookings","reloading","totalRecords","pageLimit","bookingPerPage","filteredByHost","getViewModel","prevPage","setPage","nextPage","prevGroup","pages","nextGroup","gotoPage","page","activeTab","sort_asc","sort_desc","reverse_sort","allBookings","filterBySelectedHost","originalArray","subarrayLength","newArray","$change","selectedHost","searchBookingBy","isHostChanged","searchHost","filterBookingsBySearchValue","filteredBookings","lastPage","splitArrayIntoSubarrays","getBuilding","page_idx","dontShowReloading","p","startPosition","maxed","mined","canceled","buildingAddress","next_disabled","combineItems","newItems","oldItems","itemsObj","active_order","an_order","reduceItems","reduceOrders","consolidatedOrders","deliveryTime","openCateringDetailsModal","_menu","category_list","available_times","matched_items","available_categories","within_category_restricted_time","initForm","_input_el","show_search","loadMenu","generateStartAndEndTimes","space_email","building_time","cat_start_time","cat_end_time","within_restricted_time","has_available_items","out_of_hours","form_controls","confirmOrder","edit","newOrder","previous","bookingTypes","searchBarConfig","bookingId","snapshot","verb","initData","closeAll","viewBookingFromEmailLink","replaceUrl","ifUser","host_list","hostOptions","delegateDD","onChangeDelegates","ddOptionBoxWidth","clearPage","BookingResultsViewModel","WAITING_TIME","FloorMapOverlayComponent","selectedRoomId","zoom","MIN_ZOOM_LEVEL","center","CENTER_POINT","availableUntil","untilNextBookingFlag","isTimerActive","timerIndex","fetchRoomWithBookings","userSelectedRoom","calculateRoomBookingTimeInfo","currentStatus","activeBookings","timeRemainingInActiveBooking","timeUntilNextBooking","setupTimer","updateSchedulingEpochs","intervalCall_1","intervalCall_15","determineNextBookingStartTime","parentComponent","roomStatus","nowTime","ts","addMin","nextBookingStartTime","futureBookingsForTheDay","nextBookingStartTimeMs","setUpTime","addSeconds","TIME_SIMPLE","startTimer","childCallback","updateRoomData","isOverlayOpened","adjustedTime","timeSlot","end_epoch_15","end_epoch_30","timer","currentTime","endTime","availableTimeToBook","minutesRemaining","secondsRemaining","setup15MinTimer","addjustedTime","futureBookings","endEpoch30","latestBookingStartTime","timeDiffMs","diffInMs","diffInHours","diffInMinutes","roomSelected","roomDataCallback","confirmBooking","MAP_OVERLAY_DATA","Emulated","MAX_ZOOM_LEVEL","mapSpaceStatusToDisplay","mapSpaceStatusToOption","legendOptions","defaultMapBookingRules","defaultMapBookingSubtitle","generateMapStyleForSpace","colorStatusMap","styles","generateMapListenersForSpace","hoverSpace","leaveSpace","clickSpace","listeners","spaceToMapFeature","coordinates","roomToMapFeature","SERVICE_ACCOUNT","mapModuleImports","LibraryModule","mapModuleDeclarations","openHeader","focusedMapSpace","resultBuildings","resultSpaces","activeBuilding","activeLevel","activeSpace","style_map","bookingLocations","buildingLevelOptions","spaceListOptions","activeBuildingOption","activeLevelOption","activeSpaceOption","bookingFormData","bookingConfirmed","getState","floorMap","selection","serviceAccount","self","selectActiveBuilding","spacesFromSelection","colour_map","mapStyle","focusOnRoom","firstBuilding","selectBuildingLevel","OfficeInformationModalComponent","navigationExtras","kioskFormFilter","dayOfWeek","toggleOptions","selectedToggle","selectedToggleChange","retrievedOption","onSelectedChange","queryParamsHandling","submitForm","restrictedDueToCatering","pendingDateTz","updateDisplay","pendingDateString","pendingTimeString","pendingDurationString","currentBooking","mockBooking","pending_date","$value","formControl","localizedStartDate","localizedEndDate","updateDatePickerValue","WEEKEND_DAYS","grey","secondary","primary","blue","red","confirmChanges","handleExpand","updateCalendarWeekView","warnIfItHasConflict","showDatePicker","showWeekend","calendarPopupValue","pendingChange","eventSnapSize","dayRefresh","weekRefresh","addMarginOnConflict","cssClass","resizable","beforeStart","afterEnd","draggable","modal_data","scrollFired","date_span","dateControl","currentBookingStartDate","weekViewDateTz","calendarCenter","viewDateTz","setCalendarValue","setupEventName","transformBookings","expanded","setDislayValues","dayStartHour","tz_offset","week_start_date","week_view_date","weekViewRangeText","backgroundColor","startHour","dayEndHour","bumper","getBumpers","calendarSpan","raw_booking","displayClass","utcStart","utcEnd","adjustedStartDate","utcToZonedTime","adjustedEndDate","assign","milliseconds","updateTileColor","booked","conflict","hasConflict","isEvents","thirty_minutes_in_millis","toDate","buildingTz","localizedStartTime","localizedEndTime","bookingStartTime","bookingEndTime","bstart","bend","newStart","newEnd","iEvent","buildingStartDateTz","buildingEndDateTz","new_start","md","dnd_duration","one_day_in_millis","conflictCheckStartTime","conflictCheckEndTime","buildingStartDate","applyChanges","ele","getElementById","_snackBar","triggerSubmit","validateForm","showHint","searchSubject","selectedUsers","notesHandle","noteValidationClass","selectedCompanies","companyOptions","bookingFormGroup","checkingBreakdown","searchResults","unshift","formRef","onSubmit","inputValue","inputValueEmail","emailRegex","headCountControl","showCancel","cancelSubmit","fromDate","emitEvent","formGroupData","is_past","_checkDateInPast","formGroupDate","closestTz","prevClosestTz","prevDateTz","showManageButtonA","showManageButtonB","showManageButtonC","homepageBookingResults","pastBookingResults","onbeforeunload","upcomingBookings","LearnMore","routeToResults","routeToManageBookings","isAlertDisplayed","roomSubtype","occurenceAvailability","getCurrentNavigation","availabilityStatus","checkAvailabiltyAsPerRule","setRoomSubType","requestedDateTz","endDate","temp","isSpaceValidAsPerRule","goToBackRoute","expandAvailability","updateAvailabilityStatus","primaryCheck","secondaryCheck","removeDateOffset","bookingRoute","isRequest","combinedFeatures","handleClose","expandMap","bookRoom","isInternal","filtersSubmit","getFilters","toggleOptionChecked","submitFilters","Dark","viewMode","featuresRoom","minZoom","setIntervalHandle","initMapZoom","zoomToRoom","_appService","roomSelect","availability","firstChange","coachMarkAction","ROOM_DISPLAY_STEP","ROOM_DISPLAY_START","expanded_section_ids","headerTitle","displayCount","displayViewModels","viewModels","vm","showLoadMore","remainingResults","shouldLoadMore","resultLoaded","loadMore","querySelectorAll","isDom","previouslyLoadedCount","noOfResultLoaded","spaceConflicts","overrideChanges","goToRoomDetail","mainResultViewModels","editing_form","AlternateBuildings","subscribeResultsToViewModels","subName","flattenLevelBuildings","viewModelSubject","resultsLoading","updateCoachMark","coachMarkDisplay","RoomResultsCoachmarkViewmodel","rules_link","levelBuildings","cityFromLocation","actionButtonText","day_offset","mainResults","mainResultsFiltered","laterThatDayResults","nextBusinessDayResults","diffSizeResults","laterThatDayDisplay","mainCoachMarkDisplay","mainResultsCount","laterThatDayCount","nextBusinessDayCount","diffSizeCount","spaceControl","searchStringPresent","nday","despatchLoadRooms","mainResultsSpaces","filteredRooms","selectedMenuIndex","isForFloorMap","selectedSpace","clearRoomSearch","roomIds","collapsePanel","changeSearchResults","overflow","changeClick","filterClick","canFilter","timing","filterDisplay","filterCount","computeDisplay","occEndDate","endRecDate","startDisplay","endDisplay","durationDisplay","FooterMenuComponent","tiles","MapControlsComponent","levelChange","building_details","building_list","level_list","setBuilding","lvl_id","OverlayMenuComponent","showChange","copyright","delayedClose","cancelClose","ResponsiveInlineImagesComponent","imgArr","phase","baseUrl","questions","created_at","updated_at","header_question","header_subtext","answers","questions_id","positive","option_responses","comments","getFeedbackQuestionsFromApi","questionID","checked","$evemt","delayed","TopbarHeaderComponent","backModal","noSurvey","menuChange","onBack","modalOpen","surveyDialogRef","feedbackId","logo","feedback_id","openFeedbackModal","homeOverride","help_url","back","feedback_url","goToFeedback","goToHelp","LoginComponent","username","password","login","setErrors","zoomOutClick","zoomInClick","refreshClick","infoClick","toggleEvent","toggle","MapFiltersComponent","selectedBuildingChange","selectedLevelChange","selectedSpaceChange","searchClick","buildingControl","levelControl","MapOverlayComponent","closeMapOverlayOutlet","closeOverlay","MapSearchComponent","floorData","floorDataParam","refreshFloorNumber","selectActiveSpace","displayOfficeInformation","propagateToggle","zoomIn","zoomOut","resetZoomLevels","info","custom_html","map_rules","other_rules","contact","link","COMPONENTS","CDK_MODULES","ScrollingModule","DragDropModule","CdkTableModule","APipesModule","AInteractiveMapModule","ACustomEventsModule","IvyCarouselModule","placeOs","activatedRoute","userLoading","isQRCode","buildingOptions","oauth_redirect","availibityParams","setSpaceList","bookingRoom","seledtedZone","NavigationStart","checkRoomId","query2","loading_state","initialized","isQRCodeScanedAndReady","mod","Feedback","hmr","general","home","help","columns","booking_types","html_body","multiple_spaces","desk_start","space_display","show_images","directory","show_avatars","min_search_length","explore","can_select_building","show_legend_group_names","show_timeline","General","day_view","dragdrop","hmrBootstrap","ngModule","hot","ApplicationRef","elements","components","makeVisible","createNewHosts","enableProdMode","platformBrowser","bootstrapModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,GAAhB;AAAA,OAApB;AACA37B,YAAM,CAACo9B,GAAP,CAAWrsC,OAAX,CAAmB,YAAM;AACrB,YAAM2L,MAAM,GAAmBygC,QAAQ,CAACvgC,QAAT,CAAkBl7D,GAAlB,CAAsB,OAAA27F,cAAtB,CAA/B;AACA,YAAMC,QAAQ,GAAG5gC,MAAM,CAAC6gC,UAAP,CAAkB1rG,GAAlB,CAAsB,UAAAiJ,CAAC;AAAA,iBAAIA,CAAC,CAACoK,QAAF,CAAWrb,aAAf;AAAA,SAAvB,CAAjB;AACA,YAAM2zG,WAAW,GAAG,MAAAC,cAAA,CAAeH,QAAf,CAApB;AACAH,gBAAQ,CAACz0G,OAAT;AACA80G,mBAAW;AACd,OAND;AAOH,KAdY;;;;;;;;;;;;;;;;;;;;;ACHb;AAAA;AAAA;;AAEA;AAAA;AAAA;;AACA;AAAA;AAAA;;;;;;;;;;AAGA,QAAI,cAAAvwD,WAAA,CAAYC,UAAhB,EAA4B;AACxB,aAAAwwD,cAAA;AACH;;AAED,QAAM96B,SAAS,GAAG,SAAZA,SAAY;AAAA,aAAM,oBAAA+6B,eAAA,GAAyBC,eAAzB,CAAyC,mBAAD,UAAxC,CAAN;AAAA,KAAlB,C,CAEA;;;AACA,QAAI,cAAA3wD,WAAA,CAAY4uD,GAAhB,EAAqB;AACjB,UAAK,KAAL,EAAyB,CAExB,CAFD,MAEO;AACHnqG,eAAO,CAAC4Y,KAAR,CAAc,4CAAd;AACA5Y,eAAO,CAACV,GAAR,CAAY,4CAAZ;AACH;AACJ,KAPD,MAOO;AACH4xE,eAAS,WAAT,CAAkB,UAAAj5D,GAAG;AAAA,eAAIjY,OAAO,CAACV,GAAR,CAAY2Y,GAAZ,CAAJ;AAAA,OAArB;AACH","file":"main-es5.js","sourcesContent":["export * from './lib/animations.module';\nexport * from './lib/angular-animations'\n","import { trigger, transition, style, animate, state } from '@angular/animations';\n\nexport const ANIMATION_SHOW_ENTER_LEAVE = trigger('show', [\n transition(':enter', [\n style({ opacity: 0, height: 0 }),\n animate(300, style({ opacity: 1, height: '*' }))\n ]),\n transition(':leave', [\n style({ opacity: 1, height: '*' }),\n animate(300, style({ opacity: 0, height: 0 }))\n ])\n]);\n\nexport const ANIMATION_SHOW_CONTRACT_EXPAND = trigger('show', [\n state('show', style({ opacity: 1, height: '*' })),\n state('hide', style({ opacity: 0, height: 0 })),\n transition('show <=> hide', animate('200ms ease-in'))\n]);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class AnimationsModule {}\n","export * from './lib/base.module';\nexport * from './lib/types.utilities';\nexport * from './lib/general.utilities';\nexport * from './lib/base.class';\nexport * from './lib/base.directive';\nexport * from './lib/date.utils'\nexport * from './lib/date.spec-helpers'\nexport * from './lib/replace.pipe'\nexport * from './lib/cdk-drop-list-scroll-container.directive'\nexport * from './lib/image.directive';\n","import { Subscription, BehaviorSubject } from \"rxjs\";\n\nexport class BaseClass {\n /** Store for named timers */\n protected _timers: { [name: string]: number } = {};\n /** Store for named intervals */\n protected _intervals: { [name: string]: number } = {};\n /** Store for named subscription unsub callbacks */\n protected _subscriptions: { [name: string]: (Subscription | (() => void)) } = {};\n /** Subject which stores the initialised state of the object */\n protected readonly _initialised = new BehaviorSubject(false);\n\n /** Observable of the initialised state of the object */\n public get initialised(): BehaviorSubject {\n return this._initialised;\n }\n /** Whether the object has been initialised */\n public get is_initialised(): boolean {\n return this._initialised.getValue();\n }\n\n protected destroy() {\n for (const key in this._timers) {\n if (this._timers.hasOwnProperty(key)) {\n this.clearTimeout(key);\n }\n }\n for (const key in this._intervals) {\n if (this._intervals.hasOwnProperty(key)) {\n this.clearInterval(key);\n }\n }\n for (const key in this._subscriptions) {\n if (this._subscriptions.hasOwnProperty(key)) {\n this.unsub(key);\n }\n }\n }\n\n /**\n * Creates a named timer\n * @param name Name of the timer\n * @param fn Callback function for the timer\n * @param delay Callback delay\n */\n protected timeout(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearTimeout(name);\n this._timers[name] = setTimeout(() => {\n fn();\n this._timers[name] = null;\n }, delay);\n } else {\n throw new Error(\n name ? 'Cannot create named timeout without a name' : 'Cannot create a timeout without a callback'\n );\n }\n }\n\n /**\n * Clears the named timer\n * @param name Timer name\n */\n protected clearTimeout(name: string) {\n if (this._timers[name]) {\n clearTimeout(this._timers[name]);\n this._timers[name] = null;\n }\n }\n\n /**\n * Creates a named interval\n * @param name Name of the interval\n * @param fn Callback function for the interval\n * @param delay Callback delay\n */\n protected interval(name: string, fn: () => void, delay: number = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearInterval(name);\n this._intervals[name] = setInterval(() => fn(), delay);\n } else {\n throw new Error(\n name ? 'Cannot create named interval without a name' : 'Cannot create a interval without a callback'\n );\n }\n }\n\n /**\n * Clears the named interval\n * @param name Timer name\n */\n protected clearInterval(name: string) {\n if (this._intervals[name]) {\n clearInterval(this._intervals[name]);\n this._intervals[name] = null;\n }\n }\n\n /**\n * Store named subscription\n * @param name Name of the subscription\n * @param unsub Unsubscribe callback or Subscription object\n */\n protected subscription(name: string, unsub: Subscription | (() => void)) {\n this.unsub(name);\n this._subscriptions[name] = unsub\n }\n\n /**\n * Call unsubscribe callback with the given name\n * @param name\n */\n protected unsub(name: string) {\n if (this._subscriptions && this._subscriptions[name]) {\n this._subscriptions[name] instanceof Subscription\n ? (this._subscriptions[name] as Subscription).unsubscribe()\n : (this._subscriptions[name] as any)();\n this._subscriptions[name] = null;\n }\n }\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\n\n@Directive({\n selector: 'a-very-basic-component-base-that-should-not-be-used'\n})\nexport class BaseDirective extends BaseClass implements OnDestroy {\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NumbersOnlyDirective } from './numbers-only.directive';\n\n@NgModule({\n imports: [CommonModule,],\n declarations: [\n NumbersOnlyDirective\n ],\n exports: [\n NumbersOnlyDirective\n ]\n})\nexport class BaseModule {\n}\n","import {\n Directive,\n Input,\n Renderer2,\n SimpleChanges,\n OnChanges,\n ContentChildren,\n QueryList,\n AfterContentInit\n} from '@angular/core';\nimport { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';\nimport { BaseDirective } from './base.directive';\n\nexport enum ScrollDirection {\n NONE,\n X,\n Y,\n BOTH\n}\n\n@Directive({\n selector: '[cdkDropList][scrollContainer]'\n})\nexport class CdkDropListScrollContainer extends BaseDirective\n implements OnChanges, AfterContentInit {\n /** Direction of scroll to determine updating the position of the drop list */\n @Input() direction: ScrollDirection = ScrollDirection.X;\n /** Name of the scroll container for the list */\n @Input() scrollContainer: string;\n /** Scroll container element */\n public element: HTMLElement;\n /** Last scroll position */\n public last_scroll: { x: number; y: number } = { x: 0, y: 0 };\n\n /** Draggable children elements */\n @ContentChildren(CdkDrag) private items: QueryList;\n\n constructor(private _cdkDropList: CdkDropList, private _renderer: Renderer2) {\n super();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.scrollContainer && this.scrollContainer) {\n this.element = this._cdkDropList.element.nativeElement.closest(\n this.scrollContainer\n ) as HTMLElement;\n }\n }\n\n public ngAfterContentInit(): void {\n this.subscription(\n 'drag_items',\n this.items.changes.subscribe((items: QueryList) => {\n const list = items.toArray();\n list.forEach((i, index) => {\n this.subscription(\n `list-item-${index}`,\n this._renderer.listen(i.element.nativeElement, 'mousedown', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'mouseup', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n this.subscription(\n `list-item-touch-${index}`,\n this._renderer.listen(i.element.nativeElement, 'touchstart', () => {\n this.subscription(\n 'item-dragged',\n this._renderer.listen('window', 'touchend', () => this.onDrop())\n );\n this.onDrag();\n })\n );\n });\n })\n );\n }\n\n /** Start listing for scroll events on the container */\n public onDrag() {\n if (this.element) {\n this.subscription(\n 'scroll',\n this._renderer.listen(this.element, 'scroll', () => this.updateListPosition())\n );\n }\n }\n\n /** Stop listening for scroll events on the container */\n public onDrop() {\n this.unsub('scroll');\n }\n\n /**\n * Forcefully update the position data of the drop list\n */\n private updateListPosition() {\n this.timeout(\n 'update_positions',\n () => {\n const scroll = { x: this.element.scrollLeft, y: this.element.scrollTop };\n if (\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.Y) &&\n scroll.y !== this.last_scroll.y) ||\n ((this.direction === ScrollDirection.BOTH ||\n this.direction === ScrollDirection.X) &&\n scroll.x !== this.last_scroll.x)\n ) {\n (this._cdkDropList._dropListRef as any)._cacheOwnPosition();\n (this._cdkDropList._dropListRef as any)._siblings.forEach(i =>\n i.isReceiving() ? i._cacheOwnPosition() : null\n );\n }\n this.last_scroll = scroll;\n },\n 50\n );\n }\n}\n","import MockDate from 'mockdate';\n\n/**\n * August 13, 2020 at 7:22:12 UTC\n */\nconst initialTime = 1597346532 * 1000;\n\nexport const mockDate = (timeOverride = initialTime) => MockDate.set(new Date(timeOverride));\n\nexport const resetDate = () => MockDate.reset();\n","import { DateNow, DateTZ } from '@mckinsey-converge/date-tz'\nimport { DateTime } from 'luxon';\nimport * as dayjs from 'dayjs';\nimport {\n dayJsHoursMinutes,\n dayJsTimeFormatString,\n} from './general.utilities';\n\n/**\n * Allows you to split up durations into a group.\n */\nexport interface DurationGroup {\n /**\n * Step amount to generate between start and max.\n */\n step: number;\n /**\n * Where to start in minutes.\n */\n start: number;\n /**\n * Where to end in minutes.\n */\n max: number;\n}\n\n/**\n * Find the multiple of `stepMinute` which is closest to the 'minutes' property of the given date.\n * @param date - Any Lexon date.\n * @param stepMinute - The number of minutes between one timeslot and the next. Integer value\n * 1 to 59, inclusive.\n */\n// R--- depreciate this one\nexport const closestToTimeSlot = (date: DateTime, stepMinute: number, start: number = 0) : DateTime => {\n return date.set({ millisecond: 0, second: 0, minute: Math.ceil(date.minute / stepMinute) * stepMinute })\n .plus({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\nexport const closestToTimeSlotTz = (dateTz: DateTZ, stepMinute: number, start: number = 0) : DateTZ => {\n return dateTz.setValue({ millisecond: 0, second: 0, minute: Math.ceil(dateTz.minutes / stepMinute) * stepMinute })\n .addValue({ minutes: start % 60 }) // apply offset as well if it starts at 15.\n};\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as hrs, or minutes as mins\n */\nexport function durationHumanized(duration: number, short: boolean = false): string {\n if (!duration || duration < 0) {\n return '';\n }\n const h = Math.floor(duration / 60);\n let d = `${h >= 1 ? h + (short ? ' hr' : ' hour' + (h === 1 ? '' : 's')) : ''}`;\n if (duration % 60 !== 0) {\n if (d) {\n d += short ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${m >= 1 ? m + (short ? ' min' : ' minute' + (m === 1 ? '' : 's')) : ''}`;\n }\n return d;\n}\n\nexport const weekDayMonthYearFormat = (date: DateTZ): string => date.formatDate('ccc dd MMM yyyy');\n\n/**\n * Tries to extract best-fit input\n * @return undefined if not valid. otherwise if good\n */\nexport const extractDateFromInput = (input: string,\n checkHour,\n startDate: dayjs.Dayjs): dayjs.Dayjs | undefined => {\n // check if input has am/pm or normal 24 hour time.\n // let date = dayjs(input, 'HH:mm');\n // let date = dayjs(input, 'h:mma');\n let date = dayjs(input, dayJsTimeFormatString());\n if (!date.isValid()) {\n // patch if time is in format xx:x to assume you meant xx:x0\n let cleanedInput = input;\n const times = input.split(':');\n if(!input){\n return undefined\n }\n if (times.length === 2) {\n if (times[1].length === 1) {\n cleanedInput = `${times[0]}:${times[1]}0`;\n }\n }\n // may be other input, lets try next value (without am/pm)\n date = dayjs(cleanedInput, dayJsHoursMinutes());\n // might be just purely an hour\n if (!date.isValid() && checkHour) {\n date = dayjs(input, 'H');\n }\n }\n // We expect input times to be in the future. If now is in the afternoon, this\n // simple block will ensure the returned date is also in the afternoon.\n //\n // NB: dayjs parses times as morning by default.\n if (date.isValid()) {\n // Move to the selected start date\n date = date.month(startDate.month()).date(startDate.date()).year(startDate.year());\n if (startDate.hour() > date.hour() && date.date() === startDate.date()) {\n date = date.set('hour', date.hour() + 12);\n }\n }\n\n return date.isValid() ? date : undefined;\n};\n\n\n/**\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 3. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n * @param step The step between time slots.\n * @param input The input text.\n */\nexport const nearestStepToInput = (\n step: number,\n input: string,\n currentStartDate: number,\n start: number = 0\n): string => {\n let date = extractDateFromInput(input, false, dayjs(currentStartDate));\n if (date) {\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, step, start);\n return closestDate.toFormat(dayJsHoursMinutes());\n } else {\n return input;\n }\n};\n/**\n * Similiar to {@link nearestStepToInput} instead:\n * 1. Calculates the date from input via {@link extractDateFromInput}.\n * 2. Finds which duration group is closest to the currentStartDate. If not found\n * return vanilla text.\n * 3. Finds the nearest time slot that it can be via {@link closestToTimeSlot}.\n * 4. Then returns the time-format string the input expects so autocomplete can suggest\n * closest match.\n */\nexport const nearestDurationToInput = (durationGroups: DurationGroup[],\n currentStartDate: number,\n value: string): string => {\n\n let date = extractDateFromInput(value, false, dayjs(currentStartDate));\n\n if (!date) {\n // Check if the input is a duration \n const duration = parseInt(value);\n if (typeof (duration) === 'number' && value.indexOf(':') === -1 && duration > 12) {\n date = dayjs(currentStartDate).add(duration, 'm');\n }\n }\n\n if (date) {\n const minutes = date.diff(currentStartDate, 'minute');\n const closestDurationGroup = durationGroups.find(d => {\n return (minutes <= d.max);\n });\n if (closestDurationGroup) {\n const offset = [closestDurationGroup].reduce((previousValue, currentValue) => {\n return previousValue + currentValue.start;\n }, 0);\n const luxonDate = DateTime.fromMillis(date.valueOf());\n const closestDate = closestToTimeSlot(luxonDate, closestDurationGroup.step, 0);\n return closestDate.toFormat(dayJsHoursMinutes());\n }\n }\n\n return value;\n};\n\nexport const resetSecondsOnTimestamp = (timestamp: number) => {\n return DateTime.fromMillis(timestamp).set({ second: 0, millisecond: 0 }).toMillis();\n}\n\nexport const formatDateWithSuffix = (date: string): string => {\n const dateObj = new Date(date);\n const day = dateObj.getDate();\n const month = dateObj.toLocaleString(\"default\", { month: \"short\" });\n const year = dateObj.getFullYear();\n return `${day}${nthNumber(day)} ${month} ${year}`; //this.event.date_string;\n}\n\nconst nthNumber = (number) => {\n return number > 0\n ? [\"th\", \"st\", \"nd\", \"rd\"][\n (number > 3 && number < 21) || number % 10 > 3 ? 0 : number % 10\n ]\n : \"\";\n};\n\nexport const getListOfDateFormat = () => {\n return [\t\n 'MMMM dd y', \t//March 07 2023\n 'MMM dd, y',\t//Mar 07 2023\n 'MMMM dd',\t\t//March 07\n 'MMM dd', \t\t//Mar 07\n 'MM dd', \t\t//03 07\n\n 'MM-dd-yy',\t\t//03-07-23\n 'MM-dd-yyyy',\t//03-07-2023\n 'MMMM-dd-yyyy', //March-07-2023\n 'MMMM-dd-yy',\t//March-07-23\n\n 'MMMM-dd',\t\t//March-07\n 'MMM-dd',\t\t//Mar-07\n \n 'MMM-dd-y',\t\t//Mar-07-2023\n\n 'MM/dd',\t\t//03/07\n 'MM/dd/yy',\t\t//03/07/23\n 'MM/dd/yyyy',\t//03/07/2023\n \n 'dd/MM',\t\t//07/03\n 'dd/MM/yy',\t\t//07/03/23\n 'dd/MM/yyyy',\t//07/03/2023\n \n 'dd-MMMM',\t\t//07-March\n 'dd MMMM',\t\t//07 March\n 'dd-MMM',\t\t//07-Mar\n 'dd MMM',\t\t//07 Mar\n\n 'dd-MM-y',\t\t//07-03-23\n 'dd MMMM yy',\t//07 March 23\n \n 'dd/MMM/y',\t //07/Mar/2023\n 'dd/MMMM/y', //07/March/2023\n 'dd/MMM/yy', //07/Mar/23\n 'dd/MMMM/yy', //07/March/23\n \n\n 'dd-MMMM-yy',\t//07-March-23\n 'dd-MMM-yy',\t//07-Mar-23\n 'dd-MM-yy',\t\t//07-03-23\n 'MMMM-dd-yy',\t//March-07-23\n 'MMM-dd-yy',\t//Mar-07-23\n\n 'MMMM dd yy',\t//March 07 23\n 'MMM dd, yy',\t//Mar 07 23\n 'MM dd, yy',\t//03 07 23\n\n 'dd MMMM y',\t//07 March 2023\n 'dd MMM, y',\t//07 Mar 2023\n 'dd MM, yy',\t//07 03, 23\n 'dd-MMM-y',\t//07-Mar-2023\n\n 'h:mm a', // 3:30 pm\n 'h:mma' // 3:30 pm\n\n ];\n}","import { HashMap, Point } from './types.utilities';\n\nimport * as dayjs from 'dayjs';\nimport * as utc from 'dayjs/plugin/utc';\nimport * as timezone from 'dayjs/plugin/timezone';\nimport * as isToday from 'dayjs/plugin/isToday';\nimport * as weekday from 'dayjs/plugin/weekday';\nimport * as customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n// TODO: this is not the best place to import this timezone addition\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isToday);\ndayjs.extend(weekday);\ndayjs.extend(customParseFormat);\n\n/** Available console output streams. */\nexport type ConsoleStream = 'debug' | 'warn' | 'log' | 'error' | 'info';\n\n/**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\nexport function log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false,\n app_name: string = 'STAFF'\n) {\n if ((window as any).debug || force) {\n const colors: string[] = [\n 'color: #E91E63',\n 'color: #3F51B5',\n 'color: default',\n ];\n if (args) {\n console[stream](\n `%c[${app_name}]%c[${type}] %c${msg}`,\n ...colors,\n args\n );\n } else {\n console[stream](`%c[${app_name}]%c[${type}] %c${msg}`, ...colors);\n }\n }\n}\n\n/**\n * Get item from the nested object\n * @param keys List of sub-keys to search for\n * @param map Object to search\n */\n export function getItemWithKeys(keys: string[], map: HashMap) {\n const key = keys[0];\n if (map && key in map) {\n return keys.length > 1\n ? getItemWithKeys(keys.slice(1), map[key] || {})\n : map[key];\n }\n return null;\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the platform is a mobile device.\n */\nexport function isMobileDevice(): boolean {\n const r = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n return !!navigator.userAgent.match(r);\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Mobile Safari.\n */\nexport function isMobileSafari(): boolean {\n const agent = navigator.userAgent;\n return !!(\n agent.match(/iPhone|iPad|iPod/) &&\n agent.match(/AppleWebKit/) &&\n !agent.match('CriOS')\n );\n}\n\n/* istanbul ignore next */\n/**\n * Checks whether the browser is Android Chrome.\n */\nexport function isAndroidChrome(): boolean {\n const agent = navigator.userAgent;\n return !!(agent.match(/Android/) && agent.match(/Chrome/));\n}\n\n/**\n * Generate string representation of a number with zeros padding the length\n * @param value Number to pad with zeros\n * @param length Length of the resulting string\n */\nexport function padZero(value: number, length: number): string {\n let str = value.toString();\n while (str.length < length) {\n str = '0' + str;\n }\n return str;\n}\n\n/**\n * Remove duplicates from the given array\n * @param array List of items to remove duplicates from\n * @param key Key on array objects to compare for uniqueness\n */\nexport function unique(array: T[], key: keyof T | undefined = undefined) {\n return array.filter(\n (el, pos, arr) =>\n el &&\n arr.indexOf(\n key\n ? arr.find((i) => i && i[key] === el[key])\n : arr.find((i) => i === el)\n ) === pos\n );\n}\n\n/**\n * Convert duration to human readable string\n * @param duration Duration in minutes\n * @param short Whether to use short form of duration words e.g. hours as h\n */\nexport function humaniseDuration(durationInput: number, size: string = 'long') {\n const duration = Math.floor(durationInput);\n if (!duration || duration < 0) {\n return '';\n }\n let singular = false;\n let format = { hours: ' hour', minutes: ' minute' };\n switch (size) {\n case 'medium':\n format = { hours: 'hr', minutes: 'min' };\n break;\n case 'short':\n format = { hours: 'h', minutes: 'm' };\n singular = true;\n break;\n }\n const h = Math.floor(duration / 60);\n let d = `${\n h >= 1\n ? h +\n (singular ? format.hours : format.hours + (h === 1 ? '' : 's'))\n : ''\n }`;\n if (duration % 60 !== 0) {\n if (d) {\n d += singular ? ' ' : ', ';\n }\n const m = duration % 60;\n d += `${\n m >= 1\n ? m +\n (singular\n ? format.minutes\n : format.minutes + (m === 1 ? '' : 's'))\n : ''\n }`;\n }\n return d;\n}\n\n/**\n * Get a filtered list of items\n * @param filter Value to filter on\n * @param items List of results to filter\n * @param fields Fields to check for matches on each item\n */\nexport function filterList(\n filter: string,\n items?: T[],\n fields: string[] = ['id']\n): T[] {\n let results: any[];\n // Tokenise filter string\n const filters = (filter || '').toLowerCase().split(' ');\n const list = {};\n for (const f of filters) {\n /* istanbul ignore else */\n if (f) {\n /* istanbul ignore else */\n if (!list[f]) {\n list[f] = 0;\n }\n list[f]++;\n }\n }\n // Group similar tokens\n const parts = [];\n for (const f in list) {\n /* istanbul ignore else */\n if (list.hasOwnProperty(f)) {\n parts.push({ word: f, count: list[f], regex: new RegExp(f, 'gi') });\n }\n }\n parts.sort(\n (a, b) => b.word.length - a.word.length || a.word.localeCompare(b.word)\n );\n const item_list = JSON.parse(JSON.stringify(items || []));\n /* istanbul ignore else */\n if (filter) {\n results = item_list.filter((item) => {\n let match_count = 0;\n item.match_index = 65535;\n item.match = '';\n const field_list = {};\n // Initialise field match variables\n for (const f of fields) {\n field_list[f] = {\n value: (item[f] || '').toLowerCase(),\n index: 65536,\n matched: 0,\n };\n }\n // Search for matches with the tokenised filter string\n for (const i of parts) {\n /* istanbul ignore else */\n if (i.word) {\n // Check fields for matches\n for (const f of fields) {\n const field = field_list[f];\n const index = field.value.indexOf(i.word);\n field.index = index < field.index ? index : field.index;\n field.matches = (\n field.value.match(i.regex) || []\n ).length;\n field.value = field.value.replace(i.regex, ' ');\n }\n // Update token match count\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.matches >= i.count) {\n match_count++;\n // Update field matches\n let changed = 0;\n const tokens = (\n item[`match_${f}`] ||\n item[f] ||\n ''\n ).split(' ');\n for (const k of tokens) {\n /* istanbul ignore else */\n if (changed >= i.count) {\n break;\n }\n /* istanbul ignore else */\n if (\n k.toLowerCase().indexOf(i.word) >= 0 &&\n k.indexOf('`') < 0\n ) {\n tokens[tokens.indexOf(k)] = k.replace(\n i.regex,\n '`$&`'\n );\n changed++;\n }\n }\n item[`match_${f}`] = tokens.join(' ');\n break;\n }\n }\n }\n }\n // Get field with the most relevent match\n for (const f of fields) {\n const field = field_list[f];\n /* istanbul ignore else */\n if (field.index < item.match_index && field.index >= 0) {\n item.match_index = field.index;\n item.match = f;\n }\n }\n return (\n item.match_index >= 0 &&\n item.match &&\n match_count >= parts.length\n );\n });\n } else {\n results = item_list;\n }\n // Sort by order of relevence then name\n results.sort((a, b) => {\n const diff = a.match_index - b.match_index;\n return diff === 0 ? a.name.localeCompare(b.name) : diff;\n });\n return results;\n}\n\n/**\n * Convert a match string from `filterList` to renderable HTML\n * @param str Match string to change\n */\nexport function matchToHighlight(str: string): string {\n /* istanbul ignore else */\n if (str) {\n str = str.replace(\n /\\`[a-zA-Z0-9\\@\\.\\_]*\\`/g,\n '$&'\n );\n str = str.replace(/\\`/g, '');\n }\n return str;\n}\n\n/**\n * Convert time string to ms from UTC epoch for today\n * @param time Time string in the format `HH:mm`\n */\nexport function timeToDate(time: string): number {\n const parts = time.split(':');\n const date = DateNow(new Date())\n .setValue({\n hour: +parts[0],\n minute: +parts[1],\n })\n .startOfValue('minute');\n return date.ms;\n}\n\n/**\n * Generate a random number\n * @param ceil Biggest value to generate not inclusive\n * @param floor Smallest value to generate. Defaults to 0\n */\nexport function randomInt(ceil: number, floor: number = 0) {\n return Math.floor(Math.random() * (ceil - floor)) + floor;\n}\n\n/**\n * Get time format string for locale\n * @param isLowerCaseAmPm - if true, we use lowercase for am/pm.\n */\nexport function timeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const hoursMinutes = (): string => (is24HourTime() ? 'HH:mm' : 'h:mma');\n\nexport function dayJsTimeFormatString(): string {\n return is24HourTime() ? 'HH:mm' : 'h:mma';\n}\n\nexport const dayJsHoursMinutes = (): string =>\n is24HourTime() ? 'HH:mm' : 'h:mm';\n\n/**\n * Converts a timeZone name into a date object.\n * @param timeZoneName - name of timezone\n */\nexport const timezoneNameToDate = (\n timeZoneName: string | undefined\n): DateTZ | undefined => {\n let zone: DateTZ | undefined;\n if (timeZoneName) {\n try {\n zone = DateNow(new Date()).toZone(timeZoneName);\n } catch (e) {\n // invalid timezone. Suppress logs here.\n // console.error(e);\n }\n }\n return zone;\n};\n\nexport const timezoneDisplay = (date: DateTZ) =>\n !!date ? `${date.formatDate('ZZZZ')}` : '';\nexport const gmtOffsetDisplay = (date: DateTZ) =>\n !!date ? `(GMT${date.formatDate('ZZ')})` : '';\n\n/**\n * Returns a full time with timezone.\n * @param date\n */\nexport function timeWithZoneFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${timezoneDisplay(date)}`;\n}\n\nexport function timeWithGmtOffsetFormatString(date: DateTZ): string {\n return `${date\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(date)}`;\n}\n\n/**\n * Returns a full start end range.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}`;\n}\n\n/**\n * Returns a full start end range with timezone.\n *\n * Start and end both use lowercase am/pm markers (c.f. timeFormatString).\n * @param startDateTz start time DateTZ object\n * @param endDateTz end time DateTZ object\n */\nexport function startEndTimeWithZoneFormatString(\n startDateTz: DateTZ,\n endDateTz: DateTZ\n): string {\n return `${startDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()}-${endDateTz\n .formatDate(timeFormatString())\n .toLocaleLowerCase()} ${gmtOffsetDisplay(startDateTz)}`;\n}\n\n/**\n * Returns a full date with weekday day month year.\n * @param date\n * @param comma optional boolean to display a comma after the month\n */\nexport function dateLocalFormatString(date: DateTZ, comma?: boolean): string {\n if (comma) {\n return date.formatLocalDate('cccc d MMMM, yyyy');\n }\n return date.formatLocalDate('cccc d MMMM yyyy');\n}\n\nexport function dateBuildingFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('cccc d MMMM, yyyy');\n }\n return date.formatDate('cccc d MMMM yyyy');\n}\n\nexport function shorterLocalDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatLocalDate('ccc d MMM, yyyy');\n }\n return date.formatLocalDate('ccc d MMM yyyy');\n}\n\nexport function shorterBuildingDateFormatString(\n date: DateTZ,\n comma?: boolean\n): string {\n if (comma) {\n return date.formatDate('ccc d MMM, yyyy');\n }\n return date.formatDate('ccc d MMM yyyy');\n}\n\n/** Whether locale string is displayed in 24 hour time */\nexport function is24HourTime(): boolean {\n const date = new Date();\n const localeString = date\n .toLocaleTimeString(\n document.querySelector('html').getAttribute('lang') ||\n navigator.language\n )\n .toLowerCase();\n return localeString.indexOf('am') < 0 && localeString.indexOf('pm') < 0;\n}\n\n/* istanbul ignore next */\n/**\n * Downloads a file to the users computer with the given filename and contents\n * @param filename Name of the file to download\n * @param contents Contents of the file to download\n */\nexport function downloadFile(filename: string, contents: string) {\n const element = document.createElement('a');\n element.setAttribute(\n 'href',\n 'data:text/plain;charset=utf-8,' +\n encodeURIComponent('\\uFEFF' + contents)\n );\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n}\n\n/**\n * Parse raw CSV data into a JSON object\n * @param csv CSV data to parse\n */\nexport function csvToJson(csv: string) {\n const lines = csv.split('\\n');\n let fields = lines.splice(0, 1)[0].split(',');\n fields = fields.map((v) => v.replace('\\r', ''));\n const list: any[] = [];\n for (const line of lines) {\n let parts = line.split(',');\n parts = parts.map((v) => v.replace('\\r', ''));\n /* istanbul ignore else */\n if (parts.length >= fields.length) {\n const item: any = {};\n for (let i = 0; i <= parts.length; i++) {\n let part = null;\n part = parts[i];\n /* istanbul ignore else */\n if (part !== undefined) {\n item[(fields[i] || '').split(' ').join('_').toLowerCase()] =\n part;\n }\n }\n list.push(item);\n }\n }\n\n return list;\n}\n\n/**\n * Convert javascript array to CSV string\n * @param json Javascript array to convert\n */\nexport function jsonToCsv(json: HashMap[]) {\n /* istanbul ignore else */\n if (json instanceof Array && json.length > 0) {\n const keys = Object.keys(json[0]);\n const valid_keys = keys.filter((key) => json[0].hasOwnProperty(key));\n return `${valid_keys.join(',')}\\n${json\n .map((item) =>\n valid_keys\n .map((key) => {\n return typeof item[key] !== 'boolean'\n ? `\"${item[key] || ''}\"`\n : item[key];\n })\n .join(',')\n )\n .join('\\n')}`;\n }\n return '';\n}\n\n/* istanbul ignore next */\n/**\n * detect IE\n * returns version of IE or false, if browser is not Internet Explorer\n */\nexport function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n/**\n * Grab point details from mouse or touch event\n * @param event Event to grab details from\n */\nexport function eventToPoint(event: MouseEvent | TouchEvent): Point {\n if (!event) {\n return { x: -1, y: -1 };\n }\n if (event instanceof MouseEvent) {\n return { x: event.clientX, y: event.clientY };\n } else {\n return event.touches && event.touches.length > 0\n ? { x: event.touches[0].clientX, y: event.touches[0].clientY }\n : { x: -1, y: -1 };\n }\n}\n\n/* istanbul ignore next */\n/**\n * Flatten nested array\n * @param an_array Array to flatten\n */\nexport function flatten(an_array: T[]) {\n const stack = [...an_array];\n const res = [];\n while (stack.length) {\n // pop value from stack\n const next = stack.pop();\n if (Array.isArray(next)) {\n // push back array items, won't modify the original input\n stack.push(...next);\n } else {\n res.push(next);\n }\n }\n // reverse to restore input order\n return res.reverse();\n}\n\nconst seed = xmur3('PlaceOS');\nconst rand = sfc32(0x9e3779b9, 0x243f6a88, 0xb7e15162, seed());\n\nexport function predictableRandomInt(ceil: number = 100, floor: number = 0) {\n return Math.floor(rand() * (ceil - floor)) + floor;\n}\n\n// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript\nfunction xmur3(str) {\n for (var i = 0, h = 1779033703 ^ str.length; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)),\n (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n var t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n\nexport function isLessThanBreakpoint(breakpoint: number): boolean {\n if (window) {\n return window.innerWidth < breakpoint;\n }\n return false;\n}\n\nexport function toTitleCase(str: string): string {\n return typeof str === 'string'\n ? str\n .toLowerCase()\n .split(' ')\n .map(function (word) {\n return word.replace(word[0], word[0].toUpperCase());\n })\n .join(' ')\n : '';\n}\n","\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BaseClass } from './base.class';\nimport { SpaceImageObject } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\n\n@Directive({\n selector: 'a-very-basic-component-image-that-should-not-be-used'\n})\nexport class ImageDirective extends BaseClass implements OnDestroy {\n public foundImages?: SpaceImageObject[];\n public loadImages?: BehaviorSubject\n public ngOnDestroy(): void {\n this.destroy();\n }\n}","import {\n Directive,\n ElementRef,\n HostListener\n} from '@angular/core';\n\n@Directive({\n selector: 'input[type=number], input[numbersOnly]'\n})\nexport class NumbersOnlyDirective {\n\n constructor(private _el: ElementRef) {\n }\n\n @HostListener('input', ['$event']) onInputChange(event) {\n const initalValue = this._el.nativeElement.value;\n this._el.nativeElement.value = initalValue.replace(/[^0-9]*/g, '');\n if (initalValue !== this._el.nativeElement.value) {\n event.stopPropagation();\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'replace'\n})\nexport class ReplacePipe implements PipeTransform {\n\n transform(value: string, from: string = '_', to: string = ' '): string {\n return (value|| '').split(from).join(to);\n }\n}\n","export * from './lib/bookings.module';\nexport * from './lib/bookings.actions'\nexport * from './lib/bookings.reducer'\nexport * from './lib/bookings.types'\nexport * from './lib/bookings.utils'\n","\nimport { IBookingQueryOptions, PaginatedBooking } from '@mckinsey-converge/data-common';\nimport { \n createLoadingAction\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n MyBookingsState,\n MyBookingsStoreState,\n} from './bookings.types';\nimport {\n createAction,\n props\n} from '@ngrx/store';\n\nexport const bookingStateSelector = (state: MyBookingsStoreState) => state.bookings;\n\nexport const loadBookingsWithQuery = createAction('[Bookings] Load Bookings with query', props());\n\nexport const loadHomepageBookingsResults = createLoadingAction('HomepageBookings', 'homepage');\n\nexport const loadUpcomingBookingsResults = createLoadingAction('UpcomingBookings', 'upcoming');\n\nexport const loadPastBookingsResults = createLoadingAction('PastBookings', 'past');\n\nexport const loadCancelledBookingsResults = createLoadingAction('CancelledBookings', 'cancelled');\n\nexport const loadBookingByIdResults = createLoadingAction('BookingById', 'bookingById');\n\nexport const clearBookingByIdResults = createAction('[BookingById] Clear Booking Data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n IBookingQueryOptions,\n BookingsPaginatedService\n} from '../../../data-common/src/lib/bookings';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadHomepageBookingsResults,\n loadPastBookingsResults,\n loadUpcomingBookingsResults,\n loadCancelledBookingsResults,\n loadBookingsWithQuery,\n loadBookingByIdResults\n} from './bookings.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n\n} from './bookings.utils';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Injectable()\nexport class BookingsEffects {\n constructor(private actions: Actions,\n private bookingService: BookingsPaginatedService) {\n }\n\n @Effect()\n public afterBookingsRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadBookingsWithQuery),\n mergeMap((action: LoadingAction) => {\n const date = new DateTZ({date: action.from})\n const yourBookingsRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.subtractValue({ minutes: 5 }).seconds}`,\n },\n include_rooms: true\n };\n const upcomingRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch asc',\n filters: {\n end_epoch: `>=${date.seconds}`,\n },\n include_rooms: true\n };\n const pastRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: false,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n end_epoch: `<${date.seconds}`,\n },\n include_rooms: true\n };\n const cancelledRequest = {\n email: action.email,\n pagination: true,\n limit: null,\n offset: action.offset,\n show_cancelled: true,\n sort: 'start_epoch desc',\n filters: {\n start_epoch: `>${date.subtractValue({ hours: 48 }).seconds}`,\n },\n include_rooms: true\n };\n const byIdRequest = {\n email: action.email,\n id: action.id,\n pagination: true,\n limit: 1,\n include_rooms: true\n };\n\n const effects = [];\n switch(action.target) {\n case 'upcoming':\n effects.push(loadUpcomingBookingsResults.request(upcomingRequest));\n break;\n case 'past':\n effects.push(loadPastBookingsResults.request(pastRequest));\n break;\n case 'cancelled':\n effects.push(loadCancelledBookingsResults.request(cancelledRequest));\n break;\n case 'bookingById':\n effects.push(loadBookingByIdResults.request(byIdRequest));\n break\n case 'homepage':\n effects.push(loadHomepageBookingsResults.request(yourBookingsRequest));\n // effects.push(loadPastBookingsResults.request(pastRequest));\n break\n default:\n }\n return effects;\n })\n );\n\n @Effect()\n public loadHomepageBookingsResultsEffect = createLoadingEffect(this.actions, loadHomepageBookingsResults,\n (action) => this.bookingService.userBookings(action, `homepage-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadUpcomingBookingsResultsEffect = createLoadingEffect(this.actions, loadUpcomingBookingsResults,\n (action) => this.bookingService.userBookings(action, `upcoming-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n \n @Effect()\n public loadPastBookingsResultsEffect = createLoadingEffect(this.actions, loadPastBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `past-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadCancelledBookingsResultsEffect = createLoadingEffect(this.actions, loadCancelledBookingsResults,\n (action) =>\n this.bookingService.userBookings(action, `cancelled-${action.filters?.start_epoch || ''}${action.filters?.end_epoch || ''}`));\n\n @Effect()\n public loadBookingByIdResultsEffect = createLoadingEffect(this.actions, loadBookingByIdResults,\n (action) => \n this.bookingService.userBookings(action, `bookingById-${action.id}`));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingsReducer } from './bookings.reducer';\nimport { BookingsEffects } from './bookings.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([BookingsEffects]),\n StoreModule.forFeature('bookings', bookingsReducer)\n ]\n})\nexport class BookingsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n createReducer,\n on\n} from '@ngrx/store';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n clearBookingByIdResults,\n} from './bookings.actions';\nimport { MyBookingsState } from './bookings.types';\n \nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\n\n\nexport const initialBookingsState: MyBookingsState = {\n query: LoadingModel.empty(),\n homepage: LoadingModel.empty(),\n upcoming: LoadingModel.empty(),\n past: LoadingModel.empty(),\n cancelled: LoadingModel.empty(),\n bookingById: LoadingModel.empty(),\n};\n\nexport const bookingsReducer = createReducer(initialBookingsState,\n on(clearBookingByIdResults, (state: MyBookingsState) => ({\n ...state,\n bookingById: LoadingModel.empty(),\n }) as MyBookingsState),\n ...loadHomepageBookingsResults.ons,\n ...loadUpcomingBookingsResults.ons,\n ...loadPastBookingsResults.ons,\n ...loadCancelledBookingsResults.ons,\n ...loadBookingByIdResults.ons,\n );\n\n\n\n export const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n };\n \n export const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: undefined\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n );\n \n","import { Booking } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport const mapBookingToSelectOption = (booking?: Booking): SelectOption => booking ? ({\n value: booking.id,\n display: booking.name\n}) : undefined;\n","export * from './lib/buildings.module';\nexport * from './lib/buildings.actions'\nexport * from './lib/buildings.types'\nexport * from './lib/buildings.reducer'\n","import { \n createLoadingAction,\n} from '../../../loading/src/lib/loading.actions';\nimport {\n Building,\n BuildingCity,\n} from '../../../data-common/src/lib/organisation/building.class';\nimport {\n BuildingLevel,\n} from '../../../data-common/src/lib/organisation/level.class'\nimport {\n Organisation,\n} from '../../../data-common/src/lib/organisation/organisation.class'\nimport { createSelector } from '@ngrx/store';\nimport {\n BuildingState,\n BuildingStoreState\n} from './buildings.types';\n\nexport const loadBuildings = createLoadingAction('Buildings', 'data');\n\nexport const buildingStateSelector = (state: BuildingStoreState) => state.buildings;\n\nexport const selectLoadBuildingsSuccess = createSelector(buildingStateSelector, loadBuildings.selectors.optionalSuccess);\n\n/**\n * Groups buildings by city\n */\nexport const selectBuildingOptionsGroupedByCity = createSelector(loadBuildings.selectors.optionalSuccess, (success) => {\n if (success) {\n const mapped = new Map();\n success.forEach(s => {\n const found = Array.from(mapped.keys()).find(c => c.name === s.city);\n let list = found ? mapped.get(found) : undefined;\n if (!list) {\n list = [];\n mapped.set({\n name: s.city,\n timezone: s.timezone\n }, list);\n }\n list.push(s);\n });\n return mapped;\n }\n return new Map();\n});\n\nexport const selectLevelByZoneId = createSelector(selectLoadBuildingsSuccess,\n (buildings, param: string) => {\n if (buildings) {\n return buildings.map(b => b.levels.find((l: BuildingLevel) => l.id === param))\n ?.[0] ?? undefined;\n }\n return undefined;\n });\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport {\n Organisation,\n OrganisationService\n} from '../../../data-common/src/lib/organisation';\nimport { loadBuildings } from './buildings.actions';\nimport {\n createLoadingEffect,\n LoadingAction,\n Payload\n} from '@mckinsey-converge/loading';\nimport { loadOrganisations } from '../../../organisation/src/lib/organisation.actions';\nimport { map } from 'rxjs/operators';\n\n\n@Injectable()\nexport class BuildingsEffects {\n\n constructor(private actions: Actions,\n private organizationService: OrganisationService) {\n\n }\n\n @Effect()\n public loadBuildings = createLoadingEffect(this.actions, loadBuildings,\n (action) => this.organizationService.loadBuildingsWithOrg(action));\n\n @Effect()\n public loadBuildingsAfterOrg = this.actions.pipe(\n ofType(loadOrganisations.success),\n map((action: LoadingAction>) => loadBuildings.request(action.payload)));\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { BuildingsEffects } from './buildings.effects';\nimport { StoreModule } from '@ngrx/store';\nimport { buildingsReducer } from './buildings.reducer';\n\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n BuildingsEffects\n ]),\n StoreModule.forFeature('buildings', buildingsReducer)\n ]\n})\nexport class BuildingsModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadBuildings } from './buildings.actions';\nimport { BuildingState } from './buildings.types';\n\nexport const initialBuildingState: BuildingState = {\n data: LoadingModel.empty()\n};\n\nexport const buildingsReducer = createReducer(initialBuildingState,\n ...loadBuildings.ons\n);\n","export * from './lib/data-common.module';\nexport * from './lib/booking';\nexport * from './lib/bookings';\nexport * from './lib/catering';\nexport * from './lib/location';\nexport * from './lib/organisation';\nexport * from './lib/spaces';\nexport * from './lib/users';\nexport * from './lib/app.service';\nexport * from './lib/hotkeys.service';\nexport * from './lib/base.service';\nexport * from './lib/base-api.class';\nexport * from './lib/reports'\nexport * from './lib/service-manager.class';\nexport * from './lib/settings.service';\nexport * from './lib/spec-helpers';\nexport * from './lib/settings.interfaces';\nexport * from './lib/validation.utilities';\nexport * from './lib/status.interfaces';\nexport * from './lib/recurrence/recurrence.utils';\nexport * from './lib/close-modal-dialog-service';\nexport * from './lib/validation.utilities';\nexport * from './lib/collapse-accordion-service';","import { HashMap } from '@mckinsey-converge/base';\n\n/**\n * Convert map into a query string\n * @param map Key value pairs to convert\n */\nexport function toQueryString(map: HashMap) {\n let str = '';\n if (map) {\n for (const key in map) {\n if (map.hasOwnProperty(key) && map[key] !== undefined && map[key] !== null) {\n str += `${(str ? '&' : '')}${key}=${map[key]}`;\n }\n }\n }\n return str;\n}\n","import {\n ApplicationRef,\n Injectable,\n NgZone,\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { take, first } from 'rxjs/operators';\n\nimport { ComposerService } from '@placeos/composer';\nimport { PlaceOSOptions } from '@placeos/ts-client';\nimport { HeapIoService } from '@acaprojects/ngx-heap-io';\n\nimport {\n BehaviorSubject,\n Observable,\n Subject\n} from 'rxjs';\n\nimport {\n ApplicationLoadingState,\n BaseClass,\n ConsoleStream,\n log\n} from '@mckinsey-converge/base';\nimport { SettingsService } from './settings.service';\n\nimport { HotkeysService } from './hotkeys.service';\nimport {\n ApplicationIcon,\n ComposerSettings\n} from './settings.interfaces';\nimport { EnvironmentService } from '../../../environment/src/lib/environment.service'; // '@mckinsey-converge/environment';\nimport {\n Store\n} from '@ngrx/store';\nimport { selectCurrentUser } from '../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../user/src/lib/user.types';\nimport { Booking } from './bookings';\nimport { filter } from 'rxjs/operators';\nimport { SnackBarService } from '../../../ui/src/lib/custom-snackbar-component/custom-snackbar-component.service';\n\ndeclare global {\n interface Window {\n application: ApplicationService;\n mock: {\n enabled: boolean;\n backend: any;\n };\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationService extends BaseClass {\n /** Map of state variables for Service */\n protected _subjects: {\n [key: string]: BehaviorSubject | Subject;\n } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n _kioskFormFilter: boolean;\n\n constructor(\n public store: Store,\n public analytics: HeapIoService,\n private _app_ref: ApplicationRef,\n private _zone: NgZone,\n private _title: Title,\n private _settings: SettingsService,\n private _hotkeys: HotkeysService,\n private _composer: ComposerService,\n private _snackbar: MatSnackBar,\n private _environment: EnvironmentService,\n private snack: SnackBarService\n\n ) {\n super();\n this.set('system', null);\n this.set('title', 'Home');\n this.set('loading', {});\n this.set('CONCIERGE.day_view.viewing', null);\n this.set('undo', new BehaviorSubject<{\n action: 'series' | 'booking',\n booking: Booking\n } | null>(null));\n\n this.set('APP.breakdown', false);\n\n this._app_ref.isStable.pipe(first(_ => _)).subscribe(() => {\n this._zone.run(() => {\n this.log('APP', `Application has stablised.`);\n this.waitForSettings();\n });\n });\n }\n\n public set kioskFormFilter(isIt: boolean) {\n this._kioskFormFilter = isIt;\n }\n\n public get kioskFormFilter():boolean {\n return this._kioskFormFilter \n }\n\n /** Analytics service */\n public get Analytics() {\n return {};\n }\n\n /** Hotkeys service */\n public get Hotkeys() {\n return this._hotkeys;\n }\n\n /**\n * Get a setting from the settings service\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n return this._settings.get(key);\n }\n\n /**\n * Title of the page\n */\n public set title(value: string) {\n const title_suffix = this.setting('app.title');\n this.set('title', value);\n this._title.setTitle(`${value ? value + ' | ' : ''}${title_suffix}`);\n }\n\n /**\n * Title of the page\n */\n public get title(): string {\n return this._title.getTitle();\n }\n\n /** Root API Endpoint */\n public get endpoint() {\n return `/api/staff/`;\n }\n\n /** Root API Endpoint for engine */\n public get engine_endpoint() {\n return this._composer.auth.api_endpoint + '/';\n }\n\n /** Whether settings has been loaded */\n public get has_settings(): boolean {\n return this._settings.is_initialised;\n }\n\n /**\n * Create notification popup\n * @param type CSS Class to add to the notification\n * @param message Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n * @param icon Icon to render to the left of the notification message\n */\n public notify(\n type: string,\n message: string,\n action: string = 'OK',\n on_action?: () => void,\n icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'info'\n }\n ): void {\n this.openSnack(message, type);\n // const snackbar_ref = this._snackbar.open(message, action, {\n // panelClass: [type],\n // duration: 5000\n // });\n // this.subscription(\n // 'snackbar_close',\n // snackbar_ref.afterDismissed().subscribe(() => {\n // this.unsub('snackbar_close');\n // this.unsub('notify');\n // })\n // );\n // if (action) {\n // on_action = on_action || (() => snackbar_ref.dismiss());\n // this.subscription(\n // 'notify',\n // snackbar_ref.onAction().subscribe(() => on_action())\n // );\n // }\n }\n\n public openSnack(message, type) {\n this.snack.openSnackBar(message, type, 5000);\n }\n \n /**\n * Create success notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifySuccess(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'done'\n };\n this.notify('success', msg, action, on_action, icon);\n }\n\n /**\n * Create error notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyError(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'error'\n };\n this.notify('error', msg, action, on_action, icon);\n }\n\n /**\n * Create warning notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyWarn(msg: string, action?: string, on_action?: () => void): void {\n const icon: ApplicationIcon = {\n type: 'icon',\n class: 'material-icons',\n content: 'warning'\n };\n this.notify('warn', msg, action, on_action, icon);\n }\n\n /**\n * Create info notification popup\n * @param msg Message to display on the notificaiton\n * @param action Display text for the callback action\n * @param on_action Callback of action on the notification\n */\n public notifyInfo(msg: string, action?: string, on_action?: () => void): void {\n this.notify('info', msg, action, on_action);\n }\n\n /**\n * Log data to the browser console\n * @param type Type of message\n * @param msg Message body\n * @param args array of argments to log to the console\n * @param stream Stream to emit the console on. 'debug', 'log', 'warn' or 'error'\n * @param force Whether to force message to be emitted when debug is disabled\n */\n public log(\n type: string,\n msg: string,\n args?: any,\n stream: ConsoleStream = 'debug',\n force: boolean = false\n ): void {\n log(type, msg, args, stream, force);\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n return this._subjects[name] && this._subjects[name] instanceof BehaviorSubject\n ? (this._subjects[name] as BehaviorSubject).getValue()\n : null;\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n public set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /** Wait for settings to be initialised before setting up the application */\n private waitForSettings() {\n // Wait until the settings have loaded before initialising\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => this.init());\n }\n\n /**\n * Initialise application services\n */\n private init(): void {\n this.setupComposer();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe( filter(user => user !== undefined) )\n .pipe(take(1))\n .subscribe((user: any) => {\n // Once we know we have the user loaded.\n this.setupAnalytics(user?.fmno);\n })\n );\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n this._initialised.next(true);\n });\n // Add service to window if in debug mode\n if (window.debug) {\n window.application = this;\n }\n }\n\n /**\n * Initialise the composer library comms\n */\n private setupComposer(): void {\n this.log('SYSTEM', 'Setup up composer...');\n const loading: ApplicationLoadingState = this.get('loading');\n loading.composer = {\n message: 'Initialising service connection',\n state: 'loading'\n };\n this.set('loading', loading);\n // Get application settings\n const settings: ComposerSettings = this._settings.get('composer') || {};\n const protocol = settings.protocol || location.protocol;\n const host = settings.domain || location.hostname;\n const port = settings.port || location.port;\n const url = settings.use_domain ? `${protocol}//${host}:${port}` : location.origin;\n const route = host.includes('localhost') && port === '4200' ? '' : settings.route || '';\n const mock =\n this._settings.get('mock') ||\n location.href.includes('mock=true') ||\n localStorage.getItem('mock') === 'true';\n // Generate configuration object\n const config: PlaceOSOptions = {\n scope: 'public',\n host: `${host}:${port}`,\n auth_uri: `${url}/auth/oauth/authorize`,\n token_uri: `${url}/auth/token`,\n redirect_uri: `${location.origin}${route}/oauth-resp.html`,\n handle_login: !settings.local_login,\n mock\n };\n this._composer.setup(config);\n loading.composer = {\n message: 'Initialising service connection',\n state: 'complete'\n };\n this.set('loading', loading);\n }\n\n private setupAnalytics(fmno: string) {\n this.log('HEAP', `Loading heap ${this._environment?.heap_io_id}`);\n // Default Heap app ID via the default setting\n const heapIo = this._settings.get('app.heap_io');\n if (this._environment?.heap_io_id) {\n // Apply Heap app ID via the environmental setting\n heapIo.app_id = this._environment.heap_io_id;\n }\n if (heapIo) {\n this.analytics.load(heapIo);\n if (fmno) {\n this.analytics.identify(fmno);\n }\n } else {\n this.log('HEAP', `Heap could not be found for the current frontend ${this._settings.frontend}`);\n }\n }\n\n}\n","import { Subject } from 'rxjs';\n\nimport {\n BaseClass,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n ServiceLike,\n ServiceManager\n} from './service-manager.class';\n\nexport type ApiEventType = 'value_change' | 'item_saved' | 'reset' | 'other';\n\nexport interface ApiEvent {\n type: ApiEventType;\n metadata: T;\n}\n\n\nexport class BaseDataClass extends BaseClass {\n /** Subject for emitting events on the object */\n protected readonly event_subject = new Subject();\n /** Observable for events on this object */\n public readonly events = this.event_subject.asObservable();\n /** Unique Identifier of the object */\n public readonly id: string;\n /** Human readable name of the object */\n public readonly name: string;\n /** Email address associated with the object */\n public readonly email: string;\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(BaseDataClass);\n }\n\n constructor(raw_data: HashMap) {\n super();\n this.id = raw_data.id || raw_data.zone_id || raw_data.email || '';\n this.name = raw_data.name || '';\n this.email = `${raw_data.email || ''}`.toLowerCase();\n }\n\n /**\n * Save pending changes to server\n */\n public save(): Promise {\n if (this._service) {\n const form = this.toJSON();\n return new Promise((resolve, reject) => {\n const promise = this.id\n ? this._service.update(this.id, form)\n : this._service.add(form);\n promise.then(\n (d) => {\n this.event_subject.next({ type: 'item_saved', metadata: d });\n resolve(d);\n },\n (_) => reject(_)\n );\n });\n } else {\n Promise.reject('No service to process request');\n }\n }\n\n /**\n * Delete this item from the server\n */\n public delete(): Promise {\n if (this.id) {\n return this._service.delete(this.id);\n }\n }\n\n /**\n * Run task for this item on the service\n * @param task_name Name of the task\n * @param parameters Parameters to pass to the task request\n */\n public runTask(task_name: string, parameters: HashMap): Promise {\n if (this.id) {\n return this._service.task(this.id, task_name, parameters);\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: BaseDataClass): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._service;\n delete obj._changes;\n delete obj.event_subject;\n delete obj.events;\n // Remove parent private members\n delete obj._timers;\n delete obj._intervals;\n delete obj._subscriptions;\n delete obj._server_names;\n delete obj._initialised;\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substring(1)] || key.substring(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): BaseDataClass {\n return new BaseDataClass(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): BaseDataClass {\n return new BaseDataClass({ ...this, id: null, email: null });\n }\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseDataClass } from './base-api.class';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class BaseAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = typeof query_params.cache !== 'boolean' ? query_params.cache || 1000 : 1000;\n typeof query_params.cache !== 'boolean' && delete query_params.cache;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n // Bring back once implemented in the API\n // if (this.settingsService.concierge) {\n // query = query + '&check_access=true';\n // }\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: T[] | HashMap[] = [];\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n result =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryObsr(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );;\n }\n\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse | HashMap[]{\n let result: IEngineResponse | HashMap[] =\n d && d instanceof Array\n ? d.map((i) => this.process(i))\n : d && !(d instanceof Array) && d.results\n ? (d.results as HashMap[])\n : d && !(d instanceof Array) && !d.results \n ? [d]\n : [];\n return result;\n }\n\n /**\n * query function version -2 - returns observable instead of promise...\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public queryRoomsForQR(query_params: HashMap = {}):Observable{\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n let query = toQueryString(query_params);\n const key = `query|${query}`;\n const url = `${this.route(engine)}${query ? '?' + query : ''}`;\n return this.http.get(url);\n }\n \n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public \n task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * V-2\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public taskObsr( \n id: string, \n task_name: string, \n form_data: HashMap = {}, \n method: 'post' | 'get' = 'post' ):Observable{\n const query = toQueryString(this.injectConcierge(form_data));\n let engine = false;\n let cache = 1000;\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n\n const request = method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n \n return request;\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param id url id with respect to update api\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public updateObsr(id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n \n return this.http.put(url, body)\n .pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) \n ),\n catchError((error: any, result?: T) => {\n console.log(error);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n return of(error as T);\n })\n );\n\n }\n\n /**\n * update function version -2 - returns observable instead of promise...\n * @param form_data data to be update \n * @param should_inject_concierge common value to be set to add concierge: true to the query url and body\n * @param query_params Map of query paramaters to add to the request URL\n */\n public uploadSpacePhotos(apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}):Observable{\n const query = should_inject_concierge ? toQueryString(this.injectConcierge(query_params)) : false;\n const url = `${this.route(query_params.engine)}/${apiSubRoute}${query ? '?' + query : ''}`;\n const body = should_inject_concierge ? this.injectConcierge(form_data) : form_data;\n\n const token = sessionStorage.length ? JSON.parse(sessionStorage.getItem('OAUTH.params')).access_token : '';\n\n const headers = new HttpHeaders({\n 'Authorization': `Bearer ${token}`,\n });\n \n const requestOptions = { headers: headers };\n\n // return this.httpClient.post(url, body, {\n // ...requestOptions \n // });\n\n return this.http.post(url, body);\n\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { Building } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { User } from '../users';\nimport { Space } from '../spaces';\nimport { SpaceBookingRuleOptions } from '../spaces/space.class';\nimport {\n BookingFormData,\n} from './booking.form.data';\nimport { statusFromBookings } from '../bookings/booking.utilities';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { SpaceStatus } from '../bookings/space.types';\nimport { SpaceFeatures } from '../spaces/space.class';\nimport { HashMap } from 'libs/base/src/lib/types.utilities';\n\nexport const spaceExtraFeatureToDisplayName = (feature: SpaceFeatures) => {\n switch (feature) {\n case SpaceFeatures.VideoConference:\n return 'Video conference (VC)';\n case SpaceFeatures.ConferencePhone:\n return 'Conference phone';\n case SpaceFeatures.WirelessContentSharing:\n return 'Wireless content sharing';\n case SpaceFeatures.FlipChart:\n return 'Flip chart';\n case SpaceFeatures.Glassboard:\n return 'Glassboard';\n case SpaceFeatures.ElectronicWhiteboard:\n return 'Whiteboard';\n case SpaceFeatures.ConferenceRoom:\n return 'Conference';\n case SpaceFeatures.TeamRoom:\n return 'Team';\n case SpaceFeatures.PartnerOffice:\n return 'Partner';\n case SpaceFeatures.PhoneBooth:\n return 'Phone booth';\n case SpaceFeatures.NaturalLight:\n return 'Room with window only (natural light)';\n case SpaceFeatures.BoardRoom:\n return 'Boardroom room style';\n case SpaceFeatures.CocktailRoom:\n return 'Cocktail room style';\n case SpaceFeatures.TheatreRoom:\n return 'Theatre room style';\n case SpaceFeatures.WorkshopRoom:\n return 'Workshop room style';\n case SpaceFeatures.UShapeRoom:\n return 'U Shape room style';\n case SpaceFeatures.Miscellaneous:\n return 'Miscellaneous room style'\n case SpaceFeatures.Catering:\n return 'Rooms with catering';\n // TODO: add any special display handling here.\n default:\n return feature;\n }\n};\n\n\nexport const instantBookOption: SelectOption = {\n value: 'instant-book',\n display: 'Listing you can book without waiting for a host approval',\n shortDisplay: 'Instant book'\n};\nexport const instantBookOptions: SelectOption[] = [\n instantBookOption\n];\n\nexport const mapSpaceFeaturesToSelectOption = (f: SpaceFeatures): SelectOption => {\n const display = spaceExtraFeatureToDisplayName(f);\n return ({\n value: f,\n display,\n // Useful for long text, like that of the instant-book\n // option.\n //\n // We do not expect this option object to be modified\n // at any further point before it appears on screen -\n // although that may change in future releases.\n shortDisplay: display\n });\n};\n\nexport const roomEquipmentRequiredOptions: SelectOption[] = [\n SpaceFeatures.VideoConference,\n SpaceFeatures.ConferencePhone,\n SpaceFeatures.WirelessContentSharing,\n SpaceFeatures.FlipChart,\n SpaceFeatures.Glassboard,\n SpaceFeatures.ElectronicWhiteboard\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const internalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.PartnerOffice,\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom,\n SpaceFeatures.PhoneBooth\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const externalRoomTypeRequiredOptions: SelectOption[] = [\n SpaceFeatures.ConferenceRoom,\n SpaceFeatures.TeamRoom\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomDetailsRequired: SelectOption[] = [\n SpaceFeatures.NaturalLight,\n SpaceFeatures.BoardRoom,\n SpaceFeatures.CocktailRoom,\n SpaceFeatures.TheatreRoom,\n SpaceFeatures.WorkshopRoom,\n SpaceFeatures.UShapeRoom,\n SpaceFeatures.Miscellaneous\n].map(mapSpaceFeaturesToSelectOption);\n\nexport const roomCateringAvailable: SelectOption[] = [\n SpaceFeatures.Catering,\n].map(mapSpaceFeaturesToSelectOption);\n\n/**\n * Defines the reason by which spaces are filtered out / missing.\n */\nexport enum SpaceFilterReason {\n /**\n * Spaces were shown and not all filtered out.\n */\n None = 'None',\n\n /**\n * If room filters are applied to the set of rooms,\n * and rooms are available if not applied by filtering.\n */\n Filters = 'Filters',\n\n /**\n * We check office rules first to determine if its been filtered.\n */\n OfficeRules = 'OfficeRules',\n\n /**\n * Fallback as the end case if no results are found.\n */\n DateTime = 'DateTime',\n\n /**\n * In case there are no results for a buiding but there are other office buidings in the same city.\n */\n AlternateBuildingsFound = 'AlternateBuildingsFound',\n\n /**\n * If room is non-bookable in the system\n */\n NonBookable = 'NonBookable'\n}\n\nexport interface FilteredSpaces {\n spaces: Space[] | undefined;\n reason: SpaceFilterReason;\n statusMap: HashMap;\n specificReason?: SpaceFilterReason;\n}\n\n/**\n * Filter spaces by filters locally. TBD in the future for real API pagination.\n *\n * @param formFilters - the set of filters to apply on the list of spaces.\n * @param spaces - the list of spaces to filter\n * @param activeForm - the landing page set of filters.\n * @param buildings - the list of buildings loaded, used to retrieve building-specific booking rules.\n * @param currentUser - the current user\n */\nexport const filterSpacesByAppliedFilters = (\n formFilters: SelectOption[],\n spaces: Space[] | undefined, // the resultshere are raw JSON Spaces, not an array of the Space class\n activeForm: BookingFormData,\n buildings: Building[] = [],\n currentUser: User | undefined,\n isStaffMap: boolean = false): FilteredSpaces => {\n const instantBook: boolean = formFilters.some(f => f.value === instantBookOption.value);\n const onlyCatering: boolean = formFilters.some(f => f.value === SpaceFeatures.Catering);\n // Drop incompatible spaces. If no filters were given, just return the array unchanged.\n const featureFilters = formFilters.filter(filter => ![instantBookOption.value, SpaceFeatures.Catering].includes(filter.value));\n const formFiltersEmpty = featureFilters.length === 0;\n\n // R--- refactor activeForm? Only after forms can handle dateTz\n // Blocked by date time input refactor\n const options: SpaceBookingRuleOptions = {\n duration: activeForm.duration,\n host: currentUser,\n dateTz: activeForm.dateTz,\n };\n let rulesCount = 0;\n let ruleReason = '';\n let excludedByFiltersCount = 0;\n const statusMap: HashMap = {};\n // console.group();\n const filteredSpaces = spaces?.map(space => space instanceof Space ? space : new Space(space)).filter(raw_space => {\n const space = new Space(raw_space); // Construct the full fledged space\n const building = buildings.find(b => space.zones.includes(b.id));\n const rules = rulesForSpace({\n time: options?.dateTz?.ms,\n duration: options.duration,\n user: options.host,\n rules: building?.booking_rules,\n space\n });\n ruleReason = rules.reason;\n let valid = !rules.hide;\n if (!valid) {\n rulesCount++;\n return false;\n }\n\n\n // Check for all the form filters ( except 'catering' )\n let hasAllFeatures: boolean;\n const internalRoomTypeFilters = [\n 'conference',\n 'meeting_room',\n 'partner',\n 'phone_booth',\n 'team_room',\n ];\n\n if (featureFilters.length === 0) {\n hasAllFeatures = true;\n } else if(featureFilters.every(f => internalRoomTypeFilters.includes(f.value))) { // If all featureFilters(selected filters) are present in internalRoomTypeFilters, make the filtering inclusive(return on first true) \n hasAllFeatures = featureFilters.some(f => space.featuresArray.includes(f.value));\n } else { // If any featureFilters(selected filters) are not present in internalRoomTypeFilters, make the filtering exclusive(return on first false)\n hasAllFeatures = featureFilters.every(f => space.featuresArray.includes(f.value));\n }\n\n const canBook = instantBook ? space.bookable : true;\n const matchesType = activeForm?.bookingType?.value === 'allRooms'\n ? true\n : space?.internal_or_external?.length\n ? space.internal_or_external === activeForm?.bookingType?.value\n : true;\n valid = valid && matchesType && (formFiltersEmpty || hasAllFeatures) && canBook;\n let hasCatering = building?.has_catering;\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n // need the room catering to override.\n if (onlyCatering && !hasCatering) {\n valid = false;\n // console.log('Excluded by Catering');\n }\n\n // count this space if the only reason it can't be shown is because one of the filters excluded it\n if (!hasAllFeatures) {\n valid = false;\n // console.log('Excluded by Status');\n }\n\n const status = statusFromBookings(\n space.bookings.length ? space.bookings.map(b => new Booking(b)) : space.settings.bookings.map(b => new Booking(b)),\n space.bookable && !rules.hide,\n !rules.auto_approve,\n activeForm.dateTz,\n space\n );\n\n // only compute room availability here right now if instant book option is chosen and room still valid.\n if (instantBook && valid) {\n valid = status.status === SpaceStatus.Available;\n if (!valid) console.group('Excluded by Status');\n \n }\n\n\n /** \n * If there are rooms that are recurring but not available at all during the queried times, we filter them out from the results displayed on the page.\n * The \"Available\" status indicates whether a room can be booked during the queried times.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\n if(activeForm.is_recurrent && !space.availableOccurrences && !isStaffMap) {\n valid = false;\n }\n /** */\n\n // cache space status\n if (valid) {\n if(activeForm.is_recurrent && space.availableOccurrences && space.availableOccurrences<= space.totalOccurrences) {\n // space is available and requested for recurrence booking and few occurences are available to book then let the space select/bookable from map with limited availability\n statusMap[space.id] = !rules.auto_approve ? SpaceStatus.Requestable : SpaceStatus.Available;\n }else\n {\n statusMap[space.id] = status.status;\n }\n \n } else {\n excludedByFiltersCount++;\n }\n // console.log('Valid:', valid);\n return valid;\n });\n\n const buildingsInSameCity = buildings.filter(\n (_) =>activeForm?.location!==undefined && activeForm?.location?.length && _.city === activeForm?.location[0]?.meta?.building?.city\n ) || [];\n const alternateBuildings = buildingsInSameCity.filter(building =>\n !activeForm.location.some(locationItem =>\n locationItem.meta?.building?.id === building.id\n )\n );\n\n // console.groupEnd();\n let reason, specificReason = SpaceFilterReason.None;\n // console.log('Spaces:', filteredSpaces?.length, excludedByFiltersCount, rulesCount, ruleReason)\n if (filteredSpaces?.length === 0) {\n if (excludedByFiltersCount > 0 && (!formFiltersEmpty || onlyCatering)) {\n reason = SpaceFilterReason.Filters;\n } else if (rulesCount > 0) {\n reason = SpaceFilterReason.OfficeRules;\n } else if(alternateBuildings){\n reason = SpaceFilterReason.AlternateBuildingsFound;\n }\n else {\n reason = SpaceFilterReason.DateTime;\n }\n\n if (ruleReason === SpaceFilterReason.OfficeRules) {\n specificReason = SpaceFilterReason.OfficeRules;\n }\n }\n\n return { spaces: filteredSpaces, reason, statusMap, specificReason };\n};\n","import { BookingFormData } from './booking.form.data';\nimport {\n createAction,\n props\n} from '@ngrx/store';\nimport { Payload } from '../../../../loading/src/lib/loading.actions';;\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\n\nexport const storeBookingFormData = createAction('[BookingForm] Store Form Data',\n props>>());\n\nexport const clearBookingFormData = createAction('[BookingForm] Clear Form Data');\n\nexport const storeRoomFilters = createAction('[BookingForm] Store Room Filters',\n props[]>>());\n\nexport const clearRoomFilters = createAction('[BookingForm] Clear Room Filters');\n\nexport const openBookingSurvey = createAction('[BookingSurvey] Open Survey Modal');\n","import { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { RoomQueryOptions } from '../../../../rooms/src/lib/rooms.types';\nimport { User } from '../users/user.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { Building } from '../organisation';\n\nexport const DEFAULT_BOOKING_DURATION = 30;\n\nexport const internalBookingTypeOption = {\n value: 'internal',\n display: 'Internal',\n};\n\nexport const allBookingTypeOption = {\n value: 'allRooms',\n display: 'All Rooms',\n};\n\nexport const bookingTypeOptions: SelectOption[] = [\n internalBookingTypeOption,\n {\n value: 'external',\n display: 'External',\n }\n];\n\nexport const defaultRoomSizeOption = {\n value: '2',\n display: '3-9 People',\n};\n\nexport const roomSizeOptions: SelectOption[] = [\n {\n value: '1',\n display: '1-2 People',\n },\n defaultRoomSizeOption,\n {\n value: '3',\n display: '10+ People',\n }\n];\n\nexport const roomSizeOptionsKiosk: SelectOption[] = [\n ...roomSizeOptions,\n {\n value: '4',\n display: 'All Rooms',\n },\n];\n\nexport const roomCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 1;\n case '2':\n return 3;\n case '3':\n return 10;\n case '4':\n return null;\n }\n};\n\nexport const roomMaxCapacityToValue = (roomSize: string): number => {\n switch (roomSize) {\n case '1':\n return 2;\n case '2':\n return 9;\n default:\n return null;\n }\n};\n\nexport interface BookingFormData {\n // R--- off the rails, define these \"any's\"\n id?: string;\n location: SelectOption[];\n dateTz: DateTZ;\n /**\n * Duration, in minutes.\n */\n duration: number;\n bookingType: SelectOption;\n roomSize: SelectOption;\n selectedRoom?: any;\n organiser?: SelectOption;\n title?: string;\n attendees?: any[];\n code?: string;\n notes?: string;\n head_count?: number;\n creator?: User;\n company?: any[];\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n action?: string; // helping to set staff app recurring action flag for edit/clone in the active form\n ignore?: string; // helping while editing - recurring series rooms search api call\n bookable?: boolean; // set while editing - recurring series rooms search api call\n occurrence_edits?: string[];\n opt_out?:boolean;\n nextBusinessDay?: boolean; // set property if user room selection from next business day section on result page\n outlook_opt_out?:boolean;\n expanded_section_ids?: string[]; // set property if user room selection from next business day section on result page\n resultLoaded?: number; // set property if user room selection from any section on result page after clicking load more button\n}\n\n/**\n * Converts form data into API query parameters.\n */\nexport const roomFormDataToQuery = (\n data: BookingFormData\n): RoomQueryOptions => {\n // remove all buildings chip from query\n const filteredLocationIds = data?.location\n .filter((l) => l.groupChild)\n .map((l) => l.value)\n .join(',');\n return {\n dateTz: data?.dateTz,\n duration: data?.duration,\n locations: filteredLocationIds,\n capacity: roomCapacityToValue(data?.roomSize?.value),\n capacity_max: roomMaxCapacityToValue(data?.roomSize?.value),\n\n is_recurrent: data?.is_recurrent,\n is_multiroom: data?.is_multiroom,\n merged: data?.merged,\n recurrence_period: data?.recurrence_period,\n recurrence_interval: data?.recurrence_interval,\n recurrence_endTz: data?.recurrence_endTz,\n recurrence_count: data?.recurrence_count,\n recurrence_starts: data?.recurrence_starts,\n recurrence_exceptions: data?.recurrence_exceptions, //SHOULD BE DATETZ\n recurrence_days: data?.recurrence_days,\n timezone: data?.timezone,\n offset: data?.offset,\n buildings: data?.buildings,\n bookable: data?.bookable,\n ignore: data?.ignore\n };\n};\n","import { BookingFormState } from './booking.form.types';\nimport {\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption\n} from './booking.form.data';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nconst now = DateNow(new Date())\n\nexport const defaultTestBookingForm = (): BookingFormState => ({\n activeForm: {\n dateTz: now,\n duration: 2 * DEFAULT_BOOKING_DURATION,\n location: [],\n bookingType: internalBookingTypeOption,\n roomSize: defaultRoomSizeOption\n },\n activeFormFilters: []\n});\n","import { createSelector } from '@ngrx/store';\nimport {\n RoomStoreState\n} from '../../../../rooms/src/lib/rooms.types';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n roomStateSelector,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from '../../../../rooms/src/lib/rooms.actions';\nimport {\n loadHomepageBookingsResults,\n loadUpcomingBookingsResults,\n loadPastBookingsResults,\n loadCancelledBookingsResults,\n loadBookingByIdResults,\n bookingStateSelector\n} from '../../../../bookings/src/lib/bookings.actions';\nimport { Building } from '../organisation/building.class';\nimport { BuildingStoreState } from '../../../../buildings/src/lib/buildings.types';\nimport { selectLoadBuildingsSuccess } from '../../../../buildings/src/lib/buildings.actions';\nimport { Space } from '../spaces/space.class';\nimport { User } from '../users/user.class';\nimport { selectCurrentUser } from '../../../../user/src/lib/user.actions';\nimport { UserStoreState } from '../../../../user/src/lib/user.types';\nimport { LoadingModel } from '../../../../loading/src/lib/loading.model';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\n\nimport {\n SpaceFilterReason,\n filterSpacesByAppliedFilters,\n FilteredSpaces\n} from './booking-filter.utils';\nimport {\n BookingFormData,\n internalBookingTypeOption,\n} from './booking.form.data';\nimport {\n BookingFormState,\n BookingStoreState,\n} from './booking.form.types';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\n\n\nexport const selectBookingFormsData =\n (state: BookingStoreState | RoomStoreState | BuildingStoreState | UserStoreState) =>\n (state as any).bookingForm as BookingFormState;\n\nexport const selectActiveForm = createSelector(selectBookingFormsData, state => {\n // Recreate because serialized form dateTz doesn't have DateTZ class methods\n if (!state.activeForm?.dateTz) {\n return state.activeForm\n }\n const { date, is_local_tz, building_tz} = state.activeForm?.dateTz;\n const endTzDate = state.activeForm?.recurrence_endTz?.date;\n const recurrence_endTz = endTzDate ? {\n recurrence_endTz : new DateTZ({ date: endTzDate.valueOf(), is_local_tz, building_tz })\n } : {};\n\n const recurrence_starts = state.activeForm?.recurrence_starts\n\t\t\t? {\n\t\t\t\t\trecurrence_starts: state.activeForm?.recurrence_starts.map( el =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// at final step of booking creation process recurrence_start becomes Array which need to be Array\n\t\t\t\t\t\t\t// To Do: Refactor - apps/staff/src/app/booking/booking-create/booking-form-base.component.ts lno: 186\n\t\t\t\t\t\t\treturn new DateTZ({ date: typeof el === 'number' ? el * 1000 : el.date.valueOf(), is_local_tz, building_tz })\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\n\n const recEditingSearchPayload = (state.activeForm.action === SeriesAction.EDIT && state.activeForm.is_recurrent)\n\t\t\t?\n\t\t {\n\t\t\t\tid: state.activeForm.id,\n\t\t\t\tignore: state.activeForm.ignore,\n\t\t\t\tbookable: state.activeForm.bookable\n\t\t\t}\n\t\t\t: {};\n\n\n\n\n return {\n ...state.activeForm,\n dateTz: new DateTZ({ date: date.valueOf(), is_local_tz, building_tz }),\n ...recurrence_endTz,\n ...recurrence_starts,\n\t\t\t\t...recEditingSearchPayload\n }\n});\n\nexport const selectBookingType = createSelector(selectActiveForm,\n (form) => form?.bookingType);\n\nexport const selectBookingLocations = createSelector(selectActiveForm,\n (form) => (form?.location || []).filter(f => !f.groupHeader));\n\nexport const selectIsInternal = createSelector(selectBookingType,\n (type) => type?.value === internalBookingTypeOption.value);\n\nexport const selectFormFilters = createSelector(selectBookingFormsData,\n (state) => state.activeFormFilters || []);\n\nconst selectRoomResultsFromState = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.model);\n\nconst selectRoomResultsFromState_map = createSelector(roomStateSelector,\n loadRoomsForResultsMap.selectors.model);\n\nconst selectLaterThatDayResultsFromState = createSelector(roomStateSelector,\n loadLaterThatDayResults.selectors.model);\nconst selectNextDayResultsFromState = createSelector(roomStateSelector,\n loadNextDayResults.selectors.model);\nconst selectByIdResultsFromState = createSelector(roomStateSelector,\n loadByIdResults.selectors.model);\nconst selectDiffSizeResultsFromState = createSelector(roomStateSelector,\n loadDiffSizeResults.selectors.model);\n\nexport const selectHomepageBookingsResultsFromState = createSelector(bookingStateSelector,\n loadHomepageBookingsResults.selectors.model);\nexport const selectUpcomingBookingsResultsFromState = createSelector(bookingStateSelector,\n loadUpcomingBookingsResults.selectors.model);\nexport const selectPastBookingsResultsFromState = createSelector(bookingStateSelector,\n loadPastBookingsResults.selectors.model);\nexport const selectCancelledBookingsResultsFromState = createSelector(bookingStateSelector,\n loadCancelledBookingsResults.selectors.model);\nexport const selectBookingByIdResultsFromState = createSelector(bookingStateSelector,\n loadBookingByIdResults.selectors.model);\n\n/**\n * Wraps {@link filterSpacesByAppliedFilters} with {@link LoadingModel} interop.\n * This will only filter data if there is data to filter, and returns a success {@link LoadingModel}.\n * The \"isStaffMap\" flag- This helps to indicate that all occurrences of this room are booked during the queried times and are currently in use.\n * \"isStaffMap\" flag allows including such rooms in the list, which will be displayed in red on the map.\n */\nconst filterSpacesByAppliedFiltersIfSuccess = (\n results: LoadingModel,\n formFilters: SelectOption[],\n activeForm: BookingFormData,\n buildings: Building[] | undefined,\n currentUser: User | undefined,\n isStaffMap: boolean = false): LoadingModel => {\n const data = results.optionalSuccess;\n\n // don't filter model if no success found\n return !activeForm ? results.mutate({\n spaces: data, // the result here is a raw JSON Space, not the Space class\n reason: SpaceFilterReason.None,\n statusMap: {}\n }) : results.mutate(\n filterSpacesByAppliedFilters(formFilters, data, activeForm, buildings || activeForm.buildings, currentUser, isStaffMap));\n};\n\nexport const selectFilteredResults = createSelector(selectRoomResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectMapFilteredResults = createSelector(selectRoomResultsFromState_map,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser, isStaffMap) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser, true));\n\nexport const selectFilteredLaterDayResults = createSelector(selectLaterThatDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\nexport const selectFilteredNextDayResults = createSelector(selectNextDayResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n\nexport const selectFilteredByIdResults = createSelector(selectByIdResultsFromState,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n (results, activeForm, buildings, currentUser) => filterSpacesByAppliedFiltersIfSuccess(results, [], activeForm, buildings, currentUser));\n\nexport const selectFilteredDiffSizeResults = createSelector(selectDiffSizeResultsFromState,\n selectFormFilters,\n selectActiveForm,\n selectLoadBuildingsSuccess,\n selectCurrentUser,\n filterSpacesByAppliedFiltersIfSuccess);\n\n/**\n * Maps selected options by loaded buildings.\n */\nexport const selectSelectedBuildingOptions = createSelector(\n selectBookingLocations,\n selectLoadBuildingsSuccess,\n (locations, buildings) => (locations\n .map(l => buildings?.find(b => b.id === l.value))\n .filter(f => !!f) as Building[])\n);\n\n","import { Building, BuildingCity } from '../organisation/building.class';\nimport { Booking } from '../bookings/booking.class';\nimport { BuildingLevel } from '../organisation/level.class';\nimport { Space } from '../spaces/space.class';\nimport { SpacesService } from '../spaces/spaces.service';\nimport {\n timezoneDisplay,\n timezoneNameToDate,\n unique,\n ImageDirective,\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../../../../ui/src/lib/options/select-option';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * If more than 3 are selected, we truncate location display.\n */\nconst MAX_ABBREV_LOCATIONS = 3;\n\nexport const mapBuildingToSelectOption = (\n city: string,\n building: Building\n): SelectOption => ({\n display: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n dropdownOverride: `${building.code}-${building.name}, ${building.address}`,\n value: building.id,\n groupId: city,\n groupChild: true,\n shortDisplay: `${building.name} ${timezoneDisplay(\n timezoneNameToDate(building.timezone)\n )}`,\n meta: { building, city },\n});\n\nexport const mapCityToAllSelectOption = (\n city: BuildingCity\n): SelectOption => ({\n display: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n value: city.name,\n groupHeader: true,\n groupId: city.name,\n shortDisplay: `${city.name} (All Offices) ${timezoneDisplay(\n timezoneNameToDate(city.timezone)\n )}`,\n meta: { city },\n});\n\n/**\n * Flattens a map of {@link BuildingCity} to {@link Building} array into a list of {@link SelectOption}.\n * @param grouped The grouping\n */\nexport const flattenDisplayOffices = (\n grouped: Map\n) => {\n const options: SelectOption[] = [];\n grouped.forEach((value, key) => {\n options.push(mapCityToAllSelectOption(key));\n value.forEach((b) =>\n options.push(mapBuildingToSelectOption(key.name, b))\n );\n });\n return options;\n};\n\n/**\n * This method will either add or remove a selected option from the selectedOptions list based on\n * these conditions:\n * 1. If the option EXISTS in the list AND is a groupHeader, de-select all of its children.\n * 2. If the option EXISTS in the list AND is a groupChild, remove it and its associated header from the list.\n * 3. If the option does NOT EXIST in the list AND is a groupHeader, select all other children.\n * 4. If the option does NOT EXIST in the list AND is a groupChild, add it to the list.\n *\n * Special note regarding item 4:\n * 4a. If that selection completes the children selection, select its associated header as well.\n */\nexport const toggleSelectedByGroup = (\n options: SelectOption[],\n selectedOptions: SelectOption[],\n option: SelectOption\n) => {\n if (selectedOptions.find((s) => s.value === option.value)) {\n return selectedOptions.filter((s) => {\n let filter = s.value !== option.value;\n // if group header, also remove any option that is the child of it.\n if (option.groupHeader) {\n filter =\n filter &&\n (!s.groupChild ||\n (s.groupChild && s.groupId !== option.groupId));\n } else if (option.groupChild) {\n // if child removing, remove the associated header.\n filter =\n filter &&\n (!s.groupHeader ||\n (s.groupHeader && s.groupId !== option.groupId));\n }\n return filter;\n });\n }\n // option does NOT EXIST\n // if adding header, add the other children to the selected list, ensuring no dupes.\n if (option.groupHeader) {\n const toSelect = options.filter(\n (v) =>\n v.groupChild &&\n v.groupId === option.value &&\n !selectedOptions.find((selected) => selected.value === v.value)\n );\n return [...selectedOptions, option, ...toSelect];\n }\n // add group child, add the group header if all satisfied\n const newGroup = [...selectedOptions, option];\n\n // check if we have selected all children from options by filtering down by city and checking if\n // they're in the selected options list.\n const remainingChildrenInGroup = options.filter(\n (o) =>\n o.groupChild &&\n o.groupId === option.groupId &&\n !newGroup.find((ng) => ng.value === o.value)\n );\n // if we dont have remaining children, add the group\n if (remainingChildrenInGroup.length === 0) {\n return [\n ...newGroup,\n options.find((o) => o.groupHeader && o.groupId === option.groupId),\n ];\n }\n return newGroup;\n};\n\n/**\n * If the list of locations are larger than {@link MAX_ABBREV_LOCATIONS}, then truncate\n * and display the remaining count.\n */\nexport const truncateLocationList = (\n locations: readonly SelectOption[]\n): string => {\n // comma separate the locations\n let truncatedLocations = [...locations];\n const shouldTruncate = locations.length > MAX_ABBREV_LOCATIONS;\n if (shouldTruncate) {\n truncatedLocations = truncatedLocations.splice(0, MAX_ABBREV_LOCATIONS);\n }\n let display = truncatedLocations\n .map((l) => l.shortDisplay || l.display)\n .join(', ');\n if (shouldTruncate) {\n display += `...(${locations.length})`;\n }\n return display;\n};\n\nexport const mapBuildingLevelToOption = (\n level?: BuildingLevel\n): SelectOption =>\n level\n ? {\n value: level.id,\n display: level.name,\n }\n : undefined;\n\n/**\n * Returns all levels included with the building, deduped.\n * @param buildings\n */\nexport const flattenBuildingsWithLevels = (buildings: Building[]) => {\n const flattenedLevels = unique(\n buildings.reduce((next: BuildingLevel[], building: Building) => {\n next.push(...building.levels);\n return next;\n }, []),\n 'id'\n );\n return {\n flattenedLevels,\n buildings,\n };\n};\n\n/** Gets route to image placeholder if room image isn't found */\n\nexport const placeholderRoute = (num: number): string => {\n let index: number;\n if (num <= 3) {\n index = num;\n } else if (num % 3 === 0) {\n index = 3;\n } else {\n index = 1;\n }\n return `assets/img/rooms/placeholder-${index}.png`;\n};\n\n/**\n * Method takes the rootFolderURL and fileSlug to create an array of three images\n * that should exist. If a room image exists, it replaces the placehoder image.\n */\nexport const setupRoomImages = (\n componentReference: ImageDirective,\n image_positions: number[],\n rootFolderURL: string,\n fileSlug: string,\n imagesLoaded: boolean = false\n): void => {\n let foundImages: any[] = image_positions.map((i) =>\n i ? { path: placeholderRoute(i) } : false\n );\n image_positions.forEach((n) => {\n const desiredImageName = `${rootFolderURL}${fileSlug}-part-${n}.png`;\n const desiredImage = location.pathname.includes('concierge') ? `${location.origin}/staff/${desiredImageName}` : desiredImageName;\n if (!imagesLoaded) {\n const tester = new Image();\n tester.onload = () => {\n // Will never run on unit test\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = [...foundImages.slice()];\n componentReference?.loadImages && componentReference?.loadImages.next([...foundImages.slice()]);\n };\n tester.src = desiredImage;\n }\n\n // Force valid image output on unit test\n if (imagesLoaded) {\n foundImages[n - 1] = { path: desiredImage };\n componentReference.foundImages = foundImages.slice();\n }\n });\n};\n\nexport const bookingStatusDetails = (booking: Booking) => {\n const now = DateNow(new Date());\n let image = '';\n let text = '';\n let title = '';\n\n if (booking?.status) {\n const status = now > booking.endDateTz ? 'expired' : booking.status;\n switch (status) {\n case 'unavailable':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Unavailable';\n text = 'Unavailable';\n break;\n case 'declined':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'cancelled':\n image = 'assets/icon/booking_cancelled.svg';\n title = 'Cancelled';\n text = 'Cancelled';\n break;\n case 'expired':\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n case 'tentative':\n image = 'assets/icon/booking_pending.svg';\n title = 'Requested';\n text = 'Pending';\n break;\n case 'accepted':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n case 'approved':\n image = 'assets/icon/booking_confirmed.svg';\n title = 'Confirmed';\n text = 'Confirmed';\n break;\n default:\n // TODO\n image = 'assets/icon/booking_expired.svg';\n title = 'Expired';\n text = 'Expired';\n break;\n }\n }\n return { text, title, image };\n};\n\nexport const roomHasCateringHours = (building: Building, space: Space) => {\n let hasCatering = building\n ? building.has_catering && building.catering_hours\n : false;\n // Room catering status as false overrides building status\n if (space?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n};\n\nexport const cateringAllowed = (booking: Booking, building: Building) => {\n const status = bookingStatusDetails(booking);\n const disallowedStatus = ['declined', 'cancelled', 'expired'].includes(\n status.text\n );\n const opens = building?.catering_hours?.start;\n const closed = building?.catering_hours?.end;\n\n if (disallowedStatus) {\n return false;\n }\n\n if (typeof opens === 'undefined' || typeof closed === 'undefined') {\n return false;\n }\n\n // Catering time could be a decimal so convert to a date\n const openMinutes = opens * 60;\n const closeMinutes = closed * 60;\n\n const startOfDay = booking.startDateTz.startOfValue('day');\n const cateringOpenTime = startOfDay.addValue({ minutes: openMinutes });\n const cateringCloseTime = startOfDay.addValue({ minutes: closeMinutes });\n\n if (\n cateringOpenTime.ms <= booking.startDateTz.ms ||\n cateringCloseTime.ms > booking.startDateTz.ms\n ) {\n // Booking ends before catering opens\n if (booking.endDateTz.ms <= cateringOpenTime.ms) {\n return false;\n }\n // Booking starts after catering closes\n if (booking.startDateTz.ms > cateringCloseTime.ms) {\n return false;\n }\n\n // Start time is OK\n if (booking.startDateTz.ms > DateNow(new Date()).ms) {\n // Due to COVID, no orders are available once a meeting begins.\n return true;\n }\n }\n\n return false;\n};\n\nexport const checkCollisions = (\n service: SpacesService,\n booking: Booking\n): Promise => {\n return new Promise((resolve, reject) => {\n\n let availabilityParams: {\n room_ids: string;\n dateTz: DateTZ;\n duration: number;\n setup: number;\n breakdown: number;\n hide_bookings: boolean;\n [key: string]: any;\n } = {\n room_ids: booking.space.id,\n dateTz: booking.startDateTz,\n duration: booking.duration,\n setup: booking.setup[booking.space.email],\n breakdown: booking.breakdown[booking.space.email],\n hide_bookings: false,\n };\n\n if (booking.recurrence_type === \"master\" || booking.recurrence_type === null) {\n availabilityParams = {\n ...availabilityParams,\n ignore: booking?.icaluid,\n recurrence_count: booking?.recurrence_count,\n recurrence_period: booking?.recurrence_period,\n recurrence_endTz: booking?.recurrence_endTz,\n recurrence_interval: booking?.recurrence_interval,\n recurrence_starts: booking?.recurrence_starts,\n is_recurrent: booking?.is_recurrent,\n recurrence_days: booking?.recurrence_days\n } as typeof availabilityParams;\n }\n\n service\n .available(\n availabilityParams,\n null,\n false\n )\n .then(\n (list) => {\n const space = list.length ? list[0] : null;\n if (space) {\n if (!space.bookable) return reject('Has conflict');\n const setup = booking?.setup[space?.email] || 0;\n const breakdown = booking?.breakdown[space?.email] || 0;\n const start_time = booking?.startDateTz.seconds - setup;\n const end_time = booking.endDateTz.seconds + breakdown;\n\n const bookings = space.settings.bookings;\n // console.log('Bookings:', bookings);\n // Compare the existing bookings to see if any truely conflict.\n if (bookings.length) {\n const has_conflict = bookings.find(bkn => {\n const b_setup = bkn.setup[space.email] || 0;\n const b_breakdown = bkn.setup[space.email] || 0;\n const start = (bkn.start_epoch || bkn.start) - b_setup;\n const end = (bkn.end_epoch || bkn.end) + b_breakdown;\n return (\n (end_time > start && end_time <= end) || // Booking ends during the meeting\n (start_time >= start && start_time < end) || // Booking starts during a meeting\n (start_time <= start && end_time >= end) // Booking overlaps entire meeting\n ) && \n ( \n bkn.id !== booking.id \n || \n ( !!booking.is_recurrent && (booking.recurrence_type === \"master\" || booking.recurrence_type === null ) ) \n ?\n bkn.recurrence_master_id !== booking.id\n :\n false\n \n )\n\n\n\n });\n // Conflicts found, reject\n if (has_conflict) return reject('has booking conflict');\n }\n return resolve(space.bookable);\n }\n reject('space not found');\n },\n () => reject('available error')\n );\n });\n};\n\nexport const getStatusErrorMessage = (status?: number) => {\n let msg = '';\n switch (status) {\n\t\t\tcase 400:\n\t\t\t\tmsg = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\tbreak;\n\t\t\tcase 403:\n\t\t\t\tmsg = 'Your do not have permission to update this booking.';\n\t\t\t\tbreak;\n\t\t\tcase 409:\n\t\t\t\tmsg = 'Sorry, your booking time conflicts with another booking.';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmsg = 'Your booking failed to update, please try again';\n }\n return msg;\n};\n","export * from './room-results/room-results.viewmodel'\nexport * from './booking-filter.utils'\nexport * from './booking.form.actions'\nexport * from './booking.form.data'\nexport * from './booking.form.spec-helpers'\nexport * from './booking.form.types'\nexport * from './booking.selectors'\nexport * from './booking.utils'","import { Space } from '../../spaces/space.class';\nimport { BuildingLevel } from '../../organisation/level.class';\nimport { Building } from '../../organisation/building.class';\n\nexport class RoomResultsViewModel {\n\n public levelDisplay: string;\n public title: string;\n public office: string;\n public capacity: string;\n\n constructor(public space: Space,\n public level?: BuildingLevel,\n public building?: Building) {\n\n this.levelDisplay = `Level ${this.space?.level?.short_name}`;\n this.title = this.space.local_name;\n this.office = this.building ? `(${this.building?.code}) ${this.building?.name}` : '';\n this.capacity = `Capacity: ${this.space.capacity} people`;\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Space[],\n flattenedLevels: BuildingLevel[],\n buildings: Building[]): RoomResultsViewModel[] =>\n results.map((r: Space) => {\n const level = flattenedLevels.find(l => r.zones.includes(l.id));\n const building = buildings.find(b => r.zones.includes(b.id));\n return new RoomResultsViewModel(\n r,\n level,\n building\n );\n });\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, combineLatest, of, Observable } from 'rxjs';\nimport {\n catchError,\n debounceTime,\n filter,\n first,\n map,\n shareReplay,\n switchMap,\n} from 'rxjs/operators';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { replaceBookings, timePeriodsIntersect } from './booking.utilities';\nimport { SpacesService } from '../spaces/spaces.service';\nimport { Booking } from '../bookings/booking.class';\nimport { Space } from '../spaces/space.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { OrganisationService } from '../organisation/organisation.service';\n\nexport type BookingType =\n | 'internal'\n | 'client'\n | 'external'\n | 'setup'\n | 'training'\n | 'interview'\n | 'declined';\n\nexport interface BookingFilters {\n /** List of zone ids to get bookings for */\n zone_ids?: string[];\n space_emails?: string[];\n hide_type?: BookingType[];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class BookingStateService extends BaseClass {\n /** List of bookings */\n private _poll = new BehaviorSubject(false);\n /** List of bookings */\n private _long_poll = new BehaviorSubject<'month' | ''>('');\n private _long_poll_week = new BehaviorSubject<'week' | ''>('');\n /** List of bookings */\n private _bookings = new BehaviorSubject([]);\n /** List of meeting count per date */\n public _noOfMeetings = new BehaviorSubject<{}>({});\n /** Filter details for bookings */\n private _filters = new BehaviorSubject({});\n /** Currently active date */\n private _dateTz = new BehaviorSubject(DateNow(new Date()));\n /** Currently displayed zone */\n private _zone = new BehaviorSubject(' ');\n /** Whether booking data is being loaded */\n private _loading = new BehaviorSubject(false);\n /** Observable for filter and booking list changes */\n private _state = combineLatest(\n this._bookings,\n this._filters,\n this._dateTz,\n this._zone\n );\n\n /** Observable for list of bookings */\n public readonly bookings = this._bookings.asObservable();\n /** Observable for active date */\n public readonly dateTz = this._dateTz.asObservable();\n /** Observable for active zone */ // R-- zone was this._date.asObservable(); this looks like a mistake but it exists from the beginning of time\n public readonly zone = this._dateTz.asObservable();\n /** Observable for loading state of bookings */\n public readonly loading = this._loading.asObservable();\n\n public get booking_date() {\n // When this class is initialized this._dateTz is local timezone\n return this._dateTz.value;\n }\n\n public get timezone() {\n return localStorage.getItem('CONCIERGE.timezone');\n }\n\n /** Obsevable for filtered list of bookings */\n public readonly filtered = this._state.pipe(\n map((state) => {\n const bdTz = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const startTz = bdTz.startOfValue('day');\n const endTz = startTz.addValue({}).endOfValue('day');\n return this.filterBookings(startTz, endTz);\n }),\n shareReplay(1)\n );\n\n /** Obsevable for filtered list of bookings of the active week */\n public readonly filtered_week = this._state.pipe(\n map(() => {\n // Tested to be valid in building time now.\n const bd = this.timezone\n ? new DateTZ({\n date: this.booking_date.ms,\n is_local_tz: false,\n building_tz: this.timezone,\n })\n : this.booking_date;\n const start = bd.startOfValue('week').startOfValue('day');\n const end = this.getEndOfWeek(bd);\n return this.filterBookings(start, end);\n })\n );\n\n /** Obsevable for filtered list of bookings for active month */\n public readonly filtered_month = this._state.pipe(\n map(() => {\n const start = this.booking_date.startOfValue('month');\n const end = this.booking_date.endOfValue('month');\n return this.filterBookings(start, end);\n })\n );\n\n /** Active filters */\n public get filters() {\n return this._filters.getValue();\n }\n\n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private ngZone: NgZone,\n ) {\n super();\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Just to get the timezone correct\n this._dateTz.next(\n new DateTZ({\n date: this._dateTz.value.ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone,\n })\n );\n });\n\n /** Generate observable for updating bookings */\n const search = combineLatest(this._poll, this._zone, this._dateTz).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap(() => {\n const fzone = this._zone.getValue();\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n const start = this.booking_date.startOfValue('day');\n const end = start.endOfValue('day');\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start.seconds,\n available_to: end.seconds,\n });\n }),\n catchError(() => of([]))\n );\n\n const search_long_week = combineLatest(\n this._long_poll_week,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, false);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n\n //TO DO: make sure both spaces have same booking\n /** Subscribe to update observable */\n search.subscribe((space_list) => {\n this.processBookings(space_list);\n this._loading.next(false);\n });\n search_long_week.subscribe((space_list) => {\n this.processBookings(space_list, this._long_poll_week.getValue() as any);\n this._loading.next(false);\n });\n }\n\n /**\n * Function to build\n */\n private buildSpaceLongQuery(dailyCount: boolean = false): Observable {\n return combineLatest(\n this._long_poll,\n this._zone,\n this._dateTz\n ).pipe(\n filter((i) => !!i[0]),\n debounceTime(500),\n switchMap((props) => {\n const type = props[0];\n const fzone = dailyCount ? this._org.building.id : props[1];\n const dateTz = props[2];\n if (!fzone) {\n return of([]);\n }\n this._loading.next(true);\n return this.querySpace(type, fzone, dateTz, dailyCount);\n }),\n catchError((e) => { \n return of([]);\n })\n );\n }\n\n private querySpace(type: string, fzone: string, dateTz: DateTZ, dailyCount: boolean = false) : Observable | Observable{\n const start = () => {\n const s = dateTz;\n if (type === 'week') {\n return s.startOfValue('week');\n } else {\n return s.startOfValue('month');\n }\n };\n\n const end = () => {\n const e = start();\n if (type === 'week') {\n /**\n * To Do: date-tz.class.ts endOfValue subtracts 1 day from end of week for 7 days a week type which returns Friday instead of Saturday\n * below is the adjustment -\n */\n return e.addValue({ days: 1 }).endOfValue('week');\n } else {\n return e.endOfValue('month');\n }\n /**\n * R--- when testing March 2022 London offices, the month is an hour short.\n * Is this a Luxon bug or London DST?\n */\n };\n\n // dates here are ok\n return this._spaces.queryBooking({\n zone_ids: fzone,\n available_from: start().seconds,\n available_to: end().seconds,\n ...(dailyCount) ? { daily_count: true } : ''\n });\n }\n\n\n public getDailyMeetingCount() : void {\n this._long_poll.next('month');\n this.buildSpaceLongQuery(true).subscribe((counts) => {\n this._noOfMeetings.next(counts);\n this._loading.next(false);\n });\n }\n\n /**\n * Update the booking filters\n * @param details\n */\n public setFilters(details: BookingFilters) {\n this._filters.next(details);\n }\n\n /**\n * Update the booking date\n * @param details\n */\n public setDate(dateTz: DateTZ) {\n this._dateTz.next(dateTz);\n }\n\n /**\n * Update the booking's zone\n * @param details\n */\n public setZone(zone: string) {\n this._zone.next(zone);\n }\n\n /**\n * update day view once\n */\n public pollOnce(){\n this._poll.next(true);\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPolling(delay: number = 30 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingWeek(delay: number = 4 * 30 * 1000 ) {\n this._long_poll_week.next('week');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll_week.next('week'),\n delay\n );\n });\n }\n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingEveryFiveMin(delay: number = 60 * 1000) {\n this._poll.next(true);\n this.ngZone.runOutsideAngular(() => {\n this.interval('polling', () => this._poll.next(true), delay);\n });\n }\n \n /**\n * Start polling to update bookings\n * @param delay Duration between polling events in milliseconds\n */\n public startPollingMonth(delay: number = 5 * 60 * 1000) {\n this._long_poll.next('month');\n this.ngZone.runOutsideAngular(() => {\n this.interval(\n 'polling_long',\n () => this._long_poll.next('month'),\n delay\n );\n });\n }\n\n\n /**\n * Stop polling to update bookings;\n */\n public stopPolling() {\n this._poll.next(false);\n this.clearInterval('polling');\n this._long_poll.next('');\n this.clearInterval('polling_long');\n }\n\n public updateRoomList() {\n this._spaces.updateRoomList();\n }\n\n /**\n * Add booking to bookings listing\n * @param booking\n */\n public add(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Update booking in the bookings list\n * @param booking\n */\n public replace(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings\n .filter(\n (bkn) =>\n bkn.icaluid !== booking.icaluid && bkn.id !== booking.id\n )\n .concat([booking]);\n this._bookings.next(new_bookings);\n }\n\n /**\n * Remove booking in the bookings list\n * @param booking\n */\n public remove(booking: Booking) {\n const bookings = this._bookings.getValue();\n const new_bookings = bookings.filter(\n (bkn) => bkn.icaluid !== booking.icaluid\n );\n this._bookings.next(new_bookings);\n }\n\n public attentToDelete(\n booking: Booking,\n action: 'series' | 'booking' = 'booking',\n undo: boolean = false\n ) {\n const bookings = this._bookings.getValue();\n const attempted_to_delete = ((action) => {\n return (bkg: Booking) => {\n switch (action) {\n case 'booking': {\n const booking_master = bookings.find(\n (bkn) => bkn.icaluid === booking.icaluid\n );\n if (!booking_master) return false;\n return bkg.id === booking.id;\n }\n case 'series': {\n const booking_master = bookings.find(\n (bkg) =>\n bkg.id ===\n (booking.recurrence_type === 'occurrence'\n ? booking.recurrence_master_id\n : booking.id)\n );\n if (!booking_master) return false;\n return (\n booking_master.id === bkg.id ||\n bkg.recurrence_master_id === booking_master.id\n );\n }\n default:\n false;\n }\n };\n })(action);\n\n const new_bookings = [...bookings].map((bkg) => {\n if (!undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = action;\n }\n\n if (undo && attempted_to_delete(bkg)) {\n bkg.attempted_to_delete = null;\n }\n\n return bkg;\n });\n\n this._bookings.next(new_bookings);\n }\n\n private processBookings(\n space_list: Space[],\n period: 'day' | 'week' | 'month' = 'day'\n ) {\n const start = () => {\n switch (period) {\n case 'month':\n return this.booking_date.startOfValue('month');\n case 'week':\n return this.booking_date.startOfValue('week');\n default:\n return this.booking_date.startOfValue('day');\n }\n };\n const end = () => {\n const s = start();\n switch (period) {\n case 'month':\n return s.endOfValue('month');\n case 'week':\n return s.endOfValue('week');\n default:\n return s.endOfValue('day');\n }\n };\n\n let bookings = this._bookings.getValue();\n space_list.forEach((space) => {\n return (bookings = replaceBookings(\n bookings,\n space.bookings.map((bkn) => new Booking(bkn)),\n {\n room_email: space.email,\n fromTz: start(),\n toTz: end(),\n }\n ));\n });\n this._bookings.next(bookings);\n }\n\n // private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n // const filters = this._filters.getValue();\n // const bookings = this._bookings.getValue();\n // const fzone = this._zone.getValue();\n // return bookings.filter((bkn) => {\n // const intersects = timePeriodsIntersect(\n // startTz.ms,\n // endTz.ms,\n // bkn.startDateTz.ms,\n // bkn.endDateTz.ms\n // );\n // const in_zone = bkn.room.zones.includes(fzone);\n // const has_space =\n // !filters.space_emails?.length ||\n // filters.space_emails.includes(bkn.room.email);\n // const in_zones =\n // !filters.zone_ids?.length ||\n // !!bkn.room.zones.find((zone) =>\n // filters.zone_ids.includes(zone)\n // );\n // const type = bkn.declined ? 'declined' : bkn.getType();\n\n // const show =\n // !filters.hide_type?.length ||\n // !filters.hide_type.includes(type as any);\n // return intersects && has_space && in_zone && in_zones && show;\n // });\n // }\n\n private filterBookings(startTz: DateTZ, endTz: DateTZ) {\n const filters = this._filters.getValue();\n const bookings = this._bookings.getValue();\n const fzone = this._zone.getValue();\n return bookings.filter((bkn) => {\n const intersects = timePeriodsIntersect(\n startTz.ms,\n endTz.ms,\n bkn.startDateTz.ms,\n bkn.endDateTz.ms\n );\n // Check if any room in the booking satisfies the conditions\n const roomSatisfiesConditions = bkn.multi_rooms.some((room) => {\n const in_zone = room.zones.includes(fzone);\n const has_space =\n !filters.space_emails?.length ||\n filters.space_emails.includes(room.email);\n const in_zones =\n !filters.zone_ids?.length ||\n !!room.zones.find((zone) => filters.zone_ids.includes(zone));\n return in_zone && has_space && in_zones;\n });\n \n const type = bkn.declined ? 'declined' : bkn.getType();\n \n const show =\n !filters.hide_type?.length ||\n !filters.hide_type.includes(type as any);\n return intersects && roomSatisfiesConditions && show;\n });\n } \n\n /**If Sunday add one day to get Saturday as end of week */\n private getEndOfWeek(date: DateTZ): DateTZ {\n return date.dateWeekday === 7\n ? date.addValue({ days: 1 }).endOfValue('week').endOfValue('day')\n : date.endOfValue('week').endOfValue('day');\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport { CateringOrder } from '../catering';\nimport { User } from '../users';\nimport {\n flatten,\n HashMap,\n humaniseDuration,\n shorterBuildingDateFormatString,\n shorterLocalDateFormatString,\n toTitleCase,\n unique\n} from '@mckinsey-converge/base';\nimport { Space } from '../spaces/space.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport {\n BookingNote,\n} from './booking.types';\nimport { convertLocalTimestampToTimezonedDateTz, DateNow, DateTZ, getTimezoneOffsetString } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, getLastDateFromList, handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { findSpace } from '../spaces';\nimport { DateTime } from 'luxon';\n\n\nexport interface IBookingQueryOptions {\n /** booking ID */\n id?: string;\n email?: string;\n target?: string;\n from?: number; // R--- depreciate\n until?: number; // R--- depreciate\n fromTz?: DateTZ;\n untilTz?: DateTZ;\n show_cancelled?: boolean;\n pagination?: boolean;\n limit?: number;\n offset?: number;\n sort?: string,\n filters?: any;\n include_rooms?: boolean;\n building_zone?: string;\n}\n\nexport class Booking extends BaseDataClass {\n /** Unique calendar event ID */\n // public readonly icaluid: string;\n /** Subject or title of the booking */\n public title: string;\n /** Luxon based date class of the booking start time */\n public startDateTz: DateTZ;\n /** Luxon based date class of the booking start time */\n public endDateTz: DateTZ;\n /** Description or details of the booking */\n public readonly body: string;\n /** Type of booking */\n public readonly booking_type: string;\n /** List of catering orders for the booking */\n public catering: readonly CateringOrder[];\n /** Whether booking's duration covers all day */\n public readonly all_day: boolean;\n /** Mapping of emails to approval statuses */\n public approval_status: HashMap;\n /**\n * New booking approval status set in constructor\n *\n * timeBasedStatusLabel is a getter calculated via current time, some parts of the application\n * may use status when it should use timeBasedStatusLabel\n */\n public status: 'tentative' | 'accepted' | 'approved' | 'declined' | 'cancelled' | 'expired' | 'unavailable';\n /** Host/Organiser of the booking */\n public organiser: User;\n /** List of people invited to attend the booking */\n public attendees: User[];\n /** Author of the booking */\n public readonly creator: User;\n\n /** List of notes associated with the booking */\n public notes: readonly BookingNote[];\n /** Mapping of spaces to equipment charge codes */\n public equipment_codes: HashMap;\n /** Mapping of spaces to expected number of attendees */\n public expected_attendees: HashMap;\n /** Map of space emails to the setup time before the meeting in minutes */\n public setup: HashMap;\n /** List of checked in attendees */\n public check_ins: object;\n /** Map of space emails to the breakdown time before the meeting in minutes */\n public breakdown: HashMap;\n /** List of fields edited since creation */\n public readonly edits: string[];\n /** List of users to be notified on visitor arrivals */\n public readonly notify_users: readonly string[];\n /** Whether the time or duration has changed */\n public time_changed = false;\n /**\n * Booking Space\n * Bookings only have one room on MCK\n */\n public room: Space;\n /** building_zone */\n public building_zone: string;\n /** Initialized Timezone */\n public timezone: string;\n /** Array of company names */\n public company?: string[];\n /** Flag for multiroom booking */\n public is_multiroom: boolean;\n /** Multiroom booking ID */\n public multiroom_master_id: string; \n /** Merged - field holds flag for merged-multiroom booking which tightly coupled with multiroom booking only */\n public merged: boolean;\n /** Type of recurrence, Shows whether this is a master or an occurence in the series. */\n public readonly recurrence_type: string;\n /** The frequency of the recurring booking. */\n public readonly recurrence_period: RecurrencePeriod;\n /** The interval time between each period. Defaults to 1. For example, with a period of \"weekly\" and an interval of 2, the recurrencd happen every 2 weeks. */\n public readonly recurrence_interval: number;\n /** Unix epoch in seconds of the recurrence end date */\n private _recurrence_endTz: DateTZ;\n /** The number of times to repeat the recurring booking. */\n public readonly recurrence_count: number;\n /** ID of the booking considered the master */\n public readonly recurrence_master_id: string;\n /** An array of booking IDs which belong to this recurring series. This INCLUDES the master booking ID. */\n public readonly occurrence_ids: string[];\n /** A list of INDIVIDUAL edits to any of the bookings in the series. This is so we can prompt the user if they are going to override previously updated bookings with a whole-series update. */\n public readonly occurrence_edits: string[];\n /** A list of Ocurrences */\n public readonly occurrence_details: { id: string, start_epoch: number }[];\n /** When the booking was created */\n public created_epoch: number;\n /** Is the Application concierge */\n public is_concierge: boolean;\n /**helper to know if recurring toggle is on */\n public is_recurrent: boolean;\n /**array of start dates of each ocurrence in the series */\n public recurrence_starts: Array\n /**array of conflicting dates not to be included in the recurrence series */\n public recurrence_exceptions: Array\n\n public recurrence_days?: Array\n\n /** Master recurrence start */\n public recurrence_start: number;\n\n /** Start Epoch */\n public start_epoch: number;\n public end_epoch: number;\n public level_zone: string;\n public opt_out: boolean;\n public outlook_opt_out: boolean;\n public multi_rooms: Space[];\n public room_setup: any;\n public room_breakdown: any;\n public headcount: number;\n public equipment_code: string;\n\n /** Currently back-end is not properly setting the recurrence_end property, this is a workaround */\n public get recurrence_endTz(): DateTZ {\n return this._recurrence_endTz;\n }\n\n public set recurrence_endTz(date: DateTZ) {\n this._recurrence_endTz = date;\n }\n\n /** Mark a booking for deleting */\n public attempted_to_delete?: 'series' | 'booking' | null;\n\n // No specific reason to set readonly but canm be change if needed to update in future\n public readonly booked_by : string | { name: string };\n public readonly booker: Object;\n public readonly booker_concierge: Object\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = settingsService.concierge;\n\n /**\n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = new DateTZ();\n\n const defaultTitle = ''; // Blank since the create booking form will init with test values.\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n const defaultBuildingZone = null // R --- no idea, should be a building.id but which and how\n const defaultOrgainiser = User.active_user || new User(); // meh, non American use.\n const defaultBookingType = 'internal';\n\n /**\n * Process the simple raw_data with defaults mixed in\n */\n this.title = raw_data.title || defaultTitle;\n this.timezone = raw_data.timezone || defaultLocalTimezone;\n // Used by components to get the building details\n this.building_zone = raw_data.building_zone || defaultBuildingZone;\n this.body = raw_data.body || '';\n // Provided booking type\n this.booking_type = raw_data.booking_type || defaultBookingType;\n // Attendees provided in API booking data\n this.attendees = (raw_data.attendees || []).map((i) => new User(i));\n // Provided organiser, active user, or empty user?\n this.organiser = raw_data.organiser ? new User(raw_data.organiser) : defaultOrgainiser;\n // Creator is provided or defaults to the organizer\n this.creator = (raw_data.booked_by ? new User(raw_data.booked_by) : defaultOrgainiser) || this.organiser;\n // Setup and breakdown times can conflict but not the true event start and end times\n this.setup = raw_data.setup || {};\n this.breakdown = raw_data.breakdown || {};\n this.room_setup = raw_data.room_setup;\n this.room_breakdown = raw_data.room_breakdown;\n // Notes are assigned by room but we only support a single room\n this.notes = raw_data.notes || [];\n this.equipment_codes = raw_data.equipment_codes || {};\n this.equipment_code = raw_data.equipment_code || '';\n this.expected_attendees = raw_data.expected_attendees || {};\n this.headcount = raw_data.headcount;\n this.check_ins = raw_data.check_ins || {};\n this.notify_users = raw_data.notify_users?.length ? raw_data.notify_users : [this.organiser?.name];\n this.company = raw_data.company || [];\n // retain booked by if there : helps to get correct creator above\n this.booked_by = raw_data.booked_by;\n this.booker = raw_data.booker;\n this.booker_concierge = raw_data.booker_concierge;\n this.level_zone = raw_data.level_zone;\n this.opt_out = raw_data.opt_out;\n this.outlook_opt_out = raw_data.outlook_opt_out;\n\n /**\n * \n */\n this.merged = raw_data?.merged || null;\n\n /**\n * Multiroom fields\n */\n this.is_multiroom = raw_data.is_multiroom || null;\n this.multiroom_master_id = raw_data.multiroom_master_id || null;\n\n /**\n * Setup Defaults when raw_data values are not provided\n *\n * all room_ids and space_list inputs can be refactored into just room like an API booking\n *\n * raw_data.room can be provides as the Space class or JSON object\n */\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n // this.room = raw_data?.room ? (Array.isArray(raw_data?.room) && raw_data.room.length > 0) ? raw_data?.room.map((element) => new Space(element))[0]: [new Space(raw_data.room)][0] : [new Space()][0];\n // this.room = raw_data.room ? new Space(raw_data.room) : new Space();\n\n if (raw_data && raw_data.room) {\n if (Array.isArray(raw_data.room) && raw_data.room.length) {\n this.room = raw_data.room.map((element) => new Space(element))[0];\n } else if (Array.isArray(raw_data.room) && raw_data.room.length === 0) {\n this.room = [new Space()][0];\n } else {\n this.room = [new Space(raw_data.room)][0];\n }\n } else {\n this.room = [new Space()][0];\n }\n\n\n const room_id = raw_data.room_id || raw_data.room_ids // Not sure why we have room_id and room_ids\n if (!this.room?.id && room_id?.length) {\n this.room = findSpace(room_id[0]) || this.room;\n }\n\n const roomsData = raw_data?.multi_rooms || raw_data?.room;\n this.multi_rooms = roomsData\n ? Array.isArray(roomsData)\n ? roomsData.map((element) => new Space(element))\n : [new Space(roomsData)]\n : [new Space()];\n\n \n const room_ids = [...(raw_data?.room_id || []), ...(raw_data?.room_ids || [])];\n\n room_ids.forEach(roomId => {\n const newRoom = findSpace(roomId);\n // Check if the room is found and not already included in this.room\n if (newRoom && !this.multi_rooms.some(room => room.id === newRoom.id)) {\n // Add the new room to this.room\n this.multi_rooms.push(newRoom);\n }\n });\n\n // this.room is sometimes getting set to undefined when raw_data?.room is coming as an object\n if(this.multi_rooms.length && this.room === undefined){\n this.room = this.multi_rooms[0];\n }\n \n /**\n * Setup the booking start and end time\n *\n *\n * Booking defaults to now if start is not defined.\n * Booking durration is now a getter\n */\n // now rounded to the next 5 minute increment\n const defaultStartTz = new DateTZ({ date: nowTz.ms, is_local_tz: false, building_tz: this.timezone }).setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n\n /**\n * When saving a booking the BaseDataClass doens't know to use the toAPIJson\n * so startDateTz isn't being convert to the epoch timestamp\n *\n * I'm not testing for the end time values because we can assume those follow the same pattern.\n */\n const startEpochProvided = !!(raw_data.start_epoch || raw_data.start);\n const startDateTzProvided = !!raw_data.startDateTz;\n\n /**\n * Not trying to be fancy here, just clear.\n */\n if (!startEpochProvided && startDateTzProvided) {\n /**\n * Once a booking is saved the BaseDataClass recreates the Booking\n * but doesn't use the toApiJSON method adapt the class input, mainly the\n * startDateTz isn't converted to the start_epoch timestamp.\n */\n this.startDateTz = raw_data.startDateTz;\n this.endDateTz = raw_data.endDateTz;\n } else if (startEpochProvided) {\n /**\n * A Booking created from the API responses arrives with the booking\n * start_epoch and end_epoch timestamps.\n */\n this.startDateTz = new DateTZ({\n date: ((raw_data.start_epoch || raw_data.start) * 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n this.endDateTz = new DateTZ({\n date: ((raw_data.end_epoch || raw_data.end)* 1000),\n is_local_tz: false,\n building_tz: this.timezone\n });\n } else {\n /**\n * And there are uses of new Booking where there are no inputs\n * and defaults are necessary.\n */\n this.startDateTz = defaultStartTz;\n this.endDateTz = defaultStartTz.addValue({ minutes: 60 });;\n }\n\n /**\n * End time was by design ending at one minute before, IE 4:00PM is 3:59PM,\n * because of calendar and conflcit checking\n *\n * Check and finesse it.\n * Not sure why but some booking endtime added extra seconds\n */\n if ((this.endDateTz.minutes % 5) !== 0 || this.endDateTz.second > 0) {\n // Not sure of the source but some bookings do not conform.\n this.endDateTz = this.endDateTz.setValue({ second: 0, minute: Math.round(this.endDateTz.minutes / 5) * 5 });\n }\n\n\n\n /**\n * Setup the booking created_date\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n this.created_epoch = raw_data.created_epoch || nowTz.seconds;\n\n\n /**\n * Setup the booking all_day boolean\n *\n * if it exists as a key, use the value directly.\n * if we initialize without a value, switch to checking duration.\n * Ref: MCK-826\n */\n if ('all_day' in raw_data) {\n this.all_day = raw_data.all_day;\n } else {\n this.all_day = !!raw_data.all_day || this.duration > 23 * 60;\n }\n\n\n // R--- TODO Concierge will use startDateTz so i'm not sure if this is needed.\n if (!this.is_concierge && this.all_day && this.timezone) {\n /**\n * Concierge has a all_day form field, I can see it may need this for that, does it really?\n */\n this.startDateTz = this.startDateTz.startOfValue('day')\n }\n\n /**\n * Setup the booking approval status\n */\n let status = raw_data.status;\n // If not provided default to approved.\n if (!raw_data.status) {\n status = 'accepted';\n }\n // \"show_as\" is a special rule to override how the applications display the status\n if (raw_data.show_as && raw_data.show_as === 'cancelled') {\n status = 'declined';\n }\n const approvalStatus = {};\n this.multi_rooms.forEach(room => {\n approvalStatus[room.email] = status;\n });\n // Tracking new \"status\" and legacy \"approval_status\" from raw_data.status.\n this.status = status;\n this.approval_status = raw_data.approval_status || {};\n\n /**\n * Catering setup\n *\n * Bring in and sort the catering order by delivery time\n */\n\n this.catering = (raw_data.catering instanceof Array ? raw_data.catering : []).map(\n (i) => new CateringOrder(i)\n );\n\n\n\n /**\n * Edited fields setup\n *\n * Bring in and sort the catering order by delivery time\n *\n * cateringOrders can return the order sorted\n */\n const edited_fields = Array.isArray(raw_data.edits)\n ? raw_data.edits\n : unique(\n flatten(\n Object.keys(raw_data.edits || {}).map((room) => {\n return flatten(Object.values(raw_data.edits[room]));\n })\n )\n );\n this.edits = edited_fields;\n\n /**\n * New Recurring booking feilds\n *\n * New fields do not match the BookingRecurrenceDetails type\n * and are simpler to manage this way\n */\n this.recurrence_count = raw_data.recurrence_count || null;\n this.recurrence_days = raw_data.recurrence_days || null;\n this.occurrence_edits = raw_data.occurrence_edits || null;\n this.recurrence_endTz = raw_data.recurrence_end ? new DateTZ({date: raw_data.recurrence_end * 1000, is_local_tz: false, building_tz: this.timezone}) : null;\n this.recurrence_exceptions = raw_data.recurrence_exceptions || null;\n this.occurrence_ids = raw_data.occurrence_ids || null;\n this.recurrence_interval = raw_data.recurrence_interval || null;\n this.recurrence_period = raw_data.recurrence_period || null;\n this.recurrence_type = raw_data.recurrence_type || null;\n this.recurrence_master_id = raw_data.recurrence_master_id\n this.occurrence_details = raw_data.occurrence_details\n this.is_recurrent = raw_data.is_recurrent || (!!this.recurrence_type && !!this.recurrence_period) || null;\n this.recurrence_starts = raw_data.recurrence_starts || []\n this.start_epoch = raw_data.start_epoch\n this.end_epoch = raw_data.end_epoch\n\n /**\n * I'm not clear why, but the booking body, aka description is copied into the notes.\n * R--- In concerge data description is only a key when saving, also in the note array?\n */\n if (raw_data.body && !this.notes.find((i) => i.type === 'description')) {\n this.notes = [\n ...this.notes,\n {\n type: 'description',\n date: 0,\n message: raw_data.body,\n author: this.organiser.email\n }\n ];\n }\n\n /**\n * In case there is a cancellation in progress the property attempted_to_delete is set to false\n * And it is persisted until the booking is gone\n */\n this.attempted_to_delete = raw_data.attempted_to_delete || null;\n }\n\n\n /** Service for managing Bookings */\n protected get _service() {\n return ServiceManager.serviceFor(Booking);\n }\n\n /** Alias to approval_status */\n public get auto_approve(): boolean {\n // if concierge we auto_approve always.\n if (this.is_concierge) {\n return true;\n }\n return !this.multi_rooms.some(room => room.byRequest({\n dateTz: this.startDateTz,\n duration: this.duration,\n host: this.organiser\n }));\n }\n\n /** Whether booking has been approved */\n public get approved(): boolean {\n return !this.declined && !this.tentative;\n }\n\n /** All of the booking attendees including the organizer */\n public get allAttendees(): User[] {\n return unique([this.organiser].concat(this.attendees), 'email');\n }\n\n /** Computer format for booking type */\n public get bookingTypeId(): string {\n return this.booking_type.toLowerCase();\n }\n\n /** Human format for booking type */\n public get bookingTypeLabel(): string {\n return toTitleCase(this.booking_type);\n }\n\n /** Get accessor for the check in object, app expect array */\n public get checkInsArray(): string[] {\n return Object.keys(this.check_ins || {})\n }\n\n /** Legacy getter for \"class\" */ // R-- TODO remove\n public get class(): string {\n return this.booking_type;\n }\n\n /** */\n public get displayEndDateTz(): DateTZ {\n if ((this.endDateTz.minutes % 5) !== 0) {\n // All the bookings should end in 59 seconds\n return this.endDateTz.addValue({ seconds: 1 });\n }\n // but if not they return 00\n return this.endDateTz;\n }\n\n /** Whether booking has been declined */\n public get declined(): boolean {\n /**\n * I'm not sure, nor is Cam if this is ever used to decline\n * all booking for a specific room\n */\n const isAnyRoomDeclined = this.multi_rooms.some(room => room.name.toLowerCase().includes('decline'));\n if (isAnyRoomDeclined) {\n return true;\n }\n\n if (this.status.includes('decline')) {\n return true;\n }\n\n return false;\n }\n\n /** Description of the booking purpose */\n public get description(): string {\n const note = (this.notes || []).find((i) => i.type === 'description');\n return note ? note.message : '';\n }\n\n /** Catering getter */\n public get cateringOrders() {\n // Return the catering orders sorted by delivery time\n return this.catering ? this.catering.slice().sort((a, b) => {\n if (a?.delivery_time > b?.delivery_time) return 1;\n if (b?.delivery_time > a?.delivery_time) return -1;\n\n return 0;\n }) : [];\n }\n\n /** Get the created date as DateTz */\n public get creationDateTz() {\n return new DateTZ({ date: this.created_epoch * 1000, is_local_tz: false, building_tz: this.timezone })\n }\n\n public get tz_offset() {\n return getTimezoneOffsetString(this.timezone);\n }\n\n /** Display value for the date */\n public get date_string(): string {\n return this.startDateTz.formatDate('dd MMM yyyy');\n }\n\n /**\n * Get the booking durration based on start and end times\n */\n public get duration(): number {\n return Math.abs(this.startDateTz.startOfValue('minute').dateDiff(this.displayEndDateTz, 'minutes'));\n }\n\n /** Unix timestamp of the booking start */\n public get date() { // R--- remove if not necessary\n return this.startDateTz.ms;\n }\n\n /** Whether booking contains external visitors in the attendee list */\n public get has_visitors(): boolean {\n return this.attendees.reduce((a, v) => a || v.external, false);\n }\n\n /** Does the booking have catering orders */\n public get has_catering(): boolean {\n return !!this.catering.length;\n }\n\n /**\n * Unique calendar event ID\n * same as this.id, used to support existing component usage\n */\n public get icaluid(): string {\n return this.id;\n }\n\n /**\n * Get the booking room id\n */\n public get room_id(): string {\n return this.room.id;\n }\n\n /** Legacy getter of room, aka space */\n public get space(): Space {\n return this.room;\n }\n\n /** Status of the booking */\n public get timeBasedStatusLabel(): 'future' | 'upcoming' | 'done' | 'started' | 'in_progress' | 'expired_yesterday' {\n const buildingTzDt = DateNow(new Date()).toZone(this.timezone) ; // building time\n\n if (DateNow(new Date()).isBeforeDate(this.startDateTz.subtractValue({ minutes: 15 }))) {\n return 'future';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz)) {\n return 'upcoming';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: 15 }))) {\n return 'started';\n } else if (DateNow(new Date()).isBeforeDate(this.startDateTz.addValue({ minutes: this.duration }))) {\n return 'in_progress';\n }\n // if current time is 12 AM (as per timezone) and booking expired yesterday\n else if(buildingTzDt.startOfValue('day').addValue({ minutes: 1 }).isAfterDate(this.startDateTz, 'day') ) {\n return 'expired_yesterday'\n }\n\n return 'done';\n }\n\n /** Whether booking is tentative */\n public get tentative(): boolean {\n if (\n this.status &&\n this.status.indexOf('tentative') >= 0\n ) {\n return true;\n }\n\n return false;\n }\n\n /** Display valuie for the start and end times of the booking */\n public get time_period(): string {\n return `${this.startDateTz.formatDate('h:mma')} - ${this.displayEndDateTz.formatDate('h:mma')}`;\n }\n\n /** Display value for the start time of the booking */\n public get start_time(): string {\n return this.startDateTz.formatDate('h:mma');\n }\n\n /** Display value for the end time of the booking */\n public get end_time(): string {\n return this.endDateTz.formatDate('h:mma');\n }\n\n /** Display value for the duration of the booking */\n public get length_string(): string {\n return humaniseDuration(this.duration);\n }\n\n /** Display value for the location of the booking */\n // public get local_room_name(): string {\n // return this.room?.local_name || 'No location';\n // }\n public get local_room_name(): string {\n if (this.multi_rooms.length === 0) {\n return 'No location';\n } else {\n return this.multi_rooms.map(room => room.local_name).join(', ');\n }\n } \n\n /** Display value for the level of the first space in the booking */\n public get level(): string {\n return this.space.level.name;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Booking {\n return new Booking(this.toJSON());\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(isEdit = false): Booking {\n return new Booking({\n ...this.toJSON(),\n id: isEdit ? this.id : null,\n });\n }\n\n /**\n *\n * @param status\n * @returns void\n */\n public undo(status?: 'accept' | 'decline', opts: { series?: boolean } = {}): Promise {\n return this._service.undo(\n this.id, status || 'accept',\n opts\n );\n }\n\n /**\n * Delete booking from the server\n */\n public delete(opts: { series?: boolean } = {}): Promise {\n if (this.id) {\n return this._service.delete(this.id, { ...opts });\n\n // R-- ask Cam again is he's positive these extra params are not needed for anything\n // return this._service.delete(this.id, {\n // concierge: this.is_concierge,\n // host: this.organiser.email,\n // room_id: this.space?.id,\n // icaluid: this.icaluid,\n // start: json.start,\n // end: json.end\n // });\n }\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Booking): HashMap {\n let data = super.toJSON();\n // Remove the description from the notes\n data.notes = Array.isArray(data.notes) ? data.notes.filter((note) => note.type !== 'description') : data.notes;\n // Encode the nested objects\n data.room = data.room.toJSON();\n\n\n\n data.organiser = data.organiser.toJSON();\n data.creator = data.creator?.toJSON ? data.creator.toJSON(): data.creator;\n // Map the attendees User objects\n data.attendees = data.attendees.map((i: User) => i.toJSON());\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n return data;\n }\n\n /**\n * Convert object into plain object\n */\n public toApiJSON(this: Booking): HashMap {\n let data = super.toJSON();\n\n // Update booking payload contains additional fields\n data.icaluid = \"\";\n if (data.id) {\n data.icaluid = data.id;\n data.location_name = this.multi_rooms.map((item)=>{return item.local_name}).join(', ');\n data.from_room = this.multi_rooms.map((item)=>{return item.email}).join(', ');\n data.building_zone = this.room?.building?.id;\n }\n\n /**\n * These fields are rather in flux\n * According to Cam \"approve\" will be the prefered field\n * and auto_approve and approval_status can be removed.\n */\n data.approve = this.auto_approve; // this value appear incorrect on update\n data.auto_approve = [this.auto_approve]; // Needed to update approval status until BE accepts \"approve\"\n // delete data.approval_status;\n\n // Booking start and end data\n delete data.startDateTz;\n delete data.endDateTz;\n data.start = this.startDateTz.seconds;\n data.end = this.endDateTz.seconds;\n data.old_start = this.startDateTz.seconds; // remove is not necessary\n data.old_end = this.endDateTz.seconds; // remove is not necessary\n\n // Creation date value\n delete data.created_epoch;\n data.creation_date = this.creationDateTz.seconds;\n\n // Catering fields\n // data.catering = data.catering.toJSON();\n data.catering = this.cateringOrders;\n data.has_catering = this.has_catering;\n delete data.cateringOrders\n\n // Attendees appear quite incomplete\n // Map the attendees User objects\n data.attendees = this.allAttendees.map((i: User) => i.toJSON ? i.toJSON() : i);\n\n // Orgainizer and Creator data\n data.organiser = data.organiser.toJSON ? data.organiser.toJSON() : data.organiser;\n data.creator = data.creator.toJSON ? data.creator.toJSON() : data.creator;\n\n // Convert check_ins to checked_in array\n delete data.check_ins;\n data.checked_in = this.checkInsArray;\n\n // edits - edit booking is showing all fields even w/o an edit :(\n\n // Room data\n data.room_ids = this.multi_rooms.map((item)=>{return item.email});\n delete data.room;\n\n // New recurring booking\n data = handleRecurrenceFields(data)\n\n\n if(data.recurrence_list){\n data.recurrence_starts = [...data.recurrence_list]\n delete data.recurrence_list\n }\n\n // Not found in dev data\n delete data.name;\n delete data.email;\n delete data.is_concierge;\n // delete data.building_zone;\n // delete data.status;\n\n return data;\n }\n\n public getType(): string {\n if (!this || this.status?.includes('decline')) {\n return 'cancelled';\n }\n const booking_type = this.booking_type;\n if (booking_type === 'internal' && this.has_visitors) {\n return 'external';\n }\n return booking_type;\n }\n\n /** fallback for a booking when the recurrence_end is null but it's a series booking */\n public recurrenEndFromOcurrences(occurrence_details: { id: string, start_epoch: number }[]): DateTZ {\n const date = occurrence_details?.map(occurence => occurence)\n .sort((a, b) => new Date(a.start_epoch * 1000).getTime() - new Date(b.start_epoch * 1000).getTime())\n .reverse()\n .shift()\n .start_epoch * 1000\n return new DateTZ({date, is_local_tz: false, building_tz: this.timezone});\n }\n\n public get dateString() {\n return shorterLocalDateFormatString(this.startDateTz);\n }\n public get dateBuildingString() {\n return shorterBuildingDateFormatString(this.startDateTz);\n }\n\n public get endDateString(): string {\n return shorterLocalDateFormatString(this.recurrenEndFromOcurrences(this.occurrence_details));\n }\n}\n\n/**\n * Merge catering orders with same time and location\n * @param order_list List of catering orders\n */\nexport function mergeCateringOrders(order_list: CateringOrder[]) {\n // R--- investigate when this is used. Staff doesn't use it when adding catering orders.\n for (let i = 0; i < order_list.length; i++) {\n const orders = order_list.filter(\n (order) =>\n order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time\n );\n if (orders.length > 1) {\n const new_list = order_list.filter(\n (order) =>\n !(order.location_id === order_list[i].location_id &&\n order.delivery_time === order_list[i].delivery_time)\n );\n new_list.push(new CateringOrder({\n ...order_list[i],\n items: flatten(orders.map(order => order.items)),\n booking_date: this.startDateTz.ms,\n booking_timezone: this.booking_timezone,\n }));\n order_list = new_list;\n i = 0;\n }\n }\n return order_list;\n}\n","import { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport interface SpaceRules {\n auto_approve: boolean; // if false sapce is requestable else bookable\n hide: boolean;\n max_length?: number;\n min_length?: number;\n reason?: string // specially for non-bookable rooms\n}\n\nexport interface BookingNote {\n /** Type of note */\n type: 'equipment' | 'catering' | 'description' | 'private' | 'other' | 'catering-private';\n /** Name of the note's author */\n author: string;\n /** Contents of the note */\n message: string;\n /** Time the note was added to the booking */\n date: number;\n /** Display value for the time */\n time?: string;\n /** ID of the space associated with the note */\n space?: string;\n /** ID of the catering order associated with the note */\n order_id?: string;\n}\n\nexport interface DateDurationData {\n dateTz: DateTZ,\n duration: number,\n mobile: boolean,\n save?: boolean,\n}\n\nexport enum BOOKING_STATUS {\n approved = 'approved',\n declined = 'declined',\n tentative = 'tentative',\n unavailable = 'unavailable'\n}","import {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AvailableBookingFields } from '../settings.interfaces';\nimport {\n HashMap,\n humaniseDuration,\n mockDate as mockDateBase,\n resetDate as resetDateBase,\n timeFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { CateringOrder } from '../catering/catering-order.class';\nimport { ServiceManager } from '../service-manager.class';\nimport { User } from '../users/user.class';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport {\n BookingRule,\n SpaceStatus\n} from './space.types';\nimport { validateEndTime } from '../validation.utilities';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { BookingAction, RecurrencePeriod, SeriesAction } from '../recurrence/recurrence.utils';\nimport { Space } from '../spaces';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\nconst MINUTE = 1;\nconst HOUR = 60;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\nconst MONTH = 30 * DAY;\n\nconst DURATION_MAP: { [duration: string]: number } = {\n month: MONTH,\n months: MONTH,\n week: WEEK,\n weeks: WEEK,\n day: DAY,\n days: DAY,\n hour: HOUR,\n hours: HOUR,\n minute: MINUTE,\n minutes: MINUTE\n};\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const mockDate = mockDateBase;\n\n/**\n * Deprecated. Use @mckinsey-converge/base's import.\n */\nexport const resetDate = resetDateBase;\n\nexport interface IBookingSlot {\n start: number;\n end: number;\n}\n\n\nexport function bookingOptionsToQuery(options: IBookingQueryOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n delete query.type;\n if (options.filters) {\n delete query.filters;\n for (const property in options.filters) {\n if (!query[property]) {\n query[property] = options.filters[property]\n }\n }\n }\n\n // id?: string;\n // cancelled?: boolean;\n if (options.until) {\n query.to = options.until;\n delete query.until;\n }\n \n }\n return query;\n}\n\n\n/**\n * Generate a list of free time slots between the given bookings\n * @param list List of bookings to find slots between\n * @param min_size Minimum length of a free slot in minutes\n */\nexport function getFreeBookingSlots(list: Booking[]=[], min_size: number = 30, dateTzMs: number = DateNow(new Date()).ms,): IBookingSlot[] {\n /* istanbul ignore else */\n if (!list.length) {\n return [\n {\n start: 0,\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n }\n ];\n }\n const slots: IBookingSlot[] = [];\n let start = new DateTZ({ date: dateTzMs });\n list.sort((a, b) => a.date - b.date);\n for (const booking of list) {\n const bkn_start = booking.startDateTz;\n const bkn_end = booking.endDateTz;\n if (bkn_start.isAfterDate(start)) {\n const diff = Math.abs(bkn_start.dateDiff(start, 'minutes'));\n /* istanbul ignore else */\n if (diff >= min_size) {\n slots.push({ start: start.ms, end: bkn_start.ms });\n }\n start = bkn_end;\n } else if (start.startOfValue('minute').ms === bkn_start.startOfValue('minute').ms) {\n start = bkn_end;\n }\n }\n slots.push({\n start: start.ms,\n // R--- these X 10's make no sense. why not + 2 years?\n end: DateNow(new Date()).startOfValue('minute').ms * 10\n });\n\n return slots;\n}\n\n/**\n * Get the next free time slot from the given bookings\n * @param list List of bookings to find the next slot\n * @param date Date to find next slot after in ms since UTC epoch\n * @param min_size Minimum length of the free slot in minutes\n * \n * R--- Possibly depreciate, I don't see it used anywhere except for its own test\n */\nexport function getNextFreeBookingSlot(\n list: Booking[],\n date: number = DateNow(new Date()).ms,\n min_size: number = 15\n): IBookingSlot {\n const slots = getFreeBookingSlots(list, min_size, date);\n const date_ = new DateTZ({date})\n const time = date_.startOfValue('minute').setValue({ second: 1 });\n for (const block of slots) {\n const start = new DateTZ({date: block.start});\n const end = new DateTZ({date: block.end});\n if (start.startOfValue('minute').isAfterDate(time)) {\n return block;\n } else if (time.isBeforeDate(end.startOfValue('minute'))) {\n const duration = end.startOfValue('minute').dateDiff(time, 'minutes');\n /* istanbul ignore else */\n if (duration >= min_size) {\n return block;\n }\n }\n }\n return slots[slots.length - 1];\n}\n\n/**\n * Generate form fields for the given booking\n * @param booking Booking to generate form for\n * @param current_user Current user of the system to default as the host\n */\nexport function generateBookingForm(\n booking: Booking,\n use_fields: AvailableBookingFields[],\n isConcierge: boolean = false,\n manualTimezone?: string,\n action?: SeriesAction | BookingAction | null\n ): FormGroup {\n if (!booking) {\n throw Error('No booking passed');\n }\n\n const user_service = ServiceManager.serviceFor(User);\n const current_user =\n user_service.current ||\n new User({ id: 'local-user', name: 'Local User', email: 'local@place.tech' });\n\n const fields: HashMap = {\n id: new FormControl(booking.id || ''),\n space_list: new FormControl( booking.is_multiroom? booking.multi_rooms : [booking.room], []),\n room: new FormControl(booking.room, {}),\n dateTz: new FormControl({ value: booking.startDateTz || DateNow(), disabled: false }, [Validators.required]),\n duration: new FormControl({ value: booking.duration, disabled: false }),\n organiser: new FormControl(booking.organiser || current_user, [Validators.required]),\n attendees: new FormControl(booking.attendees, []),\n title: new FormControl(booking.title || '', { validators: [ Validators.required, Validators.minLength(1) ], updateOn: 'blur' }), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n booking_type: new FormControl(booking.booking_type),\n body: new FormControl(booking.body),\n notes: new FormControl(booking.notes),\n equipment_codes: new FormControl(booking.equipment_codes),\n expected_attendees: new FormControl(booking.expected_attendees),\n company: new FormControl(booking.company),\n is_multiroom: new FormControl(booking.is_multiroom),\n merged: new FormControl({value: booking?.merged, disabled: true}),\n catering: new FormControl(\n booking.cateringOrders.map(\n (order) => new CateringOrder({\n ...order,\n booking_date: booking.startDateTz.ms,\n booking_timezone: booking.timezone,\n })\n )\n ),\n all_day: new FormControl(!!booking.all_day),\n has_catering: new FormControl(!!booking.has_catering),\n needs_space: new FormControl(true),\n action: new FormControl(''),\n timezone: new FormControl(manualTimezone || \"\"),\n is_before_date: new FormControl(false)\n };\n if (!isConcierge) {\n fields.duration.setValidators([Validators.required, validateEndTime(fields.dateTz)]);\n }\n /* istanbul ignore else */\n if (booking.id && booking.id !== 'ad-hoc') {\n fields.organiser.disable();\n /* istanbul ignore else */\n if (booking.endDateTz.ms < DateNow(new Date()).ms) {\n fields.dateTz.disable();\n }\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n fields.dateTz.setValidators(dateValidators);\n fields.dateTz.updateValueAndValidity();\n }\n let list_length = -1;\n fields.space_list.valueChanges.subscribe((list) => {\n const expected = fields.expected_attendees.value || {};\n const matches = Object.keys(expected).filter((key) =>\n list?.find((space) => space.email === key)\n ).length;\n if (list && list.length && matches === 0) {\n const codes = fields.equipment_codes.value || {};\n if (Object.keys(expected).length >= 0 || Object.keys(codes).length >= 0) {\n const key = Object.keys(expected)[0] || Object.keys(codes)[0];\n const new_expected = {};\n const new_codes = {};\n const notes = fields.notes.value;\n notes.forEach((note) => (note.space === key ? (note.space = list[0].email) : ''));\n new_expected[list[0].email] = expected[key];\n new_codes[list[0].email] = codes[key];\n fields.expected_attendees.setValue(new_expected);\n fields.equipment_codes.setValue(new_codes);\n }\n }\n list_length = list?.length;\n });\n fields.dateTz.valueChanges.subscribe((_) => {\n fields.duration.updateValueAndValidity();\n });\n fields.needs_space.valueChanges.subscribe((space_needed) => {\n if (!space_needed) {\n fields.space_list.setValue([]);\n }\n });\n fields.has_catering.valueChanges.subscribe((has_catering) => {\n if (!has_catering) {\n fields.catering.setValue([]);\n }\n });\n const simplified_fields: HashMap = [\n 'id',\n 'space_list',\n 'space_ids',\n 'notes',\n 'dateTz',\n 'booking_type',\n 'equipment_codes',\n 'expected_attendees',\n 'timezone',\n 'is_before_date',\n ...use_fields\n ].reduce((map, key) => {\n /* istanbul ignore else */\n if (fields[key]) {\n map[key] = fields[key];\n }\n return map;\n }, {});\n \n if (simplified_fields.all_day) {\n const handleAllDay = (value) => {\n if (value) {\n let startOfDay = simplified_fields.dateTz.value.clone();\n // When the booking space isn't set we still need a way to determine midnight\n // and here we use the current concierge building selection's timezone.\n if (manualTimezone) {\n startOfDay = startOfDay.toZone(manualTimezone);\n }\n\n simplified_fields.dateTz.setValidators([Validators.required]);\n simplified_fields.dateTz.setValue(simplified_fields.all_day.value\n ? startOfDay.startOfValue('day')\n : simplified_fields.dateTz.value);\n simplified_fields.duration.setValue(simplified_fields.all_day.value\n ? 24 * 60\n : simplified_fields.duration.value);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.disable();\n // simplified_fields.dateTz.disable();\n } else {\n const dateValidators = [Validators.required];\n if (!isConcierge) {\n dateValidators.push(isFuture);\n }\n dateValidators.push(validDateTZ)\n simplified_fields.dateTz.setValidators(dateValidators);\n simplified_fields.duration.setValue(booking.duration || 30);\n simplified_fields.dateTz.updateValueAndValidity();\n simplified_fields.duration.enable();\n simplified_fields.dateTz.enable();\n }\n };\n simplified_fields.all_day.valueChanges.subscribe(handleAllDay);\n handleAllDay(simplified_fields.all_day.value);\n }\n\n const occurrences = booking.occurrence_details || [];\n\n //Add recurrence fields\n if(action && booking.recurrence_period === RecurrencePeriod.LIST){\n booking.recurrence_starts = occurrences\n .filter(occurrence => occurrence.id !== booking.recurrence_master_id)\n .map((occurrence) => new DateTZ({date: occurrence.start_epoch * 1000, is_local_tz: false, building_tz: booking.timezone})\n ) \n }\n /**If series exists then set the start and end dates from the first and last bookings in the occurrences array\n * this prevents prefilled form errors due to individual edits\n */\n if(action && action !== SeriesAction.CLONE && action !== BookingAction.CLONE && occurrences && occurrences.length && !booking.id){\n const start_dateTz = new DateTZ({\n date: occurrences.sort((d1, d2) => d1.start_epoch - d2.start_epoch)[0].start_epoch * 1000, \n is_local_tz: false, building_tz: booking.timezone\n })\n simplified_fields.dateTz.setValue(start_dateTz)\n const end = occurrences.sort((d1, d2) => d2.start_epoch - d1.start_epoch)[0].start_epoch * 1000\n booking.recurrence_endTz = new DateTZ({date: end, is_local_tz: false, building_tz: booking.timezone}) \n }\n\n // R-- needs TZ aware fields\n const _recurr_end = simplified_fields.dateTz?.value || new DateTZ({ date: 1 }); // new DateTZ({date: simplified_fields.date?.value}) \n const fields_with_recurrence = {\n ...simplified_fields,\n recurrence_period: new FormControl(booking.recurrence_period || RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl(booking.recurrence_interval || 1),\n recurrence_endTz: new FormControl(booking.recurrence_endTz || _recurr_end.addValue({days: 1})),\n recurrence_count: new FormControl(booking.recurrence_count || 0),\n is_recurrent: new FormControl(booking.is_recurrent),\n recurrence_starts: new FormControl(booking.recurrence_starts || []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl(booking.recurrence_days || [])\n }\n\n if(booking.is_recurrent && action !== BookingAction.CLONE){\n fields_with_recurrence.recurrence_starts.setValidators([arrayWithValues])\n fields_with_recurrence.recurrence_starts.updateValueAndValidity()\n fields_with_recurrence.recurrence_endTz.setValidators([Validators.required, validDateTZ]);\n }\n // Generate form group for booking item\n const form = new FormGroup(fields_with_recurrence);\n return form;\n}\n\n/**\n * Validate whether date is in the future\n * @param control Control to check value\n */\nexport function isFuture(control: AbstractControl) {\n const dateTz = control.value; // new DateTZ({date: control.value});\n return dateTz.isBeforeDate(DateNow(new Date()).subtractValue({ minutes: 5 }))\n ? { dateTz: 'Date needs to be in the future' }\n : null;\n}\n\n/**\n * Validate whether an array has values\n * @param control Control to check value\n */\nexport function arrayWithValues (control: AbstractControl) {\n return control.value.length !== 0 ? null : { field: 'Needs at least one value'}\n}\n\n/**\n * Validate whether a date has a valid value (future or current date)\n * @param control Control to check value\n */\n export function validDate (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = new DateTZ({date: control.value})\n const now = DateNow(new Date())\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Validate whether a date has a valid DateTZ value (future or current date)\n * @param control Control to check value\n */\n export function validDateTZ (control: AbstractControl) {\n if(!control.value){\n return { date: 'Needs a valid date'}\n }\n const date = DateNow(control.value.JSDate);\n const now = DateNow(new Date());\n const isValid = now.isBeforeDate(date, 'day') || now.isSameDate(date, 'day')\n return isValid ? null : { date: 'Needs a valid date'}\n}\n\n/**\n * Get minimum duration from ruleset in minutes\n * Default to 5min\n */\nexport function getMinLength(rule_list: HashMap): number {\n return Object.values(rule_list).reduce((min, block) => {\n const min_block = block.reduce((min_length, el) => {\n if (el.conditions.min_length && stringToMinutes(el.conditions.min_length) > min) {\n return stringToMinutes(el.conditions.min_length);\n } else {\n return min_length;\n }\n }, 5);\n if (min_block > min) {\n return min_block;\n } else {\n return min;\n }\n }, 5) as number;\n}\n\n/**\n * Whether the first input is greater than the last. Converts duration strings into minutes\n * @param duration_1 First input can be a number in minutes or a duration string e.g. `1 hour`\n * @param duration_2 Second input can be a number in minutes or a duration string e.g. `30 minutes`\n */\nexport function durationGreaterThanOrEqual(\n duration_1: string | number,\n duration_2: string | number\n) {\n const first: number = typeof duration_1 === 'string' ? stringToMinutes(duration_1) : duration_1;\n const second: number =\n typeof duration_2 === 'string' ? stringToMinutes(duration_2) : duration_2;\n return first >= second;\n}\n\n/**\n * Conver time string into minutes\n * @param str timestring e.g. `'1 day'`, `'15 minutes'`, `'2 weeks'`\n */\nexport function stringToMinutes(str: string): number {\n const parts = str.split(' ');\n return +parts[0] * DURATION_MAP[parts[1]];\n}\n\n/**\n * Get current status within bookings\n * @param bookings List of bookings\n * @param host Host of the new event\n * @param date Datetime of the new event\n */\nexport function statusFromBookings(\n bookings: Booking[] = [],\n bookable: boolean = true,\n requestable: boolean = false,\n dateTz: DateTZ = DateNow(),\n space?: Space\n) {\n const free_slots = getFreeBookingSlots(bookings.filter((bkn) => !bkn.declined));\n const now = DateNow() // new DateTZ({date}); // now should be now\n // commeted bellow piece as correct way to get next free booking slot is at line- 488\n // const next_free_slot = free_slots.find((slot) => {\n // return slot && (slot.start > now.ms || now.ms > slot.start - slot.start % 1000 || now.ms < slot.end - slot.end % 60 * 1000);\n // // const start = new DateTZ({date: slot?.start || 0 });\n // // const end = new DateTZ({date: slot?.end || 0}); // slot end isn't late enough? or after now/\n // // return start.isAfterDate(now) || (now.isAfterDate(start.startOfValue('second')) && now.isBeforeDate(end.startOfValue('minute')))\n // });\n\n const next_free_slot = getNextFreeBookingSlot(bookings.filter((bkn) => !bkn.declined), dateTz.ms);\n \n const start = new DateTZ({date: next_free_slot?.start || 0});\n const end = new DateTZ({date: next_free_slot?.end || 0});\n const currently_free = dateTz.isAfterDate(start.startOfValue('second')) && dateTz.isBeforeDate(end.startOfValue('minute'));\n const time_until_next_block = humaniseDuration(\n currently_free ? end.dateDiff(dateTz, 'minutes') : start.dateDiff(dateTz, 'minutes'),\n 'short'\n );\n\n const free_tomorrow = !currently_free && !start.isSameDate(dateTz, 'day');\n const free_today = currently_free && !end.isSameDate(dateTz, 'day');\n \n return {\n status: (!bookable\n ? SpaceStatus.NotBookable\n : currently_free\n ? requestable\n ? SpaceStatus.Requestable\n : SpaceStatus.Available\n : SpaceStatus.InProgress) as SpaceStatus,\n available_until: free_today\n ? 'No meetings today'\n : currently_free\n ? `Free until ${end.formatDate(timeFormatString())}(${time_until_next_block})`\n : free_tomorrow\n ? 'Unavailable today'\n : `Free at ${start.formatDate(timeFormatString())}(${time_until_next_block})`\n };\n}\n\n/**\n * V1 version display.\n */\nexport const spaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'Unavailable';\n case SpaceStatus.InProgress:\n return 'Meeting in Progress';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nexport function replaceBookings(\n list: Booking[],\n new_bookings: Booking[],\n filter_options: { room_email: string; fromTz: DateTZ; toTz: DateTZ }\n) {\n const filtered_list = list.filter((booking) => {\n return (\n !(booking.multi_rooms.some(room => room?.email === filter_options.room_email)) ||\n !timePeriodsIntersect(filter_options.fromTz.ms, filter_options.toTz.ms, booking.startDateTz.ms, booking.endDateTz.ms)\n );\n });\n const updated_list = filtered_list.concat(new_bookings);\n updated_list.sort((a, b) => a.date - b.date);\n return unique(updated_list, 'icaluid');\n}\n\nexport function timePeriodsIntersect(\n start1: number,\n end1: number,\n start2: number,\n end2: number,\n type = ''\n) {\n return (\n (start1 >= start2 && start1 < end2) ||\n (end1 > start2 && end1 <= end2) ||\n (start2 >= start1 && start2 < end1) ||\n (end2 > start1 && end2 <= end1)\n );\n}\n\nexport function formatWhen({\n all_day,\n startTZ,\n endTZ,\n displayEndTZ\n}): string {\n if (all_day) {\n return `${startTZ.formatDate('dd MMM yyyy')} - All Day`;\n } else {\n if (startTZ.isSameDate(endTZ, 'day')) {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('h:mma')}`;\n } else {\n return `${startTZ.formatDate('dd MMM yyyy, h:mma')} - ${displayEndTZ.formatDate('dd MMM yyyy, h:mma')}`;\n }\n }\n}\n\nexport const isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\nexport function searchRoomsAndBookings(allItems: (Space | Booking)[], searchValue: string, isConcierge:boolean = false) {\n\n let relevantItems: (Space | Booking)[] = [];\n\n if(isConcierge) {\n relevantItems = allItems.filter( (item: any ) => \n isIncludes(item, 'title', searchValue) ||\n isIncludes(item.creator, 'name', searchValue) ||\n isIncludes(item.organiser, 'name', searchValue) ||\n isIncludes(item, 'simple_name', searchValue) || // search with room name \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n } else {\n relevantItems = allItems.filter( (item: any ) => \n this.isIncludes(item.creator, 'name', searchValue) ||\n this.isIncludes(item.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'simple_name', searchValue) \n );\n }\n\n const filteredItems = this.duplicateMultiroomEntriesIfAny(relevantItems);\n \n return filteredItems;\n} \n\nexport function duplicateMultiroomEntriesIfAny(bookings) {\n // Initialize an array to hold the original and duplicated entries \n const updatedBookings = [...bookings];\n\n // Loop through the original bookings array \n [...bookings].forEach(booking => {\n if(booking?.is_multiroom) {\n // calculate the number of times to duplicates the booking\n const duplicatesCount = booking.multi_rooms.filter(el => el.id !== booking.space.id);\n\n // Create the duplicate and add them to the updatedBookings array.\n for(let i = 0; i < duplicatesCount.length; i++) {\n // Deep copy the booking to ensure references are not copied\n const duplicatedBooking = cloneDeep(booking); \n duplicatedBooking.room = duplicatesCount[i]; \n updatedBookings.push(duplicatedBooking);\n }\n }\n });\n\n // Return the array with duplicated entries \n return updatedBookings;\n\n}\n \n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { Booking, IBookingQueryOptions } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { DateNow } from \"@mckinsey-converge/date-tz\";\nimport { Observable } from 'rxjs/internal/Observable';\nimport { forkJoin } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n const now = DateNow(new Date())\n if (!options.from) {\n options.from = now\n .startOfValue('day')\n .subtractValue({ days: 2 })\n .ms;\n }\n if (!options.until) {\n options.until = null;\n }\n\n const key = `bookings|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Booking[]) => {\n delete this._promises[key];\n resolve(list);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking, series?: boolean): Promise {\n const body = booking.toApiJSON()\n if(series){\n body.series = true\n }\n return booking.id ? this.update(booking.id, body) : this.add(body);\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n public checkinIndividualVisitor(id: string, fields: BookingCheckinParams) {\n return this.taskObsr(id, 'checkin', fields); \n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n public declineMultiple(bookings: Booking[]): Observable {\n const requests = [];\n bookings.forEach(bkg => {\n const booking = bkg.toJSON();\n const id = booking.id;\n const fields = {\n booking_id: booking.id,\n organiser: booking.organiser.email,\n room_email: booking.space?.email,\n icaluid: booking.icaluid,\n start: booking.startDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n end: booking.endDateTz.formatDate('h:mm a').toLocaleLowerCase(),\n };\n if (bkg.is_recurrent && bkg.recurrence_type === 'master') {\n // Add series=true for recurrent bookings\n fields['series'] = true;\n } \n requests.push(this.taskObsr(id, 'concierge_decline', fields) ); \n });\n return forkJoin(requests);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { PaginatedAPIService } from '../paginated.service';\nimport { Booking, IBookingQueryOptions, } from './booking.class';\nimport { bookingOptionsToQuery } from './booking.utilities';\nimport {\n HashMap\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { BookingCheckinParams } from './space.types';\nimport { Observable } from 'rxjs';\n\nexport interface PaginatedBooking {\n results: Booking[];\n total: number;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BookingsPaginatedService extends PaginatedAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Booking, this);\n this._name = 'Bookings';\n this._api_route = 'bookings';\n this._compare = (a, b) => !(a.id || '').localeCompare(b.id) || !(a.icaluid || '').localeCompare(b.icaluid);\n }\n\n /**\n * Get user bookings\n * @param options\n */\n public userBookings(options: IBookingQueryOptions,\n uniqueId?: string): Promise {\n if (!options) {\n throw new Error('Booking avilability requires request options');\n }\n\n const key = `bookingsPaginated|${options.id ? options.id : ''}|${uniqueId ?? ''}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (response: any) => {\n delete this._promises[key];\n resolve(response);\n };\n const error = e => {\n reject(e);\n delete this._promises[key];\n };\n const query = bookingOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(i => respond([i]), error);\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n\n /**\n * Save changes to the booking\n * @param booking Booking update or add to the database\n */\n public save(booking: Booking): Promise {\n return booking.id ? this.update(booking.id, booking.toJSON()) : this.add(booking.toJSON());\n }\n\n /**\n * Checkin atteendee of a booking\n * @param id ID of the booking\n * @param fields Fields associated with the booking and attendee\n */\n public checkin(id: string, fields: BookingCheckinParams) {\n return this.task(id, 'checkin', fields);\n }\n\n public accept(id: string, fields?: HashMap) {\n return this.task(id, 'accept', fields);\n }\n\n public decline(id: string, fields?: HashMap) {\n return this.task(id, this.settingsService.concierge ? 'concierge_decline' : 'decline', fields);\n }\n\n public undo(id: string, status: 'accept' | 'decline', fields?: HashMap) {\n return this.task(id, status, fields);\n }\n\n protected process(raw_data: HashMap): Booking {\n return new Booking(raw_data);\n }\n\n // public getHoldingBay(query: IBookingQueryOptions): Promise {\n // const key = `bookingsPaginated|holding-bay`;\n // if (!this._promises[key]) {\n // this._promises[key] = new Promise((resolve, reject) => {\n // const respond = (response: any) => {\n // delete this._promises[key];\n // resolve(response);\n // };\n // const error = e => {\n // reject(e);\n // delete this._promises[key];\n // }; \n // this.query(query, { url: '/api/staff/bookings/holding_bay' }).then(respond, error);\n // });\n // }\n\n // return this._promises[key];\n // }\n\n public getHoldingBay = (query: IBookingQueryOptions): Observable => this.queryHoldingBay(query, { url: '/api/staff/bookings/holding_bay' });\n}\n","export * from './booking.class'\nexport * from './space.types'\nexport * from './bookings.service'\nexport * from './bookingsPaginated.service'\nexport * from './booking.utilities'\nexport * from './booking-state.service'\nexport * from './space.utilities'\nexport * from './booking.types'\n","import { SpaceRules } from './booking.types';\n\nimport {\n durationGreaterThanOrEqual,\n stringToMinutes\n} from './booking.utilities';\nimport {\n SpaceCheckOptions,\n SpaceRuleOptions\n} from './space.types';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n/**\n * Get booking rules for the given user and space\n * @param options\n */\nexport function rulesForSpace(options: SpaceRuleOptions): SpaceRules {\n if (!options) {\n throw Error('Options are needed to check for rule matches');\n }\n const space_rules_for_user: SpaceRules = {\n auto_approve: true,\n hide: true,\n reason: ''\n };\n let match = false;\n /* istanbul ignore else */\n if (options.space) {\n for (const type in options.rules) {\n if (\n options.rules.hasOwnProperty(type) &&\n options.rules[type] instanceof Array &&\n options.space.zones.find((zone) => zone === type)\n ) {\n for (const rule_block of options.rules[type]) {\n /* istanbul ignore else */\n if (\n checkRules({\n user: options.user,\n space: options.space,\n time: options.time,\n duration: options.duration,\n rules: rule_block.conditions\n })\n ) {\n const ruleset = rule_block.rules;\n const conditions = rule_block.conditions;\n space_rules_for_user.hide = false;\n /* istanbul ignore else */\n if (conditions.max_length) {\n space_rules_for_user.max_length = stringToMinutes(\n conditions.max_length as string\n );\n }\n /* istanbul ignore else */\n if (conditions.min_length) {\n space_rules_for_user.min_length = stringToMinutes(\n conditions.min_length as string\n );\n }\n // NOTE: use max_length in conditions instead of book_length in rules\n // if (ruleset.book_length) {\n // space_rules_for_user.max_length = stringToMinutes(ruleset.book_length as string);\n // }\n /* istanbul ignore else */\n if (ruleset.auto_approve !== undefined) {\n space_rules_for_user.auto_approve = ruleset.auto_approve;\n }\n match = true;\n space_rules_for_user.reason = '';\n break;\n }\n else {\n space_rules_for_user.reason = 'OfficeRules';\n }\n }\n }\n \n /* istanbul ignore else */\n if (!space_rules_for_user.hide) {\n break;\n }\n }\n }\n if (!match) {\n space_rules_for_user.hide = true;\n }\n return space_rules_for_user;\n}\n\n\n/**\n * Check if user matches the given ruleset\n * @param options\n */\nfunction checkRules(options: SpaceCheckOptions): boolean {\n /* istanbul ignore else */\n if (options.rules) {\n const time = new DateTZ({date: options.time});\n const count = Object.keys(options.rules).length;\n let matches = 0;\n Object.keys(options.rules).forEach((key) => {\n let counter = 0;\n const condition: string[] =\n options.rules[key] instanceof Array\n ? (options.rules[key] as [])\n : [options.rules[key] as string];\n switch (key) {\n case 'groups':\n /* istanbul ignore else */\n if (options.user && options.user.groups) {\n counter = 0;\n condition.forEach((i) =>\n options.user.groups.find((j) => j === i) ? counter++ : null\n );\n /* istanbul ignore else */\n if (counter > 0) {\n matches++;\n }\n }\n break;\n case 'locations':\n /* istanbul ignore else */\n if (options.user && options.user.location) {\n counter = 0;\n condition.forEach((i) =>\n (options.user.last_location.name || '').indexOf(i) >= 0\n ? counter++\n : null\n );\n /* istanbul ignore else */\n if (counter >= options.rules[key].length) {\n matches++;\n }\n }\n break;\n case 'is_before':\n /* istanbul ignore else */\n if (options.time) {\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date()).addValue({ minutes: duration });\n let match = time.isBeforeDate(check);\n /* istanbul ignore else */\n matches += match ? 1 : 0;\n }\n break;\n case 'is_after':\n /* istanbul ignore else */\n if (options.time) {\n\n const duration = stringToMinutes(condition[0]);\n const check = DateNow(new Date());\n time.isAfterDate(check.addValue({ minutes: duration })) ? matches++ : '';\n }\n break;\n case 'min_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(options.duration, condition[0])\n ) {\n matches++;\n }\n break;\n case 'max_length':\n /* istanbul ignore else */\n if (\n options.duration &&\n durationGreaterThanOrEqual(condition[0], options.duration)\n ) {\n matches++;\n }\n break;\n }\n });\n return matches >= count;\n }\n return false;\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringCategoriesService extends BaseAPIService {\n\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringCategory, this);\n this._name = 'catering category/group';\n this._api_route = 'catering/category';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering categories. Use catering menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering categories. Use catering menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringCategory(raw_item);\n }\n\n public format(item: CateringCategory) {\n return { ...item };\n }\n}\n","import { CateringItem } from \"./catering-item.class\";\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport class CateringCategory extends CateringItem {\n /** Whether item is a category */\n public is_category = true;\n public admin_only: boolean;\n public restricted_from: number;\n\n constructor(data: HashMap) {\n super(data);\n this.is_category = true;\n (this as any).must_select = this.must_select || 0;\n (this as any).order_anytime = !!data.order_anytime && this.package;\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj = super.toJSON();\n obj.order_anytime = !!obj.order_anytime && obj.package;\n return obj;\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport interface CateringAvailability {\n /** Month of the year that the item starts being available */\n readonly from_month: number;\n /** Month of the year that the item ends being available */\n readonly to_month: number;\n}\n\nexport class CateringItem {\n /** Unique ID of the catering item */\n public readonly id: string;\n /** Display name of the catering item */\n public readonly name: string;\n /** Description of the item */\n public readonly description: string;\n /** URL to the image associated with the item */\n public readonly image_path: string;\n /** Type of catering item */\n public readonly catering_type: string;\n /** Availability of the item */\n public readonly available: CateringAvailability;\n /** Time in hours that is needed to prepare the item beforehand */\n public readonly prior_notice: number;\n /** Cost of the item without decimals */\n private unit_price: number;\n /** Cost of the item without decimals */\n public readonly supplier_cost: number;\n /** Minimum number this item allowed in an order */\n public readonly minimum_quantity: number;\n /** Maximum number this item allowed in an order */\n public readonly maximum_quantity: number;\n /** List of categories that the item is contained in */\n public readonly parent_categories: readonly string[];\n /** Allegen information associated with the item */\n public readonly allergy: string;\n /** Whether the supply of this item has run out */\n public out_of_stock: boolean;\n /** Whether item can be ordered within the time limit set by the building */\n public readonly order_anytime: boolean;\n /** Number of child items that must be selected as part of the package */\n public readonly must_select: number;\n /** List of associated items */\n public readonly items: CateringItem[];\n public readonly availableItems: CateringItem[];\n /** Whether child items are part of a package */\n public readonly package: boolean;\n /** List of zone ids associated with the category */\n public readonly zones: readonly string[];\n /** Number of this item in the assoicated order */\n private _amount = 0;\n /** Unique ID of the catering item */\n private instance_id: string;\n /** Whether item is a category */\n public is_category: boolean = false;\n /** Whether item is disabled in Staff App */\n public admin_only: boolean;\n /** restricted_from indicates category restriction from hours ahead of delivery time */\n public restricted_from: number;\n\n public get can_order_anytime(): boolean {\n return (\n this.order_anytime ||\n !this.package && this.items.reduce(\n (anytime, item) => anytime || item.can_order_anytime,\n false,\n )\n );\n }\n\n /** Number of this item in the assoicated order */\n public get amount(): number {\n return this._amount || 0;\n }\n\n /** Unit price in the assoicated order */\n public get price(): number {\n return this.unit_price || 0;\n }\n\n /** Total cost of the amount of items set */\n public get total(): number {\n return (this._amount * this.unit_price) || 0;\n }\n\n constructor(data: HashMap) {\n this.instance_id = `item-${Math.floor(Math.random() * 999_999_999)}`;\n this.id = data.id || '';\n this.name = data.name || '';\n this.is_category = this.id.includes('category-');\n this.available = {\n from_month: (data.available ? data.available.from_month : data.available_from) || -1,\n to_month: (data.available ? data.available.to_month : data.available_to) || -1,\n };\n this.description = data.description || '';\n this.prior_notice = data.prior_notice || data.notice;\n this.unit_price = data.unit_price || data.price || 0;\n this.supplier_cost = data.supplier_cost;\n this.minimum_quantity = Math.max(0, data.minimum_quantity || 0);\n this.maximum_quantity = Math.max(1, data.maximum_quantity || 999);\n this.parent_categories = data.category_ids || data.parent_categories || data.categories;\n this.order_anytime = !!data.order_anytime;\n this.image_path = data.image_path || '';\n this.admin_only = data.admin_only;\n this.restricted_from = data.restricted_from || data?.root_category_restricted_from || 0;\n \n this.catering_type = data.catering_type;\n this.must_select = data.must_select ?? 0;\n this._amount = data._amount || data.amount || 0;\n this.allergy = data.allergy || '';\n const cateringItems: CateringItem[] = (data.items || []).map(item => new CateringItem(item));\n this.items = cateringItems;\n const filteredCateringItems = cateringItems.filter(c => !c.out_of_stock);\n this.availableItems = filteredCateringItems;\n this.out_of_stock = !!data.out_of_stock ||\n // if original items are empty, we hit the bottom, so if we filter out items then its out of stock.\n (cateringItems.length > 0 && filteredCateringItems.length === 0);\n this.package = data.package === 'true' || data.package === true;\n this.zones = data.zones && data.zones.length ? [...data.zones] : [];\n }\n\n public setAmount(amount: number = 0): void {\n if (amount <= this._amount) {\n if (amount < this.minimum_quantity) {\n amount = 0;\n }\n } else {\n if (amount < this.minimum_quantity) {\n amount = this.minimum_quantity;\n }\n }\n this._amount = Math.max(0, Math.min(this.maximum_quantity, amount));\n }\n\n /**\n * Updates the unit_price in the assoicated order if necessary\n * @param price value to compare to unit_price\n */\n public setPrice(price: number = 0): void {\n if(this.unit_price !== price) this.unit_price = price;\n }\n\n /**\n * Increase amount of the item the order\n * @param amount Amount to increase by\n */\n public addToOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount += amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = this.minimum_quantity;\n } else if (this._amount > this.maximum_quantity) {\n this._amount = this.maximum_quantity;\n }\n }\n\n /**\n * Decrease amount of the item the order\n * @param amount Amount to decrease by\n */\n public removeFromOrder(amount: number = 1) {\n amount = Math.max(1, amount);\n this._amount -= amount;\n if (this._amount < 0) {\n this._amount = 0;\n } else if (this._amount < this.minimum_quantity) {\n this._amount = 0;\n }\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringItem): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._changes;\n delete obj._server_names;\n // Convert remaining members to be public\n obj.price = obj.unit_price;\n obj.categories = obj.parent_categories;\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n return obj;\n }\n\n\n\n public within_category_restricted_time(dateTz): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!this?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: this?.restricted_from }).startOfValue('minute');\n return dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n}\n","\nimport { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { BaseAPIService } from '../base.service';\nimport { CateringItem } from './catering-item.class';\nimport { SettingsService } from '../settings.service';\nimport { ServiceManager } from '../service-manager.class';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringItemsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(CateringItem, this);\n this._name = 'Catering Menu';\n this._api_route = 'catering/item';\n }\n\n public query(): never {\n throw Error('No index endpoint for catering items. Use menu service.');\n }\n\n public show(): never {\n throw Error('No show endpoint for catering items. Use menu service.');\n }\n\n public processItem(raw_item: any) {\n return new CateringItem(raw_item);\n }\n\n public format(item: CateringItem) {\n return item instanceof CateringItem ? item.toJSON() : item;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { CateringItem } from './catering-item.class';\nimport { CateringCategory } from './catering-category.class';\nimport { BaseAPIService } from '../base.service';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringMenuService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Catering Menu';\n this._api_route = 'menu';\n }\n\n /**\n * Convert user data to local format\n * @param user User data\n */\n protected processItem(item: HashMap) {\n return item.items ? new CateringCategory(item) : new CateringItem(item);\n }\n}\n","\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CateringNotesService {\n\n public cateringNotes = [];\n\n \n public setNotes(notes) {\n this.cateringNotes = notes;\n }\n\n public getNotes() {\n return this.cateringNotes;\n }\n}","import { CateringItem } from './catering-item.class';\nimport { HashMap } from '@mckinsey-converge/base';\n\nimport { CateringCategory } from './catering-category.class';\nimport { Booking } from '../bookings';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport type CateringOrderMutableProperties =\n | 'items'\n | 'location_id'\n | 'location'\n | 'delivery_time'\n | 'charge_code'\n | 'notes'\n | 'status';\n\nexport type CateringOrderStatus = 'accepted' | 'preparing' | 'ready' | 'delivered' | 'cancelled';\n\nconst now = DateNow(new Date());\n\n// R--- refactor booking date to be dateTz\nexport class CateringOrder {\n /**\n * Booking fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Unique Booking ID for the catering order */\n readonly booking_id: string;\n /** \n * Timestamp based booking time of the booking associated with the order\n * \n * Must be provide as the true Booking startDateTz or as a new DateTZ with \n * the correct date: timestamp, local_tz = false and bulding_tz values\n */\n readonly booking_date: number;\n /**\n * Timezone of the booking associated with the order\n */\n readonly booking_timezone: string;\n /** ID of the location to deliver the items to */\n location_id: string = '';\n /** Display text for the location to deliver the items to */\n location: string = '';\n /**\n * Smart timezone aware catering datetime with timezone\n */\n readonly bookingDateTz: DateTZ;\n\n /** \n * Booking associated with the order \n * \n * The booking attached to the CateringOrder is a special case used \n * mainly on the Concierge catering reports because someone created \n * a bad pattern to save catering changes to the booking. \n * \n * Avoid when possible.\n */\n public booking: Booking = null;\n\n /**\n * Catering specific fields\n * \n * The app handles booking data inconsisently. Ususally these booking fields are provided\n * for related booking data, but on occasion the full Booking class is used.\n */\n\n /** Whether the order status change is loading */\n public loading: boolean;\n /** Unique ID for the catering order */\n readonly id: string;\n /** Number of minutes after the start of the associated meeting to delivery the order */\n readonly delivery_time: number = 0;\n /** Status of the catering order */\n readonly status: CateringOrderStatus;\n /** Whether items in the order need to be prepared in the kitchen */\n readonly kitchen: boolean;\n /** Whether items in the order are in the pantry */\n readonly pantry: boolean;\n /** List of items */\n readonly items: readonly (CateringItem | CateringCategory)[] = [];\n /** Creation time of the order */\n readonly created_at: number;\n /** Charge code associated with the order */\n readonly charge_code: string;\n /** Notes associated with the order */\n readonly notes: string;\n // /** Mapping of properties to their changes */\n // private _changes: HashMap = {};\n /** Map of local property names to server ones */\n protected _server_names: HashMap = {};\n /** Currency code for the location of the order */\n public symbol: string;\n /** Whether the is an error with the order */\n public error: boolean;\n\n\n constructor(data: HashMap) {\n /** \n * Setup Defaults when raw_data values are not provided\n */\n const nowTz = DateNow(new Date());\n // now rounded to the next 5 minute increment\n const defaultStartTz = nowTz.setValue({ minute: Math.ceil(nowTz.minutes / 5) * 5 });\n const defaultLocalTimezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;\n\n this.id = data.id || `order-${Math.floor(Math.random() * 999_999_999)}`;\n\n // If the booking is provided default the booking values to the true booking values\n this.booking = data.booking || null;\n\n \n // Has a booking so init with those values\n if (this.hasBookingAttached) {\n this.booking_date = this.booking.startDateTz.ms;\n this.booking_timezone = this.booking.timezone;\n this.bookingDateTz = this.booking.startDateTz;\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n } else {\n this.booking_date = data.booking_date || defaultStartTz.ms;\n this.booking_timezone = data.booking_timezone || defaultLocalTimezone;\n this.bookingDateTz = new DateTZ({ date: this.booking_date, is_local_tz: false, building_tz: this.booking_timezone });\n this.location_id = data.location_id || '';\n this.location = data.location || '';\n }\n \n this.delivery_time = typeof data.delivery_time === 'number' ? data.delivery_time : 0;\n this.status = data.status || 'accepted';\n this.charge_code = data.charge_code || data.code;\n this.notes = data.notes;\n this.kitchen = data.kitchen instanceof Array ? !!data.kitchen.length : data.kitchen;\n this.pantry = data.pantry instanceof Array ? !!data.pantry.length : data.pantry;\n this.symbol = data.symbol || 'USD';\n this.items = (data.items || [])\n .map(item => (item.items ? new CateringCategory(item) : new CateringItem(item)))\n .filter(item => !!item.amount);\n }\n\n /** Special Case, check if a full booking is attached */\n public get hasBookingAttached(): boolean {\n return !!this.booking;\n }\n\n /** Display string for the types of items in the order */\n public get type(): string {\n let type = '';\n /* istanbul ignore else */\n if (this.kitchen) type += 'Kitchen';\n /* istanbul ignore else */\n if (this.pantry) {\n /* istanbul ignore else */\n if (type) type += ' + ';\n type += 'Pantry';\n }\n return type;\n }\n\n /** Total cost of the order */\n public get total(): number {\n return this.items.reduce((total, item) => total + (item.total || 0), 0);\n }\n\n /** Total number of items in the order */\n public get item_count(): number {\n return this.items.reduce((total, item) => total + (item.amount || 0), 0);\n }\n\n public get deliver_date(): DateTZ {\n return (this.bookingDateTz || this.booking?.startDateTz).addValue({ minutes: this.delivery_time })\n }\n\n /** Display string for the delivery time of the order (short version) */\n public get deliver_at(): string {\n return this.deliver_date.formatDate('h:mm a');\n }\n\n /** Display string for the delivery time of the order */\n public get deliver_at_time(): string {\n return this.deliver_date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Display string for the delivery date of the order */\n public get deliver_on_date(): string {\n return this.deliver_date.formatDate('dd MMM yyyy');\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): CateringOrder {\n return new CateringOrder(this.toJSON());\n }\n\n /**\n * Convert class object into plain object\n */\n public toJSON(this: CateringOrder): HashMap {\n const obj: any = { ...this };\n // Remove local private members\n delete obj._server_names;\n // Remove local public members\n delete obj.booking;\n delete obj.loading;\n delete obj.bookingDateTz;\n\n // Convert remaining members to be public\n const keys = Object.keys(obj);\n for (const key of keys) {\n if (key[0] === '_') {\n const new_key = this._server_names[key.substr(1)] || key.substr(1);\n obj[new_key] = obj[key];\n delete obj[key];\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n obj.items = obj.items.map((item: CateringItem) => item.toJSON());\n\n return obj;\n }\n}\n","import { CateringItem } from './catering-item.class';\n\nexport const mergeCateringItemWithFormData = (existing: CateringItem, override: any) =>\n new CateringItem({\n ...(existing instanceof CateringItem ? existing.toJSON() : existing),\n ...override\n });\n","export * from './catering-item.class';\nexport * from './catering-category.class';\nexport * from './catering-menu.service';\nexport * from './catering-order.class';\nexport * from './catering-categories.service';\nexport * from './catering-items.service';\nexport * from './catering.utilities';\nexport * from './catering-notes.service';\n","import { Injectable } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CloseDialogService {\n private dialogRefMap = new Map>();\n\n constructor() { }\n\n // Register a dialog with its ID\n registerDialog(id: string, dialogRef: MatDialogRef): void {\n this.dialogRefMap.set(id, dialogRef);\n }\n\n // Close a specific dialog by ID\n closeDialog(id: string): void {\n const dialogRef = this.dialogRefMap.get(id);\n if (dialogRef) {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n }\n }\n\n // Optional: Close all dialogs\n closeAllDialogs(): void {\n this.dialogRefMap.forEach((dialogRef, id) => {\n dialogRef.close();\n this.dialogRefMap.delete(id);\n });\n }\n}\n\nexport enum DialogIds {\n MeetingDetails = 'meetingDetailsDialogId',\n BookingConfirmation = 'bookingConfirmationDialogId',\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapseService {\n private collapseSubject = new BehaviorSubject(false);\n collapse$ = this.collapseSubject.asObservable();\n\n collapsePanel() {\n this.collapseSubject.next(false);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class DataCommonModule {}\n","import { Injectable } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n Subscription\n} from 'rxjs';\n\nimport {\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\n/** List of keys that cannot be in a combination by themselves or with each other */\nconst INVALID_STANDALONE_KEYS: string[] = ['control', 'shift', 'alt', 'meta', 'os'];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class HotkeysService {\n /** Map of subjects which store press states of keys */\n private keydown_states: HashMap> = {};\n /** Map of obserers for key state subjects */\n private keydown_observers: HashMap> = {};\n /** List of keys at the end of a combination */\n private combo_end: string[] = [];\n /** List of registered hotkey combinations */\n private registered_combos: string[][] = [];\n /** Counter for the number of keydown events. Used for checking order of key presses */\n private counter: number = 0;\n /** Last key code to be pressed */\n private last_down: string;\n\n constructor() {\n window.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.last_down !== code) {\n /* istanbul ignore else */\n if (!this.keydown_states[code]) {\n this.keydown_states[code] = new BehaviorSubject(null);\n this.keydown_observers[code] = this.keydown_states[code].asObservable();\n }\n this.keydown_states[code].next(++this.counter);\n /* istanbul ignore else */\n if (this.combo_end.indexOf(code) >= 0) {\n event.preventDefault();\n }\n this.last_down = code;\n }\n });\n\n window.addEventListener('keyup', (event: KeyboardEvent) => {\n const code = this.mapKey((event.code || '').toLowerCase());\n /* istanbul ignore else */\n if (this.keydown_states[code]) {\n this.keydown_states[code].next(null);\n }\n /* istanbul ignore else */\n if (this.last_down === code) {\n this.last_down = null;\n }\n });\n }\n\n /**\n * Listen to the given key combination\n * @param combo Array of key codes to listen to or a hotkey string e.g. `Alt+Shift+KeyK`\n * @param next Callback for combination presses\n */\n public listen(combo: string | string[], next: () => void): Subscription {\n combo = (combo instanceof Array ? combo : combo.split('+'));\n const combination: string[] = combo.map(i => this.mapKey(i.toLowerCase()));\n /* istanbul ignore else */\n if (combination.length > 0 && this.validCombination(combination)) {\n this.registered_combos.push(combination);\n const last_key = combination[combination.length - 1];\n /* istanbul ignore else */\n if (!this.keydown_states[last_key]) {\n this.keydown_states[last_key] = new BehaviorSubject(null);\n this.keydown_observers[last_key] = this.keydown_states[last_key].asObservable();\n }\n this.updateCombinationEndList();\n return this.keydown_observers[last_key].subscribe((count) => {\n /* istanbul ignore else */\n if (count) {\n const presses: number[] = [];\n /* istanbul ignore else */\n if (combination.length > 0) {\n // Check that keys are pressed\n for (const key of combination) {\n const state = this.keydown_states[key];\n presses.push(state ? state.getValue() || -1 : -1);\n }\n // Check that keys are pressed in the correct order\n for (let i = 0; i < combination.length - 1; i++) {\n if (presses[i] > presses[i + 1]) {\n return;\n }\n }\n }\n const total = presses.reduce((a, v) => a + (v > 0 ? 1 : -1), 0);\n /* istanbul ignore else */\n if (total >= combination.length) {\n next();\n }\n }\n });\n }\n return null;\n }\n\n /**\n * Map key codes with multiple versions to simple form\n * @param code Code to transform\n */\n private mapKey(code: string): string {\n /* istanbul ignore else */\n if (code.indexOf('alt') >= 0 || code.indexOf('shift') >= 0 || code.indexOf('control') >= 0) {\n return code.replace('left', '').replace('right', '');\n }\n return code;\n }\n\n /**\n * Update the list of the last keys in combinations to allow for prevent default actions on pre-existing hotkeys\n */\n private updateCombinationEndList(): void {\n const key_list = [];\n for (const combo of this.registered_combos) {\n this.combo_end.push(combo[combo.length - 1]);\n }\n this.combo_end = unique(key_list);\n }\n\n /**\n * Checks if the given hotkey combination is allowed and valid\n * @param combo Array of key codes\n */\n private validCombination(combo: string[]): boolean {\n let non_meta = 0;\n for (const key of combo) {\n /* istanbul ignore else */\n if (INVALID_STANDALONE_KEYS.indexOf(key) < 0) {\n non_meta++;\n }\n }\n return non_meta > 0;\n }\n}\n","export * from './location.class';\nexport * from './location.service';\n","import { HashMap } from '@mckinsey-converge/base';\n\nimport { Organisation } from '../organisation/organisation.class';\nimport {\n ServiceLike,\n ServiceManager\n} from '../service-manager.class';\nimport { BuildingLevel } from '../organisation/level.class';\n\nexport class MapLocation {\n /** ID of the element on the associated map */\n public readonly id?: string;\n /** Name of the location */\n public readonly name?: string;\n /** X coordinate of the location */\n public readonly x?: number;\n /** Y coordinate of the location */\n public readonly y?: number;\n /** Level details for the location */\n public readonly level: BuildingLevel;\n /** Whether the position is fixed */\n public readonly fixed: boolean;\n /** Accuracy of the location when not fixed */\n public readonly confidence?: number;\n /** Whether location is at a desk */\n public readonly at_desk?: boolean;\n /** Whether location is set */\n public readonly empty: boolean;\n\n /** Service for managing model on the server */\n protected get _service(): ServiceLike {\n return ServiceManager.serviceFor(MapLocation);\n }\n\n /** Display string for the building and level of the location */\n public get display(): string {\n const service = ServiceManager.serviceFor(Organisation);\n if (!service) {\n return this.level.name;\n }\n const bld = service.buildings.find((bld) => bld.id === this.level.building_id);\n return bld ? `${bld.name}, ${this.level.name}` : this.level.name;\n }\n\n /** Whether location is in a different building from the active one */\n public get in_another_building(): boolean {\n const service = ServiceManager.serviceFor(Organisation);\n return service && service.building.id !== this.level.building_id;\n }\n\n constructor(raw_data: HashMap) {\n this.id = raw_data.id || raw_data.map_id || raw_data.desk_id;\n this.name = raw_data.name || '';\n this.x = raw_data.x\n ? Math.floor(this.normalise(raw_data.x, raw_data.x_max || 10000) * 10000)\n : null;\n this.y = raw_data.y\n ? Math.floor(this.normalise(raw_data.y, raw_data.x_max || 10000) * 10000)\n : null;\n const service = ServiceManager.serviceFor(Organisation);\n this.level =\n raw_data.level instanceof BuildingLevel\n ? raw_data.level\n : service\n ? service.levelWithID(raw_data.level)\n : new BuildingLevel(raw_data.level);\n this.fixed = this.x === null && this.y === null;\n this.confidence = Math.max(5, Math.min(15, raw_data.confidence || 0));\n this.at_desk = this.id && this.id.indexOf('area-') === 0;\n this.empty = !(this.name && this.level && (this.id || this.x || this.y));\n }\n\n /** Normalise the given value within the max */\n private normalise(value: number, max: number): number {\n return value / (max * 1.0);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { MapLocation } from './location.class';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n ServiceManager.setService(MapLocation, this);\n this._name = 'Location';\n this._api_route = 'people';\n }\n\n public add(...args): never {\n throw new Error('Create not allowed for location service')\n }\n\n public update(...args): never {\n throw new Error('Update not allowed for location service')\n }\n\n public delete(...args): never {\n throw new Error('Delete not allowed for location service')\n }\n\n public process(item: HashMap) {\n return new MapLocation(item) as any;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { BookingRule } from '../bookings';\nimport { ServiceManager } from '../service-manager.class';\n\nexport interface BuildingCity {\n timezone: string\n name: string\n}\n\nexport interface IBuildingRoleUser {\n name: string;\n email: string;\n phone: string;\n}\n\nexport interface LockerMap {\n [zone: string]: {\n [area: string]: {\n [type: string]: (string | boolean)[][];\n };\n };\n}\n\nexport interface ICoordinates {\n longitude: number;\n latitude: number;\n}\n\nexport interface LevelFeature {\n id: string;\n level_id: string;\n name: string;\n}\n\nexport interface BookingRuleDetails {\n /** List of booking rules details for the building */\n readonly rules: readonly string[];\n /** Custom booking rules for the map */\n readonly map_rules?: readonly string[];\n /** Custom booking rules for the map */\n readonly other_rules?: readonly string[];\n /** Contact email address for the building */\n readonly contact?: string;\n /** Information string to display before the rule listings */\n readonly info?: string;\n /** Link for more details */\n readonly link?: { url?: string, name?: string };\n /**\n * Allow buildings to define their own rules formats where needed or for special messages.\n */\n readonly custom_html?: string;\n}\n\nexport class Building extends BaseDataClass {\n /** Service for managing buildings */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Engine Zone ID for the building */\n public readonly zone_id: string;\n /** Organisation Code for the building */\n public readonly code: string;\n /** Geographical address of the building */\n public readonly address: string;\n /** Details about the booking rules for the building */\n public readonly booking_details: BookingRuleDetails;\n /** Details about the booking rules for the building */\n public readonly booking_rules: HashMap;\n /** Number of hour before a booking catering is restricted */\n public readonly catering_restricted_from: number;\n /** Currency code for the country assoicated with the building */\n public readonly currency: string;\n /** Map of fields that are required on the form */\n public readonly required: HashMap;\n /** IANA timezone database string for the location the building resides */\n public readonly timezone: string;\n /** Whether catering is available in this building */\n public readonly has_catering: boolean;\n /** ID of the system used for the holding bay */\n public readonly holding_bay: string;\n /** ID of the system used for standalone visitors bookings */\n public readonly visitor_space: string;\n /** List of zones to determine sort order spaces */\n public readonly sort_order: readonly string[];\n /** Searchable map features */\n public readonly searchables: readonly LevelFeature[];\n /** List of available extras for the building */\n public readonly extras: readonly Identity[];\n /** List of available extra equipment for loan at the building */\n public readonly loan_items: readonly Identity[];\n /** List of available levels for the building */\n public readonly levels: readonly BuildingLevel[];\n /** The city the building belongs in **/\n public readonly city: string;\n\n public readonly catering_hours: { readonly start: number, readonly end: number };\n /** Map of custom settings for the building */\n private _settings: HashMap;\n /** Map of roles and list of the associated users */\n private _roles: HashMap;\n /** Map of the locker ID arrays */\n private _lockers: LockerMap;\n /** Map of important system ids for the building */\n private _systems: HashMap;\n /** Map of important phone numbers for the building */\n private _phone_numbers: HashMap;\n /** Globe coordiates for the build */\n private _location: ICoordinates;\n /** List of zones associated with the building */\n public readonly zones: readonly string[];\n\n constructor(raw_data: HashMap) {\n super(raw_data);\n const settings = raw_data.settings || {};\n const disc_info = settings.discovery_info || {};\n this.zone_id = raw_data.zone_id || raw_data.zone;\n this.extras = (raw_data.extras || disc_info.extras || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.loan_items = (raw_data.loan_items || disc_info.loan_items || []).map(i => ({\n id: i.extra_id || i.id,\n name: i.extra_name || i.name\n }));\n this.levels = (raw_data.levels || disc_info.levels || []).map(i => new BuildingLevel({\n ...i,\n building_id: this.id\n }));\n this._roles = raw_data.roles || disc_info.roles || {};\n this._lockers = raw_data.lockers || raw_data.locker_structure || disc_info.locker_structure || {};\n this._systems = raw_data.systems || disc_info.systems || {};\n this._settings = settings;\n this._phone_numbers = raw_data.phone_numbers || disc_info.phone_numbers || {};\n this._location = raw_data.location || disc_info.location || { longitude: null, latitude: null };\n this.catering_hours = raw_data.catering_hours || disc_info.catering_hours || settings.catering_hours || {\n start: 7,\n end: 20\n };\n const searchables = [];\n if (raw_data.neighbourhoods) {\n for (const lvl in raw_data.neighbourhoods) {\n if (raw_data.neighbourhoods.hasOwnProperty(lvl)) {\n const lvl_features = raw_data.neighbourhoods[lvl] || {};\n for (const feature in lvl_features) {\n if (lvl_features.hasOwnProperty(feature)) {\n searchables.push({\n id: lvl_features[feature],\n name: feature,\n level_id: lvl\n });\n }\n }\n }\n }\n }\n this.searchables = searchables;\n this.code = raw_data.code || disc_info.code || settings.code || '';\n this.address = raw_data.address || disc_info.address || settings.address || '';\n this.booking_details = raw_data.booking_details || disc_info.booking_details || settings.booking_details || {};\n this.booking_rules = raw_data.booking_rules || disc_info.booking_rules || settings.booking_rules || {};\n this.catering_restricted_from = raw_data.catering_restricted_from || disc_info.catering_restricted_from || settings.catering_restricted_from || 0;\n this.currency = raw_data.currency || disc_info.currency || settings.currency || 'USD';\n this.required = raw_data.required || disc_info.required || settings.required || {};\n if (disc_info.requires_equipment_code) {\n this.required.equipment_code = true;\n }\n if (disc_info.requires_expected_attendees) {\n this.required.expected_attendees = true;\n }\n this.timezone = raw_data.timezone || disc_info.timezone || settings.timezone || '';\n this.has_catering = raw_data.has_catering || disc_info.has_catering || settings.has_catering || false;\n this.holding_bay = raw_data.holding_bay || disc_info.holding_bay || settings.holding_bay || '';\n this.visitor_space = raw_data.visitor_space || disc_info.visitor_space || settings.visitor_space || '';\n this.sort_order = raw_data.sort_order || disc_info.sort_order || settings.sort_order || [];\n this.city = raw_data.city || disc_info.city || 'No City';\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings) || getItemWithKeys(['discovery_info', ...keys], this._settings);\n return value;\n }\n\n /**\n * Get list of users with the associated role\n * @param name Role to find users for\n */\n public role(name: string): IBuildingRoleUser[] {\n return [...(this._roles[name] || [])];\n }\n\n /**\n * Get list of the names of available user role lists\n */\n public get role_names(): string[] {\n return Object.keys(this._roles).filter(i => this._roles.hasOwnProperty(i));\n }\n\n /** Map of the locker ID arrays */\n public get lockers(): LockerMap {\n return { ...(this._lockers || {}) };\n }\n\n /** Map of important system ids for the building */\n public get systems(): HashMap {\n return { ...(this._systems || {}) };\n }\n\n /** Map of important phone numbers for the building */\n public get phone_numbers(): HashMap {\n return { ...(this._phone_numbers || {}) };\n }\n\n /** Real coordinates */\n public get location(): ICoordinates {\n return { ...this._location };\n }\n\n /**\n * Get search map feature for the given level ID\n * @param level_id ID of level to grab features for\n */\n public featuresForLevel(level_id: string): LevelFeature[] {\n return (this.searchables || []).filter(i => i.level_id === level_id);\n }\n\n /**\n * Building objects are readonly and cannot be changed\n */\n public async save(): Promise {\n throw new Error('Building objects are readonly and cannot be changed');\n }\n\n /**\n * Building objects are readonly and cannot be deleted\n */\n public async delete(): Promise {\n throw new Error('Building objects are readonly and cannot be deleted');\n }\n}\n","export * from './building.class';\nexport * from './level.class';\nexport * from './organisation.class';\nexport * from './organisation.service';\n","import { HashMap } from 'libs/base/src/lib/types.utilities';\n\n/** Building Level data */\nexport class BuildingLevel {\n /** ID of the building level zone */\n readonly id: string;\n /** ID of the building zone associated with the level */\n readonly building_id: string;\n /** Name of the level */\n readonly name: string;\n /** Number or short identifier of the level */\n readonly short_name: string;\n /** Map URL for the level */\n readonly map_url: string;\n /** Usage type for the level */\n readonly type: 'staff' | 'client' | 'any';\n /** Setting for the level */\n readonly settings: HashMap;\n\n constructor(_data: HashMap = {}) {\n this.id = _data.id || _data.level_id || '';\n this.building_id = _data.bld_id || _data.building_id || '';\n this.name = _data.name || _data.level_name || '';\n const lower_name = this.name.toLowerCase();\n const num = lower_name.indexOf('level') >= 0 ? lower_name.replace(/ ?level ?/gi, '') : lower_name.substr(0, 1).toUpperCase();\n this.short_name = _data.short_name || num || '';\n this.map_url = _data.map_url || '';\n this.type = _data.type || _data.floor_type || 'any';\n this.settings = _data.settings;\n }\n}\n","import { BaseDataClass } from '../base-api.class';\nimport {\n getItemWithKeys,\n HashMap\n} from '@mckinsey-converge/base';\n\n/* istanbul ignore next */\n\nexport class Organisation extends BaseDataClass {\n /** List of available building zone ids for the organisation */\n public readonly available_buildings: readonly string[];\n /** Map of custom settings for the building */\n private _settings: HashMap;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this._settings = raw_data.settings || {};\n this.available_buildings = (raw_data.settings?.discovery_info?.buildings || []).map(\n (bld) => bld.zone_id\n );\n }\n\n /**\n * Get a custom building setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string): any {\n const keys = key.split('.');\n const value = getItemWithKeys(keys, this._settings);\n return value;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { BaseAPIService } from '../base.service';\nimport { Organisation } from './organisation.class';\nimport { Building } from './building.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { BuildingLevel } from './level.class';\nimport { first } from 'rxjs/operators';\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { UsersService } from '../users';\nimport { SettingsService } from '../settings.service';\nimport { Observable, Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OrganisationService extends BaseAPIService {\n /** Organisation data for the application */\n private _organisation: Organisation;\n /** Actively displayed building */\n private _active_building: string;\n\n private _spaceTypesSubject: Subject = new Subject();\n\n constructor(\n protected _composer: ComposerService,\n private _service: ApplicationService,\n private _users: UsersService,\n settingsService: SettingsService,\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(Organisation, this);\n ServiceManager.setService(Building, this);\n this._name = 'Organisation';\n this._api_route = 'zones';\n this.set('buildings', []);\n this.set('active_building', null);\n this._users.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /**\n * Add is not available on organisation service\n */\n public async add(form_data: HashMap, query_params?: HashMap): Promise {\n throw new Error('Add is not available on the organisation service');\n }\n\n /**\n * Update is not available on organisation service\n */\n public async update(\n id: string,\n form_data: HashMap,\n query_params?: HashMap\n ): Promise {\n throw new Error('Update is not available on the organisation service');\n }\n\n /**\n * Delete is not available on organisation service\n */\n public async delete(id: string): Promise {\n throw new Error('Delete is not available on the organisation service');\n }\n\n /**\n * Get list of levels for the given building ID\n * @param bld_id Building ID\n */\n public levels(bld_id: string): readonly BuildingLevel[] {\n return (this.buildings.find((i) => i.id === bld_id) || ({} as Building)).levels;\n }\n\n /**\n * Get a setting from the organisation or active building\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public setting(key: string) {\n return this.building.setting(key) || this._organisation.setting(key);\n }\n\n /** Active building */\n public get building(): Building {\n return this.buildings.find((i) => i.id === this._active_building);\n }\n\n /** List of types of spaces */\n public get space_types(): Identity[] {\n return this.get('space_types') || [];\n }\n\n public set building(bld: Building) {\n if (bld instanceof Building) {\n this._active_building = bld.id;\n } else {\n this._active_building = bld;\n }\n this.set('active_building', this.building);\n this.loadSpaceTypes();\n localStorage.setItem('PlaceOS.building', this._active_building);\n localStorage.setItem('CONCIERGE.timezone', bld.timezone);\n }\n\n /** List of buildings for the organisation */\n public get buildings(): Building[] {\n return this.get('buildings') || [];\n }\n\n /**\n * Get list of available equipment\n * @param id ID of the building to get the list from. i.e. Defaults to the active building\n */\n public getExtras(id: string, bld_id?: string) {\n const bld = this.buildings.find((i) => i.id === bld_id) || this.building;\n if (bld && id) {\n return bld.extras.filter((i) => `${i.id}`.indexOf(id) >= 0);\n }\n return [];\n }\n\n /**\n * Get the first level matching the list of given IDs\n * @param ids List of ID to search with\n */\n public levelWithID(ids: string | string[]): BuildingLevel {\n const list = ids instanceof Array ? ids : [ids];\n const bld_list = this.buildings;\n for (const id of list) {\n for (const bld of bld_list) {\n for (const lvl of bld.levels) {\n if (lvl.id === id) {\n return lvl;\n }\n }\n }\n }\n return null;\n }\n\n /**\n * Initialise service data\n */\n protected async load(): Promise {\n /* istanbul ignore else */\n if (localStorage) {\n this._active_building = localStorage.getItem(`${this.settingsService.frontend.toUpperCase()}.building`);\n }\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.organisation = { message: 'Loading organisation data', state: 'loading' };\n await this.loadOrganisation();\n loading.organisation = { message: 'Loading organisation data', state: 'complete' };\n loading.buildings = { message: 'Loading building data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadBuildings();\n loading.buildings = { message: 'Loading building data', state: 'complete' };\n loading.levels = { message: 'Loading building floor data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadLevels();\n loading.levels = { message: 'Loading building floor data', state: 'complete' };\n this._service.set('loading', loading);\n loading.space_types = { message: 'Loading space type data', state: 'loading' };\n this._service.set('loading', loading);\n await this.loadSpaceTypes();\n loading.space_types = { message: 'Loading space type data', state: 'complete' };\n this._service.set('loading', loading);\n const user = this._users.current;\n\n if (user) {\n const id = localStorage.getItem('PlaceOS.building');\n const building = this.buildings.find(bld => id && bld.id === id) || this.buildings.find((bld) => bld.code === user.location);\n if (building) {\n this._active_building = building.id;\n this.set('active_building', building);\n } else if(this.building) {\n // This conditional solves a problem of infinite loop when user building doesn't exist.\n this._active_building = this.building.id;\n this.set('active_building', this.building);\n }\n }\n }\n\n /**\n * Load organisation data for application\n */\n public async loadOrganisation(): Promise {\n const org_data = await this.query({ tags: 'org', engine: true });\n this._organisation = new Organisation(org_data[0]);\n this.set('organisation', this._organisation);\n return this._organisation;\n }\n\n /**\n * Load building data for the organisation already stored in the service..\n */\n public async loadBuildings(): Promise {\n return this.loadBuildingsWithOrg(this._organisation);\n }\n\n /**\n * Load building data for the organisation passed.\n */\n public async loadBuildingsWithOrg(organisation: Organisation): Promise {\n const bld_data = await this.query({ tags: 'building', engine: true, limit: 1000 });\n const buildings = (bld_data as HashMap[])\n .map((i) => new Building(i))\n .filter((bld) => organisation.available_buildings.includes(bld.id));\n this.set('buildings', buildings);\n /* istanbul ignore else */\n if (!this._active_building && buildings && buildings.length > 0) {\n this._active_building = buildings[0].id;\n }\n return buildings;\n }\n\n /**\n * Load level data for the buildings\n */\n public async loadLevels(): Promise {\n const lvl_data = await this.query({ tags: 'level', engine: true, limit: 1000 });\n const levels = (lvl_data as HashMap[]).map((i) => new BuildingLevel(i));\n this.set('levels', levels);\n return levels;\n }\n\n /**\n * Load space type data for the buildings\n */\n public async loadSpaceTypes(): Promise {\n const type_data = await this.query({ tags: 'room', engine: true, limit: 1000, building_id: this._active_building });\n const types = (type_data as HashMap[]).map((i) => ({ id: i.id, name: i.name }));\n this.set('space_types', types);\n // Emit the updated space_types\n this._spaceTypesSubject.next(types);\n }\n\n /**\n * Observable to listen for changes in space_types\n */\n public get spaceTypesObservable(): Observable {\n return this._spaceTypesSubject.asObservable();\n }\n\n public getOrganizationFiltersByRoomType(key: string) {\n if (!this._organisation) {\n return {}\n }\n const discovery_info = this._organisation.setting('discovery_info')\n\n return discovery_info && discovery_info[key] ? discovery_info[key] : {}\n }\n\n public getRoomTypeSubsetDDOptions(type:string) {\n const filters = this.getOrganizationFiltersByRoomType(type) || {}\n return [...Object.keys(filters).map((key) => {\n const display = filters[key].toString();\n return {\n display,\n value: key,\n meta: {}\n }\n }) ];\n }\n\n\n\n /**\n * The function will generate filter options, excluding London. London has its own set of options as per the request. \n * The filter options pertain to a subset of room type options managed by the room admin module.\n * @returns filterOptions: filter options for day view space type filter\n */\n public getRoomFilterOptionsPerLocation() {\n let internalSubSet = this.getRoomTypeSubsetDDOptions('internal_room_types');\n if(this.building.name.toLowerCase().includes('london')) {\n internalSubSet = internalSubSet.filter(e => !e.value.includes('meeting') && !e.value.includes('partner') );\n }\n const filterOptions = [];\n internalSubSet.forEach(el => filterOptions.push({name: el.display, id: el.value} ) ); \n return filterOptions\n }\n\n}\n","import { ComposerService } from '@placeos/composer';\nimport { BehaviorSubject, Observable, of, Subject, Subscriber } from 'rxjs';\n\nimport { BaseAPIService } from './base.service';\nimport { BaseClass, HashMap } from '@mckinsey-converge/base';\nimport { ApplicationService } from './app.service';\nimport { toQueryString } from './api.utilities';\nimport { SettingsService } from './settings.service';\nimport { catchError, map } from 'rxjs/operators';\n\nexport interface IEngineResponse {\n results: HashMap[];\n total: number;\n}\n\nexport class PaginatedAPIService extends BaseClass {\n /** Application service */\n public parent: ApplicationService;\n /** Display name of the service */\n protected _name: string;\n /** API Route of the service */\n protected _api_route: string;\n /** Map of state variables for Service */\n protected _subjects: { [key: string]: BehaviorSubject | Subject } = {};\n /** Map of observables for state variables */\n protected _observers: { [key: string]: Observable } = {};\n /** Map of poll subscribers for API endpoints */\n protected _subscribers: { [key: string]: Subscriber } = {};\n /** Map of promises for Service */\n protected _promises: { [key: string]: Promise } = {};\n /** Comparison function for service items */\n protected _compare: (a: T, b: T) => boolean = (a, b) =>\n a === b || (a as any).id === (b as any).id;\n /** Default filter function for list method */\n protected _list_filter: (a: T) => boolean = (a) => !!a;\n\n /** Http Client */\n protected get http() {\n return this._composer.http;\n }\n\n constructor(protected _composer: ComposerService,\n protected settingsService: SettingsService) {\n super();\n this._name = 'Base';\n this._api_route = 'base';\n this.set('list', []);\n }\n\n /**\n * Injects concierge into form_data.\n */\n private injectConcierge(form_data: HashMap) {\n // we only send it over when concierge, since the BE may check for presence rather than\n // if its true or not.\n if (this.settingsService.concierge) {\n return { ...form_data, concierge: true }\n }\n return form_data;\n }\n\n /**\n * Initailise service\n */\n public init() {\n this.load().then(\n (_) => this._initialised.next(true),\n (err) => this.timeout('init', () => this.init(), 1000)\n );\n }\n\n /**\n * Get API route for the service\n * @param engine Whether endpoint is using the application API or engine API\n */\n public route(engine: boolean = false) {\n const endpoint = engine\n ? this._composer.auth.api_endpoint\n : '/api/staff';\n return `${endpoint}/${this._api_route}`;\n }\n\n /** API Route of the service */\n public get api_route() {\n return this._api_route;\n }\n\n /**\n * Get the current value of the named property\n * @param name Property name\n */\n public get(name: string): U {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return (this._subjects[name] as BehaviorSubject).getValue();\n }\n\n /**\n * Listen to value change of the named property\n * @param name Property name\n * @param next Callback for value changes\n */\n public listen(name: string): Observable {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }\n\n /**\n * Update the value of the named property\n * @param name Property name\n * @param value New value\n */\n protected set(name: string, value: U): void {\n if (!this._subjects[name]) {\n this._subjects[name] = new BehaviorSubject(value);\n this._observers[name] = this._subjects[name].asObservable();\n } else {\n this._subjects[name].next(value);\n }\n }\n\n /**\n * Get list of loaded items\n * @param predicate Function for filtering the list\n */\n public filter(predicate: (a: T) => boolean = this._list_filter): T[] {\n const list: T[] = this.get('list');\n return list.filter(predicate);\n }\n\n /**\n * Get item with the given id from the loaded items\n * @param id ID of the item\n */\n public find(id: string): T {\n const list = this.get('list');\n return list.find((i) => i.id === id || (i.email?.toLowerCase() === id?.toLowerCase()));\n }\n\n /**\n * Query the index of the API route associated with this service\n * @param query_params Map of query paramaters to add to the request URL\n */\n public query(query_params: HashMap = {}, config: { url?: string } = {}): Promise {\n let engine = false;\n let cache = 1000;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n cache = query_params.cache || 1000;\n delete query_params.cache;\n }\n const query = toQueryString(query_params);\n const key = `query|${query}`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = config && config.url ? `${config.url}${query ? '?' + query : ''}` : `${this.route(engine)}${query ? '?' + query : ''}`;\n let result: IEngineResponse;\n this.http.get(url).subscribe(\n (d: IEngineResponse | HashMap[]) => {\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n },\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), cache);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * \n * @param query_params \n * @param config \n * @returns \n */\n queryHoldingBay(query_params: HashMap = {}, config: { url?: string } = {}):Observable {\n const query = toQueryString(query_params);\n const url = `${config.url}${query ? '?' + query : ''}`;\n return this.http.get(url).pipe(\n map((d: IEngineResponse | HashMap[]) => this.processApiResult(d) ),\n catchError((error: any, result?: T) => {\n console.log(error);\n return of(result as T);\n })\n );\n }\n\n /**\n * \n * @param d \n * @returns \n */\n processApiResult(d: IEngineResponse | HashMap[]): IEngineResponse{\n let result: IEngineResponse;\n if (d && d instanceof Array) {\n const results = d.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else if (d && !(d instanceof Array) && d.results && d.total) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: d.total,\n }\n } else if (d && !(d instanceof Array) && d.results) {\n const results = d.results.map((i) => this.process(i));\n result = {\n results,\n total: results.length,\n }\n } else {\n result = {\n results: [],\n total: 0,\n }\n }\n return result;\n }\n \n\n /**\n * Query the API route for a sepecific item\n * @param id ID of the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public show(id: string, query_params: HashMap = {}): Promise {\n let engine = false;\n /* istanbul ignore else */\n if (query_params) {\n engine = !!query_params.engine;\n delete query_params.engine;\n }\n const query = toQueryString(query_params);\n const key = `show|${id}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const url = `${this.route(engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.get(url).subscribe(\n (d) => {\n result = this.process(d); \n },\n (e) => {\n reject(e);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.timeout(key, () => (this._promises[key] = null), 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make post request for a new item to the service\n * @param form_data Data to post to the server\n * @param query_params Map of query paramaters to add to the request URL\n */\n public add(form_data: HashMap, query_params: HashMap = {}): Promise {\n /* istanbul ignore else */\n if (!this._promises.new_item) {\n this._promises.new_item = new Promise((resolve, reject) => {\n const query = toQueryString(query_params);\n const url = `${this.route(query_params.engine)}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.post(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`create-${this._name.toLowerCase()}-failed`);\n this._promises.new_item = null;\n },\n () => {\n resolve(result);\n this.set('list', this.updateList(this.get('list'), [result]));\n this.analyticsEvent(`create-${this._name.toLowerCase()}-success`);\n this._promises.new_item = null;\n }\n );\n });\n }\n return this._promises.new_item;\n }\n\n /**\n * Perform API task for the given item ID\n * @param id ID of the item\n * @param task_name Name of the task\n * @param form_data Map of data to pass to the API\n * @param method Verb to use for request\n */\n public task(\n id: string,\n task_name: string,\n form_data: HashMap = {},\n method: 'post' | 'get' = 'post'\n ): Promise {\n const query = toQueryString(this.injectConcierge(form_data));\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = { ...form_data, id, _task: task_name };\n const url = `${this.route(false)}/${id}/${task_name}`;\n let result: any;\n const request =\n method === 'post'\n ? this.http.post(url, post_data)\n : this.http.get(`${url}${query ? '?' + query : ''}`);\n request.subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-failed`,\n id\n );\n delete this._promises[key];\n },\n () => {\n resolve(result as U);\n this.analyticsEvent(\n `${this._name.toLowerCase()}-task-${task_name}-success`,\n id\n );\n this.timeout(key, () => delete this._promises[key], 1000);\n }\n );\n });\n }\n return this._promises[key];\n }\n\n\n /**\n * Make put request for changes to the item with the given id\n * @param id ID of the item being updated\n * @param form_data New values for the item\n * @param query_params Map of query paramaters to add to the request URL\n */\n public update(id: string, form_data: HashMap, query_params: HashMap = {}): Promise {\n const key = `update|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(this.injectConcierge(query_params));\n const url = `${this.route(query_params.engine)}/${id}${query ? '?' + query : ''}`;\n let result: T = null;\n this.http.put(url, this.injectConcierge(form_data)).subscribe(\n (d) => (result = this.process(d)),\n (e) => {\n reject(e);\n this.analyticsEvent(`update-${this._name.toLowerCase()}-failed`, id);\n this._promises[key] = null;\n },\n () => {\n resolve(result);\n this.set(\n 'list',\n this.updateList(this.removeItem(this.get('list'), { id } as any), [\n result\n ])\n );\n this.analyticsEvent(`update-${this._name.toLowerCase()}-success`, id);\n this._promises[key] = null;\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Make delete request for the given item\n * @param id ID of item\n */\n public delete(id: string, q: HashMap = {}): Promise {\n const key = `delete|${id}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const query = toQueryString(q);\n const url = `${this.route()}/${id}${query ? '?' + query : ''}`;\n this.http.delete(url).subscribe(\n (_) => null,\n (e) => {\n reject(e);\n this._promises[key] = null;\n },\n () => {\n this.set('list', this.removeItem(this.get('list'), { id } as any));\n this._promises[key] = null;\n resolve();\n }\n );\n });\n }\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n }\n\n /**\n * Post analytics event for this service\n * @param action Name of the action to post\n */\n protected analyticsEvent(action: string, label?: string) {\n // if (this.parent && this.parent.Analytics) {\n // this.parent.Analytics.track(this._name, { desc: `${this.parent.name.toLowerCase()}-${action}`, label });\n // }\n }\n\n /**\n * Convert raw API data into a valid API Object\n * @param raw_item Raw API data\n */\n protected process(raw_item: HashMap): T {\n return raw_item as T;\n }\n\n /**\n * Update recorded list of items\n * @param old_list Old list of items\n * @param list List of updated items\n * @param compareFn Function to compare items to remove duplicates\n */\n public updateList(\n old_list: T[],\n list: T[],\n compareFn: (a: T, b: T) => boolean = this._compare\n ): T[] {\n /* istanbul ignore else */\n if (!list || list.length === 0) {\n return old_list;\n }\n const new_list: T[] = [];\n const mixed_list = [...list, ...old_list];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n for (const item of mixed_list) {\n const found = new_list.find((i) => compareFn(i, item));\n /* istanbul ignore else */\n if (!found) {\n new_list.push(item);\n }\n }\n return new_list;\n }\n\n /**\n * Remove the given item from the given list\n * @param list List of items\n * @param item Item to remove\n * @param compareFn Function to compare items\n */\n protected removeItem(list: T[], item: T, compareFn?: (a: T, b: T) => boolean) {\n const new_list = [];\n /* istanbul ignore else */\n if (!compareFn) {\n compareFn = this._compare;\n }\n list.forEach((i) => (compareFn(item, i) ? null : new_list.push(i)));\n return new_list;\n }\n}\n","import { FormGroup } from \"@angular/forms\";\nimport { HashMap } from \"@mckinsey-converge/base\"\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\"\n\nexport enum RecurrencePeriod {\n LIST = 'list',\n DAILY = 'daily',\n WEEKLY = 'weekly',\n //RELATIVE_MONTHLY = 'relativeMonthly', for the moment we will only support absoluteMonthly\n ABSOLUTE_MONTHLY = 'monthly'\n}\n\nexport enum DaysOfWeek {\n SUNDAY = 'sunday',\n MONDAY = 'monday',\n TUESDAY = 'tuesday',\n WEDNESDAY = 'wednesday',\n THURSDAY = 'thursday',\n FRIDAY = 'friday',\n SATURDAY = 'saturday'\n\n}\n\nexport enum SeriesAction {\n EDIT = 'edit',\n CLONE = 'clone'\n}\n\nexport enum BookingAction {\n CLONE = 'booking_clone',\n EDIT = 'booking_edit'\n}\n\nexport interface WeekDays {\n id: string;\n active: boolean;\n day_index: number;\n full_name: string;\n}\n\nexport interface RepeatPeriod {\n id: RecurrencePeriod;\n label: string\n}\n\nexport enum RepeatsOn {\n PATTERN = 'pattern',\n DATE = 'date'\n}\n\nexport interface RecurrenceType {\n type: RepeatsOn;\n label: string;\n}\n\nexport interface RecurrenceDetails {\n period: RecurrencePeriod,\n end: DateTZ,\n list: Array\n interval: number\n}\n\nexport interface RecurrenceRecurringDetails extends RecurrenceDetails {\n start: number\n}\n\nexport const recurrencePeriodToDurationType = (period: RecurrencePeriod) =>{\n switch (period) {\n case RecurrencePeriod.DAILY:\n return 'days'\n case RecurrencePeriod.WEEKLY:\n return 'weeks' \n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return 'months' \n default:\n return 'days'\n }\n}\n\n/**\n * Generate weekdays from monday to saturday\n */\nexport const generateWeekDays = (date: number, params: { building_tz?: string } = {}): Array=> {\n const { building_tz } = params;\n let start_week = DateNow(new Date()).startOfValue('week').addValue({days : 1}); //set monday as start of week\n const week_days: Array = []\n for (let i = 1; i <= 7; i++) {\n const activeDate = new DateTZ({date, building_tz, is_local_tz: false })\n const active = activeDate.dateWeekday === i\n const full_name = start_week.formatDate('EEEE')\n const day_index = i === 7 ? 0 : i //Sunday must be indexed as day 0\n week_days.push({id: full_name.substring(0, 1), active, day_index, full_name: full_name.toLocaleLowerCase()});\n start_week = start_week.addValue({ days : 1 });\n }\n return week_days\n}\n\nexport const getFirstDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isBeforeDate(b) ? a : b; });\n}\n\nexport const getLastDateFromList = (list: Array) => {\n return list.reduce((a, b) => { return a.isAfterDate(b) ? a : b; });\n}\n\nexport const recurrenceDetails = (recurr: RecurrenceDetails): string => {\n const end = getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `Occurs Every ${period} until ${end}`\n }else{\n return `Occurs Every ${recurr.interval} ${period}s until ${end}`\n }\n } \n \n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `Occurs on Specific Dates until ${getLastDateFromList(recurr.list).formatDate('ccc dd MMM yyyy')}`\n default:\n return ''\n }\n}\n\nexport const recurrenceRecurringDetails = (recurr: RecurrenceRecurringDetails): string => {\n const end = recurr.end\n const start = new DateTZ({ date: recurr.start })\n\n const getPeriod = (period: string) => {\n if(recurr.interval === 1){\n return `occurs every ${period} effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }else{\n return `occurs every ${recurr.interval} ${period}s effective ${start.formatDate('dd MMM yyyy')} until ${end.formatDate('dd MMM yyyy')}`\n }\n }\n\n switch (recurr.period) {\n case RecurrencePeriod.DAILY:\n return getPeriod('Day')\n case RecurrencePeriod.WEEKLY:\n return getPeriod('Week')\n case RecurrencePeriod.ABSOLUTE_MONTHLY:\n return getPeriod('Month')\n case RecurrencePeriod.LIST:\n return `occurs on Specific Dates`\n default:\n return ''\n }\n}\n\nexport const handleRecurrenceFields = (data: HashMap) => {\n if(data.is_recurrent){\n if(data.recurrence_period !== RecurrencePeriod.LIST){\n delete data.recurrence_starts\n delete data.recurrence_endTz\n if(data.recurrence_period !== RecurrencePeriod.WEEKLY){\n delete data.recurrence_days\n }\n } else if(data.recurrence_period){\n data.recurrence_list = [...(data.recurrence_starts || []).map((date: DateTZ) => date.startOfValue('minute').seconds)]\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.recurrence_days\n }\n delete data.is_recurrent\n }else{\n delete data.recurrence_period;\n delete data.recurrence_interval;\n delete data.recurrence_endTz;\n delete data.recurrence_count;\n delete data.recurrence_starts\n delete data.is_recurrent\n delete data.recurrence_exceptions\n delete data.recurrence_days\n }\n\n return data\n}\n\n/** Removes expired occurrences and updates start and end dates when cloning a series */\nexport const removeExpiredOcurrences = (form: FormGroup) =>{\n if(form.controls.action?.value === SeriesAction.CLONE ){\n const tz = form.controls.space_list.value[0].timezone\n const date_now = new DateTZ({ is_local_tz: false, building_tz: tz });\n const occurrences = form.controls.recurrence_starts.value.filter((date: DateTZ) =>\n date_now.isBeforeDate(date, 'day') || date_now.isSameDate(date, 'day')\n )\n form.controls.recurrence_starts.setValue(occurrences)\n const { start, end } = setStartAndEndDateFromArray(occurrences, tz)\n form.controls.dateTz.setValue(start)\n form.controls.recurrence_endTz.setValue(end)\n }\n}\n\n/** \n * Returns starts and end dates from an array of dates in milliseconds \n **/\n export const setStartAndEndDateFromArray = (dates: Array, tz: string): {start: DateTZ, end: DateTZ} =>{\n if(dates.length !== 0){\n return {\n start: dates.sort((d1, d2) => d1.ms - d2.ms)[0] ,\n end: dates.sort((d1, d2) => d2.ms - d1.ms)[0]\n }\n }\n //if the dates array is empty set the start and end dates as the current and next day\n const now = DateNow(new Date()).toZone(tz)\n return {start: now, end: now.addValue({days: 1})}\n}\n\nexport const setRecurrenceStartsTime = (form: FormGroup) => {\n const { recurrence_starts, dateTz } = form.value\n const list = (recurrence_starts || []).map((date: DateTZ) => date.setValue({hour: dateTz.dateHour, minute: dateTz.minutes}))\n form.controls.recurrence_starts.setValue(list)\n}","export * from './report.class'\nexport * from './reports.service'\n","import { CurrencyPipe } from '@angular/common';\n\nimport {\n csvToJson,\n downloadFile,\n HashMap,\n humaniseDuration,\n jsonToCsv,\n} from '@mckinsey-converge/base';\n\nimport { ServiceManager } from '../service-manager.class';\nimport { Space } from '../spaces';\nimport { Organisation } from '../organisation';\n\nexport class Report {\n /** Type of report */\n public readonly type: string;\n /** List of data associated with the report */\n public readonly data: T[];\n\n constructor(raw_data: HashMap = {}) {\n this.type = raw_data.type || '';\n this.data = this.cleanData(raw_data.data);\n }\n\n /** Create report data structure from CSV */\n public static fromCSV(type: string, data: string): Report {\n const csv_json = csvToJson(data);\n return new Report({ type, data: csv_json });\n }\n\n /** Download report data as CSV format */\n public downloadCSV(name: string = 'unnamed.csv'): void {\n downloadFile(name, jsonToCsv(this.data));\n }\n\n /** Download report data as JSON format */\n public downloadJSON(name: string = 'unnamed.json'): void {\n downloadFile(name, JSON.stringify(this.data, undefined, 4));\n }\n\n public formatCancelledBy(email: string) {\n if (email !== null && email !== undefined) {\n let name = email.split('@')[0];\n name = name.split('_').join(' '); //get name from email and convert it to title case\n name = name.replace(/\\w\\S*/g, function (txt) {\n return `${txt\n .charAt(0)\n .toUpperCase()}${txt.substr(1).toLowerCase()}`;\n });\n return name;\n } else {\n return email;\n }\n }\n\n public timeConverter( UNIX_timestamp: number ){\n if(!UNIX_timestamp) return '';\n let a = new Date(UNIX_timestamp * 1000);\n let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n let year = a.getFullYear();\n let month = months[a.getMonth()];\n let date = a.getDate();\n let hour = ((a.getHours() + 11) % 12 + 1);\n let suffix = a.getHours() >= 12 ? \"PM\":\"AM\";\n let min = a.getMinutes() === 0 ? '00':a.getMinutes();\n let time = date + ' ' + month + ' ' + year + ' - ' + hour + ':' + min + ' ' + suffix;\n return time;\n }\n\n private cleanData(data: T[] = []) {\n if (data.length > 0 && this.type === 'day') {\n for (let i = 0; i < data.length; i++) {\n data[i]['booker'] = data[i]['booker'].name;\n data[i]['expected_attendees'] = Object.values(data[i]['expected_attendees'])[0];\n }\n } else if (data.length > 0 && this.type === 'audit') {\n for (let i = 0; i < data.length; i++) {\n data[i]['created_at'] = this.timeConverter(data[i]['created_at']);\n }\n } else if (data.length > 0 && this.type === 'catering') {\n for (let i = 0; i < data.length; i++) {\n data[i]['Cancelled By'] = this.formatCancelledBy(\n data[i]['Cancelled By']\n );\n }\n const fields = Object.keys(data[0]);\n const room_field = fields.find(\n (key) =>\n key.toLowerCase().includes('room') &&\n key.toLowerCase().includes('email')\n );\n const price_field = fields.find((key) =>\n key.toLowerCase().includes('price')\n );\n\n for (let row of data) {\n /* istanbul ignore else */\n const space_service = ServiceManager.serviceFor(Space);\n if (room_field && price_field && space_service) {\n const room = space_service.find(\n row[room_field].toLowerCase()\n );\n const org_service = ServiceManager.serviceFor(Organisation);\n const bld = org_service.buildings.find(\n (bld: { id: any }) =>\n bld.id === room?.level?.building_id\n );\n row[price_field] = new CurrencyPipe('en_us').transform(\n row[price_field] / 100,\n bld?.currency\n );\n }\n /* istanbul ignore else */\n for (let field of fields) {\n row[field] =\n typeof row[field] === 'string'\n ? row[field].replace(/\\,/g, '٫')\n : row[field];\n }\n }\n } else if (this.type === 'bookings') {\n data = data.map((i: HashMap) => {\n const booking = i;\n try {\n if (booking.setup instanceof Object) {\n booking.setup = booking.setup[booking.room_email];\n }\n if (booking.breakdown instanceof Object) {\n booking.breakdown =\n booking.breakdown[booking.room_email];\n }\n booking.setup = humaniseDuration((booking.setup || 0) / 60);\n booking.breakdown = humaniseDuration(\n (booking.breakdown || 0) / 60\n );\n booking.description = (booking.description || '')\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ');\n booking['Meeting Host'] =\n booking.organizer?.name || booking.organizer;\n booking['Booked By'] =\n booking.booked_by?.name ||\n booking.booked_by?.email ||\n '';\n booking.charge_code =\n booking.equipment_codes[booking.room_email] || '';\n // booking.expected_attendees = Object.keys(booking.expected_attendees).map(key => booking.expected_attendees[key]).join(', ');\n booking.attendees = (booking.attendees || [])\n .map((person) => person.name || person.email || person)\n .join('٫ ');\n booking.notes = (booking.notes || [])\n .map((note) =>\n note.author &&\n (note.type === 'description' ||\n note.type === 'private')\n ? `[${note.author}|${note.type}]${note.message\n .replace(/<[^>]*>?/gm, '')\n .replace(/\\,/g, '٫')\n .replace(/\\r?\\n|\\r/g, ' ')}`\n : ''\n )\n .join(' | ');\n booking.cancelled = booking.isCancelled;\n booking.status = booking.status[booking.room_email] || '';\n booking.company = booking.company.join(', ');\n if (booking.cancelled_by) {\n booking.cancelled_by = this.formatCancelledBy(\n booking.cancelled_by\n );\n }\n booking.cancelled_date = this.timeConverter(booking.cancelled_at_epoch);\n\n } catch (e) {}\n const remove_fields = [\n 'id',\n 'icaluid',\n 'accepted_at',\n 'accepted_by',\n 'check_ins',\n 'changeKey',\n 'created',\n 'booking_type',\n 'edit_history',\n 'end_epoch',\n 'old_attendees',\n 'start_epoch',\n 'expected_attendees',\n 'isAllDay',\n 'isCancelled',\n 'body',\n 'is_free',\n 'lastModifiedDateTime',\n 'locationType',\n 'locations',\n 'organizer',\n 'booked_by',\n 'originalEndTimeZone',\n 'originalStartTimeZone',\n 'room_booking_status',\n 'room_email',\n 'room_emails',\n 'room_id',\n 'sensitivity',\n 'seriesMasterId',\n 'show_as',\n 'notes',\n 'subject',\n 'type',\n 'previous_booking',\n 'catering',\n 'responseStatus',\n 'equipment_codes',\n 'cancelled_at_epoch',\n ];\n for (const field of remove_fields) {\n if (booking[field] !== undefined) {\n delete booking[field];\n }\n }\n const output = {};\n const order = [\n 'title',\n 'start',\n 'end',\n 'location',\n 'Meeting Host',\n 'Booked By',\n 'booked_at',\n 'booked_ahead_by',\n 'all_day',\n 'attendees',\n 'company',\n 'description',\n 'cancelled',\n 'cancelled_by',\n 'cancelled_date',\n ];\n const keys = Object.keys(booking);\n keys.sort((a, b) => {\n const idx_a = order.indexOf(a);\n const idx_b = order.indexOf(b);\n return (\n (idx_a === -1 ? keys.length : idx_a) -\n (idx_b === -1 ? keys.length : idx_b)\n );\n });\n for (const key of keys) {\n output[key] = booking[key];\n }\n return output;\n }) as any;\n }\n return data;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { ComposerService } from '@placeos/composer';\n\nimport { Report } from './report.class';\nimport { BaseAPIService } from '../base.service';\nimport { SettingsService } from '../settings.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ReportsService extends BaseAPIService {\n constructor(protected _composer: ComposerService,\n settingsService: SettingsService) {\n super(_composer, settingsService);\n this._name = 'Reports';\n this._api_route = 'reports';\n }\n\n protected process(raw_data: any): Report {\n return raw_data instanceof Array\n ? new Report({ data: raw_data })\n : Report.fromCSV('', raw_data);\n }\n}\n","import { Type } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { HashMap } from '@mckinsey-converge/base';\n\n\nexport interface ServiceLike extends HashMap {\n parent: any;\n add: (_: HashMap) => Promise;\n update: (id: string, _: HashMap) => Promise;\n delete: (id: string, params?: HashMap) => Promise;\n task: (id: string, name: string, data: HashMap) => Promise;\n listen: (prop: string) => Observable;\n}\n\nexport interface ServiceProvider {\n provideFor: Type;\n useValue: T;\n}\n\nexport class ServiceManager {\n /** Map of available services for child classes */\n private static _service_list: ServiceProvider[] = [];\n\n /** Set the services used to handle data model requests */\n public static setService(type: Type, service: any): void {\n if (window.debug) {\n (window as any).ServiceManager = this._service_list;\n }\n const index = ServiceManager._service_list.findIndex(provider => provider.provideFor === type);\n if (index >= 0) {\n ServiceManager._service_list.splice(index, 1, { provideFor: type, useValue: service });\n } else {\n ServiceManager._service_list.push({ provideFor: type, useValue: service });\n }\n }\n\n /** Get the services used to handle data model requests */\n public static serviceFor(type: Type): ServiceLike {\n const provider = ServiceManager._service_list.find(provider => provider.provideFor === type) || { useValue: null };\n return provider.useValue;\n }\n\n constructor() {\n throw new Error('ServiceMananger is static class');\n }\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\n\nimport { VERSION } from '@mckinsey-converge/environment';\nimport {\n BaseClass,\n getItemWithKeys,\n HashMap,\n log\n} from '@mckinsey-converge/base';\nimport { ServiceManager } from './service-manager.class';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ndeclare global {\n interface Window {\n debug: boolean;\n }\n}\n\nexport const SETTINGS_TOKEN = 'settings_service_data';\n\ntype SettingsAppData = T & {\n title: string;\n description: string;\n short_name: string;\n logo_light: {\n type: string;\n src: string;\n background: string;\n }\n logo_dark: {\n type: string;\n src: string;\n background: string;\n }\n heap_io: {\n app_id: number;\n force_ssl: boolean;\n secure_cookie: boolean;\n disable_text_capture: boolean;\n cookie_path: string;\n }\n}\n\nexport interface SettingsData {\n debug: boolean;\n mock: boolean;\n frontend: 'staff' | 'concierge' | 'booking';\n composer: {\n domain: string;\n route: string;\n protocol: string;\n port: string;\n use_domain: boolean;\n local_login: boolean;\n }\n app: SettingsAppData;\n}\n\nexport class SettingsObject {\n constructor(public data: SettingsData) {\n }\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SettingsService extends BaseClass {\n /** Name of the application */\n private _app_name = 'Converge';\n /** List of override settings in order of priority */\n private _overrides = new BehaviorSubject([]);\n /** Mapping of behaviour subjects */\n private _subjects: HashMap> = {};\n /** Mapping of observables */\n private _observables: HashMap> = {};\n /** Which frontend we're in. staff, concierge, or bookings **/\n public readonly frontend: string;\n private _bypass_bookings: boolean = false;\n\n /**\n * @hidden\n */\n public set overrides(value: HashMap[]) {\n this._overrides.next(value);\n }\n\n /** Get observable for key */\n public listen(name: string): Observable {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n return this._observables[name];\n }\n\n /** Update observable value for key */\n public post(name: string, value: T): void {\n if (!this._observables[name]) {\n this._subjects[name] = new BehaviorSubject(null);\n this._observables[name] = this._subjects[name].asObservable();\n }\n this._subjects[name].next(value);\n }\n\n public value(name: string): T {\n return !this._observables[name] ? null : this._subjects[name].getValue();\n }\n\n /** Page title */\n public get title() {\n return this._title.getTitle();\n }\n\n public set title(value: string) {\n this._title.setTitle(`${value} | ${this._app_name}`);\n }\n\n constructor(private _title: Title,\n @Inject(SETTINGS_TOKEN)\n private settings: SettingsObject) {\n super();\n ServiceManager.setService(SettingsService, this);\n const time = new DateTZ({date: VERSION.time});\n const built = DateNow(new Date()).isSameDate(time, 'day')\n ? `Today at ${time.formatDate('h:mma')}`\n : time.formatDate('do MMM yyyy, h:mma');\n const frontend = this.get('frontend') || 'Unknown';\n this.frontend = frontend;\n log('CORE', `${VERSION.semver}`, null, 'debug', true, frontend?.toUpperCase());\n log('APP', `${VERSION.hash} | Built: ${built}`, null, 'debug', true, frontend?.toUpperCase());\n this.init();\n }\n\n /**\n * Initialise the settings\n */\n public async init() {\n if (this.get('debug')) {\n window.debug = true;\n }\n if (this.get('app')?.name) {\n this._app_name = this.get('app').name;\n }\n log('Settings', 'Successfully loaded settings');\n this._initialised.next(true);\n }\n\n /** Whether settings service has initialised */\n public get app_name() {\n return this._app_name;\n }\n\n public get concierge() {\n return this.frontend === 'concierge';\n }\n\n public set bypass_bookings(value: boolean) {\n this._bypass_bookings = value;\n }\n\n public get bypass_bookings() {\n return this._bypass_bookings;\n }\n\n /**\n * Get a setting\n * @param key Name of the setting. i.e. nested items can be grabbed using `.` to seperate key names\n */\n public get(key: string): any {\n const keys = key.split('.');\n if (keys[0] !== 'app') {\n return getItemWithKeys(keys, this.settings.data);\n }\n const override_settings = this._overrides.getValue();\n for (const override of override_settings) {\n const value = getItemWithKeys(keys.slice(1), override);\n if (value != null) {\n return value;\n }\n }\n return getItemWithKeys(keys, this.settings.data);\n }\n}\n","export * from './space.class';\nexport * from './spaces.service';\nexport * from './space.utilities';\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n} from '@mckinsey-converge/base';\nimport {\n Building,\n BuildingLevel,\n Organisation\n} from '../organisation';\nimport { User } from '../users';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { SpaceRules } from '../bookings/booking.types';\nimport { rulesForSpace } from '../bookings/space.utilities';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DaysOfWeek, RecurrencePeriod } from '../recurrence/recurrence.utils';\nimport { DateTime } from 'luxon';\n\nexport interface ISpaceAvailabilityOptions {\n /** Start date and time of the availability block */\n dateTz?: DateTZ;\n /** Length of the availability block */\n duration: number;\n /** */\n id?: string;\n /** List of spaces to look at the availability for */\n room_ids?: string;\n /** Whether the spaces looked at should be bookable */\n bookable?: boolean;\n /** List of spaces or zones to ignore */\n ignore?: string;\n /** List of zones to look at the availability for */\n zone_ids?: string | string[];\n /** Whether space bookings should not be returned */\n hide_bookings?: boolean;\n /** Min capacity on the room **/\n capacity?: number\n clear?: boolean;\n /** Length of the setup */\n setup?: number;\n /** Length of the breakdown */\n breakdown?: number;\n /** Hide declined bookings */\n hide_declined?: boolean;\n /** Max capacity on the room **/\n capacity_max?: number\n\n diff_capacity?: boolean\n\n /** Fields to include recurrence in the availability search */\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array\n is_recurrent?: boolean\n is_multiroom?: boolean\n merged?: boolean\n recurrence_days?: Array\n}\n\nexport interface SpaceBookingRuleOptions {\n dateTz: DateTZ;\n duration: number;\n host: User;\n}\n\nexport const OPTION_DEFAULTS: ISpaceAvailabilityOptions = {\n duration: 60\n};\n\nexport interface RecurrenceAvailability {\n /** Unix epoch in seconds */\n readonly date: number;\n /** Whetehr space is available at this time */\n readonly available: boolean;\n}\n\n/**\n * Room Settings Type\n *\n * Exmaple:\n * available: true\n * available_until: 1644344999\n * bookings: []\n * catering: false\n * charge_code: false\n * extra_features: \"meeting_room boardroom\"\n * internal_or_external: \"internal\"\n * map_id: \"08.8.15\"\n * natural_light: false\n * room_booking_screen: true\n * room_name: \"8.15 Meeting\"\n * vc: false\n * recurrence_availability: {\n * date: \"1642596300\",\n * available: false,\n * }\n */\nexport interface RoomSettings {\n // Local room name is required.\n room_name?: string\n // TBD if anything else should be required\n available?: boolean\n available_until?: number\n bookings?: HashMap[]\n catering?: boolean\n charge_code?: boolean\n extra_features?: string\n internal_or_external?: string\n map_id?: string\n natural_light?: boolean\n room_booking_screen?: boolean\n vc?: boolean\n recurrence_availability?: RecurrenceAvailability[]\n equipment_code?: boolean\n external?: boolean\n}\n\n/**\n * List of space features that come from settings.\n *\n * Im sure this list will grow. It is not the most comprehensive list.\n */\nexport enum SpaceFeatures {\n BoardRoom = 'boardroom',\n Catering = 'catering',\n CocktailRoom = 'cocktail',\n ConferencePhone = 'conference_phone',\n ConferenceRoom = 'conference',\n ElectronicWhiteboard = 'whiteboard',\n FlipChart = 'flipchart',\n Glassboard = 'glassboard',\n PartnerOffice = 'partner',\n PhoneBooth = 'phone_booth',\n TheatreRoom = 'theatre',\n TeamRoom = 'team_room',\n VideoConference = 'vc',\n NaturalLight = 'natural_light',\n WirelessContentSharing = 'wireless_content_sharing',\n WorkshopRoom = 'workshop',\n UShapeRoom = 'u_shape',\n Miscellaneous = 'miscellaneous'\n}\n\nexport enum SpaceEquipments {\n conference_phone,\n whiteboard,\n vc,\n flipchart,\n glassboard,\n wireless_content_sharing\n}\nexport enum SpaceStyles {\n boardroom,\n cocktail,\n conference,\n partner,\n theatre,\n team_room,\n // natural_light,\n workshop,\n u_shape,\n miscellaneous\n}\n\nconst EMPTY_ARRAY = [];\n\nexport class Space extends BaseDataClass {\n /** Whether space can be booked by users */\n public readonly bookable: boolean;\n /** People capacity of the space */\n public readonly capacity: number;\n /** Index to force order when sorting multiple spaces */\n public readonly sort_priority: number;\n /** Settings has extensive info displayed in the app. */\n public readonly settings: RoomSettings;\n /** URL for the control interface of the space */\n public readonly support_url: string;\n /** Engine zones associated with the space */\n public readonly zones: readonly string[];\n /** Is the Application concierge */\n public is_concierge: boolean = false;\n /** To allow bookings with rooms for staff calendar view only */\n public allowStaffRoomWithBookings: boolean = false;\n\n /** Simple name == local name being using in seeting.room_name\n\t\t *\n\t\t*/\n public simple_name: string;\n\n /** Room style set of all room style one room has\n * [\"boardroom\", \"cocktail\", \"miscellaneous\", \"natural_light\", \"theatre\", \"u-shape\", \"workshop\"] */\n public room_style: string[] = [];\n\n /** Equipment set of all room equipment one room has\n * [\"conference_phone\", \"whiteboard\", \"vc\", \"flipchart\", \"glassboard\", \"whiteboard\", \"wireless_content_sharing\"] */\n public equipment: string[] = [];\n\n /** Filters has charge code settings for booking and catering */\n public filters: RoomSettings;\n\n /** room_type subset of internal or external rooms */\n public room_type: string[] | string;\n /**\n * Features used in identifying room types.\n *\n * Both features and extra_features are space delimited strings.\n *\n * There is a getter featuresArray that returns the\n * combination of the two as an array.\n */\n public readonly features: string;\n public readonly extra_features: string;\n public map_id: string;\n\n\n /** Service for managing spaces */\n protected get _service() {\n return ServiceManager.serviceFor(Building);\n }\n\n /** Return the rooms' building */\n public get building() {\n return this._service?.buildings.find((bld) => {\n return this.zones.includes(bld.id);\n });\n }\n\n /** Return building timezone */\n public get timezone() {\n return this.building?.timezone;\n }\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n\n // Needed to check if the current app is Concierge or Staff\n const settingsService = ServiceManager.serviceFor(SettingsService) as unknown as SettingsService;\n this.is_concierge = !!settingsService?.concierge;\n this.allowStaffRoomWithBookings = settingsService?.bypass_bookings || false;\n\n const defaultGlobalName = raw_data.name || raw_data.email || 'Meeting Room';\n const defaultSettings = {\n room_name: defaultGlobalName\n }\n /**\n * Duplicate of base-api.class just for readability\n * .name is the full, mckinsey standardised name of the room.\n * You can think of it was what people would call the room when\n * considering every office and room globally.\n *\n * this.name = raw_data.name;\n */\n /**\n * Settings has extensive info displayed in the app.\n * setting.room_name is always used when displaying the room name in the applications\n * setting.room_name is the more office-specific room name, you can think of this as\n * the one people in that office would refer to the room as.\n *\n */\n this.settings = raw_data.settings || defaultSettings;\n this.filters = raw_data?.filters;\n // Room fields\n this.bookable = raw_data.bookable || false;\n this.capacity = raw_data.capacity || 0;\n this.support_url = raw_data.support_url;\n this.zones = raw_data.zones instanceof Array ? raw_data.zones : [];\n // Feature fields\n this.features = raw_data.features || '';\n this.extra_features = raw_data.settings?.extra_features || '';\n\n\t\tthis.room_type = raw_data?.room_type;\n this.simple_name = raw_data?.simple_name;\n this.map_id = raw_data?.map_id || raw_data.settings?.map_id || '';\n this.room_style = raw_data?.room_style || [];\n this.equipment = raw_data?.equipment || [];\n\n }\n\n /**\n * Return the global room name\n * IE LDN-4-408-06\n */\n public get global_name(): string {\n return this.name || ''\n }\n\n /**\n * Return the local room name\n * i.e. 4.08\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.room_name\n */\n public get local_name(): string {\n return this.simple_name || this.name || ''; // this.settings?.room_name\n }\n\n public get street_and_city(): string {\n return this.building ? `${this.building.address}, ${this.building.city}` : '';\n }\n\n /**\n * Return the map_id from settings\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.map_id and use map_id from space modal( after testing over prod)\n */\n // public get map_id(): string {\n // return this?.map_id || this.settings?.map_id || '';\n // }\n\n /** Internal / External status */\n public get internal_or_external(): string {\n const external = this.filters?.external;\n return external ? 'external' : 'internal'; // ( external ? 'external' : this.settings?.internal_or_external ) || 'internal';\n }\n\n /**\n * Works in conjunction with available_until.\n *\n * If a room is bookable that only means you can make a booking but not when.\n * Available indicates that it is available to be booked durring the queried times.\n */\n public get available(): boolean {\n return this.settings?.available ?? false;\n }\n\n public get currently_in_use(): boolean {\n const nowMs = new DateTZ({ date: DateTime.now(), is_local_tz: false, building_tz: this.timezone }).ms;\n const runningBookings = this.settings?.bookings?.filter( bks => {\n const startEpoch = new DateTZ({ date: bks.start_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n const endEpoch = new DateTZ({ date: bks.end_epoch * 1000, is_local_tz: false, building_tz: bks.timezone}).ms;\n return startEpoch <= nowMs && endEpoch >= nowMs;\n })\n // console.log(raw_data.settings.room_name+' : '+ nowMs.ms);\n // console.log('IS IN USER CURRENTLY : ', isinUsernow);\n return !!runningBookings.length;\n }\n\n /** Last returned availability time */\n public get available_until(): number {\n return this.settings?.available_until;\n }\n\n /** Bookings associated with the space */\n public get bookings(): HashMap[] {\n // We should need to care if a room as bookings in Staff\n if (!this.is_concierge && !this.allowStaffRoomWithBookings) {\n return EMPTY_ARRAY;\n }\n\n if (this.settings?.bookings?.length) {\n /**\n * When we're dealing with Concierge the API data arriving is rooms, and those rooms contain booking,\n * but those bookings don't contain a room since the room is the root.\n * In order for Concierge to filter bookings by room we need to reattach this room\n * to each of the bookings, with it's own bookings.\n *\n * It's loopy and kooky but correcting for this pattern is beyond the scope of this refactor.\n */\n const spaceWithBookings = new Space(this.toJSON());\n return this.settings?.bookings.map(b => {\n b.room = spaceWithBookings;\n return b;\n });\n }\n return EMPTY_ARRAY;\n }\n\n /**\n\t\t * Whether space has catering\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove seetings.catering and use filters?.catering instead\n\t\t */\n public get has_catering(): boolean {\n return this.filters?.catering || this.settings?.catering || false;\n }\n\n /** Returns an array of the space delimited feature and extra_feature strings.\n * TO DO: ROOM-DATA-STRUCTURE-REFACTOR - stop using/remove features, extra_features\n */\n public get featuresArray(): (SpaceFeatures | string)[] {\n // (this.simple_name === \"Entresol M-06\" ) && console.log('raw_data : ', this)\n const roomType = Array.isArray(this.room_type) ? this.room_type : [this.room_type]\n const features = [\n ...this.features.split(' '),\n ...this.extra_features?.split(' '),\n\n ...roomType, // required to work with staff>result>filters\n ...this?.room_style,\n ...this?.equipment,\n\n (this.filters?.natural_light) && SpaceFeatures.NaturalLight || undefined, // || this.settings?.natural_light\n // this.settings?.natural_light && SpaceFeatures.NaturalLight || undefined,\n // this.settings?.vc && SpaceFeatures.VideoConference || undefined,\n ].filter(f => !!f).map(f => f.toLowerCase());\n //will be an array... new Set() turns it into a set, but [... ] turns it back into an array again\n return [ ...new Set(features) ];\n }\n\n /** Level in which the space is associated */\n public get level(): BuildingLevel {\n const service = ServiceManager.serviceFor(Organisation);\n return (service ? service.levelWithID(this.zones as any) : null) || new BuildingLevel({});\n }\n\n /**\n * Return the new recurrence_availability from settings\n */\n public get recurrence_availability(): RecurrenceAvailability[] {\n return this.settings?.recurrence_availability || [];\n }\n\n public get availableOccurrences(): number {\n if(this?.recurrence_availability) {\n return this?.recurrence_availability?.filter(recurr => recurr.available).length;\n }\n }\n\n public get totalOccurrences(): number {\n return this?.recurrence_availability.length;\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): Space {\n return new Space(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): Space {\n const space = { ...this };\n space.settings.bookings = []; // clear out bookings\n return new Space({ ...space, id: null, email: null });\n }\n\n /**\n * Generate the booking rules for space with given options\n * @param options Conditions for generating the space rules\n */\n public rulesFor(options: SpaceBookingRuleOptions): SpaceRules {\n if (!this._service || !this.level) {\n return { auto_approve: true, hide: false };\n }\n\n const building = this.is_concierge ? this.level.building_id : this.building\n\n if (!building) {\n return { auto_approve: true, hide: false };\n }\n const { dateTz, duration, host } = options;\n const rules: SpaceRules = rulesForSpace({\n time: dateTz.ms,\n duration,\n space: this,\n user: host,\n rules: building.booking_rules\n });\n return rules;\n }\n\n /**\n * Whether space can only be booked by request\n * @param options Conditions for checking the space rules\n */\n public byRequest(options: SpaceBookingRuleOptions) {\n const rules = this.rulesFor(options);\n return !rules.auto_approve;\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: Space): HashMap {\n return { ...super.toJSON(), settings: { ...this.settings, bookings: [] }, filters: { ...this.filters }, equipment: [ ...this.equipment] };\n }\n}\n","import { HashMap } from '@mckinsey-converge/base';\nimport {\n ISpaceAvailabilityOptions,\n Space\n} from './space.class';\nimport { Building } from '../organisation/building.class';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { handleRecurrenceFields, RecurrencePeriod } from '../recurrence/recurrence.utils';\n\nexport function availabilityOptionsToQuery(options: ISpaceAvailabilityOptions): HashMap {\n let query: HashMap = {};\n if (options) {\n query = { ...options };\n if (options.dateTz) {\n const date = options.dateTz.startOfValue('minute');\n query.available_from = date.seconds; // Add one second or API will not allow end to end booking\n query.available_to = date.addValue({ minutes: options.duration || 60 }).subtractValue({ seconds: 1 }).seconds;\n\n if (options.setup) query.setup = options.setup ;\n if (options.breakdown) query.breakdown = options.breakdown;\n \n delete query.dateTz;\n delete query.duration;\n }\n\n if (!options.capacity_max) delete query.capacity_max\n\n if (options.hide_declined) query.hide_declined = options.hide_declined;\n query = handleRecurrenceFields(query)\n }\n return query;\n}\n\n/**\n * Compare two spaces to determine order\n * @param first\n * @param second\n */\nexport function sort(first: Space, second: Space, blds: Building[] = []) {\n const bld = blds.find(bld => first.zones.includes(bld.id));\n const bld_b = blds.find(bld => second.zones.includes(bld.id));\n if (bld) {\n if (bld !== bld_b) {\n return (bld.name).localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = first.zones.indexOf(zone_id) >= 0;\n const b_has_zone = second.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n }\n return first.name.localeCompare(second.name);\n}\n","import { Injectable } from '@angular/core';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { BaseAPIService } from '../base.service';\nimport { ISpaceAvailabilityOptions, Space } from './space.class';\nimport { ApplicationLoadingState, HashMap } from '@mckinsey-converge/base';\nimport { availabilityOptionsToQuery } from './space.utilities';\nimport { ServiceManager } from '../service-manager.class';\nimport { OrganisationService } from '../organisation';\nimport { ApplicationService } from '../app.service';\nimport { SettingsService } from '../settings.service';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { Observable } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\n\nlet SPACE_LIST = [];\n\nexport function findSpace(id: string) {\n return SPACE_LIST.find((_) => _.id === id || _.email === id);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SpacesService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n private _org: OrganisationService,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n \n super(_composer, settingsService);\n ServiceManager.setService(Space, this);\n this._name = 'Space';\n this._api_route = 'rooms';\n this._compare = (a, b) =>\n !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this._list_filter = (a: Space) => {\n const bld = this._org.building;\n return a.level.building_id === bld.id;\n };\n this._org.initialised\n .pipe(first((_) => _))\n .subscribe(() => this.init());\n }\n\n public async query(query: HashMap = {}, setList:boolean = false) {\n const list = await super.query(query);\n if ( (query.hasOwnProperty('cache') && query.cache === false) || !Object.keys(query).length || setList) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n return list;\n }\n\n public filterAvailableSpaces(list: Space[]) {\n return list.filter((i) => {\n if (i.recurrence_availability?.length) return i; //if recurrence, send the space regardless of availability (needed for edit and cloning series)\n return i.available;\n });\n }\n\n /**\n * Get available spaces\n * @param options\n */\n public available(\n options: ISpaceAvailabilityOptions,\n uniqueId?: string,\n filter: boolean = true\n ): Promise {\n if (!options) {\n throw new Error('Space avilability requires request options');\n }\n\n const now = DateNow(new Date());\n if (!options.dateTz) {\n options.dateTz = now.startOfValue('minute');\n }\n\n if (options.hide_declined === undefined) {\n options.hide_declined = true;\n }\n\n const key = `available|${options.id ? options.id : ''}|${\n uniqueId ?? ''\n }`;\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const respond = (list: Space[]) => {\n delete this._promises[key];\n resolve(filter ? this.filterAvailableSpaces(list) : list);\n };\n const error = (e) => {\n reject(e);\n delete this._promises[key];\n };\n const query = availabilityOptionsToQuery(options);\n if (options.id) {\n this.show(options.id, query).then(\n (i) => respond([i]),\n error\n );\n } else {\n this.query(query).then(respond, error);\n }\n });\n }\n\n return this._promises[key];\n }\n\n /**\n * Load initial data for the service\n */\n protected async load(): Promise {\n const loading: ApplicationLoadingState =\n this._service.get('loading') || {};\n if (!loading.spaces) {\n loading.spaces = {\n message: 'Loading space data',\n state: 'loading',\n };\n this._service.set('loading', loading);\n }\n // Adjusted the query by incorporating the \"zone_ids\" option to filter rooms based on specific zone IDs instead of considering all thousands of rooms.\n const option = {\n zone_ids: this._org.building.id\n }\n await this.query(option, true).catch(() => {\n loading.spaces = { message: 'Loading space data', state: 'failed' };\n this._service.set('loading', loading);\n });\n loading.spaces = { message: 'Loading space data', state: 'complete' };\n this._service.set('loading', loading);\n }\n\n /**\n * Convert raw data into API object\n * @param raw_data Raw API data\n */\n public process(raw_data: HashMap): Space {\n return new Space(raw_data);\n }\n /**\n * \n * Special observable function to make http call for rooms\n * @param query \n * @returns observable\n */\n public queryRooms = (query: HashMap = {}): Observable => super.queryRoomsForQR(query);\n\n public setSpaceList(list) {\n this.set('list', list);\n SPACE_LIST = list;\n }\n\n public queryBooking = (query: HashMap = {}) : Observable | Observable => super.queryObsr(query);\n public updateSpace = (id: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.updateObsr(id, form_data, should_inject_concierge, query_params);\n public uploadSpacePhotos = (apiSubRoute: string, form_data: HashMap, should_inject_concierge: Boolean = false, query_params: HashMap = {}) : Observable | Observable => super.uploadSpacePhotos(apiSubRoute, form_data, should_inject_concierge, query_params);\n \n public updateRoomList() {\n this.load().then((_) => null)\n }\n}\n","import {\n BehaviorSubject,\n of\n} from 'rxjs';\nimport {\n Building,\n Organisation\n} from './organisation';\nimport { BaseDataClass } from './base-api.class';\nimport { MapLocation } from './location';\nimport { User } from './users';\nimport { Booking } from './bookings';\nimport {\n RoomSettings,\n Space,\n SpaceFeatures\n} from './spaces';\nimport { ServiceManager } from './service-manager.class';\nimport {\n CateringCategory,\n CateringItem\n} from './catering';\nimport {\n HashMap,\n padZero,\n predictableRandomInt,\n unique\n} from '@mckinsey-converge/base';\n\nimport * as faker from 'faker';\n\nimport {\n SETTINGS_TOKEN,\n SettingsData,\n SettingsObject,\n SettingsService\n} from './settings.service';\nimport { Report } from './reports';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nfaker.seed(2560);\n\nlet SERVICE: any;\n\ndeclare global {\n interface Jest {\n fn: () => any\n }\n}\n\n\ndeclare let jest: Jest;\n\n/* istanbul ignore file */\n\nexport function generateMockOrganisationService(): HashMap {\n return {\n levelWithID: jest.fn(),\n listen: jest.fn(),\n loadOrganisation: jest.fn(),\n initialised: of(true),\n building: new Building(generateMockBuilding({ id: 'bld-01' })),\n loadBuildingsWithOrg: jest.fn(),\n getOrganizationFiltersByRoomType: jest.fn(),\n getRoomTypeSubsetDDOptions: jest.fn(),\n getRoomFilterOptionsPerLocation: jest.fn(),\n ...generateMockDataService('OrganisationService')\n };\n}\n\nexport const generateMockSpacesService = (): HashMap => ({\n available: jest.fn(),\n ...generateMockDataService('SpacesService')\n});\n\nexport const generateMockUsersService = (): HashMap => ({\n loadCurrentUser: jest.fn(),\n ...generateMockDataService('UsersService')\n});\n\nexport const bookingState = () => ({\n bookings: of([]),\n filtered: of([]),\n filtered_week: of([]),\n filtered_month: of([]),\n setZone: jest.fn(),\n setDate: jest.fn(),\n setFilters: jest.fn(),\n add: jest.fn(),\n replace: jest.fn(),\n remove: jest.fn(),\n startPolling: jest.fn(),\n startPollingMonth: jest.fn(),\n startPollingWeek: jest.fn(),\n startPollingEveryFiveMin: jest.fn(),\n _noOfMeetings: of([])\n});\n\nconst test_app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n }\n};\n\nexport const TEST_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/test',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app: test_app,\n mock: false,\n frontend: 'staff'\n};\n\nexport const generateMockSettingsService = (overrides: Partial> = {}) => new SettingsService({ getTitle: () => jest.fn() } as any,\n new SettingsObject({\n ...TEST_SETTINGS,\n ...overrides\n }));\n\n/**\n * Provides an injectable instance for settings.\n */\nexport const provideMockSettingsObject = (settings: Partial> = {}) => ({\n provide: SETTINGS_TOKEN,\n useValue: new SettingsObject({\n ...TEST_SETTINGS,\n ...settings\n })\n});\n\n/**\n * Generate a mocked version of the application service\n */\nexport function generateMockAppService(settingsOverrides: Partial> = {}) {\n SERVICE = {\n setting: jest.fn(),\n notify: jest.fn(),\n notifyInfo: jest.fn(),\n notifyWarn: jest.fn(),\n notifySuccess: jest.fn(),\n notifyError: jest.fn(),\n log: jest.fn(),\n navigate: jest.fn(),\n navigateBack: jest.fn(),\n get: jest.fn(),\n listen: jest.fn(),\n set: jest.fn(),\n Composer: { auth: { token: 'test' } },\n Hotkeys: { listen: jest.fn() },\n Users: generateMockUsersService(),\n Organisation: generateMockOrganisationService(),\n Locations: generateMockDataService('LocationsService'),\n Base: generateMockDataService('BaseService'),\n Menu: generateMockDataService('CateringMenuService'),\n Spaces: generateMockSpacesService(),\n Bookings: generateMockDataService('BookingsService'),\n Reports: generateMockDataService('ReportsService'),\n CateringItems: generateMockDataService('CateringItemsService'),\n CateringCategories: generateMockDataService('CateringCategoriesService'),\n Settings: generateMockSettingsService(settingsOverrides),\n initialised: of(true)\n };\n ServiceManager.setService(BaseDataClass, SERVICE.Base);\n ServiceManager.setService(Organisation, SERVICE.Organisation);\n ServiceManager.setService(Building, SERVICE.Organisation);\n ServiceManager.setService(User, SERVICE.Users);\n ServiceManager.setService(Booking, SERVICE.Bookings);\n ServiceManager.setService(Space, SERVICE.Spaces);\n ServiceManager.setService(MapLocation, SERVICE.Locations);\n ServiceManager.setService(Report, SERVICE.Reports);\n ServiceManager.setService(CateringItem, SERVICE.CateringItems);\n ServiceManager.setService(CateringCategory, SERVICE.CateringCategories);\n SERVICE.Organisation.buildings = [SERVICE.Organisation.building];\n SERVICE.Users.current = new User(generateMockUser());\n SERVICE.Users.initialised = of(true);\n SERVICE.Bookings.booking_list = new BehaviorSubject(new Array(10).fill(0).map(_ => new Booking(generateMockBooking())));\n SERVICE.listen.mockReturnValue(of(null, []));\n return SERVICE;\n}\n\nexport function generateMockDataService(name: string) {\n const service = {\n find: jest.fn(),\n filter: jest.fn(),\n listen: jest.fn(),\n get: jest.fn(),\n set: jest.fn(),\n setting: jest.fn(),\n query: jest.fn(),\n show: jest.fn(),\n add: jest.fn(),\n save: jest.fn(),\n remove: jest.fn(),\n delete: jest.fn(),\n update: jest.fn(),\n addFrom: jest.fn(),\n removeFrom: jest.fn(),\n task: jest.fn(),\n available: jest.fn(),\n process: jest.fn(),\n updateList: jest.fn(),\n clearList: jest.fn(),\n removeFromList: jest.fn(),\n accept: jest.fn(),\n decline: jest.fn(),\n checkin: jest.fn(),\n is_logged_in: false,\n initialised: of(true),\n getHoldingBay: jest.fn(),\n name,\n queryRooms: of(true),\n queryRoomsForQR: of([]),\n queryObsr: of([]),\n queryBooking: of(true),\n checkinIndividualVisitor: jest.fn(),\n taskObsr: of(true),\n updateSpace: jest.fn(),\n updateObsr: of([]),\n uploadSpacePhotos: of([])\n\n };\n\n service.getHoldingBay.mockImplementation(_ => Promise.resolve([new Booking({})]));\n service.save.mockImplementation(_ => Promise.resolve(new Booking({})));\n\n service.listen.mockReturnValue(of(null));\n service.filter.mockReturnValue([]);\n return service;\n}\n\nlet SPACE_COUNT: number = 0;\n\nexport function generateMinimalRoomDetails(count: number) {\n return {\n name: `space-0${count}`,\n email: `space-0${count}@test.com`,\n settings: {\n name: `localname-0${count}`,\n catering: true\n }\n }\n}\n\nexport function generateMockSpace(overrides: HashMap = {}, space_id: number = null, recurring_search: boolean = false ): Space {\n const id = `space-${space_id || SPACE_COUNT++}`;\n const name = overrides.name || `${faker.name} ${faker.name.lastName()} Space`;\n const startOfDay = DateNow(new Date()).startOfValue('day');\n let settings: RoomSettings = {\n available: true,\n available_until: startOfDay.addValue({ days: 1 }).seconds, // (Date.now() / 1000) + (60 * 60 * 24), // now plus 24 hrs\n bookings: Array(10).fill(0).map(i => generateMockBooking()),\n catering: true,\n charge_code: true,\n extra_features: \"meeting_room boardroom\",\n internal_or_external: \"internal\",\n map_id: \"1\",\n natural_light: false,\n room_booking_screen: true,\n room_name: `${name} - Local Name`,\n vc: false,\n }\n if (overrides.settings) {\n settings = { ...settings, ...overrides.settings };\n delete overrides.settings;\n }\n if (recurring_search) {\n settings.recurrence_availability = [\n {\n date: startOfDay.seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 1 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 2 }).seconds,\n available: false,\n },\n {\n date: startOfDay.addValue({ days: 3 }).seconds,\n available: false,\n },\n ]\n }\n\n const linked = Math.floor(predictableRandomInt(99999)) % 2 === 0 && SPACE_COUNT > 1;\n return new Space({\n id,\n name: `${name} - Global Name`,\n map_id: `${space_id || SPACE_COUNT}`,\n type: faker.commerce.productName(),\n searchable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n controlable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n hourly_rate: Math.floor(predictableRandomInt(300)) * 100,\n bookable: Math.floor(predictableRandomInt(99999)) % 2 === 0,\n capacity: 15,\n sort_priority: 0,\n setup: Math.floor(predictableRandomInt(6)) * 5,\n breakdown: Math.floor(predictableRandomInt(6)) * 5,\n support_url: `/control/#/${id}`,\n image: faker.image.business(),\n zones: ['zone_lvl-0'],\n features: `${SpaceFeatures.BoardRoom} ${SpaceFeatures.ElectronicWhiteboard}`,\n email: `${name.toLowerCase().split(' ').join('.')}@${USER_DOMAIN}`,\n settings,\n ...overrides\n });\n}\n\nlet BOOKING_COUNT = 0;\nlet BOOKING_DATE = DateNow(new Date()).setValue({ hour: 6 }).setValue({minute: 0}).subtractValue({ days: 10 }).startOfValue('minute');\n\n/**\n * Set the initial time used for generating mock bookings\n * @param time New initial time as ms from UTC epoch\n */\nexport function setMockBookingStartDatetime(time: number) {\n const date = new DateTZ({date: time})\n BOOKING_DATE = date.startOfValue('minute');\n}\n\n/**\n * Create mock raw API data for a booking\n * @param override Overrides the properties of the generated booking with it's own\n */\nexport function generateMockBooking(override: HashMap = {}) {\n const id = `booking-${BOOKING_COUNT++}`;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4) + 2) * 15 });\n const start = BOOKING_DATE.ms;\n const duration = Math.floor(predictableRandomInt(4) + 2) * 15;\n BOOKING_DATE = BOOKING_DATE.addValue({ minutes: Math.floor(predictableRandomInt(4)) * 15 });\n const organiser = generateMockUser({ external: false, visitor: false });\n const orders = Array(Math.floor(predictableRandomInt(5)))\n .fill(0)\n .map(_ => generateMockCateringOrder({ booking_date: start }, override.room_ids, override.menu));\n const hasCatering = Math.floor(predictableRandomInt(34567)) % 3 === 0;\n const date_start = new DateTZ({date: start})\n return {\n id,\n title: `${faker.commerce.productName()} Meeting`,\n attendees: Array(Math.floor(predictableRandomInt(5) + 2))\n .fill(0)\n .map((_, i) => generateMockUser(override.users)),\n organiser,\n start_epoch: date_start.seconds,\n end_epoch: date_start.addValue({ minutes: duration }).seconds,\n body: faker.lorem.paragraph(),\n notes: [{ type: 'other', message: faker.lorem.paragraph() }],\n location: faker.address.city(),\n // Mckinsey only has internal or external meetings\n booking_type: ['internal', 'external'][predictableRandomInt(2)],\n setup: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n breakdown: { 'space-01': Math.max(0, (predictableRandomInt(12) - 6) * 5) },\n status: 'accepted',\n catering: hasCatering ? orders : [],\n room: new Space(generateMinimalRoomDetails(1)), // returns space-01 type values\n equipment_codes: {},\n company:[],\n ...override\n };\n}\n\nlet BLD_COUNT = 0;\nlet LVL_COUNT = 0;\n\n/**\n * Generate raw mock data for creating a building\n * @param id Forced ID for the mock\n * @param overrides Supply object value overrides in place. Supports a levelGenerator function\n * to stabilize level ids for testing.\n */\nexport function generateMockBuilding(overrides: HashMap = {}): HashMap {\n const id = `zone_bld-${BLD_COUNT++}`;\n const levels = Array(10)\n .fill(0)\n .map((_, i) => generateMockLevel(undefined, overrides.levelGenerator?.(i)));\n const features: any = {};\n for (const lvl of levels) {\n const count = Math.floor(predictableRandomInt(3) + 2);\n features[lvl.level_id] = {};\n for (let i = 0; i < count; i++) {\n features[lvl.level_id][faker.commerce.productName()] = `feature-${i + 1}`;\n }\n }\n return {\n id,\n zone_id: id,\n extras: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n code: 'NYO',\n name: faker.name.firstName(),\n address: 'building address field',\n city: 'building city',\n loan_items: Array(10)\n .fill(0)\n .map(i => {\n const name = faker.commerce.productName();\n return {\n extra_id: name\n .split(' ')\n .join('-')\n .toLowerCase(),\n extra_name: name\n };\n }),\n levels,\n roles: {\n 'first-aiders': Array(10)\n .fill(0)\n .map(i => generateMockUser())\n },\n neighbourhoods: features,\n settings: {\n test: {\n nested: {\n level2: true,\n org: false\n }\n },\n city: faker.address.city()\n },\n timezone: 'America/Chicago',\n ...overrides\n };\n}\n\n/**\n * Generate raw mock data for a building level\n * @param id Forced ID for the mock\n * @param overrides value overrides\n */\nexport function generateMockLevel(id?: string, overrides: HashMap = {}): HashMap {\n if (!id) {\n id = `zone_lvl-${LVL_COUNT++}`;\n }\n return {\n id,\n level_id: id,\n level_name: `Level ${LVL_COUNT}`,\n short_name: `L ${LVL_COUNT}`,\n ...overrides\n };\n}\n\nlet USER_COUNT = 0;\n\nexport let USER_DOMAIN = 'acaprojects.com';\n\nconst USER_EMAILS: string[] = [];\n\n/**\n * Generate raw mock data for a user\n * @param id Forced ID for the mock\n * @param name Forced name for the user\n * @param external Whether user is external of the organisation\n */\nexport function generateMockUser(override: HashMap = {}): HashMap {\n const id = `user-${USER_COUNT++}`;\n const name = `${faker.name.firstName()} ${faker.name.lastName()}`;\n const external = override.external || !(predictableRandomInt(99999) % 2);\n const organisation = external ? faker.company.companyName() : USER_DOMAIN.split('.')[0];\n let delegates: {email: string, opt_out: boolean}[] = [];\n const delegate_count = Math.min(predictableRandomInt(4) + 1, USER_EMAILS.length);\n for (let i = 0; i < delegate_count; i++) {\n delegates.push({email: USER_EMAILS[Math.floor(predictableRandomInt(USER_EMAILS.length))], opt_out: false});\n }\n delegates = unique(delegates);\n const email = `${name\n .split(' ')\n .join('.')\n .toLowerCase()}@${external ? 'not-' : ''}${USER_DOMAIN}`;\n USER_EMAILS.push(email);\n return {\n id,\n name,\n first_name: name.split(' ')[0],\n last_name: name.split(' ')[1],\n email,\n phone: faker.phone.phoneNumber(),\n visitor: external,\n organisation: {\n id: organisation\n .split(' ')\n .join('.')\n .toLowerCase(),\n name: organisation\n },\n department: faker.commerce.department(),\n staff_code: padZero(Math.floor(predictableRandomInt(99999)), 5),\n delegates,\n image: faker.image.avatar(),\n ...override\n };\n}\n\nexport function generateMockCateringOrder(overrides: HashMap = {}, room_id: string = '', menu: HashMap = {}) {\n return {\n id: `order-${predictableRandomInt(9999_9999)}`,\n delivery_time: predictableRandomInt(6) * 5,\n location_id: room_id, // R--- could be undefined\n items: new Array(predictableRandomInt(5, 1)).fill(0).map(i => pickMenuItem(menu)),\n ...overrides\n };\n}\n\nfunction pickMenuItem(menu_map: HashMap = {}) {\n const zones = Object.keys(menu_map);\n const menu = menu_map[zones[predictableRandomInt(zones.length)]] || [];\n const category = menu[predictableRandomInt(menu.length)] || { items: [] };\n const group = { ...(category.items[predictableRandomInt(category.items.length)] || {}) };\n if (!group.package && group.items?.length) {\n const item = { ...group.items[predictableRandomInt(group.items.length)] };\n item.amount = predictableRandomInt(5, 1);\n return item;\n }\n group.amount = predictableRandomInt(5, 1);\n return group;\n}\n\nexport function generateMockLocation(overrides: HashMap, fixed_locations: string[], maps: string[]): HashMap {\n const fixed = predictableRandomInt(999_999_999) % 2 === 0;\n if (fixed && (!overrides || overrides.fixed)) {\n return {\n map_id: fixed_locations[predictableRandomInt(fixed_locations.length)],\n level: maps[predictableRandomInt(maps.length)],\n ...overrides\n };\n } else {\n return {\n x: predictableRandomInt(900, 100),\n x_max: 1000,\n y: predictableRandomInt(500, 100),\n level: maps[predictableRandomInt(maps.length)],\n confidence: predictableRandomInt(30),\n ...overrides\n };\n }\n}\n\nlet ORG_COUNT = 0;\n\nexport function generateMockOrganisation(): HashMap {\n const buildings = Array(3).fill(0).map(i => generateMockBuilding());\n return {\n id: `zone_org-${ORG_COUNT++}`,\n name: `Organisation ${ORG_COUNT}`,\n buildings,\n settings: {\n discovery_info: {\n buildings\n },\n test: {\n nested: {\n org: true\n }\n }\n }\n };\n}\n\n\nexport const generateMockBuildingSetByCity = () => {\n const buildings: Building[] = Array(10).fill(0)\n .map(() => new Building(generateMockBuilding()));\n buildings.push(...Array(2).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'Auckland'\n },\n city: 'Auckland'\n }))));\n buildings.push(...Array(5).fill(0).map(() => new Building(generateMockBuilding({\n settings: {\n city: 'NYC'\n },\n city: 'NYC'\n }))));\n return buildings;\n};\n\nexport function generateMockModalData(data: HashMap = null) : HashMap {\n if (data) {\n return data;\n }\n return {\n pendingDate: new Date(1603087100 + (1000 * 60 * 15)),\n pendingDuration: 60,\n date: 1603087100,\n duration: 30,\n }\n}\n\nexport const mockDateToBuildingTz = (date?: number) =>{\n return new DateTZ({date, building_tz: 'America/Chicago', is_local_tz: false})\n}","export * from './user.class'\nexport * from './user.utilities'\nexport * from './users.service'\n","import { BaseDataClass } from '../base-api.class';\nimport {\n HashMap,\n Identity\n} from '@mckinsey-converge/base';\nimport { MapLocation } from '../location';\nimport { ServiceManager } from '../service-manager.class';\n\nexport class User extends BaseDataClass {\n \n /** Currently logged in user */\n public static get active_user(): User {\n const service = ServiceManager.serviceFor(User);\n return service ? service.current : null;\n }\n\n /** First name of the user */\n public readonly first_name: string;\n /** Last name of the user */\n public readonly last_name: string;\n /** Windows user ID */\n public readonly windows_id: string;\n /** FMNO */\n public readonly fmno: string;\n /** Type of user */\n public readonly type: 'partner' | 'external' | 'internal';\n /** Contact phone number of the user */\n public readonly phone: string;\n /** Organisational department the user is part of */\n public readonly business_unit: string;\n /** Whether user is external from the application's organisation */\n public readonly external: boolean;\n /** Whether user is a visitor */\n public readonly visitor: boolean;\n /** Organisational Identifier for the user */\n public readonly staff_code: string;\n /** Basic location descriptor for the user */\n public readonly location: string;\n /** List of users that this user can act on behalf */\n public readonly delegates: readonly {email: string, opt_out: boolean}[];\n /** URL of the user's avatar image */\n public readonly image: string;\n /** List of user groups associated with this user */\n public readonly groups: readonly string[];\n /** Organisation the user is associated with */\n private _organisation: Identity;\n\n /** Map location of the user */\n private _location: MapLocation;\n /** List of desk bookings */\n // private _desk_bookings: HashMap = {}; // R--- can't explain why this is here.\n /** Host/Organisawe email notification opt out/in setting */\n public opt_out: boolean;\n\n constructor(raw_data: HashMap = {}) {\n super(raw_data);\n this.first_name = raw_data.first_name || '';\n this.last_name = raw_data.last_name || '';\n this.windows_id = raw_data.email || '';\n this.fmno = raw_data.fmno;\n this.external = raw_data.external || false;\n this.visitor = raw_data.visitor || false;\n\n\n this.type = this.visitor ? 'external' : 'internal';\n this.phone = raw_data.phone || raw_data.mobile || '';\n this.business_unit = raw_data.business_unit || raw_data.department || '';\n this._organisation = raw_data.organisation || {\n id: raw_data.organisation_id,\n name: raw_data.organisation_name\n };\n\n this._location = null;\n this.image = raw_data.image || '';\n this.staff_code = raw_data.staff_code || raw_data.fmno || '';\n this.delegates = raw_data.delegates || [];\n this._location = new MapLocation(\n raw_data.location && raw_data.location instanceof Object\n ? raw_data.location\n : { name: raw_data.location }\n );\n this.groups = raw_data.groups || [];\n this.location = raw_data.location || raw_data.officeLocation || '';\n this.opt_out = raw_data.opt_out;\n }\n\n /** Organisation the user is associated with */\n public get organisation() {\n return this._organisation;\n }\n\n /** Map location of the user */\n public get last_location(): MapLocation {\n return new MapLocation(this._location || {});\n }\n\n /**\n * Ask the server for the users current location\n */\n public locate(): Promise {\n const service: any = ServiceManager.serviceFor(MapLocation);\n return new Promise((resolve, reject) => {\n if (service) {\n service.show(this.id, { desk: this.email }).then(\n l => {\n this._location = l;\n resolve(l);\n },\n e => reject(e)\n );\n } else {\n resolve(null);\n }\n });\n }\n\n /**\n * Whether user is available during the given period\n * @param start Start time as a unix timestamp with milliseconds\n * @param end End time as a unix timestamp with milliseconds\n */\n public available(start?: number, end?: number): Promise {\n return new Promise(resolve => {\n this._service.query({ email: this.email, start, end }).then(\n l => resolve(l && l.length > 0),\n _ => resolve(false)\n );\n });\n }\n\n /**\n * Make a copy of this object\n */\n public clone(): User {\n return new User(this);\n }\n\n /**\n * Make a copy of this object without identification data\n */\n public duplicate(): User {\n return new User({ ...this, id: null, email: null });\n }\n\n /**\n * Convert object into plain object\n */\n public toJSON(this: User): HashMap {\n const data = super.toJSON();\n delete data.location;\n return data;\n }\n}\n\n// R--- Might need an toApiJSON due to visitor field.","import {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\n\nimport { HashMap } from '@mckinsey-converge/base';\nimport { User } from './user.class';\n\n/**\n * Generate form fields for the given user\n * @param user User to generate form for\n */\nexport function generateUserForm(user: User): FormGroup {\n if (!user) {\n throw Error('No user passed');\n }\n const fields: HashMap = {\n id: new FormControl(user.id || ''),\n name: new FormControl(user.name || ''),\n first_name: new FormControl(user.first_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n last_name: new FormControl(user.last_name || '', [Validators.required, Validators.pattern(/^(?![\\d\\s]+$)[^\\d]+$/), Validators.maxLength(50)]),\n email: new FormControl(user.email || '', [Validators.email])\n };\n // Generate form group for booking item\n return new FormGroup(fields);\n}\n","import { Injectable } from '@angular/core';\nimport { Location } from '@angular/common';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\nimport { Md5 } from 'ts-md5/dist/md5';\n\nimport { BaseAPIService } from '../base.service';\nimport { User } from './user.class';\nimport {\n ApplicationLoadingState,\n HashMap,\n unique\n} from '@mckinsey-converge/base';\n\nimport { ApplicationService } from '../app.service';\nimport { ServiceManager } from '../service-manager.class';\nimport { SettingsService } from '../settings.service';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface ILoginOptions {\n /** URL to post login request to */\n url?: string;\n /** Whether form data is passed in the body of the request */\n form?: boolean;\n /** Custom headers to pass into the post request */\n headers?: HashMap;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UsersService extends BaseAPIService {\n constructor(\n protected _composer: ComposerService,\n protected uhttp: HttpClient,\n protected location: Location,\n private _service: ApplicationService,\n settingsService: SettingsService\n ) {\n super(_composer, settingsService);\n ServiceManager.setService(User, this);\n this._name = 'Users';\n this._api_route = 'users';\n this._compare = (a, b) => !a.id.localeCompare(b.id) || !a.email.localeCompare(b.email);\n this.set('list', []);\n this.set('current_user', new User({ id: 'local_user', name: 'Local User' }));\n this.set('delegates', null);\n this._composer.initialised.pipe(first((_) => _)).subscribe(() => this.init());\n }\n\n /** Currently logged in user */\n public get current(): User {\n return this.get('current_user');\n }\n\n /** Whether the user has properly logged in */\n public get is_logged_in(): boolean {\n return this.current && this.current.id !== 'local_user';\n }\n\n /* istanbul ignore next */\n /**\n * Sets the access token and expiry for the user\n * @param token OAuth bearer token\n * @param expiry Expiry epoch timestamp in ms\n * @param reload Whether to reload the page after setting tokens\n */\n public setToken(token: string, expiry?: number, reload: boolean = true) {\n if (!expiry) {\n const now = DateNow(new Date())\n expiry = now.addValue({ days: 7 }).endOfValue('day').ms;\n }\n const path = `${location.origin}${\n this._service.setting('composer.route') || ''\n }/oauth-resp.html`;\n const client_id = Md5.hashStr(path);\n if (sessionStorage) {\n sessionStorage.setItem(`${client_id}_access_token`, token);\n sessionStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (localStorage) {\n localStorage.setItem(`${client_id}_access_token`, token);\n localStorage.setItem(`${client_id}_expires_at`, `${expiry}`);\n }\n if (reload) {\n this.location.go(this.location.path());\n }\n return path;\n }\n\n /**\n * Post login request to the API\n * @param query_params Key value pairs to pass into\n * @param options Options for the login request\n */\n public async login(query_params: HashMap, options: ILoginOptions = {}): Promise {\n if (this.settingsService.concierge) {\n if (!this._promises['login']) {\n this._promises['login'] = new Promise((resolve, reject) => {\n this.set('status', 'loading');\n let headers = new HttpHeaders();\n if (!options || options.form !== false) {\n headers = headers.append('Content-Type', 'application/x-www-form-urlencoded');\n }\n const url = (options ? options.url : '') || '/auth/signin';\n this.uhttp.post(url, query_params, { headers }).subscribe(\n (_) => null,\n (e) => reject(e),\n () => {\n this._composer.auth.authorise();\n resolve();\n }\n );\n });\n }\n return this._promises['login'];\n }\n }\n\n\n /**\n * Logout of user and redirect to logout URL\n */\n public logout() {\n this._composer.auth.logout();\n }\n\n /**\n * Loads current user from API. This diverges from {@link load} in order to simply return\n * the user object instead of setting it on the service.\n */\n public async loadCurrentUser(): Promise {\n return this.show('current')\n }\n\n /**\n * Load initial data for the service\n */\n protected load(tries: number = 0): Promise {\n const loading: ApplicationLoadingState = this._service.get('loading') || {};\n loading.user = { message: 'Loading user credentials', state: 'loading' };\n this._service.set('loading', loading);\n this.set('status', 'loading');\n return new Promise((resolve) => {\n // this is due to unclear nature of the merge between concierge and staff\n // concierge has the retries enabled, while staff continuously retries.\n if (this.settingsService.concierge && tries > 4) {\n this.set('status', 'invalid');\n loading.user = { message: 'Loading user credentials', state: 'failed' };\n this._service.set('loading', loading);\n return resolve();\n }\n this.show('current').then(\n async (current_user) => {\n this.set('status', 'available');\n this.set('current_user', current_user);\n this._initialised.next(true);\n if (this._service && this._service.setting('app.user.grab_api_details')) {\n this.show(current_user.email).then(\n async (user) => {\n this.set('current_user', user);\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = {\n message: 'Loading user credentials',\n state: 'complete'\n };\n this._service.set('loading', loading);\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n } else {\n \n // is after process\n if (this._service.setting('app.user.update_location')) {\n this.interval('location', () => current_user.locate(), 5000);\n }\n await this.loadDelegates().catch(_ => null);\n resolve();\n loading.user = { message: 'Loading user credentials', state: 'complete' };\n this._service.set('loading', loading);\n }\n },\n () => this.timeout('load', () => this.load(++tries).then(() => resolve()), Math.min(3000, 300 * tries))\n );\n });\n }\n\n private async loadDelegates() {\n const delegates = this.current.delegates;\n if (!delegates || !delegates.length) {\n return [];\n }\n const promises: Promise[] = [];\n for (const del of delegates) {\n promises.push(this.show(del.email));\n }\n const list = await Promise.all(promises);\n this.set('delegates', list);\n this.set('list', unique((this.get('list') || []).concat(list)));\n return list;\n }\n\n /**\n * Convert raw API data into a valid User Object\n * @param raw_item Raw API data\n */\n protected process(raw_data: any): User {\n return new User(raw_data);\n }\n}","import { AbstractControl } from '@angular/forms';\n\nimport { User } from './users';\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n\nconst HAS_ERROR = true;\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n */\nexport function buildValidateDate(date?: number) {\n const from = new DateTZ({ date });\n return (c) => validateDate(c, date);\n}\n\n/**\n * Check that control value is a date that is the same or after from date\n * @param control Angular form control\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateDate(control: AbstractControl, is_from?: number) {\n const from = new DateTZ({date: is_from})\n const date = new DateTZ({date: control.value})\n return date.isBeforeDate(from) ? { date: HAS_ERROR, message: 'Booking needs to be made in the future' } : null;\n}\n\n/**\n * Build start time validation function\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function buildValidateStartTime(date: number, is_from?: number) {\n const from = new DateTZ({date: is_from})\n return (c) => validateStartTime(c, date, from.ms);\n}\n\n/**\n * Check that control value time is after the comparison date time\n * @param control Angular form control\n * @param date Date of the time to check\n * @param is_from Comparison date(ms from UTC epoch). Defaults to the current time\n */\nexport function validateStartTime(control: AbstractControl, date: number, is_from?: number) {\n const now = new DateTZ({date: is_from});\n const parts = control.value.split(':');\n const date_obj = new DateTZ({date});\n return date_obj.setValue({ hour: +parts[0], minute: +parts[1] }).isBeforeDate(now) ? {\n start: HAS_ERROR,\n message: 'Booking time needs to be made in the future'\n } : null;\n}\n\nexport function buildValidateDuration(min: number = 30, max: number = 240) {\n return (c) => validateDuration(c, min, max);\n}\n\nexport function validateDuration(control: AbstractControl, min: number = 30, max: number = 240) {\n if (control.value < (min || 30)) {\n return { duration: HAS_ERROR, message: `Minimum booking duration is ${min} minute${min === 1 ? 's' : ''}` };\n } else if (control.value > (max || 480)) {\n return { length: HAS_ERROR, message: `Maximum booking duration is ${max} minute${max === 1 ? 's' : ''}` };\n }\n return null;\n}\n\nexport function buildValidateAttendees(host: User, min: number = 0) {\n return (c) => validateAttendees(c, host, min);\n}\n\nexport function validateAttendees(control: AbstractControl, host: User, min: number = 0) {\n if (!control || !(control.value instanceof Array)) {\n return min > 0\n ? { invalid: true, message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you` }\n : null;\n }\n const list: User[] = control.value;\n if (host) {\n const result = list.find(a => a.email === host.email);\n if (result) {\n list.splice(list.indexOf(result), 1);\n }\n }\n return list.length >= min ? null : {\n count: true,\n message: `Minimum of ${min} attendee${min === 1 ? ' is' : 's are'} required other than you`\n };\n}\n\nexport function validateEndTime(dateControlTz: AbstractControl) {\n return (control: AbstractControl) => {\n // const date = new DateTZ({date: date_control ? date_control.value : undefined})\n const now = DateNow(new Date())\n return dateControlTz.value.addValue({ minutes: control.value || 60 }).isBeforeDate(now)? { end_time: true } : null;\n };\n}\n\nexport function noWhitespaceValidator(control: AbstractControl) {\n const value = control?.value;\n if ( value === '') {\n return null; // Return null if control value is undefined or null\n }\n const isWhitespace = value.trim().length === 0;\n // const isValid = !isWhitespace;\n return !isWhitespace ? null : { whitespace: true };\n}\n\n","export * from './lib/date-tz.class'","import { DateObjectUnits, DateTime, DateTimeUnit, DurationLike, DurationUnits } from 'luxon';\nimport { getTimezoneOffset } from 'date-fns-tz';\n\nfunction padZero(value: number, length: number): string {\n let str = `${value}`;\n while (str.length < length) str = `0${str}`;\n return str;\n}\n\ninterface DateTZParams {\n date?: number | DateTime\n building_tz?: string\n is_local_tz?: boolean\n all_day?: boolean\n}\n\nconst now = new Date()\n\nexport class DateTZ {\n date: DateTime\n date_org: DateTime\n building_tz: string\n is_local_tz: boolean = true\n all_day: boolean\n local_tz: string\n valid: boolean\n\n constructor(data?: DateTZParams) { \n this.date_org = typeof data?.date === 'number' ? DateTime.fromMillis(data?.date) : data?.date ? data?.date : DateTime.fromMillis(now.valueOf())\n this.is_local_tz = data?.is_local_tz === false ? data?.is_local_tz : true\n this.all_day = data?.all_day || false\n this.local_tz = DateTime.now().zoneName\n this.building_tz = data?.building_tz || this.local_tz\n this.date = !this.is_local_tz ? this.date_org.setZone(this.building_tz) : this.date_org\n this.valid = this.date.isValid\n }\n\n //get epoch milliseconds\n public get ms(): number {\n return this.date.valueOf()\n }\n\n //get epoch seconds\n public get seconds(): number {\n return Math.trunc(this.date.toSeconds())\n }\n\n //get the second of the minute\n public get second(): number {\n return this.date.second\n }\n\n //get the minutes of the hour\n public get minutes(): number {\n return this.date.minute\n }\n\n //get the minutes of the hour\n public get hours(): number {\n return this.date.hour\n }\n\n public get utc(): number {\n const newDate = new DateTZ({...this, date: this.date.toUTC()})\n return newDate.seconds\n }\n\n public get dateDay(): number {\n return this.date.day\n }\n\n public get dateHour(): number {\n return this.date.hour\n }\n\n public get dateYear(): number {\n return this.date.year\n }\n\n public get dateWeekday(): number {\n try {\n return this.date.weekday;\n } catch (e) {\n return this.date.toJSDate().getDay();\n }\n }\n\n public get dateMonth(): number {\n return this.date.month\n }\n\n public dateDiff (compare_to: DateTZ, unit: DurationUnits, ans_unit = 'minutes'): number {\n return this.date.diff(compare_to.date, unit)[ans_unit]\n }\n\n //set the date to the begining of the given unit\n public startOfValue (unit: DateTimeUnit) {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 7) {\n // Don't change, we want sunday as the start of the week even though luxon thinks it is Monday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 1) {\n // If this.date is monday, just subtract one more day to make it Sunday\n const monday = new DateTZ({ ...this, date: this.date })\n newDate = monday.subtractValue({ days: 1 });\n } else {\n // If later than monday, startOfWeek back to monday and then subtact another day to get to Sunday.\n const monday = new DateTZ({...this, date: this.date.startOf(unit)})\n newDate = monday.subtractValue({ days: 1 })\n }\n }\n\n return newDate\n }\n\n //set the date to the end of the given unit\n public endOfValue (unit: DateTimeUnit) : DateTZ {\n // All the luxon start of values work as needed except for week\n let newDate = new DateTZ({...this, date: this.date.startOf(unit)})\n // Special week logic\n if (unit === 'week') {\n if (this.dateWeekday === 6) {\n // Don't change, we want saturday as the end of the week even though luxon thinks it is Sunday\n newDate = new DateTZ({ ...this, date: this.date })\n } else if (this.dateWeekday === 7) {\n // If this.date is Sunday, this alone is the luxon end of week so add a day\n // to get to monday, then endOfWeek to Sunday, and subtract 1 day to Saturday\n const sunday = new DateTZ({ ...this, date: this.date }).addValue({ days: 1 })\n newDate = sunday.endOfValue(unit).subtractValue({ days: 1 }); // return next saturday\n } else {\n // If not saturday or sunday\n // endOfWeek to Sunday and then subtact a day to get to Saturday.\n const later = new DateTZ({...this, date: this.date.endOf(unit)})\n newDate = later.subtractValue({ days: 1 })\n }\n } else {\n newDate = new DateTZ({...this, date: this.date.endOf(unit)})\n }\n\n return newDate\n }\n \n public startEpoch (): number {\n const org = new DateTZ({date: this.date_org})\n return this.all_day\n ? this.startOfValue('day').ms - this.dateDiff(org, 'minutes')\n : this.ms\n }\n\n //clone the given value and unit to the date\n public clone (): DateTZ {\n // return new DateTZ({...this})\n return this.addValue({ seconds: 0 })\n }\n\n //adds the given value and unit to the date\n public addValue (duration: DurationLike, isLastDayOfMonth?: boolean): DateTZ {\n return new DateTZ({...this, date: isLastDayOfMonth ? this.date.plus(duration).endOf('month') : this.date.plus(duration)});\n }\n\n //subtracts the given value and unit to the date\n public subtractValue (duration: DurationLike): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.minus(duration)})\n return newDate\n }\n\n public setValue (obj: DateObjectUnits): DateTZ {\n const newDate = new DateTZ({...this, date: this.date.set(obj)})\n return newDate\n }\n\n public formatDate (format: string): string {\n // Return new immuatable via \"plus\" to prevent \n // TypeError: Cannot assign to read only property 'weekData' of object\n // https://github.com/moment/luxon/issues/601\n return this.date.plus({ seconds: 0 }).toFormat(format)\n }\n\n public formatLocalDate (format: string): string {\n // setZone already returns new immutable so it doesn't have the formatDate issue.\n return this.date.plus({ seconds: 0 }).setZone(this.local_tz).toFormat(format)\n }\n\n public isSameDate(compare_to: DateTZ, value: DateTimeUnit): boolean {\n return this.date.hasSame(compare_to.date, value)\n }\n\n public isAfterDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear > compare_to.dateYear\n case 'month':\n if(this.isAfterDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth > compare_to.dateMonth\n }\n case 'day':\n if(this.isAfterDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay > compare_to.dateDay\n }\n case 'hour':\n if(this.isAfterDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour > compare_to.dateHour\n }\n case 'minute':\n if(this.isAfterDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes > compare_to.minutes\n }\n default:\n return this.ms > compare_to.ms;\n }\n }\n\n public isBeforeDate(compare_to: DateTZ, unit?: DateTimeUnit): boolean {\n switch (unit) {\n case 'year':\n return this.dateYear < compare_to.dateYear\n case 'month':\n if(this.isBeforeDate(compare_to, 'year')){\n return true\n }else if(!this.isSameDate(compare_to, 'year')){\n return false\n }else{\n return this.dateMonth < compare_to.dateMonth\n }\n case 'day':\n if(this.isBeforeDate(compare_to, 'month')){\n return true\n }else if(!this.isSameDate(compare_to, 'month')){\n return false\n }else{\n return this.dateDay < compare_to.dateDay\n }\n case 'hour':\n if(this.isBeforeDate(compare_to, 'day')){\n return true\n }else if(!this.isSameDate(compare_to, 'day')){\n return false\n }else{\n return this.dateHour < compare_to.dateHour\n }\n case 'minute':\n if(this.isBeforeDate(compare_to, 'hour')){\n return true\n }else if(!this.isSameDate(compare_to, 'hour')){\n return false\n }else{\n return this.minutes < compare_to.minutes\n }\n default:\n return this.ms < compare_to.ms;\n }\n }\n\n public toZone(tz: string): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: this.date.setZone(tz), \n building_tz: tz, \n is_local_tz: false\n })\n return newDate\n }\n\n public setTimestamp(timestamp: number): DateTZ {\n const newDate = new DateTZ({\n ...this, \n date: timestamp,\n })\n return newDate\n }\n\n public get JSDate(): Date {\n return this.date.toJSDate()\n }\n\n // helper to log out the dateTZ values\n public logDateTz (label: string = ''): void {\n console.log(`${label} local tz/date/time`, this.addValue({ seconds: 0 }).formatLocalDate(\"cccc d MMMM,yyyy h:mma\"), this.local_tz)\n console.log(`${label} building tz/date/time`, this.addValue({ seconds: 0 }).formatDate(\"cccc d MMMM,yyyy h:mma\"), this.building_tz)\n }\n}\n\nexport const DateNow = (date: Date = new Date()) => {\n return new DateTZ({date: date.valueOf()})\n} \n\n// input the local time and the building timezone\nexport const convertLocalTimestampToTimezonedDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const date = new Date(timestamp);\n return new DateTZ({ date: timestamp, building_tz: buildingTimezone, is_local_tz: false }).setValue({\n day: date.getDate(),\n hour: date.getHours(),\n minute: date.getMinutes()\n });\n}\n\n// input the building time and the building timezone\nexport const convertTimezonedTimestampToLocalDateTz = (timestamp: number, buildingTimezone: string): DateTZ => {\n const local_tz = DateTime.now().zoneName;\n const localOffset = getTimezoneOffset(local_tz, new Date(timestamp));\n const desiredOffset = getTimezoneOffset(buildingTimezone, new Date(timestamp));\n if (localOffset > desiredOffset) {\n const eleA = timestamp + (localOffset - desiredOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n } else {\n const eleA = timestamp + (desiredOffset - localOffset);\n return new DateTZ({date: eleA, building_tz: buildingTimezone, is_local_tz: false});\n }\n}\n\nexport const localTimezone = () => {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n}\n\nexport const getTimezoneOffsetString = (tz: string) => {\n const offset_minutes = Math.floor(getTimezoneOffset(tz) / 1000 / 60);\n const hours = Math.floor(offset_minutes/60);\n const minutes = offset_minutes % 60;\n return `${offset_minutes > 0 ? '+' : '-'}${padZero(Math.abs(hours), 2)}${padZero(minutes, 2)}`;\n}\n\nexport function toMiddayUTC(value: DateTZ = DateNow()) {\n // exclude Auckland from rouding up timezone as it has 12+ hours UTC timezone difference\n return value.building_tz.includes('Auckland') ? value : new DateTZ({\n date: value.setValue({ hour: 12, minute: 0 }).ms,\n is_local_tz: false,\n building_tz: 'UTC',\n }).setValue({ hour: 12, minute: 0 });\n}\n\n/**returns the offset between two timezones in minutes and hours */\nexport function timezoneOffset(tz: string){\n const nowTz = DateNow(new Date())\n const offset = nowTz.date.offset - nowTz.toZone(tz).date.offset\n return {minutes: offset, hours: offset/60}\n}\n\nexport function isToday (date, timezone) {\n\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: timezone\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: timezone,\n }),\n 'day'\n );\n}\n","export * from './lib/environment.module';\nexport * from './lib/version';\nexport * from './lib/environment.service'\nexport * from './lib/types'\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n providers: []\n})\nexport class EnvironmentModule {\n}\n","import {\n Inject,\n Injectable\n} from '@angular/core';\nimport { EnvironmentData } from './types';\n\nexport const ENVIRONMENT_TOKEN = 'environments_service_data';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class EnvironmentService {\n\n public get production(): boolean {\n return this.environment.production;\n }\n\n public get heap_io_id(): number {\n return this.environment.heap_io_id;\n }\n\n constructor(@Inject(ENVIRONMENT_TOKEN) private environment: EnvironmentData) {\n }\n}\n","// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\n/* tslint:disable */\nexport const VERSION = {\n \"dirty\": false,\n \"raw\": \"a592d101a\",\n \"hash\": \"a592d101a\",\n \"distance\": null,\n \"tag\": null,\n \"semver\": null,\n \"suffix\": \"a592d101a\",\n \"semverString\": null,\n \"version\": \"0.0.0\",\n \"time\": 1734294095956\n};\n/* tslint:enable */\n","export * from './lib/legacy-overlays.module';\nexport * from './lib/space-select-modal/space-select-modal.component';\nexport * from './lib/new-user-modal/new-user-modal.component';\nexport * from './lib/confirm-modal/confirm-modal.component';\nexport * from './lib/catering-confirm-modal/catering-confirm-modal.component';\nexport * from './lib/catering-details-modal/catering-details-modal.component';\nexport * from './lib/requirement-details-modal/requirement-details-modal.component';\nexport * from './lib/booking-confirm/booking-confirm.component';\nexport * from './lib/user-form/user-form.component'\nexport * from './lib/booking-form/booking-form.component'\nexport * from './lib/no-catering-modal/no-catering-modal.component'\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n Renderer2,\n ViewChild\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport { Router } from '@angular/router';\n\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n CateringOrder,\n getFirstDateFromList,\n OrganisationService,\n rulesForSpace,\n recurrenceDetails,\n SeriesAction,\n SettingsService,\n Space,\n SpacesService,\n User,\n UsersService,\n formatWhen,\n BOOKING_STATUS,\n CloseDialogService,\n DialogIds\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent,\n HashMap,\n humaniseDuration\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport interface BookingConfirmModalData {\n old_booking: Booking;\n booking: Booking;\n action?: SeriesAction\n}\n\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\n\n@Component({\n selector: 'a-booking-confirm-modal',\n templateUrl: './booking-confirm.component.html',\n styleUrls: ['./booking-confirm.component.scss']\n})\nexport class BookingConfirmComponent extends BaseDirective implements OnInit{\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** Display string for changes are being processed */\n public loading: string;\n /** Whether space availability is being checked */\n public checking_available: boolean;\n /** Whether to show all attendees */\n public show_attendees: boolean = false;\n /** Whether to show all locations */\n public show_locations: boolean;\n /** Whether to show all catering orders */\n public show_orders: boolean;\n /** Whether booking has succeeded */\n public success: boolean;\n /** Whether booking needs to be accepted */\n public readonly is_request: boolean;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n lastMomentConflict: boolean = false;\n \n @ViewChild('attendeesListRef') attendeesListRef: ElementRef;\n @ViewChild('locationsListRef') locationsListRef: ElementRef;\n @ViewChild('cateringListRef') cateringListRef: ElementRef;\n\n /** Booking to confirm changes to */\n public get old_booking(): Booking {\n return this._data.old_booking;\n }\n\n /** Booking to confirm changes to */\n public get booking(): Booking {\n return this._data.booking;\n }\n\n /** Active user */\n public get user(): User {\n return this._users.current;\n }\n\n /** Title of the displayed event */\n public get title(): string {\n return this.booking.title;\n }\n\n /** Comapny names */\n public get company(): string[] {\n return this.booking.company;\n }\n \n\n /** Display string of when the event will occur */\n public get when(): string {\n const duration_value = this.booking.duration;\n const all_day = this.booking.all_day && duration_value < 25 * 60;\n if(this.booking.is_recurrent && this.booking.recurrence_starts && this.booking.recurrence_starts.length){\n return formatWhen({all_day, ...this.recurrenceDates })\n }\n return formatWhen({\n all_day,\n startTZ: this.booking.startDateTz,\n endTZ: this.booking.endDateTz,\n displayEndTZ: this.booking.displayEndDateTz})\n }\n\n public get recurrenceDates(){\n const startTZ = getFirstDateFromList(this.booking.recurrence_starts)\n const endTZ = startTZ.addValue({minutes: this.booking.duration})\n return {startTZ, endTZ, displayEndTZ: endTZ}\n }\n\n /** Display string for the recurrence value of the booking */\n public get recurrence(): string {\n return recurrenceDetails({\n period: this.booking.recurrence_period,\n end: this.booking.recurrence_endTz,\n list: this.booking.recurrence_starts,\n interval: this.booking.recurrence_interval\n });\n }\n\n /** Display string for the event's duration */\n public get duration(): string {\n const duration_value = this.booking.duration;\n return this.booking.all_day ? 'All Day' : humaniseDuration(duration_value);\n }\n\n /** List of spaces associated with the event */\n public get spaces(): Space[] {\n return this.booking.multi_rooms;\n }\n\n /** List of attendees associated with the event not including the host */\n public get attendees(): User[] {\n const attendees = this.booking.attendees;\n return attendees.filter((i) => i.email !== this.organiser.email);\n }\n\n /** Host of the event */\n public get organiser(): User {\n return this.booking.organiser || this._users.current;\n }\n\n /** Host of the event */\n public get equipment_codes(): HashMap {\n return this.booking.equipment_codes || {};\n }\n\n /** Host of the event */\n public get catering_codes(): HashMap {\n const catering = this.catering;\n const codes = {};\n for (const order of this.catering) {\n codes[order.location_id] = order.charge_code;\n }\n return codes;\n }\n\n /** Host of the event */\n public get equipment_notes(): HashMap {\n return this.booking.notes\n .filter((note) => note.type === 'equipment')\n .reduce((map, notes) => {\n map[notes.space] = notes.message;\n return map;\n }, {});\n }\n\n /** Details about the event */\n public get notes(): string {\n return this.booking.body;\n }\n\n /** List of catering orders in the booking */\n public get catering(): CateringOrder[] {\n return (this.booking.catering || []).map((order) => {\n const space: any = this.spaces.find(\n (a_space) => a_space.email === order.location_id\n ) || {\n level: {}\n };\n const building: any =\n this._org.buildings.find((bld) => bld.id === space.level.building_id) || {};\n return new CateringOrder({\n ...order,\n location: space.local_name,\n symbol: building.currency,\n booking_date: this.booking.startDateTz.ms,\n booking_timezone: this.booking.timezone,\n });\n });\n }\n\n /** Map of changes to the booking */\n public get changes(): HashMap {\n return {};\n }\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _org: OrganisationService,\n private _bookings: BookingsService,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private _router: Router,\n private _dialog: MatDialog,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: BookingConfirmModalData,\n public settings: SettingsService,\n private closeDialogService: CloseDialogService, \n private renderer: Renderer2,\n ) {\n super();\n this.booking.time_changed =\n this.old_booking &&\n (this.old_booking.startDateTz.ms !== this.booking.startDateTz.ms ||\n this.old_booking.duration !== this.booking.duration);\n // in concierge, all bookings are acceptable without explicit approval.\n\n const rules = rulesForSpace({ user: this.user, space: this.booking.room, duration: 60 });\n this.is_request = this.settings.concierge ? false : rules.auto_approve;\n }\n\n ngOnInit(): void {\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined; \n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && (booker_concierge !== null && booker_concierge !==undefined ) && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && (booker_concierge['email'] && organiser.email !==booker_concierge['email']) ) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = 'Checking availability of selected spaces';\n this._dialog_ref.disableClose = true;\n this.checkSpaceAvailability().then(\n () => {\n this.loading = 'Processing booking request...';\n // Change the unchanged settings to the selected room\n const newEmail = this.booking.space.email;\n const replaceObjects = ['setup', 'breakdown', 'approval_status']\n replaceObjects.forEach(key => {\n const obj = this.booking[key];\n if (obj && obj.constructor === Object) {\n const keys = Object.keys(obj);\n if (keys.length > 0) {\n const replacement = {};\n keys.forEach(nk => {\n replacement[newEmail] = obj[nk];\n })\n this.booking[key] = replacement;\n }\n }\n });\n\n const buffer = {};\n this.booking.multi_rooms.map(room => room.email).forEach(elem => buffer[elem] = 900);\n\n // // if no setup or breakdown time already added and notes or catering exist? add 15 min buffer setup and breakdown to booking\n // if(this.booking.setup === null || this.booking.breakdown === null){\n // const has_note_buffer = (this.booking.notes && this.booking.notes?.length) || (this.booking.catering && this.booking.catering?.length) ? \n // buffer : null; // 900 seconds = 15 min\n // if (has_note_buffer) {\n // this.booking.setup = has_note_buffer;\n // this.booking.breakdown = has_note_buffer; \n // this.booking.room_setup = has_note_buffer; \n // this.booking.room_breakdown = has_note_buffer; \n // }\n // }\n\n // if no setup time already added and notes or catering exist? add 15 min buffer setup time to booking\n if (this.booking.setup === null || this.booking.setup === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.setup = has_note_buffer;\n this.booking.room_setup = has_note_buffer;\n }\n }\n\n // if no breakdown time already added and notes or catering exist? add 15 min buffer breakdown time to booking\n if (this.booking.breakdown === null || this.booking.breakdown === undefined) {\n const has_note_buffer = (this.booking.notes && this.booking.notes.length) || \n (this.booking.catering && this.booking.catering.length) ? \n buffer : null; // 900 seconds = 15 min\n if (has_note_buffer) {\n this.booking.breakdown = has_note_buffer;\n this.booking.room_breakdown = has_note_buffer;\n }\n }\n\n\n this._bookings.save(this.booking, this._data.action === SeriesAction.EDIT).then(\n async (bkn) => {\n this.loading = null;\n this.success = true;\n this._dialog_ref.disableClose = false;\n const updated = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this._booking_state_service.replace(updated);\n \n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(updated.recurrence_master_id !== null)\n { \n const master_booking = await this._bookings.show(updated.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n if (bkn.is_recurrent && bkn.recurrence_type === 'master') {\n this._booking_state_service.pollOnce();\n this.closeDialogService.closeDialog(DialogIds.MeetingDetails);\n }\n\n localStorage.removeItem('ACA_STAFF.booking_form_data');\n this.event.emit({ reason: 'done' });\n this._service.notifySuccess(\n `Successfully ${this.booking.id ? 'updated' : 'created'} booking`\n );\n },\n (err) => {\n\n this._dialog_ref.disableClose = false;\n let erroMessage: string = '';\n switch(err.status){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 400:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, the booking cannot be finalized because the current time has exceeded the scheduled start time for this booking. Please try again.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase 409:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\terroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.lastMomentConflict = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n },\n (err) => {\n\n this.lastMomentConflict = true;\n this._dialog_ref.disableClose = false;\n const erroMessage = 'Apologies, this room has been booked recently by another user, please try another one.';\n this.loading = erroMessage;\n this._service.notifyError(\n `Error ${this.booking.id ? 'updating' : 'creating'} booking: ${erroMessage}`\n );\n setTimeout(()=> {\n this.loading = null;\n this.event.emit({ reason: 'last-moment-conflict' });\n }, 4000) ;\n }\n );\n }\n\n /**\n * Staff only\n */\n public newBooking() {\n this._router.navigate(['/book', 'spaces']);\n this._dialog_ref.close();\n }\n\n /**\n * Staff only\n */\n public toSchedule() {\n this._router.navigate(['/schedule'], {\n queryParams: { email: this.booking.organiser.email }\n });\n this._dialog_ref.close();\n }\n\n /**\n * Check whether the selected spaces are available for the selected time period\n */\n public checkSpaceAvailability(): Promise {\n const spaces: Space[] = this.spaces;\n if (\n (this.booking.id &&\n (this.booking.startDateTz.ms === this.old_booking.startDateTz.ms &&\n this.booking.duration === this.old_booking.duration)) ||\n (spaces && spaces.length <= 0)\n ) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n // Use of this.booking.timezone is unreliable, use booking space instead.\n const all_day = this.booking.all_day;\n // R--- should be nothing to do with date as a timestamp getter\n this._spaces\n .available({\n room_ids: spaces.map((space) => space.id).join(','),\n dateTz: this.booking.startDateTz,\n duration: all_day ? 24 * 60 : this.booking.duration,\n ignore: this.booking.icaluid,\n recurrence_count: this.booking.recurrence_count,\n recurrence_period: this.booking.recurrence_period,\n recurrence_endTz: this.booking.recurrence_endTz,\n recurrence_interval: this.booking.recurrence_interval,\n recurrence_starts: this.booking.recurrence_starts,\n is_recurrent: this.booking.is_recurrent,\n recurrence_days: this.booking.recurrence_days\n })\n .then(\n (space_list) => {\n for (const space of space_list) {\n if (!space.bookable) {\n this.lastMomentConflict = true;\n return reject(\n `${space.name} is not available at the select time period.`\n );\n }\n }\n if (space_list.length < spaces.length) {\n this.lastMomentConflict = true;\n return reject(\n `${spaces[0].name} is not available at the select time period.`\n );\n }\n resolve();\n },\n (err) => reject(err)\n );\n });\n }\n\n public openConflictsModal(){\n const ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: this.booking.local_room_name,\n conflicts: this.booking.recurrence_exceptions,\n copy_conflicts: true,\n timezone: this.booking.timezone\n }\n });\n\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n if(event.reason === 'close'){\n ref.close();\n }else if(event.reason === 'action'){\n navigator.clipboard.writeText(this.conflictsText)\n }\n \n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public get conflictsText(){\n let text = ''\n this.booking.recurrence_exceptions.map((date)=>{\n const dateTZ = new DateTZ({date: date*1000});\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n text = `${text}\\n${display}${dateTZ.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n })\n return text\n }\n\n public toggleList(listType: 'attendees' | 'locations' | 'catering') {\n if (listType === 'attendees') {\n this.show_attendees ? this.collapseList(this.attendeesListRef) : this.expandList(this.attendeesListRef);\n this.show_attendees = !this.show_attendees;\n } else if (listType === 'locations') {\n this.show_locations ? this.collapseList(this.locationsListRef) : this.expandList(this.locationsListRef);\n this.show_locations = !this.show_locations;\n } else if (listType === 'catering') {\n this.show_orders ? this.collapseList(this.cateringListRef) : this.expandList(this.cateringListRef);\n this.show_orders = !this.show_orders;\n }\n }\n\n public expandList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n const listItems = listElement.getElementsByClassName('list-item');\n let totalHeight = 0;\n\n for (let i = 0; i < listItems.length; i++) {\n totalHeight += listItems[i].offsetHeight;\n }\n\n this.renderer.setStyle(listElement, 'max-height', `${totalHeight}px`);\n this.renderer.addClass(listElement, 'shown');\n }\n\n public collapseList(listRef: ElementRef) {\n const listElement = listRef.nativeElement;\n this.renderer.setStyle(listElement, 'max-height', '4.5em');\n this.renderer.removeClass(listElement, 'shown');\n }\n}\n","\n \n\n\n
\n \n \n \n \n
\n
\n\n
\n
\n
\n \n
\n
\n {{ loading }}\n
\n
\n
\n
\n\n \n \n \n
My Day\n \n\n","import {\n Component,\n Input,\n OnInit, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter \n} from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { MatDialog } from '@angular/material/dialog';\nimport { distinctUntilChanged, first, skip } from 'rxjs/operators';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n arrayWithValues,\n BookingAction,\n CateringOrder,\n SeriesAction,\n SettingsService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\n\nimport { NewUserModalComponent } from '../new-user-modal/new-user-modal.component';\nimport {\n SpaceSelectModalComponent,\n SpaceSelectModalData\n} from '../space-select-modal/space-select-modal.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { MatChipsModule} from '@angular/material/chips';\n\n\n@Component({\n selector: 'a-booking-form',\n templateUrl: './booking-form.component.html',\n styleUrls: ['./booking-form.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingFormComponent extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n /** List of available users to host bookings */\n public user_list: User[] = [];\n public nowTz: DateTZ = DateNow(new Date());\n /** From date input for date field */\n public fromDateTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n /** Last bookable date, concierge only */\n public readonly untilDateTz = DateNow(new Date()).addValue({ days: 365 }).endOfValue('day');\n public isConcierge: boolean;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\";\n // Define an array to store selected company options\n public chipOptions: any[] = [];\n public showTimeCateringWarning: boolean = false;\n\n constructor(\n private _service: ApplicationService,\n private _users: UsersService,\n private _dialog: MatDialog,\n private settingsService: SettingsService,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n this.isConcierge = this.settingsService.concierge;\n }\n\n public ngOnInit(): void {\n // Trim title \n // this.form.get('title').setValue(this.form.get('title').value.trim());\n\n this.chipOptions = [...this.form.controls.company.value];\n\n this.localTimezone = DateNow(new Date()).building_tz;\n const building_tz = (\n this.form.controls.action &&\n (\n this.form.controls.action.value === 'booking_clone' ||\n this.form.controls.action.value === 'clone' ||\n this.form.controls.action.value === 'edit' ||\n this.form.controls.action.value === 'booking_edit'\n ) &&\n this.form.controls.dateTz &&\n this.form.controls.dateTz.value\n ) ? this.form.controls.dateTz.value.building_tz : this.localTimezone;\n\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz });\n this.fromDateTz = closestToTimeSlotTz(this.nowTz, 15);\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map(\n (del) => this._users.find(del.email) || new User({ email: del.email, name: del.email.split('@')[0] })\n );\n this.user_list = [user].concat(delegates);\n });\n\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n this.subscription('formChanges', this.form.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe(() => {\n this.timeout('update_coachmark', () => {\n this.updateCoachmarkTimes(this.form.controls.timezone.value);\n }, 500);\n })\n );\n\n this.subscription('isRecurrentChanges', this.form.controls.is_recurrent.valueChanges\n .subscribe(() => {\n const recurrenceStarts = this.form.controls.recurrence_starts\n if(!this.form.controls.is_recurrent.value){\n recurrenceStarts.clearValidators() \n }else{\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n recurrenceStarts.setValidators(arrayValidators);\n }\n recurrenceStarts.updateValueAndValidity()\n })\n ); \n\n /**Disable Inputs */\n this.disableInputs();\n\n /**turn is_recurrent to false if editing or cloning a stand-alone/occurrence */\n if(this.form.controls.id?.value && !this.form.controls.action?.value){\n this.form.controls.is_recurrent.setValue(false)\n }\n\n // Subscribe to changes in dateTz, duration, and has_catering\n this.subscription('dateTz_changes', this.form.controls.dateTz.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n this.subscription('duration_changes', this.form.controls.duration.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // No need to subscribe to catering_changes since we're now handling has_catering\n this.subscription('has_catering_changes', this.form.controls.has_catering.valueChanges.subscribe(() => {\n this.checkTimeCateringWarning();\n }));\n\n // Initial check\n this.checkTimeCateringWarning();\n}\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.form.get(key).setValue(this.form.get(key).value.trim());\n }\n\n /** Whether notes and description should use the HTML editor */\n public get use_html(): boolean {\n return this._service.setting('app.booking.html_body') || false;\n }\n\n /** List of available types for bookings */\n public get booking_types(): Identity[] {\n return this._service.setting('app.booking.booking_types') || [];\n }\n\n /** Display string for the list of active spaces */\n public get spaces(): string {\n const spaces = this.form.controls.space_list.value;\n return spaces.length === 1\n ? spaces[0].local_name\n : spaces.length > 1\n ? `${spaces.length} spaces selected`\n : 'No Spaces selected';\n }\n\n public disableInputs() {\n const { id, action, needs_space, is_recurrent } = this.form.value;\n const has_id = !!id;\n const is_edit = action === BookingAction.EDIT;\n if (has_id) {\n this.form.get('is_recurrent')?.disable();\n }\n\n if(is_edit){\n this.form.get('is_multiroom')?.disable();\n }\n\n if (!this.isConcierge && !needs_space) {\n this.form.get('has_catering')?.disable();\n }\n if(has_id && is_edit && is_recurrent){\n this.form.get('dateTz')?.disable()\n this.form.patchValue({ action: null });\n }\n }\n\n /**\n * Open modal to change the space details for the booking\n */\n public openSpacesModal(): void {\n const ref = this._dialog.open(\n SpaceSelectModalComponent,\n {\n width: 'auto',\n height: 'auto',\n maxWidth: '95vw',\n data: {\n spaces: this.form.controls.space_list.value,\n dateTz: this.form.controls.dateTz.value,\n duration: this.form.controls.duration.value,\n host: this.form.controls.organiser.value,\n multiple: true,\n needsCatering: !!this.form.controls.catering?.value?.length,\n }\n }\n );\n this.subscription(\n 'new_spaces',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n let space_list = this.form.controls.space_list.value;\n space_list = event.metadata;\n this.form.controls.space_list.setValue(unique(space_list, 'id'));\n if (event.noCatering) {\n // Set has_catering to false and clear the catering list\n this.form.controls.has_catering.setValue(false);\n this.form.controls.catering?.setValue([]);\n } else {\n const catering = this.form.controls?.catering?.value.map((order: CateringOrder) => {\n order.location = space_list[0].name;\n order.location_id = space_list[0].email;\n return order;\n });\n this.form.controls.catering?.setValue(catering || []);\n }\n ref.close();\n this.unsub('new_spaces');\n }\n if (event.reason === 'close') {\n ref.close();\n this.unsub('new_spaces');\n }\n })\n );\n }\n\n /**\n * Open modal to change the recurrence details for the booking\n */\n public openNewUserModal() {\n const ref = this._dialog.open(NewUserModalComponent, {\n width: 'auto',\n height: 'auto'\n });\n this.subscription(\n 'new_user',\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const attendees = this.form.controls.attendees?.value;\n attendees.push(event.metadata);\n this.form.controls.attendees.setValue(unique(attendees, 'email'));\n ref.close();\n this.unsub('new_user');\n this.cdRef.detectChanges();\n }\n })\n );\n }\n\n // Add & Remove chip and set the value of the form control accordingly\n addCompany(event, company): void {\n if (company) {\n this.chipOptions.push(company);\n this.form.controls.company.setValue(this.chipOptions);\n }\n event.preventDefault();\n }\n\n removeOption(option: any): void {\n const index = this.chipOptions.indexOf(option);\n if (index >= 0) {\n this.chipOptions.splice(index, 1);\n }\n this.form.controls.company.setValue(this.chipOptions);\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (!timezone) timezone = this.localTimezone;\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n const dateTz = this.form.controls.dateTz.value;\n if (dateTz && localTzOffset !== buildingTzOffset) {\n const startDate = dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.form.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n this.cdRef.detectChanges();\n }\n\n public get isSeriesAction(){\n return this.form.value.action === SeriesAction.CLONE || this.form.value.action === SeriesAction.EDIT\n }\n\n onToggleChange(toggledControlName: string, is_multiroom: boolean): void {\n if (toggledControlName === 'is_recurrent') {\n // If the is_recurrent toggle is being activated, deactivate is_multiroom\n if (this.form.controls.is_recurrent?.value) {\n this.form.controls.is_multiroom?.setValue(false);\n this.form.controls.merged?.setValue(false);\n this.form.get('merged')?.disable();\n\n }\n } else if (toggledControlName === 'is_multiroom') {\n // If the is_multiroom toggle is being activated, deactivate is_recurrent\n if (this.form.controls.is_multiroom?.value) {\n this.form.controls.is_recurrent?.setValue(false);\n }\n if(is_multiroom) { \n this.form.get('merged').setValue(false);\n this.form.get('merged')?.enable() \n } else {\n this.form.get('merged').setValue(false); \n this.form.get('merged')?.disable(); }\n }\n }\n \n private checkTimeCateringWarning() {\n const dateTz = this.form.controls.dateTz.value;\n const duration = this.form.controls.duration.value;\n const hasCatering = this.form.controls.has_catering?.value;\n const cateringOrders = this.form.controls.catering?.value;\n \n if (dateTz && duration && hasCatering && cateringOrders && cateringOrders.length > 0) {\n // Create DateTime object for the start time\n const startDateTime = DateTime.fromISO(dateTz.date, { zone: dateTz.building_tz });\n \n // Calculate the end time\n const endDateTime = startDateTime.plus({ minutes: duration });\n \n // Get the date part of the startDateTime\n const bookingDate = startDateTime.startOf('day');\n\n // Define 7 am and 8 pm on the booking date\n const dayStartAt7am = bookingDate.set({ hour: 7 });\n const dayEndAt8pm = bookingDate.set({ hour: 20 });\n\n // Check if booking ends before or at 7 am, or starts at or after 8 pm\n if (endDateTime <= dayStartAt7am || startDateTime >= dayEndAt8pm) {\n // Booking is outside of catering hours and has catering selected\n this.showTimeCateringWarning = true;\n } else {\n this.showTimeCateringWarning = false;\n }\n } else {\n this.showTimeCateringWarning = false;\n }\n\n // Inform Angular that the component needs to be checked\n this.cdRef.markForCheck();\n }\n\n}\n","
\n \n \n \n
\n
\n \n Title*:\n \n \n \n\n \n {{ ( form?.get('title').errors && form?.get('title').hasError('pattern')) \n ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Title is required'}} \n \n \n
\n\n
\n \n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n
\n \n \n
\n Date and time must be in the future\n
\n
\n
\n
\n \n \n
\n \n
\n Duration is invalid. End time must be in the future\n
\n
\n
\n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n Warning: Changing the booking time outside of catering hours will drop your catering order.\n
\n
\n
\n
\n
\n Recurring booking\n
\n \n
\n Multiroom\n
\n
\n \n
\n
Merged
\n
\n \n
\n
\n \n \n
\n \n \n \n \n \n {{ user.name || user.email }}\n \n \n \n
\n
\n \n \n \n {{ form?.get('attendees').errors?.customError }}\n \n
\n
\n \n
\n \n
\n \n
\n \n \n {{ ( form?.get('company').errors && form?.get('company').hasError('pattern'))\n ? 'Some special characters (^=`~@#$%*{};:_\\\",.\\<>) are not allowed' : ''}}\n \n
\n \n
\n \n \n {{ selected }}\n
\n
\n
\n
\n\n
1\">\n \n \n \n \n {{ type.name }}\n \n \n \n
\n
\n Need a meeting space?\n \n
\n
\n \n \n Need catering?\n \n
\n
\n \n \n \n \n \n \n \n
\n\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringItem,\n OrganisationService,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringConfirmModalData {\n all_day: boolean;\n form: FormGroup;\n dateTz: DateTZ;\n}\n\n@Component({\n selector: 'a-catering-confirm-modal',\n templateUrl: './catering-confirm-modal.component.html',\n styleUrls: ['./catering-confirm-modal.component.scss']\n})\nexport class BookingCateringConfirmModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n /** List of selected items for the order */\n public item_list: CateringItem[] = [];\n\n /** Space selected for delivery */\n public get space(): Space {\n return this._spaces.find(this._data.form?.controls?.location_id?.value);\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n let date = this._data.dateTz;\n if (this._data.form && this._data.form.controls.delivery_time) {\n date = date.addValue({ minutes: this._data.form.controls.delivery_time.value });\n }\n return date.formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Form field for order items */\n public get item_field(): FormControl {\n return this._data.form.controls.items as any;\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n return this.item_list.reduce((amount, item) => {\n const price = item.price\n return amount + item.amount * price\n }, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.space || !this.space.level) {\n return 'USD';\n }\n const building = this._org.buildings.find(\n (bld) => bld.id === this.space.level.building_id\n ) || { currency: 'USD' };\n return building.currency;\n }\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _dialog_ref: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: CateringConfirmModalData\n ) {\n super();\n if (!this._data.form) {\n this._service.notifyError('No form data for order');\n this._dialog_ref.close();\n }\n }\n\n public ngOnInit(): void {\n /* istanbul ignore else */\n if (this._data.form.controls.items) {\n this.subscription(\n 'item_list',\n this._data.form.controls.items.valueChanges.subscribe((items) => {\n /* istanbul ignore else */\n if (!items || items.length <= 0) {\n this._dialog_ref.close();\n }\n })\n );\n }\n this.item_list = this._data.form.controls.items.value.map((item) => new CateringItem(item.toJSON()));\n }\n}\n","
\n
Confirm Catering Order
\n \n
\n\n
\n
\n Delivering to {{ space?.local_name || space?.simple_name || space?.settings?.room_name }} at {{ delivery_time }}\n
\n
\n \n
\n
\n \n
{{ order_cost / 100 | currency:symbol }}
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n OrganisationService,\n BookingNote,\n CateringOrder,\n Space,\n UsersService,\n CateringNotesService,\n Booking\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface CateringDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n catering: AbstractControl;\n booking: Booking\n}\n\n@Component({\n selector: 'a-catering-details-modal',\n templateUrl: './catering-details-modal.component.html',\n styleUrls: ['./catering-details-modal.component.scss']\n})\nexport class CateringDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: HashMap = {};\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return (this._data.spaces || []).filter((space) =>\n this._data.catering.value.find((order) => order.location_id === space.email)\n );\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.pattern || this.active_form.controls.code.errors?.minlength;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n return this.space_list.reduce(\n (valid, space) => valid && this.form[space.email].valid,\n true\n );\n }\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _cateringNotesService: CateringNotesService,\n @Inject(MAT_DIALOG_DATA) private _data: CateringDetailsModalData\n ) {\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type === 'catering'\n );\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = this._data.catering.value.reduce((map, order: CateringOrder) => {\n map[order.location_id] = order.charge_code;\n return map;\n }, {});\n this.generateFormFields();\n }\n\n public submit(): void {\n this.space_list.forEach((space) => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes\n const notes = this._data.notes_field.value.filter(\n (note: BookingNote) => note.type !== 'catering'\n );\n const new_notes = this.space_list.map(\n (space) =>\n ({\n author: this._data.booking.booked_by ? this._data.booking.booked_by['name'] : this._users.current.name,\n type: 'catering',\n message: this.form[space.email].controls.notes.value,\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote)\n );\n this._cateringNotesService.setNotes(new_notes);\n this._data.notes_field.setValue(notes.concat(new_notes).filter((note) => note.message));\n // Save the notes\n const orders = this._data.catering.value.map(\n (order) =>\n new CateringOrder({\n ...order,\n charge_code: this.form[order.location_id]\n ? this.form[order.location_id].controls.code.value\n : ''\n })\n );\n\n this._data.catering.setValue(orders);\n // This should go to the next\n this.event.emit({ reason: 'done' });\n } else {\n this._scrollToBottom();\n }\n }\n\n /** Generate form fields for each space */\n private generateFormFields(): void {\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space.level.building_id\n );\n \n this.needs_charge_code[space.email] = space?.filters?.charge_code || space?.settings?.charge_code || false;\n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(this.codes[space.email] || '',\n this.needs_charge_code[space.email] ?\n [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4), Validators.required ] : [Validators.pattern(/^[a-zA-Z0-9]{4,}$/), Validators.minLength(4)])\n });\n }\n }\n\n /** Scroll the content container to the bottom */\n private _scrollToBottom(): void {\n this._content_el?.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n}\n","
\n
\n \n \n \n
\n \n
\n\n
\n
\n \n
Please specify any allergies or gluten intolerances
\n
\n
\n
\n \n \n \n \n
\n
\n \n Charge Code\n *\n \n \n \n \n Note: Your booking will be confirmed before you are charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\nexport interface ConfirmModalData {\n /** Title of the modal */\n title: string;\n /** Contents of the modal */\n content: string;\n /** Text displaed on the confirmation button */\n action?: string;\n /** Icon to display on the modal */\n icon: ApplicationIcon;\n}\n\nexport const CONFIRM_METADATA = {\n height: 'auto',\n width: '24em',\n maxHeight: 'calc(100vh - 2em)',\n maxWidth: 'calc(100vw - 2em)'\n};\n\n@Component({\n selector: 'confirm-modal',\n templateUrl: './confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss']\n})\nexport class ConfirmModalComponent extends BaseDirective {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Loading state */\n public loading: string;\n\n /** Title of the confirm modal */\n public get title(): string {\n return (this._data ? this._data.title : null) || 'Confirm';\n }\n\n /** Body of the confirm modal */\n public get content(): string {\n return (this._data ? this._data.content : null) || 'Are you sure?';\n }\n\n /** Display text on the confirm button */\n public get action(): string {\n return (this._data ? this._data.action : null) || 'Ok';\n }\n\n /** Display icon properties */\n public get icon(): ApplicationIcon {\n return (this._data ? this._data.icon : null) || null;\n }\n\n constructor(\n private _dialog: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: ConfirmModalData\n ) {\n super();\n }\n\n /**\n * User confirmation of the content of the modal\n */\n public accept() {\n this.event.emit({ reason: 'done' });\n }\n}\n","
\n

{{ title || 'Confirm' }}

\n
\n\n
\n \n
\n

\n
\n
\n
\n\n
\n \n \n
\n
\n\n
\n
\n
\n \n
\n
{{ loading }}
\n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { LegacyUiModule } from '@mckinsey-converge/legacy-ui';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SpaceSelectModalComponent } from './space-select-modal/space-select-modal.component';\nimport { NewUserModalComponent } from './new-user-modal/new-user-modal.component';\nimport { ConfirmModalComponent } from './confirm-modal/confirm-modal.component';\nimport { NoCateringModalComponent } from './no-catering-modal/no-catering-modal.component';\nimport { BookingCateringConfirmModalComponent } from './catering-confirm-modal/catering-confirm-modal.component';\nimport { CateringDetailsModalComponent } from './catering-details-modal/catering-details-modal.component';\nimport { RequirementDetailsModalComponent } from './requirement-details-modal/requirement-details-modal.component';\nimport { BookingConfirmComponent } from './booking-confirm/booking-confirm.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UserFormComponent } from './user-form/user-form.component';\nimport { BookingFormComponent } from './booking-form/booking-form.component';\nimport { EditorModule } from '@tinymce/tinymce-angular';\n\nconst DECLARATIONS = [\n SpaceSelectModalComponent,\n NewUserModalComponent,\n ConfirmModalComponent,\n NoCateringModalComponent,\n BookingCateringConfirmModalComponent,\n CateringDetailsModalComponent,\n RequirementDetailsModalComponent,\n BookingConfirmComponent,\n UserFormComponent,\n BookingFormComponent,\n];\n\n@NgModule({\n imports: [\n LegacyUiModule,\n FormsModule,\n ReactiveFormsModule,\n CommonModule,\n UiModule,\n BaseModule,\n EditorModule,\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ...DECLARATIONS,\n BaseModule\n ]\n})\nexport class LegacyOverlaysModule {\n}\n","import { Component, EventEmitter, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\n\nimport { BaseDirective, DialogEvent } from '@mckinsey-converge/base';\nimport { generateUserForm, User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'new-user-modal',\n templateUrl: './new-user-modal.component.html',\n styleUrls: ['./new-user-modal.component.scss'],\n})\nexport class NewUserModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Form fields for the new user */\n public form: FormGroup;\n /** New user data store */\n public user: User;\n /** Whether user details are being saved */\n public loading: boolean;\n\n public ngOnInit(): void {\n this.user = new User();\n this.form = generateUserForm(this.user);\n }\n\n public saveChanges() {\n this.form.markAllAsTouched();\n if (this.form.valid) {\n if (!this.form.controls.email.value) {\n this.form.controls.email.setValue(\n `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`\n );\n }\n const firstName = this.form.value.first_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n const lastName = this.form.value.last_name.split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n \n const new_user = new User({\n ...this.form.value,\n name: `${firstName} ${lastName}`,\n type: 'external',\n external: true,\n visitor: true,\n });\n this.event.emit({ reason: 'done', metadata: new_user });\n }\n }\n}\n","
\n

Add External Attendee

\n \n
\n
\n \n
\n
\n \n \n
\n\n
\n
\n
\n \n
\n
\n Saving attendee...\n
\n
\n
\n
\n\n","import {\n Component,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n BaseDirective,\n DialogEvent\n} from '@mckinsey-converge/base';\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'no-catering-modal',\n templateUrl: './no-catering-modal.component.html',\n styleUrls: ['./no-catering-modal.component.scss']\n})\nexport class NoCateringModalComponent extends BaseDirective {\n constructor(\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n // /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n\n // Submit the Survey in it's current state.\n public confirm() {\n this.event.emit({ reason: 'done', noCatering: true });\n this._dialog_ref.close();\n }\n\n // Close the modal\n public cancel() {\n this.event.emit({ reason: 'close' });\n this._dialog_ref.close();\n }\n}\n","
\n \n
\n
\n
\n \n

Catering is not available for your new room selection. \n
Are you sure you want to drop order and change rooms?

\n
\n
\n \n \n \n
\n
\n
","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n BookingNote,\n OrganisationService,\n SettingsService,\n Space,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\nexport interface RequirementDetailsModalData {\n spaces: Space[];\n notes_field: AbstractControl;\n codes_field: AbstractControl;\n head_counts_field: AbstractControl;\n standalone?: boolean;\n}\n\n@Component({\n selector: 'a-requirement-details-modal',\n templateUrl: './requirement-details-modal.component.html',\n styleUrls: ['./requirement-details-modal.component.scss']\n})\nexport class RequirementDetailsModalComponent implements OnInit {\n /** Emitter for modal events */\n @Output() public event = new EventEmitter();\n /** Mapping of spaces to notes */\n public notes: HashMap = {};\n /** Mapping of spaces to cost codes */\n public codes: HashMap = {};\n /** Mapping of spaces to estimated head count */\n public head_counts: HashMap = {};\n /** Mapping of spaces to form fields */\n public form: HashMap = {};\n /** Map of spaces to whether they need a charge code */\n public needs_charge_code: boolean;\n /** Index of the active space */\n public active_space: number = 0;\n\n @ViewChild('content', { static: true }) private _content_el: ElementRef;\n\n /** List of selected spaces */\n public get space_list(): Space[] {\n return this._data.spaces;\n }\n\n public get has_recurrence(): boolean {\n return false\n }\n\n public get active_form(): FormGroup {\n return this.form[this.space_list[this.active_space].email];\n }\n\n public get invalid_charge_code(): boolean {\n return this.active_form.controls.code.errors?.minlength || this.active_form.controls.code.errors?.pattern;\n }\n\n /** Whether form fields are valid */\n public get is_valid(): boolean {\n // return this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n return this.space_list.length > 0 && this.space_list.reduce((valid, space) => valid && this.form[space.email].valid, true);\n }\n\n public isConcierge: boolean;\n public frontend: string;\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n @Inject(MAT_DIALOG_DATA) private _data: RequirementDetailsModalData,\n private _settings: SettingsService,\n ) {\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n const note_list = this._data.notes_field.value\n .filter((note: BookingNote) => note.type === 'equipment');\n this.notes = note_list.reduce((map, note) => {\n map[note.space] = note.message;\n return map;\n }, {});\n this.codes = { ...this._data.codes_field.value };\n this.head_counts = { ...this._data.head_counts_field.value };\n this.generateFormFields();\n }\n\n public submit(): void {\n // Get the email of the first space\n const firstSpaceEmail = this.space_list[0].email;\n\n // Copy values from the first space's form controls to all other spaces\n this.space_list.forEach(space => {\n if (space.email !== firstSpaceEmail) {\n this.form[space.email].controls.notes.setValue(this.form[firstSpaceEmail].controls.notes.value);\n this.form[space.email].controls.code.setValue(this.form[firstSpaceEmail].controls.code.value);\n this.form[space.email].controls.head_count.setValue(this.form[firstSpaceEmail].controls.head_count.value);\n }\n });\n\n this.space_list.forEach(space => this.form[space.email].markAllAsTouched());\n /* istanbul ignore else */\n if (this.is_valid) {\n // Update notes \n const notes = this._data.notes_field.value\n .filter((note: BookingNote) => note.type !== 'equipment');\n const new_notes = this.space_list.map(space => ({\n author: this._users.current.name,\n type: 'equipment',\n message: this.form[space.email].controls.notes.value.trim(),\n space: space.email,\n date: DateNow(new Date()).ms\n } as BookingNote));\n this._data.notes_field.setValue(notes.concat(new_notes).filter(note => note.message));\n this._data.codes_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.code.value;\n return map;\n }, {}));\n this._data.head_counts_field.setValue(this.space_list.reduce((map, space) => {\n map[space.email] = this.form[space.email].controls.head_count.value;\n return map;\n }, {}));\n this.event.emit({ reason: 'done' });\n } else {\n this._content_el.nativeElement.scrollTo({\n top: this._content_el.nativeElement.scrollHeight,\n left: 0,\n behavior: 'smooth'\n });\n }\n }\n\n /** Generate form fields for each space */\n // private generateFormFields(): void {\n // for (const space of this.space_list) {\n // const building = this._org.buildings.find(\n // bld => bld.id === space[0]?.level.building_id\n // );\n // // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n // const { filters, settings } = space;\n // const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n // const officeBasedEqCode = building?.required?.equipment_code;\n // this.needs_charge_code[space.email] = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n\n // this.form[space.email] = new FormGroup({\n // notes: new FormControl(this.notes[space.email] || ''),\n // code: new FormControl(\n // this.codes[space.email] || '',\n // this.needs_charge_code[space.email] ?\n // [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] : [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n // ),\n // head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n // });\n // }\n // }\n \n private generateFormFields(): void {\n // Initialize a variable to determine if any space needs a charge code\n let anySpaceNeedsChargeCode = false;\n \n // First pass to determine if any space needs a charge code\n for (const space of this.space_list) {\n const building = this._org.buildings.find(\n bld => bld.id === space?.level.building_id\n );\n const { filters, settings } = space;\n const roomBasedEqCode = filters?.equipment_code;\n const officeBasedEqCode = building?.required?.equipment_code;\n \n // this.needs_charge_code[space.email] = space?.settings?.equipment_code || building?.required?.equipment_code || false;\n if (roomBasedEqCode || officeBasedEqCode) {\n anySpaceNeedsChargeCode = true;\n this.needs_charge_code = true;\n break;\n } else{\n this.needs_charge_code = false;\n }\n }\n \n // Second pass to create form groups with the determined charge code requirement.\n // We show only the first space, but if one of the selected spaces needs a mandatory charge code,\n // then all spaces need a mandatory charge code\n for (const space of this.space_list) { \n this.form[space.email] = new FormGroup({\n notes: new FormControl(this.notes[space.email] || ''),\n code: new FormControl(\n this.codes[space.email] || '',\n anySpaceNeedsChargeCode ?\n [Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.minLength(4), Validators.required] :\n [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]\n ),\n head_count: new FormControl(this.head_counts[space.email] || '', [Validators.required, Validators.pattern(/^(?!0+$)/)])\n });\n }\n }\n}\n","
\n
\n \n \n \n \n {{\n this.space_list.length > 1 ? this.space_list.length + ' spaces selected' :\n this.space_list[0]?.local_name || 'No spaces selected'\n }}\n \n \n \n \n
\n \n
\n\n
\n
\n \n
\n {{\n has_recurrence && !isConcierge\n ? 'To update headcount information, add equipment or catering, please edit individual meeting occurences in My Day'\n : \"Would you like to add equipment to your booking's spaces?\"\n }}\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n Charge Code*\n \n \n \n \n Note: Your booking will be confirmed before you are\n charged.\n \n \n {{ invalid_charge_code ? 'Valid Charge Code Required' : 'Charge Code is required'}}\n \n \n
\n
\n \n Headcount Estimate*\n \n \n \n \n Note: This estimate is used to calculate catering and/or\n assign rooms. Please keep updated of any changes.\n \n \n Headcount Estimate is required\n \n \n
\n \n
\n
\n
\n\n
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n Inject,\n OnInit,\n Output,\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n Building,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n OrganisationService,\n SettingsService,\n Space,\n SpaceBookingRuleOptions,\n SpacesService,\n toggleSelectedByGroup,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n DialogEvent,\n HashMap,\n Identity,\n unique\n} from '@mckinsey-converge/base';\nimport { NoCateringModalComponent } from '../no-catering-modal/no-catering-modal.component'\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\nexport interface SpaceSelectModalData {\n /** List of selected spaces */\n spaces: Space[];\n /** Start time for availability of spaces */\n dateTz: DateTZ;\n /** Duration of the availability block to look for */\n duration: number;\n /** Host of the booking being made */\n host: User;\n /** Whether multiple spaces can be selected */\n multiple: boolean;\n /** Force zone ids */\n zone_ids?: string;\n /** Booking needs catering */\n needsCatering?: boolean,\n}\n\ninterface CustomDialogEvent extends DialogEvent {\n noCatering?: boolean;\n}\n\n@Component({\n selector: 'a-space-select-modal',\n templateUrl: './space-select-modal.component.html',\n styleUrls: ['./space-select-modal.component.scss']\n})\nexport class SpaceSelectModalComponent extends BaseDirective implements OnInit {\n /** Emitter for user action on the modal */\n @Output() public event = new EventEmitter();\n /** Whether space list is being loaded */\n public loading: boolean;\n /** List of available spaces to select from */\n public spaces: Space[] = [];\n /** Active building to filter spaces on */\n public active_building: Building;\n /** Active building to filter spaces on */\n public active_type: Identity;\n /** List of items from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public readonly change$ = new Subject();\n /** List of currently selected spaces */\n public selected_spaces: Space[] = [];\n /** Mapping as to whether a space is by request */\n public request_map: HashMap = {};\n /** Whether selected list should be shown on mobile */\n public show_list: boolean;\n\n /** host to load (only in staff) **/\n public host: User;\n\n /** List of available buildings */\n public types: Identity[] = [];\n\n public isConcierge: boolean;\n public frontend: string;\n\n /** List of available buildings */\n public get buildings(): Building[] {\n return this._org.buildings;\n }\n\n /** Whether multiple spaces can be selected */\n public get multiple(): boolean {\n return false;\n }\n\n public get has_zone(): boolean {\n return !!this._data.zone_ids;\n }\n\n public formGroup = new FormGroup({\n location: new FormControl([]),\n });\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n\n public noCateringDialogRef: MatDialogRef;\n\n /** List of zones to filter the spaces on */\n public zone_ids: string[] = [];\n\n\n public get initialBuildingIds(): string[] {\n return this._org.building ? [this._org.building.id] : [];\n }\n\n public savedSelection\n\n constructor(\n private _org: OrganisationService,\n private _users: UsersService,\n private _spaces: SpacesService,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n @Inject(MAT_DIALOG_DATA) private _data: SpaceSelectModalData\n ) {\n super();\n this.isConcierge = _settings.concierge;\n this.frontend = _settings.frontend;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n let request_id = 0;\n // Listen for input changes\n this.search_results$ = this.change$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap((bld) => {\n this.loading = true;\n const zone_ids: string[] = [];\n /* istanbul ignore else */\n if (this.active_building) {\n zone_ids.push(this.active_building.id);\n }\n\n if (bld?.includes('|')) {\n bld = this.savedSelection\n }\n\n const id = request_id;\n return this._spaces.available({\n zone_ids: bld?.length ? bld : this._data.spaces[0].building.id || zone_ids.join(','),\n dateTz: this._data.dateTz,\n duration: this._data.duration\n }).then(async (list) => ({ id, list }));\n }),\n catchError((_) => of({ id: request_id, list: [], error: _ })),\n map((resp: { id: number, list: Space[] }) => {\n this.loading = false;\n const filtered_list = resp.list.filter((space: Space) => {\n // if concierge skip rules check.\n if (this._settings.concierge) {\n return (this.active_type && this.active_type.id ? space.zones.includes(`${this.active_type.id}`) : true) &&\n !this.selected_spaces.find((s) => s.id === space.id);\n }\n\n const rules = space.rulesFor({\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this.host || this._data.host\n });\n return (\n rules.hide !== true &&\n (this.active_type && this.active_type.id\n ? space.zones.includes(`${this.active_type.id}`)\n : true) &&\n !this.selected_spaces.find((_space) => _space.id === space.id)\n );\n });\n return resp.id === request_id ? filtered_list : this.spaces;\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.spaces = list.filter((space) => {\n if (!space.available) {\n return false;\n }\n for (const zone of this.zone_ids) {\n if (space.zones.includes(zone)) {\n return true;\n }\n }\n return !this.zone_ids.length;\n });\n this.spaces.sort((a, b) => this.sort(a, b));\n if (!this.selectedOptions.value.length) {\n this.setDefaultBuilding()\n }\n })\n );\n this.active_building = this._data.spaces?.length\n ? this._org.buildings.find((i) => i.id === this._data.spaces[0].level.building_id)\n : this._org.building;\n this.types = [{ id: '', name: 'Any Space Type' } as any].concat(\n this._org.space_types || []\n );\n this.active_type = this.types[0];\n this.change$.next('');\n });\n\n this.subscription('buildings', this._org.listen('buildings').subscribe((bld_list) => {\n const city = this._org.building.city\n const timezone = this._org.building.timezone\n const grouped_by_city = {\n key: { name: city, timezone },\n value: bld_list?.filter((bld) => bld.city === city) || []\n }\n const city_buildings = grouped_by_city.value.map(\n (bld) => mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n )\n const buildings = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings\n ]\n this.options.next(buildings)\n }));\n\n }\n\n /** Add space to selected list */\n public addSpace(space: Space) {\n this.selected_spaces.push(space);\n this.selected_spaces = unique(this.selected_spaces, 'id');\n }\n\n /** Remove space from selected list */\n public removeSpace(space: Space) {\n this.selected_spaces = this.selected_spaces.filter((a_space) => a_space.id !== space.id);\n }\n\n /** Emit current state of the selected list */\n public save(list: Space[]) {\n if (!this._data.needsCatering) {\n // No catering order to warn about\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // Check if the room has catering \n if (list[0].has_catering) {\n this.event.emit({ reason: 'done', metadata: list });\n return;\n }\n // If not warn that the room doesn't have catering\n this.noCateringDialogRef = this._dialog.open(NoCateringModalComponent, {\n panelClass: 'mck-modal-mini',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.subscription(\n 'no-catering-modal',\n this.noCateringDialogRef.componentInstance.event.subscribe((event) => {\n if (event.reason === 'done') {\n this.event.emit({ reason: 'done', metadata: list, noCatering: event.noCatering });\n }\n if (event.reason === 'close') {\n this.event.emit({ reason: 'close' });\n }\n })\n );\n }\n\n private update() {\n const map = {};\n const options: SpaceBookingRuleOptions = {\n dateTz: this._data.dateTz,\n duration: this._data.duration,\n host: this._data.host\n };\n this.selected_spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.spaces.forEach((space) => (map[space.id] = space.byRequest(options)));\n this.request_map = map;\n }\n\n public setDefaultBuilding() {\n const defaultBld = this.options.value.filter(opt => opt.value === this._org.building.id)\n this.selectedOptions.next(defaultBld)\n }\n\n /**\n * Compare two spaces to determine order\n * @param space_a\n * @param space_b\n */\n public sort(space_a: Space, space_b: Space) {\n const bld = this._org.buildings.find((bld) => space_a.zones.includes(bld.id)) || { name: '', sort_order: [] };\n const bld_b = this._org.buildings.find((bld) => space_b.zones.includes(bld.id));\n if (bld && bld !== bld_b) {\n return bld.name.localeCompare(bld_b?.name);\n }\n const sort_order = [...bld.sort_order].reverse();\n for (const zone_id of sort_order) {\n if (zone_id === '*') {\n continue;\n }\n const a_has_zone = space_a.zones.indexOf(zone_id) >= 0;\n const b_has_zone = space_b.zones.indexOf(zone_id) >= 0;\n if (a_has_zone && !b_has_zone) {\n return 1;\n } else if (b_has_zone && !a_has_zone) {\n return -1;\n }\n }\n return space_a.name.localeCompare(space_b.name);\n }\n\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n const formData = this.formGroup.value;\n this.formGroup.setValue({\n location: formData.location,\n });\n this.selectedOptions.next(next);\n this.savedSelection = next.map((bld) => bld.value)\n\n });\n }\n\n /**\n * Update the selected space list\n * @param space Space to add/toggle in the selected list\n */\n public selectSpace(space: Space) {\n const list = this.spaces;\n if (list.find((item) => item.id === space.id)) {\n this.spaces = list.filter((item) => item.id !== space.id);\n } else {\n this.spaces = [space];\n }\n }\n\n public clearList() {\n this.spaces = []\n this.savedSelection = []\n }\n\n public triggerSearch = () => {\n if (this.savedSelection.length) {\n this.change$.next(this.savedSelection)\n } else {\n this.spaces = []\n }\n }\n\n}\n","
\n
Select meeting space{{ multiple ? 's' : '' }}
\n \n
\n\n
\n
\n \n \n 1\">Type\n 1\">\n \n \n {{ type?.name }}\n \n \n \n \n
\n \n \n
\n
\n
{{ space.local_name }}
\n
{{ space.level.name }}
\n
\n
\n \n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n {{ (!isConcierge && request_map[space.id]) ? 'Request' : 'Select' }}\n \n
\n
\n
\n
\n
\n
\n
\n

Selected spaces

\n
\n \n
\n \n \n
\n
\n
{{ space.name }}
\n
{{ space.level.name }}
\n
\n
\n \n
{{ space.capacity || '0' }}
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n \n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n
Loading available spaces...
\n
\n
\n\n
\n
\n \n
\n
No results available, please select another office.
\n
\n
\n\n
\n
\n \n
\n
No selected spaces
\n
\n
\n","import { Component, Input } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'user-form',\n templateUrl: './user-form.component.html',\n styleUrls: ['./user-form.component.scss']\n})\nexport class UserFormComponent {\n /** Group of form fields used for creating the system */\n @Input() public form: FormGroup;\n}\n","
\n
\n
\n First Name:\n \n \n First name is required\n \n \n
\n
\n Last Name:\n \n \n Last name is required\n \n
\n
\n Email:\n \n \n A valid email is required\n \n
\n
\n
\n","export * from './lib/legacy-ui.module';\nexport * from './lib/custom-fields';\nexport * from './lib/icon/icon.component';\nexport * from './lib/feedback/feedback.component';\nexport * from './lib/action-icon/action-icon.component';\nexport * from './lib/user-avatar/user-avatar.component';\nexport * from './lib/bookings/catering/item/item.component';\nexport * from './lib/cng-search-bar/cng-search-bar.component';\n","import { Component, OnInit, Input } from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'action-icon',\n templateUrl: './action-icon.component.html',\n styleUrls: ['./action-icon.component.scss']\n})\nexport class ActionIconComponent implements OnInit {\n /** Icon to display */\n @Input() public icon: ApplicationIcon;\n /** Whether action is being processed */\n @Input() public loading: boolean;\n /** State of the action */\n @Input() public state: 'success' | 'error' | '' = '';\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","
\n \n
\n \n
\n
\n \n
\n
\n","import {\n Component,\n Input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { FormControl } from '@angular/forms';\n\nimport {\n ApplicationService,\n CateringCategory,\n CateringItem,\n SettingsService\n} from '@mckinsey-converge/data-common';\nimport { ANIMATION_SHOW_CONTRACT_EXPAND } from '@mckinsey-converge/animations';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { PackageOptionsModalComponent } from '../package-options-modal/package-options-modal.component';\n\nfunction hasSelectionRequirements(category: CateringCategory) {\n return (\n category.must_select < category.items.length ||\n (category.must_select === category.items.length &&\n category.items.find((item: any) => item.items && item.must_select < item.items.length))\n );\n}\n\nfunction getActiveList(category: CateringCategory) {\n const items = category.items || [];\n let list = items.filter((item) => item.amount > 0).map((item) => item.id);\n for (const item of items) {\n if ((item as any).items && (item as any).items.length) {\n list = list.concat(getActiveList(item as any));\n }\n }\n return list;\n}\n\n@Component({\n selector: 'a-catering-menu-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss'],\n animations: [ANIMATION_SHOW_CONTRACT_EXPAND]\n})\nexport class CateringMenuItemComponent extends BaseDirective implements OnChanges {\n /** Whether item is a child of another */\n @Input() public subitem: boolean;\n /** Item to display */\n @Input() public item: CateringCategory;\n /** Field for storing items */\n @Input() public field: FormControl;\n /** Current symbol for the selected space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Whether to show children items */\n public show_children: boolean;\n public initial_state = null;\n\n /** List of contents of the package */\n public get contents(): string {\n return this.item.items\n ? this.item.items.reduce((list, item) => {\n /* istanbul ignore else */\n if (list) {\n list += '\\n\\n';\n }\n return (list += `${item.name}${\n (item as any).items\n ? (item as any).items.reduce(\n (a_list, an_item) =>\n (a_list += `\\n ${an_item.amount ? '✓' : '•'} ${an_item.name} `),\n ''\n )\n : ''\n } ${item.amount ? '✓' : ''}`);\n }, '')\n : '';\n }\n\n constructor(private _service: ApplicationService, private _dialog: MatDialog,\n public settings: SettingsService) {\n super();\n // on the item selection set the revert/close state\n this.initial_state = this.item;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.field && this.field) {\n const list = this.field.value;\n // check the category\n let item = list.find((an_cat) => an_cat.id === this.item.id);\n if (item) {\n // update the category level amount\n this.item.setAmount(item ? item.amount : 0);\n } else {\n // find a category item\n for (var cat of list) {\n item = cat?.items.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(item ? item.amount : 0);\n break;\n }\n }; \n } \n\n // On the confirm catering order modal set the revert/close state\n if (!this.initial_state && this.item.amount) {\n this.initial_state = this.item;\n }\n\n this.subscription(\n 'field_change',\n this.field.valueChanges.subscribe((list) => {\n const item = list.find((an_item) => an_item.id === this.item.id);\n this.item.setAmount(item ? item.amount : 0);\n this.updatePackageSelection();\n })\n );\n }\n }\n\n /**\n * Update the amount of the item in the order\n * @param value New amount\n */\n public updateAmount(value: number) {\n /* istanbul ignore else */\n if (this.field) {\n const list: CateringItem[] = this.field.value;\n const item = list.find((an_item) => an_item.id === this.item.id);\n if (item) {\n this.item.setAmount(value);\n item.setAmount(value);\n // MCK-1550 fix\n const price = this.item.price;\n item.setPrice(price)\n } else {\n const amount = this.item.amount;\n this.item.setAmount(value);\n if (\n this.item.package &&\n amount < value &&\n this.item.items &&\n this.item.items.length &&\n hasSelectionRequirements(this.item)\n ) {\n this.selectPackageOptions().then(\n (confirmed_item) => {\n list.push(new CateringCategory(confirmed_item));\n this.field.setValue(list.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n } else {\n list.push(new CateringItem(this.item));\n }\n }\n this.field.setValue(list.filter((an_item) => an_item.amount));\n }\n }\n\n public updatePackageSelection() {\n const cart_item = this.field.value.find((item) => item.id === this.item.id);\n if (cart_item) {\n const active_items = getActiveList(cart_item);\n this.timeout(\n 'update_package',\n () => {\n this.item.items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n if ((item as any).items) {\n (item as any).items.forEach((item) => {\n item.setAmount(active_items.includes(item.id) ? 1 : 0);\n });\n }\n });\n },\n 5\n );\n }\n }\n\n /** Reselect package options */\n public updatePackageOptions(): void {\n let updatedList: CateringItem[] = [];\n this.selectPackageOptions().then(\n (confirmed_item) => {\n // Update the existing category package\n this.field.value.forEach((category: CateringCategory) => {\n if (category.id === confirmed_item.id) {\n updatedList.push(new CateringCategory(confirmed_item))\n } else {\n updatedList.push(category)\n }\n })\n this.field.setValue(updatedList.filter((an_item) => an_item.amount));\n },\n () => {\n this.item.setAmount(999);\n this.timeout('amount', () => this.item.setAmount(0), 5);\n this._service.notifyWarn(\n 'Package options not selected. Item removed from order'\n );\n }\n );\n }\n\n /**\n * Open modal for user to select package options\n */\n private selectPackageOptions(): Promise {\n return new Promise((resolve, reject) => {\n const ref = this._dialog.open(PackageOptionsModalComponent, {\n maxWidth: '95vw',\n data: {\n item: new CateringCategory(this.item)\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n let done = false;\n ref.componentInstance.event.subscribe((event) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n done = true;\n resolve(ref.componentInstance.item);\n this.initial_state = this.item;\n ref.close();\n }\n });\n ref.afterClosed().subscribe(() => {\n /* istanbul ignore else */\n if (!done) {\n if (this.initial_state) {\n resolve(this.initial_state);\n } else {\n reject();\n }\n }\n });\n });\n }\n}\n","\n \n
\n
{{ item.name }}
\n
{{ item.package ? '[Package] ' : '' }}{{ item.description }}
\n
\n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n { item.availableItems.length, plural, =1 { Contains {{ item.availableItems.length }} item } other {\n Contains {{ item.availableItems.length }} items } }\n
\n 0\"\n [matTooltip]=\"contents\"\n >\n {{ item.must_select }}\n \n Selected\n \n
\n 0\"\n (click)=\"updatePackageOptions()\"\n i18n=\"Catering order item options change action\"\n >\n Customise\n \n \n \n
\n {{ item.unit_price / 100 | currency: symbol }}\n
\n \n \n \n \n\n
\n \n
\n","import {\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nimport {\n DialogEvent,\n HashMap\n} from '@mckinsey-converge/base';\nimport {\n CateringCategory,\n CateringItem\n} from '@mckinsey-converge/data-common';\n\nexport interface PackageOptionsModalData {\n item: CateringCategory;\n}\n\nexport function checkItemRequirements(category: CateringCategory): boolean {\n const items = category.items || [];\n return category.must_select >= items.length\n ? items.reduce((valid, item) => valid && checkItemRequirements(item as any), true)\n : items.reduce((amount, item) => amount + (item.amount ? 1 : 0), 0) ===\n category.must_select;\n}\n\nexport function getActiveItems(category: CateringCategory): HashMap {\n let map = {};\n if (category.items) {\n const item = category.items.find(item => item.amount > 0);\n if (item) {\n map[category.id] = item.id;\n }\n category.items.forEach(item => map = { ...map, ...getActiveItems(item as any) });\n }\n return map;\n}\n\n@Component({\n selector: 'a-package-options-modal',\n templateUrl: './package-options-modal.component.html',\n styleUrls: ['./package-options-modal.component.scss']\n})\nexport class PackageOptionsModalComponent {\n /** Emitter for user actions on the modal */\n @Output() public event = new EventEmitter();\n\n /** Item to select options for */\n public get item(): CateringCategory {\n return this._data.item;\n }\n\n /** Whether package requirements have been met */\n public get requirements_met(): boolean {\n return checkItemRequirements(this.item);\n }\n\n public get active_items(): HashMap {\n return getActiveItems(this.item);\n }\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: PackageOptionsModalData) {\n }\n\n /**\n * Update the list of selected items\n */\n public updateAmount(a_package: CateringCategory, option: CateringItem, state: boolean) {\n if (state) {\n const needed = a_package.must_select;\n const active = a_package.items.filter(an_item => an_item.amount > 0).length;\n if (active >= needed) {\n const item = a_package.items.find(an_item => an_item.amount > 0);\n item.setAmount(0);\n }\n option.setAmount(1);\n } else {\n option.setAmount(0);\n }\n }\n}\n","
\n

Package Options

\n \n
\n\n
\n \n
\n
\n\n
\n \n
\n
\n\n \n \n
\n \n 1\"\n [checked]=\"!!option.amount\"\n (change)=\"updateAmount(package, option, $event.checked)\"\n >\n {{ option.name }}\n \n \n {{ option.name }}\n \n \n = package.items.length || option.must_select\">\n {{ option.name }}\n \n \n
\n
\n
\n
\n","import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n// Interface to define the structure of the configuration object for the search bar\nexport interface SearchBarConfig {\n placeholder?: string;\n totalFoundItem?: number;\n showSrchWarning?: boolean;\n}\n\n@Component({\n selector: 'cng-search-bar',\n templateUrl: './cng-search-bar.component.html',\n styleUrls: ['./cmg-search-bar.component.scss']\n})\nexport class CngSearchBarComponent implements OnChanges {\n // Input property to accept configuration for the search bar\n @Input() config: SearchBarConfig = {\n placeholder: 'Search ...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n // Output event emitter to emit search strings to parent components\n @Output() search = new EventEmitter();\n\n // Local variable to store the search string entered by the user\n searchStr: string = '';\n\n // Lifecycle hook that is called when any data-bound property of a directive changes\n ngOnChanges(changes: SimpleChanges): void {\n // Check if the config property has changed\n if (changes.config) {\n const configChanges = changes.config.currentValue;\n // Update the config with new values or fallback to defaults\n this.config = {\n placeholder: configChanges.placeholder || 'Search ...',\n totalFoundItem: configChanges.totalFoundItem || 0,\n showSrchWarning: configChanges.showSrchWarning || false\n };\n }\n }\n\n // Method to handle the search action\n onSearch(value: string): void {\n // Emit the search string if it's not empty\n if (value) {\n this.search.emit(value);\n } else {\n this.clearSearch();\n }\n }\n\n // Method to clear the search input and reset related configurations\n clearSearch(box: HTMLInputElement | null = null): void {\n this.searchStr = '';\n if (box) {\n box.value = '';\n }\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n this.search.emit('');\n }\n\n // Method to reset the search-related warnings and item count\n resetSearch(): void {\n this.config.showSrchWarning = false;\n this.config.totalFoundItem = 0;\n }\n}\n","
\n \n \n
{{ config.totalFoundItem }}
\n \n \n \n
\n \n No search found!\n
\n
\n ","import { Directive, ElementRef, HostListener, Input } from '@angular/core';\n\n@Directive({\n selector: '[hover-class]'\n})\nexport class HoverClassDirective {\n @Input('hover-class') hoverClass: string;\n\n constructor(private elementRef: ElementRef) {}\n\n @HostListener('mouseenter') onMouseEnter() {\n this.update('add');\n }\n\n @HostListener('mouseleave') onMouseLeave() {\n this.update('remove');\n }\n\n @HostListener('blur') onBlur() {\n this.update('remove');\n }\n\n private update(action: string): void {\n this.hoverClass.split(' ').forEach(item => this.elementRef.nativeElement.classList[action](item));\n }\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'an-action-field',\n templateUrl: './action-field.component.html',\n styleUrls: ['./action-field.component.scss']\n})\nexport class ActionFieldComponent extends BaseDirective {\n /** Name of the field */\n @Input() public name: string;\n /** Value to display on the field */\n @Input() public placeholder: string;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Emitter for user interaction events */\n @Output('onAction') public on_action = new EventEmitter();\n /** Whether to show tooltip */\n public show_tooltip = false;\n\n /**\n * Emit that the user has performed an action on the field\n */\n public performAction() {\n this.show_tooltip = !this.show_tooltip;\n this.on_action.emit();\n }\n}\n","\n
{{ placeholder }}
\n
\n \n
\n\n","import { Component, forwardRef, Input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'a-counter',\n templateUrl: './counter.component.html',\n styleUrls: ['./counter.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n /* istanbul ignore next */\n useExisting: forwardRef(() => CounterComponent),\n multi: true,\n },\n ],\n})\nexport class CounterComponent implements ControlValueAccessor {\n /** Maximum amount for the counter */\n @Input() public max: number = 10;\n /** Minimum amount for the counter */\n @Input() public min: number = 0;\n\n @Input() public useInput = false;\n\n /** Current value of the counter */\n public value: number;\n public previous_value: number = 0;\n /** Whether shift key is being held by the user */\n public shift_key: boolean;\n /** Whether control key is being held by the user */\n public ctrl_key: boolean;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /**\n * Add the `step` to the current value\n */\n public add() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value += step;\n if (this.value > this.max) {\n this.value = this.max || 10;\n }\n this.setValue(this.value);\n }\n\n /** Remove the `step` from the current value */\n public remove() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : 1;\n this.value -= step;\n if (this.value < this.min) {\n this.value = this.min || 0;\n }\n this.setValue(this.value);\n }\n\n public handleTimeout = null;\n\n public onInputChange(new_value: string) {\n if (this.handleTimeout) {\n clearTimeout(this.handleTimeout);\n this.handleTimeout = null;\n }\n this.handleTimeout = setTimeout(() => this.changeInput(new_value), 500);\n }\n\n public changeInput(new_value: string) {\n let value = Number(new_value);\n if (isNaN(value)) {\n value = this.previous_value;\n }\n if (value < this.min) {\n value = this.min || 0;\n }\n if (value > this.max) {\n value = this.max || 10;\n }\n this.setValue(value);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.previous_value = new_value;\n this.value = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.value = value;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","\n \n \n
\n {{value || '0'}}\n
\n \n\n","import { Component, OnInit, forwardRef, Input, ViewChild, Output, EventEmitter } from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { MatMenuTrigger } from '@angular/material/menu';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-date-field',\n templateUrl: './date-field.component.html',\n styleUrls: ['./date-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateFieldComponent),\n multi: true\n }\n ]\n})\nexport class DateFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n /** Optional event emitter for changes */\n @Output() public onChange = new EventEmitter();\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Currently selected date */\n public date: number;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n /** Display value for the current date */\n public get date_string(): string {\n // R--- Needs TZ aware inputs\n const date = new DateTZ({date: this.date})\n return date.formatDate('dd MMM yyyy');\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public ngOnInit() {\n this.date = DateNow(new Date()).ms;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = new DateTZ({date: this.date });\n const new_d = new DateTZ({date: new_value})\n let new_date = new_d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n this.date = new_date;\n if (this._onChange) {\n this._onChange(new_date);\n this.onChange.emit(new_date);\n }\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","\n
{{ date_string }}
\n
\n \n
\n\n\n
\n \n
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport {\n humaniseDuration,\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-duration-field',\n templateUrl: './duration-field.component.html',\n styleUrls: ['./duration-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ]\n})\nexport class DurationFieldComponent extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor {\n /** Maximum duration option available */\n @Input() public max: number = 240;\n /** Minimum duration option available */\n @Input() public min: number = 15;\n /** Step value between options */\n @Input() public step: number = 15;\n /** Reference time for displaying next to durations */\n @Input() public time: number;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Special case prepopulation i.e. out of step options */\n @Input() public specialPreprops: Array = [];\n /** Whether form all_day is enabled. */\n @Input() public all_day: boolean = false;\n\n public duration: number = 60;\n /** List of available duration options */\n public duration_options: Identity[];\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n public ngOnInit(): void {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.max || changes.min || changes.step || changes.time || changes.all_day) {\n this.duration_options = this.generateDurationOptions(this.max, this.min, this.step, this.all_day);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.duration = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(+new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.duration = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n private generateDurationOptions(max: number, min: number, step: number, all_day: boolean = false): Identity[] {\n const blocks: Identity[] = [];\n let time = min;\n // R--- Change input to dateTz\n let date = this.time ? new DateTZ({date: this.time}) : null;\n\n // Add special case for 10min duration/prepropulation\n for (const option of this.specialPreprops) {\n blocks.push({\n id: option,\n name: date\n ? `${date.addValue({ minutes: option }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(option)})`\n : `${humaniseDuration(option)}`\n });\n }\n\n\n while (time <= max) {\n blocks.push({\n id: time,\n name: date\n ? `${date.addValue({ minutes: time }).formatDate(timeFormatString()).toLocaleLowerCase()} (${humaniseDuration(time)})`\n : `${humaniseDuration(time)}`\n });\n time += step;\n }\n if (all_day) {\n blocks.push({ id: 24 * 60, name: 'All Day' }); \n }\n blocks.push({ id: 7 * 24 * 60, name: '1 week' });\n return blocks;\n }\n}\n","
\n \n \n \n {{ option.name }}\n \n \n \n
\n","export * from './action-field/action-field.component'\nexport * from './counter/counter.component'\nexport * from './date-field/date-field.component'\nexport * from './duration-field/duration-field.component'\nexport * from './time-field/time-field.component'\nexport * from './user-search-field/user-search-field.component'\nexport * from './user-list-field/user-list-field.component'\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n Identity,\n timeFormatString\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'a-time-field',\n templateUrl: './time-field.component.html',\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ]\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n /** Time step between each allowed time option */\n @Input() public step: number = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public no_past_times: boolean = true;\n /** String representing the currently set time */\n public date: number = DateNow(new Date()).ms;\n /** String representing the currently set time */\n public time: string = DateNow(new Date()).formatDate('HH:mm');\n /** Available time blocks for the selected date */\n public _time_options: Identity[];\n /** Whether select field should be shown */\n public show_select: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n // R--- This is the form input that needs to be TZ active.\n public ngOnInit(): void {\n this.show_select = true;\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n this.timeout('hide', () => this.show_select = false);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step) {\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n }\n\n public get date_(){\n return new DateTZ({date: this.date})\n }\n\n /** Available time blocks for the selected date */\n public get time_options() {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] });\n if (date.minutes % 15 !== 0 && !this._time_options.find(time => time.id === date.formatDate('HH:mm'))) {\n this._time_options.push({\n name: `${date.formatDate(timeFormatString())}`,\n id: date.formatDate('HH:mm')\n });\n this._time_options.sort((a, b) => `${a.id}`.localeCompare(`${b.id}`));\n }\n return this._time_options;\n }\n\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.time = new_value;\n if (this._onChange) {\n const time = (this.time || '00:00').split(':');\n const date = this.date_.setValue({ hour: +time[0], minute: +time[1] }).startOfValue('minute');\n this._onChange(date.ms);\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n if (!value) {\n return;\n }\n this.date = value;\n let date = this.date_.startOfValue('minute');\n date = date.setValue({ minute: Math.ceil(date.minutes / 5) * 5 });\n this.time = date.formatDate('HH:mm');\n this._time_options = this.generateAvailableTimes(this.date, !this.no_past_times, this.step);\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Show select field for time options\n */\n public showSelect() {\n this.show_select = true;\n this.timeout('on_shown', () => {\n if (this.select_field) {\n this.select_field.focus();\n this.select_field.open();\n this.subscription('listen_close', this.select_field.openedChange.subscribe((state) => {\n if (!state) {\n this.show_select = false;\n }\n }));\n }\n });\n }\n\n /**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n private generateAvailableTimes(datestamp: number, show_past: boolean, step: number = 15): Identity[] {\n let date = new DateTZ({date: datestamp});\n const blocks = [];\n if (show_past || date.isAfterDate(DateNow(new Date()))) {\n date = date.startOfValue('day');\n } else if (date.isAfterDate(DateNow(new Date()))) {\n date = DateNow(new Date());\n }\n date = date.setValue({ minute: Math.ceil(date.minutes / step) * step });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n name: `${date.formatDate(timeFormatString()).toLocaleLowerCase()}`,\n id: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n }\n}\n","\n
\n \n
\n
\n \n
\n\n\n \n \n {{ option.name }}\n \n \n\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n tap,\n map,\n switchMap,\n finalize\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n csvToJson,\n downloadFile,\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-list-field',\n templateUrl: './user-list-field.component.html',\n styleUrls: ['./user-list-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserListFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserListFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Number of characters needed before a search will start */\n @Input() public limit: number = 3;\n /** Emitter for action to make a new user */\n @Output('newUser') public new_user = new EventEmitter();\n\n /** User list to display */\n public user_list: User[];\n /** List of active selected users on the list */\n public active_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** String */\n public search_str: string;\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User[]) => void;\n /** Form control on touch handler */\n private _onTouch: (_: User[]) => void;\n\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n\n constructor(private _service: ApplicationService, private _users: UsersService, private cdRef: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit() {\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(100),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query.slice(0, Math.max(this.limit, 3)),\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription(\n 'search_results',\n this.search_results$.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n })\n );\n }\n\n /**\n * Add user to the user list\n * @param user\n */\n public addUser(user: User) {\n /* istanbul ignore else */\n if (!this.active_list) {\n this.active_list = [];\n }\n const index = this.active_list.findIndex((a_user) => a_user.id === user.id);\n /* istanbul ignore else */\n if (index < 0) {\n this.active_list = [...this.active_list, user];\n }\n this.setValue(this.active_list);\n this.search_str = '';\n }\n\n /**\n * Remove user from the user list\n * @param user\n */\n public removeUser(user: User) {\n this.active_list = this.active_list.filter((a_user) => a_user.id !== user.id);\n this.setValue(this.active_list);\n }\n\n /**\n * Load CSV file and populate the user list with the contents\n * @param event File input field event\n */\n public addUsersFromFile(event) {\n /* istanbul ignore else */\n if (event.target) {\n const file = event.target.files[0];\n /* istanbul ignore else */\n if (file) {\n const reader = new FileReader();\n reader.readAsText(file, 'UTF-8');\n reader.addEventListener('load', (evt) => {\n this.processCsvData((evt.srcElement as any).result);\n event.target.value = '';\n this.cdRef.detectChanges();\n });\n reader.addEventListener('error', (_) =>\n this._service.notifyError('Error reading file.')\n );\n }\n }\n }\n\n /**\n * Process raw CSV data and save user data to attendee list\n * @param data CSV data\n */\n private processCsvData(data: string) {\n const list = csvToJson(data) || [];\n const id = this._users.current.staff_code; \n list.forEach((el) => {\n const firstName = el.first_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n const lastName = el.last_name.split(' ').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n\n el.name = el.name || `${firstName} ${lastName}`;\n const display = (el.name || `${Math.floor(Math.random() * 9999_9999)}`)\n .split(' ')\n .join('_')\n .toLowerCase();\n /* istanbul ignore else */\n if (!el.email) {\n el.email = `${display}+${id}@guest.mckinsey.com`;\n }\n el.type = 'external';\n el.external = !el.email.endsWith(\"@mckinsey.com\") && !el.email.endsWith(\"@external.mckinsey.com\");\n this.addUser(new User(el));\n });\n }\n\n /* istanbul ignore next */\n /** Download template CSV file */\n public downloadCSVTemplate() {\n const template = `Organisation Name,First Name,Last Name,Email,Phone\\nFake Org,John,Smith,john.smith@example.com,01234567898`;\n downloadFile('template.csv', template);\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User[]): void {\n this.active_list = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User[]) {\n this.active_list = value;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User[]) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: User[]) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n \n \n \n
\n
\n \n \n {{ user.name }}\n \n \n \n
\n
\n\n
No attendees
\n
\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewChild\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n map,\n switchMap\n} from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n User,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n filterList,\n matchToHighlight\n} from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'a-user-search-field',\n templateUrl: './user-search-field.component.html',\n styleUrls: ['./user-search-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => UserSearchFieldComponent),\n multi: true\n }\n ]\n})\nexport class UserSearchFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Limit available options to these */\n @Input() public options: User[];\n /** Currently selected user */\n public active_user: User;\n /** User list to display */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Current display value of the search input field */\n public search_str: string = '';\n /** List of users from an API search */\n public search_results$: Observable;\n /** Subject holding the value of the search */\n public search$ = new Subject();\n\n /** Form control on change handler */\n private _onChange: (_: User) => void;\n /** Form control on touch handler */\n private _onTouch: () => void;\n @ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) inputAutoComplete: MatAutocompleteTrigger;\n \n constructor(private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Listen for input changes\n this.search_results$ = this.search$.pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap(query => {\n this.loading = true;\n return this.options && this.options.length > 0\n ? Promise.resolve(this.options)\n : query.length >= 3\n ? (this._users.query({ q: query, cache: 60 * 1000 }) as Promise)\n : Promise.resolve([]);\n }),\n catchError((err) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return filterList(this.search_str, list, ['name', 'email']);\n })\n );\n // Process API results\n this.subscription('search_results', this.search_results$.subscribe(list => {\n this.user_list = list;\n this.user_list.length ? this.inputAutoComplete.openPanel() : this.inputAutoComplete.closePanel();\n }));\n }\n\n /** Handle input changes */\n public onInputChange(value: string): void {\n this.search_str = value;\n this.search$.next(value);\n }\n\n /**\n * Reset the search string back to the name of the active user\n */\n public resetSearchString(): void {\n if (this.active_user) {\n this.search_str = this.active_user.name;\n } else {\n this.search_str = '';\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: User): void {\n this.active_user = new_value;\n if (this._onChange) {\n this._onChange(new_value);\n }\n this.resetSearchString();\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: User): void {\n this.active_user = value;\n this.search_str = value ? value.name : '';\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: User) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: () => void): void {\n this._onTouch = fn;\n }\n\n /** Function to display the user's name in the input field */\n public displayFn(user?: User): string {\n return user ? user.name : '';\n }\n}\n","
\n \n \n
\n \n
\n
\n \n
\n
\n \n \n
{{ option.name }}
\n
{{ option.email }}
\n
\n
\n
\n","import { Component, OnInit } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'feedback',\n templateUrl: './feedback.component.html',\n styleUrls: ['./feedback.component.scss'],\n})\nexport class FeedbackComponent extends BaseDirective implements OnInit {\n /** Name of the currently active page */\n public current_page: string;\n\n constructor(private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title), 1000);\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.current_page = location;\n }\n}\n","\n
\n Feedback\n \n \n \n
\n
\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-icon',\n templateUrl: './icon.component.html',\n styleUrls: ['./icon.component.scss']\n})\nexport class IconComponent extends BaseDirective {\n @Input() public icon: ApplicationIcon;\n}\n","
\n {{ icon.content }}\n \n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n ActionFieldComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserListFieldComponent,\n UserSearchFieldComponent\n} from './custom-fields';\nimport { IconComponent } from './icon/icon.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { ACA_PIPES_MODULE } from '@acaprojects/ngx-pipes';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { FeedbackComponent } from './feedback/feedback.component';\nimport { ActionIconComponent } from './action-icon/action-icon.component';\nimport { PopoutMenuComponent } from './popout-menu/popout-menu.component';\nimport { SearchbarComponent } from './searchbar/searchbar.component';\nimport { UserAvatarComponent } from './user-avatar/user-avatar.component';\nimport { CateringMenuItemComponent } from './bookings/catering/item/item.component';\nimport { PackageOptionsModalComponent } from './bookings/catering/package-options-modal/package-options-modal.component';\nimport { BaseModule } from '@mckinsey-converge/base';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { CngSearchBarComponent } from './cng-search-bar/cng-search-bar.component';\nimport { HoverClassDirective } from './cng-search-bar/hover-class.directive';\n\nconst DECLARATIONS = [\n ActionFieldComponent,\n IconComponent,\n CounterComponent,\n DateFieldComponent,\n DurationFieldComponent,\n TimeFieldComponent,\n UserSearchFieldComponent,\n UserListFieldComponent,\n FeedbackComponent,\n ActionIconComponent,\n PopoutMenuComponent,\n SearchbarComponent,\n UserAvatarComponent,\n CateringMenuItemComponent,\n PackageOptionsModalComponent,\n CngSearchBarComponent,\n HoverClassDirective\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\n@NgModule({\n imports: [\n CommonModule,\n ACA_PIPES_MODULE,\n FormsModule,\n ReactiveFormsModule,\n ...MATERIAL_MODULES,\n BaseModule,\n UiModule\n ],\n declarations: [\n ...DECLARATIONS\n ],\n exports: [\n ACA_PIPES_MODULE,\n ...DECLARATIONS,\n ...MATERIAL_MODULES,\n BaseModule,\n ]\n})\nexport class LegacyUiModule {\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { ApplicationIcon } from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nexport interface PopoutAction extends ApplicationIcon {\n /** ID of the action */\n id: string;\n}\n\n@Component({\n selector: 'a-popout-menu',\n templateUrl: './popout-menu.component.html',\n styleUrls: ['./popout-menu.component.scss']\n})\nexport class PopoutMenuComponent extends BaseDirective {\n /** List of available actions */\n @Input() public actions: PopoutAction[] = [];\n /** Emitter for user actions */\n @Output() public action = new EventEmitter();\n /** Whether actions should show */\n public show: boolean;\n\n public close() {\n this.timeout('close', () => {\n this.show = false;\n });\n }\n}\n","\n \n\n\n","import { Component, OnInit, Input, EventEmitter, Output, ViewChild, ElementRef, SimpleChanges, OnChanges } from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'a-searchbar',\n templateUrl: './searchbar.component.html',\n styleUrls: ['./searchbar.component.scss']\n})\nexport class SearchbarComponent extends BaseDirective implements OnChanges {\n /** Current contents of the searchbar input */\n @Input('value') public value: string;\n /** Current contents of the searchbar input */\n @Input() public placeholder: string;\n /** Whether external changes are being processed */\n @Input() public loading: boolean;\n /** Whether external changes are being processed */\n @Input() public autofocus: boolean;\n /** Emitter for changes to the searchbar value */\n @Output() public valueChange = new EventEmitter();\n /** Input field reference */\n @ViewChild('input', { static: true }) private input_field: ElementRef;\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.autofocus && this.autofocus) {\n this.focusField()\n }\n }\n\n public focusField() {\n /* istanbul ignore else */\n if (this.input_field && this.input_field.nativeElement) {\n this.input_field.nativeElement.focus();\n }\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n","import { Component, Input } from '@angular/core';\nimport { User } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-user-avatar',\n templateUrl: './user-avatar.component.html',\n styleUrls: ['./user-avatar.component.scss']\n})\nexport class UserAvatarComponent {\n /** User to display avatar for */\n @Input() public user: User;\n\n public get initials(): string {\n if (!this.user) {\n return 'NA';\n }\n const parts = this.user.name.split(' ');\n return parts.length > 1\n ? `${parts[0][0]}${parts[parts.length - 1][0]}`\n : this.user.name.slice(0, 2);\n }\n}\n","
\n
{{ initials }}
\n
\n\n \n\n","export * from './lib/loading.actions'\nexport * from './lib/loading.model'\nexport * from './lib/loading.effects'\nexport * from './lib/loading.selectors'\nexport * from '../testing'\n","import {\n createAction,\n createSelector,\n on,\n On,\n props\n} from '@ngrx/store';\nimport {\n LoadingModel,\n wrapLoading\n} from './loading.model';\nimport {\n selectIsLoading,\n selectOptionalError,\n selectOptionalSuccess,\n selectSuccess\n} from './loading.selectors';\nimport { MemoizedSelector } from '@ngrx/store/src/selector';\nimport {\n ActionCreator,\n NotAllowedCheck,\n TypedAction\n} from '@ngrx/store/src/models';\nimport { HashMap } from '@mckinsey-converge/base';\n\nexport interface Payload {\n payload: T\n}\n\nexport type LoadingAction = T & TypedAction\nexport type LoadingActionCreator = T extends null | undefined ?\n ActionCreator TypedAction>\n : ActionCreator) => LoadingAction>\n\ntype ClearAction = ActionCreator TypedAction>\n\ninterface Selectors {\n success: MemoizedSelector\n optionalSuccess: MemoizedSelector\n error: MemoizedSelector\n loading: MemoizedSelector\n model: (TState) => LoadingModel\n}\n\nexport interface LoadingActionObject {\n request: LoadingActionCreator\n success: LoadingActionCreator>\n error: LoadingActionCreator>\n clear: ClearAction,\n ons: On[],\n selectors: Selectors\n}\n\n/**\n * Creates a {@link LoadingActionObject} that contains a set of ActionCreators\n * for request, success, error, loading, and clear data. Also, it contains\n * the necessary On reducers and selectors in order to properly connect them in\n * a standardized way to data in the application.\n *\n * `TState` is the type of data on your reducer, not global store.\n * `TRequest` is an object type to use in request methods.\n * `TSuccess` is the object type of the T parameter on `LoadingModel`.\n *\n * This assumes you have state represented by:\n * ```typescript\n * interface SomeState {\n * stateKey: LoadingModel\n * }\n * ```\n *\n * To dispatch an action:\n * ```typescript\n *\n * // request parameters depend on the object type used as second type parameter\n * // in createLoadingAction\n * this.store.dispatch(someLoadingAction.request())\n *\n * // action created with createLoadingAction\n * this.store.dispatch(someLoadingAction.request({\n * name: 'Andrew G',\n * age: 24\n * }))\n *\n * ```\n *\n * The generated selectors only select data from its fractured state, not the global\n * store. In order to use them, make sure you {@link select} the global state\n * before using them:\n *\n * ```typescript\n *\n * this.store.pipe(\n * select(selectSomeState),\n * select(someLoadingAction.selectors.success)\n * ).subscribe(next => {\n *\n * })\n *\n * ```\n *\n * @param actionPrefix - Prefixes actions to uniquely identify them.\n * @param stateKey - The field within the reducer state to set data on.\n */\nexport const createLoadingAction = (\n actionPrefix: string,\n stateKey: keyof TState\n): LoadingActionObject => {\n const buildAction = (postfix: string) => `[${actionPrefix}] ${postfix}`;\n // @ts-ignore\n const request = createAction(buildAction('request'), props());\n const success = createAction(buildAction('success'), props>());\n const error = createAction(buildAction('error'), props>());\n const clear = createAction(buildAction('clear'));\n const ons: On[] = [\n on(request, (state: TState & HashMap>, action: LoadingAction) =>\n ({\n ...state,\n [stateKey]: wrapLoading(state[stateKey]).loading()\n })),\n on(success, (state: TState & HashMap>, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.success(action.payload)\n })),\n // some reason specifying state like in success and request does not work.\n on(error, (state: any, action: LoadingAction>) => ({\n ...state,\n [stateKey]: LoadingModel.error(action.payload)\n })),\n on(clear, () => ({\n ...this.state,\n [stateKey]: LoadingModel.empty()\n }))\n ];\n const selectData = (state: TState) => {\n if (!state) {\n console.warn('[LoadingActions] State is empty for key', stateKey);\n }\n return wrapLoading(state?.[stateKey] as unknown as LoadingModel);\n };\n const selSuccess = createSelector, TSuccess>(\n selectData,\n selectSuccess\n );\n const selOptionalSuccess = createSelector(\n selectData,\n selectOptionalSuccess\n );\n const selError = createSelector(\n selectData,\n selectOptionalError\n );\n const selLoading = createSelector(\n selectData,\n selectIsLoading\n );\n return {\n request,\n success,\n error,\n clear,\n ons,\n selectors: {\n success: selSuccess,\n optionalSuccess: selOptionalSuccess,\n error: selError,\n loading: selLoading,\n model: selectData\n }\n };\n};\n","import {\n Actions,\n ofType\n} from '@ngrx/effects';\n\nimport { \n LoadingAction,\n LoadingActionObject\n} from '../../../loading/src/lib/loading.actions';\n\nimport {\n catchError,\n flatMap,\n map\n} from 'rxjs/operators';\nimport {\n Observable,\n of\n} from 'rxjs';\nimport { TypedAction } from '@ngrx/store/src/models';\n\n/**\n * This creates an effect to use in Effects classes. This coordinates a simple\n * success and error payload effect.\n * @param actions - The actions object\n * @param actionObject - The created createLoadingAction object.\n * @param caller - Define what API method or asynchronous operation is needed to\n * run this. Return TSuccess.\n */\nexport const createLoadingEffect = (\n actions: Actions, actionObject: LoadingActionObject,\n caller: (action: LoadingAction) => Promise): Observable> => actions.pipe(\n ofType(actionObject.request),\n flatMap((action) => caller(action as LoadingAction)),\n map((response: TSuccess) => actionObject.success({ payload: response })),\n catchError(err => {\n return of(actionObject.error({ payload: err }));\n })\n);\n","/* eslint-disable no-underscore-dangle,no-useless-constructor */\n/**\n * Wraps around the typical data objects we write for success, error, loading, and empty state. This convenience\n * wrapper consolidates all of that logic into a handy wrapper.\n */\nexport class LoadingModel {\n static empty = () => new LoadingModel(false, false, false, undefined);\n\n static success = (success?: T): LoadingModel =>\n new LoadingModel(false, false, true, success);\n\n static error = (error?: Error, optionalSuccess?: T): LoadingModel =>\n new LoadingModel(false, true, false, optionalSuccess, error);\n\n /**\n * Mutates the model with a success state, preserving other state fields.\n * @param success - override success state.\n */\n mutate = (\n success: T2 | null) => new LoadingModel(\n this.isLoading,\n this.hasError,\n !!success,\n !success ? undefined : success\n );\n\n loading = (success: T | null = this.success) =>\n new LoadingModel(\n true,\n false,\n !!success && this.hasSuccess,\n !success ? undefined : success\n );\n\n public get success(): T {\n return this._success as T;\n }\n\n public get optionalSuccess(): T | undefined {\n return this._success;\n }\n\n constructor(\n public isLoading: boolean,\n private hasError: boolean,\n private hasSuccess: boolean,\n private _success?: T,\n public error?: Error\n ) {\n }\n\n isEmpty = () => !this.isSuccess() && !this.isError();\n\n hasLoaded = () => !this.isEmpty() && !this.isLoading;\n\n isSuccess = () => this.hasSuccess;\n\n isError = () => this.hasError;\n\n shouldLoad = () => !this.isSuccess() && !this.isLoading;\n\n public toString = () =>\n `Loading: ${this.isLoading}, Success: ${this.hasSuccess}:**${this._success}**, ` +\n `Error: ${this.hasError}:${this.error}`;\n}\n\n/**\n * Wraps an object that conforms to LoadingModel to restore object loss from\n * hydrating state during development.\n */\nexport const wrapLoading = (loading: any): LoadingModel => {\n if (loading instanceof LoadingModel) {\n return loading;\n } else {\n if (!loading) {\n return LoadingModel.empty();\n } else {\n return new LoadingModel(\n loading.isLoading || false,\n loading.hasError || false,\n loading.hasSuccess || false,\n loading._success,\n loading.error\n );\n }\n }\n};\n","import { LoadingModel, wrapLoading } from './loading.model';\n\nexport const selectSuccess = (state: LoadingModel) =>\n wrapLoading(state).success;\nexport const selectOptionalSuccess = (state: LoadingModel) =>\n wrapLoading(state).optionalSuccess;\nexport const selectIsLoading = (state: LoadingModel) =>\n wrapLoading(state).isLoading;\nexport const selectIsSuccess = (state: LoadingModel) =>\n wrapLoading(state).isSuccess();\nexport const selectOptionalError = (state: LoadingModel) =>\n wrapLoading(state).error;\nexport const selectIsError = (state: LoadingModel) =>\n wrapLoading(state).isError();\nexport const selectHasLoaded = (state: LoadingModel) =>\n wrapLoading(state).hasLoaded();\nexport const selectIsEmpty = (state: LoadingModel) =>\n wrapLoading(state).isEmpty();\n\n","import {\n Observable,\n Subject\n} from 'rxjs';\nimport { Action } from '@ngrx/store';\nimport { Actions } from '@ngrx/effects';\nimport { TypedAction } from '@ngrx/store/src/models';\nimport { take } from 'rxjs/operators';\nimport {\n LoadingActionObject\n} from '../src/lib/loading.actions';\n\nexport const generateMockActions = () => {\n const dispatcher = new Subject();\n return {\n dispatcher,\n actions: new Actions(dispatcher)\n };\n};\n\n/**\n * Simple verifier that checks if the request action results in a success returned.\n */\nexport const verifyActionSuccess = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n data: TSuccess,\n payload?: TRequest,\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.success({ payload: options.data }));\n};\n\n/**\n * Simple verifier that checks if the request action results in a failure returned.\n */\nexport const verifyActionError = (\n action: LoadingActionObject,\n effect: Observable>,\n dispatcher: Subject,\n options: {\n error: Error,\n payload?: TRequest\n }) => {\n let result: TypedAction;\n effect\n .pipe(take(1))\n .subscribe(next => {\n result = next;\n });\n // payload has type issues, just ignore them since we specify TRequest as type param already.\n dispatcher.next(action.request((options.payload || {}) as never));\n\n expect(result).toBeDefined();\n expect(result).toStrictEqual(action.error({ payload: options.error }));\n};\n","export * from './effects.testing'\n","export * from './lib/organisation.module';\nexport * from './lib/organisation.actions';\n","import { OrganisationState } from './organisation.reducer';\nimport { createLoadingAction } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\n\nexport const organisationStateSelector = (state: { organisation: OrganisationState }) => state.organisation;\n\nexport const loadOrganisations = createLoadingAction('Organisation', 'data');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadOrganisations } from './organisation.actions';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\n\n\n@Injectable()\nexport class OrganisationEffects {\n\n constructor(private actions: Actions,\n private organisationService: OrganisationService) {\n }\n\n @Effect()\n public loadOrganisations = createLoadingEffect(this.actions, loadOrganisations,\n () => this.organisationService.loadOrganisation())\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { organisationReducer } from './organisation.reducer';\nimport { OrganisationEffects } from './organisation.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([\n OrganisationEffects\n ]),\n StoreModule.forFeature('organisation', organisationReducer)\n ]\n})\nexport class OrganisationModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { Organisation } from '@mckinsey-converge/data-common';\nimport { createReducer } from '@ngrx/store';\nimport { loadOrganisations } from './organisation.actions';\n\nexport interface OrganisationState {\n data: LoadingModel\n}\n\nconst initialState: OrganisationState = {\n data: LoadingModel.empty()\n};\n\nexport const organisationReducer = createReducer(initialState,\n ...loadOrganisations.ons);\n","export * from './lib/rooms.module';\nexport * from './lib/rooms.actions'\nexport * from './lib/rooms.reducer'\nexport * from './lib/rooms.types'\nexport * from './lib/rooms.utils'\n","import { createLoadingAction } from '../../../loading/src/lib/loading.actions';\nimport { Space } from '../../../data-common/src/lib/spaces/space.class';\nimport {\n RoomQueryOptions,\n RoomState,\n RoomStoreState\n} from './rooms.types';\nimport {\n createAction,\n createSelector,\n props\n} from '@ngrx/store';\n\nexport const roomStateSelector = (state: RoomStoreState) => state.rooms;\n\nexport const loadRoomsWithQuery = createAction('[Rooms] Load Rooms with query', props());\n\nexport const loadRoomsForResults = createLoadingAction('Rooms', 'query');\n\nexport const loadRoomsForResultsMap = createLoadingAction('Rooms for map', 'query');\n\n\nexport const loadLaterThatDayResults = createLoadingAction('Later Rooms', 'later');\n\nexport const loadNextDayResults = createLoadingAction('Next Day Rooms', 'next');\n\nexport const loadByIdResults = createLoadingAction('By Id Rooms', 'byid');\n\nexport const selectRoomResultsSuccess = createSelector(roomStateSelector,\n loadRoomsForResults.selectors.optionalSuccess);\n\nexport const loadDiffSizeResults = createLoadingAction('Different Size Rooms', 'size');\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect,\n ofType\n} from '@ngrx/effects';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport {\n createLoadingEffect,\n LoadingAction\n} from '@mckinsey-converge/loading';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n loadRoomsWithQuery,\n loadByIdResults,\n loadDiffSizeResults\n} from './rooms.actions';\nimport { mergeMap } from 'rxjs/operators';\nimport {\n laterThatDayFromDateTz,\n nextBusinessDay,\n} from './rooms.utils';\nimport {\n RoomQueryOptions,\n roomQueryOptionsToSpaceAvailabilityOptions,\n roomByIdQueryOptionsToSpaceAvailabilityOptions\n} from './rooms.types';\n\n@Injectable()\nexport class RoomsEffects {\n constructor(private actions: Actions,\n private spaceService: SpacesService) {\n }\n\n @Effect()\n public afterRequestResultsLoadOthersEffect = this.actions.pipe(\n ofType(loadRoomsWithQuery),\n mergeMap((action: LoadingAction) => {\n return [\n loadRoomsForResults.request({\n ...action,\n dateTz: action.dateTz\n }),\n // loadRoomsForResultsMap.request({\n // ...action,\n // dateTz: action.dateTz\n // }),\n loadLaterThatDayResults.request({\n ...action,\n dateTz: laterThatDayFromDateTz(action.dateTz)\n }),\n loadNextDayResults.request({\n ...action,\n dateTz: nextBusinessDay(action.dateTz)\n }),\n loadDiffSizeResults.request({\n ...action,\n dateTz: action.dateTz,\n diff_capacity: true\n }),\n ];\n })\n );\n\n @Effect()\n public loadRoomsForResultsEffect = createLoadingEffect(this.actions, loadRoomsForResults,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms'));\n \n @Effect() \n public loadRoomsForResultsMapEffect = createLoadingEffect(this.actions, loadRoomsForResultsMap,\n (action) => this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'rooms for maps', false));\n\n @Effect()\n public loadLaterThatDayResultsEffect = createLoadingEffect(this.actions, loadLaterThatDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'laterResults'));\n\n @Effect()\n public loadNextDayResultsEffect = createLoadingEffect(this.actions, loadNextDayResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'nextDay'));\n\n @Effect()\n public loadDiffSizeResultsEffect = createLoadingEffect(this.actions, loadDiffSizeResults,\n (action) =>\n this.spaceService.available(roomQueryOptionsToSpaceAvailabilityOptions(action), 'diffSize'));\n\n @Effect()\n public loadRoomByIdResultsEffect = createLoadingEffect(this.actions, loadByIdResults,\n (action) => \n this.spaceService.available(roomByIdQueryOptionsToSpaceAvailabilityOptions(action), 'byId', false));\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\nimport { roomsReducer } from './rooms.reducer';\nimport { RoomsEffects } from './rooms.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n EffectsModule.forFeature([RoomsEffects]),\n StoreModule.forFeature('rooms', roomsReducer)\n ]\n})\nexport class RoomsModule {\n}\n","import { LoadingModel } from '@mckinsey-converge/loading';\nimport { createReducer } from '@ngrx/store';\nimport {\n loadLaterThatDayResults,\n loadNextDayResults,\n loadRoomsForResults,\n loadByIdResults,\n loadDiffSizeResults,\n loadRoomsForResultsMap\n} from './rooms.actions';\nimport { RoomState } from './rooms.types';\n\nexport const initialRoomsState: RoomState = {\n query: LoadingModel.empty(),\n later: LoadingModel.empty(),\n next: LoadingModel.empty(),\n byid: LoadingModel.empty(),\n size: LoadingModel.empty(),\n};\n\nexport const roomsReducer = createReducer(initialRoomsState,\n ...loadRoomsForResults.ons,\n ...loadRoomsForResultsMap.ons,\n\n ...loadLaterThatDayResults.ons,\n ...loadNextDayResults.ons,\n ...loadByIdResults.ons,\n ...loadDiffSizeResults.ons);\n","import { LoadingModel } from '../../../loading/src/lib/loading.model';\nimport {\n Building,\n DaysOfWeek,\n ISpaceAvailabilityOptions,\n RecurrencePeriod,\n Space\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface RoomStoreState {\n rooms: RoomState;\n}\n\nexport interface RoomState {\n query: LoadingModel\n later: LoadingModel\n next: LoadingModel\n byid: LoadingModel\n size: LoadingModel\n}\n\nexport interface RoomQueryOptions {\n dateTz: DateTZ;\n duration: number;\n locations: string;\n capacity?: number;\n capacity_max?: number;\n diff_capacity?: boolean;\n //Recurrence fields\n recurrence_period?: RecurrencePeriod;\n recurrence_interval?: number;\n recurrence_endTz?: DateTZ;\n recurrence_count?: number;\n recurrence_starts?: Array;\n recurrence_exceptions?: Array; //SHOULD BE DATETZ\n recurrence_days?: Array;\n timezone?: string;\n offset?: number;\n buildings?: Building[];\n is_recurrent?: boolean;\n is_multiroom?: boolean;\n merged?: boolean;\n bookable?: boolean;\n ignore?: string;\n}\n\nexport const roomQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n zone_ids: options.locations,\n capacity_max: options.capacity_max,\n diff_capacity: options.diff_capacity,\n /** Fields to include recurrence in the availability search */\n is_recurrent: options?.is_recurrent,\n is_multiroom: options?.is_multiroom,\n merged: options?.merged,\n recurrence_period: options?.recurrence_period,\n recurrence_interval: options?.recurrence_interval,\n recurrence_endTz: options?.recurrence_endTz,\n recurrence_count: options?.recurrence_count,\n recurrence_starts: options?.recurrence_starts,\n recurrence_days: options?.recurrence_days,\n bookable: options?.bookable,\n ignore: options?.ignore\n});\n\nexport const roomByIdQueryOptionsToSpaceAvailabilityOptions = (options: RoomQueryOptions): ISpaceAvailabilityOptions => ({\n dateTz: options.dateTz,\n duration: options.duration,\n capacity: options.capacity,\n room_ids: options.locations,\n capacity_max: options.capacity_max\n});\n","import { Space } from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\n\nexport const todayFromDate = (date: number) => new DateTZ({date});\n\n/**\n * Adds 60 mins.\n */\nexport const laterThatDayFromDateTz = (dateTz: DateTZ) => {\n return dateTz.addValue({ minutes: 60 })\n};\n\n/**\n * Next business day. In most cases 1 day, but on Fridays, it follows to the monday.\n * @param date\n */\nexport const nextBusinessDay = (dateTz: DateTZ) => {\n let retDate = dateTz.addValue({ days: 1 });\n if (retDate.dateWeekday >= 6) {\n retDate = retDate.setValue({ weekday: 8 });\n }\n return retDate;\n};\n\nexport const mapRoomToSelectOption = (room?: Space): SelectOption => room ? ({\n value: room.id,\n shortDisplay: room.local_name,\n display: `${room.local_name}, ${room.level?.name}`\n}) : undefined;\n","export * from './lib/rx-utils.module';\nexport * from './lib/operators'\nexport * from './lib/loading-model.utils'\n","import {\n combineLatest,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\n\n/**\n * Generates the results count based on if data has loaded or not. If not, undefined is returned.\n * Otherwise, it'll return the count of the results.\n */\nexport const resultCountObservable = (loadingObservable: Observable>,\n resultsObservable: Observable\n): Observable => combineLatest([\n loadingObservable.pipe(map(r => r.hasLoaded())),\n resultsObservable.pipe(map(v => v?.length))\n]).pipe(map(([isLoading, viewModelLength]) => isLoading ? viewModelLength : undefined));\n","import {\n distinctUntilChanged,\n filter\n} from 'rxjs/operators';\nimport * as deepEqual from 'fast-deep-equal';\n\n/**\n * Useful for nested objects to prevent unnecessary triggers in RX chain.\n */\nexport const deepDistinctUntilChanged = () => distinctUntilChanged(deepEqual);\n\n/**\n * Won't emit if value is undefined.\n */\nexport const filterUndefined = () => filter(f => !!f);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class RxUtilsModule {}\n","export * from './lib/ui.module';\nexport * from './lib/types';\nexport * from './lib/base-template.component';\nexport * from './lib/recurrence-pattern-form/recurrence-pattern-form.component';\nexport * from './lib/recurrence-booking-form/recurrence-booking-form.component';\nexport * from './lib/conflicts-modal/conflicts-modal.component'\nexport * from './lib/override-changes-modal/override-changes-modal.component'\nexport * from './lib/date-tz-calendar-widget/date-tz-calendar-widget.component';\nexport * from './lib/date-tz-date-picker/date-tz-date-picker.component';\nexport * from './lib/date-tz-duration-field/date-tz-duration-field.component';\nexport * from './lib/date-tz-time-field/date-tz-time-field.component';\nexport * from './lib/aca-date-picker/aca-date-picker.component';\nexport * from './lib/conflict-alert-modal/conflict-alert-modal.component';\nexport * from './lib/tooltip/tooltip.enums';\nexport * from './lib/zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nexport * from './lib/catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n","import { Component, OnInit, Input, Output, OnChanges, SimpleChanges, forwardRef, EventEmitter } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDatePickerOptions {\n /** Unix timestamp with millisecond. First selectable date */\n from?: number;\n /** Unix timestamp with millisecond. Last selectable date */\n to?: number;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: number;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'aca-date-picker',\n templateUrl: './aca-date-picker.component.html',\n styleUrls: ['./aca-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AcaDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class AcaDatePickerComponent implements OnInit, OnChanges, ControlValueAccessor {\n /** CSS class to add to the root element of the component */\n @Input() public klass = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDatePickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n /** Display the last selected day as active */\n @Input() public show_last_selection?: boolean = true\n\n public date: number = DateNow(new Date()).ms;\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private from: DateTZ;\n /** Last selectable date */\n private to: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n /** ID of the timer used for changing the month */\n private _change_timer: number;\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.date = item.value;\n if (this._onChange) {\n this._onChange(this.date);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date\n */\n public updateDate(): void {\n \n if (!this.date) {\n return;\n }\n const now = DateNow(new Date()).startOfValue('month');\n const date_ = new DateTZ({date: this.date})\n const date = date_.startOfValue('month');\n if (date.valid) {\n const difference = date.dateDiff(now, 'months', 'months');\n if (this.offset !== difference) {\n this.offset = difference;\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.from) {\n const date_ = new DateTZ({date: this.options.from})\n this.from = date_.startOfValue('day');;\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.from.startOfValue('month');\n this.min_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.from) {\n this.from = null;\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.to) {\n const date_ = new DateTZ({date: this.options.to})\n this.to = date_.startOfValue('day');\n const today = DateNow(new Date()).startOfValue('month');\n const date = this.to.startOfValue('month');\n this.max_offset = date.dateDiff(today, 'months', 'months');\n } else if (this.to) {\n this.to = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n if (!this.date) {\n return;\n }\n const date = DateNow(new Date()).addValue({ months : this.offset });\n const active = new DateTZ({date: this.date});\n let start = date.setValue({ day: 1 }).setValue({ weekday: 7 }).subtractValue({ weeks: 1 });\n const end_ = new DateTZ({date: start.ms})\n const end = end_.addValue({ weeks: 1 }).endOfValue('month').addValue({ days: 2 }).endOfValue('week');\n this.date_list = [];\n while (start.isBeforeDate(end) || start.isSameDate(end, 'day')) {\n this.date_list.push({\n value: start.ms,\n display: start.formatDate('d'),\n active: this.show_last_selection && active.isSameDate(start, 'day'),\n non_month: !date.isSameDate(start, 'month'),\n count: this.counters ? this.counters[start.formatDate('yyyy-MM-dd')] || 0 : 0,\n disabled: (this.from ? start.isBeforeDate(this.from, 'day') : false) || (this.to ? start.isAfterDate(this.to, 'day') : false),\n today: DateNow(new Date()).isSameDate(start, 'day')\n });\n start = start.addValue({ days : 1 });\n }\n this.month_name = date.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = DateNow(new Date()).startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days : 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n if (this._change_timer) {\n clearTimeout(this._change_timer);\n }\n this._change_timer = setTimeout(() => {\n const new_offset = this.offset + value;\n const now = DateNow(new Date())\n const date = now.addValue({ months : new_offset, days: now.dateMonth === 2 ? 2 : 0 }); //add 2 days if month is february to avoid calc errors\n if (this.from && date.isBeforeDate(this.from, 'month')) { return; }\n if (this.to && date.isAfterDate(this.to, 'month')) { return; }\n this.offset = new_offset;\n this.month.emit(this.offset);\n this.generateMonth();\n this._change_timer = null;\n }, 100);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const date = new DateTZ({date: this.date});\n const offset = this.offset;\n this.offset = DateNow(new Date()).dateDiff(date, 'months', 'months');\n if (offset !== this.offset) {\n this.generateMonth();\n }\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n this.date = value;\n this.updateDate();\n this.generateMonth();\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","
\n
\n
\n
\n
\n
{{month_name}}
\n
= max_offset\" (click)=\"changeMonth(1)\" (touchend)=\"changeMonth(1)\">\n
\n
\n
\n
\n
{{item}}
\n
\n
\n
\n
\n {{item.display}}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nexport enum AlertMode {\n Warning = 'warning',\n Coachmark = 'coachmark',\n BlueCoachmark = 'blue-coachmark',\n Error = 'error'\n}\n\nexport enum AlertBannerDisplay {\n /**\n * New UI\n */\n V2 = 'v2',\n\n /**\n * Default, legacy ui.\n */\n V1 = 'v1',\n}\n\n@Component({\n selector: 'mck-alert-banner',\n template: `\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n `,\n styleUrls: ['./alert-banner.component.scss']\n})\nexport class AlertBannerComponent implements OnInit, OnChanges {\n\n @Input()\n public mode: AlertMode = AlertMode.Warning;\n\n @Output()\n public close = new EventEmitter();\n\n @Output()\n public action = new EventEmitter();\n\n @Input()\n public message: string;\n\n @Input()\n public buttonText: string;\n\n @Input()\n public showClose = true;\n\n @Input()\n public display: AlertBannerDisplay = AlertBannerDisplay.V1;\n\n public iconPath: string = 'assets/icon/warning-yellow.svg';\n public materialColor: string = 'black';\n public closeIcon: string = 'close_outline.svg';\n\n public ngOnInit(): void {\n this._onModeChange();\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.mode) {\n this._onModeChange();\n }\n }\n\n private _onModeChange() {\n this.iconPath = 'assets/icon/warning-yellow.svg';\n this.closeIcon = 'close_outline.svg';\n switch (this.mode) {\n case AlertMode.Warning:\n this.materialColor = 'black';\n break;\n case AlertMode.Coachmark:\n this.materialColor = 'coachmark';\n this.closeIcon = 'close_outline_coachmark.svg';\n break;\n case AlertMode.BlueCoachmark:\n this.iconPath = 'assets/icon/info-bg-dark.svg'\n this.materialColor = 'blue-coachmark'\n break;\n case AlertMode.Error:\n this.iconPath = 'assets/img/error-icon.svg'\n this.materialColor = 'white'\n break;\n default:\n this.materialColor = 'black';\n }\n }\n\n}\n","import {\n Component,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n Self,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NgControl\n} from '@angular/forms';\nimport { SelectOption } from '../types';\nimport {\n BehaviorSubject,\n combineLatest,\n from,\n Subject\n} from 'rxjs';\nimport {\n COMMA,\n ENTER\n} from '@angular/cdk/keycodes';\nimport { MatChipInputEvent } from '@angular/material/chips';\nimport {\n distinctUntilChanged,\n map,\n take\n} from 'rxjs/operators';\nimport { MatCheckboxChange } from '@angular/material/checkbox';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\n\n@Component({\n selector: 'mck-autocomplete-chip-select-item',\n template: `\n
\n \n {{label}}\n \n
\n \n
\n
\n \n
\n \n
\n \n
\n
\n
\n \n \n \n \n {{selected.shortDisplay}}\n close\n \n \n \n \n
\n \n \n {{option.dropdownOverride || option.display}}\n \n \n
\n
\n \n Clear\n \n \n Confirm\n \n
\n \n \n {{errorMessage}}\n
\n `,\n styleUrls: ['./auto-complete-chip-select-item.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class AutoCompleteChipSelectItemComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor, OnDestroy {\n\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n @ViewChild('componentInput')\n componentInput: HTMLInputElement;\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n feedbackInput?: boolean;\n\n @Input()\n loading?: boolean;\n\n @Input()\n placeHolder: string;\n\n @Input()\n options: Subject[]>;\n\n @Input()\n selectedOptions: Subject[]>;\n\n @Input()\n useCTAs?: boolean;\n\n @Output()\n optionSelected = new EventEmitter>();\n\n @Output()\n feedbackOutput = new EventEmitter();\n\n @Output()\n chipsCleared: EventEmitter = new EventEmitter();\n\n @Output()\n onClickConfirm: EventEmitter = new EventEmitter();\n\n /**\n * If true, only allow 1 group at a time to get selected. Show others as disabled.\n */\n @Input()\n selectOnlyOneGroup = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input() public localFilter: boolean = true;\n\n /**\n * If error exists, a message.\n */\n @Input()\n errorMessage?: string;\n\n @Input()\n hideDropdownCarret?: boolean;\n\n @Input()\n displayCTA?: boolean;\n\n private selectOnlyOneGroupChange = new BehaviorSubject(false);\n\n separatorKeysCodes = [ENTER, COMMA];\n\n public filterFormControl: FormControl = new FormControl();\n\n public focused = false;\n public mobileFullScreen = false;\n\n public autocompleteOptions = new BehaviorSubject[]>([]);\n public filteredAutocompleteOptions = new BehaviorSubject[]>([]);\n\n /** List shown to user, filters children if a group header is added **/\n public chipOptions = new BehaviorSubject[]>([]);\n\n /** Form control on change handler */\n private _onChange?: (_: SelectOption[]) => void;\n /** Form control on touch handler */\n private _onTouch?: (_: string) => void;\n\n private value = new BehaviorSubject[]>([]);\n\n public enableCTAs: boolean = false\n\n public hasChips: boolean = false;\n\n constructor(@Self() @Optional() private control: NgControl) {\n super();\n if (this.control) {\n this.control.valueAccessor = this;\n }\n }\n\n public get invalid(): boolean {\n return this.control ? this.control.invalid : false;\n }\n\n public get showError(): boolean {\n if (!this.control) {\n return false;\n }\n\n const { dirty, touched } = this.control;\n\n return this.invalid ? (dirty && touched) : false;\n }\n\n public iconFillClass(color?: string): string {\n return color === 'external' ? 'mck-icon-fill-gray' : 'mck-icon-fill-white'\n }\n\n ngOnInit() {\n this.subscription('autoCompleteOptions', combineLatest([\n this.options,\n this.selectedOptions,\n this.selectOnlyOneGroupChange\n ])\n .pipe(\n map(([options, selectedOptions, selectOnlyOneGroup]) => {\n this.hasChips = !!selectedOptions.length;\n return options.map(option => {\n const selected = !!selectedOptions.find(s => s.value === option.value);\n let enabled = true;\n if (selectOnlyOneGroup) {\n // find first group item in selection\n const selectedGroupHeader = selectedOptions.find(s => s.groupHeader || s.groupId === option.groupId);\n\n // if no options chosen, enable it, otherwise only allow selections from other options.\n enabled =\n selectedOptions.length === 0 ||\n (selectedGroupHeader ? selectedGroupHeader.groupId === option.groupId : false);\n this.enableCTAs = selectedOptions.length !== 0\n }\n\n return {\n ...option,\n enabled,\n selected\n } as SelectOption;\n });\n })\n ).subscribe(next => {\n const options = next.sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n this.autocompleteOptions.next(options);\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(this.filterFormControl.value?.trim()));\n }));\n this.subscription('filterFormControlChanges',\n this.filterFormControl.valueChanges.subscribe(value => {\n if (this.localFilter && value.length) {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions(value));\n } else {\n this.filteredAutocompleteOptions.next(this.getFilteredAutocompleteOptions());\n }\n }));\n this.subscription('chipOptions', this.selectedOptions\n .pipe(map(selectedOptions => {\n // find group headers and check if children are part of that group.\n // if part of group, filter them out as redundant.\n const groupHeaders = selectedOptions.filter(s => s.groupHeader) || [];\n return selectedOptions.filter(s => s.groupHeader || s.groupChild && !(groupHeaders.find(g => g.groupId === s.groupId)));\n }))\n .subscribe(next => {\n this.chipOptions.next(next);\n }));\n\n this.subscription('formData', this.selectedOptions\n .pipe(map(selected => {\n // group headers always contain children, so only pick out children for data\n return selected;\n }))\n .subscribe(next => {\n this.value.next(next);\n }));\n\n // tie value changes to change.\n this.subscription('valueChanges', this.value\n .pipe(distinctUntilChanged())\n .subscribe(next => {\n if (this._onChange) {\n // rewrote this to avoid read only error\n const values = [];\n next.forEach((v, i) => {\n const value = { ...v };\n if (v.meta?.user) {\n value.display = v.meta.user.name;\n }\n values.push(value);\n });\n this._onChange(values);\n }\n }));\n\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n getFilteredAutocompleteOptions(searchString: string = '') {\n // Exact matches of the groupId or display value\n const exactMatches = this.autocompleteOptions.value.filter(o => {\n if (searchString && searchString.length) {\n return o.groupId.toLowerCase().indexOf(searchString.toLowerCase()) === 0 || o.display.toLowerCase().indexOf(searchString.toLowerCase()) === 0;\n }\n return o.groupId && o.display;\n });\n // Fuzzier search of the dropdownOverride field\n const moreOptions = this.autocompleteOptions.value.filter(o => {\n if (o?.dropdownOverride?.length && searchString) {\n const match = o.dropdownOverride?.toLowerCase().indexOf(searchString.toLowerCase()) > -1;\n // only return found locations that don't exist in exactMatches.\n return match && !exactMatches.find(e => {\n return e.value === o.value\n });\n }\n return false;\n });\n\n // Merge the two result sets\n let joinedOptions = exactMatches.concat(moreOptions).sort((a, b) => {\n if (a.groupId === b.groupId) {\n return b.display > a.display ? -1 : 1;\n }\n return b.groupId > a.groupId ? -1 : 1;\n });\n\n // Create a 1D array of the groupId\n const groupIds = joinedOptions.map(o => o.groupId);\n // Get a deduped list of the group parents\n const parents = this.autocompleteOptions.value.filter(o => {\n return o?.groupHeader && groupIds.indexOf(o.groupId) !== -1;\n });\n\n // Remove the parents from the joinedOptions and merge with the reduced parents set, and then sort by groupId.\n // Resulting array sets the parents first in order so the widget renders properly.\n const filteredAutocompleteOptions = parents.concat(joinedOptions.filter(jo => !!jo.dropdownOverride)).sort((a, b) => {\n return b.groupId > a.groupId ? -1 : 1;\n });\n return filteredAutocompleteOptions;\n }\n\n loseFocus(): void {\n this.mobileFullScreen = false;\n this.focused = false;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.selectOnlyOneGroup) {\n this.selectOnlyOneGroupChange.next(this.selectOnlyOneGroup);\n }\n }\n\n keyedInput(matInput: string) {\n if (this.feedbackInput) {\n this.feedbackOutput.emit(matInput);\n }\n }\n\n selectOption(value: string) {\n this.options.pipe(\n take(1),\n map((options: SelectOption[]) => options.find(o => o.value === value))\n ).subscribe(next => {\n if (next) {\n this.optionSelected.emit(next);\n }\n });\n }\n\n removeOption(value: SelectOption) {\n this.optionSelected.emit(value);\n if (this.useCTAs) {\n this.onClickConfirm.emit();\n }\n\n }\n\n clearSelections() {\n this.selectedOptions.next([]);\n this.chipsCleared.emit();\n }\n\n onClickArrow() {\n // only close events we allow arrow to close panel.\n if (this.focused) {\n this.onFocus(false);\n }\n }\n\n onPanelFocusChange(focusIn: boolean) {\n this.onFocus(focusIn, true);\n }\n\n onFocus(focusIn: boolean, fromPanel?: boolean) {\n if (!focusIn && this.useCTAs) {\n this.onClickConfirm.emit();\n }\n // Only for location input???\n if (this.localFilter && fromPanel && focusIn) {\n // open on focus, mobile needs a refocus\n this.mobileFullScreen = true;\n this.timeout('showDefaults', () => {\n // All results do not show as expected unless I focus again.\n // Something about the mobile styles.\n this.onFocus(true);\n }, 100)\n }\n\n if (this.feedbackInput && !fromPanel) {\n // clear input when input creates options\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n this.feedbackOutput.emit('');\n }\n\n if (this.focused !== focusIn) {\n this.focused = focusIn;\n // clear on close\n if (!focusIn) {\n this.componentInput.value = '';\n this.filterFormControl.setValue('');\n }\n if (!fromPanel) {\n if (focusIn) {\n this.trigger.openPanel();\n } else {\n this.trigger.closePanel();\n // close the mobile full screen\n this.loseFocus();\n }\n }\n }\n }\n\n onChanged(value: SelectOption, event: MatCheckboxChange) {\n this.optionSelected.emit(value);\n }\n\n add(event: MatChipInputEvent) {\n // reset\n if (event.input) {\n event.input.value = '';\n }\n this.filterFormControl.setValue('');\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n // TODO: disabled not implemented yet.\n this.disabled = isDisabled;\n }\n\n writeValue(obj: SelectOption[] | undefined): void {\n // update selected options when this value is written\n this.options?.pipe(\n take(1),\n map((options: SelectOption[]) => {\n return options.filter(o => obj ? !!obj.find(spl => o.value === spl.value) : false );\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null && !event.srcElement.classList.contains('mat-form-field-autofill-control')) {\n this.onFocus(false);\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n}\n\n\n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\nimport { SelectOption } from '../types';\n\n/**\n * Patch orphaned SelectOption children into acting as their own group headers.\n *\n * This intends to help in the common scenario where filters have (for whatever\n * reason) prevented the child's usual group header from appearing.\n */\n@Pipe({\n name: 'groupHeaderPatch',\n})\nexport class GroupHeaderPipe implements PipeTransform {\n transform(items: SelectOption[]): SelectOption[] {\n if (!items) {\n return [];\n }\n\n return items.map(v => {\n const hasHeader = !!items.find(i => i.groupHeader && i.groupId === v.groupId);\n return {\n ...v,\n displayAsHeader: !hasHeader,\n }\n })\n }\n\n}\n","import { Component, Input, Output, forwardRef, SimpleChanges, OnChanges, OnInit, EventEmitter, ViewChild, OnDestroy } from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\nimport {\n BehaviorSubject\n} from 'rxjs';\n\n/**\n * @title Autocomplete filtering select of a single option via text search.\n */\n@Component({\n selector: 'mck-autocomplete-select-option',\n templateUrl: 'auto-complete-select-option.component.html',\n styleUrls: ['auto-complete-select-option.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AutoCompleteSelectOptionComponent),\n multi: true\n }\n ],\n})\nexport class AutoCompleteSelectOptionComponent implements OnInit, OnChanges, ControlValueAccessor, OnDestroy{\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n @Input()\n public resetInput: number | undefined;\n\n @Input()\n public placeholder: string;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Output()\n public filteredOptionsChange = new EventEmitter[]>();\n\n @Output()\n public inputTextChange = new EventEmitter();\n\n @Output() emptyBoxEvent = new EventEmitter();\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n filterFormControl = new FormControl();\n filteredOptions: Observable[]>;\n\n /** The selected value */\n public value = new BehaviorSubject('');\n\n /** Available options to search / select from */\n public _options = new BehaviorSubject[]>(this.options);\n @ViewChild('trigger')\n trigger: MatAutocompleteTrigger;\n\n ngOnInit() {\n this.updateFilteredOptions();\n window.addEventListener('scroll', this.scrollEvent, true);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n // Watch and apply changes from the parent component.\n if (changes.options || changes.selectedValue) {\n if (changes.options && !changes.selectedValue) {\n this.filterFormControl.setValue('')\n }\n this.updateFilteredOptions();\n }\n if (changes.resetInput) {\n this.filterFormControl.setValue('');\n this.updateFilteredOptions();\n }\n \n }\n\n private updateFilteredOptions() {\n this.filteredOptions = this.filterFormControl.valueChanges\n .pipe(\n startWith(''),\n map(value => typeof value === 'string' ? value : value && value?.display ? value.display : ''),\n map(name => name ? this._filter(name) : this.options.slice())\n );\n }\n\n displayFn(data: SelectOption): string {\n return data && data?.display ? data.display : '';\n }\n\n private _filter(display: string): SelectOption[] {\n const filterValue = display.toLowerCase();\n // return all the matches found\n const filtered = this.options.filter(option => {\n // split this input and index both, if both\n // match return true.\n if (filterValue.includes(' ')) {\n const filterValues =filterValue.split(' ');\n let matchesAll = true;\n for (let x = 0; x < filterValues.length; x++) {\n if (option.display.toLowerCase().indexOf(filterValues[x]) === -1) {\n matchesAll = false;\n }\n }\n if (matchesAll) {\n return true;\n }\n }\n // match the whole string\n return option.display.toLowerCase().indexOf(filterValue) > -1;\n });\n this.inputTextChange.emit(filterValue);\n this.filteredOptionsChange.emit(filtered);\n return filtered;\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: SelectOption): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value.value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n public onChangeInput() {\n if (this.filterFormControl.value === '') {\n this.emptyBoxEvent.emit(true);\n }\n }\n\n private scrollEvent = (event): void => {\n if (this.trigger === null) {\n return;\n }\n /**\n * IF - to confirm user not scrolling from autocomplete opened panel and close panel if scroll event triggers from outside of panel\n */\n if (this.trigger.panelOpen && event.target.closest('.mat-autocomplete-panel') === null ) {\n this.trigger.closePanel();\n this.trigger['_element'].nativeElement.blur();\n }\n }\n public ngOnDestroy(): void {\n window.removeEventListener('scroll', this.scrollEvent, true);\n }\n\n}","
\n {{label}}\n \n \n \n \n {{option.shortDisplay || option.display}}\n \n \n \n
","import {\n AfterViewInit,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n/**\n * A helper class for rendering embedded views (ng-template) as standalone components.\n *\n * If the view is lazy and does not render upon initialization,\n * it attempts embedding view again later.\n *\n * When testing a component directly that extends this class, its best to wrap the component\n * in a wrapper component for testing so that it can render itself.\n */\nexport class BaseTemplateComponent extends BaseDirective implements AfterViewInit, OnInit, OnDestroy {\n @ViewChild(TemplateRef, { static: true })\n public template: TemplateRef;\n\n private isRendered = false;\n\n constructor(private vcRef: ViewContainerRef) {\n super();\n }\n\n public ngOnInit(): void {\n // try early rendering\n this.attemptViewEmbed();\n }\n\n public attemptViewEmbed() {\n if (this.template && !this.isRendered) {\n this.isRendered = true;\n this.vcRef.createEmbeddedView(this.template);\n return true;\n }\n return false;\n }\n\n public ngAfterViewInit(): void {\n if (!this.isRendered) {\n console.log('View not rendered yet, attempting to post initialization');\n setTimeout(() => {\n console.log('Timeout ended, trying again', this.template);\n if (!this.attemptViewEmbed()) {\n console.log('Attempting render in after view initialization');\n setTimeout(() => {\n if (!this.attemptViewEmbed()) {\n console.error('FAILED TO LOAD TEMPLATE');\n }\n }, 1000);\n }\n });\n }\n }\n\n public ngOnDestroy(): void {\n super.ngOnDestroy();\n this.isRendered = false;\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'catering-drop-modal',\n templateUrl: './catering-drop-modal.component.html',\n styleUrls: ['./catering-drop-modal.component.scss']\n})\nexport class CateringDropComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onConfirm(): void {\n this.dialogRef.close(true);\n}\n\nonCancel(): void {\n this.dialogRef.close(false);\n}\n}\n","
\n

Catering conflict

\n
\n\n
\n
\n

New proposed meeting time is outside catering hours. Proceed without catering?

\n
\n
\n
\n\n
\n \n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input\n } from \"@angular/core\";\n import { DropdownPanel } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select-options\",\n templateUrl: \"./cng-select-options.component.html\",\n styleUrls: [\"./cng-select-options.component.scss\"]\n })\n export class CngSelectOptionsComponent implements DropdownPanel {\n @ViewChild(TemplateRef) templateRef: TemplateRef;\n @Output() closed = new EventEmitter();\n @Input() ddWidth: string;\n \n constructor() {}\n }\n ","\n
\n \n
\n
","import {\n Component,\n Output,\n TemplateRef,\n ViewChild,\n EventEmitter,\n Input,\n OnInit\n } from \"@angular/core\";\n import { DropdownPanel, DropdownOpion } from \"./dropdown-panel\";\n \n @Component({\n selector: \"cng-select\",\n templateUrl: \"./cng-select.component.html\",\n styleUrls: [\"./cng-select.component.scss\"]\n })\n export class CngSelectComponent implements OnInit {\n @Input() data: any;\n public isClosed: boolean = false;\n public selected: DropdownOpion;\n constructor() {\n\n }\n ngOnInit(): void {\n this.selected = this.data.defaultSelected;\n }\n\n public optionSelected(item: DropdownOpion) {\n // this.selected = item;\n this.data.defaultSelected = item;\n this.data?.onChangeCallback && this.data?.onChangeCallback(item);\n }\n }\n ","\n\n
\n {{data?.defaultSelected?.display}}\n
\n \n
\n
\n\n
{{item?.display}}
\n
","import {\n AfterViewInit,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n ViewContainerRef\n } from '@angular/core';\n import { DropdownPanel } from './dropdown-panel';\n import { Overlay, OverlayRef } from '@angular/cdk/overlay';\n import { TemplatePortal } from '@angular/cdk/portal';\n import { merge, Observable, Subscription } from 'rxjs';\n \n @Directive({\n selector: '[dropdownTriggerFor]',\n host: {\n '(click)': 'toggleDropdown()'\n }\n })\n export class DropdownTriggerForDirective implements OnDestroy, AfterViewInit, OnInit {\n private isDropdownOpen = false;\n private overlayRef: OverlayRef;\n private dropdownClosingActionsSub = Subscription.EMPTY;\n \n @Input('dropdownTriggerFor') public dropdownPanel: DropdownPanel;\n @Output() isPanelOpened = new EventEmitter();\n constructor(\n private overlay: Overlay,\n private elementRef: ElementRef,\n private viewContainerRef: ViewContainerRef,\n private renderer: Renderer2\n ) {\n \n }\n ngOnInit(): void {\n // const cngSelectEl = this.elementRef.nativeElement.nextElementSibling; \n // const parentWidth = this.elementRef.nativeElement.offsetWidth; \n // this.renderer.setStyle(cngSelectEl, 'width', `${parentWidth}px`);\n }\n ngAfterViewInit(): void {\n \n }\n\n \n toggleDropdown(): void {\n this.isDropdownOpen ? this.destroyDropdown() : this.openDropdown();\n \n }\n \n openDropdown(): void {\n let {ddWidth} = this.dropdownPanel;\n this.dropdownPanel.ddWidth = ddWidth !=='' ? ddWidth : `${this.elementRef.nativeElement.offsetWidth}px`;\n this.isDropdownOpen = true;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.close(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions([\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8\n }\n ])\n });\n \n const templatePortal = new TemplatePortal(\n this.dropdownPanel.templateRef,\n this.viewContainerRef\n );\n this.overlayRef.attach(templatePortal);\n \n this.dropdownClosingActionsSub = this.dropdownClosingActions().subscribe(\n () => this.destroyDropdown()\n );\n }\n \n private dropdownClosingActions(): Observable {\n const backdropClick$ = this.overlayRef.backdropClick();\n const detachment$ = this.overlayRef.detachments();\n const dropdownClosed = this.dropdownPanel.closed;\n \n return merge(backdropClick$, detachment$, dropdownClosed);\n }\n \n private destroyDropdown(): void {\n if (!this.overlayRef || !this.isDropdownOpen) {\n return;\n }\n \n this.dropdownClosingActionsSub.unsubscribe();\n this.isDropdownOpen = false;\n this.isPanelOpened.emit(this.isDropdownOpen);\n this.overlayRef.detach();\n }\n \n ngOnDestroy(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n }\n }\n }\n ","import {\n Component,\n Input,\n OnInit,\n OnDestroy,\n ViewChild,\n AfterViewInit,\n Output,\n EventEmitter\n} from '@angular/core';\nimport { MatExpansionPanel } from '@angular/material/expansion';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { CollapseService } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'mck-collapse-header',\n template: `\n \n \n {{title}} \n
\n
\n \n
\n \n
\n
\n {{description}}\n \n \n \n \n `,\n styleUrls: ['./collapse-header.component.scss'],\n})\nexport class CollapseHeaderComponent implements OnInit, OnDestroy {\n\n @Input() title: string;\n @Input() description: string;\n @Input() isLoading = false;\n @Input() expandedIds: string[] = [];\n @Output() updateSectionIdOnOpen = new EventEmitter<{ status: string, id: string }>(); // Emit the id of the opened result section\n\n @ViewChild('expansionPanel') expansionPanel: MatExpansionPanel;\n\n public isExpanded = new BehaviorSubject(false);\n private collapseSubscription: Subscription;\n\n constructor(private collapseService: CollapseService) {}\n\n ngOnInit(): void {\n this.collapseSubscription = this.collapseService.collapse$.subscribe(() => {\n if (this.expansionPanel) {\n this.expansionPanel.close(); // Close the panel\n }\n });\n }\n\n // Update opened section id and emit the id of the opened result section to the parent component \n public updateOpenedSectionId(isOpen: string) {\n this.updateSectionIdOnOpen.emit({ status: isOpen, id: this.expandedTitleId });\n }\n\n\n \n /**\n * Gets the expanded title as an id by removing parentheses and replacing spaces with underscores.\n * @returns The expanded title.\n */\n public get expandedTitleId(): string {\n return this.title?.split('(')[0]?.split(' ')?.join('_') ;\n }\n\n ngOnDestroy(): void {\n this.collapseSubscription.unsubscribe();\n }\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n\nexport interface RoomAvaibilityModalData {\n\theaderText: string,\n\tmessage: string,\n\tbuttonLabel: string,\n\tcallback: Function,\n shouldClose: boolean\n}\n\n@Component({\n selector: 'conflict-alert-modal',\n templateUrl: 'conflict-alert-modal.component.html',\n styleUrls: ['./conflict-alert-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConflictAlertModalComponent implements OnInit {\n constructor(public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public dialogData: RoomAvaibilityModalData) {\n }\n ngOnInit(): void {}\n\n public done() {\n this.dialogData?.callback(); this.dialogRef.close()\n }\n}\n","
\n \n
\n\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{dialogData?.headerText}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{dialogData?.message}}
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\t\t \n\t\t\t\n
","import {Component, EventEmitter, Inject, Input, OnInit, Output} from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport {DialogEvent} from '@mckinsey-converge/base';\nimport {DateTZ, isToday} from '@mckinsey-converge/date-tz';\n\nexport interface ConflictsModalComponentData {\n room_name: string;\n conflicts: number[];\n copy_conflicts?: boolean;\n timezone: string;\n status?: string;\n}\n\n@Component({\n selector: 'app-conflicts-modal',\n templateUrl: './conflicts-modal.component.html',\n styleUrls: ['./conflicts-modal.component.scss']\n})\nexport class ConflictsModalComponent implements OnInit{\n public room_name: string;\n public conflicts: number[];\n public copy_conflicts: boolean;\n public timezone;\n public status: string;\n\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: ConflictsModalComponentData){\n\n }\n\n public ngOnInit(){\n this.timezone = this._data.timezone;\n this.room_name = this._data.room_name\n this.conflicts = this._data.conflicts\n this.copy_conflicts = this._data.copy_conflicts\n this.status = this._data.status\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone});\n const dateIsToday = isToday(dateTZ, this.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n\n public copy(): void {\n this.event.emit({ reason: 'action' });\n }\n\n\n}\n","
\n \n
\n\n
\n

Conflicts ({{conflicts.length}})

\n
\n The {{room_name}} room is not available on the following dates.\n Do you want to proceed without booking these days?\n
\n
\n The {{room_name}} room is not available on the following dates.\n You need to make individual bookings to cover these days, please.\n
\n
\n
\n
\n Date\n
\n
\n
\n {{formatDate(conflict)}}\n
\n
\n
\n
\n\n \n {{copy_conflicts ? 'Copy to clipboard' : 'Close'}}\n \n \n {{copy_conflicts ? 'Close' : 'Continue'}}\n \n\n","import { Component, OnInit, Inject } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'custom-snackbar',\n templateUrl: './custom-snackbar-component.component.html',\n styleUrls: ['./custom-snackbar-component.component.scss'],\n})\nexport class CustomSnackbarComponent implements OnInit {\n constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any) {\n }\n\n ngOnInit() {}\n\n get getIcon() {\n switch (this.data.snackType) {\n case 'success':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-success.svg',\n };\n case 'error':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-failure.svg',\n };\n case 'warn':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-warning.svg',\n };\n case 'info':\n return {\n type: this.data.snackType,\n iconPath: 'assets/icon/toast-info.svg',\n };\n default:\n return { type: 'info', iconPath: 'assets/icon/toast-info.svg' };\n }\n }\n\n closeSnackbar() {\n this.data.snackBar.dismiss();\n }\n}\n","
\n
\n
\n \"{{getIcon.type}}\n
\n
\n {{data.message}}\n
\n
\n
\n
close
\n
\n
","import { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { CustomSnackbarComponent } from './custom-snackbar-component.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarService {\n messageText: string[];\n constructor(public snackBar: MatSnackBar) {}\n\n public openSnackBar(\n message,\n type,\n duration?,\n verticalPosition?,\n horizontalPosition?\n ) {\n const _snackType = type !== undefined ? type : 'success';\n this.snackBar.openFromComponent(CustomSnackbarComponent, {\n duration: duration || 4000,\n horizontalPosition: horizontalPosition || 'end',\n verticalPosition: verticalPosition || 'top',\n data: {\n message: message,\n snackType: _snackType,\n snackBar: this.snackBar,\n },\n });\n }\n}\n","import {\n Component,\n OnInit,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n forwardRef,\n EventEmitter,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface IDateTzPickerOptions {\n /** DateTZ object. First selectable date */\n fromDateTz?: DateTZ;\n /** DateTZ object. Last selectable date */\n untilDateTz?: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `DDD` */\n day_format?: string;\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n month_format?: string;\n}\n\ninterface IDateBlock {\n /** Timestamp value of the date */\n value: DateTZ;\n /** Day of the month to display */\n display: string;\n /** Whether block is the selected date */\n active: boolean;\n /** Whether block not selectable */\n disabled: boolean;\n /** Whether block outside the active month */\n non_month: boolean;\n /** Whether the block is today */\n today: boolean;\n /** Number of events on this block */\n count?: number;\n}\n\n@Component({\n selector: 'date-tz-calendar-widget',\n templateUrl: './date-tz-calendar-widget.component.html',\n styleUrls: ['./date-tz-calendar-widget.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzCalendarWidgetComponent),\n multi: true,\n },\n ],\n})\nexport class DateTzCalendarWidgetComponent\n extends BaseClass\n implements OnInit, OnChanges, ControlValueAccessor\n{\n /** CSS class to add to the root element of the component */\n @Input() public className = 'default';\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n @Input() public counters: { [date: string]: number };\n /** Settings for the date picker component */\n @Input() public options: IDateTzPickerOptions;\n /** Offset of the display month from the current month */\n @Output() public month = new EventEmitter();\n\n public readonly weeks = new Array(6).fill(0);\n public selectedDateTz: DateTZ = DateNow();\n\n // R--- this is the date picker that needs to be TZ aware\n /** Offset of the month displayed from the current month */\n public offset = 0;\n /** Minimum offset for changing the month */\n public min_offset = -999999;\n /** Maximum offset for changing the month */\n public max_offset = 999999;\n /** Blocks representing the rendering details of the display days of the month */\n public date_list: IDateBlock[] = [];\n /** Name of the actively displayed month */\n public month_name = DateNow(new Date()).formatDate('MMMM yyyy');\n /** Name of the days of the week to display */\n public days_of_week = [];\n /** First selectable date */\n private fromTz: DateTZ;\n /** Last selectable date */\n private toTz: DateTZ;\n /** Luxon format string for formatting days of the week. Defaults to `dd` */\n private day_format = 'EEE';\n /** Luxon format string for formatting active month. Defaults to `MMMM yyyy` */\n private month_format = 'MMMM yyyy';\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n private _today = DateNow();\n\n public get timezone() {\n return this.selectedDateTz?.building_tz || '';\n }\n\n public ngOnInit(): void {\n this.generateMonth();\n this.generateDaysOfTheWeek();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this.updateOptions();\n }\n if (changes.counters) {\n this.generateMonth();\n }\n }\n\n /** Change date using the given block */\n public setDate(item: IDateBlock) {\n this.selectedDateTz = item.value;\n if (this._onChange) {\n this._onChange(this.selectedDateTz);\n }\n this.generateMonth();\n }\n\n /**\n * Update offset to show the selected date 2\n */\n public updateDate(): void {\n if (!this.selectedDateTz) {\n return;\n }\n const now = this._today.startOfValue('month');\n const startOfMonthDateTz = this.selectedDateTz.startOfValue('month');\n if (startOfMonthDateTz.valid) {\n const difference = startOfMonthDateTz.dateDiff(\n now,\n 'months',\n 'months'\n );\n if (this.offset !== difference) {\n this.offset = Math.round(difference);\n this.month.emit(this.offset);\n }\n this.generateMonth();\n }\n }\n\n /**\n * Update local properties based off changes to settings\n */\n public updateOptions(): void {\n if (this.options) {\n // Setup from date\n if (this.options.fromDateTz) {\n const today = this._today.startOfValue('month');\n this.fromTz = this.options.fromDateTz.startOfValue('day');\n this.min_offset = Math.round(\n this.fromTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months')\n );\n } else if (this.fromTz) {\n this.fromTz = null; // R-- check if ok\n this.min_offset = -999999;\n }\n // Setup to date\n if (this.options.untilDateTz) {\n const today = this._today.startOfValue('month');\n this.toTz = this.options.untilDateTz.startOfValue('day');\n this.max_offset = this.toTz\n .startOfValue('month')\n .dateDiff(today, 'months', 'months');\n } else if (this.toTz) {\n this.toTz = null;\n this.max_offset = 999999;\n }\n if (this.options.month_format) {\n this.month_format = this.options.month_format || 'MMMM yyyy';\n }\n if (this.options.day_format) {\n this.day_format = this.options.day_format || 'EEE';\n this.generateDaysOfTheWeek();\n }\n // Update date blocks\n this.generateMonth();\n }\n }\n\n /**\n * Generate the display blocks for the days of the active month\n */\n private generateMonth(): void {\n this._today = new DateTZ({ date: Date.now(), is_local_tz: !this.timezone, building_tz: this.timezone });\n const startOfMonthDateTz = this._today.addValue({ months: this.offset });\n const active = this.selectedDateTz || DateNow();\n let startDate = startOfMonthDateTz\n .setValue({ day: 1 })\n .setValue({ weekday: 7 })\n .subtractValue({ weeks: 1 });\n this.date_list = [];\n for (let i = 0; i < 42; i++) {\n this.date_list.push({\n value: startDate,\n display: startDate.formatDate('d'),\n active: active.isSameDate(startDate, 'day'),\n non_month: !startOfMonthDateTz.isSameDate(startDate, 'month'),\n count: this.counters\n ? this.counters[startDate.formatDate('yyyy-MM-dd')] || 0\n : 0,\n disabled:\n (this.fromTz ? startDate.ms < this.fromTz.ms : false) ||\n (this.toTz ? startDate.ms > this.toTz.ms : false),\n today: this._today.isSameDate(startDate, 'day'),\n });\n startDate = startDate.addValue({ days: 1 });\n }\n this.month_name = startOfMonthDateTz.formatDate(this.month_format);\n }\n\n /**\n * Generate this weekdays to display in the header of the calendar\n */\n private generateDaysOfTheWeek() {\n let date = this._today.startOfValue('week');\n this.days_of_week = [];\n for (let i = 0; i < 7; i++) {\n this.days_of_week.push(date.formatDate(this.day_format));\n date = date.addValue({ days: 1 });\n }\n }\n\n /**\n * Changes the month offset by the given value.\n * Does nothing if the new month is not available to be selected\n * @param value Number of months to change the offset by\n */\n public changeMonth(value: number): void {\n const new_offset = Math.min(\n this.max_offset,\n Math.max(this.min_offset, this.offset + value)\n );\n this.offset = Math.round(new_offset);\n this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Reset the month offset to the month of the selected date\n */\n public reset() {\n const offset = this.offset;\n this.offset = Math.round(\n this._today.dateDiff(this.selectedDateTz, 'months', 'months')\n );\n if (offset !== this.offset) this.generateMonth();\n this.month.emit(this.offset);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: DateTZ) {\n if (value) {\n this.selectedDateTz = value;\n this.updateDate();\n this.generateMonth();\n }\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n}\n","
\n
\n \n
\n \n
{{ month_name }}
\n = max_offset\"\n (click)=\"changeMonth(1)\"\n >\n
\n \n
\n \n \n \n \n \n \n \n \n \n
{{ item }}
\n \n {{ item.display }}\n
\n
{{item.count > 9 ? '+9' : item.count}}
\n \n
\n
\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTzCalendarWidgetComponent } from '../date-tz-calendar-widget/date-tz-calendar-widget.component';\n\n@Component({\n selector: 'date-tz-date-picker',\n template: `\n \n {{label}}\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./date-tz-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class DateTzDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n @Input() public label?: string;\n /** Earliest date available the user is allowed to pick */\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n /** Latest date available the user is allowed to pick */\n @Input() public untilDateTz: DateTZ = DateNow(new Date()).endOfValue('day').addValue({ years: 1 });\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n // R-- possible TODO, address all_day that disables this input and displays \"Add Day for the value like the time picker\"\n @Input() public all_day: boolean = false;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public counters: any;\n\n @Input() public initialDateSelectionTz?: DateTZ;\n\n @Output() public onSelect = new EventEmitter();\n\n @Input() public invalid?: boolean;\n\n @Input() public timezone?: string;\n\n @Input() public can_pick_today: boolean = true;\n\n /** Whether form control is invalid, touched and contains errors */\n @Input() public error?: boolean;\n\n public ngOnInit(): void {\n if (this.initialDateSelectionTz) {\n this.writeValue(this.initialDateSelectionTz)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(DateTzCalendarWidgetComponent, {static: true }) private _acaDatePicker: DateTzCalendarWidgetComponent;\n /** Currently selected date */\n public selectedDateTzValue = new BehaviorSubject(DateNow(new Date()));\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(new DateTZ({ is_local_tz: false, building_tz: d.building_tz }), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n // date\n public get dateTzObservable(): Observable {\n return this.selectedDateTzValue.pipe(map(d => {\n return d \n }));\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(newValueTz: DateTZ) {\n // Keep hours and minutes of the old date\n const old_date = this.selectedDateTzValue.value;\n let newDateTz = newValueTz.setValue({ hour: old_date.dateHour, minute: old_date.minutes, second: old_date.second });\n\n // Check that new date is before from\n if (newDateTz.ms < this.fromDateTz.ms) {\n newDateTz = this.fromDateTz;\n }\n\n this.selectedDateTzValue.next(newDateTz);\n if (this._onChange) {\n this._onChange(newDateTz);\n }\n\n this.onSelect.emit(newDateTz);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n const building_tz = this.timezone || this.fromDateTz.building_tz\n const is_local_tz = DateNow(new Date()).building_tz === building_tz\n this.setValue(new DateTZ({ is_local_tz, building_tz }));\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(selectedDateTz: DateTZ) {\n this.selectedDateTzValue.next(selectedDateTz);\n this.show_tooltip = false;\n }\n\n public readonly registerOnChange = (fn: (_: DateTZ) => void) => this._onChange = fn;\n public readonly registerOnTouched = (fn: (_: DateTZ) => void) => this._onTouch = fn;\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n DurationGroup,\n nearestDurationToInput,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators'; \nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'date-tz-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzDurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DateTzDurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input() public label?: string;\n @Input() public required: boolean;\n @Input() max_length?: number;\n\n // /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDateTz: DateTZ;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Whether form all_day is enabled. */\n // R-- need to address all_day that disables this input and displays \"Add Day for the value\"\n @Input() public all_day: boolean = false;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** Component will return a number of minutes */\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDateTz = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDateTz]).pipe(\n \n map(([value, currentStartDate]) => { \n /**\n * convert current start date/time to building time zone first\n * \n */\n const ms = convertTimezonedTimestampToLocalDateTz(currentStartDate.ms, currentStartDate.building_tz).ms;\n return nearestDurationToInput(this.durationGroups, ms, value); \n }\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDateTz.pipe(\n map(d => generateDurationOptionsFromGroups(d, this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDateTz.value, this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDateTz) {\n this.currentStartDateTz.next(changes.startDateTz.currentValue);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlotTz,\n nearestStepToInput,\n timeWithGmtOffsetFormatString,\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n generateAvailableTimes,\n generateAvailableTimesTz,\n} from '../utils/time.utils';\nimport { BehaviorSubject, combineLatest } from 'rxjs';\nimport { filter, map, withLatestFrom } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'date-tz-time-field',\n template: `\n
\n {{\n label\n }}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./date-tz-time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTzTimeFieldComponent),\n multi: true,\n },\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DateTzTimeFieldComponent\n extends BaseDirective\n implements OnInit, OnChanges, ControlValueAccessor\n{\n @Input() public label?: string;\n @Input() public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n // @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the DateTZ object datetime to start time options from **/\n @Input() public fromDateTz: DateTZ = DateNow(new Date());\n // Disables this input and displays R--- \"All Day\" for the value\n @Input() public all_day: boolean = false;\n @Input() public show_current: boolean = false;\n @Input() public startFromDateTz: boolean = false;\n\n /** Form control on change handler */\n private _onChange: (_: DateTZ) => void;\n /** Form control on touch handler */\n private _onTouch: (_: DateTZ) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n /** DateTZ object representing the currently set datetime */\n public selectedDateTz = new BehaviorSubject(\n closestToTimeSlotTz(DateNow(new Date()), this.step)\n );\n\n /** string representing the currently set datetime display value, needed for the input to display the slected value */\n public selectedTimeString = new BehaviorSubject(\n timeWithGmtOffsetFormatString(this.selectedDateTz.value)\n );\n\n public filterFormControl: FormControl = new FormControl();\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(\n generateAvailableTimesTz(\n DateNow(),\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(DateNow())]\n : [],\n this.startFromDateTz\n )\n );\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // Subscribe to selected option changes\n this.subscription(\n 'dateTimeChanges',\n combineLatest([this.selectedDateTz])\n .pipe(\n map(([selectedDateTz]) => {\n /**\n * The selectedDateTz should already be pegged to the closest time slot, but\n * if the selected time rolls into the past this can correct it. // R--- verify this statement\n */\n return closestToTimeSlotTz(selectedDateTz, this.step);\n }),\n withLatestFrom(this.options),\n filter(\n ([date, timeOptions]: [\n DateTZ,\n SelectOption[]\n ]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(\n (t) => t.value === date.formatDate('HH:mm')\n );\n }\n ),\n map(([dateTz, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz,\n });\n\n // Sort the time options\n timeOptions.sort((a, b) =>\n `${a.value}`.localeCompare(`${b.value}`)\n );\n return timeOptions;\n })\n )\n .subscribe((next) => {\n return this.options.next(next);\n })\n );\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (\n changes.no_past_times ||\n changes.step ||\n changes.fromDateTz ||\n changes.all_day\n ) {\n // If there's a new date value then update the time options\n this.options.next(\n generateAvailableTimesTz(\n this.selectedDateTz.value,\n !this.noPastTimes,\n this.step,\n this.timezone,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(this.selectedDateTz.value)]\n : [],\n this.startFromDateTz\n )\n );\n // If today and all day goes from on to off the selected value isn't going to be available.\n if (\n changes.all_day &&\n !changes.all_day.currentValue &&\n changes.all_day.previousValue\n ) {\n this.setValue(this.options.value[0].display);\n }\n }\n }\n\n /**\n * Getter if the time picker options are visiable or not\n */\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n /**\n * Getter to return the current form timestamp from the from date object\n */\n public get timezone(): string {\n return this.fromDateTz.building_tz;\n }\n\n /**\n * A filter for finding a matching value when using the input text search\n */\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.selectedDateTz,\n ]).pipe(\n map(([value, selectedDateTz]) => {\n return nearestStepToInput(\n this.step,\n value,\n DateTime.now().valueOf()\n );\n })\n );\n\n /**\n * Default text displayed in the search field when the component initializes\n */\n public placeHolderOption = this.options.pipe(\n map((os) => os.length > 0 && os[0])\n );\n\n /**\n * Returns the selected option object by matching the selectedDateTz formated string with the option.display string\n */\n public selectedOption = combineLatest([\n this.options,\n this.selectedDateTz,\n ]).pipe(\n map(([options, selectedDateTz]) =>\n options.find(\n (o) =>\n o.display === timeWithGmtOffsetFormatString(selectedDateTz)\n )\n )\n );\n\n /**\n * Determines the visually selected value when the options list is visible.\n *\n * @param option DateTZ\n * @returns boolean\n */\n public isSelected(option: SelectOption) {\n return this.selectedTimeString.value === option.display;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: DateTZ) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: DateTZ) => void): void {\n this._onTouch = fn;\n }\n\n /**\n * Method just used in unit tests to test disabling the input\n * @param disabled\n */\n // public setDisabledState(disabled: boolean) {\n // this.disabled = disabled;\n // }\n\n /**\n * Update the selected values\n * @param dateTz the DateTz object for the new time\n */\n public setSelectedValues(dateTz: DateTZ) {\n // Update the selected DateTz and string representations\n this.selectedTimeString.next(timeWithGmtOffsetFormatString(dateTz));\n this.selectedDateTz.next(dateTz);\n if (this._onChange) {\n this._onChange(dateTz);\n }\n }\n\n /**\n * Update the form field value\n * @param displayString The \"display\" value of this.options set by the time picker\n */\n public setValue(displayString: string): void {\n // Convert the display time string to the actual option object via an array find.\n const newTimeTz = this.options.value.find(\n (opt) => opt.display === displayString\n ).value;\n // Update the selected DateTz and string representations\n this.setSelectedValues(newTimeTz);\n // Send the\n if (newTimeTz) {\n if (this._onChange) {\n this._onChange(newTimeTz);\n }\n }\n }\n\n /**\n * Fires when the form control value is changed\n * @param dateTz The new value for the component\n */\n public writeValue(dateTz: DateTZ | null) {\n // Init is null ?\n if (dateTz != null) {\n // Update the selected DateTz and string representations\n this.setSelectedValues(dateTz);\n // Update the available options\n this.options.next(\n generateAvailableTimesTz(\n dateTz,\n !this.noPastTimes,\n this.step,\n dateTz.building_tz,\n this.all_day,\n this.show_current\n ? [generateOptionForDateTz(dateTz)]\n : [],\n this.startFromDateTz\n )\n );\n }\n }\n}\n\nfunction generateOptionForDateTz(dateTz: DateTZ): SelectOption {\n return {\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n nearestDurationToInput,\n DurationGroup,\n} from '@mckinsey-converge/base';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map\n} from 'rxjs/operators';\nimport {\n DEFAULT_DURATION,\n defaultDurationGroups,\n generateDurationOptionsFromGroups\n} from '../utils/time.utils';\nimport { MatSelect } from '@angular/material/select';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'mck-duration-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n `,\n styleUrls: ['./duration-field.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DurationFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class DurationFieldComponent extends BaseDirective implements OnInit, ControlValueAccessor, OnChanges {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n @Input() max_length?: number;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Start date value to count from */\n @Input() public startDate: number;\n /** Set to limit the duration options */\n @Input() public extended?: boolean;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n /**\n * Specify the slice of durations to use when generating options.\n */\n @Input() public durationGroups: DurationGroup[] = defaultDurationGroups;\n\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n public value = new BehaviorSubject(DEFAULT_DURATION);\n\n public currentStartDate = new BehaviorSubject(DateNow(new Date()));\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([this.filterFormControl.valueChanges, this.currentStartDate]).pipe(\n map(([value, currentStartDate]) => nearestDurationToInput(this.durationGroups, currentStartDate.ms, value)\n ));\n\n public options = new BehaviorSubject[]>([]);\n\n public placeHolderOption = this.options.pipe(\n map(options => options.find(o => o.value === DEFAULT_DURATION))\n );\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public isDisabled(option: SelectOption) {\n return this.max_length ? option.value > this.max_length : false;\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n ngOnInit(): void {\n this.subscription('OptionsCalculation',\n this.currentStartDate.pipe(\n map(d => generateDurationOptionsFromGroups(d.toZone(this.timezone), this.durationGroups, this.extended))\n ).subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.timezone) {\n const dopt = generateDurationOptionsFromGroups(this.currentStartDate.value.toZone(this.timezone), this.durationGroups, this.extended);\n this.options.next(dopt);\n }\n if (changes.startDate) {\n // R--- refactor input param\n const date = new DateTZ({date: this.startDate})\n this.currentStartDate.next(date);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number): void {\n this.writeValue(new_value);\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n writeValue(obj: number): void {\n this.value.next(obj);\n if (this._onChange) {\n this._onChange(obj);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'mck-error-message',\n template: `\n
\n
\n
\n \n \n \n
\n
\n `,\n styleUrls: ['./error-message.component.scss']\n})\nexport class ErrorMessageComponent {\n\n constructor() {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-calendar-icon',\n template: `\n \n \n \n \n \n `,\n})\nexport class CalendarIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../../base-template.component';\n\n@Component({\n selector: 'mck-chevron-icon',\n template: `\n \n \n
\n \n \n \n
\n
\n \n
\n `\n})\nexport class ChevronIconComponent extends BaseTemplateComponent {\n\n @Input()\n fillClass?: string;\n\n @Input()\n up?: boolean;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit\n} from '@angular/core';\n\n@Component({\n selector: 'mck-close-icon',\n template: `\n \n \n \n \n `\n})\nexport class CloseIconComponent implements OnInit {\n\n @Input()\n fillClass?: string;\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n}\n","import {\n Component,\n Input,\n ViewContainerRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component(\n {\n selector: 'mck-informational-image',\n template: `\n \n
\n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./informational-image.component.scss'],\n encapsulation: ViewEncapsulation.None\n }\n)\nexport class InformationalImageComponent extends BaseTemplateComponent {\n\n @Input()\n public src: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-label',\n template: `\n \n \n \n *\n \n \n `,\n styleUrls: ['./label.component.scss']\n})\nexport class LabelComponent extends BaseTemplateComponent implements OnInit {\n\n @Input()\n required = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { MatSelect } from '@angular/material/select';\nimport { SelectOption } from '../options/select-option';\n\n@Component({\n selector: 'mck-legend-dropdown',\n template: `\n
\n \n \n \n \n
\n \n \n \n {{ buildPlaceholder() }}\n \n
\n \n
\n \n
\n `,\n styleUrls: ['./legend-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class LegendDropdownComponent {\n\n @Input()\n public placeholder: string;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public placeholderOpen?: string\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public buildPlaceholder(){\n return this.isOpen && this.placeholderOpen ? this.placeholderOpen : this.placeholder\n }\n}\n","import {\n Component,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewChild,\n OnInit\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport {\n BehaviorSubject,\n Observable\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { AcaDatePickerComponent } from '../aca-date-picker/aca-date-picker.component';\n\n@Component({\n selector: 'mck-date-picker',\n template: `\n \n Date\n \n
{{ dateString | async }}
\n
\n \n
\n \n \n \n
\n \n Today\n \n
\n
\n \n `,\n styleUrls: ['./mck-date-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MckDatePickerComponent),\n multi: true\n }\n ]\n})\nexport class MckDatePickerComponent extends BaseDirective implements OnInit, ControlValueAccessor {\n /** Earliest date available the user is allowed to pick */\n @Input('from') public _from: number = DateNow(new Date()).ms;\n /** Latest date available the user is allowed to pick */\n @Input('to') public _to: number;\n /** Position of the tooltip */\n @Input() public position: 'right' | 'left' = 'right';\n /** Offset of the tooltip */\n @Input() public offset: 'top' | 'bottom' = 'bottom';\n /** Whether form control is disabled */\n @Input() public disabled: boolean;\n /** Whether to show the calendar tooltip */\n @Input() public icon_only: boolean = false;\n\n @Input() public initialDateSelection?: number;\n\n @Input() public invalid?: boolean;\n\n @Output() public onSelect = new EventEmitter();\n\n // R--- or is this the date picker to refactor. too tired.\n public ngOnInit(): void {\n if (this.initialDateSelection) {\n this.writeValue(this.initialDateSelection)\n }\n }\n\n /** Whether to show the calendar tooltip */\n public show_tooltip: boolean;\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n @ViewChild(AcaDatePickerComponent, {static: true }) private _acaDatePicker: AcaDatePickerComponent;\n\n /** Currently selected date */\n public dateValue = new BehaviorSubject(DateNow(new Date()));\n\n /** First allowed date on the calendar */\n public get from(): number {\n return this._from || DateNow(new Date()).startOfValue('day').ms;\n }\n\n /** Current date value */\n public get until(): number {\n return this._to || DateNow(new Date()).endOfValue('day').addValue({ years: 1 }).ms;\n }\n\n /** Display value for the current date */\n public get dateString(): Observable {\n return this.dateValue.pipe(map(d => {\n const display = d.formatDate('ccc dd MMM yyyy');\n return `${display}${d.isSameDate(DateNow(new Date()), 'day') ? ' (Today)' : ''}`;\n }));\n }\n\n /** Whether date picker is open */\n public get is_open(): boolean {\n return this._trigger.menuOpen;\n }\n\n public get date(): Observable {\n return this.dateValue;\n\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: number) {\n // Keep hours and minutes of the old date\n const old_date = this.dateValue.value;\n const d = new DateTZ({date: new_value})\n let new_date = d\n .setValue({ hour: old_date.dateHour, minute: old_date.minutes })\n .ms;\n // Check that new date is before from\n if (new_date < this.from) {\n new_date = this.from;\n }\n const new_d = new DateTZ({ date: new_date })\n this.dateValue.next(new_d);\n if (this._onChange) {\n this._onChange(new_date);\n }\n this.onSelect.emit(new_date);\n this.show_tooltip = false;\n }\n\n public goToToday() {\n this.setValue(DateNow(new Date()).ms);\n }\n\n public resetToLastSelection = () => this._acaDatePicker.updateDate();\n\n public onDatePickerClose() {\n this.resetToLastSelection();\n }\n\n /* istanbul ignore next */\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number) {\n const date = new DateTZ({date: value})\n this.dateValue.next(date);\n this.show_tooltip = false;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /* istanbul ignore next */\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /** Set the state of the tooltip to closed after delay */\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n /** Set the state of the tooltip to closed after delay */\n public openDatePicker() {\n this._trigger.openMenu();\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\n@Component({\n selector: 'mck-modal-button-row',\n template: `\n \n \n \n \n
\n \n {{secondaryLabel}}\n \n \n {{primaryLabel}}\n\n \n
\n \n
\n `,\n styleUrls: ['./modal-button-row.component.scss']\n})\nexport class ModalButtonRowComponent extends BaseTemplateComponent {\n\n @Input()\n primaryLabel?: string;\n\n /**\n * Specify if you want to disable the primary button\n */\n @Input()\n primaryDisabled?: boolean = false;\n\n /**\n * Used only if primaryLabel is specified.\n */\n @Output()\n public primarySubmit = new EventEmitter();\n\n /**\n * Specify if you want to show a secondary label button\n */\n @Input()\n secondaryLabel?: string;\n\n @Input()\n disableFixed: boolean = false;\n\n /**\n * Specify if you want to disable the secondary button\n */\n @Input()\n secondaryDisabled?: boolean = false;\n\n /**\n * Used only if secondaryLabel is specified.\n */\n @Output()\n public secondarySubmit = new EventEmitter();\n\n @Input()\n smallButtons?: boolean = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n Input\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-modal',\n template: `\n \n
\n
\n \n
\n
\n

{{header}}

\n
\n
\n \n
\n `,\n styleUrls: ['./modal.component.scss']\n})\nexport class ModalComponent {\n\n @Input()\n header?: string;\n @Input() shouldClose?: boolean = true;\n\n constructor(private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n}\n","import { Component, EventEmitter, Inject, OnInit, Output } from '@angular/core';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\nimport { DateTZ, isToday } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'override-changes-modal',\n templateUrl: './override-changes-modal.component.html',\n styleUrls: ['./override-changes-modal.component.scss']\n})\nexport class OverrideChangesModalComponent implements OnInit{\n\n public edits;\n public timezone;\n\n @Output() public event = new EventEmitter();\n\n constructor(@Inject(MAT_DIALOG_DATA) private _data: OverrideChangesModalComponent){\n\n }\n\n public ngOnInit(){\n // this.edits = this._data.edits.sort((a, b) => a - b);\n\n // Function to convert epoch to 'YYYY-MM-DD' format\n const getDateString = (epoch) => {\n return new Date(epoch * 1000).toISOString().split('T')[0];\n };\n\n // Set to store unique date strings\n const uniqueDates = new Set();\n\n // Filter the edits array\n const filteredEdits = this._data.edits.filter(epoch => {\n const dateString = getDateString(epoch);\n if (!uniqueDates.has(dateString)) {\n uniqueDates.add(dateString);\n return true;\n }\n return false;\n });\n\n this.edits = filteredEdits;\n }\n\n public formatDate(date: number) {\n const dateTZ = new DateTZ({date: date*1000, is_local_tz: false, building_tz: this._data.timezone });\n const dateIsToday = isToday(dateTZ, this._data.timezone);\n const display = dateTZ.formatDate('ccc dd MMM yyyy');\n return `${display}${dateIsToday ? ' (Today)' : ''}`;\n }\n\n public continue(): void {\n this.event.emit({ reason: 'done' });\n }\n\n public close(): void {\n this.event.emit({ reason: 'close' });\n }\n}","
\n \n \n
\n\n \n \n \n\n

Overriding Changes

\n

Editing the series here will override all previous changes made to individual occurrences. Are you sure you want to proceed?

\n\n \n \n \n \n \n \n \n \n \n \n \n
Dates
{{formatDate(edit)}}
\n
\n\n\n \n \n","import {\n Pipe,\n PipeTransform\n} from '@angular/core';\n\n/**\n * Transforms input by returning a subset of items based on if the\n * any items include the search text based on passed objectKey.\n *\n * objectKey can be pipe separated keys. e.g: 'name|age'. Then it will check against all.\n */\n@Pipe({\n name: 'filter'\n})\nexport class FilterPipe implements PipeTransform {\n transform(items: any[], searchText: string, objectKey?: string): any[] {\n if (!items) return [];\n if (!searchText) return items;\n searchText = searchText.toLowerCase();\n const splitKeys = objectKey?.split('|') ?? [];\n return items.filter(it => {\n let included = false;\n splitKeys.forEach((key) => {\n if (it[key]?.toLowerCase().includes(searchText)) {\n included = true;\n }\n });\n if (splitKeys.length === 0) {\n return it.toLowerCase().includes(searchText);\n }\n return included;\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport {\n DomSanitizer,\n SafeHtml,\n SafeResourceUrl,\n SafeScript,\n SafeStyle,\n} from '@angular/platform-browser';\n\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n@Pipe({\n name: 'sanitize',\n})\nexport class SanitizePipe implements PipeTransform {\n constructor(private sanitizer: DomSanitizer) {}\n\n transform(\n value: string,\n type: 'resource' | 'url' | 'script' | 'style' | 'html' = 'html'\n ): SafeHtml | SafeResourceUrl | SafeScript | SafeStyle {\n switch (type) {\n case 'resource':\n return (\n this.sanitizer.sanitize(\n SecurityContext.RESOURCE_URL,\n value\n ) || ''\n );\n case 'url':\n return (\n this.sanitizer.sanitize(SecurityContext.URL, value) || ''\n );\n case 'script':\n return (\n this.sanitizer.sanitize(SecurityContext.SCRIPT, value) || ''\n );\n case 'style':\n return (\n this.sanitizer.sanitize(SecurityContext.STYLE, value) || ''\n );\n }\n return this.sanitizer.sanitize(SecurityContext.HTML, value) || '';\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { SelectOption } from '../types';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'mck-radio-select',\n template: `\n \n
\n {{label}}\n \n {{option.display}}\n \n
\n
\n `,\n styleUrls: ['./radio-select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioSelectComponent),\n multi: true\n }\n ]\n})\nexport class RadioSelectComponent extends BaseTemplateComponent implements OnInit, ControlValueAccessor {\n\n @Input()\n label: string;\n\n @Input()\n required?: boolean;\n\n @Input()\n options: SelectOption[];\n\n public value = new BehaviorSubject | undefined>(undefined);\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this._onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public setValue(value: string) {\n const obj = this.options.find(o => o.value === value);\n this.writeValue(obj);\n if (this._onChange) {\n this._onChange(obj)\n }\n }\n\n writeValue(obj: SelectOption): void {\n this.value.next(obj);\n }\n}\n","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { OrganisationService, RecurrencePeriod, RecurrenceType, removeExpiredOcurrences, RepeatsOn } from \"@mckinsey-converge/data-common\";\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { first } from \"rxjs/operators\";\nimport { RecurrencePatternForm } from \"../recurrence-pattern-form/recurrence-pattern-form.component\";\n\n@Component({\n selector: 'recurrence-booking-form',\n templateUrl: './recurrence-booking-form.component.html',\n styleUrls: ['./recurrence-booking-form.component.scss']\n})\n\nexport class RecurringBookingForm implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n\n public current_type: RecurrenceType; \n public recurrence_types: Array = [\n {type: RepeatsOn.PATTERN, label: 'Repeats on'},\n {type: RepeatsOn.DATE, label: 'Repeats on specific date'}\n ]\n\n public building_tz = \"\";\n\n @ViewChild(RecurrencePatternForm) pattern_form: RecurrencePatternForm;\n\n constructor(\n private _org: OrganisationService,\n ) {}\n\n public get recurrencePeriod(){\n return this.form.get('recurrence_period')\n }\n\n public ngOnInit(): void {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.building_tz = this._org?.building?.timezone || 'America/Chicago';\n })\n if(this.recurrencePeriod.value === RecurrencePeriod.LIST){\n this.current_type = this.recurrence_types[1];\n removeExpiredOcurrences(this.form)\n }else{\n this.current_type = this.recurrence_types[0];\n }\n }\n\n public onChangeType(value: string) {\n this.current_type = this.recurrence_types.filter((type) => type.type === value)[0]\n if(this.current_type.type === RepeatsOn.PATTERN){\n this.recurrencePeriod.setValue(this.pattern_form.recurrencePatternFormControl.value)\n }else{\n this.recurrencePeriod.setValue(RecurrencePeriod.LIST)\n }\n }\n\n public dateToBuildingTz(date?: number){\n return new DateTZ({date, building_tz: this.building_tz, is_local_tz: false})\n }\n\n public get error(){\n const recurrence_starts = this.form.controls.recurrence_starts\n const recurrence_days = this.form.controls.recurrence_days\n return recurrence_starts.invalid || recurrence_days.invalid\n }\n\n}\n","
\n \n
\n \n \n {{recurrence_types[0].label}}\n \n \n \n
\n
\n \n \n {{recurrence_types[1].label}}\n \n \n \n
\n
\n
\nThe recurrence pattern is not valid.","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport { FormGroup } from \"@angular/forms\";\nimport { MatMenuTrigger } from \"@angular/material/menu\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { OrganisationService } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ,toMiddayUTC } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-date-form',\n templateUrl: './recurrence-date-form.component.html',\n styleUrls: ['./recurrence-date-form.component.scss']\n})\n\nexport class RecurrenceDateForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n @ViewChild(MatMenuTrigger, { static: true }) private _trigger: MatMenuTrigger;\n\n public selected_dates: Array = []\n public timezone: string = '';\n public nowTz: DateTZ = DateNow(new Date());\n public fromDateTz: DateTZ = this.nowTz.clone();\n public untilDateTz: DateTZ = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n public dateTz: DateTZ = DateNow(new Date());\n\n public get recurrenceStarts(){\n return this.form.get('recurrence_starts');\n }\n\n public get formDateTz(){\n return this.form.get('dateTz');\n }\n\n constructor (private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The fromDateTz is curious, would it make sense to be based on the form dateTz?\n this.fromDateTz = this.nowTz.clone()\n this.untilDateTz = this.fromDateTz.endOfValue('day').addValue({ years: 1 });\n\n if(this.recurrenceStarts.value){\n const tempForSort = [...this.recurrenceStarts.value]; // due to cannot assign to read only property '0' of object '[object Array]'\n this.selected_dates = tempForSort.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n this.subscription('ocurrenceChanges', this.recurrenceStarts.valueChanges\n .subscribe(() => {\n this.selected_dates = [...this.recurrenceStarts.value]\n })\n ); \n }\n\n /**\n * Add value to the list of selected dates\n * @param newDateTz\n */\n public addDate(newDateTz: DateTZ) {\n const d = newDateTz.clone();\n const start_date = this.formDateTz.value;\n let new_date = d.setValue({hour: start_date.dateHour, minute: start_date.minutes})\n \n /** Prevent user from selecting past dates */\n if (new_date.isBeforeDate(this.fromDateTz)) {\n new_date = this.fromDateTz;\n }\n\n /** Prevent user from selecting the same date more than once */\n const is_selected = this.selected_dates.filter((date: DateTZ)=> new_date.isSameDate(date, 'day'))\n if(is_selected.length){\n return\n }\n \n this.selected_dates.push(new_date);\n this.recurrenceStarts.setValue(this.selected_dates.sort((d1, d2) => d1.ms - d2.ms));\n this.setDateTzForm();\n }\n\n /**\n * \n * @param dateMsValue: number\n * @returns \n */\n public setPickerToGivenDate(dateTsValue: DateTZ) {\n this.fromDateTz = dateTsValue.clone();\n }\n\n /**\n * Function calls on close of date picker without date selection\n */\n public onDatePickerClose = () => {\n this.setPickerToGivenDate(this.nowTz)\n };\n\n public goToToday() {\n this.addDate(this.nowTz);\n this.setPickerToGivenDate(this.nowTz);\n }\n\n public closeDatePicker() {\n this._trigger.closeMenu();\n }\n\n public openDatePicker() {\n this._trigger.openMenu();\n }\n\n public deleteDate(date: DateTZ) {\n const index = this.selected_dates.map((d: DateTZ) => d.ms).indexOf(date.ms)\n this.selected_dates.splice(index, 1)\n this.recurrenceStarts.setValue(this.selected_dates)\n this.setDateTzForm()\n }\n\n public isToday(date) {\n return new DateTZ({\n date: toMiddayUTC(date).ms,\n is_local_tz: false,\n building_tz: this.timezone,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone,\n }),\n 'day'\n );\n }\n\n public formatDate(date: DateTZ){\n const isToday = this.isToday(date);\n const display = date.formatDate('ccc dd MMM yyyy');\n\n return `${display}${isToday ? ' (Today)' : ''}`;\n }\n\n private setDateTzForm(): void {\n if (this.selected_dates.length === 0)\n return;\n\n const tz = this._org.building.timezone;\n const date_now = DateNow(new Date()).toZone(tz);\n let dateTz = this.selected_dates[0].clone();\n\n dateTz = dateTz.setValue({\n hour: (this.formDateTz.value as DateTZ).hours,\n minute: (this.formDateTz.value as DateTZ).minutes\n });\n\n if (this.selected_dates[0].isSameDate(this.nowTz, \"day\") && dateTz.hours < date_now.hours) {\n const { minutes: minute, hours: hour } = closestToTimeSlotTz(this.nowTz, 15);\n dateTz = dateTz.setValue({ minute, hour, second: 0 });\n }\n\n this.formDateTz.setValue(dateTz);\n }\n}\n","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
DateAction
{{formatDate(date)}}Delete
\n
[+] Add another date
\n \n
\n \n Today\n \n
\n
\n
\n
","import { Component, Input, OnInit } from \"@angular/core\";\nimport { FormGroup, Validators } from \"@angular/forms\";\nimport { BaseDirective, closestToTimeSlotTz } from \"@mckinsey-converge/base\";\nimport { arrayWithValues, generateWeekDays, RecurrencePeriod, recurrencePeriodToDurationType, RepeatPeriod, validDateTZ, WeekDays } from \"@mckinsey-converge/data-common\";\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\n\n@Component({\n selector: 'recurrence-pattern-form',\n templateUrl: './recurrence-pattern-form.component.html',\n styleUrls: ['./recurrence-pattern-form.component.scss']\n})\n\nexport class RecurrencePatternForm extends BaseDirective implements OnInit {\n /** Form fields for booking */\n @Input() public form: FormGroup;\n @Input() disabled: boolean;\n\n /** Range of dates for the Start Date Picker*/\n public nowTz: DateTZ = DateNow(new Date());\n public fromStartTz: DateTZ = this.nowTz.setValue({ minute: Math.ceil(this.nowTz.minutes / 5) * 5 });\n public untilTz: DateTZ = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n public timezone: string = '';\n \n\n /** Range of dates for the End Date Picker*/\n public fromEndTz: DateTZ;\n\n public repeat_period_options: Array = [\n {label: 'Day', id: RecurrencePeriod.DAILY},\n {label: 'Week',id: RecurrencePeriod.WEEKLY},\n {label: 'Month', id: RecurrencePeriod.ABSOLUTE_MONTHLY}\n ]\n public week_days: Array = []\n\n public repeat_every_options\n\n\n public get recurrenceDateStartTzFormControl() {\n return this.form.get('dateTz')\n }\n\n public get recurrenceEndFormControl(){\n return this.form.get('recurrence_endTz')\n }\n\n public get recurrencePeriodFormControl(){\n return this.form.get('recurrence_period')\n }\n\n public get recurrenceIntervalFormControl(){\n return this.form.get('recurrence_interval')\n }\n\n public get recurrencePatternFormControl(){\n return this.form.get('recurrence_pattern')\n }\n\n public get recurrenceDaysFormControl(){\n return this.form.get('recurrence_days')\n }\n\n public ngOnInit(): void {\n // Setup some data to only run once, the previous giters were hogs\n this.timezone = this.form.get('timezone').value;\n this.nowTz = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: this.timezone });\n // R--- The from date is curious, why isn't it based on the form dateTz?\n this.repeat_every_options = new Array(1)\n this.fromStartTz = closestToTimeSlotTz(this.nowTz, 15)\n this.untilTz = this.nowTz.addValue({ years: 1 }).endOfValue('day');\n this.fromEndTz = this.fromStartTz.addValue({days: 1})\n\n this.setEndDateFromStartDate(this.recurrenceDateStartTzFormControl.value) //make sure end date is after start date\n\n if(!this.recurrencePeriodFormControl.value){\n this.recurrencePeriodFormControl.setValue(RecurrencePeriod.WEEKLY)\n }\n\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.recurrencePatternFormControl.setValue(this.recurrencePeriodFormControl.value)\n }\n\n this.week_days = generateWeekDays(this.recurrenceDateStartTzFormControl.value.ms, { building_tz: this.fromStartTz.building_tz })\n this.generateMaxIntervals()\n\n if(this.recurrenceDaysFormControl.value.length > 0){\n this.week_days = this.week_days.map((day) => \n ({...day, active: this.recurrenceDaysFormControl.value.includes(day.full_name)})\n )\n }\n\n if(!this.recurrenceDaysFormControl.value.length && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n const current_days = this.week_days.filter((day) => day.active).map((day)=>day.full_name)\n this.recurrenceDaysFormControl.setValue(current_days)\n }\n\n this.generateOcurrenceList()\n\n this.subscription('startTimeChanges', this.recurrenceDateStartTzFormControl.valueChanges\n .subscribe((next) => {\n this.setEndDateFromStartDate(next) \n })\n );\n\n this.subscription('endTimeChanges', this.recurrenceEndFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n );\n \n this.subscription('recurrencePeriodFormControlChanges', this.recurrencePeriodFormControl.valueChanges\n .subscribe(() => {\n this.generateMaxIntervals();\n })\n ); \n }\n\n public setEndDateFromStartDate(startDateTz: DateTZ){\n let end_date = this.recurrenceEndFormControl.value.setValue({hour: startDateTz.dateHour, minute: startDateTz.minutes})\n\n /**Update the End date picker range */\n this.fromEndTz = startDateTz.isSameDate(this.untilTz,'day') ? startDateTz : startDateTz.addValue({days: 1})\n\n if(end_date.isBeforeDate(this.fromEndTz)){\n end_date = this.fromEndTz\n }\n\n this.recurrenceEndFormControl.setValue(end_date)\n\n this.generateMaxIntervals()\n this.updateActiveWeekday() \n }\n\n public setRepeatPeriod(value: RecurrencePeriod){\n this.updateValidators(value)\n this.recurrencePeriodFormControl.setValue(value);\n this.recurrencePatternFormControl.setValue(value);\n this.recurrenceIntervalFormControl.setValue(1)\n this.generateOcurrenceList();\n }\n\n public setRepeatEvery(value: number){\n this.recurrenceIntervalFormControl.setValue(value)\n this.generateOcurrenceList()\n }\n\n public repeatTimeString(value: string){\n return this.recurrenceIntervalFormControl.value !== 1 ? `${value}(s)` : value\n }\n\n public get displayWeekdays(){\n return this.recurrencePatternFormControl.value === RecurrencePeriod.WEEKLY\n }\n\n /* Check if selected interval is valid and reset to 1 if not*/\n private validateRecurrenceInterval = () => {\n if(this.repeat_every_options.length < this.recurrenceIntervalFormControl.value){\n this.recurrenceIntervalFormControl.setValue(1)\n } \n };\n\n /**\n * Generate max value for dorpdown interval\n */\n public generateMaxIntervals(){\n const start = this.recurrenceDateStartTzFormControl.value;\n const date_diff = this.recurrenceEndFormControl.value.dateDiff(start, this.periodToDurationType, this.periodToDurationType)\n //If no diff default to 1\n this.repeat_every_options = new Array(Math.round(date_diff) || 1)\n this.validateRecurrenceInterval();\n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.LIST){\n this.generateOcurrenceList()\n }\n }\n\n /**\n * Generate ocurrence list base on the selected interval\n */\n public generateOcurrenceList() {\n\n /**If selected period is list then we don't want \n * to generate a list based on the repeats on selections*/\n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.LIST){\n return\n }\n\n const occurrence = []\n const first_date = this.recurrenceDateStartTzFormControl.value;\n let start = first_date\n const end = this.recurrenceEndFormControl.value;\n const interval = this.recurrenceIntervalFormControl.value\n const recurr_days = this.week_days.filter(day => day.active)\n /**\n * isLastDayOfMonth : Boolean\n * flag - to generate last day of every month in case of day or month reccuring booking if start date is last day of month\n */\n // const isLastDayOfMonth = first_date.date.day === first_date.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY;\n const isLastDayOfMonth = first_date.dateDay === 31 && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY ;\n \n if(this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n start = start.startOfValue('week')\n }\n\n while (end.dateDiff(start.startOfValue('day'), this.periodToDurationType, this.periodToDurationType) >= 0) {\n \n if(this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n occurrence.push(start) \n start = start.addValue({[this.periodToDurationType]: interval}, isLastDayOfMonth);\n /**\n * IF - should only consider resetting start under mentioned condition of ticket - https://acaprojects.atlassian.net/browse/MCK-2085\n * In summery - If user select any date except 31st, other months in the series (no matter 30 or 31 day month) should have same date select as start date.\n * If user select 31st as an start date, other month in the seleries should have select last day of the month (30th/31st/28th/29th).\n * Exception for February - February should select 28th or 29th If in above both selection includes date between 28th - 31st.\n * \n */\n if(start.dateDay !== first_date.dateDay && start.dateDay !== start.date.daysInMonth && this.recurrencePeriodFormControl.value === RecurrencePeriod.ABSOLUTE_MONTHLY) {\n start = start.setValue({day: first_date.dateDay});\n } \n }else {\n recurr_days.forEach((day)=>{\n const date = start.addValue({days: day.day_index})\n if((date.isAfterDate(first_date) || date.isSameDate(first_date, 'day')) && \n (date.isBeforeDate(end) || date.isSameDate(end, 'day'))){\n occurrence.push(date)\n }\n })\n start = start.addValue({[this.periodToDurationType]: interval})\n }\n }\n\n this.form.controls.recurrence_count.setValue(occurrence.length)\n this.form.controls.recurrence_starts.setValue(occurrence.sort((d1, d2) => d1.ms - d2.ms))\n \n }\n\n public get periodToDurationType(){\n const period = this.recurrencePeriodFormControl.value\n return recurrencePeriodToDurationType(period)\n }\n\n /**\n * Update active weekday in the weekdays array\n */\n private updateActiveWeekday() {\n const _week_days = this.week_days.map((day)=>{\n if(this.recurrenceDaysFormControl.value.includes(day.full_name)){\n return {...day, active: true}\n }else{\n return {...day, active: false}\n }\n })\n this.week_days = [..._week_days] \n }\n\n public setWeekDays(new_day: WeekDays){\n const days = this.recurrenceDaysFormControl.value\n if(this.disabled){\n return\n }\n\n if(!new_day.active){\n days.push(new_day.full_name)\n }else{\n const current_index = days.indexOf(new_day.full_name)\n days.splice(current_index,1)\n }\n this.recurrenceDaysFormControl.setValue([...days])\n this.updateActiveWeekday()\n this.generateOcurrenceList()\n }\n\n /**Update the recurrence days validator if period changes */\n public updateValidators(value: RecurrencePeriod){\n if(value === RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value !== RecurrencePeriod.WEEKLY){\n const arrayValidators = [Validators.required];\n arrayValidators.push(arrayWithValues);\n this.recurrenceDaysFormControl.setValidators(arrayValidators);\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }else if(value !== RecurrencePeriod.WEEKLY && this.recurrencePeriodFormControl.value === RecurrencePeriod.WEEKLY){\n this.recurrenceDaysFormControl.clearValidators();\n this.recurrenceDaysFormControl.updateValueAndValidity();\n }\n }\n}\n","
\n
\n \n \n \n Date and time must be in the future\n
\n
\n \n \n \n Date and time must be in the future\n
\n
\n
\n \n
\n \n \n \n {{ i + 1}}\n \n \n \n \n \n \n {{ repeatTimeString(option.label) }}\n \n \n \n
\n
\n
\n \n
\n
\n {{day.id}}\n
\n
\n
\n
\n
","import {\n Component,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\nimport { SelectOption } from '../types';\n\n@Component({\n selector: 'mck-select-option',\n template: `\n \n \n \n \n {{ option.display }}\n \n \n `,\n styleUrls: ['./select-option.component.css']\n})\nexport class SelectOptionComponent extends BaseTemplateComponent {\n\n @Input()\n option: SelectOption;\n\n @Input()\n selected: boolean;\n\n /**\n * If true, we still display as if it wasn't disabled.\n */\n @Input()\n ignoreDisabled = false;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { map } from 'rxjs/operators';\nimport { MatSelect } from '@angular/material/select';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\n\n@Component({\n selector: 'mck-select',\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class SelectComponent implements OnInit, OnChanges, ControlValueAccessor {\n\n @Input()\n public label: string;\n\n @Input()\n public required: boolean;\n\n @Input()\n public options: SelectOption[] = [];\n\n @Input()\n public selectedValue: SelectOption | undefined;\n\n /**\n * When true, can filter by searching on the input.\n */\n @Input()\n public searchEnabled = false;\n\n @Input()\n public splitDisplay = false;\n\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n\n @Input()\n public noEntriesFoundLabel: string;\n\n @Input()\n public showDivider: boolean = false\n\n /** Form control on change handler */\n private _onChange: (_: SelectOption) => void;\n /** Form control on touch handler */\n private _onTouch: (_: SelectOption) => void;\n\n public filterFormControl: FormControl = new FormControl();\n\n public value = new BehaviorSubject(this.selectedValue || this.options[0]?.value);\n\n /** Available time blocks for the selected date */\n public _options = new BehaviorSubject[]>(this.options);\n\n /** Select field for selecting the value */\n @ViewChild('select') private select_field: MatSelect;\n\n public selectedOption = combineLatest([this._options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this._options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n\n constructor() {\n }\n\n public ngOnInit(): void {\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.options) {\n this._options.next(this.options);\n this.value.next(this.selectedValue || this.options?.[0]?.value);\n }\n if (changes.selectedValue) {\n this.value.next(this.selectedValue?.value);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n this.value.next(new_value);\n if (this._onChange) {\n this._onChange(this.options.find(f => f.value === new_value));\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: SelectOption | null) {\n if (value != null) {\n this.value.next(value.value);\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: SelectOption) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: SelectOption) => void): void {\n this._onTouch = fn;\n }\n\n}\n","
\n {{label}}\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\n@Component({\n selector: 'mck-selected-chip-count',\n template: `\n \n {{count}}\n \n \n `,\n styleUrls: ['./selected-chip-count.component.scss']\n})\nexport class SelectedChipCountComponent {\n\n @Input()\n count: number;\n\n @Output()\n close = new EventEmitter();\n\n}\n","import {\n Component,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { BaseTemplateComponent } from '../base-template.component';\n\nexport enum SpacerMode {\n /**\n * If vertical, it expands in the vertical direction. Size is width.\n */\n Vertical = 'vertical',\n /**\n * If horizontal, it expands in the horizontal direction. Size is height.\n */\n Horizontal = 'horizontal',\n}\n\n@Component({\n selector: 'mck-spacer',\n template: `\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./spacer.component.css'],\n})\nexport class SpacerComponent extends BaseTemplateComponent implements OnInit {\n SpacerMode = SpacerMode;\n\n @Input()\n size: string;\n\n @Input()\n mode: SpacerMode = SpacerMode.Horizontal;\n\n @Input()\n autoSize?: boolean;\n\n @Input()\n spacerClass?: string;\n\n constructor(vcRef: ViewContainerRef) {\n super(vcRef);\n }\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-switch-group',\n template: `\n
\n {{title}}\n {{option.display}}\n
\n `,\n styleUrls: ['./switch-group.component.scss']\n})\nexport class SwitchGroupComponent implements OnInit {\n\n @Input()\n title: string;\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selectedOptions: SelectOption[] = [];\n\n @Output()\n optionChecked = new EventEmitter>();\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n public onCheckedChange(option: SelectOption) {\n this.optionChecked.emit(option);\n }\n\n public isSelected(option: SelectOption) {\n return !!this.selectedOptions.find(s => s.value === option.value);\n }\n}\n","import {\n Component,\n forwardRef,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR\n} from '@angular/forms';\nimport { MatSelect } from '@angular/material/select';\n\nimport {\n BaseDirective,\n closestToTimeSlot,\n nearestStepToInput,\n timeWithGmtOffsetFormatString\n} from '@mckinsey-converge/base';\n\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { generateAvailableTimes } from '../utils/time.utils';\nimport {\n BehaviorSubject,\n combineLatest\n} from 'rxjs';\nimport {\n filter,\n map,\n withLatestFrom\n} from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\n@Component({\n selector: 'mck-time-field',\n template: `\n
\n {{label}}\n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n `,\n styleUrls: ['./time-field.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimeFieldComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimeFieldComponent extends BaseDirective implements OnInit, OnChanges, ControlValueAccessor {\n @Input()\n public label: string;\n @Input()\n public required: boolean;\n /** Time step between each allowed time option */\n @Input() public step = 15;\n /** Whether form field is disabled */\n @Input() public disabled: boolean;\n /** Whether past times are allowed */\n @Input() public noPastTimes = true;\n /** Representing the date from start **/\n @Input() public from: number;\n /** Representing desired timezone **/\n @Input() public timezone?: string = new DateTZ({ date: Date.now() }).local_tz;\n\n // R-- Which time field is going to be used, there's too many\n /** Form control on change handler */\n private _onChange: (_: number) => void;\n /** Form control on touch handler */\n private _onTouch: (_: number) => void;\n\n /** Select field for selecting the time */\n @ViewChild('select') private select_field: MatSelect;\n\n /** String representing the currently set date */\n public date = new BehaviorSubject(DateNow(new Date()).ms);\n\n public filterFormControl: FormControl = new FormControl();\n\n public nearestStep = combineLatest([\n this.filterFormControl.valueChanges,\n this.date]).pipe(\n map(([value, date]) => nearestStepToInput(this.step, value, DateTime.now().valueOf()))\n );\n\n /** String representing the currently set time */\n public value = new BehaviorSubject(closestToTimeSlot(DateTime.now(), this.step).toFormat('HH:mm'));\n\n /** Available time blocks for the selected date */\n public options = new BehaviorSubject[]>(generateAvailableTimes(DateNow(new Date()).ms, !this.noPastTimes, this.step, this.timezone));\n\n public selectedOption = combineLatest([this.options, this.value]).pipe(\n map(([options, value]) => options.find(o => o.value === value))\n );\n\n public placeHolderOption = this.options.pipe(\n map(os => os.length > 0 && os[0])\n );\n\n public isSelected(option: SelectOption) {\n return this.value.pipe(map(t => t === option.value));\n }\n\n public get isOpen() {\n return this.select_field?.panelOpen ?? false;\n }\n\n public ngOnInit(): void {\n // Generate the time input options for the booking date\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n\n // Subscribe to selected option changes\n this.subscription('dateTimeChanges',\n combineLatest([\n this.date\n ]).pipe(\n map(([date]) => {\n // R--- The time input needing to be TZ aware.\n const closestTimeSlot = closestToTimeSlot(DateTime.fromMillis(date.valueOf()), this.step);\n // Need to return the date with building timezone or the HH:mm representation will no match the option values\n return new DateTZ({date: closestTimeSlot.valueOf(), is_local_tz:false, building_tz: this.timezone});\n }),\n withLatestFrom(this.options),\n filter(([date, timeOptions]: [DateTZ, SelectOption[]]) => {\n // if new time slot opened up when date / time changes, add it here.\n return !timeOptions.find(t => t.value === date.formatDate('HH:mm'));\n }),\n map(([date, timeOptions]) => {\n // TODO probably an issue here with going from a future date and time earlier than now back to day showing null\n // Push the current date option in\n timeOptions.push({\n display: timeWithGmtOffsetFormatString(date),\n value: date.formatDate('HH:mm')\n });\n // Sort the time options\n timeOptions.sort((a, b) => `${a.value}`.localeCompare(`${b.value}`));\n return timeOptions;\n })\n ).subscribe(next => this.options.next(next)));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.no_past_times || changes.step || changes.timezone) {\n // If there's a new date value then update the time options\n this.options.next(generateAvailableTimes(this.date.value, !this.noPastTimes, this.step, this.timezone));\n const buildingDate = new DateTZ({date: this.from, is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.value.next(buildingDate.formatDate('HH:mm'));\n }\n if (changes.from) {\n // When the from input param changes update the date value\n this.date.next(this.from);\n }\n }\n\n /**\n * Update the form field value\n * @param new_value New value to set on the form field\n */\n public setValue(new_value: string): void {\n // value comes in as a HH:mm string\n const newTime = (new_value.indexOf(':') > 0 ? new_value : '00:00').split(':');\n // need the date with the building timezone so the hour set is relative to there and not local.\n const d = new DateTZ({ date: this.date.value, is_local_tz: false, building_tz: this.timezone });\n const date = d.setValue({ hour: parseInt(newTime[0]), minute: parseInt(newTime[1]) });\n if (date) {\n if (this._onChange) {\n this._onChange(date.ms);\n }\n }\n }\n\n /**\n * Update local value when form control value is changed\n * @param value The new value for the component\n */\n public writeValue(value: number | null) {\n if (value != null) {\n // Time input value in building time milliseconds\n this.date.next(value);\n // Get the closest time to slot in case the browser was idle and elapse the valid times\n const date = closestToTimeSlot(DateTime.fromMillis(value).startOf('minute'), this.step);\n // Need the building time so HH:mm is correct\n const buildingDate = new DateTZ({date: date.valueOf(), is_local_tz: false, building_tz: this.timezone}).startOfValue('minute');\n this.options.next(generateAvailableTimes(buildingDate.ms, !this.noPastTimes, this.step, this.timezone));\n }\n }\n\n public setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Registers a callback function that is called when the control's value changes in the UI.\n * @param fn The callback function to register\n */\n public registerOnChange(fn: (_: number) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback function is called by the forms API on initialization to update the form model on blur.\n * @param fn The callback function to register\n */\n public registerOnTouched(fn: (_: number) => void): void {\n this._onTouch = fn;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'mck-toggle',\n template: `\n
\n \n
\n `,\n styleUrls: ['./toggle.component.scss']\n})\nexport class ToggleComponent {\n\n @Input()\n options: SelectOption[];\n\n @Input()\n selected: SelectOption;\n\n @Output()\n selectedChange = new EventEmitter>();\n\n public onTapOption(option: SelectOption) {\n this.selectedChange.emit(option);\n }\n\n isSelected(option: SelectOption) {\n return this.selected === option;\n }\n}\n","import { Component, Input } from '@angular/core';\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Component({\n selector: 'app-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss']\n})\nexport class TooltipComponent {\n isVisible: boolean = false; // To control the visibility of the tooltip\n position: TooltipPosition = TooltipPosition.DEFAULT;\n theme: TooltipTheme = TooltipTheme.DEFAULT;\n tooltip = '';\n left = 0;\n top = 0;\n visible = false;\n}","
\n
\n
\n {{string}}\n
\n
\n
","import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n HostListener,\n Injector,\n Input,\n ViewContainerRef\n} from '@angular/core';\nimport {TooltipComponent} from \"./tooltip.component\";\nimport {TooltipPosition, TooltipTheme} from \"./tooltip.enums\";\n\n@Directive({\n selector: '[tooltip]'\n})\nexport class TooltipDirective {\n\n @Input() tooltip = '';\n @Input() position: TooltipPosition = TooltipPosition.DEFAULT;\n @Input() theme: TooltipTheme = TooltipTheme.DEFAULT;\n @Input() trigger: ('hover' | 'click' | 'touch')[] = ['hover']; // Now an array of trigger types\n @Input() showDelay = 0;\n @Input() hideDelay = 0;\n @Input() show: boolean = true;\n\n private componentRef: ComponentRef | null = null;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n\n constructor(\n private elementRef: ElementRef, \n private appRef: ApplicationRef,\n private componentFactoryResolver: ComponentFactoryResolver, \n private injector: Injector) {\n }\n\n // Helper function to check if the tirgger type is present \n private hasTrigger(triggerType: 'hover' | 'click' | 'touch'): boolean {\n return this.trigger.includes(triggerType);\n }\n\n //Mouse and hover events\n @HostListener('mouseenter')\n onMouseEnter(): void {\n if (this.hasTrigger('hover') ) {\n this.initializeTooltip();\n }\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n if (this.hasTrigger('hover') ) {\n this.setHideTooltipTimeout();\n }\n }\n\n // Click event\n @HostListener('click')\n onClick(): void {\n if (this.hasTrigger('click') ) {\n if (this.componentRef === null) {\n this.initializeTooltip();\n } else {\n this.destroy(); // Hide tooltip if it is already shown\n }\n }\n }\n\n // Touch event\n\n\n @HostListener('touchstart', ['$event'])\n onTouchStart($event: TouchEvent): void {\n // Prevent default to avoid click event fire immedieatly \n // $event.preventDefault();\n if(this.hasTrigger('touch')) {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = window.setTimeout(this.initializeTooltip.bind(this), 150); // show the tooltip after short delay\n }\n \n }\n\n @HostListener('touchend')\n onTouchEnd(): void {\n // Hide the tooltip when touch end \n if(this.hasTrigger('touch') ){\n window.clearTimeout(this.touchTimeout);\n // this.setHideTooltipTimeout();\n setTimeout(() => {\n this.setHideTooltipTimeout();\n }, 500); \n }\n \n }\n\n // Initialization of the tooltip\n private initializeTooltip() {\n if (this.componentRef === null) {\n window.clearInterval(this.hideDelay);\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);\n this.componentRef = componentFactory.create(this.injector);\n\n this.appRef.attachView(this.componentRef.hostView);\n const [tooltipDOMElement] = (this.componentRef.hostView as EmbeddedViewRef).rootNodes;\n\n this.setTooltipComponentProperties();\n\n document.body.appendChild(tooltipDOMElement);\n this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);\n }\n }\n\n private setTooltipComponentProperties() {\n if (this.componentRef !== null) {\n this.componentRef.instance.tooltip = this.tooltip;\n this.componentRef.instance.position = this.position;\n this.componentRef.instance.theme = this.theme;\n\n const {left, right, top, bottom} = this.elementRef.nativeElement.getBoundingClientRect();\n\n switch (this.position) {\n case TooltipPosition.BELOW: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(bottom);\n break;\n }\n case TooltipPosition.ABOVE: {\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\n this.componentRef.instance.top = Math.round(top);\n break;\n }\n case TooltipPosition.RIGHT: {\n this.componentRef.instance.left = Math.round(right);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n case TooltipPosition.LEFT: {\n this.componentRef.instance.left = Math.round(left);\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\n break;\n }\n default: {\n break;\n }\n }\n }\n }\n\n private showTooltip() {\n if (this.componentRef !== null) {\n this.componentRef.instance.visible = this.show ? true : false;\n }\n }\n\n private setHideTooltipTimeout() {\n this.hideTimeout = window.setTimeout(this.destroy.bind(this), this.hideDelay);\n }\n\n ngOnDestroy(): void {\n this.destroy();\n }\n\n destroy(): void {\n if (this.componentRef !== null) {\n window.clearInterval(this.showTimeout);\n window.clearInterval(this.hideDelay);\n this.appRef.detachView(this.componentRef.hostView);\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","export enum TooltipPosition {\n ABOVE = 'above',\n BELOW = 'below',\n LEFT = 'left',\n RIGHT = 'right',\n DYNAMIC = 'dynamic',\n DEFAULT = 'below'\n}\n\nexport enum TooltipTheme {\n DARK = 'dark',\n LIGHT = 'light',\n DEFAULT = 'dark'\n}\n","export { AlertMode, AlertBannerDisplay } from './alert-banner/alert-banner.component';\nexport { SelectOption } from './options/select-option';\nexport * from './cng-select/dropdown-panel';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatSelectModule } from '@angular/material/select';\nimport { AutoCompleteChipSelectItemComponent } from './auto-complete-chip-select-item/auto-complete-chip-select-item.component';\nimport { AutoCompleteSelectOptionComponent } from './auto-complete-select-option/auto-complete-select-option.component';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { RadioSelectComponent } from './radio-select/radio-select.component';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FilterPipe } from './pipes/filter.pipe';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TimeFieldComponent } from './time-field/time-field.component';\nimport { DateTzTimeFieldComponent } from './date-tz-time-field/date-tz-time-field.component';\nimport { SpacerComponent } from './spacer/spacer.component';\nimport { DurationFieldComponent } from './duration-field/duration-field.component';\nimport { DateTzDurationFieldComponent } from './date-tz-duration-field/date-tz-duration-field.component';\nimport { AcaDatePickerComponent } from './aca-date-picker/aca-date-picker.component'; // the old widget\nimport { MckDatePickerComponent } from './mck-date-picker/mck-date-picker.component'; // the old form field \nimport { DateTzCalendarWidgetComponent } from './date-tz-calendar-widget/date-tz-calendar-widget.component'; // the new widget\nimport { DateTzDatePickerComponent } from './date-tz-date-picker/date-tz-date-picker.component'; // the new form field \nimport { CalendarIconComponent } from './icons/calendar/calendar-icon.component';\nimport { ChevronIconComponent } from './icons/calendar/chevron-icon.component';\nimport { SelectOptionComponent } from './select-option/select-option.component';\nimport { CloseIconComponent } from './icons/close/close-icon.component';\nimport { SelectedChipCountComponent } from './selected-chip-count/selected-chip-count.component';\nimport { AlertBannerComponent } from './alert-banner/alert-banner.component';\nimport { ErrorMessageComponent } from './error-message/error-message.component';\nimport { ToggleComponent } from './toggle/toggle.component';\nimport { LabelComponent } from './label/label.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { CollapseHeaderComponent } from './collapse-header/collapse-header.component';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { SwitchGroupComponent } from './switch-group/switch-group.component';\nimport { ModalButtonRowComponent } from './modal-button-row/modal-button-row.component';\nimport { InformationalImageComponent } from './informational-image/informational-image.component';\nimport { GroupHeaderPipe } from './auto-complete-chip-select-item/groupHeader.pipe';\nimport { SelectComponent } from './select/select.component';\nimport { LegendDropdownComponent } from './legend-dropdown/legend-dropdown.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RecurrencePatternForm } from './recurrence-pattern-form/recurrence-pattern-form.component'; \nimport { RecurrenceDateForm } from './recurrence-date-form/recurrence-date-form.component';\nimport { ConflictsModalComponent } from './conflicts-modal/conflicts-modal.component';\nimport { RecurringBookingForm } from './recurrence-booking-form/recurrence-booking-form.component';\nimport { OverrideChangesModalComponent } from './override-changes-modal/override-changes-modal.component';\nimport { SanitizePipe } from './pipes/sanitise.pipe';\nimport { ConflictAlertModalComponent } from './conflict-alert-modal/conflict-alert-modal.component';\nimport { CngSelectComponent } from './cng-select/cng-select.component';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { DropdownTriggerForDirective } from './cng-select/dropdown-trigger-for.directive';\nimport { CngSelectOptionsComponent } from './cng-select/cng-select-options.component';\nimport { TooltipComponent } from './tooltip/tooltip.component';\nimport { TooltipDirective } from './tooltip/tooltip.directive';\nimport { ZoomWarningComponent } from './zoom-warning-modal/components/zoom-warning/zoom-warning.component';\nimport { CustomSnackbarComponent } from './custom-snackbar-component/custom-snackbar-component.component';\nimport { SnackBarService } from './custom-snackbar-component/custom-snackbar-component.service';\nimport { CateringDropComponent } from './catering-drop-modal/components/catering-drop/catering-drop-modal.component';\n\nexport const MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule,\n MatExpansionModule,\n OverlayModule\n];\n\n@NgModule({\n imports: [CommonModule,\n ...MATERIAL_MODULES,\n ReactiveFormsModule,\n FormsModule,\n NgxMatSelectSearchModule, \n NgxSkeletonLoaderModule,\n MatSnackBarModule],\n declarations: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n GroupHeaderPipe,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n SelectOptionComponent,\n CloseIconComponent,\n SelectedChipCountComponent,\n AlertBannerComponent,\n ErrorMessageComponent,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n CustomSnackbarComponent,\n CateringDropComponent\n ],\n exports: [\n AutoCompleteChipSelectItemComponent,\n AutoCompleteSelectOptionComponent,\n AcaDatePickerComponent,\n MckDatePickerComponent,\n DateTzCalendarWidgetComponent,\n DateTzDatePickerComponent,\n TimeFieldComponent,\n DateTzTimeFieldComponent,\n DurationFieldComponent,\n DateTzDurationFieldComponent,\n RadioSelectComponent,\n FilterPipe,\n SanitizePipe,\n SpacerComponent,\n CalendarIconComponent,\n ChevronIconComponent,\n AlertBannerComponent,\n ReactiveFormsModule,\n FormsModule,\n ToggleComponent,\n LabelComponent,\n ModalComponent,\n CollapseHeaderComponent,\n SwitchGroupComponent,\n ModalButtonRowComponent,\n InformationalImageComponent,\n SelectComponent,\n LegendDropdownComponent,\n RecurrencePatternForm,\n RecurrenceDateForm,\n RecurringBookingForm,\n ConflictsModalComponent,\n OverrideChangesModalComponent,\n ConflictAlertModalComponent,\n CngSelectComponent, \n DropdownTriggerForDirective,\n CngSelectOptionsComponent,\n TooltipComponent,\n TooltipDirective,\n ZoomWarningComponent,\n ],\n entryComponents: [\n CustomSnackbarComponent,\n CateringDropComponent\n ]\n \n})\nexport class UiModule {\n}\n","/**\n * Generate a list of time options for the given date\n * @param datestamp Date to generate options for\n * @param show_past Whether past times should be options\n */\n\nimport {\n closestToTimeSlot,\n closestToTimeSlotTz,\n DurationGroup,\n durationHumanized,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n unique\n} from '@mckinsey-converge/base';\nimport { SelectOption } from '../types';\nimport { DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { DateTime } from 'luxon';\n\n// 24 hours\nexport const ALL_DAY_BOOKING_VALUE = 60 * 24;\n\nexport const DEFAULT_DURATION = 30;\n\n// R--- depreciate.\nexport const generateAvailableTimes = (\n datestamp: number,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz\n): SelectOption[] => {\n // R--- refactor to only used dateTz input and drop timezone param.\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let date = new DateTZ({ date: datestamp, is_local_tz: false, building_tz: timezone });\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || date.isAfterDate(now, 'day')) {\n // later than today\n date = date.startOfValue('day');\n } else {\n // today\n date = now;\n }\n // Get the closest timeslot to the start time\n const inputDate = DateTime.fromMillis(date.ms);\n const closestDate = closestToTimeSlot(inputDate, step);\n // Date changed to the closest time\n date = new DateTZ({ date: closestDate.valueOf(), is_local_tz: false, building_tz: timezone });\n const end = date.endOfValue('day');\n // Add options for the rest of the day\n while (date.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(date),\n shortDisplay: date.formatDate('hh:mma'),\n value: date.formatDate('HH:mm')\n });\n date = date.addValue({ minutes: step });\n }\n return blocks;\n};\n\n\nexport const generateAvailableTimesTz = (\n fromDateTz: DateTZ,\n showPast: boolean,\n step: number = 15,\n timezone: string = new DateTZ({ date: Date.now() }).local_tz,\n all_day: boolean = false,\n extras: SelectOption[] = [],\n startFromDateTz: boolean = false\n): SelectOption[] => {\n // now needs the building timezone for isAfter to work correctly\n const now = new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: timezone });\n // date needs the building timezone for isAfter to work correctly\n let dateTz = fromDateTz.clone();\n // Check if we're today or a future date\n const blocks: SelectOption[] = [];\n if (showPast || dateTz.isAfterDate(now, 'day')) {\n // later than today\n dateTz = dateTz.startOfValue('day');\n } else {\n // today/fromDateTz using the flag\n dateTz = startFromDateTz ? dateTz : now;\n }\n // Get the closest timeslot to the start time\n dateTz = closestToTimeSlotTz(dateTz, step);\n // Date changed to the closest time\n const end = dateTz.endOfValue('day');\n // Add the all day option for today\n if (all_day && dateTz.isSameDate(now, 'day')) {\n const startOfDay = dateTz.startOfValue('day');\n blocks.push({\n display: timeWithGmtOffsetFormatString(startOfDay),\n shortDisplay: startOfDay.formatDate('hh:mma'),\n value: startOfDay\n })\n }\n // Add options for the rest of the day\n while (dateTz.isBeforeDate(end)) {\n blocks.push({\n display: timeWithGmtOffsetFormatString(dateTz),\n shortDisplay: dateTz.formatDate('hh:mma'),\n value: dateTz, \n });\n \n dateTz = dateTz.addValue({ minutes: step });\n }\n\n return unique(extras.concat(blocks), 'shortDisplay');\n};\n\n/**\n * Generates list of duration options for new booking flow.\n * @param date - The start dateTime\n * @param max - The max number of minutes to go to from the date param.\n * @param min - The min number of minutes to display first time from.\n * @param step - The number of minutes to step up by for timeslots.\n */\nexport const generateDurationOptions = (\n date: DateTZ,\n max: number,\n min: number,\n step: number,\n extended: boolean): SelectOption[] => {\n const blocks: SelectOption[] = [];\n let value = min;\n while (value <= max) {\n let duration: string;\n if (extended) {\n const d = durationHumanized(value - min, true);\n duration = d ? `+${d}` : 'Current';\n } else {\n duration = durationHumanized(value, true);\n }\n\n blocks.push({\n value,\n display: `${date.addValue({ minutes: value }).formatDate(timeFormatString()).toLocaleLowerCase()} (${duration})`,\n });\n value += step;\n }\n return blocks;\n};\n\nexport const allDayOption: SelectOption = ({\n value: ALL_DAY_BOOKING_VALUE,\n display: 'All Day'\n});\n\nexport const oneWeekOption: SelectOption = ({\n value: 60 * 24 * 7, // 1 week\n display: 'One Week'\n});\n\nexport const defaultDurationGroups: DurationGroup[] = [\n {\n start: 15,\n step: 15,\n max: 60 * 24\n }\n // , {\n // start: 60,\n // step: 30,\n // max: (60 * 8) - 1 // 8 hours\n // }, {\n // start: 60 * 8,\n // step: 60,\n // max: 60 * 24 // 24 hours\n // }\n];\n\n/**\n * Maps the {@link DurationGroup} to {@link SelectOption} and appends the default all day and week options.\n */\nexport const generateDurationOptionsFromGroups = (date: DateTZ, durationGroups: DurationGroup[], extended: boolean): SelectOption[] => [\n ...(durationGroups.map(duration => generateDurationOptions(date, duration.max, duration.start, duration.step, extended)).reduce(((previousValue, currentValue) => {\n previousValue.push(...currentValue);\n return previousValue;\n }), [])),\n // allDayOption,\n // oneWeekOption\n ];\n","import { Component, OnInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'mck-zoom-warning',\n templateUrl: './zoom-warning.component.html',\n styleUrls: ['./zoom-warning.component.scss']\n})\nexport class ZoomWarningComponent {\n\n constructor(private dialogRef: MatDialogRef) {}\n\n onCloseClick(): void {\n this.dialogRef.close();\n }\n}\n","
\n

Excessive zoom warning

\n
\n\n
\n
\n

\n
\n
\n
\n\n
\n \n
\n
","export * from './lib/user.module';\nexport * from './lib/user.actions'\nexport * from './lib/user.types'\nexport * from './lib/user.reducer'\n","import { \n createLoadingAction\n } from '../../../loading/src/lib/loading.actions';\nimport {\n UserState,\n UserStoreState\n} from './user.types';\nimport { User } from '../../../data-common/src/lib/users/user.class';\nimport { createSelector } from '@ngrx/store';\n\nexport const loadUser = createLoadingAction('CurrentUser', 'current');\n\nexport const selectUserState = ({ user }: UserStoreState) => user;\n\nexport const selectHasUserData = createSelector(createSelector(selectUserState, loadUser.selectors.model), (state) => !!state.optionalSuccess);\n\nexport const selectCurrentUser = createSelector(selectUserState, loadUser.selectors.optionalSuccess);\n","import { Injectable } from '@angular/core';\nimport {\n Actions,\n Effect\n} from '@ngrx/effects';\nimport { createLoadingEffect } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\nimport { UsersService } from '../../../data-common/src/lib/users/users.service';\n\n\n@Injectable()\nexport class UserEffects {\n\n constructor(private actions: Actions,\n private userService: UsersService) {\n }\n\n @Effect()\n loadUser = createLoadingEffect(this.actions, loadUser, () => this.userService.loadCurrentUser());\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { StoreModule } from '@ngrx/store';\nimport { userReducer } from './user.reducer';\nimport { EffectsModule } from '@ngrx/effects';\nimport { UserEffects } from './user.effects';\n\n@NgModule({\n imports: [\n CommonModule,\n StoreModule.forFeature('user', userReducer),\n EffectsModule.forFeature([UserEffects])\n ]\n})\nexport class UserModule {\n}\n","import { createReducer } from '@ngrx/store';\nimport { UserState } from './user.types';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { loadUser } from './user.actions';\n\n\nexport const initialUserState: UserState = {\n current: LoadingModel.empty()\n};\n\nexport const userReducer = createReducer(initialUserState,\n ...loadUser.ons);\n","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./$$_lazy_route_resource lazy recursive\";","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { ShellWrapperComponent } from './shell/shell.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: ShellWrapperComponent,\n children: [\n {\n path: 'home',\n loadChildren: () => import('./booking/booking.module').then((m) => m.BookingModule),\n },\n { path: '**', redirectTo: 'home' },\n ],\n },\n { path: '**', redirectTo: 'home' },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, { useHash: true })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective, detectIE } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingsService,\n OrganisationService,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { environment } from 'src/environments/environment';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ZoomWarningComponent } from '@mckinsey-converge/ui';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: [\n './styles/app.component.scss',\n './styles/custom-element.styles.scss',\n './styles/native-element.styles.scss'\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class AppComponent extends BaseDirective implements OnInit {\n constructor(\n private _app: ApplicationService,\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private _router: Router,\n private _route: ActivatedRoute,\n private _dialog: MatDialog,\n ) {\n super();\n\n // ensure app is trusted in dev mode so we can preserve login.\n if (!environment.production) {\n localStorage.setItem('trusted', 'true');\n }\n\n\n if (detectIE() && detectIE() < 12) {\n location.href = `${location.origin}${location.pathname}assets/not-supported.html`;\n return;\n }\n }\n\n public ngOnInit(): void {\n this._router.events.subscribe((val: NavigationStart) => {\n const bookingForm = JSON.parse(localStorage.getItem('bookingForm'));\n if (val && val.navigationTrigger && val.url) {\n // Redirect everyone who doesn't have an active bookingForm back to the home page.\n const cleanHash = location?.hash.split('?')[0];\n const isLoadBookingUrl = cleanHash.indexOf('#/home/booking/') === 0;\n const isLoadCateringUrl = cleanHash.indexOf('#/home/catering/') === 0;\n if (!isLoadBookingUrl && !isLoadCateringUrl && cleanHash && ['#/home', '#/home/manage', '#/home/create', '#/home/edit'].indexOf(cleanHash) === -1 && bookingForm && !bookingForm?.activeForm) {\n location.href = `${location.origin}`;\n return;\n }\n }\n\n })\n this.adjustZoom();\n }\n\n private adjustZoom() {\n const clientWidth = document.body.clientWidth;\n if (this.isMobileOrTablet()) { // Do not show the warning if it's a mobile or tablet device\n return;\n }\n if (clientWidth < 1300) {\n this._dialog.open(ZoomWarningComponent);\n }\n }\n private isMobileOrTablet(): boolean {\n const userAgent = navigator.userAgent || navigator.vendor;\n const maxTouchPoints = navigator.maxTouchPoints || 0; // Check for touch points \n if (maxTouchPoints > 0 && window.innerWidth <= 1024) {\n return true;\n } // Check for common mobile/tablet user agent strings \n const mobileAgents = ['Android', 'webOS', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'IEMobile', 'Opera Mini'];\n for (const agent of mobileAgents) {\n if (userAgent.indexOf(agent) > -1) {\n return true;\n }\n }\n return false;\n }\n}\n","
\n \n
\n","// remove after trigger build\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { NgModule } from '@angular/core';\nimport { HttpClientModule } from '@angular/common/http';\nimport { FormsModule } from '@angular/forms';\nimport { MAT_LABEL_GLOBAL_OPTIONS } from '@angular/material/core';\n\nimport { ComposerModule } from '@placeos/composer';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { environment } from '../environments/environment';\nimport { SharedContentModule } from './shared/shared.module';\n\nimport { ShellWrapperComponent } from './shell/shell.component';\nimport {\n ActionReducer,\n MetaReducer,\n StoreModule\n} from '@ngrx/store';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport { BookingModule } from 'src/app/booking/booking.module';\nimport { BookingsModule } from '@mckinsey-converge/bookings';\nimport { BuildingsModule } from '@mckinsey-converge/buildings';\nimport { EffectsModule } from '@ngrx/effects';\nimport { DEFAULT_SETTINGS } from 'src/environments/settings';\nimport { provideMockSettingsObject } from '@mckinsey-converge/data-common';\nimport { OrganisationModule } from '@mckinsey-converge/organisation';\nimport { localStorageSync } from 'ngrx-store-localstorage';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { RoomsModule } from '@mckinsey-converge/rooms';\nimport { ENVIRONMENT_TOKEN } from '@mckinsey-converge/environment';\nimport { LegacyOverlaysModule } from '@mckinsey-converge/legacy-overlays';\nimport { UserModule } from '@mckinsey-converge/user';\nimport { MapModule } from 'src/app/map/map.module';\n\n/**\n * Cache some state in local storage. Not for use in production.\n */\nexport function localStorageSyncReducer(reducer: ActionReducer): ActionReducer {\n // Keys needed to fix prod reloading. MCK-1229\n let keys = [\n 'buildings',\n 'bookingForm',\n 'rooms',\n ];\n\n if (!environment.production) {\n keys = [\n 'bookings',\n 'buildings',\n 'organisation',\n 'bookingForm',\n 'rooms',\n 'user'\n ];\n }\n\n return localStorageSync({\n keys,\n rehydrate: true,\n })(reducer);\n}\n\nconst metaReducers: Array> = [localStorageSyncReducer];\n\n\n@NgModule({\n declarations: [\n AppComponent,\n ShellWrapperComponent\n ],\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n AppRoutingModule,\n HttpClientModule,\n FormsModule,\n ComposerModule,\n SharedContentModule,\n LegacyOverlaysModule,\n StoreModule.forRoot({}, { metaReducers }),\n StoreDevtoolsModule.instrument({\n maxAge: 100,\n logOnly: environment.production\n }),\n EffectsModule.forRoot(),\n BookingsModule,\n BookingModule,\n BuildingsModule,\n MapModule,\n OrganisationModule,\n RoomsModule,\n UiModule,\n UserModule\n ],\n providers: [\n { provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: { float: 'nevet' } },\n provideMockSettingsObject(DEFAULT_SETTINGS),\n { provide: ENVIRONMENT_TOKEN, useValue: environment }\n ],\n bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n","import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { BookingStateService, OrganisationService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, getTimezoneOffsetString, toMiddayUTC } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'calendar-date-widget',\n templateUrl: './calendar-date-widget.component.html',\n styleUrls: ['./calendar-date-widget.component.scss'],\n})\nexport class CalendarDateWidgetComponent extends BaseDirective implements OnInit {\n /** Currently selected date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Currently building timezone */\n @Input() public timezone: string;\n /** Currently active zone */\n @Input() public zone: string;\n /** Whether to show new item button */\n @Input() public show_add_item = false;\n /** Whether to show the events for the active month */\n @Input() public show_events: boolean = false;\n /** Preserve last selected date */\n @Input() public retainSelectedDate: boolean = false;\n /** Emitter for changes selected date */\n @Output() public dateChangeTz = new EventEmitter();\n /** Emitter for add item button */\n @Output() public event = new EventEmitter();\n /** Counters of the events on given dates. Key format is `yyyy-MM-dd` */\n public event_map: { [date: string]: number };\n\n public fromDateTz = DateNow().subtractValue({ months: 6 });\n\n public get now() {\n return DateNow();\n }\n\n /** Display string for the currently selected date */\n public get tz(): string {\n return getTimezoneOffsetString(this.timezone_value);\n }\n\n public get timezone_value() {\n return localStorage.getItem('CONCIERGE.timezone') || this.timezone || this.now.building_tz;\n }\n\n public get is_today() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this.timezone_value,\n }),\n 'day'\n );\n }\n\n constructor(private _bookings: BookingStateService, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n // CONCIERGE.date: Get the localstorage date and timezone when changing pages.\n let date: any;\n if(!this.retainSelectedDate) {\n date = +localStorage.getItem('CONCIERGE.date') || this.now.ms;\n } else {\n date = this.now.ms;\n }\n\n \n /* istanbul ignore else */\n if (date && (date !== this.dateTz.ms || this.timezone_value !== this.dateTz.building_tz)) {\n // CONCIERGE.date Reapply the localstorage date and timezone when changing pages.\n this.timeout(\n 'init',\n () => {\n this.dateTz = new DateTZ({\n date,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n this.updateDate();\n },\n 10\n );\n }\n this.subscription(\n 'events',\n this._bookings._noOfMeetings.subscribe((list) => {\n this.event_map = {};\n this.event_map = list[0];\n })\n );\n }\n\n public noOfCount(event) {\n // Disabling bellow until find more reliable way to call as it is been called multiple times on hover/click\n // this._bookings.getDailyMeetingCount();\n // event.stopPropogation();\n }\n\n /**\n * Change the selected date with the arrow controls\n *\n */\n public changeDate(value: number) {\n let date = new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n date = date.addValue({ days: value });\n this.dateTz = date;\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n /**\n * Change the selected date with the calendar widget\n *\n */\n public applyDatePickerValue(dateInputTz: DateTZ) {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(dateInputTz).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n this.closeDatePicker();\n }\n\n public updateDate() {\n this.timeout('update_date', () => this._bookings.setDate(this.dateTz));\n }\n\n /** Reset date to the current date */\n public resetDate() {\n this.dateTz = new DateTZ({\n date: toMiddayUTC(this.now).ms,\n is_local_tz: false,\n building_tz: this.timezone_value,\n });\n this.dateChangeTz.emit(this.dateTz);\n localStorage.setItem('CONCIERGE.date', `${this.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.timezone_value}`);\n this.updateDate();\n }\n\n public closeDatePicker() {\n this.updateDate();\n }\n\n /** New Item button click */\n public newItem(): void {\n this.event.emit('new_item');\n }\n}\n","
\n\n \n
\n
\n \n
\n

Today

\n

{{ dateTz.ms | date: 'mediumDate':tz }}

\n
\n \n
\n
\n \n \n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\n\nconst routes: Routes = [\n { path: '', component: BookingCalendarWrapperComponent },\n { path: ':level', component: BookingCalendarWrapperComponent },\n { path: '**', redirectTo: '' }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingCalendarRoutingModule {}\n","import {\n Component,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { ActivatedRoute, GuardsCheckEnd, NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n BookingFormData,\n BookingsService,\n Building,\n OrganisationService,\n SettingsService,\n SpacesService,\n selectActiveForm\n} from '@mckinsey-converge/data-common';\nimport { Store, select } from '@ngrx/store';\nimport { distinctUntilChanged, first } from 'rxjs/operators';\n\nimport { RoutePayload, TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\n@Component({\n selector: 'booking-calendar-wrapper',\n templateUrl: './booking-calendar-wrapper.html',\n styleUrls: ['./booking-calendar.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookingCalendarWrapperComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n orgBuildings: Building[] = [];\n \n constructor(\n private _org: OrganisationService,\n private _spaces: SpacesService,\n private _bookings: BookingsService,\n private settingService: SettingsService,\n private store: Store,\n ) {\n super();\n\n \n }\n\n public ngOnInit(): void {\n /** allow booking bypass to receive bookings for staff calendar view only */\n this.settingService.bypass_bookings = true;\n\n this.orgBuildings = this._org.buildings;\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz) {\n localStorage.setItem('CONCIERGE.date', `${next.dateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${next.timezone}`);\n const building = this._org.buildings.find(\n (_) => _.id === next.location.filter(el => el.groupChild)[0]?.meta?.building?.id\n );\n if(building) {\n this._org.building = building;\n }\n \n }\n }));\n\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this.orgBuildings = this._org.buildings;\n })\n\n \n }\n\n public onBackCallback() {}\n\n public ngOnDestroy(): void {\n /** disallowed booking bypass when you are moving from staff app calendar view*/\n this.settingService.bypass_bookings = false;\n }\n\n}\n","
\n\t
\n\t\t \n\t\t\n\t
\n\t\n\t\n
","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { BookingCalendarWrapperComponent } from './booking-calendar-wrapper.component';\n\nimport { StaffCalendarComponent } from './staff-calendar/staff-calendar.component';\nimport { CalendarDateWidgetComponent } from './booking-calendar-date-widget/calendar-date-widget.component';\nimport { DayViewTimelineComponent } from './staff-calendar/timeline/timeline.component';\nimport { DayViewSpaceComponent } from './staff-calendar/space/space.component';\nimport { DayViewSpaceEventComponent } from './staff-calendar/space/event/event.component';\n\n\nimport { BookingCalendarRoutingModule } from './booking-calendar-routing.module';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { UiModule } from '@mckinsey-converge/ui';\n\nimport {CngMenuItemComponent} from './cng-menu-item/cng-menu-item.component';\n\nexport const bookingModuleDeclarations = [\n BookingCalendarWrapperComponent,\n StaffCalendarComponent,\n CalendarDateWidgetComponent,\n DayViewTimelineComponent,\n DayViewSpaceComponent,\n DayViewSpaceEventComponent,\n CngMenuItemComponent\n ];\n\nexport const bookingModuleImports = [\n CommonModule,FormsModule,\n ReactiveFormsModule,\n SharedContentModule,\n UiModule,\n \n \n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingCalendarRoutingModule,\n // StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingCalendarModule {\n}","import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NavItem} from './nav-item';\nimport { MatMenu } from '@angular/material/menu';\n\n@Component({\n selector: 'cng-menu-item',\n templateUrl: './cng-menu-item.component.html',\n styleUrls: ['./cng-menu-item.component.scss']\n})\nexport class CngMenuItemComponent implements OnInit {\n @Input() items: NavItem[];\n @Input() activeOption: string;\n @ViewChild('childMenu', {static: true}) public childMenu: any;\n\n @Output() public onChildSelect = new EventEmitter<{}>();\n \n constructor(public router: Router) {\n }\n\n ngOnInit() {\n }\n\n public notifySelection(node) {\n this.onChildSelect.emit(node);\n }\n}\n","\n \n \n 0\">\n \n \n \n \n \n \n \n \n \n ","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space, BOOKING_STATUS, CloseDialogService, DialogIds, BookingStoreState, User } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { CateringOrder } from '@mckinsey-converge/data-common';\n\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState, selectCurrentUser } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { take } from 'rxjs/operators';\n\n/** Details about the associated event overlapping with other events */\nexport interface IEventOverlap {\n /** Index of this item with the overlapping items */\n index: number;\n /** Total number of items overlapping with this one */\n total: number;\n}\nexport interface BookingDetailInfo {\n bookedBy: {\n display:boolean,\n value: string\n }\n}\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n \n@Component({\n selector: 'day-view-space-event',\n templateUrl: './event.component.html',\n styleUrls: ['./event.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewSpaceEventComponent extends BaseDirective implements OnInit, OnChanges {\n /** Event to display */\n @Input() public booking: Booking;\n /** Date to display bookings for */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** Space associated with the booking */\n @Input() public space: Space;\n /** Whether the item is a fixed size */\n @Input() public fixed: boolean;\n /** Overlap details for the booking */\n @Input() public overlap: IEventOverlap;\n /** Whether an action is being processed for this booking */\n @Input() public loading: boolean;\n /** Emitter for the current position of the booking within the timeline */\n @Output() public position = new EventEmitter<{ top: number; height: number }>();\n\n /** Position of the booking start time in the day */\n public top: number;\n /** Position of the booking relative to overlapping bookings */\n public left: number;\n /** Height based of the duration of the booking */\n public height: number;\n /** Size of the booking when overlapping with other bookings */\n public width: number;\n /** Offset from the booking's top that the setup time starts */\n public overflow_top: number;\n /** Offset from the booking's bottom that the breakdown time ends */\n public overflow_bottom: number;\n\n public approved: boolean;\n public declined: boolean;\n public bookingDetails: BookingDetailInfo;\n currentUser: User;\n constructor(\n private _service: ApplicationService,\n public store: Store,\n private _dialog: MatDialog,\n private _router: Router,\n private cdRef: ChangeDetectorRef,\n private closeDialogService: CloseDialogService\n ) {\n super();\n }\n\n ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n // test comment\n const {creator, organiser, booker_concierge} = this.booking;\n this.bookingDetails = {\n bookedBy: {\n display: creator && ( creator.email !== organiser.email || (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ),\n value: (creator.email === organiser.email && booker_concierge !== null && organiser.email !==booker_concierge['email']) ? booker_concierge['name'] || booker_concierge['email'] : creator?.name || creator.email\n }\n }\n }\n\n public get local_id(): string {\n return this.booking.icaluid.substr(0, 6);\n }\n\n /** Type of booking */\n public get type(): string {\n const userEmail = this.currentUser.email;\n const { creator, organiser } = this.booking;\n if(userEmail === creator.email || userEmail === organiser.email) \n return this.booking.getType();\n else \n return 'others-booking';\n }\n\n /** Period that the booking will occur during the day */\n public get period(): string {\n // the booking time is being pass in as the local timezone version.\n return this.booking.time_period;\n }\n\n /** Number attendees expected to turn up to the booking */\n public get expected(): number {\n const expected = this.booking.expected_attendees;\n return this.space ? expected[this.space.email] || 0 : 0;\n }\n\n /** Whether the meeting has catering attached */\n public get has_catering(): boolean {\n return !!this.order;\n }\n\n public get order(): CateringOrder {\n return this.booking.catering.find((order) => order.location_id === this.space.email);\n }\n\n /** Whether booking is active */\n public get active(): boolean {\n const booking = this._service.get('CONCIERGE.day_view.viewing');\n return !booking || booking.id === this.booking.id;\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.booking || changes.overlap || changes.dateTz) {\n this.calculatePosition();\n this.approved = this.booking.status === BOOKING_STATUS.approved;\n this.declined = this.booking.status === BOOKING_STATUS.declined;\n }\n }\n\n /** Store the order details for viewing in another component */\n public storeOrder(order: CateringOrder) {\n const booking_details = this.booking.toApiJSON();\n localStorage.setItem('CONCIERGE.view_order', JSON.stringify(order.toJSON()));\n localStorage.setItem('CONCIERGE.view_booking', JSON.stringify(booking_details));\n localStorage.setItem('CONCIERGE.date', `${this.booking.startDateTz.ms}`);\n localStorage.setItem('CONCIERGE.timezone', `${this.booking.startDateTz.building_tz}`);\n }\n\n /**\n * View catering order for the booking\n */\n public viewOrder(order: CateringOrder) {\n /* istanbul ignore else */\n if (this.booking && this.booking.catering) {\n /* istanbul ignore else */\n if (localStorage) {\n this.storeOrder(order);\n }\n this._router.navigate(['/catering', 'orders'], {\n queryParams: { booking: this.booking.id, view: order.id },\n });\n }\n }\n\n /** Calculate the position */\n private calculatePosition() {\n /* istanbul ignore else */\n if (this.booking) {\n const overlap = this.overlap || { index: 0, total: 1 };\n const shown_date = this.dateTz.startOfValue('day');\n const date = this.booking.startDateTz.startOfValue('minute');\n const end = this.booking.endDateTz.startOfValue('minute');\n const from_previous_day = !date.isSameDate(shown_date, 'day');\n if (end.isBeforeDate(shown_date, 'day')) { // Hide booking if not on shown date\n this.top = -100;\n this.height = 1;\n return;\n }\n\n //R-- Stragest thing, but one time this was logging bookings form different timezones?\n // this.dateTz.logDateTz('calculatePosition this.dateTz')\n // this.booking.startDateTz.logDateTz('calculatePosition this.booking.startDateTz')\n\n const start = from_previous_day ? 0 : Math.abs(+date.dateDiff(shown_date, 'hours', 'hours').toFixed(3));\n const duration = Math.min(\n this.booking.duration,\n Math.abs(shown_date.dateDiff(date.addValue({ minutes: this.booking.duration }), 'minutes'))\n );\n this.top = Math.max(0, (start / 24) * 100);\n this.height = Math.min(\n 100 - this.top,\n this.fixed ? duration / 60 : (duration / 60 / 24) * 100\n );\n this.position.emit({ top: this.top, height: (duration / 60 / 24) * 100 });\n this.width = Math.min(100, 100 / overlap.total + 5);\n this.left = Math.min(100 - this.width, this.width * overlap.index - 5 * overlap.index);\n this.overflow_top =\n (this.booking.setup[this.space.email]\n ? (this.booking.setup[this.space.email] / 60) / duration\n : -0.1) * 100;\n this.overflow_bottom =\n (this.booking.breakdown[this.space.email]\n ? (this.booking.breakdown[this.space.email] / 60) / duration\n : -0.1) * 100;\n if (this.booking.all_day) {\n this.top = 0;\n this.height = 100;\n }\n }\n }\n\n public get emailURL() {\n const userEmail = this.currentUser.email;\n const userName = this.currentUser.name\n const { creator, organiser } = this.booking;\n\t\treturn `mailto:${encodeURIComponent(organiser.email)}?cc=${encodeURIComponent(userEmail)}&subject=Request%20to%20release%20room%20reservation%20-%20${encodeURIComponent(this.space.simple_name)}`;\n\t}\n\n /** Whether booking has been ended */\n public expired(): boolean {\n return ['started','in_progress','expired_yesterday', 'done'].includes(this.booking.timeBasedStatusLabel);\n }\n}\n","\n \n \n 50 ? ' low' : '')\"\n [style.z-index]=\"(overlap?.index || 0) + 2\"\n \n >\n
\n
{{ booking.all_day ? 'All Day' : period }}
\n
\n \n\n \n \n
\n
\n
\n
\n
Host: 
\n
\n {{ booking.organiser?.name || booking.organiser }}\n
\n
\n \n
Booked by: 
\n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n
\n
{{ booking.title }}
\n
\n
\n
\n {{ booking.attendees ? booking.attendees.length || 'No' : 'No' }} Attendee{{\n booking.attendees?.length === 1 ? '' : 's'\n }}{{ expected ? '(' + expected + ' Expected)' : '' }}\n
\n
\n
0\">\n
\n Company: {{ booking.company.length }}\n
\n
\n
\n
Welcomed by: {{ booking.organiser?.name || booking.organiser }}
\n
\n
\n
Catered
\n
\n
\n \n \n \n \n\n","import {\n Component,\n OnChanges,\n Input,\n SimpleChanges,\n Output,\n EventEmitter,\n ViewChild,\n ElementRef,\n OnInit,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { CdkDragMove, CdkDragDrop } from '@angular/cdk/drag-drop';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first } from 'rxjs/operators';\n\nimport { IEventOverlap } from './event/event.component';\nimport { BaseDirective, closestToTimeSlotTz, Identity } from '@mckinsey-converge/base';\nimport { OrganisationService, Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { ConfirmModalComponent } from '@mckinsey-converge/legacy-overlays';\nimport { DialogEvent, HashMap } from '@mckinsey-converge/base';\nimport { DayViewSettings } from '@mckinsey-converge/data-common';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { BookingsService } from '@mckinsey-converge/data-common';\n\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { convertTimezonedTimestampToLocalDateTz, DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\n@Component({\n selector: 'day-view-space',\n templateUrl: './space.component.html',\n styleUrls: ['./space.component.scss'],\n})\nexport class DayViewSpaceComponent extends BaseDirective implements OnInit, OnChanges {\n /** List of space dropzones connected to */\n @Input() public space_list: string[];\n /** Date to display events for */\n @Input() public dateTz: DateTZ;\n /** Space to display events for */\n @Input() public space: Space;\n /** Scroll value of the day view */\n @Input() public scroll: number;\n /** Only show events with setup and/or breakdown times */\n @Input() public overflow_only: boolean;\n /** Mapping of whether to show events with a given legend id */\n @Input() public legend: HashMap = {};\n /** Scroll value to add to drop placeholders */\n @Input('scrollTop') public scroll_top: number;\n /** Last update time of the displayed bookings */\n @Input('lastUpdate') public last_update: number;\n\n @Input() public eventMovingLoader : HashMap = {};\n /** Emitter for whether the space column is in view */\n @Output() public inView = new EventEmitter();\n /** Emitter for whether an event is being dragged */\n @Output() public dragging = new EventEmitter();\n /** Emitter for whether an event is being dropped and moving in progress */\n @Output() public moving = new EventEmitter<{}>();\n /** List of bookings for the current date and space */\n public event_list: Booking[] = [];\n /** Mapping of event IDs to overlap details */\n public overlap_details: HashMap = {};\n /** Mapping of positions of event in the day */\n public position_list: HashMap<{ top: number; height: number }> = {};\n /** Override for mapped position */\n public top: number;\n /** Client Rectangle for the container element box */\n public box: ClientRect;\n /** Whether the space list is in view */\n public in_view: boolean;\n /** ID of the booking with an action processing */\n public override_state: string;\n /** Map of bookings to whether they are loading */\n public loading: HashMap = {};\n /** Settings for day view */\n public settings: DayViewSettings = {} as any;\n\n /** Container element for the component contents */\n @ViewChild('view', { static: true }) private view: ElementRef;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _bookings: BookingsService,\n private _dialog: MatDialog,\n private cdr: ChangeDetectorRef,\n private _org: OrganisationService,\n ) {\n super();\n }\n\n /** Events to display for the active date */\n public events: Booking[] = []\n\n public ngOnInit(): void {\n this.events = this.filterEvents();\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.settings = this._service.setting('app.day_view') || {};\n // this.subscription(\n // 'breakdown',\n // this._service\n // .listen('APP.breakdown')\n // .subscribe((state) => {\n // this.overflow_only = state;\n // this.events = [...this.filterEvents()];\n // })\n // );\n // this.subscription(\n // 'legend',\n // this._service\n // .listen('CONCIERGE.legend')\n // .subscribe((state) => (this.legend = state || {}))\n // );\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...list];\n this.events = [...this.filterEvents()];\n this.cdr.detectChanges();\n })\n );\n this.checkInView();\n });\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.scroll) {\n this.checkInView();\n }\n if (changes.space) {\n this.event_list = [...this.event_list];\n this.timeout('in_view', () => this.checkInView(), 100);\n }\n /* istanbul ignore else */\n if (changes.last_update) {\n this.timeout('update_overlaps', () => this.calculateOverlaps(), 1000);\n }\n }\n\n //replace this with concierge space.comp filterEvents\n // private filterEvents(): Booking[] {\n // if (this.space) {\n // const bookings = this.event_list;\n // const list = bookings.filter((event) => {\n // if (this.override_state && this.override_state === event.icaluid) {\n // this.loading[event.id] = true;\n // }\n\n // const ignore = event.is_recurrent && event.recurrence_type === 'master';\n\n // return (\n // !ignore && !event.declined && // filtered declied bookings\n // event.room.email === this.space.email &&\n // (!this.overflow_only ||\n // event.setup[event.room.email] ||\n // event.breakdown[event.room.email])\n // );\n // }).map(e => new Booking({...e.toJSON()}) );\n\n // return list;\n // }\n // return [];\n // }\n\n private filterEvents(): Booking[] {\n if (!this.space) {\n return [];\n }\n \n return this.event_list.filter((event) => {\n // Mark as loading if override state matches.\n if (this.override_state && this.override_state === event.icaluid) {\n this.loading[event.id] = true;\n }\n \n const isRecurrentMaster = event.is_recurrent && event.recurrence_type === 'master';\n const isRoomEmailMatch = event.multi_rooms.some(room => room.email === this.space.email);\n \n // Determine if the event should be included based on setup or breakdown conditions.\n const isIncludedInSetupOrBreakdown = event.multi_rooms.some(room => {\n return event.setup[room.email] || event.breakdown[room.email];\n });\n \n return !isRecurrentMaster && isRoomEmailMatch && (!this.overflow_only || isIncludedInSetupOrBreakdown);\n }).map(event => new Booking({...event.toJSON()}));\n }\n\n /* istanbul ignore next */\n /**\n * Track by function for ngFor optimisation\n * @param index Index of the item\n * @param item Data associated with the item at the given index\n */\n public trackByFn(index: number, item: Booking) {\n return item.id || index;\n }\n\n /**\n * Calculate to overlap details for the booking events on the space\n */\n private calculateOverlaps() {\n const events = this.events.sort(\n (a, b) =>\n a.startDateTz.ms - b.startDateTz.ms ||\n a.duration - b.duration ||\n (a.title || '').localeCompare(b.title || '')\n );\n events.forEach((i) => (this.overlap_details[i.id] = { index: 0, total: 1 }));\n for (const bkn of events) {\n const bkn_start = bkn.startDateTz.startOfValue('minute');\n const bkn_end = bkn.endDateTz.startOfValue('minute');\n let count = 1;\n let index = 0;\n const collisions: Booking[] = [];\n for (const cmp of events) {\n /* istanbul ignore else */\n if (bkn.id !== cmp.id) {\n const cmp_start = cmp.startDateTz.startOfValue('minute');\n const cmp_end = cmp.endDateTz.startOfValue('minute');\n /* istanbul ignore else */\n if (\n bkn_start.isSameDate(cmp_start, 'minute') ||\n (bkn_start.isAfterDate(cmp_start) && bkn_start.isBeforeDate(cmp_end)) ||\n bkn_end.isSameDate(cmp_end, 'minute') ||\n (bkn_end.isAfterDate(cmp_start) && bkn_end.isBeforeDate(cmp_end))\n ) {\n count++;\n collisions.push(bkn);\n /* istanbul ignore else */\n if (\n events.findIndex((i) => i.id === bkn.id) >\n events.findIndex((i) => i.id === cmp.id)\n ) {\n index++;\n }\n }\n }\n }\n this.overlap_details[bkn.id] = { index: Math.max(0, index), total: count };\n }\n }\n\n /**\n * Check whether the space column is with the view of the\n */\n private checkInView() {\n /* istanbul ignore else */\n if (this.view && this.view.nativeElement) {\n const el = this.view.nativeElement;\n this.in_view =\n el.offsetLeft + this.scroll >= -240 &&\n el.offsetLeft + this.scroll <= window.innerWidth;\n this.inView.emit(this.in_view);\n }\n }\n\n /**\n * Initialise drag events\n */\n public initDrag() {\n this.box = this.view.nativeElement.getBoundingClientRect();\n this.dragging.emit(true);\n }\n\n /**\n * Cleanup after drag\n */\n public endDrag() {\n this.timeout('end_drag', () => (this.top = 0), 10);\n this.dragging.emit(false);\n }\n\n /**\n * Update top position of the dragged event placeholder\n * @param booking Booking being dragged\n * @param event Drag event\n */\n public updateDragTop(event: CdkDragMove) {\n /* istanbul ignore else */\n if (event.delta.y) {\n const y = event.pointerPosition.y;\n const top = (y - this.box.top - this.scroll_top) / this.box.height;\n const top_minutes = (Math.round((top * 24 * 60) / 15) * 15) / 60;\n this.top = (top_minutes / 24) * 100;\n\n }\n }\n\n\n\n\n\n public checkAvailabilityOnGivenTime(selectedBlockStart, selectedBlockEnd) {\n const runningBookings =\n this.events?.filter((bks) => {\n const startEpoch = new DateTZ({\n date: bks.start_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const endEpoch = new DateTZ({\n date: bks.end_epoch * 1000,\n is_local_tz: false,\n building_tz: bks.timezone,\n }).ms;\n const hasValidBreakdown: boolean =\n bks.breakdown &&\n Object.values(bks.breakdown).some((value) => value !== null);\n if (selectedBlockStart.ms === endEpoch && hasValidBreakdown) {\n return true;\n } else\n return (\n (selectedBlockStart.ms >= startEpoch && selectedBlockStart.ms < endEpoch) ||\n (selectedBlockEnd.ms > startEpoch && selectedBlockEnd.ms < endEpoch)\n );\n }) || [];\n return !!runningBookings.length;\n }\n\n\t\t/** Whether booking has been ended */\n public expired(booking): boolean {\n\t\t\treturn booking.timeBasedStatusLabel === 'done';\n\t\t}\n\n\t\t\n}\n","\n\n
\n
\n
\n
\n
\n\n \n \n \n\t\t\n
\n
\n \n
\n
\n
\n \n\n\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first, take } from 'rxjs/operators';\n\nimport { BaseDirective, HashMap, Identity } from '@mckinsey-converge/base';\n// import { BookingModalComponent } from 'src/app/bookings/booking-modal/booking-modal.component';\n\nexport interface NavItem {\n\tdisplayName: string;\n\ticonName?: string;\n\troute?: string;\n\tmeta?:{}; \n\tchildren?: NavItem[];\n}\n\n\nimport {\n ApplicationService,\n BookingStateService,\n BookingStoreState,\n BuildingLevel,\n OrganisationService,\n selectBookingByIdResultsFromState,\n User,\n Booking,\n SpacesService,\n Space,\n Building,\n searchRoomsAndBookings\n} from '@mckinsey-converge/data-common';\n\n\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { Store } from '@ngrx/store';\nimport { BuildingStoreState } from 'libs/buildings/src';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { Subscription } from 'rxjs';\nimport { DropdownOpion } from '@mckinsey-converge/ui';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'staff-calendar',\n templateUrl: './staff-calendar.component.html',\n styleUrls: ['./staff-calendar.component.scss']\n})\nexport class StaffCalendarComponent extends BaseDirective implements OnInit {\n /** Currently selected date, starts out with no timezone data, gets updated later */\n public dateTz: DateTZ = DateNow(new Date());\n\n /** ID of the currently selected level */\n public active_level: string = '';\n /** ID of the currently selected type */\n public active_type: string = '';\n /** List of levels available for the active building */\n public levels: BuildingLevel[] = [];\n /** List of space types available for the active building */\n public space_types: Identity[] = [];\n /** Whether to show only items with a setup and/or breakdown time */\n public only_overflow: boolean;\n \n\n\t\tprivate spaceTypesSubscription: Subscription;\n\n\t\tevent_list: Booking[] = [];\n\t\tsearchStr: any;\n\t\tfoundSearchLength: number = 0;\n\t\tsearchedCounter: any = 1;\n\t\tshowSrchWarning: boolean;\n\t\ttotalFoundItem: number = 0;\n spaces: Space[] = [];\n\t\tbuildingsInSameCity: Building[];\n\t\tbuildingMenuItems: NavItem[];\n\t\tactiveBuildingName: string;\n\t levelsDD: any = [];\n\t roomLevelDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; };\n \n\n\n constructor(\n private _service: ApplicationService,\n private _org: OrganisationService,\n private _dialog: MatDialog,\n private _router: Router,\n private _route: ActivatedRoute,\n private _booking_state_service: BookingStateService,\n private _spaces: SpacesService,\n private store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this._service.title = 'Day View';\n\n\t\t\t\tthis._org.initialised.pipe(first((_) => _)).subscribe(() => {\n // Init dateTz here once the organization data is loaded.\n this.dateTz = new DateTZ({ date: this.dateTz.ms, is_local_tz: false, building_tz: this.timezone });\n this.subscription(\n 'route.params',\n this._route.paramMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('level') && this.active_level !== params.get('level')) {\n const level = this._org.levelWithID(params.get('level'));\n /* istanbul ignore else */\n if (level) {\n const building = this._org.buildings.find(\n (bld) => bld.id === level.building_id\n );\n /* istanbul ignore else */\n if (building) {\n this.active_level = level.id;\n this._org.building = building;\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n }\n }\n }\n })\n );\n this.subscription(\n 'building',\n this._org.listen('active_building').subscribe(() => {\n this._booking_state_service.updateRoomList();\n // Update dateTz here when the building is changed.\n\t\t\t\t\t\t\t\t\t\tthis.dateTz = new DateTZ({\n\t\t\t\t\t\t\t\t\t\t\tdate: this.dateTz.ms,\n\t\t\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\t\t\tbuilding_tz: this.timezone,\n\t\t\t\t\t\t\t\t\t\t});\n const building = this._org.building;\n\n /* istanbul ignore else */\n if (!building.levels.find((lvl) => lvl.id === this.active_level)) {\n this.active_level = building?.levels[0]?.id;\n this.updateLevel();\n }\n\t\t\t\t\t\t\t\t\t\tthis.initSpace();\n\n this.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\t\t\t\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\t\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\t\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.levelsDD = [];\n\t\t\t\t\t\t\t\t\t\tthis.levels.forEach(el => {\n\t\t\t\t\t\t\t\t\t\t\tthis.levelsDD.push({\n\t\t\t\t\t\t\t\t\t\t\t\t display: el.name, value: el.id, meta: {} \n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\tthis.roomLevelDD = {\n\t\t\t\t\t\t\t\t\t\t\tddBoxClass: 'room-level',\n\t\t\t\t\t\t\t\t\t\t\toptions: this.levelsDD,\n\t\t\t\t\t\t\t\t\t\t\tdefaultSelected: this.levelsDD.filter(el => el.value === this.active_level )[0],\n\t\t\t\t\t\t\t\t\t\t\tonChangeCallback: this.onChangeActiveLevel.bind(this)\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\tthis.buildingsInSameCity = this._org.buildings.filter(\n\t\t\t\t\t\t\t\t\t\t\t(_) => _.city === building.city\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tthis.generateBuildingMenu();\n\n \n })\n );\n \n });\n\n this.subscription(\n 'bookings',\n this._booking_state_service.filtered.subscribe((list) => {\n this.event_list = [...this.filterEvents(list)];\n\n })\n );\n }\n\n private filterEvents(list): Booking[] {\n\t\t\tconst bookings = list;\n\t\t\tconst filterd_booking = bookings.filter((event) => {\n\t\t\t\t\tconst ignore = event.is_recurrent && event.recurrence_type === 'master';\n\t\t\t\t\treturn ( !ignore );\n\t\t\t});\n\n\t\t\treturn filterd_booking || [];\n }\n\n public initSpace() {\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.active_level ? this._org.building.id : this.active_level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0 && _.bookable);\n })\n );\n }\n\n // isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n \n searchBooking(value) {\n\n // Resetting warning flag\n this.showSrchWarning = false;\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = value.toLowerCase().trim();\n \n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.event_list, ...this.spaces];\n // Filtering the combine array to find matching room or booking\n const filteredItems = searchRoomsAndBookings(allItems, searchValue);\n \n // Updating the total number of found items in serach\n this.totalFoundItem = filteredItems.length;\n\n // Setting showSrchWarning flag if no result were found \n this.showSrchWarning = !this.totalFoundItem;\n\n // Updating lenght of found items for later use\n this.foundSearchLength = this.totalFoundItem - 1;\n\n if(this.searchStr !== value) {\n // Setting the first found as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[0]);\n // Resetting the search counter\n this.searchedCounter = 0;\n }\n else {\n // Handling case where seached string is the same as previou one \n // Incrementing search counter, loopoing back to 0 if it exceed the length of found items\n this.searchedCounter = ( this.searchedCounter < this.foundSearchLength ) ? this.searchedCounter + 1 : 0\n // Setting the next found items as the current viewing item\n this._service.set('CONCIERGE.day_view.viewing', filteredItems[this.searchedCounter]);\n }\n\n // Storing the current search string for future camparison\n this.searchStr = value;\n }\n\n\n public ngOnDestroy(): void {\n this._service.set('CONCIERGE.day_view.viewing', []);\n }\n\n\n \n\n // that encapsulates the common elements.\n public get timezone() {\n return this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone');\n }\n\n public updateDateTz(dateTz: DateTZ) {\n this.dateTz = dateTz;\n }\n\n public updateLevel() {\n this._booking_state_service.setZone(this.active_level || this._org.building.id);\n\t\t\t\tthis.initSpace();\n // this._router?.url?.includes('/booking-calendar') && this._router.navigate(['/home/results/booking-calendar', this.active_level], {relativeTo: this._route});\n }\n\n\t\tpublic generateBuildingMenu() {\n\n\n\t\t\tif(this.buildingsInSameCity.length) {\n\n\t\t\t\tconst menuItem: NavItem[] = [{\n\t\t\t\t\tdisplayName: this._org.building.name,\n\t\t\t\t\ticonName: 'close',\n\t\t\t\t\tchildren:[]\n\t\t\t\t}];\n\n\n\t\t\t\tthis.buildingsInSameCity.forEach(el => {\n\t\t\t\t\tconst buildingLevels: NavItem[] = [];\n\n\t\t\t\t\tel.levels.forEach(lvl => buildingLevels.push({\n\t\t\t\t\t\tdisplayName: lvl.name,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tlevel_id : lvl.id,\n\t\t\t\t\t\t\tbuilding_id: lvl.building_id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tbuildingLevels.push({ displayName: 'All Levels', children: [], meta: {\n\t\t\t\t\t\t\tlevel_id : '',\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t} \n\t\t\t\t\t});\n\n\t\t\t\t\tmenuItem[0].children.push({\n\t\t\t\t\t\tdisplayName: el.name,\n\t\t\t\t\t\tchildren: buildingLevels,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tbuilding_id: el.id\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\n\t\t\t\tthis.buildingMenuItems = menuItem;\n\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\tpublic updateActiveBuilding (node) {\n\t\t\t// console.log(node);\n\t\t\tconst building = this.buildingsInSameCity.filter(bld => bld.id === node.meta.building_id)[0];\n\t\t\tthis._org.building = building;\n\t\t\tthis.activeBuildingName = building.name;\n\n\t\t\n\t\t\t\tthis.levels = [{ id: '', name: 'All Levels' } as any].concat(building.levels);\n\t\t\t\tthis.levels.sort((a, b) => b.name.localeCompare(a.name, undefined, {\n\t\t\t\t\t\tnumeric: true,\n\t\t\t\t\t\tignorePunctuation: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\n\n\t\t\t\tthis.active_level = node.meta.level_id;\n\t\t\t\tthis.roomLevelDD.defaultSelected = this.levelsDD.filter(el => el.value === this.active_level )[0];\n\t\t\t\tthis.updateLevel();\n\t\t}\n\n\t\tonChangeActiveLevel(level:any) {\n\t\t\tthis.active_level = level.value;\n\t\t\t\n\t\t\tthis.updateLevel();\n\n\t\t}\n\n\t\t\n}\n\n","
\n
\n \n
\n \n
\n \n \n 0\">\n
\n {{activeBuildingName || item.displayName}}\n
\n \n
\n
\n \n
\n \n \n
\n
\n \n 1\">\n\n
\n \n \n \n
{{ totalFoundItem }}
\n \n
\n \n No search found!\n
\n
\n
\n\n \n \n \n \n
\n\n
\n \n
\n
\n
\n\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewChild, NgZone, DoCheck, ChangeDetectionStrategy, ChangeDetectorRef\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { filter, first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Space } from '@mckinsey-converge/data-common';\nimport { ApplicationService } from '@mckinsey-converge/data-common';\nimport { Booking } from '@mckinsey-converge/data-common';\nimport { HashMap, Identity } from '@mckinsey-converge/base';\n// import { MeetingDetailsModalComponent } from 'src/app/calendar/meeting-details-modal/meeting-details-modal.component';\nimport { SpacesService } from '@mckinsey-converge/data-common';\nimport { OrganisationService } from '@mckinsey-converge/data-common';\nimport { BookingStateService } from '@mckinsey-converge/data-common';\nimport { DateNow, DateTZ, toMiddayUTC } from '@mckinsey-converge/date-tz';\nimport { isToday } from 'date-fns';\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n\n\nconst UPDATE_INTERVAL = 10;\n\n@Component({\n selector: 'day-view-timeline',\n templateUrl: './timeline.component.html',\n styleUrls: ['./timeline.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayViewTimelineComponent\n extends BaseDirective\n implements OnInit, OnChanges, OnDestroy\n{\n /** DateTZ object of the active date */\n @Input() public dateTz: DateTZ = DateNow(new Date());\n /** ID of the active level */\n @Input() public level: string;\n /** ID of the room type to filter displayed spaces by */\n @Input() public space_type: string;\n /** List of shown legend items */\n @Input() public legend: HashMap = {};\n /** Whether to show only items with a setup and/or breakdown time */\n @Input() public overflow_only: boolean;\n /** Whether space bookings are being loaded */\n @Input() public loading: boolean;\n\n @Input() undo_action;\n\n /** List of timeblocks to display */\n public time_blocks: Identity[] = this.generateTimeBlocks();\n /** Top value of the content scroll */\n public scroll_top: number = 0;\n /** Left value of the content scroll */\n public scroll_left: number = 0;\n /** Offset of the scroll value when starting a drag */\n public scroll_offset: number = 0;\n /** List of spaces to display for */\n public spaces: Space[] = [];\n /** List of spaces to display for */\n public filtered_spaces: Space[] = [];\n /** Mapping of space ids to whether they are in view */\n public in_view: { [id: string]: boolean } = {};\n /** Percent of the day that is now */\n public now: number;\n /** Currently active hour of the day */\n public active_hour: string;\n /** Mapping of spaces loading booking date */\n public loading_space: { [id: string]: boolean } = {};\n /** Booking ID to open modal for */\n public view_id: string;\n /** Last update time for the space bookings */\n public last_update: number = 0;\n /** Whether an event is being dragged */\n public is_dragging: boolean;\n /** Client rectangle for the scroll area */\n public box: ClientRect;\n /** Whether to show the holding bay */\n // public show_holding_bay: boolean = true;\n\n public space_zones: string[] = [];\n\n public is_today: boolean = this.isToday();\n public modalInitialized = false;\n\n /** Scrollable area of the day view */\n @ViewChild('scroll_area', { static: true }) private scroll_area: ElementRef;\n\n @ViewChild(CdkVirtualScrollViewport) virtualScroll: CdkVirtualScrollViewport;\n isEventMoving: boolean = false;\n bookingEl: any;\n timeoutID: any;\n column: any;\n\n /** Update scroll box when the window is resized */\n @HostListener('window:resize')\n public onResize() {\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n public get is_loading() {\n return this._booking_state_service.loading;\n }\n\n public isToday() {\n return new DateTZ({\n date: toMiddayUTC(this.dateTz).ms,\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }).isSameDate(\n new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n }),\n 'day'\n );\n }\n\n constructor(\n private _service: ApplicationService,\n private _spaces: SpacesService,\n private _booking_state_service: BookingStateService,\n private _org: OrganisationService,\n private _route: ActivatedRoute,\n private _renderer: Renderer2,\n private _dialog: MatDialog,\n private _zone: NgZone,\n private cdr: ChangeDetectorRef,\n ) {\n super();\n }\n\n public get holding_bay(): Space {\n const bld = this._org.building;\n /* istanbul ignore else */\n if (bld && bld.holding_bay) {\n return this._spaces.find(bld.holding_bay);\n }\n return null;\n }\n\n public ngOnInit(): void {\n this._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n this._org.initialised.pipe(first((_) => _)).subscribe(() => {\n this._booking_state_service.startPollingEveryFiveMin();\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n this._zone.runOutsideAngular(() => {\n this.interval('time', () => this.updateTime(), 15 * 1000);\n });\n // R--- return to see if the booking service needs updating\n this.subscription(\n 'dateTz',\n this._booking_state_service.dateTz.subscribe((dateTz) => {\n // const dateTz = new DateTZ({date});\n this.dateTz = dateTz;\n })\n );\n });\n });\n this.is_today = this.isToday();\n\n this.subscription(\n 'spaces',\n this._spaces.listen('list').subscribe((spaces) => {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.init();\n this.initSpaces();\n // Update time\n this.updateTime();\n })\n );\n\n }\n\n ngAfterViewInit() {\n const d2 = this._renderer.createElement('div');\n this._renderer.addClass(d2, 'adjustable-room-block-2');\n this.virtualScroll.elementRef && this._renderer.appendChild(this.virtualScroll.elementRef.nativeElement, d2);\n }\n\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (changes.level && this._org.building) {\n const zone_id = !this.level ? this._org.building.id : this.level;\n this.spaces = this._spaces.filter((_) => _.zones.indexOf(zone_id) >= 0);\n this.updateTime();\n this.initSpaces();\n }\n if (changes.space_type) {\n this.initSpaces();\n }\n }\n\n public ngOnDestroy() {\n if (this._booking_state_service?.stopPolling) this._booking_state_service?.stopPolling();\n }\n\n public init() {\n this._service.title = 'Day View';\n this.subscription(\n 'viewing',\n this._service\n .listen('CONCIERGE.day_view.viewing')\n .subscribe((event) => this.scrollIntoView(event) )\n );\n // Subscribe to route query changes\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n /* istanbul ignore else */\n if (params.has('view') || localStorage.getItem('CONCIERGE.view_booking')) {\n this.view_id = params.get('view');\n const details = localStorage.getItem('CONCIERGE.view_booking');\n const spaceJson = localStorage.getItem('CONCIERGE.view_booking_space');\n /* istanbul ignore else */\n if (details) {\n const space: Space | undefined = spaceJson\n ? new Space(JSON.parse(spaceJson))\n : undefined;\n const booking = new Booking({ ...JSON.parse(details), room: space });\n if(!this.modalInitialized) {\n this.modalInitialized = true;\n // this.view(booking, space);\n localStorage.removeItem('CONCIERGE.view_booking');\n localStorage.removeItem('CONCIERGE.view_booking_space');\n }\n }\n }\n })\n );\n \n /* istanbul ignore else */\n if (this.scroll_area['elementRef'].nativeElement) {\n this.box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n }\n }\n\n /**\n * Update scroll parameters to match the change in the scroll position\n * @param event\n */\n public updateScroll(event) {\n this.scroll_top = event.target.scrollTop;\n this.scroll_left = event.target.scrollLeft;\n }\n\n\n\n /** Generate time blocks to display on the day view */\n private generateTimeBlocks(): Identity[] {\n const blocks: Identity[] = [];\n const date = DateNow(new Date()).startOfValue('hour');\n for (let i = 0; i < 24; i++) {\n blocks.push({\n id: date.setValue({ hour: i }).formatDate('HH:mm'),\n name: date.setValue({ hour: i }).formatDate('h:mma').toLocaleLowerCase(),\n });\n }\n return blocks;\n }\n\n /** Update the now line position */\n private updateTime() {\n const now = new DateTZ({\n date: Date.now(),\n is_local_tz: false,\n building_tz: this._org.building?.timezone || localStorage.getItem('CONCIERGE.timezone'),\n });\n this.now = (now.dateHour + now.minutes / 60) / 24;\n this.active_hour = now.startOfValue('hour').formatDate('HH:mm');\n this.is_today = this.isToday();\n this.cdr.detectChanges();\n }\n\n\n /**\n * Scroll booking to the event on the day view\n * @param booking Booking to scroll into view\n */\n private scrollIntoView(searchData: Booking | Space ) {\n if (searchData && this.scroll_area && this.scroll_area['elementRef'].nativeElement) {\n this.column && this._renderer.removeClass(this.column, 'wild');\n\n /** Select space column element using space id in search data - \n * space.id if seach data is space object or data.space.id if search data is booking object\n * \n */\n const spaceId = searchData['space'] ? searchData['space'].id : searchData.id;\n const element: HTMLDivElement = this.scroll_area['elementRef']\n .nativeElement.querySelector(`#space-col-${spaceId}`);\n\n\n this.column = element;\n\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n if(searchData['space'] && searchData['space'].id) \n this.bookingEl = element?.querySelector(`#${searchData.id}`)?.querySelector('.event-container');\n\n\n /* istanbul ignore else */\n if (element) {\n this.timeoutID && clearTimeout(this.timeoutID);\n this._renderer.addClass(element, 'wild');\n this.bookingEl && this._renderer.addClass(this.bookingEl, 'wild');\n const scroll_box = this.scroll_area['elementRef'].nativeElement.getBoundingClientRect();\n\n let date_percent;\n if(searchData['space'] && searchData['space'].id) {\n date_percent = Math.abs(\n searchData['startDateTz'].dateDiff(\n searchData['startDateTz'].startOfValue('day'),\n 'minutes'\n )\n ) / (24 * 60);\n }\n \n\n const box = element.getBoundingClientRect();\n const left = box.left - scroll_box.left + this.scroll_area['elementRef'].nativeElement.scrollLeft - 500;\n const top = (searchData['space'] && searchData['space'].id) ? \n this.scroll_area['elementRef'].nativeElement.scrollHeight * date_percent - 10 :\n 0\n\n\n this.scroll_area['elementRef'].nativeElement.scrollTo({\n left: left,\n top: top,\n behavior: 'smooth',\n });\n\n this.timeoutID = setTimeout(()=> {\n element && this._renderer.removeClass(element, 'wild');\n this.bookingEl && this._renderer.removeClass(this.bookingEl, 'wild');\n }, 3000);\n }\n }\n }\n\n /**\n * Setup an auto-scroll for the display view\n * @param x\n * @param y\n */\n public scrollView(x: number, y: number) {\n /* istanbul ignore else */\n if (x || y) {\n this.scroll_area['elementRef'].nativeElement.scrollTop += y || 0;\n this.scroll_area['elementRef'].nativeElement.scrollLeft += x || 0;\n /* istanbul ignore else */\n if (\n (y &&\n this.scroll_area['elementRef'].nativeElement.scrollTop >=\n this.scroll_area['elementRef'].nativeElement.scrollHeight) ||\n (x &&\n this.scroll_area['elementRef'].nativeElement.scrollLeft >=\n this.scroll_area['elementRef'].nativeElement.scrollWidth) ||\n (y && this.scroll_area['elementRef'].nativeElement.scrollTop <= 0) ||\n (x && this.scroll_area['elementRef'].nativeElement.scrollLeft <= 0)\n ) {\n this.clearInterval('auto_scroll');\n }\n // this.updateScroll({ target: this.scroll_area['elementRef'].nativeElement });\n }\n }\n\n public clearSelected() {\n this._service.set('CONCIERGE.day_view.viewing', null);\n }\n\n public cancelScroll() {\n this.clearInterval('auto_scroll');\n }\n\n /** */\n\n // public dragChange(is_dragging: boolean) {\n // if (is_dragging) {\n // this.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop; \n // this.subscription(\n // 'listen_move',\n // this._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n // const position = { x: event.clientX, y: event.clientY };\n // const y = position.y > this.box.bottom - this.box.height * 0.05\n // ? 1\n // : position.y < this.box.top + this.box.height * 0.05\n // ? -1\n // : 0;\n // const x = position.x > this.box.right - this.box.width * 0.05\n // ? 1\n // : position.x < this.box.left + this.box.height * 0.05\n // ? -1\n // : 0;\n // this.scrollView(x * 5, y * 5);\n // this._zone.runOutsideAngular(() => {\n // this.interval('auto_scroll', () => {\n // return this.scrollView(x * 40, y * 40) \n // }, 15);\n // });\n // this.cdr.detectChanges();\n // })\n // );\n // this.clearInterval('bookings');\n // } else {\n // this.cancelScroll();\n // this.unsub('listen_move');\n // }\n // }\n\n private initSpaces() {\n const holding_bay = this.holding_bay;\n this.filtered_spaces = this.spaces.filter(\n (i) =>\n (!this.space_type || i.zones.indexOf(this.space_type) >= 0) &&\n (!holding_bay || i.id !== holding_bay.id) &&\n i.bookable\n );\n this.filtered_spaces.sort((a, b) => a.local_name.localeCompare(b.local_name));\n this.space_zones = this.spaces.map((i) => `space-col-${i.id}`);\n }\n\n\n\n\t// public onEventDragging(isDragging: boolean): void {\n\t// \t\t// Check if dragging is initiated\n\t// \t\tif (isDragging) {\n\t// \t\t\t// Store the current scroll position\n\t// \t\t\tthis.scroll_offset = this.scroll_area['elementRef'].nativeElement.scrollTop;\n\t// \t\t\t// Subscribe to mouse move events\n\t// \t\t\tthis.subscribeToMouseMove();\n\t// \t\t\t// Clear existing interval for bookings\n\t// \t\t\tthis.clearInterval('bookings');\n\t// \t\t} else {\n\t// \t\t\t// Cancel scroll operation\n\t// \t\t\tthis.cancelScroll();\n\t// \t\t\t// Unsubscribe from mouse move events\n\t// \t\t\tthis.unsubscribeFromMouseMove();\n\t// \t\t}\n\t// }\n\n\t// Subscribe to mouse move events and handle scroll logic\n\t// private subscribeToMouseMove(): void {\n\t// \tthis.subscription(\n\t// \t\t'listen_move',\n\t// \t\tthis._renderer.listen('window', 'mousemove', (event: MouseEvent) => {\n\t// \t\t\t// Get mouse position\n\t// \t\t\tconst position = { x: event.clientX, y: event.clientY };\n\t// \t\t\t// Calculate scroll direction based on mouse position\n\t// \t\t\tconst [x, y] = this.calculateScrollDirection(position);\n\t// \t\t\t// Scroll the view based on calculated direction\n\t// \t\t\tthis.scrollView(x * 5, y * 5);\n\t// \t\t\t// Run auto-scroll logic\n\t// \t\t\tthis.runAutoScroll(x, y);\n\t// \t\t\t// Detect changes to update the view\n\t// \t\t\tthis.cdr.detectChanges();\n\t// \t\t})\n\t// \t);\n\t// }\n\n\t// Calculate scroll direction based on mouse position\n\t// private calculateScrollDirection(position: { x: number, y: number }): [number, number] {\n\t// \tconst tolerance = 0.05;\n\t// \tconst x = this.calculateDirection(position.x, this.box.left, this.box.right, tolerance);\n\t// \tconst y = this.calculateDirection(position.y, this.box.top, this.box.bottom, tolerance);\n\t// \treturn [x, y];\n\t// }\n\n\t// Calculate direction based on mouse position and element boundaries\n\t// private calculateDirection(pos: number, min: number, max: number, tolerance: number): number {\n\t// \tif (pos > max - this.box.width * tolerance) {\n\t// \t\t\treturn 1; // Scroll right\n\t// \t} else if (pos < min + this.box.width * tolerance) {\n\t// \t\t\treturn -1; // Scroll left\n\t// \t} else {\n\t// \t\t\treturn 0; // Do not scroll\n\t// \t}\n\t// }\n\n\t// Run auto-scroll logic\n\t// private runAutoScroll(x: number, y: number): void {\n\t// \tthis._zone.runOutsideAngular(() => {\n\t// \t\t\tthis.interval('auto_scroll', () => this.scrollView(x * 10, y * 10), 10);\n\t// \t});\n\t// }\n\n\t// Unsubscribe from mouse move events\n\t// private unsubscribeFromMouseMove(): void {\n\t// \tthis.unsub('listen_move');\n\t// }\n\n // public movingEvent(booking) {\n // this.isEventMoving = booking.isMoving;\n // this.loading_space[booking.movingId] = booking.isMoving;\n \n // }\n\n}\n\n","
\n\t
\n\t\t\n\t
\n\n\t
\n\t\t
\n\t\t\t\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Time
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ timeslot.name }}
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
{{ room.local_name }}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tCapacity - {{ room.capacity || '0' }}\n\t\t\t\t\t\t\t{{ room.capacity === 1 ? 'person' : 'people' }}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t
\n
\n
\n
\n\t
\n\t\t
Moving meeting
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n
\n","import {\n Component,\n Input,\n Output,\n EventEmitter\n} from '@angular/core';\nimport {\n Router\n} from '@angular/router';\nimport {\n BaseDirective, shorterBuildingDateFormatString,\n} from '@mckinsey-converge/base';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n Booking,\n Building,\n BookingStoreState,\n clearBookingFormData,\n cateringAllowed,\n openBookingSurvey,\n roomHasCateringHours\n} from '@mckinsey-converge/data-common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface statusObject {\n text: string,\n title: string,\n image: string,\n}\n\n@Component({\n selector: 'booking-confirmation',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n \n

{{ data?.isEditSeries || (booking.is_recurrent && booking.recurrence_type === 'master') ? 'Recurring Series' : 'Booking' }} {{data?.status.title}}

\n
\n \n \n \n
\n
\n
\n

{{ booking.title }}

\n

Room is no longer available for your chosen date and time

\n
\n \n
\n
Status: {{data?.status.text}}
\n
Date: {{data?.dateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.typeString}} meeting ({{data?.durationString}})
\n
\n
\n
\n \n {{booking?.recurrence_period === 'list' ? 'Specific dates' : booking?.recurrence_period | titlecase}}\n \n - Conflicts({{data?.isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{data?.dateString}}
\n
End date: {{data?.endDateString}}
\n
Time: {{data?.timeString}}
\n
{{data?.type}} meeting ({{data?.durationString}})
\n
\n\n
\n \n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n Address: {{building.address}},\n {{building.city}}\n
\n
Room: {{booking.space.local_name}}
\n
Room Capacity: {{booking.space.capacity}}
\n
\n \n
\n \n \n \n \n
\n
\n
\n
\n \n
\n \n

{{ data?.status.text }}

\n
\n
\n \n
\n \n

\n \n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n

{{booking.organiser.name}}

\n

{{attendees}}

\n

{{company}}

\n

{{charge_code}}

\n

{{headcount}}

\n

{{notes}}

\n

\n
\n \n

\n

\n

\n

\n

\n

\n \n \n \n

\n
\n
\n
\n
\n

Catering is available for this meeting room

\n Add catering\n\n \n
\n
\n
\n
\n \n

\n

\n

 

\n \n
\n\n
\n
\n
\n

Ooops - we're sorry!

\n

Unfortunately your selected room has been booked by another user

\n

Please try searching for another room.

\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./booking-confirmation.component.scss']\n})\nexport class BookingConfirmationComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n\n @Input() public confirmed: boolean;\n @Input() public loading: boolean;\n\n @Input() public modal: boolean;\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\t\t@Input('dataForConfirmation') public data: any; // consolidated data using for confirmation template\n\n /** Emitter for close events */\n @Output() public callback = new EventEmitter();\n\n public currentPage: string;\n\n\t\tpublic get booking(): Booking {\n\t\t\treturn this.data?.booking\n\t\t};\n\n\n public get building(): Building {\n return this.data?.booking.room.building;\n };\n\n public get disableCateringButton(): boolean {\n return !cateringAllowed(this.data?.booking, this.building);\n }\n\n public get charge_code() {\n return (this.data?.booking.equipment_codes || {})[\n this.data?.booking.room.email\n ] || 'No Charge Code'\n }\n\n public get headcount() {\n return (this.data?.booking.expected_attendees || {})[\n this.data?.booking.room.email\n ] || 0\n }\n\n public get attendees() {\n const a = Array.isArray(this.data?.booking.attendees) ? this.data?.booking.attendees.map(u => u?.name ? u.name : '') : [];\n return a.join(', ');\n }\n\n public get company() {\n return this.data?.booking.company.join(', ');\n }\n\n public get notes() {\n const note = this.data?.booking.notes.find(n => n.type === 'equipment');\n return note ? note.message : '';\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get roomHasCatering() {\n return roomHasCateringHours(this.building, this.data?.booking?.space) && cateringAllowed(this.data?.booking, this.building);\n }\n\n public listItems(order) {\n return order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.data?.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n }\n\n constructor(\n private store: Store,\n private _router: Router,\n ) {\n super();\n }\n\n public getStatusColor (statusText: string): string {\n switch (statusText) {\n case 'confirmed':\n return 'approved'\n case 'unavailable':\n return 'cancelled'\n default:\n return statusText;\n }\n }\n\n public hasData() {\n return (this.confirmed && !this.loading) || this.isUnavailable();\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public async returnHome() {\n \n if (this.modal || this.placeIntoModal) {\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n } else {\n if(!this.isUnavailable()){\n this.store.dispatch(openBookingSurvey());\n // Clear everything out\n this.store.dispatch(clearBookingFormData());\n this._router.navigate(['/', 'home']);\n } else {\n await this._router.navigate(['/home', 'results'], { queryParams: { display: 'list' }});\n }\n }\n }\n\n public async startCatering() {\n this.store.dispatch(clearBookingFormData());\n this.confirmed = false;\n this.loading = false;\n this.callback.emit();\n await this._router.navigate(['/', 'home', 'catering', this.data?.booking.id]);\n }\n\n public isUnavailable() {\n return this.data?.status.text.toLowerCase() === 'unavailable'\n }\n\n getTooltipText() { \n return this.data.booking.occurrence_details?.filter(ocurrence => ocurrence.id !== this.data.booking.id).map((item)=>{\n let date = item.start_epoch * 1000;\n let specificDates = new DateTZ({date, is_local_tz: false, building_tz: this.data.booking.timezone});\n return shorterBuildingDateFormatString(specificDates).slice(3);\n })\n }\n\n \n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n Booking,\n BookingFormData,\n selectActiveForm,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n\t\tSpace,\n\t\tgetLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent, shorterLocalDateFormatString } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-booking-create',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingCreateComponent extends BookingFormBaseComponent implements OnInit {\n\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.booking = this.bookingFormToBooking(next);\n }\n }));\n\n\t\t\t\t// in the parent component\n\t\t\t\tthis.updateConfimatinModal();\n }\n\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n this.booking = this.bookingFormToBooking(this.data.value);\n // const booking_form_data = this.data.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n if (!bookable) {\n // Refactored for\n //\thttps://acaprojects.atlassian.net/browse/MCK-1498\n //\thttps://mckinsey.atlassian.net/browse/CNG-97\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n\t\t\t\t\t\t\t\t\t// update template properties and booking\n\t\t\t\t\t\t\t\t\tthis.handleBookingSuccessResponse(bkn);\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n\t\t\t\t\t\t\t\t\t\t\tthis.loading = false;\n \tthis.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n },(err) => {\n this.timeout('error', () => {\n\t\t\t\t\t\t\t\t\tthis.handleBookingErrorMessage();\n }, 500);\n }\n );\n }\n\n}\n","
\n
\n \n

{{ warningMessage }}

\n \n
\n
\n \n \n \n \n
\n
\n
\n
\n
\n
\n

Book {{booking?.space?.local_name}}

\n
\n
\n \n
\n
\n
\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Details

\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
{{type}} meeting ({{durationString}})
\n
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' : data?.value?.recurrence_period | titlecase}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t - Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Start date: {{dateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
End date: {{endDateString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Time: {{timeString}}
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
{{type}} meeting ({{durationString}})
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\n
\n
Address: {{building?.address}},\n {{building?.city}}
\n
Room: {{booking?.space?.local_name}}
\n
Capacity: {{booking?.space?.capacity}}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n","import {Component,OnInit,Input,Output,EventEmitter,\n } from '@angular/core';\n import {\n Booking,\n selectActiveForm,\n BookingFormData,\n\t\tBookingStoreState,\n } from '@mckinsey-converge/data-common';\n import {\n\t\tStore,\n select,\n } from '@ngrx/store';\n import {\n distinctUntilChanged, take,\n } from 'rxjs/operators';\n import { BaseDirective } from '@mckinsey-converge/base';\n\timport {\n\t\tRoomStoreState,\n\t} from '@mckinsey-converge/rooms';\n\timport {\n\t\tBuildingStoreState\n\t} from '@mckinsey-converge/buildings';\n\timport { UserStoreState } from '@mckinsey-converge/user';\n\n\texport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n\n @Component({\n selector: 'app-booking-edit-wrapper',\n template: `
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
`,\n styleUrls: ['./booking-create.component.scss']\n })\n export class BookingEditWrapperComponent extends BaseDirective implements OnInit {\n\n\t\tpublic booking: Booking;\n\t\tpublic loading: boolean = true;\n\n constructor(\n public store: Store,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n this.subscription('activeForm',\n this.store.pipe(take(1),\n\t\t\t\t\tselect(selectActiveForm),\n \tdistinctUntilChanged()\n\t\t\t\t\t).subscribe((next: BookingFormData | undefined) => {\n\t\t\t\t\t\tthis.loading = false;\n \t\tif (next && next?.dateTz) {\n \t\tthis.booking = new Booking(next);\n \t\t}\n }));\n\n }\n\n }\n","import {\n Component,\n OnInit,\n Input,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport {\n Booking,\n selectActiveForm,\n storeBookingFormData,\n BookingFormData,\n checkCollisions,\n getStatusErrorMessage,\n clearBookingFormData,\n BOOKING_STATUS,\n getLastDateFromList,\n Space,\n SeriesAction\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n} from '@ngrx/store';\nimport {\n distinctUntilChanged,\n} from 'rxjs/operators';\nimport { BookingFormBaseComponent } from './booking-form-base.component';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\n@Component({\n selector: 'app-booking-edit',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingEditComponent extends BookingFormBaseComponent implements OnInit {\n @Input() public booking: Booking;\n @Output() public updateCallback = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n public roomEmail: string;\n\n public ngOnInit(): void {\n super.ngOnInit();\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next && next?.dateTz && next?.selectedRoom?.space) {\n this.data.next(next);\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n\n this.modal = !this.isEditSeries && !this.placeIntoModal;\n this.roomEmail = this.booking.space.email;\n const attendees = (this.data?.value?.attendees?.length && this.data?.value?.attendees[0]?.meta)\n ? this.data.value.attendees\n : this.booking.attendees.filter(bk => bk.name !== '' && bk.email !=='').map(u => {\n return {\n value: u.email,\n display: u.name,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: u.name,\n meta: { external: u.external, user: u, color: u.email.toLowerCase().includes('mckinsey.') ? 'internal' : 'external' },\n }\n });\n\n const company = (this.data?.value?.company?.length && this.data?.value?.company[0]?.groupId)\n ? this.data?.value?.company\n : this.booking.company.map(u => {\n return {\n value: u,\n display: u,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: u,\n }\n });\n\n const head_count = this.booking?.expected_attendees[this.roomEmail] ? this.booking?.expected_attendees[this.roomEmail] : 0;\n const code = this.booking?.equipment_codes[this.roomEmail] ? this.booking?.equipment_codes[this.roomEmail] : '';\n const organiser = (this.data?.value?.organiser && this.data?.value?.organiser?.meta)\n ? this.data?.value?.organiser\n : {\n display: this.booking.organiser.name,\n value: this.booking.organiser.email,\n meta: { user: this.booking.organiser }\n };\n const notes = Array.isArray(this.booking.notes) ? this.booking.notes.find(n => n.type === 'equipment')?.message : this.booking.notes;\n const selectedRoom = this.data?.value?.selectedRoom\n ?\n this.data?.value?.selectedRoom\n :\n {\n space: this.booking.room, // this.building,\n };\n\n const payload = {\n ...this.booking.toJSON(),\n attendees,\n code,\n head_count,\n notes,\n organiser,\n selectedRoom,\n company\n };\n this.store.dispatch(storeBookingFormData({\n payload: payload\n }));\n \n if(this.isEditSeries) {\n this.booking = this.bookingFormToBooking(this.data.value, this.isEditSeries); \n }\n // in parent component\n this.updateConfimatinModal();\n\n\n }\n\n public updateNotes(booking, note, room) {\n const notes = [];\n const cateringNotes = this._cateringNotesService.getNotes();\n const isEquipmentNote = booking.notes.find(note => note.type === 'equipment');\n const isCateringNote = booking.notes.find(note => note.type === 'catering');\n\n if (cateringNotes.length && !isCateringNote) {\n notes.push(cateringNotes[0]);\n }\n\n if (isEquipmentNote) {\n booking.notes.map(item => {\n const message = cateringNotes.length && item.type === 'catering' ? cateringNotes[0].message : item.message;\n\n notes.push({\n ...item,\n author : this.currentUser.name,\n message : item.type === 'equipment' ? note : message,\n space: item.type === 'equipment' ? room : item.space,\n date: item.type === 'equipment' ? new Date().getTime() : item.date\n })\n });\n } else {\n if (note) {\n notes.push({\n author: this.currentUser.name,\n type: \"equipment\",\n message: note,\n space: room,\n date: new Date().getTime()\n })\n }\n }\n return notes;\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n const booking_form_data = this.data.value;\n\n if(!this.isEditSeries) {\n\t\t\t // clone booking to allow editing\n const booking = cloneDeep(this.booking);\n \n\t\t\tbooking.title = booking_form_data.title;\n\t\t\tbooking.attendees = this.formToAttendees(booking_form_data.attendees);\n\t\t\tbooking.company = this.formToCompany(booking_form_data.company);\n\t\t\tbooking.notes = this.updateNotes(this.booking, booking_form_data.notes, this.roomEmail);;\n\t\t\tbooking.equipment_codes = { [this.roomEmail]: booking_form_data.code };\n\t\t\tbooking.expected_attendees = { [this.roomEmail]: booking_form_data.head_count };\n\t\t\tbooking.organiser = booking_form_data.organiser?.meta.user;\n\t\t\tconst has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom?.space?.email || booking?.space?.email]: 900} : null; // 900 seconds = 15 min\n\t\t\t// Removing the note does not remove the existing setup / breakdown\n\t\t\tif (has_note_buffer) {\n\t\t\t booking.setup = has_note_buffer;\n\t\t\t booking.breakdown = has_note_buffer;\n\t\t\t}\n booking.opt_out = booking_form_data.opt_out;\n // booking.outlook_opt_out = booking_form_data.outlook_opt_out;\n\t\t\tthis.booking = booking;\n\t\t }\n\t\t else {\n\t\t\tthis.booking = this.bookingFormToBooking(booking_form_data, this.isEditSeries);\n\t\t }\n\n\n this.loading = true;\n checkCollisions(\n this._spaces,\n this.booking\n ).then((bookable: boolean) => {\n // We expect the current booking to be returned form this api call,\n if (bookable) {\n\n this._bookings_service.save(this.booking, this.isEditSeries).then(\n (bkn) => {\n // update template properties and booking\n this.handleBookingSuccessResponse(bkn);\n // update callback in case of standard booking edit\n this.updateCallback && this.updateCallback.emit(this.booking);\n\n },\n (err) => {\n if (err.status === 409) {\n this.handleBookingErrorMessage();\n } else {\n this.loading = false;\n this.confirmed = false;\n this.displayWarningBanner(getStatusErrorMessage(err.status));\n }\n }\n );\n } else {\n this.handleBookingErrorMessage();\n return;\n }\n },\n (err) => {\n this.handleBookingErrorMessage();\n }\n );\n }\n\n public callback() {\n this.closeCallback.emit(true);\n }\n\n}\n","import {\n Component,\n OnInit,\n Output,\n EventEmitter,\n} from '@angular/core';\nimport { TopBarHeaderMode, RoutePayload } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n dateLocalFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase,\n dateBuildingFormatString,\n shorterLocalDateFormatString,\n DialogEvent,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Booking,\n BookingsService,\n BookingStateService,\n Space,\n SpacesService,\n User,\n BookingNote,\n BookingFormData,\n BookingStoreState,\n storeBookingFormData,\n bookingStatusDetails,\n clearBookingFormData,\n CateringNotesService,\n getLastDateFromList,\n BOOKING_STATUS,\n DataForConfirmation,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n take,\n} from 'rxjs/operators';\nimport {\n BuildingStoreState\n} from '@mckinsey-converge/buildings';\nimport {\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport {\n Router\n} from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictsModalComponent, ConflictsModalComponentData } from '@mckinsey-converge/ui';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-booking-base',\n templateUrl: './booking-form-base.component.html',\n styleUrls: ['./booking-create.component.scss']\n})\nexport class BookingFormBaseComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public backRoute: RoutePayload = {\n route: ['/home', 'results', 'room'],\n queryParams: {}\n };\n\n @Output() public closeCallback = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n public placeIntoModal = false;\n // Eliminate selectedRoom (room building capacity )\n public modal = false;\n public data = new BehaviorSubject(undefined);\n public submitTimestamp: number;\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public updated: boolean;\n /** Display loading template */\n public loading: boolean= false;\n public booking: Booking = new Booking({});\n /** Current User */\n public currentUser: User;\n public invalidForm: boolean = true;\n public showWarningBanner: boolean = false;\n public warningMessage: string;\n\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n\n constructor(\n public _service: ApplicationService,\n public store: Store,\n public router: Router,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _spaces: SpacesService,\n public _cateringNotesService: CateringNotesService,\n public dialog: MatDialog,\n private _users: UsersService\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n\n }\n\n public get building(){\n return this.booking.room.building;\n }\n\n public get type() {\n return this.booking.bookingTypeLabel;\n }\n\n public get internal_external_type() {\n return this.booking.room?.[0].filters.external === true? \"External\" : \"Internal\";\n }\n\n public get date(){\n // R--- remove if no longer used.\n return this.booking.startDateTz;\n }\n\n public get dateString() {\n return this.booking.startDateTz.formatDate('ccc d MMM yyyy'); //shorterLocalDateFormatString(this.booking.startDateTz);\n \n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n public async goToBackRoute() {\n await this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n /**\n * Continue to Booking Form\n */\n public createBooking() { // todo change links based on usage\n // trigger the booking form submit\n this.submitTimestamp = new Date().getTime();\n }\n\n // submit the booking form\n public submitForm(formGroup: any) {\n let creator: User;\n if (formGroup.has_delegate) {\n if (formGroup.organiser.value !== this.currentUser.email) {\n creator = this.currentUser;\n }\n }\n\n // Combines booking with selected form fields and not the entire formGroup like other places.\n // to combine booking with selected form fields on submit - WHY IS THIS NEEDED TO DISPACH TO STORE BOOKING FORM DATA ???\n // THIS ISSUE IS SPILLING INTO - libs/data-common/src/lib/booking/booking.selectors.ts lno: 70\n // - due to .toJSON recurrence_starts becomes Array ?!?\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...this.booking.toJSON(),\n attendees: formGroup.attendees,\n code: formGroup.code,\n head_count: formGroup.head_count,\n notes: formGroup.notes,\n organiser: formGroup.organiser,\n creator,\n title: formGroup.title,\n company: formGroup.company,\n opt_out: formGroup.opt_out,\n outlook_opt_out: formGroup.outlook_opt_out\n }\n }));\n this.saveChanges();\n }\n\n // submit the booking form\n public validateForm(valid: boolean) {\n this.invalidForm = !valid;\n }\n\n public setupNotes(note: string, roomEmail: string) {\n if (note && note.length ) {\n // this note was required to update setup and breakdown\n return [{\n author: this.currentUser.name,\n type: \"equipment\",\n message: !Array.isArray(note) ? note : note[0].message,\n space: roomEmail,\n date: new Date().getTime()\n }] as BookingNote[];\n }\n\n return [];\n }\n\n public formToAttendees(attendees: any[]) {\n return !attendees ? [] : attendees.map(a => {\n let raw_user = {\n first_name: '',\n last_name: '',\n email: '',\n name: '',\n type: 'internal',\n external: false,\n visitor: false,\n };\n if (a.meta?.external) {\n // External users get assigned a random email\n const nameParts = a.display.split(' ');\n const length = nameParts.length;\n if (length) {\n raw_user.first_name = nameParts[0];\n raw_user.name = nameParts.join(' ');\n }\n if (length > 1) {\n nameParts.shift();\n raw_user.last_name = nameParts.join(' ');\n }\n raw_user.email = a.value ?? `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n raw_user.type = 'external'; // retain external identity\n raw_user.external = true;\n raw_user.visitor = true;\n } else if (a.meta?.user) {\n raw_user = a.meta.user;\n }\n else {\n raw_user = a;\n }\n return new User(raw_user);\n });\n }\n\n public formToCompany(companies: any[]) {\n return !companies ? [] : companies.map(a => {\n return a.value;\n });\n }\n\n /**\n * Save booking changes\n */\n public saveChanges() {\n this.loading = true;\n const booking_form_data = this.data.value;\n // override in child class\n }\n\n public callback() {\n // mock interface\n }\n\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n return space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser\n });\n }\n\n public displayWarningBanner(custom: string) {\n this.warningMessage = custom;\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n\n public discardChanges() {\n this.store.dispatch(clearBookingFormData());\n this.closeCallback.emit(true)\n }\n\n\n\n setupOrganiser(booking_form_data: BookingFormData) {\n if(booking_form_data.organiser?.meta?.user){\n return booking_form_data.organiser?.meta?.user;\n }\n else{\n booking_form_data.organiser = {...booking_form_data.organiser, meta: {user: this.currentUser}}\n return booking_form_data.organiser?.meta.user;\n }\n }\n\n public bookingFormToBooking(bookingData, isEditSeries: boolean = false): Booking {\n let booking_form_data = bookingData;\n const has_note_buffer = booking_form_data.notes && booking_form_data.notes?.length ? {[booking_form_data.selectedRoom.space.email]: 900} : {}; // 900 seconds = 15 min\n const attendees = this.formToAttendees(booking_form_data.attendees);\n const company = this.formToCompany(booking_form_data.company);\n const start_epoch = booking_form_data?.dateTz?.seconds;\n const end_epoch = booking_form_data.dateTz.addValue({ minutes: booking_form_data.duration }).seconds;\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = booking_form_data?.nextBusinessDay || false\n\n const raw_data = {\n id: isEditSeries ? booking_form_data.id : '',\n all_day: booking_form_data.all_day || false,\n attendees,\n booking_type: booking_form_data.bookingType.value,\n catering: booking_form_data.catering || [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data.timezone,\n equipment_codes: {[booking_form_data.selectedRoom.space.email]: booking_form_data.code},\n expected_attendees: {[booking_form_data.selectedRoom.space.email]: booking_form_data.head_count},\n has_catering: booking_form_data.has_catering || false,\n needs_space: booking_form_data.needs_space || false,\n organiser: this.setupOrganiser(booking_form_data),\n notes: this.setupNotes(booking_form_data.notes, booking_form_data.selectedRoom.space.email),\n creator: booking_form_data.creator,\n room: booking_form_data.selectedRoom.space,\n title: booking_form_data.title,\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n /* Staff Recurring form fields */\n is_recurrent: booking_form_data.is_recurrent,\n recurrence_count: booking_form_data.recurrence_count,\n recurrence_days: booking_form_data.recurrence_days,\n recurrence_endTz: booking_form_data.recurrence_endTz,\n recurrence_exceptions: booking_form_data.recurrence_exceptions,\n recurrence_interval: booking_form_data.recurrence_interval,\n recurrence_period: booking_form_data.recurrence_period,\n recurrence_starts: booking_form_data.recurrence_starts,\n\n occurrence_details: booking_form_data.occurrence_details,\n // occurrence_edits: booking_form_data.occurrence_edits || null,\n // occurrence_ids: booking_form_data.occurrence_ids || null,\n recurrence_type: booking_form_data.recurrence_type || null,\n recurrence_master_id: booking_form_data.recurrence_master_id,\n edits: booking_form_data?.edits,\n ignore: booking_form_data?.ignore,\n\n opt_out: bookingData.opt_out,\n \n //outlook_opt_out: true //bookingData.outlook_opt_out keeping always true for now (will never send outlook invite) until feature fully tested and released to prod \n\n\n };\n\n return new Booking(raw_data);\n }\n\n\n public async handleBookingSuccessResponse(bkn) {\n\n // const user: User = this._users.current;\n // if(this._users.current.email === bkn.organiser.email) {\n // this._users.current.opt_out = true;\n // }else {\n // this._users.current.delegates.map(el => { \n // if(el.email === bkn.organiser.email) {\n // el.opt_out = true;\n // }\n // return el;\n // })\n // }\n \n\n //const responceBkn = new Booking({...bkn}); // \n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() });\n this.updateConfimatinModal();\n this._booking_state_service.replace(this.booking);\n\n /**\n * update the master booking in case of recurring to have latest updated in the system\n */\n if(this.booking.recurrence_master_id !== null && this.isEditSeries)\n {\n const master_booking = await this._bookings_service.show(this.booking.recurrence_master_id);\n this._booking_state_service.replace(master_booking);\n }\n\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n\n // Heap track event\n this._service.analytics.track('update', {\n booking_id: this.booking.id,\n office: this.booking.room.building.name, // this.building.name,\n room: this.booking.room.simple_name,\n start_time: this.booking.startDateTz.ms,\n end_time: this.booking.endDateTz.ms,\n catering: !!this.booking.catering.length,\n headcount: this.data.value.head_count,\n });\n\n }\n\n\n public handleBookingErrorMessage() {\n this.loading = false;\n this.booking.status = BOOKING_STATUS.unavailable\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n this.updateConfimatinModal();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n\n if (this.booking.multi_rooms && this.booking.multi_rooms.length > 0) {\n this.booking.multi_rooms.forEach((room) => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n } \n if (this.booking.room) {\n totalConflicts =\n this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n }\n\n const result = {\n is_conflict: totalConflicts > 0,\n total_Conflicts: totalConflicts,\n };\n return result;\n}\n\n\n/**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details?.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n const requestedEndDateTz = getLastDateFromList(recurrenceStart); //shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n \n // add one day if user room selection from next business day section on result page\n const endDatestring = this.nextBusinessDay ? requestedEndDateTz.addValue({ minutes: this.data?.value.offset }) : requestedEndDateTz;\n\n return endDatestring.formatDate('ccc d MMM yyyy');\n }\n\n /**\n * Opens a modal to display recurrence conflicts for a given room.\n *\n * @param {Space} room - The room for which recurrence conflicts are being displayed.\n *\n * This function opens a modal dialog to show recurrence exceptions (conflicts)\n * for the specified room.\n *\n * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n * and mckinsey-converge/apps/staff/src/app/booking/catering/catering.component.ts\n */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n status: 'confirmed'\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\n}\n","import {BehaviorSubject,fromEvent,\n} from 'rxjs';\nimport {take,throttleTime,tap,distinctUntilChanged,map\n} from 'rxjs/operators';\nimport {select,Store\n} from '@ngrx/store';\nimport {Component,Inject,OnInit,\n} from '@angular/core';\nimport { BaseDirective, dateBuildingFormatString, startEndTimeWithZoneFormatString, humaniseDuration, toTitleCase, closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { User,\n\tApplicationService,\n\tAvailableBookingFields,\n\tBooking,\n\tBookingFormData,\n\tBookingFlowSettings,\n\tSpacesService,\n\tstoreBookingFormData,\n\tDateDurationData,\n\tselectFilteredByIdResults,\n\tgenerateBookingForm,\n\tcateringAllowed,\n\trulesForSpace,\n\tgetStatusErrorMessage,\n\troomHasCateringHours,\n\tBookingsService,\n\tSpaceConflictAlertModalData,\n\tSpaceFilterReason,\n\tBuilding,\n\tBuildingCity,\n\tflattenDisplayOffices,\n\troomSizeOptions,\n\tDEFAULT_BOOKING_DURATION,\n\tbookingTypeOptions,\n\troomFormDataToQuery,\n\tclearBookingFormData,\n\tBookingStateService,\n\tRecurrencePeriod,\n\tselectActiveForm,\n\tSeriesAction\n} from '@mckinsey-converge/data-common';\nimport { first } from 'rxjs/operators';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { CancelBookingModalComponent } from '../cancel-booking-modal/cancel-booking-modal.component';\nimport { BookingDurationModalComponent } from '../booking-duration-modal/booking-duration-modal.component';\nimport { RoomResultsState } from '../room-details/room-details.component';\nimport {\n\tloadByIdResults, loadRoomsForResults, loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { FormGroup } from '@angular/forms';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { DateNow, DateTZ } from \"@mckinsey-converge/date-tz\";\nimport { ConflictAlertModalComponent, SelectOption } from '@mckinsey-converge/ui';\nimport { buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { RoomBookingModalComponent } from '../room-booking-modal/room-booking-modal.component';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { CateringDropComponent } from '@mckinsey-converge/ui';\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n\tselector: 'app-booking-details-modal',\n\ttemplateUrl: 'booking-details-modal.component.html',\n\tstyleUrls: ['./booking-details-modal.component.scss']\n})\nexport class BookingDetailsModalComponent extends BaseDirective implements OnInit {\n\tpublic TopBarHeaderMode = TopBarHeaderMode;\n\tpublic title: string;\n\tpublic roomName: string;\n\tpublic roomLocation: string;\n\tpublic host: string;\n\tpublic hostEmail: string;\n\tpublic type: string;\n\tpublic status: string;\n\tpublic statusText: string = '';\n\tpublic statusImage: string;\n\tpublic durationString: string;\n\tpublic dateString: string;\n\tpublic timeString: string;\n\tpublic capacity: number;\n\tpublic attendeesString: string;\n\tpublic chargeCode: string;\n\tpublic headcount: number;\n\tpublic requirements: string;\n\tpublic showDetails: boolean;\n\tpublic warningMessage: string;\n\tpublic mapUrl: string;\n\tpublic focusedRoom: string;\n\tpublic expandedLocation = false;\n\tpublic isRecurrentBooking = false;\n\tpublic isMultiroomBooking:boolean = false;\n\n\tpublic checkingExtendable: boolean;\n\tpublic extendableMaximum: number;\n\n\tpublic receiptionEmail: string;\n\n\tpublic data = new BehaviorSubject(undefined);\n\tpublic byIdResults = new BehaviorSubject(undefined);\n\n\t// Track event date changes in the UI in this param\n\tpublic alternativeWeekStartDateTz: DateTZ;\n\t/** Current User */\n\tpublic currentUser: User;\n\tpublic expandedAvailability: boolean = false;\n\t// Set in the room availablity callback\n\tpublic mobile: boolean = false;\n\tpublic loading: boolean = false;\n\tpublic showInfoBanner: boolean = false;\n\tpublic showWarningBanner: boolean = false;\n\tpublic showCatering: boolean = false;\n\t/** Application settings for bookings */\n\tpublic settings: BookingFlowSettings;\n\tpublic form: FormGroup;\n\tpublic companyString: string;\n\n\tinvalidDueToOfficeRule: boolean;\n\tbuildings: SelectOption[];\n\tmaster_booking: Booking;\n\n\tprivate recurrence_period: RecurrencePeriod;\n\tprivate recurrence_interval: number;\n\toccurrence_details: { start_epoch: number; dateTz: DateTZ; id: string; }[];\n\tdisableSeriesEditButton: boolean = false;\n\topt_out: boolean;\n\toutlook_opt_out: boolean;\n\t/** List of available booking fields for the form */\n\tpublic get available_fields(): AvailableBookingFields[] {\n\t\treturn this.settings?.show_fields || [];\n\t}\n\n\tpublic get emailURL() {\n\t\treturn `mailto:${encodeURIComponent(this.receiptionEmail)}?cc=${encodeURIComponent(this.hostEmail)}&subject=Enquiry%3A%20${encodeURIComponent(this.roomName)}&body=Details%3A%0ADate%3A%20${encodeURIComponent(this.dateString)}%0ATime%3A%20${encodeURIComponent(this.timeString)}%0A${encodeURIComponent(this.type)}%20meeting%20(${encodeURIComponent(this.durationString)})%0AAddress%3A%20${encodeURIComponent(this.roomLocation)}%0ARoom%3A%20${encodeURIComponent(this.roomName)}%0ACapacity%3A%20${encodeURIComponent(this.capacity)}%20people%0A%0ANeeding%20assistance%20with%3A%0A`;\n\t}\n\n\tpublic disableCancelButton: boolean = false;\n\tpublic disableEditTimeButton: boolean = false;\n\tpublic disableUpdateDetailsButton: boolean = false;\n\n\tprivate _specific_dates = false;\n\n\n\tconstructor(\n\t\t private router: Router,\n private route: ActivatedRoute,\n\t\t@Inject(MAT_DIALOG_DATA) public _data: any,\n\t\tprivate dialogRef: MatDialogRef,\n\t\tprivate store: Store,\n\t\tpublic _bookings: BookingsService,\n\t\tprivate _service: ApplicationService,\n\t\tprivate _spaces: SpacesService,\n\t\tprivate dialog: MatDialog,\n\t) {\n\t\tsuper();\n\t\tthis.roomLocation = this._data.booking.room.street_and_city;\n\t\tthis.initDisplayValues(this._data.booking);\n\t\tthis.timeout('slowinit', () => {\n\t\t\tthis.initDisplayValues(this._data.booking);\n\t\t\tif (this._data.cancel && this.displayCancelModal()) {\n\t\t\t\tthis.cancelBooking();\n\t\t\t}\n\t\t\tif (this._data.addCatering && this.roomHasCatering) {\n\t\t\t\tthis.addCatering();\n\t\t\t}\n\t\t\t// Close up the loader panel\n\t\t\tthis.timeout('hide modal mask', () => {\n\t\t\t\tthis._data.hasLoaderUrl = false;\n\t\t\t}, 300);\n\t\t}, 1000);\n\t}\n\n\n\tpublic ngOnInit() {\n\n\t\t/**\n\t\t * Update booking recurrence and occurrence details based on master booking data.\n\t\t *\n\t\t * This code block checks if there is a master booking available in the data.\n\t\t * If a master booking exists, it extracts recurrence period and interval information,\n\t\t * and processes occurrence details, excluding the current booking itself. Occurrence\n\t\t * start epochs are converted to milliseconds and date-time strings are created in the\n\t\t * building's timezone.\n\t\t */\n\t\tif(this._data?.master_booking !== null) {\n\t\t\tthis.recurrence_period = this._data?.master_booking?.recurrence_period;\n\t\t\tthis.recurrence_interval = this._data?.master_booking?.recurrence_interval;\n\n\t\t\tconst bookingData = this._data?.master_booking || this._data?.booking;\n\n\t\t\tthis.occurrence_details = bookingData.occurrence_details && bookingData.occurrence_details\n\t\t\t\t.filter(ocurrence => ocurrence.id !== bookingData.id)\n\t\t\t\t.map(ocurrence => ({\n\t\t\t\t\t...ocurrence,\n\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000, // Convert start epoch to milliseconds\n\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000, // Create a DateTZ object with the converted epoch\n\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\tbuilding_tz: bookingData.timezone\n\t\t\t\t\t})\n\t\t\t\t}));\n\t\t}\n\n\n\t\tthis.subscription('currentUser', this.store.select(selectCurrentUser)\n\t\t\t.pipe(take(1))\n\t\t\t.subscribe((user: User | undefined) => {\n\t\t\t\t// Once we know we have the user loaded.\n\t\t\t\tthis.currentUser = new User(user);\n\t\t\t})\n\t\t);\n\n\t\tthis.subscription('byId', this.store.pipe(\n\t\t\tselect(selectFilteredByIdResults)\n\t\t).subscribe(next => {\n\t\t\t// Should be fired when loading by ID in URL\n\t\t\tthis.byIdResults.next(next.success?.spaces?.length ? next.success.spaces[0].settings.bookings : EMPTY_ARRAY);\n\t\t}));\n\n\t\tthis._spaces.initialised.pipe(first((_) => _)).subscribe(() => {\n\t\t\tthis.settings = this._service.setting('app.booking');\n\t\t\tthis.form = generateBookingForm(this._data.booking, this.available_fields);\n\t\t});\n\n\t\tconst breakpoint = 450;\n\t\tif (window) {\n\t\t\tthis.mobile = window.innerWidth < breakpoint;\n\t\t}\n\n\t\tfromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n\t\t\tnext: val => {\n\t\t\t\tconst target = val.target as Window;\n\t\t\t\tthis.mobile = target.innerWidth < breakpoint;\n\t\t\t}\n\t\t})).subscribe();\n\n\n\t\tthis.subscription('buildings', this.store.pipe(\n\t\t\tselect(buildingStateSelector),\n\t\t\tselect(selectBuildingOptionsGroupedByCity),\n\t\t\tmap((grouped: Map) => {\n\t\t\t\treturn flattenDisplayOffices(grouped);\n\t\t\t}),\n\t\t\tdistinctUntilChanged()\n\t\t).subscribe(next => {\n\t\t\tthis.buildings = next;\n\t\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t\t}));\n\n\n\t}\n\n\t// public get isCateringAdded()\n\n\tpublic get disableCateringButton() {\n\t\tswitch (this.status) {\n\t\t\tcase 'cancelled':\n\t\t\tcase 'declined':\n\t\t\tcase 'expired':\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\treturn !cateringAllowed(this._data?.booking, this._data.booking.room.building);\n\t\t}\n\t}\n\n\tpublic get roomHasCatering() {\n\t\treturn roomHasCateringHours(this._data.booking.room.building, this._data.booking?.room);\n\t}\n\n\tpublic get catering() {\n\t\treturn this._data.booking?.catering || [];\n\t}\n\n\tpublic formatDeliveryTime(order) {\n\t\treturn this._data.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate(\"h:mma\");\n\t}\n\n\tpublic initDisplayValues(booking: Booking) {\n\t\tconst roomEmail = booking.room.email || '';\n\t\tthis.dateString = dateBuildingFormatString(booking.startDateTz, true);\n\t\tthis.timeString = startEndTimeWithZoneFormatString(booking.startDateTz, booking.displayEndDateTz);\n\t\tthis.host = booking.organiser.name;\n\t\tthis.opt_out = booking.opt_out;\n\t\tthis.outlook_opt_out = booking.outlook_opt_out;\n\t\tthis.hostEmail = booking.organiser.email;\n\t\tthis.title = booking.title;\n\t\tthis.type = toTitleCase(booking.booking_type);\n\t\tthis.roomName = booking.local_room_name || '';\n\t\tthis.durationString = humaniseDuration(booking.duration);\n\t\tthis.capacity = booking.room.capacity; // in case of multiroom booking should we sum the capacity for all the rooms?\n\t\tthis.attendeesString = booking.attendees.map(a => a.name).join(', ');\n\t\tthis.chargeCode = booking.equipment_codes[roomEmail];\n\t\tthis.headcount = booking.expected_attendees[roomEmail];\n\t\tthis.mapUrl = booking.room.level.map_url;\n\t\tthis.extendableMaximum = 0;\n\t\tthis.focusedRoom = `area-${booking.room.map_id}-status`;\n\t\tthis.checkingExtendable = false;\n\t\tthis.receiptionEmail = this._data.booking.room.building?._settings?.discovery_info?.reception_email || '';\n\t\tthis.companyString = booking.company.join(', ');\n\t\t// UI button availability\n\t\tthis.disableCancelButton = true; // CSS hide disabled\n\t\tthis.disableEditTimeButton = true;\n\t\tthis.disableUpdateDetailsButton = true;\n\t\tthis.isRecurrentBooking = (booking.recurrence_type !== null || booking.recurrence_type === '') && booking.recurrence_period !== null ? true : false;\n\t\tthis.isMultiroomBooking = booking.is_multiroom ? true : false\n\n\t\t// Room Availability modal start date\n\t\tthis.setAlternativeWeekStartDate(booking.startDateTz);\n\n\t\t// Get the equiptment notes\n\t\tconst requirements = booking.notes.find(n => {\n\t\t\tif (n.type === 'equipment') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\tthis.requirements = requirements ? requirements.message : '';\n\n\t\t// Setup the UI status based on the booking approval status\n\t\tif (booking.status) {\n\t\t\t// mark bookings before today expired\n\t\t\tconst orgStatus = booking.status;\n\t\t\tthis.status = booking.status;\n\t\t\tconst recentlyExpired = DateNow(new Date()).subtractValue({ minutes: 5 }).isBeforeDate(booking.startDateTz.addValue({ minutes: booking.duration }));\n\t\t\tif (!['declined', 'cancelled'].includes(booking.status)) {\n\t\t\t\tthis.status = DateNow(new Date()).isAfterDate(booking.startDateTz.addValue({ minutes: booking.duration })) ? 'expired' : booking.status;\n\t\t\t}\n\n\t\t\tif(this._data.master_booking && this._data.master_booking.status === 'tentative' ) {\n\t\t\t\tthis.disableSeriesEditButton = true;\n\t\t\t}\n\n\t\t\tswitch (this.status) {\n\t\t\t\tcase 'tentative':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_pending.svg';\n\t\t\t\t\tthis.statusText = 'Pending';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accepted':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false;\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on but returns to tenative on save\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'approved':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_confirmed.svg';\n\t\t\t\t\tthis.statusText = 'Confirmed';\n\t\t\t\t\tthis.disableCancelButton = false;\n\t\t\t\t\tthis.disableUpdateDetailsButton = false;\n\t\t\t\t\tthis.disableEditTimeButton = false; // BLOCKED: API doesn't update 'approval_status' on save.\n\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t// edit date time on, back to pending on change.\n\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t});\n\t\t\t\t\t// Verify the booking date makes it updatable.\n\t\t\t\t\tif (DateNow(new Date()).isAfterDate(booking.startDateTz)) {\n\t\t\t\t\t\t// disable edit date time\n\t\t\t\t\t\tthis.disableEditTimeButton = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'declined':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\t// you can edit time and go back to pending\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cancelled':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_cancelled.svg';\n\t\t\t\t\tthis.statusText = 'Cancelled';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'expired':\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\n\t\t\t\t\tif (recentlyExpired && ['accepted', 'approved'].includes(orgStatus)) {\n\t\t\t\t\t\tthis.checkingExtendable = true;\n\t\t\t\t\t\tthis.findMaxExtension().then(v => {\n\t\t\t\t\t\t\tthis.extendableMaximum = v;\n\t\t\t\t\t\t\tthis.checkingExtendable = false;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // TODO What is an appropriate default ? And refactor where else this is common.\n\t\t\t\t\tthis.statusImage = 'assets/icon/booking_expired.svg';\n\t\t\t\t\tthis.statusText = 'Expired';\n\t\t\t\t\tthis.extendableMaximum = 0;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic listItems(order) {\n\t\treturn order.items.map(i => `(${i.amount}) ${i.name}`).join(', ');\n\t}\n\n\tpublic expandLocation() {\n\t\tthis.expandedLocation = true;\n\t}\n\n\tpublic handleClose(fetchRooms: boolean = false) {\n\t\tthis.expandedLocation = false;\n\t\tthis.expandedAvailability = false;\n\t\tif (fetchRooms) {\n\t\t\tthis.fetchRooms(false);\n\t\t\tthis.invalidDueToOfficeRule && this.alertIfItHasConflict(false, true);\n\t\t\tthis.invalidDueToOfficeRule = false;\n\t\t}\n\t}\n\n\tpublic close(flag: string = '') {\n\t\tthis.dialogRef.close(flag);\n\t}\n\n\t/**\n\t * Check if there are any booking collisions with the new booking time\n\t * @param room_id 'sys-' id of room in question\n\t * @param date proposed booking time\n\t * @param duration proposed booking length (in minutes)\n\t */\n\tprivate async findMaxExtension(): Promise {\n\t\tconst setupInSeconds = this._data.booking.setup[this._data.booking.room.email] || 0;\n\t\tconst breakdownInMinutes = this._data.booking.breakdown[this._data.booking.room.email] ? this._data.booking.breakdown[this._data.booking.room.email] / 60 : 0;\n\n\t\t// Add a seconds, since the end time ends in :59, and add the setup time\n\t\tconst endTz = this._data.booking.endDateTz.addValue({ seconds: setupInSeconds + 1 });// (this._data.booking.date + this._data.booking.duration*60000)*0.001 -1\n\t\tconst params = {\n\t\t\troom_ids: this._data.booking.room.id,\n\t\t\tdateTz: endTz, // (((end + 60 + setupSeconds) * 1000)),\n\t\t\tduration: 60 + breakdownInMinutes,\n\t\t\thide_bookings: true,\n\t\t};\n\n\t\treturn await this._spaces\n\t\t\t.available(params, null, false)\n\t\t\t.then(\n\t\t\t\t(list) => {\n\t\t\t\t\t// measure gap in booking instead and have options\n\t\t\t\t\tconst gapInMinutes = ((list[0].available_until - (endTz.seconds - 60)) / 60);\n\t\t\t\t\tconst value = Math.min(60, gapInMinutes);\n\t\t\t\t\treturn value >= 15 ? value : 0;\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t);\n\t}\n\n\tpublic toggleUpdateView() {\n\t\tthis.showDetails = !this.showDetails;\n\t\t!this.showDetails && this.dispatchToGetFloorCurrentStatus(this._data.booking);\n\t}\n\n\n\n\n\tpublic getLocation(booking: Booking): any {\n\n\t\tif (this.buildings && booking.building_zone) {\n\t\t\treturn this.buildings.find(b => booking.building_zone === b.value);\n\t\t}\n\t\treturn [];\n\t}\n\n\n\t/**\n * Dispatches data for getting the current status of the booking floor.\n *\n * This function prepares and dispatches necessary data to retrieve the current status\n * of the booking floor.\n *\n * @param {Object} booking - The booking details object, containing room, date, duration, etc.\n * @param {boolean} editingSeries - A boolean indicating whether the booking is part of a series and being edited.\n\n */\n\tpublic dispatchToGetFloorCurrentStatus(booking, editingSeries: boolean = false) {\n\t\tconst timezone = booking.timezone;\n\t\tconst { capacity, internal_or_external } = booking.room;\n\t\tconst roomOption = capacity < 3 ? 0 : (capacity > 2 && capacity < 10) ? 1 : 2;\n\t\tconst roomSize = roomSizeOptions[roomOption];\n\n\t\t// Process recurrence data if the booking is part of a series being edited\n\t\tlet recurringBookingData = {};\n\t\tlet recurrenceStart = [];\n\t\tif(booking.is_recurrent && editingSeries) {\n\n\t\t\tthis._data.master_booking.occurrence_details.forEach(element => {\n\t\t\t\trecurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n\t\t\t});\n\t\t\trecurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n\n\t\t\tconst {\n\t\t\t\tid,\n\t\t\t\trecurrence_period,\n\t\t\t\trecurrence_interval,\n\t\t\t\trecurrence_count,\n\t\t\t\tis_recurrent,\n\t\t\t\trecurrence_exceptions,\n\t\t\t\trecurrence_pattern,\n\t\t\t\trecurrence_days,\n\t\t\t\trecurrenEndFromOcurrences,\n\t\t\t\toccurrence_details,\n\t\t\t\toccurrence_edits,\n\t\t\t\toccurrence_ids,\n\t\t\t\trecurrence_type,\n\t\t\t\trecurrence_master_id,\n\t\t\t\tedits } = this._data.master_booking\n\n\t\t\tconst rec_endTz = recurrenEndFromOcurrences.bind(this._data.master_booking);\n\t\t\tconst recurrence_endTz = rec_endTz(occurrence_details)\n\n\n\n\n\t\t\trecurringBookingData = {\n\t\t\t\tid:id,\n\t\t\t\trecurrence_period: recurrence_period,\n\t\t\t\trecurrence_interval: recurrence_interval || 1,\n\t\t\t\trecurrence_endTz: recurrence_endTz, //this._data.master_booking.recurrence_endTz,\n\t\t\t\trecurrence_count: recurrence_count || 1,\n\t\t\t\tis_recurrent: is_recurrent,\n\t\t\t\trecurrence_starts: recurrenceStart,\n\t\t\t\trecurrence_exceptions: recurrence_exceptions || [],\n\t\t\t\trecurrence_pattern: recurrence_pattern || \"weekly\", //Helper value to store the last selected pattern (daily, weekly, monthly),\n\t\t\t\trecurrence_days: recurrence_days || [],\n\n\t\t\t\toccurrence_details: occurrence_details,\n occurrence_edits: occurrence_edits || null,\n occurrence_ids: occurrence_ids || null,\n recurrence_type: recurrence_type || null,\n recurrence_master_id: recurrence_master_id,\n\t\t\t\tedits: edits\n\t\t\t}\n\t\t};\n\n\n\t\tconst formGroup: BookingFormData = {\n\t\t\tlocation: [this.getLocation(booking)],\n\t\t\t//date: booking.date,\n\t\t\t// dateTz: recurrenceStart[0], //building_tz: timezone\n\t\t\tdateTz: recurrenceStart.length >=1 ? recurrenceStart[0] : closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }),\t15\t).toZone(timezone),\n\t\t\tduration: booking.duration,\n\t\t\tbookingType: internal_or_external === 'internal' ? bookingTypeOptions[0] : bookingTypeOptions[1],\n\t\t\troomSize: roomSize,\n\t\t\tselectedRoom: null,\n\t\t\ttimezone: timezone,\n\t\t\t// buildings: buildings,\n\t\t\t...this._data?.master_booking?.toJSON(),\n\t\t\t...recurringBookingData,\n\t\t\topt_out:booking.opt_out,\n\t\t\toutlook_opt_out: booking.outlook_opt_out,\n\t\t\taction: 'edit_booking'\n\n\t\t};\n\n\t\t// Clear existing form and result data, then dispatch the updated form data\n\t\tthis.clearFormAndResultData();\n\t\tthis.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n\t\t// Dispatch a request to load available rooms based on the updated form data\n\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(formGroup)))\n\t}\n\n\t/**\n * Opens a modal for editing a recurring series of bookings.\n */\n\tpublic editRecurringSeries() {\n\t\t// Dispatch the current status of the booking floor for editing the recurring series\n\t\tthis.dispatchToGetFloorCurrentStatus(this._data.booking, true);\n\n\t\tconst dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n\t\t\t\tpanelClass: 'mck-modal',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdata: {\n\t\t\t\t\tnavigateTo: this.navigateT0Search.bind(this),\n\t\t\t\t\taction: SeriesAction.EDIT, // Indicates the action type (editing a series)\n\t\t\t\t}\n\t\t});\n\n\t\t// Subscribe to the modal's closed event to handle the result\n\t\tdialog_ref.afterClosed().subscribe((flag) => {\n\t\t\t// Close the modal if the operation was successful (flag is truthy)\n\t\t\tflag && this.close(flag); //console.log('ROOM MODAL CLOSED')\n\t\t});\n\n\t}\n\n\tnavigateT0Search() {\n\t\tthis.router.navigate(['../home/results'], { relativeTo: this.route });\n\t}\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n\n\tpublic toggleEditView() {\n\t\tthis.fetchRooms(true);\n\t\tthis.expandedAvailability = true;\n\t}\n\n\tpublic updateBookingState(booking: Booking) {\n\t\tthis._data.booking = booking;\n\t\tthis.initDisplayValues(booking);\n\t\tthis.store.dispatch(loadBookingsWithQuery({ 'id': booking.id, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n\t\t// reload all booking for user from - apps/staff/src/app/booking/room-booking/room-booking.component.ts\n\t\tthis._data.refresh(); //\n\t}\n\n\tpublic cancelBooking(opts: { series?: boolean } = {}) {\n\t\t// Open the cancel booking modal\n\t\tthis.dialog.open(CancelBookingModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\t...this._data,\n\t\t\t\t...opts,\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst booking = this._data.booking.clone();\n\t\t\t\t\tthis._data.booking.delete(opts).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tthis.close();\n\t\t\t\t\t\t\t// @TODO:API The deleted record is still being returned for quite some time regardless of timeout.\n\t\t\t\t\t\t\tthis._data.refresh()\n\t\t\t\t\t\t\t// this.timeout('refresh', () => this._data.refresh(), 1000);\n\t\t\t\t\t\t\t// Heap track event\n\t\t\t\t\t\t\tthis._service.analytics.track('delete', {\n\t\t\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\t\t\troom: booking.room.name,\n\t\t\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\t\t\tcatering: !!booking.catering.legth,\n\t\t\t\t\t\t\t\theadcount: booking?.expected_attendees[booking.room.email],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err) => {\n\t\t\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\t}\n\n\tpublic extendBooking() {\n\t\t// open the extend booking modal\n\t\tconst dialogRefX = this.dialog.open(BookingDurationModalComponent, {\n\t\t\tpanelClass: 'mck-noexpand',\n\t\t\tdata: {\n\t\t\t\tbooking: this._data.booking,\n\t\t\t\tmaximum: this.extendableMaximum,\n\t\t\t},\n\t\t\tautoFocus: false,\n\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t});\n\n\t\tdialogRefX.afterClosed().subscribe((booking?: Booking) => {\n\t\t\tif (booking) {\n\t\t\t\tthis.updateBookingState(booking);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic displayCancelModal() {\n\t\t// Can the display cancel modal open? If it isn't one of these statuses\n\t\treturn !['cancelled', 'expired', 'declined'].includes(this.status);\n\t}\n\n\n\tpublic confirmChanges(data: DateDurationData) {\n\t\t// Confirm the changes returned from the room availability modal.\n\t\tthis.mobile = data.mobile;\n\t\tthis.setAlternativeWeekStartDate(data.dateTz);\n\n\t\t// New booking flow has this.data\n\t\tif (this.data.value) {\n\t\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t\t\t// submit\n\t\t\tthis.store.dispatch(storeBookingFormData({\n\t\t\t\tpayload: {\n\t\t\t\t\t...this.data.value,\n\t\t\t\t\tdateTz: data.dateTz,\n\t\t\t\t\tduration: data.duration,\n\t\t\t\t}\n\t\t\t}));\n\t\t} else if (data.save) {\n\t\t\t// update booking date/duration\n\t\t\tconst booking = this._data.booking.clone();\n\t\t\tconst pendingChanges = booking.duration !== data.duration || booking.startDateTz.ms !== data.dateTz.ms;\n\t\t\t// booking.duration = data.duration;\n\t\t\tbooking.startDateTz = data.dateTz; // date = data.dateTz.ms;\n\t\t\tbooking.endDateTz = data.dateTz.addValue({ minutes: data.duration });\n\t\t\tthis.loading = true;\n\n\t\t\tconst roomRules = rulesForSpace({\n\t\t\t\ttime: booking.date,\n\t\t\t\tduration: booking.duration,\n\t\t\t\tuser: this.currentUser,\n\t\t\t\trules: this._data.booking.room.building?.booking_rules,\n\t\t\t\tspace: booking.room\n\t\t\t});\n\n\t\t\t// Rooms requiring approval are reset to tentative when the time changes.\n\t\t\tif (pendingChanges && !roomRules?.auto_approve) {\n\t\t\t\t// https://acaprojects.atlassian.net/browse/MCK-1481\n\t\t\t\t/**\n\t\t\t\t * Having 2 ways of containing the status is icky but until PlaceOS\n\t\t\t\t * depreciates approval_status it's necessry.\n\t\t\t\t */\n\t\t\t\t// booking.approval_status[booking.room.email] = \"tentative\";\n\t\t\t\tbooking.status = \"tentative\";\n\t\t\t\tbooking.time_changed = true;\n\t\t\t}\n\t\t\telse if (roomRules.reason === SpaceFilterReason.OfficeRules) {\n\t\t\t\t// this.alertIfItHasConflict(false, true);\n\t\t\t\tthis.invalidDueToOfficeRule = true;\n\t\t\t\tthis.loading = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// -----------------------------------------------------------\n\t\t\t// Check if catering is outside allowed hours before saving\n\t\t\t// -----------------------------------------------------------\n\t\t\tif (this.hasCateringOutsideHours(booking)) {\n\t\t\t\tthis.dialog.open(CateringDropComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-mini',\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\t})\n\t\t\t\t.afterClosed().subscribe((confirm_drop: boolean) => {\n\t\t\t\t\tif (confirm_drop) {\n\t\t\t\t\t\t// User chose to drop catering and proceed\n\t\t\t\t\t\tbooking.catering = [];\n\t\t\t\t\t\tthis.saveBooking(booking);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// User cancelled - do not save, just stop here\n\t\t\t\t\t\tthis.loading = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// If catering is within hours or no catering issue, just save\n\t\t\t\tthis.saveBooking(booking);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate saveBooking(booking: Booking) {\n\t\t\t// booking.save() won't use the toAPIJSON conversion so use the booking service.\n\t\t\tthis._bookings.save(booking).then(\n\t\t\t\t(bkn) => {\n\t\t\t\t\t// update booking\n\t\t\t\t\tthis.updateBookingState(booking);\n\t\t\t\t\tthis.form = generateBookingForm(booking, this.available_fields);\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.displayInfoBanner();\n\t\t\t\t\tbooking.room.building.name\n\t\t\t\t\tthis._service.analytics.track('update', {\n\t\t\t\t\t\tbooking_id: booking.id,\n\t\t\t\t\t\toffice: booking.room.building.name,\n\t\t\t\t\t\troom: booking.room.global_name,\n\t\t\t\t\t\tstart_time: booking.startDateTz.ms,\n\t\t\t\t\t\tend_time: booking.endDateTz.ms,\n\t\t\t\t\t\tcatering: !!booking.catering.length,\n\t\t\t\t\t\theadcount: booking.headcount,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t\tthis.expandedAvailability = false;\n\t\t\t\t\tthis.displayWarningBanner(getStatusErrorMessage(err?.status));\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\n\t/**\n\t * Check if the booking has catering and if it's outside allowed hours.\n\t */\n\tprivate hasCateringOutsideHours(booking: Booking): boolean {\n\t\tif (!booking?.catering || !booking.catering.length) return false;\n\t\n\t\t// Extract the hour from startDateTz\n\t\tconst hour = booking.startDateTz.date.hour;\n\t\t// Check if hour is outside 7 AM - 8 PM\n\t\treturn hour < 7 || hour >= 20;\n\t}\n\n\t/**\n\t * Open dialog if booking date and time is out of office rule\n\t * TO DO : Redundant code - same validaiton been applied over room detail while creating new booking - need to handle more graceful way. better if user been prohibited from choose future date if out of office rule on show avaialability calender itself\n\t * related to - https://acaprojects.atlassian.net/browse/MCK-2419\n\t */\n\n\talertIfItHasConflict(isBookable, isAvailable) {\n\t\t// this.isAlertDisplayed = true;\n\t\tconst data = {\n\t\t\theaderText: !isBookable ? SpaceConflictAlertModalData.NotBookableHeaderText : !isAvailable ? SpaceConflictAlertModalData.NotAvailableHeaderText : '',\n\t\t\tmessage: SpaceConflictAlertModalData.NotBookableDueToOfficeRule,\n\t\t\tbuttonLabel: 'Close',\n\t\t\tcallback: () => null,\n\t\t\tshouldClose: false\n\t\t};\n\t\tconst dialog = this.dialog.open(ConflictAlertModalComponent,\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tpanelClass: 'mck-alert',\n\t\t\t\tautoFocus: false,\n\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t\tdisableClose: !isBookable\n\t\t\t});\n\t}\n\n\n\n\tpublic displayInfoBanner() {\n\t\tthis.showInfoBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showInfoBanner = false;\n\t\t}, 3000);\n\t}\n\n\tpublic displayWarningBanner(custom: string) {\n\t\tthis.warningMessage = custom;\n\t\tthis.showWarningBanner = true;\n\t\tthis.timeout('close banner', () => {\n\t\t\tthis.showWarningBanner = false;\n\t\t}, 10000);\n\t}\n\n\tpublic hideInfoBanner() {\n\t\tthis.showInfoBanner = false;\n\t}\n\n\tpublic hideWarningBanner() {\n\t\tthis.showWarningBanner = false;\n\t}\n\n\tpublic setAlternativeWeekStartDate(bookingDate: DateTZ) {\n\t\tif (!bookingDate) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mobile) {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone();\n\t\t} else {\n\t\t\tthis.alternativeWeekStartDateTz = bookingDate.clone().startOfValue('week').startOfValue('day');\n\t\t}\n\t}\n\n\tpublic updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n\t\tthis.alternativeWeekStartDateTz = alternativeWeekStartDateTz.clone();\n\t\tthis.fetchRooms(true, this.alternativeWeekStartDateTz);\n\t}\n\n\tpublic fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n\t\tif (!this._data?.booking?.space?.id) {\n\t\t\treturn\n\t\t}\n\n\t\tconst day = 24 * 60;\n\t\tconst week = day * 7;\n\t\tconst date = (alternativeWeekStartDateTz || this._data?.booking?.startDateTz).clone(); // new DateTZ({date: alternativeWeekStartDateTz || this._data?.booking?.date});\n\t\tconst startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n\t\tconst startOfWeek = date.startOfValue('week');\n\n\t\t// Query for the entire day for this room\n\t\tconst query = {\n\t\t\tdateTz: allWeek ? startOfWeek : startOfDay,\n\t\t\tduration: allWeek ? week : day,\n\t\t\tlocations: this._data?.booking?.space?.id,\n\t\t\tcapacity: this._data?.booking?.space?.capacity,\n\t\t};\n\t\tthis.store.dispatch(loadByIdResults.request(query));\n\t}\n\n\tpublic addCatering() {\n\t\t// For the Add Catering button\n\t\tthis.showCatering = true;\n\t}\n\n\tpublic saveBookingWithCatering(form: FormGroup) {\n\t\t// Response from the catering modal closing\n\t\t// Close catering and confirmation modals and just show booking details modal\n\t\tif (!form) {\n\t\t\tthis.showCatering = false;\n\t\t\tthis.showDetails = false;\n\t\t\treturn;\n\t\t}\n\t\t// Update the booking state.\n\t\tconst booking = this._data.booking.clone();\n\t\tbooking.catering = form.controls.catering.value;\n\n\t\tif (booking.catering.length) {\n\t\t\tconst setup = {};\n\t\t\tsetup[booking.room.email] = booking.setup[booking.room.email] || 900;\n\t\t\tconst breakdown = {};\n\t\t\tbreakdown[booking.room.email] = booking.breakdown[booking.room.email] || 900;\n\n\t\t\tbooking.setup = setup\n\t\t\tbooking.breakdown = breakdown\n\t\t}\n\n\t\tthis.updateBookingState(booking);\n\t}\n\n\tpublic set specific_dates(val: boolean) {\n\t\tthis._specific_dates = val;\n\t}\n\n\tpublic get specific_dates(): boolean {\n\t\treturn this._specific_dates;\n\t}\n\n\n\tpublic toggleSpecificDates() {\n\t\tthis.specific_dates = !this.specific_dates;\n\t}\n\n\n}\n","\n
\n
\n
 
\n
\n \n

Your booking date and/or time was successfully updated

\n \n
\n
\n \n

{{ warningMessage }}

\n \n
\n \n \n
\n
\n
\n
\n \n Recurring booking status: {{ statusText }} \n
\n
\n \n
\n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Days' : 'Day'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Weeks' : 'Week'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs every {{recurrence_interval > 1 ? recurrence_interval + ' Months' : 'Month'}} effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}.\n \n \n This is one occurrence in a recurring series which occurs on Specific Dates effective {{ _data?.master_booking?.dateString }} until {{ _data?.master_booking?.endDateString }}\n
\n
\n
\n
{{ occurrence.dateTz.formatDate('dd MMM yyyy') }}
\n
\n
\n
\n
\n
\n
\n
\n \n Edit series\n \n \n \n
\n
\n\n
\n
\n

{{statusText}}

\n {{timeString}} \n
\n
\n
\n \n
\n

This is a multiroom booking. To request edits, please contact your local backoffice team.

\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n \n
\n\n
\n
\n {{roomName}}\n
\n
\n {{roomLocation}}\n
\n
\n Capacity: {{capacity}}\n
\n \n
\n\n\n\n
\n\n \n
\n \n Reception\n \n
\n
\n \n Cancel booking\n \n
\n \n
\n\n\n
\n \n\n
\n \n
\n \n
\n
\n
\n

\n \n Schedule\n

\n \n \n
\n\n

\n Date: {{dateString}}
\n Time: {{timeString}}
\n {{type}} meeting ({{durationString}})\n

\n \n {{ checkingExtendable ? 'Checking availability...' : 'Extend booking duration'}}\n \n
\n \n
\n
\n

\n \n

\n

\n \n \n \n

\n
\n \n\n \n
\n
\n
\n

\n Meeting\n

\n \n \n
\n \n
\n
Meeting title:   {{ title}}
\n
Host:   {{ host}}
\n
Attendees:   {{attendeesString}}\n
\n
Company:   {{companyString}}
\n
Charge code:   {{chargeCode}}
\n
Headcount estimate:   {{headcount}}
\n
Additional requirements:   {{requirements}}
\n
Email notification for this booking has been opt out.
\n
Outlook calendar invite for this booking has been opted out of.
\n \n
\n \n
\n
\n\n
\n
\n

\n \n

\n \n \n \n \n \n \n
\n
\n \n\n
\n
\n
\n \n
\n
\n \n
\n\n \n
\n\n \n
\n
\n \n \n \n

\n \n \n \n

\n \n \n
\n\n
\n
\n \n
\n

\n \n Catering\n

\n \n \n
\n Catering available for this room\n
\n \n \n
\n
\n\n \n
\n \n
\n

\n \n

\n

\n \n

\n \n
\n
\n
\n\n
\n
\n \n
\n
\n \n \n \n \n \n
\n\n \n
\n
\n\n
\n \n
\n \n \n
\n
\n
\n\n
\n \n
\n\n
\n \n
\n \n
\n
\n
\n\n
\n\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n BaseDirective,\n } from '@mckinsey-converge/base';\nimport {\n Booking,\n BookingsService,\n DEFAULT_BOOKING_DURATION,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport * as cloneDeep from 'lodash/cloneDeep';\n\ninterface extendData {\n booking: Booking;\n maximum: number\n}\n\n@Component({\n selector: 'app-booking-duration-modal',\n template: `\n \n
\n \n

Your booking failed to update, please try again

\n \n
\n
\n \n
Extend booking duration
\n
\n
\n \n \n
\n
\n \n
\n
\n `,\n styleUrls: ['./booking-duration-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class BookingDurationModalComponent extends BaseDirective implements OnInit {\n\n public loading: string;\n public showWarningBanner: boolean = false;\n\n public get durationGroups() {\n const step = 15;\n const steps = Math.floor(this.data.maximum / step);\n const max = (steps * step) + this.data.booking.duration;\n\n return [{\n start: this.data.booking.duration,\n step,\n max\n }];\n }\n\n public formGroup = new FormGroup({\n date: new FormControl(this.data.booking.date, [Validators.required]),\n dateTz: new FormControl(this.data.booking.startDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n });\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: extendData,\n private dialogRef: MatDialogRef,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n ngOnInit() {\n this.formGroup.setValue({\n date: this.data.booking.date,\n dateTz: this.data.booking.startDateTz,\n duration: this.data.booking.duration,\n });\n }\n\n public closeModal(booking?: Booking) {\n this.dialogRef.close(booking);\n }\n\n public updateBookingDuration() {\n const formData = this.formGroup.getRawValue();\n this.loading = 'Saving...';\n\n // clone booking to allow editing\n // const booking = this.data.booking.clone(); // this line commented for bug appearing in CNG-352. Used cloneDeep instead\n const booking = cloneDeep(this.data?.booking);\n booking.endDateTz = booking.startDateTz.addValue({ minutes: formData.duration });\n this._bookings.save(booking).then(\n () => {\n this.loading = null;\n this.closeModal(booking);\n },\n (err) => {\n this.loading = null;\n this.displayWarningBanner()\n }\n );\n }\n\n\n public displayWarningBanner() {\n this.showWarningBanner = true;\n this.timeout('close banner', () => {\n this.showWarningBanner = false;\n }, 10000);\n }\n\n public hideWarningBanner() {\n this.showWarningBanner= false;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { BookingResultsViewModel } from '../manage-bookings/manage-bookings.viewmodel';\nimport {\n BaseDirective,\n shorterLocalDateFormatString,\n timeWithZoneFormatString,\n startEndTimeFormatString,\n humaniseDuration,\n closestToTimeSlotTz,\n} from '@mckinsey-converge/base';\nimport { DateNow, DateTZ, localTimezone } from \"@mckinsey-converge/date-tz\";\nimport { Booking, BookingFormData, BookingStoreState, bookingTypeOptions, Building, BuildingCity, clearBookingFormData, defaultRoomSizeOption, DEFAULT_BOOKING_DURATION, flattenDisplayOffices, roomFormDataToQuery, roomSizeOptions, storeBookingFormData } from '@mckinsey-converge/data-common';\nimport { buildingStateSelector, BuildingStoreState, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BehaviorSubject,\n} from 'rxjs';\n\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n@Component({\n selector: 'app-booking-result-item',\n templateUrl: './booking-result-item.component.html',\n styleUrls: ['./booking-result-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingResultItemComponent extends BaseDirective implements OnInit {\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: BookingResultsViewModel | undefined;\n \n @Input()\n public bookings: BookingResultsViewModel[];\n\n @Input()\n public list: string;\n\n @Input() public index: number;\n\n @Input() public small: boolean = false;\n\n @Output()\n public bookingSelect = new EventEmitter();\n\n public buildings = new BehaviorSubject[]>([]);\n\n public roomName: string;\n public roomLocation: string;\n public host: string;\n public status: string;\n public timeStringParts: string[] = [' ', ' '];\n public localTimeStringParts: string[] = [' ', ' '];\n public isAnotherTimezone: boolean = false;\n public statusText: string;\n public statusImage: string;\n public durationString: string;\n public timeRangeString: string;\n public building: any;\n public get dateString() {\n if (!this.bookings || !this.bookings.length) return '';\n const bkn1 = this.bookings[this.index].booking;\n const d1 = new DateTZ({ date: bkn1.startDateTz.ms, is_local_tz: false, building_tz: bkn1.startDateTz.building_tz });\n if (this.index === 0) {\n return shorterLocalDateFormatString(d1);\n }\n const bkn2 = this.bookings[this.index - 1].booking;\n const d2 = new DateTZ({ date: bkn2.startDateTz.ms, is_local_tz: false, building_tz: bkn2.startDateTz.building_tz });\n if (!d1.isSameDate(d2, 'day')) {\n return shorterLocalDateFormatString(d1);\n }\n return '';\n }\n public get todayString() {\n if (!this.bookings || !this.bookings.length) {\n return '';\n }\n \n // Strip the booking of it's timezone infomation so isSameDate is just based on timestamp and local time.\n const d1 = new DateTZ({ date: this.bookings[this.index].booking.startDateTz.ms });\n return DateNow(new Date()).isSameDate(d1, 'day') ? '(Today)' : '';\n }\n\n public get attendeesCount(): number {\n // allAttendees is booking.attendees + 1 (booking.organizer)\n return this.viewModel.booking?.allAttendees.length; \n }\n\n public get has_catering(): number {\n return this.viewModel.booking?.has_catering && this.viewModel.booking?.catering?.length;\n }\n\n public get upcoming() {\n return ['tentative', 'accepted', 'approved'].includes(this.status);\n }\n\n constructor(private store: Store,\n private cdRef: ChangeDetectorRef) {\n super();\n }\n\n public ngOnInit(): void {\n this.setupDisplayFields();\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n }));\n this.cdRef.detectChanges();\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public getTooltipText(){\n return this.viewModel.booking.local_room_name.split(',');\n }\n\n public setupDisplayFields() { \n if (!this.viewModel?.booking) {\n return;\n }\n this.timeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz).split(' ');\n this.timeRangeString = startEndTimeFormatString(this.viewModel.booking.startDateTz, this.viewModel.booking.displayEndDateTz);\n this.isAnotherTimezone = !this.viewModel.booking.startDateTz.is_local_tz;\n this.localTimeStringParts = timeWithZoneFormatString(this.viewModel.booking.startDateTz.toZone(localTimezone())).split(' ');\n this.host = this.viewModel.booking.organiser.name;\n this.roomName = this.viewModel.booking.local_room_name.split(',')[0];\n this.roomLocation = this.viewModel.booking.room.street_and_city;\n this.durationString = humaniseDuration(this.viewModel.booking.duration, 'medium');\n\n if (this.viewModel.booking.status) {\n // mark bookings before today expired\n this.status = (DateNow(new Date()).isAfterDate(this.viewModel.booking.endDateTz) && this.list !== 'cancelled') ? 'expired' : this.viewModel.booking.status;\n switch(this.status) {\n case 'tentative':\n this.statusImage = 'assets/icon/booking_pending.svg';\n this.statusText = 'Pending';\n break;\n case 'accepted':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'approved':\n this.statusImage = 'assets/icon/booking_confirmed.svg';\n this.statusText = 'Confirmed';\n break;\n case 'declined':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'cancelled':\n this.statusImage = 'assets/icon/booking_cancelled.svg';\n this.statusText = 'Cancelled';\n break;\n case 'expired':\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n default: // TODO\n this.statusImage = 'assets/icon/booking_expired.svg';\n this.statusText = 'Expired';\n break;\n }\n }\n this.cdRef.detectChanges();\n return;\n }\n\n}\n","

\n {{ dateString }} {{ todayString }}\n

\n
\n
\n
\n
\n
\n {{ timeStringParts[0] }} ({{ timeStringParts[1] }}) ({{\n durationString\n }})\n
\n
\n {{ localTimeStringParts[0] }} ({{ localTimeStringParts[1] }}) in your\n local timezone\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
{{ statusText }}
\n
\n {{ timeRangeString }}\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
{{ viewModel.booking.title }}
\n {{\n viewModel.booking.bookingTypeLabel\n }}\n \n {{viewModel.booking?.merged ? 'Merged' : 'Multiroom'}} \n \n \n
\n \n \n \n
\n
\n \n {{ roomName }}\n {{ roomLocation }}\n Host: {{ host }}\n {{ attendeesCount }}pp\n Catered\n \n \n \n \n \n \n \n \n
\n
\n
\n\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { RoomBookingComponent } from 'src/app/booking/room-booking/room-booking.component';\nimport { RoomResultsComponent } from 'src/app/booking/room-results/room-results.component';\nimport { RoomDetailsComponent } from 'src/app/booking/room-details/room-details.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { OfficeFloorComponent } from './office-floor/office-floor/office-floor.component';\n\nconst routes: Routes = [\n {\n path: 'results',\n component: RoomResultsComponent,\n },\n {\n path: 'results/filter',\n component: RoomFiltersModalComponent,\n },\n {\n path: 'results/room',\n component: RoomDetailsComponent,\n },\n {\n path: 'create',\n component: BookingCreateComponent,\n },\n {\n path: 'edit',\n component: BookingEditWrapperComponent,\n },\n {\n path: 'manage',\n component: ManageBookingsComponent,\n },\n {\n path: 'catering/:id',\n data: { hasCatering: true },\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id/:verb',\n component: ManageBookingsComponent,\n },\n {\n path: 'booking/:id',\n component: ManageBookingsComponent,\n },\n {\n path: 'floor-map',\n component: OfficeFloorComponent,\n },\n {\n path: 'results/booking-calendar',\n loadChildren: () => import('./booking-calendar/booking-calendar.module').then((m) => m.BookingCalendarModule),\n },\n {\n path: '**',\n component: RoomBookingComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BookingRoutingModule {}\n","import {\n createReducer,\n on\n} from '@ngrx/store';\nimport { \n BookingFormState,\n clearBookingFormData,\n clearRoomFilters,\n openBookingSurvey,\n storeBookingFormData,\n storeRoomFilters\n} from '@mckinsey-converge/data-common';\nimport { closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\nexport const initialBookingFormState: BookingFormState = {\n activeFormFilters: []\n};\n\nexport const bookingFormReducer = createReducer(initialBookingFormState,\n on(storeBookingFormData, (state: BookingFormState, action) => {\n return {\n ...state,\n activeForm: {\n ...state.activeForm,\n ...action.payload\n }\n } as BookingFormState;\n }),\n on(clearBookingFormData, state => ({\n ...state,\n activeForm: \n {\n location: state?.activeForm?.location,\n timezone: state?.activeForm?.timezone,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: state?.activeForm?.timezone, }), 15)\n \n }\n }) as BookingFormState),\n on(openBookingSurvey, state => ({\n ...state,\n bookingCompleted: new Date()\n }) as BookingFormState),\n on(storeRoomFilters, (state: BookingFormState, action) => {\n return {\n ...state,\n activeFormFilters: action.payload\n } as BookingFormState;\n }),\n on(clearRoomFilters, (state: BookingFormState) => ({\n ...state,\n activeFormFilters: initialBookingFormState.activeFormFilters\n }) as BookingFormState)\n);\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { BookingRoutingModule } from './booking-routing.module';\nimport { BookingsListingComponent } from './bookings-listing/bookings-listing.component'\nimport { RoomBookingComponent } from './room-booking/room-booking.component';\nimport { RoomDetailsComponent } from './room-details/room-details.component';\nimport { BookingFormBaseComponent } from './booking-create/booking-form-base.component';\nimport { BookingCreateComponent } from './booking-create/booking-create.component';\nimport { BookingEditComponent } from './booking-create/booking-edit.component';\nimport { BookingConfirmationComponent } from './booking-confirmation/booking-confirmation.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule } from '@angular/material/select';\nimport {\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { SharedContentModule } from 'src/app/shared/shared.module';\nimport { MatButtonModule } from '@angular/material/button';\nimport { StoreModule } from '@ngrx/store';\nimport { bookingFormReducer } from 'src/app/booking/booking.form.reducer';\nimport { BookingResultItemComponent } from './booking-result-item/booking-result-item.component';\nimport { BookingDetailsModalComponent } from './booking-details-modal/booking-details-modal.component';\nimport { BookingDurationModalComponent } from './booking-duration-modal/booking-duration-modal.component';\nimport { CancelBookingModalComponent } from './cancel-booking-modal/cancel-booking-modal.component';\nimport { ManageBookingsComponent } from './manage-bookings/manage-bookings.component';\nimport { RoomResultsComponent } from './room-results/room-results.component';\nimport { SearchedLocationComponent } from './searched-location/searched-location.component';\nimport { ResultsHeaderComponent } from './results-header/results-header.component';\nimport { RoomAvailabilityPreviewComponent } from './room-availability-preview/room-availability-preview.component';\nimport { RoomLocationPreviewComponent } from './room-location-preview/room-location-preview.component';\nimport { RoomResultItemComponent } from './room-result-item/room-result-item.component';\nimport { RoomBookingFormComponent } from './room-booking-form/room-booking-form.component';\nimport { RoomBookingDetailsFormComponent } from './room-booking-details-form/room-booking-details-form.component';\nimport { RoomBookingModalComponent } from './room-booking-modal/room-booking-modal.component';\nimport { RoomResultsPaginatedComponent } from './room-results-paginated/room-results-paginated.component';\nimport { RoomFiltersModalComponent } from './room-filters-modal/room-filters-modal.component';\nimport { RoomFiltersFormComponent } from './room-filters-form/room-filters-form.component';\nimport { RoomAvailabilityPreviewModalComponent } from './room-availability-preview-modal/room-availability-preview-modal.component';\nimport { MapModule } from 'src/app/map/map.module';\nimport { OfficeFloorMapModule } from 'src/app/booking/office-floor/office-floor-map.module';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\nimport { RoomResultsSectionComponent } from './room-results-section/room-results-section.component';\nimport { CalendarModule, DateAdapter } from 'angular-calendar';\nimport { adapterFactory } from 'angular-calendar/date-adapters/date-fns';\nimport { BookingCateringComponent } from './catering/catering.component';\nimport { OrderTableComponent } from './catering/order-table/order-table.component';\nimport { BookingCateringOrderDetailsComponent } from './catering/order-details/order-details.component';\nimport { BookingCateringOrderListComponent } from './catering/order-list/order-list.component';\nimport { CateringOrderListItemComponent } from './catering/order-list/item/item.component';\nimport { CateringMenuCategoryComponent } from './catering/order-details/category/category.component';\nimport { SurveyModalComponent } from '../components/survey-modal/survey-modal.component';\nimport { BookingEditWrapperComponent } from './booking-create/booking-edit-wrapper.component';\n\nexport const bookingModuleDeclarations = [\n BookingFormBaseComponent,\n BookingCreateComponent,\n BookingEditComponent,\n BookingConfirmationComponent,\n BookingDetailsModalComponent,\n BookingDurationModalComponent,\n BookingsListingComponent,\n BookingResultItemComponent,\n CancelBookingModalComponent,\n ManageBookingsComponent,\n BookingCateringComponent,\n BookingCateringOrderDetailsComponent,\n BookingCateringOrderListComponent,\n CateringMenuCategoryComponent,\n CateringOrderListItemComponent,\n RoomBookingComponent,\n RoomDetailsComponent,\n RoomResultsComponent,\n SearchedLocationComponent,\n ResultsHeaderComponent,\n RoomAvailabilityPreviewComponent,\n RoomLocationPreviewComponent,\n RoomResultItemComponent,\n RoomBookingModalComponent,\n RoomBookingFormComponent,\n RoomBookingDetailsFormComponent,\n RoomResultsPaginatedComponent,\n RoomFiltersModalComponent,\n RoomFiltersFormComponent,\n RoomResultsSectionComponent,\n RoomAvailabilityPreviewModalComponent,\n CateringMenuCategoryComponent,\n OrderTableComponent,\n SurveyModalComponent,\n BookingEditWrapperComponent\n];\n\nexport const bookingModuleImports = [\n CommonModule,\n UiModule,\n MatSelectModule,\n MatButtonModule,\n NgxMatSelectSearchModule,\n ReactiveFormsModule,\n SharedContentModule,\n FormsModule,\n NgxSkeletonLoaderModule,\n MapModule,\n CalendarModule.forRoot({\n provide: DateAdapter,\n useFactory: adapterFactory,\n }),\n OfficeFloorMapModule\n];\n\n\n@NgModule({\n declarations: [...bookingModuleDeclarations],\n imports: [\n ...bookingModuleImports,\n BookingRoutingModule,\n StoreModule.forFeature('bookingForm', bookingFormReducer)\n ]\n})\nexport class BookingModule {\n}","import { Component, Input, OnInit, OnChanges, ChangeDetectionStrategy, ChangeDetectorRef, NgZone } from '@angular/core';\nimport { throttleTime, tap, first, distinctUntilChanged, map } from 'rxjs/operators';\nimport { fromEvent } from 'rxjs';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BuildingStoreState, buildingStateSelector, selectBuildingOptionsGroupedByCity } from '@mckinsey-converge/buildings';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Booking, User, IEngineResponse, BookingStoreState, clearBookingFormData, BookingsService, UsersService, flattenDisplayOffices, BuildingCity, Building } from '@mckinsey-converge/data-common';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { loadBookingsWithQuery, loadUpcomingBookingsResults, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel,\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { BookingPagination } from '@mckinsey-converge/bookings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nexport type ManageBookingsStoreState = BookingStoreState &\n BuildingStoreState &\n MyBookingsStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-bookings-listing',\n templateUrl: './bookings-listing.component.html',\n styleUrls: ['./bookings-listing.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BookingsListingComponent extends BaseDirective implements OnInit, OnChanges {\n @Input() public config: any;\n @Input() public buildings: BehaviorSubject[]>;\n @Input() public searchBookingBy: string;\n @Input() public selectedHost: string;\n @Input() public activeTab: string;\n\n public bookingResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public bookings: BookingResultsViewModel[];\n public showBookings = false;\n public reloading = false;\n public TopBarHeaderMode = TopBarHeaderMode;\n public mobile: boolean = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n public pagination: BookingPagination = {\n currentPage: 1,\n totalRecords: 0,\n pageLimit: 10,\n };\n bookingPerPage: any[] = [];\n filteredByHost: any[] = [];\n\n public get lastPage() {\n return this.pages.total === this.pagination.currentPage;\n }\n\n public get pages() {\n const p = this.pagination;\n const total = Math.ceil(p.totalRecords / p.pageLimit) ;\n const group = Math.ceil(p.currentPage / 5);\n const startPosition = Math.max(\n 1,\n Math.min(group > 1 ? (group - 1) * (p.pageLimit + 1) : 1, total - 4)\n );\n let pages = [];\n for (let x = startPosition; x <= Math.min(startPosition + 4, total); x++) {\n pages.push(x);\n }\n if (!pages.length) {\n pages.push(1);\n }\n const maxed = () => {\n if (total <= 5 || p.currentPage >= total) {\n return false;\n }\n return true;\n };\n const mined = () => {\n if (total <= 5 || p.currentPage < 6) {\n return false;\n }\n return true;\n };\n const start = p.currentPage > 5;\n const end = !(p.currentPage >= total);\n return {\n total,\n pages,\n min: mined(),\n max: maxed(),\n start,\n end,\n };\n }\n\n constructor(\n private store: Store,\n private _route: ActivatedRoute,\n private _router: Router,\n private dialog: MatDialog,\n private _bookings: BookingsService,\n private _zone: NgZone,\n private cdRef: ChangeDetectorRef\n ) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 450;\n const selector = this.config.selector;\n const target = this.config.type;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n \n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n // this.buildings.next(next);\n if(this.activeTab === this.config.type) {\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target,\n offset: 0,\n })\n );\n }\n\n // start the timer at the top of the minute;\n const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n setTimeout(() => {\n this.refresh(target);\n this._zone.runOutsideAngular(() => {\n this.interval('refreshBookings', () => this.refresh(target, true), 60 * 1000);\n });\n\n }, offset + 5000);\n\n \n }));\n\n\n\n const sort_asc = (a, b) => a.date - b.date;\n const sort_desc = (a, b) => b.date - a.date;\n\n this.subscription(\n 'bookingResults',\n this.store.pipe(select(selector)).subscribe((next) => {\n this.bookingResults.next(next);\n if (!next.isEmpty() && Array.isArray(next?.success?.results)) {\n let results = [...next?.success?.results].sort(\n this.config.reverse_sort ? sort_desc : sort_asc\n );\n this.showBookings = !!results.length;\n this.reloading = false;\n // save all bookings to reuse later \n this.allBookings = results;\n \n /** Filter all booings of active tab by selected host if any */\n this.filterBySelectedHost(true);\n\n } else {\n this.showBookings = false;\n this.reloading = false;\n this.bookings = [];\n this.pagination.totalRecords = 0;\n this.cdRef.detectChanges();\n }\n })\n );\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n ).subscribe();\n \n this.timeout('query', () =>\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe((params) => {\n if (params.has('page')) this.setPage(+params.get('page'), false);\n })\n )\n );\n }\n\n //For each result from results, it find its level and building from the lists and map with BookingResultsViewModel but filter all master from list.\n public getViewModel = (results) => mapResultsToViewModels(results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n\n\n public splitArrayIntoSubarrays(originalArray, subarrayLength) {\n var newArray = [];\n for (var i = 0; i < originalArray.length; i += subarrayLength) {\n newArray.push(originalArray.slice(i, i + subarrayLength));\n }\n return newArray;\n }\n\n\n public ngOnChanges($change: any) {\n \n if ($change?.buildings?.currentValue !== $change?.buildings?.previousValue || $change?.activeTab?.currentValue !== $change?.activeTab?.previousValue) {\n this.refresh(this.config.type);\n }\n if ($change?.selectedHost?.currentValue !== $change?.selectedHost?.previousValue) {\n this.filterBySelectedHost(true);\n } else\n if ($change?.searchBookingBy?.currentValue !== $change?.searchBookingBy?.previousValue) {\n this.filterBySelectedHost(false);\n }\n }\n\n\n\n public filterBySelectedHost(isHostChanged: boolean) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchHost = this.selectedHost.toLowerCase().trim();\n // this.filteredByHost = [];\n\n if(this.allBookings) {\n\n if(searchHost) {\n if(isHostChanged) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...this.allBookings];\n // Filtering the combine array to find matching host email \n this.filteredByHost = allItems.filter( (item: any ) => \n this.isIncludes(item?.host, 'email', searchHost) ||\n this.isIncludes(item?.organiser, 'email', searchHost)\n );\n }\n else {\n this.filteredByHost = [...this.filteredByHost];\n }\n \n }\n else {\n this.filteredByHost = [...this.allBookings];\n }\n\n //Now send filtered booking by host to filter further by search input given in the field\n this.filterBookingsBySearchValue([...this.filteredByHost]);\n\n \n }\n }\n\n \n public isIncludes = (item: any, field: string, searchVaue: string) => (item && item[field] && item[field].toLowerCase().includes(searchVaue));\n\n public filterBookingsBySearchValue(filteredByHost) {\n\n // Converting search value to lower case for case-insensitive comparison\n const searchValue = this.searchBookingBy.toLowerCase().trim();\n let filteredItems = [];\n\n if(filteredByHost) {\n\n if(searchValue) {\n // Combining event list and space arrays into one arrya for searchig \n const allItems = [...filteredByHost];\n // Filtering the combine array to find matching room or booking \n filteredItems = allItems.filter( (item: any ) => \n this.isIncludes(item, 'title', searchValue) ||\n this.isIncludes(item?.creator, 'name', searchValue) ||\n this.isIncludes(item?.organiser, 'name', searchValue) ||\n this.isIncludes(item, 'local_room_name', searchValue) || // search with room name \n this.isIncludes(item, 'simple_name', searchValue) || \n (item?.attendees && !!item?.attendees.filter(el => el.name.toLowerCase().includes(searchValue)).length ) \n );\n }\n else {\n filteredItems = [...filteredByHost];\n }\n\n const filteredBookings = this.getViewModel(filteredItems);\n \n this.pagination.totalRecords = filteredBookings.length;\n this.pagination.currentPage = !this.lastPage ? 1 : this.pagination.currentPage;\n this.bookingPerPage = this.splitArrayIntoSubarrays(filteredBookings, this.pagination.pageLimit);\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n }\n \n }\n\n \n\n\n\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return this.reloading; // || !this.bookingResults?.value?.isLoading;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find((b) => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // From the Manage Bookings page\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n if(viewModel.booking.is_recurrent) {\n let booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n if (!booking) {\n booking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n }\n this.master_booking = mapResultsToViewModels([booking])[0];\n }\n this.cdRef.detectChanges();\n\n // real booking.room here.\n const dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking: viewModel.booking,\n refresh: () => {\n this.refresh('all');\n },\n\n building: this.getBuilding(viewModel.booking),\n master_booking: this.master_booking?.booking || null,\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRefX.afterClosed().subscribe((flag) => {\n flag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n this.cdRef.detectChanges();\n // this.timeout('refreshBookings', () => this.refresh('all'), 1000);\n // this.timeout('refreshBookings', () => this.refresh('all'), 5000);\n });\n }\n\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n this.cdRef.detectChanges();\n }\n\n public readonly prevPage = () => this.setPage(this.pagination.currentPage - 1);\n public readonly nextPage = () => this.setPage(this.pagination.currentPage + 1);\n public readonly prevGroup = () => this.setPage(this.pages.pages.length);\n public readonly nextGroup = () => this.setPage(this.pages.pages.length + 1);\n public readonly gotoPage = (page: number) => this.setPage(page);\n\n public setPage(page_idx: number, route: boolean = true) {\n if (!this.pages.total) return;\n const page = Math.max(1, Math.min(page_idx, this.pages.total));\n if (route) this._router.navigate([], { relativeTo: this._route, queryParams: { page } });\n this.pagination.currentPage = page;\n this.bookings = this.bookingPerPage[this.pagination.currentPage-1];\n this.cdRef.detectChanges();\n // this.refresh();\n }\n\n public refresh(target: string = this.activeTab, dontShowReloading = false) {\n if (!this.currentUser?.email) {\n return;\n }\n\n \n const offset = 0 ; //(this.pagination.currentPage - 1) * this.pagination.pageLimit;\n // fetch it on one minute interval now that there is room data.\n if(this.activeTab === this.config.type) {\n\n this.store.dispatch(\n loadBookingsWithQuery({\n email: this.currentUser.email,\n from: DateNow(new Date()).ms,\n target:this.activeTab,\n offset,\n })\n );\n this.reloading = !dontShowReloading;\n this.cdRef.detectChanges();\n }\n \n\n \n\n \n }\n\n identify(index, item) {\n return item.booking.id;\n }\n}\n","
\n \n \n
\n
\n \n\n \n \n \n \n \n \n \n \n
\n \n
\n
\n \n

End of list. You have no upcoming bookings

\n
\n
\n \n

End of list. Past meetings are saved for up to 48 hours.

\n
\n
\n \n

End of list. Cancelled meetings are saved for up to 48 hours.

\n
\n
\n
\n \n \n \n \n
\n
\n
\n
    \n
  • \n
  • 1
  • \n
  • ...
  • \n
  • \n {{p}}\n
  • \n
  • ...
  • \n
  • \n {{pages.total}}\n
  • \n
  • \n
\n
\n","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { Booking, Building, RecurrencePeriod } from '@mckinsey-converge/data-common';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { BaseClass } from '@mckinsey-converge/base';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface data {\n booking: Booking;\n building: Building;\n callback: Function;\n master_booking?: Booking;\n hasLoaderUrl?: boolean;\n refresh?: Function;\n\t\tseries?:{};\n}\n\n@Component({\n selector: 'app-cancel-booking-modal',\n template: `\n \n
\n \n
\n
\n \n
{{ subtitle }}
\n
\n
\n

{{ data.booking.title }}

\n\n \n

\n Daily from \n \n

\n weekly on {{ data?.master_booking?.recurrence_days[0] | titlecase }}\n

\n

from

\n \n Monthly on \n\n {{ data?.master_booking?.dateString }} until\n {{ data?.master_booking?.endDateString }}\n

\n \n \n Specific Dates: \n
\n
\n
Date
\n
\n
\n {{ occurrence.dateTz.formatDate('dd MMM yyyy') }}\n
\n
\n
\n
\n
\n
\n\n

{{ dateString }}

\n

{{ timeString }}

\n

{{ buildingAddress }}

\n

{{ data.booking.room.local_room_name }}

\n \n
\n \n
\n
\n `,\n styleUrls: ['./cancel-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CancelBookingModalComponent extends BaseClass {\n public title: string;\n public roomName: string;\n public buildingAddress: string;\n public dateString: string;\n public timeString: string;\n public canceled = false;\n private _specific_dates = false;\n private recurrence_period: RecurrencePeriod;\n public occurrence_details: { start_epoch: number; dateTz: DateTZ; id: string }[];\n private recurrence_interval: number;\n\n public get subtitle() {\n return this.canceled\n ? `${this.title} booking cancelled`\n : this.data?.series\n ? 'Are you sure you want to cancel this recurring series?'\n : 'Are you sure you want to cancel this booking?';\n }\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: data,\n private dialogRef: MatDialogRef\n ) {\n super();\n this.dateString = dateBuildingFormatString(this.data.booking.startDateTz, true);\n this.timeString = startEndTimeWithZoneFormatString(this.data.booking.startDateTz, this.data.booking.displayEndDateTz);\n this.title = this.data.booking.title;\n this.buildingAddress = this.data.booking.room.street_and_city;\n\n\n\t\t\t\tif(this.data?.master_booking !== null) {\n\n\t\t\t\t\tthis.recurrence_period = this.data?.master_booking?.recurrence_period;\n\t\t\t\t\tthis.recurrence_interval = this.data?.master_booking?.recurrence_interval;\n\n\t\t\t\t\tthis.occurrence_details = this.data?.master_booking?.occurrence_details &&\n\t\t\t\t\t\tthis.data?.master_booking?.occurrence_details\n\t\t\t\t\t\t\t.filter((ocurrence) => ocurrence.id !== this.data?.master_booking?.id)\n\t\t\t\t\t\t\t.map((ocurrence) => ({\n\t\t\t\t\t\t\t\t...ocurrence,\n\t\t\t\t\t\t\t\tstart_epoch: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\tdateTz: new DateTZ({\n\t\t\t\t\t\t\t\t\tdate: ocurrence.start_epoch * 1000,\n\t\t\t\t\t\t\t\t\tis_local_tz: false,\n\t\t\t\t\t\t\t\t\tbuilding_tz: this.data.master_booking.timezone,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t}));\n\t\t\t\t}\n\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public cancelBooking() {\n this.canceled = true;\n this.data.callback();\n this.timeout('closeModal', () => this.closeModal(), 2000);\n }\n\n public set specific_dates(val: boolean) {\n this._specific_dates = val;\n }\n\n public get specific_dates(): boolean {\n return this._specific_dates;\n }\n\n public toggleSpecificDates() {\n this.specific_dates = !this.specific_dates;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n Booking,\n Building,\n CateringOrder,\n Space,\n bookingStatusDetails,\n ApplicationService,\n CateringCategory,\n BookingsService,\n DataForConfirmation,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n HashMap,\n shorterLocalDateFormatString\n} from '@mckinsey-converge/base';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n toTitleCase\n} from '@mckinsey-converge/base';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n CateringDetailsModalComponent,\n CateringDetailsModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\nexport interface BookingFlowEvent {\n /** Type of flow event */\n type: 'previous' | 'next' | 'reset' | 'close' | 'error';\n /** Step which the event was emitted from */\n step: string;\n /** Additional metadata for the event */\n metadata?: HashMap;\n}\n\n@Component({\n selector: 'booking-catering',\n templateUrl: './catering.component.html',\n styleUrls: ['./catering.component.scss']\n})\nexport class BookingCateringComponent extends BaseDirective implements OnInit {\n /** Form fields for the booking */\n @Input() public form: FormGroup;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n @Input() public booking: Booking;\n @Input() public isOccurence: boolean;\n /** Emitter for open catering */\n @Output() public showCatering = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n dataForConfirmation: DataForConfirmation;\n isEditSeries: boolean = false;\n\n constructor(\n private _dialog: MatDialog,\n public _service: ApplicationService,\n public _bookings: BookingsService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.updateConfimatinModal();\n }\n\n /** Active order to display details for */\n public active_order: CateringOrder;\n public TopBarHeaderMode = TopBarHeaderMode;\n public confirmed: boolean = false;\n public next_disabled: boolean = true;\n\n public loading: boolean = false;\n\n\n public get building(): Building[] {\n return this.booking.room.building;\n };\n\n /** Field for storing catering details */\n public get catering_field() {\n return this.form && this.form.controls.catering ? this.form.controls.catering : null;\n }\n\n /** List of spaces selected for the booking */\n public get space_list(): Space[] {\n return this.form && this.form?.controls?.space_list?.value.length\n ? this.form.controls.space_list.value\n : [];\n }\n\n /** Date of the booking */\n public get dateTz(): number {\n return this.form && this.form.controls.dateTz\n ? this.form.controls.dateTz.value\n : DateNow(new Date()).startOfValue('minute');\n }\n\n /** Duration of the booking */\n public get duration(): number {\n return this.form && this.form.controls.duration ? this.form.controls.duration.value : 60;\n }\n\n /** Whether booking is all day */\n public get all_day(): boolean {\n return this.form && this.form.controls.all_day && this.form.controls.all_day.value;\n }\n\n\n public get type() {\n return toTitleCase(this.booking?.class);\n }\n\n public get dateString() {\n return dateBuildingFormatString(this.booking.startDateTz);\n }\n\n public get timeString() {\n return startEndTimeWithZoneFormatString(this.booking.startDateTz, this.booking?.displayEndDateTz);\n }\n\n public get durationString() {\n return humaniseDuration(this.booking?.duration);\n }\n\n public get status() {\n return bookingStatusDetails(this.booking);\n }\n\n /** Create a new catering order */\n public newOrder(): void {\n const order = new CateringOrder({ booking_timezone: this.booking?.timezone });\n this.active_order = order;\n }\n\n // Combine the same items for the same timeslot into the same order item\n public combineItems = (newItems: CateringCategory[], oldItems: CateringCategory[]) => {\n // Group and Sum the items in an Item ID keyed object\n const itemsObj = {};\n oldItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n });\n newItems.forEach((i) => {\n if (itemsObj[i.id]) {\n itemsObj[i.id].setAmount(itemsObj[i.id].amount + i.amount);\n } else {\n itemsObj[i.id] = i;\n }\n })\n // Convert the object to an array\n const items = [];\n for (const item in itemsObj) {\n items.push(itemsObj[item]);\n }\n // return the items consolidated by item ID.\n return items;\n }\n\n /** Handle changes to catering order */\n public handleOrderEvent(order: CateringOrder) {\n /* istanbul ignore else */\n if (order) {\n this.next_disabled = false;\n const orders = this.form.controls.catering.value;\n // When the order edit button is clicked we are editing an existing order\n const index = orders.findIndex((an_order) => {\n return order.id === an_order.id\n });\n\n // If editing an existing order row it will have an index, if not create a new row\n if (index < 0) {\n // Add the new order\n orders.push(order);\n } else {\n // Replace the existing order with the edited order\n orders.splice(index, 1, order);\n }\n\n // Setup the \"reduced\" data containers\n const reduceItems = {};\n const reduceOrders = {};\n orders.forEach((o) => {\n if (reduceItems[o.delivery_time]) {\n // An order for this timeslot already exists, combine the same items to dedupe rows\n reduceItems[o.delivery_time] = this.combineItems(o.items, reduceItems[o.delivery_time]);\n } else {\n // Since this is a new timeslot, use the existing items\n reduceItems[o.delivery_time] = o.items;\n // Copy the order and clear its item contents, placeholder for the updated items\n reduceOrders[o.delivery_time] = o;\n reduceOrders[o.delivery_time].items = [];\n }\n });\n\n // Add the reduced items to the reduced orders\n let consolidatedOrders = [];\n for (const deliveryTime in reduceOrders) {\n const order = reduceOrders[deliveryTime];\n order.items = reduceItems[deliveryTime]\n consolidatedOrders.push(order);\n }\n\n this.form.controls.catering.setValue(consolidatedOrders);\n }\n this.active_order = null;\n }\n\n public closeCallback() {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n\n public closeConfirmation() {\n this.event.emit();\n }\n\n /** Open modal for adding equipment requirements to booking */\n private openCateringDetailsModal() {\n const ref = this._dialog.open(\n CateringDetailsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n spaces: this.form.controls.space_list.value,\n notes_field: this.form.controls.notes,\n catering: this.form.controls.catering,\n booking: this.booking\n }\n }\n );\n this.subscription(\n 'modal_events',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n // Catering requirements and charge code modal closed event\n /* istanbul ignore else */\n if (event.reason === 'done') {\n // Closed with the reason done\n ref.close();\n\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n\n this.saveBooking();\n }\n })\n );\n ref.afterClosed().subscribe(() => this.unsub('modal_events'));\n }\n\n public saveBooking() {\n // Clone and append the catering and note data to the booking\n let booking = this.booking.clone();\n booking.catering = this.form.controls.catering.value;\n booking.notes = this.form.controls.notes.value;\n if(booking.notes.length || booking.catering.length) {\n\n const setup = { ...booking.setup };\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n booking.setup = setup;\n\n const breakdown = { ...booking.breakdown };\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n booking.breakdown = breakdown;\n }\n\n\n // Save to the API and respond. && !this.isOccurence\n this._bookings.save(booking, booking.is_recurrent ).then(\n (bkn) => {\n this.booking = new Booking({ ...this.booking, ...bkn.toApiJSON() }); \n // Stop the loading animation and show the booking confirmation component.\n this.updateConfimatinModal();\n\n this.loading = false;\n this.confirmed = true;\n this.event.emit(this.form)\n },\n (err) => {\n // Stop the loading animation and return to the catering flow with an error.\n this.loading = false;\n this.confirmed = false;\n this._service.notifyError(\n `Error updating booking.`\n );\n }\n )\n }\n\n public handleOrderListEvent($event: any) {\n const orders = this.form.controls.catering.value;\n // Handle the Previous and Next buttons\n if ($event.type === 'previous') {\n // Bail and close the catering component\n this.next_disabled = true;\n this.active_order = null;\n // Need to clone to avoid readonly errors\n this.form.controls.catering.setValue(this.booking.catering.map(order => order.clone()));\n this.event.emit();\n }\n if ($event.type === 'next') {\n // Move on to the catering details modal\n this.next_disabled = false;\n if (orders.length) {\n this.openCateringDetailsModal();\n } else {\n // Display the loading animation and the Booking Confrimation component\n this.loading = true;\n this.confirmed = true;\n this.saveBooking();\n }\n }\n }\n\n public openCatering() {\n // Start catering from the Booking Confirmation page Add Catering button\n this.confirmed = false;\n this.next_disabled = true;\n this.showCatering.emit();\n }\n\n /**\n * Public method to update the confirmation modal data.\n * This method updates the dataForConfirmation object with the necessary information\n * for displaying the confirmation modal in the application.\n */\n public updateConfimatinModal() {\n\n // Prepare an object with booking details and related information for the confirmation modal\n this.dataForConfirmation = {\n booking: this.booking, // Information about the booking\n status: this.status, // Status of the booking (e.g., confirmed, pending, etc.)\n dateString: this.dateString, // Date of the booking in string format\n endDateString: this.endDateString, // End date of the booking in string format\n timeString: this.timeString, // Time of the booking in string format\n durationString: this.durationString, // Duration of the booking in string format\n type: this.type, // Type of booking (e.g., internal, external, etc.)\n isEditSeries: this.isEditSeries, // Boolean indicating whether it's an edit in a series of events\n // Function to check if there are conflicts with occurrences of the booking\n isConflictWithOccurences: this.isConflictWithOccurences.bind(this),\n // Function to open a modal in case of conflicts with recurring events\n // openRecurrenceConflictsModal: this.openRecurrenceConflictsModal.bind(this)\n }\n }\n\n /**\n * Checks if there are conflicts with the current booking and its occurrences.\n * Calculates the difference between total occurrences and available occurrences\n * to determine if there are conflicts.\n *\n * @returns {Object} An object containing conflict information:\n * - is_conflict: A boolean indicating if there are conflicts (true if conflicts exist, false otherwise).\n * - total_Conflicts: The total number of conflicts (the difference between total occurrences and available occurrences).\n */\n // public isConflictWithOccurences() {\n // const conflicts = this?.booking?.room?.totalOccurrences - this?.booking?.room?.availableOccurrences;\n // return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n // }\n\n public isConflictWithOccurences() {\n let totalConflicts = 0;\n \n this.booking.multi_rooms.forEach(room => {\n totalConflicts += Math.max(room.totalOccurrences - room.availableOccurrences, 0);\n });\n \n\n const result = {\n is_conflict: totalConflicts > 0, \n total_Conflicts: totalConflicts \n };\n return result;\n }\n\n /**\n * Retrieves the end date string for the booking, considering recurrence if applicable.\n * If the booking is recurrent, it calculates the end date based on recurrence starts;\n * otherwise, it uses the booking's start date as the end date.\n *\n * @returns {string} The formatted end date string in a shorter local date format.\n */\n public get endDateString(): string {\n // Determine the array of date-time strings based on recurrence or single start date\n let recurrenceStart: Array= [];\n const { is_recurrent, recurrence_starts, occurrence_details, timezone} = this.booking;\n if(is_recurrent && recurrence_starts.length) {\n recurrenceStart = this.booking.recurrence_starts;\n }\n else if(is_recurrent && !recurrence_starts.length && occurrence_details.length) {\n this.booking.occurrence_details.forEach(element => {\n recurrenceStart.push(new DateTZ({ date: element.start_epoch * 1000, is_local_tz: false, building_tz: timezone}));\n });\n recurrenceStart = recurrenceStart.sort((d1: DateTZ, d2: DateTZ) => d1.ms - d2.ms);\n }\n else {\n recurrenceStart = [this.booking.startDateTz];\n }\n\n\n // const endDtz = (this.booking.is_recurrent && this.booking.recurrence_starts.length) ? this.booking.recurrence_starts : [this.booking.startDateTz]\n // Get the last date from the list of date-time strings and format it in a shorter local date format\n return shorterLocalDateFormatString(getLastDateFromList(recurrenceStart));\n }\n\n}\n","
\n
\n \n \n
\n
\n
\n
\n \n \n \n
\n \n \n \n
\n
\n \n
\n
\n
","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport { CateringCategory } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-category-display',\n templateUrl: './category.component.html',\n styleUrls: ['./category.component.scss']\n})\nexport class CateringMenuCategoryComponent {\n /** Category to display details for */\n @Input() public category: CateringCategory;\n /** Form control for the list of order items */\n @Input() public items: FormControl;\n /** Currency symbol for the active space */\n @Input() public symbol: string;\n /** Whether item should be disabled if not available anytime */\n @Input() public disabled: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for close events */\n @Output() public close = new EventEmitter();\n}\n","
\n
\n \n
{{ category?.name }}
\n
\n
\n\n
\n \n
\n
\n\n
\n
\n \n
\n
\n Category contains no available items\n
\n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n FormControl,\n FormGroup\n} from '@angular/forms';\nimport { BehaviorSubject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n Building,\n CateringCategory,\n CateringItem,\n CateringMenuService,\n CateringOrder,\n OrganisationService,\n Space\n} from '@mckinsey-converge/data-common';\nimport {\n DialogEvent,\n Identity\n} from '@mckinsey-converge/base';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n BookingCateringConfirmModalComponent,\n CateringConfirmModalData\n} from '@mckinsey-converge/legacy-overlays';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n\ninterface StartEndResponse {\n timezone: string,\n start: DateTZ;\n end: DateTZ\n}\n\n@Component({\n selector: 'a-catering-order-details',\n templateUrl: './order-details.component.html',\n styleUrls: ['./order-details.component.scss']\n})\nexport class BookingCateringOrderDetailsComponent extends BaseDirective implements OnInit {\n /** Catering order to edit details of */\n @Input() public order: CateringOrder;\n /** Booking date */\n @Input() public dateTz: DateTZ;\n /** Booking duration */\n @Input() public duration: number;\n /** Booking duration */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether top header details should be shown */\n @Input() public hide_details: boolean;\n /** Whether to show smaller version of component */\n @Input() public compact: boolean;\n /** Emitter for changes to the catering order */\n @Output() public event = new EventEmitter();\n /** Form controls for order */\n public form: FormGroup;\n /** List of available catering item categories */\n public category_list: CateringCategory[] = [];\n /** Active category to display details for */\n public active_category: CateringCategory;\n /** List of available times for delivering catering */\n public available_times: Identity[] = [];\n /** Whether the menu is loading */\n public loading: boolean;\n /** Whether the search input should be shown */\n public show_search: boolean;\n /** Current search string for filtering */\n public readonly search$ = new BehaviorSubject('');\n /** List of menu items that match the search string */\n public matched_items: CateringItem[] = [];\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n @ViewChild('input') private _input_el: ElementRef;\n\n /** Whether user is able to order from the currently selected space */\n public get can_order(): boolean {\n return (\n (this.active_building.has_catering || this.category_list.length) &&\n (!this.within_restricted_time || this.has_available_items) &&\n !this.out_of_hours\n );\n }\n\n /** Building associated with the selected space */\n public get active_building(): Building {\n const form_controls = (this.form || { controls: { location_id: { value: '' } } }).controls;\n const space: Space =\n this.space_list.find((space) => space.email == form_controls.location_id.value) ||\n ({ level: {} } as any);\n return (\n this._org.buildings.find((bld) => space.level?.building_id === bld.id) ||\n ({ catering_restricted_from: 0 } as any)\n );\n }\n\n /** Currency code for the active building */\n public get symbol(): string {\n return this.active_building.currency || 'USD';\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n return this.form\n ? this.form.controls.items.value.reduce((total, item) => total + item.amount, 0)\n : 0;\n }\n\n /* istanbul ignore next */\n /** Whether booking time is outside of catering hours */\n public get out_of_hours(): boolean {\n return this.form.controls.delivery_time.value < 0;\n }\n\n /** Whether booking is with the restricted ordering period */\n public get within_restricted_time(): boolean {\n const expired = DateNow(new Date()).addValue({ hours: this.active_building.catering_restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n }\n\n /** Whether booking is with the restricted ordering period */\n public within_category_restricted_time(item?: CateringItem ): boolean {\n /**\n * Update : https://mckinsey.atlassian.net/browse/CNG-574\n * Right now the frontend is restricting catering orders based off the field .settings.discovery_info.catering_restricted_from,\n * so for this ticket change it’s best we keep that field as the default time restriction, then add a new field to catering categories called \n * restricted_from which will override the old field if it’s present!\n * restricted_from can be set by concierge admin to restrict item from being order before set time ex if it been set to 24 then the item should\n * available to order before 24 hours of booking/order time!\n */\n\n if(!!item?.restricted_from) {\n const expired = DateNow(new Date()).addValue({ hours: item?.restricted_from }).startOfValue('minute');\n return this.dateTz.isBeforeDate(expired);\n } else {\n return false;\n }\n \n }\n\n /** Whether items are available for order at anytime */\n public get has_available_items(): boolean {\n return this.category_list.reduce(\n (available, category) => available || category.can_order_anytime,\n false\n );\n }\n\n constructor(\n private _menu: CateringMenuService,\n private _org: OrganisationService,\n private _dialog: MatDialog\n ) {\n super();\n }\n\n public ngOnInit(): void {\n this.generateAvailableTimes();\n this.subscription('search', this.search$.pipe(map((str) => {\n const search = str.toLowerCase();\n const items = [];\n const available_categories = this.category_list.filter(item => !item.within_category_restricted_time(this.dateTz) )\n\n for (const category of available_categories) {\n if (category.items) {\n for (const group of category.items) {\n if ((group as any).items.length) {\n if (\n (group as any).package &&\n (group.name.toLowerCase().includes(search) ||\n (group as any).items.find((item) =>\n item.name.toLowerCase().includes(search)\n ))\n ) {\n items.push(group);\n } else {\n for (const item of (group as any).items) {\n if (item.name.toLowerCase().includes(search)) {\n items.push(item);\n }\n }\n }\n } else {\n if (group.name.toLowerCase().includes(search)) {\n items.push(group);\n }\n }\n }\n }\n }\n \n return items;\n })).subscribe((items) => this.matched_items = items));\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (changes.date || changes.duration) {\n this.generateAvailableTimes();\n /* istanbul ignore else */\n if (\n this.form &&\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n /* istanbul ignore else */\n if (changes.space_list) {\n /* istanbul ignore else */\n if (this.form && this.space_list && !this.form.controls.location_id.value) {\n this.form.controls.location_id.setValue(this.space_list[0].email);\n }\n }\n /* istanbul ignore else */\n if (changes.order && this.order) {\n this.initForm();\n }\n }\n\n public focusSearch() {\n if (this._input_el && this.show_search) {\n this._input_el.nativeElement.focus();\n }\n }\n\n public initForm() {\n this.form = new FormGroup({\n id: new FormControl(this.order.id),\n booking_date: new FormControl(\n this.all_day ? this.dateTz.startOfValue('day').ms : this.dateTz.ms\n ),\n location_id: new FormControl(this.order.location_id || this.space_list[0]?.email),\n delivery_time: new FormControl(this.order.delivery_time || this.available_times[0].id),\n items: new FormControl(this.order.items.map((item) => new CateringItem(item)))\n });\n this.subscription(\n 'space_change',\n this.form.controls.location_id.valueChanges.subscribe((space) => {\n this.generateAvailableTimes();\n if (\n !this.available_times.find(\n (time) => time.id === this.form.controls.delivery_time.value\n )\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n this.form.controls.items.setValue([]);\n this.loadMenu();\n })\n );\n this.loadMenu();\n this.generateAvailableTimes();\n if (\n this.form &&\n !this.available_times.find((time) => time.id === this.form.controls.delivery_time.value)\n ) {\n this.form.controls.delivery_time.setValue(this.available_times[0].id);\n }\n }\n\n public confirmOrder() {\n const ref = this._dialog.open(BookingCateringConfirmModalComponent, {\n maxWidth: '95vw',\n data: {\n all_day: this.all_day,\n dateTz: this.dateTz,\n form: this.form\n }\n });\n this.subscription(\n 'confirm_event',\n ref.componentInstance.event.subscribe((event: DialogEvent) => {\n /* istanbul ignore else */\n if (event.reason === 'done') {\n const order = new CateringOrder({ ...this.order, ...this.form.value });\n // order is emited but who is receiving?\n this.event.emit(order);\n ref.close();\n }\n })\n );\n ref.afterClosed().subscribe(() => {\n this.unsub('confirm_event');\n });\n }\n\n private loadMenu() {\n const space = this.space_list.find(\n (space) => space.email === this.form.controls.location_id.value\n );\n\n this.loading = true;\n this._menu\n .query({ zone_id: this._org.buildings.find((bld) => space?.zones.includes(bld.id))?.id })\n .then(\n (list) => {\n this.loading = false;\n this.category_list = list.map((i) => new CateringCategory(i))\n .filter(c => !c.out_of_stock);\n },\n () => (this.loading = false)\n );\n }\n\n /** Generate a list of available delivery times for the given booking time */\n private generateAvailableTimes() {\n let { timezone, start, end } = this.generateStartAndEndTimes();\n start = start.setValue({ minute: Math.ceil(start.minutes / 5) * 5 });\n // will be different from staff in these commonly named methods.\n const start_date = this.dateTz;\n this.available_times = [];\n while (start.isBeforeDate(end)) {\n this.available_times.push({\n id: Math.abs(start_date.dateDiff(start, 'minutes')),\n name: start.formatDate('h:mma').toLocaleLowerCase(),\n });\n start = start.addValue({ minutes: 5 });\n }\n /* istanbul ignore else */\n if (this.available_times.length === 0) {\n this.available_times.push({ id: -1, name: 'Out of hours' });\n }\n }\n\n private generateStartAndEndTimes(): StartEndResponse {\n const now = DateNow(new Date())\n let timezone = now.local_tz;\n const space_email = this.form ? this.form.controls.location_id.value : null;\n let catering_hours = { start: 7, end: 20 };\n let building_time = this.dateTz.startOfValue('day');\n let cat_start_time = building_time.addValue({ hours: catering_hours.start });\n let cat_end_time = building_time.addValue({ hours: catering_hours.end });\n\n if (space_email) {\n // Fetch the Space and Building\n const space = this.space_list.find((space) => space.email === space_email);\n const building = this._org.buildings.find((bld) => space?.zones.includes(bld.id));\n if (building.timezone) {\n // Update to the building timezone if defined.\n timezone = building.timezone;\n building_time = this.dateTz.toZone(timezone).startOfValue('day');\n }\n if (building?.catering_hours) {\n // Update to the building catering hours if defined.\n catering_hours = building?.catering_hours;\n }\n // Update the hours with the currently defined timezone.\n cat_start_time = building_time.addValue({ hours: catering_hours.start });\n cat_end_time = building_time.addValue({ hours: catering_hours.end });\n }\n\n // Start Time of the Booking\n let start = this.dateTz.toZone(timezone);\n let end = this.dateTz.toZone(timezone).addValue({ minutes: this.duration });\n\n // Do the booking start and end time coincide with the catering hours?\n if (start.isBeforeDate(cat_start_time)) {\n // booking start before catering opens'\n if (cat_end_time.isAfterDate(start)) {\n // catering closes after booking starts'\n start = cat_start_time.addValue({});\n } else {\n // were just closed, catering closes before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking starts after catering is open'\n if (cat_end_time.isBeforeDate(start)) {\n // were just closed, catering closed before booking start'\n start = cat_end_time.addValue({});\n end = cat_end_time.addValue({});\n return { timezone, start, end };\n }\n }\n\n if (end.isBeforeDate(cat_end_time)) {\n // booking ends before catering closes'\n if (cat_start_time.isAfterDate(end)) {\n // were just closed, catering opens is after booking ends'\n start = cat_start_time.addValue({});\n end = cat_start_time.addValue({});\n return { timezone, start, end };\n }\n } else {\n // booking ends after catering closes'\n // set the booking end to the catering close time.'\n end = cat_end_time.addValue({});\n }\n\n return { timezone, start, end };\n }\n}\n\n","
\n
\n
\n
\n
Deliver to:
\n \n \n \n {{ space.local_name }}\n \n \n \n
\n
\n
At:
\n \n \n \n {{ time.name }}\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n \n \n
\n \n
\n
{{ item.name }}
\n \n
\n
\n
\n
\n
\n
\n \n Back\n \n \n Confirm Order({{ item_count || '0' }})\n \n
\n
\n
\n\n
\n
\n \"No\n
\n

\n Catering is not available for this booking.
\n Catering must be ordered within business hours at {{ active_building?.name }}.\n

\n
\n
\n\n
\n
\n
\n \n
\n
\n Loading menu for {{ active_building?.name }}...\n
\n
\n
\n
\n\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\n\nimport {\n CateringOrder,\n Space,\n SpacesService\n} from '@mckinsey-converge/data-common';\nimport { DateNow } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'catering-order-list-item',\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss']\n})\nexport class CateringOrderListItemComponent implements OnInit {\n /** Catering order to display */\n @Input() order: CateringOrder;\n /** */\n @Input() public space_list: Space[];\n /** Selected datetime */\n @Input() date: number = DateNow(new Date()).ms;\n /** Emitter for edit events */\n @Output() public edit = new EventEmitter();\n /** Emitter for delete events */\n @Output() public delete = new EventEmitter();\n\n public room: Space;\n\n public ngOnInit(): void {\n this.room = (this.space_list || []).find(space => space.email === this.order.location_id);\n }\n\n public get space_in_booking(): boolean {\n return !!this.room;\n }\n\n /** Space selected for delivery */\n public get local_space_name(): string {\n return this.room?.local_name || '';\n }\n\n /** Delivery time for the order */\n public get delivery_time(): string {\n /* istanbul ignore else */\n if (!this.order) {\n return '';\n }\n\n // R--- there's probably a helper for this calculation on the Catering Order \n return this.order.bookingDateTz.addValue({ minutes: this.order.delivery_time || 0 }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n /** Total cost of the order */\n public get order_cost(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount * item.unit_price, 0);\n }\n\n /** Number of items in the order */\n public get item_count(): number {\n const items = (this.order || { items: [] }).items as any;\n return items.reduce((amount, item) => amount + item.amount, 0);\n }\n\n /** Currency symbol for the selected space */\n public get symbol(): string {\n /* istanbul ignore else */\n if (!this.room || !this.room.level) {\n return 'USD';\n }\n\n return this.room?.building?.currency || 'USD';\n }\n\n constructor(private _spaces: SpacesService) {\n }\n}\n","
\n Deliver to {{ local_space_name }} at {{ delivery_time }}\n
\n
\n
\n {{ item_count }}\n { item_count, plural, =1 { item } other { items } }\n
\n
{{ order_cost / 100 | currency: symbol }}
\n
\n
\n \n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport {\n CateringOrder,\n Space\n} from '@mckinsey-converge/data-common';\nimport { BookingFlowEvent } from '../../catering/catering.component';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\n\n\n@Component({\n selector: 'a-catering-order-list',\n templateUrl: './order-list.component.html',\n styleUrls: ['./order-list.component.scss']\n})\nexport class BookingCateringOrderListComponent {\n /** Form field for storing catering orders */\n @Input() public catering: FormControl;\n /** Selected datetime for the booking */\n @Input() public date: number;\n /** */\n @Input() public space_list: Space[];\n /** Whether booking is all day */\n @Input() public all_day: boolean;\n /** Whether booking is all day */\n @Input() public next_disabled: boolean;\n /** Emitter for flow update events */\n @Output() public event = new EventEmitter();\n /** Emiiter for order events */\n @Output() public order = new EventEmitter();\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n \n public delete: boolean = false;\n\n /** List of orders in the booking */\n public get orders(): CateringOrder[] {\n /* istanbul ignore else */\n if (!this.catering) {\n return [];\n }\n let orders = [];\n const date_ = new DateTZ({date: this.date})\n this.catering.value.forEach(\n order => {\n const newOrder = order;\n newOrder.booking_date = this.all_day\n ? date_.startOfValue('day').ms\n : this.date;\n orders.push(newOrder);\n }\n \n );\n return orders;\n }\n\n /** Emit event for a new catering order */\n public newOrder() {\n this.order.emit();\n }\n\n /** Emit event for editing existing order */\n public editOrder(order: CateringOrder) {\n this.order.emit(order);\n }\n\n /** Remove order from the list */\n public deleteOrder(order: CateringOrder) {\n const orders = this.orders;\n const index = orders.findIndex(an_order => order.id === an_order.id);\n /* istanbul ignore else */\n if (index >= 0) {\n orders.splice(index, 1);\n this.catering.setValue(orders);\n this.delete = true;\n }\n }\n\n /**\n * Proceed to the next step in the space booking flow\n */\n public next(): void {\n // Open the confirmation modal\n this.event.emit({ type: 'next', step: 'catering' });\n }\n\n /** Move flow to previous step */\n public previous(): void {\n this.event.emit({ type: 'previous', step: 'catering' });\n }\n}\n","
\n
\n

Catering Orders

\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n Back\n \n \n Next\n \n
\n
\n
\n\n
\n
\n \n
\n
No catering orders
\n \n
\n
\n","import {\n Component,\n Input,\n} from '@angular/core';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'catering-order-table',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n Delivery\n Charge CodeOrder
\n {{formatDeliveryTime(order)}}\n \n {{order?.charge_code}} \n \n {{listItems(order)}}\n
\n
\n `,\n styleUrls: ['./order-table.component.scss']\n})\nexport class OrderTableComponent extends BaseDirective {\n /** The theme to use **/\n @Input() public booking: Booking;\n\n public listItems(order) {\n return order.items.map(i => `${i.name}${i.amount > 1 ? ` (${i.amount})` : ''}`).join(', ');\n }\n\n public formatDeliveryTime(order) {\n return this.booking.startDateTz.addValue({ minutes: order?.delivery_time }).formatDate('h:mma').toLocaleLowerCase();\n }\n\n public oddEvenClass(x) {\n return x % 2 === 0 ? 'odd' : 'even';\n }\n}\n","import {\n Component,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnInit\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport {\n User,\n Booking,\n Building,\n BuildingCity,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectUpcomingBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n selectBookingByIdResultsFromState,\n UsersService,\n} from '@mckinsey-converge/data-common';\nimport {\n clearBookingByIdResults,\n} from '@mckinsey-converge/bookings';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n first,\n map,\n take,\n} from 'rxjs/operators';\nimport { loadBookingsWithQuery } from '@mckinsey-converge/bookings';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport {\n SelectOption\n} from '@mckinsey-converge/ui';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { RoomBookingStoreState } from '../room-booking/room-booking.component';\nimport { MatTabChangeEvent } from '@angular/material/tabs';\nimport { SearchBarConfig } from 'libs/legacy-ui/src/lib/cng-search-bar/cng-search-bar.component';\n\n\n@Component({\n selector: 'app-manage-bookings',\n template: `\n
\n
 
\n
\n \n
\n
\n
\n
\n

Manage Bookings

\n\n
\n \n \n
\n \n
\n \n
\n\n\n \n \n
\n \n \n \n
\n
\n\n
\n
\n
\n
\n `,\n styleUrls: ['./manage-bookings.component.scss']\n})\nexport class ManageBookingsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public buildings = new BehaviorSubject[]>([]);\n public bookingTypes = [\n {\n type: 'upcoming',\n display: 'Upcoming',\n selector: selectUpcomingBookingsResultsFromState\n },\n {\n type: 'past',\n display: 'Past',\n selector: selectPastBookingsResultsFromState\n },\n {\n type: 'cancelled',\n display: 'Cancelled',\n reverse_sort: true,\n selector: selectCancelledBookingsResultsFromState\n },\n ];\n\n /** Current User */\n public currentUser: User;\n public dialogRef: MatDialogRef;\n public modalInitialized = false;\n public hasLoaderUrl = true;\n\n public activeTab = 'upcoming';\n\n /**\n * Configs for delegate dropdown\n */\n /* if user has no delegates, hide the dropdown */\n public has_delegate: boolean = false; \n /* Holds list of all host/delegates */\n public host_list: User[];\n public hostOptions: { display: string; value: string; meta: { user: User; }; }[];\n public delegateDD: { ddBoxClass: string; options: any; defaultSelected: any; onChangeCallback: any; ddOptionBoxWidth: string };\n public selectedHost: string = '';\n\n public searchBookingBy: any = '';\n\n\n searchBarConfig: SearchBarConfig = {\n placeholder: 'Search by title, room name, attendees...',\n totalFoundItem: 0,\n showSrchWarning: false\n };\n\n constructor(\n private dialog: MatDialog,\n private store: Store,\n private route: ActivatedRoute,\n private _router: Router,\n private _users: UsersService,\n ) {\n super();\n }\n\n public ngOnInit(): void {\n\n // Get the router params\n const bookingId = this.route.snapshot.paramMap.get('id');\n const verb = this.route.snapshot.paramMap.get('verb');\n // Load the buildings data\n this.store.dispatch(loadOrganisations.request());\n this.route.data.subscribe(initData => {\n // Determine if the cancel or booking submodal is loading\n const cancel = verb === 'cancel';\n const addCatering = initData.hasCatering;\n /**\n * When using the catering or cancel URLs,\n * Users reported the modals loading after one another was\n * jarring so, so the UI is masked out until the modal is loaded.\n */\n this.hasLoaderUrl = addCatering || cancel;\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n if (bookingId && !this.modalInitialized) {\n this.store.dispatch(clearBookingByIdResults())\n this.modalInitialized = true;\n // Once the data loads viewBooking\n this.subscription('bookingResults', this.store.pipe(\n select(selectBookingByIdResultsFromState)\n ).subscribe(next => {\n const booking = next.success ? next.success?.[0] : null;\n if (booking && booking.room) {\n // Modal Madness, close the existing booking details modals.\n if (this.dialogRef) {\n this.dialogRef.close();\n }\n if (this.dialog) {\n this.dialog.closeAll();\n }\n // Call viewBookingFromEmailLink with cancel = true to trigger the cancel modal\n // Call viewBookingFromEmailLink with addCatering = true to trigger the add Catering modal\n this.viewBookingFromEmailLink(booking, cancel, addCatering);\n\n // Remove the \"loader\" url from view\n this.timeout('rewrite url',() => {\n this._router.navigate(['/home','manage'], { replaceUrl: true });\n })\n }\n }));\n }\n }));\n\n })\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n if (bookingId) {\n // If there's a booking ID loadBookingById\n this.store.dispatch(loadBookingsWithQuery({ 'id': bookingId, 'email': this.currentUser.email, 'target': 'bookingById', 'offset': 0 }));\n }\n }));\n\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n\n const delegates = user.delegates.map((del) => {\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n });\n\n if (delegates.length) {\n this.has_delegate = true;\n\n this.host_list = [user].concat(delegates);\n const options = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }))\n \n this.hostOptions = [{ display: 'All', value: '', meta: { user: null } }].concat(options);\n this.selectedHost = this.hostOptions[0].value;\n this.delegateDD = {\n ddBoxClass: '',\n options: this.hostOptions,\n defaultSelected: this.hostOptions[0],\n onChangeCallback: this.onChangeDelegates.bind(this),\n ddOptionBoxWidth: '200px'\n }\n }\n \n });\n }\n\n public onChangeDelegates(del) {\n this.selectedHost = del.value;\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return null;\n }\n\n // Only fires from an email link\n public viewBookingFromEmailLink(booking: Booking, cancel: boolean = false, addCatering: boolean = false) {\n if (this.modalInitialized && this.dialogRef) {\n this.dialogRef.close();\n this.dialogRef = null;\n }\n // R--- Verify the email links are working.\n // Open the booking details modal\n if (!this.dialogRef && booking.room) {\n this.dialogRef = this.dialog.open(BookingDetailsModalComponent, {\n panelClass: 'mck-modal-wide-manage-booking',\n data: {\n booking,\n building: this.getBuilding(booking),\n cancel,\n addCatering,\n hasLoaderUrl: this.hasLoaderUrl,\n refresh: () => null\n },\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n // Close up the loader panel\n setTimeout(() => {\n this.hasLoaderUrl = false;\n }, 1000);\n }\n }\n\n public clearPage(event : MatTabChangeEvent) {\n this.activeTab = this.bookingTypes[event.index].type;\n this._router.navigate([], { relativeTo: this.route, queryParams: { page: 1 } });\n }\n\n\n searchBooking(value) {\n this.searchBookingBy = value;\n }\n\n}\n","import {\n Booking\n} from '@mckinsey-converge/data-common';\n\n\nexport class BookingResultsViewModel {\n constructor(public booking: Booking) {\n }\n}\n\n/**\n * For each result from results, we find its level and building from the lists.\n */\nexport const mapResultsToViewModels = (results: Booking[]): BookingResultsViewModel[] => {\n if (!results || !results[0]?.space) {\n return [];\n }\n return results.map((booking: Booking) => {\n return new BookingResultsViewModel(\n booking,\n );\n }); \n}\n\n","import { Component, Inject, OnInit, ViewEncapsulation, ElementRef, Input, ViewChild, ChangeDetectorRef } from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n BookingStoreState,\n User,\n Booking,\n BookingFormData,\n BOOKING_STATUS,\n checkCollisions,\n SpacesService,\n BookingsService,\n BookingStateService,\n clearBookingFormData,\n ApplicationService,\n selectFilteredByIdResults,\n FilteredSpaces,\n selectActiveForm,\n roomFormDataToQuery,\n storeBookingFormData,\n getNextFreeBookingSlot,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\nimport { DateTime } from 'luxon';\nimport { Point, BaseDirective, closestToTimeSlot, HashMap, closestToTimeSlotTz } from '@mckinsey-converge/base';\nimport { BehaviorSubject, Observable, interval, timer, of } from 'rxjs';\nimport { CENTER_POINT, MIN_ZOOM_LEVEL } from 'src/app/map/map.utils';\nimport { Store, select } from '@ngrx/store';\nimport { RoomStoreState, loadByIdResults, loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { delay, map, take } from 'rxjs/operators';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\n// import { WAITING_TIME } from '../floor-map.utils'; // commented and re declare below due to circular dependency overlay > util > overlay\n\nexport const WAITING_TIME = 15;\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel;\n parentComponent?: any;\n roomObs?: Observable\n}\n\ninterface InProgressRoomBookingTimeInfo {\n\tcurrentStatus: string,\n\tactiveBookings: Booking[],\n\ttimeUntilNextBooking: number,\n\ttimeRemainingInActiveBooking : number,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'foor-map-overlay',\n template: `\n
\n
\n\n
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \t\n
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tThis room is available\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tRoom {{ data.simple_name || data.name || '' }} is available for booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tBook now for:\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tUntil next booking\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Available if you book in the next {{minutesRemaining}}:{{secondsRemaining}} minutes\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tRefresing availability ...\n\t\t\t\t\t\t\t
\n \t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\tThis room is booked\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t Apologies, this room has been booked recently by another user, please try another one. \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n
\n
\n
\n `,\n styleUrls: ['./floor-map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class FloorMapOverlayComponent extends BaseDirective implements OnInit {\n public selectedRoomId = this.data.id;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public center = new BehaviorSubject(CENTER_POINT);\n\n public date = DateTime.now().valueOf();\n /** Current User */\n public currentUser: User;\n\n public availableUntil = parseInt(this.data?.settings?.available_until.toString()) * 1000;\n public diff: any;\n\n public latestBooking: any[];\n public latestBookingStartTime: string;\n public diffInHours: number;\n public diffInMinutes: number;\n public booking: Booking = new Booking({});\n public loading: boolean;\n public bookingData = new BehaviorSubject(undefined);\n public confirmed: boolean = false;\n /** Whether booking has succeeded */\n public success: boolean;\n public diffInMs: number;\n public futureBookingsForTheDay: HashMap[];\n public untilNextBookingFlag: boolean = false;\n public start_epoch: any;\n public end_epoch_15: any;\n public end_epoch_30: any;\n\n public userSelectedRoom: RoomResultsViewModel;\n\n // @ViewChild('time', { static: false }) public time: ElementRef;\n public isTimerActive: boolean = true;\n minutesRemaining: number | string;\n secondsRemaining: number | string;\n isAvailable: boolean = true;\n intervalCall_15: any;\n intervalCall_1: any ;\n\t\ttimerIndex = 0;\n\t\tpublic currentMin;\n\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n private elementRef: ElementRef,\n public store: Store,\n public _spaces: SpacesService,\n public _bookings_service: BookingsService,\n public _booking_state_service: BookingStateService,\n public _service: ApplicationService,\n // public cdRef: ChangeDetectorRef,\n ) {\n super();\n }\n\n public updateRoomData(space) {\n\n\t\t\t\t\t\t// get all booking of selected room\n this.fetchRoomWithBookings(false);\n\n\t\t\t\t\t\t// subscrip selected room detail with all bookings for the day\n this.subscription(\n 'bookingSpaceResults',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n if (next.success.spaces) {\n\n space.space = next.success.spaces[0];\n this.userSelectedRoom = space;\n\n this.isTimerActive = true;\n\n this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n\n\t\t\t\t\t\t\t\t\t\t\t\t//Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t\t\t\t\t\t\t\t\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t\t\t\t\t\t\t\t\t\tthis.diff = timeUntilNextBooking\n // inform user if space has been booked by other\n if( currentStatus !== 'available') {\n if(activeBookings.length && timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 ) {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n } else {\n this.isAvailable = false;\n this.intervalCall_1?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n }else {\n this.setupTimer();\n // this.isAvailable = true;\n //update up start and end epoch times for a booking button options\n this.updateSchedulingEpochs();\n }\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Determine available time until next booking start time\n this.determineNextBookingStartTime();\n }\n })\n );\n\n }\n\n\t\t/**\n\t\t * Retrive and calculate reamining time related information for the selected room and its upcomming bookings\n\t\t * @returns\n\t\t */\n\t\tpublic calculateRoomBookingTimeInfo(): InProgressRoomBookingTimeInfo {\n\n\t\t\tconst now: any = DateNow(new Date()); // current date time\n\n\t\t\t// Retirive a list of bookings and map them to booking objects\n\t\t\tconst bookings = this.userSelectedRoom.space.settings.bookings.map(b => new Booking(b));\n\n\t\t\t// Filter active/in-progress bookings based on the current time\n\t\t\tconst activeBookings = bookings.filter(booking =>\n\t\t\t\t\t\tnow.isAfterDate(booking.startDateTz.startOfValue('second')) &&\n\t\t\t\t\t\tnow.isBeforeDate(booking.endDateTz.startOfValue('second') )\n\t\t\t);\n\n\t\t\t// Retrive the status of the selected room from parent component data\n\t\t\tconst currentStatus = this.data.parentComponent.roomStatus.statusMap[this.selectedRoomId]; // \" 'available' / 'in-use'\"\"\n\n\t\t\t// Initialize the variable to track time-related information\n\t\t\tlet timeRemainingInActiveBooking = 0; // The remaining time in the active booking in milliseconds\n\t\t\tlet timeUntilNextBooking = 30; // Time until the start of the next booking minutes\n\n\t\t\t// Check if ther are active bookings (room is 'in-use')\n\t\t\tif(activeBookings.length) {\n\t\t\t\tconst nowTime: any = DateTime.now()\n\t\t\t\t// Calculate the time remaining in the active booking in minutes\n\t\t\t\ttimeRemainingInActiveBooking = Math.abs(Math.round((activeBookings[0].end_epoch * 1000 - nowTime.ts) / 60000));\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n\t\t\t\tconst addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// calculate the start time of the next booking in the same time slot\n\t\t\t\tconst nextBookingStartTime: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n\n\t\t\t\t// Filter futute booking for the day to find the next booking\n\t\t\t\tconst futureBookingsForTheDay = this.userSelectedRoom.space?.settings?.bookings.filter((item) =>\n\t\t\t\t\titem.start_epoch * 1000 >= nextBookingStartTime.ts\n\t\t\t\t);\n\n\t\t\t\t// Check if there is an futute booking for the day\n\t\t\t\tif(futureBookingsForTheDay.length) {\n\t\t\t\t\t// calculate the time until start of the next booking in minutes\n\t\t\t\t\tconst nextBookingStartTimeMs = futureBookingsForTheDay[0].start_epoch * 1000;\n\t\t\t\t\ttimeUntilNextBooking = Math.floor((nextBookingStartTimeMs - nowTime.ts) / (1000 * 60));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t\t\t\tcurrentStatus: currentStatus,\n\t\t\t\t\t\t\tactiveBookings: activeBookings,\n\t\t\t\t\t\t\ttimeUntilNextBooking: timeUntilNextBooking,\n\t\t\t\t\t\t\ttimeRemainingInActiveBooking : timeRemainingInActiveBooking,\n\t\t\t\t\t\t};\n\n\t\t}\n\n public setup15MinTimer() {\n //interval for 15 min\n !this.timerIndex && setTimeout(()=>this.setUpTime(), 1100 ) ;\n this.timerIndex++\n this.intervalCall_15 = window.setInterval(\n () => { this.intervalCall_1?.unsubscribe(); setTimeout(()=>this.setUpTime(), 1100 ) }\n , ( 1000 * 60 * WAITING_TIME ) );\n\n\n }\n\n public setUpTime() {\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute'));\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME)\n // console.log(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second'))\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n let start:any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME);\n start = start.toLocaleString(DateTime.TIME_SIMPLE);\n if(start !== this.start_epoch ) {\n\n this.start_epoch = start;\n\n // this.availableUntil = parseInt(this.userSelectedRoom.space.settings.available_until.toString()) * 1000;\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(this.availableUntil);\n // this.diff = Math.abs(Math.round((endTime.getTime() - currentTime.getTime()) / 60000));\n\n const addMin = DateTime.now().get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n\n }\n\n\t\t\t\t\t\t//update up start and end epoch times for a booking button options\n\t\t\t\t\t\tthis.updateSchedulingEpochs()\n\n // let end_15: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 15 });\n // end_15 = end_15.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_15 !== this.end_epoch_15) {\n // this.end_epoch_15 = end_15\n // }\n\n // let end_30: any = closestToTimeSlot(DateTime.now().plus({ minutes: addMin, seconds:0 }).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).plus({ minutes: 30 });\n // end_30 = end_30.toLocaleString(DateTime.TIME_SIMPLE);\n // if(end_30 !== this.end_epoch_30) {\n // this.end_epoch_30 = end_30;\n // }\n }\n\n public ngOnInit(): void {\n this.fetchRoomWithBookings(false);\n\n this.data.parentComponent.childCallback = this.updateRoomData.bind(this);\n this.userSelectedRoom = this.data?.room;\n\t\t\t\tthis.updateSchedulingEpochs();\n this.updateRoomData(this.userSelectedRoom);\n\t\t\t\t// Determine available time until next booking start time\n // this.determineNextBookingStartTime();\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n //update up start and end epoch times for a booking button options\n // this.updateSchedulingEpochs();\n this.data.parentComponent.isOverlayOpened = true;\n }\n\n /**\n * This function sets up start and end epoch times for a booking scheduling system.\n * It calculates and assigns various epoch times based on the current time,\n * available until time, and user-selected room's timezone.\n */\n public updateSchedulingEpochs() {\n\n\t\t\tconst now: any = DateTime.now();\n\n\t\t\t// Calculate the time difference in minutes between current and available until time\n\t\t\tconst {currentStatus, activeBookings, timeRemainingInActiveBooking, timeUntilNextBooking} = this.calculateRoomBookingTimeInfo();\n\t\t\t// this.diff = Math.abs(Math.round((this.availableUntil - now.ts) / 60000)); // recheck\n\t\t\tthis.diff = timeUntilNextBooking;\n\n\t\t\t// Determine system availability based on time difference\n\t\t\tthis.isAvailable = timeRemainingInActiveBooking < 15 && timeUntilNextBooking >= 15 // this.diff >= 15;\n\n\t\t\t// Calculate the next time slot for scheduling\n\t\t\tconst addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\t\t\tconst adjustedTime = now.plus({ minutes: addMin, seconds: 0 }).setZone(this.userSelectedRoom?.building?.timezone);\n\n\t\t\t// Calculate and assign the start and end epoch times with 15 and 30-minute intervals\n\t\t\tconst timeSlot = closestToTimeSlot(adjustedTime, WAITING_TIME);\n\t\t\tthis.start_epoch = timeSlot.toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_15 = timeSlot.plus({ minutes: 15 }).toLocaleString(DateTime.TIME_SIMPLE);\n\t\t\tthis.end_epoch_30 = timeSlot.plus({ minutes: 30 }).toLocaleString(DateTime.TIME_SIMPLE);\n }\n\n ngAfterViewInit() {\n this.setupTimer();\n }\n\n public setupTimer() {\n console.log(DateTime.now().get('second'))\n const addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n const addSeconds = 60 - DateTime.now().get('second');\n this.startTimer(addMin);\n }\n\n\n // countdown timer for coachmark\n public startTimer(display = 0, addSeconds = 0) {\n\n // const currentTime = new Date(DateTime.now().valueOf());\n // const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n // const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n // let timer = availableTimeToBook; //(this.diff -35) * 60;\n // let minutes;\n // let seconds;\n let timer = 0 ;\n if(timer >= 0){\n this.intervalCall_1 = interval(1000).subscribe(x => {\n\n const currentTime = new Date(DateTime.now().valueOf());\n const endTime = new Date(closestToTimeSlot(DateTime.now().plus({minutes: display, seconds: addSeconds}).setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME).valueOf());\n const availableTimeToBook = Math.abs((endTime.getTime() - currentTime.getTime()) / 60000)* 60;\n let timer = availableTimeToBook; //(this.diff -35) * 60;\n\n this.isTimerActive = true;\n this.minutesRemaining = Math.floor(timer / 60);\n this.secondsRemaining = Math.floor(timer % 60);\n\n this.minutesRemaining = this.minutesRemaining < 10 ? \"0\" + this.minutesRemaining : this.minutesRemaining;\n this.secondsRemaining = this.secondsRemaining < 10 ? \"0\" + this.secondsRemaining : this.secondsRemaining;\n\n --timer;\n\n if (timer <= 0) {\n timer = 0\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n this.isTimerActive = false;\n !this.timerIndex && this.setup15MinTimer();\n\n\t\t\t\t\t\t\t\t\t\tthis.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t\t\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addMin = DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('minute') % WAITING_TIME === 0 ? 1 : 0 ;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst addSeconds = 60 - DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).get('second');\n\t\t\t\t\t\t\t\t\t\t\t\t\tform['date'] = closestToTimeSlot(DateTime.now().setZone(this.userSelectedRoom?.building?.timezone).plus({ minutes: addMin, seconds:0 }), WAITING_TIME).valueOf(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tform.dateTz = closestToTimeSlotTz(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew DateTZ({ date: DateTime.now().plus({ minutes: addMin, seconds:0 }), is_local_tz: false, building_tz: form.timezone }),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWAITING_TIME\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n\n\t\t\t\t\t\t\t\t\t\t\t});\n\n }\n }) //, 1000, endTime)\n }\n }\n\n\t\t/**\n\t\t * This function updates information related to the lates booking in the selected room\n\t\t */\n public determineNextBookingStartTime() {\n\n\t\t\t\t// Get the current time using DateTime library\n const now = DateTime.now();\n\n\t\t\t\t// Determine if an extra minute should be added based on the current minute's remainder when devided by WAITING_TIME\n const addMin = now.get('minute') % WAITING_TIME === 0 ? 1 : 0;\n\n\t\t\t\t// Adjust the current time by adding the calculated minutes adna setting the timezone based on the selected room's building\n const addjustedTime: any = closestToTimeSlot(\n now.plus({ minutes: addMin, seconds:0 })\n .setZone(this.userSelectedRoom?.building?.timezone), WAITING_TIME\n );\n\n\t\t\t\t\t\t// Check if room is selected and has bookings settings\n if (this.userSelectedRoom?.space) {\n\t\t\t\t\t// Returive the list of future bookings or initializem it as an empaty array\n const futureBookings = this.userSelectedRoom?.space?.settings?.bookings || [];\n\n\t\t\t\t\t\t// Calculate the end time for a 30-minute interval from the addjested time\n const endEpoch30 = addjustedTime.plus({ minutes: 30 }).ts;\n\n\t\t\t\t\t\t// Filter future booking that start after end_epoch_30\n\t\t\t\t\t\tconst futureBookingsForTheDay = futureBookings.filter(item => item.start_epoch * 1000 >= endEpoch30);\n\n\t\t\t\t\t\t// Check if there are futute bookings found\n\t\t\t\t\t\tif(futureBookingsForTheDay.length > 0) {\n\t\t\t\t\t\t\t//Extract the start time of latest booking\n\t\t\t\t\t\t\tconst latestBookingStartTime = new Date(futureBookingsForTheDay[0].start_epoch * 1000);\n\n\t\t\t\t\t\t\t// Calculate the time difference between the latest booking start time and the current time in milliseconds\n\t\t\t\t\t\t\tconst timeDiffMs = latestBookingStartTime.getTime() - now.valueOf();\n\t\t\t\t\t\t\tthis.diffInMs = timeDiffMs;\n\t\t\t\t\t\t\t// Calculate the timne differenc in hours and minutes\n\t\t\t\t\t\t\tthis.diffInHours = Math.floor(timeDiffMs / (1000 * 60 * 60));\n \tthis.diffInMinutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));\n\n\t\t\t\t\t\t\t// Set flag to indicate the wether the difference is NaN (no future booking)\n \tthis.untilNextBookingFlag = !isNaN(timeDiffMs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.untilNextBookingFlag = false;\n\t\t\t\t\t\t}\n }\n\n }\n\n //fetch all the bookings for selected room for the day to the store\n public fetchRoomWithBookings(allWeek: boolean = true) {\n const day = 24 * 60;\n const week = day * 7;\n const date = (this.booking?.startDateTz).clone();\n const startOfDay = date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = date.startOfValue('week');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.data?.id,\n capacity: this.booking?.space?.capacity,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public closeModal() {\n const modal = this.elementRef.nativeElement.querySelector('.map-overlay-container');\n modal.classList.add('hide');\n this.data.parentComponent.isOverlayOpened = false;\n this.timerIndex = 0;\n this.isAvailable = false;\n\t\t\t\tthis.untilNextBookingFlag = false;\n this.intervalCall_1?.unsubscribe();\n // clearInterval(this.intervalCall_1);\n // this.intervalCall_15?.unsubscribe();\n clearInterval(this.intervalCall_15);\n }\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.userSelectedRoom) {\n this.data.parentComponent.roomSelected(this.userSelectedRoom);\n }\n }\n\n public onBook(minutes: number) {\n minutes = Math.round(minutes);\n const {filters, settings} = this.userSelectedRoom.space;\n if ( (filters && filters?.equipment_code ) || (settings && settings?.equipment_code) ) {\n this.roomDataCallback();\n } else {\n this.saveChanges(minutes);\n }\n }\n\n public bookingFormToBooking(minutes): Booking {\n const booking_form_data = this.bookingData.value;\n const has_note_buffer =\n booking_form_data?.notes && booking_form_data.notes?.length\n ? { [booking_form_data.selectedRoom.space.email]: 900 }\n : {}; // 900 seconds = 15 min\n const attendees = this.booking.attendees;\n const company = this.booking.company;\n const start_epoch = closestToTimeSlot(DateTime.now(), 15).valueOf() / 1000;\n const end_epoch =\n closestToTimeSlot(DateTime.now(), 15).plus({ minutes: minutes }).valueOf() / 1000;\n\n const raw_data = {\n space: { id: this.selectedRoomId },\n all_day: false,\n attendees,\n // booking_type: booking_form_data?.bookingType.value,\n booking_type: this.userSelectedRoom.space.filters.external === true? \"External\" : \"Internal\",\n catering: [],\n start_epoch,\n end_epoch,\n timezone: booking_form_data?.timezone,\n equipment_codes: {\n [booking_form_data?.selectedRoom.space.email]: booking_form_data?.code,\n },\n expected_attendees: {\n [this.data.email]: 1,\n },\n has_catering: false,\n needs_space: false,\n notes: this.booking.notes,\n organiser: this.currentUser,\n creator: this.currentUser,\n room: this.userSelectedRoom.space,\n title: 'Ad hoc meeting',\n setup: has_note_buffer,\n breakdown: has_note_buffer,\n company,\n };\n console.log(new Booking(raw_data));\n return new Booking(raw_data);\n }\n\n //function for sending final booking request\n public saveChanges(minutes) {\n this.loading = true;\n this.booking = this.bookingFormToBooking(minutes);\n // const booking_form_data = this.bookingData.value;\n this.booking.status = BOOKING_STATUS.approved;\n checkCollisions(this._spaces, this.booking).then(\n (bookable: boolean) => {\n if (!bookable) {\n // TODO - Refactor for https://acaprojects.atlassian.net/browse/MCK-1498\n // API is retuning bookings ouside of requested time range\n // TODO check booking date and times for conflict manually\n this.booking.status = BOOKING_STATUS.unavailable;\n return;\n }\n\n this._bookings_service.save(this.booking).then(\n (bkn) => {\n this.loading = false;\n this.success = true;\n this.confirmed = true;\n this._booking_state_service.replace(bkn);\n\n // When saved, the returned booking has a null room.\n // Correct this so the rest of the code doesn't flake out.\n this.booking = new Booking({ ...bkn.toJSON(), room: this.booking.room });\n // Clear the current booking form\n this.store.dispatch(clearBookingFormData());\n\n // Heap track event\n this._service.analytics.track('create', {\n booking_id: bkn.id,\n office: this.booking.room.building.name,\n room: this.booking.local_room_name,\n start_time: bkn.startDateTz.ms,\n end_time: bkn.endDateTz.ms,\n catering: !!bkn.catering.length,\n headcount: 1,\n });\n this.data.parentComponent.confirmBooking(this.booking);\n },\n (err) => {\n this.loading = false;\n this.confirmed = false;\n if (err.status === 409) {\n // Unavailable Confirmation\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n } else {\n console.log(err);\n }\n }\n );\n },\n (err) => {\n // Unavailable Confirmation\n this.loading = false;\n this.timeout(\n 'error',\n () => {\n this.booking.status = BOOKING_STATUS.unavailable;\n this._booking_state_service.replace(this.booking);\n this.confirmed = true;\n this.success = false;\n },\n 500\n );\n }\n );\n }\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nexport const WAITING_TIME = 15;\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 1\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: FloorMapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room\n }\n});\n\n// service account for office floor map view - read only\nexport const SERVICE_ACCOUNT = 'svc_kiosk_converge@mckinsey.onmicrosoft.com';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OfficeFloorComponent } from './office-floor/office-floor.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapModule } from 'src/app/map/map.module';\nimport { FloorMapOverlayComponent } from './floor-map-overlay/floor-map-overlay.component';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n MapModule,\n];\n\nexport const mapModuleDeclarations = [\n OfficeFloorComponent,\n FloorMapOverlayComponent,\n // MapControlsComponent,\n // MapFiltersComponent,\n // OfficeInformationModalComponent,\n // MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations,\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class OfficeFloorMapModule {\n}\n","import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, closestToTimeSlot, closestToTimeSlotTz, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults,\n User,\n selectMapFilteredResults,\n ApplicationService,\n clearRoomFilters,\n\t\tbookingTypeOptions,\n defaultRoomSizeOption,\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\n\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n SERVICE_ACCOUNT,\n WAITING_TIME,\n} from '../floor-map.utils';\nimport {\n loadDiffSizeResults,\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router, RouterStateSnapshot } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-office-floor',\n templateUrl: './office-floor.component.html',\n styleUrls: ['./office-floor.component.scss'],\n})\nexport class OfficeFloorComponent extends BaseDirective implements OnInit, OnChanges {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n\n public roomStatus: any;\n public payload: any;\n /** Current User */\n public currentUser: User;\n public bookingConfirmed = false;\n public bookingData: {};\n serviceAccount: boolean;\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private route: ActivatedRoute,\n public _service: ApplicationService,\n private location: Location\n ) {\n super();\n this.payload = location.getState();\n this.payload.floorMap = false;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n throw new Error('Method not implemented.');\n }\n\n public ngOnInit(): void {\n //clear filters first if any applied previously \n this.store.dispatch(clearRoomFilters());\n\n const selection = { value: this.payload?.payload, display: '' };\n this.payload.building.value = this.payload.building[0].id;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n this.serviceAccount = this.currentUser.email === SERVICE_ACCOUNT\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n next.duration = 30;\n this.bookingFormData.next(next); /// <---- timezone setting can be done here\n }\n })\n );\n\n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n this.roomStatus = filteredSpaces;\n\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) =>\n !!s.map_id &&\n s.zones.includes(building.id) &&\n s.zones.includes(this.payload?.payload)\n );\n\n this.resultSpaces.next(cloneDeep(spacesFromSelection));\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n () => {\n if(!this.serviceAccount) {\n this.activeSpace.next(space);\n this.focusOnRoom();\n }\n \n }\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n this.isOverlayOpened && this.focusOnRoom();\n })\n );\n\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'setActiveSpace',\n this.resultSpaces\n .subscribe((next) => {\n // console.log(this.focusedRoom?.value?.space?.id);\n const space = next.find((s) => s.id === this.focusedRoom?.value?.space?.id)\n space && this.activeSpace.next(space);\n })\n );\n\n\n \n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(this.payload.building);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n \n form['date'] = closestToTimeSlot(DateTime.now().plus({ minutes: 1 }), WAITING_TIME).valueOf(),\n form.dateTz = closestToTimeSlotTz(\n new DateTZ({ date: DateTime.now().plus({ minutes: 1 }), is_local_tz: false, building_tz: form.timezone }),\n WAITING_TIME\n )\n this.store.dispatch(storeBookingFormData({ payload: form }));\n this.store.dispatch(loadRoomsForResults.request(roomFormDataToQuery(form)));\n })\n );\n\n this.selectActiveBuilding(this.payload.building);\n this.selectBuildingLevel(selection);\n\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeLevel.next(next);\n });\n }\n\n public selectActiveSpace(selection?: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === this.focusedRoom?.value.space.id)),\n // take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom() {\n // this.selectedSpace = space;\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n // this.focusedRoom.next(null);\n \n this.focusedRoom.next(cloneDeep(focusedRoom[0]));\n this.isOverlayOpened && this.childCallback( cloneDeep(focusedRoom[0]) );\n\n\t\t\t\t\tconst { filters, settings } = this.focusedRoom?.value?.space; // use of new data structure fields\n if ( this.roomStatus.statusMap[this.focusedRoom.value.space.id] === 'requestable' || (filters?.equipment_code || settings?.equipment_code) ) {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.bookingFormData.value,\n selectedRoom: this.focusedRoom.value,\n },\n })\n );\n this.roomSelected(this.focusedRoom.value);\n }\n !this.isOverlayOpened && this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this));\n this.zoom.next(6);\n },\n delay\n );\n });\n }\n\n public isOverlayOpened = false;\n public childCallback;\n\n public exitFullscreen(route: string): void {\n this.store.dispatch(clearRoomFilters());\n\n this.store.select(selectActiveForm).pipe(take(1))\n\t\t\t\t\t.subscribe((form) => {\n\t\t\t\t\t\tform.bookingType = bookingTypeOptions[0],\n form.roomSize = defaultRoomSizeOption,\n\t\t\t\t\t\t\tthis.store.dispatch(storeBookingFormData({ payload: form }));\n\t\t\t\t\t});\n\n const navigationExtras = {\n state: { payload: this.activeLevel.value },\n relativeTo: this.route,\n queryParams: {\n display: 'map',\n },\n };\n this._service.kioskFormFilter = true;\n this.router.navigate([route], navigationExtras);\n }\n\n // public triggerRefresh(){\n // this.subscription(\n // 'activeForm',\n // this.store\n // .pipe(select(selectActiveForm), distinctUntilChanged())\n // .subscribe((next: BookingFormData | undefined) => {\n // if (next) {\n // next.duration = 35;\n // this.bookingFormData.next(next);\n // }\n // })\n // );\n\n // this.subscription(\n // 'bookingSpaceResults',\n // combineLatest([\n // this.store.pipe(\n // select(selectMapFilteredResults),\n // map((r: LoadingModel) => r.success)\n // ),\n // this.activeBuilding.pipe(filterUndefined()),\n // this.activeLevel.pipe(filterUndefined()),\n // ]).subscribe(([filteredSpaces, building, level]) => {\n // this.roomStatus = filteredSpaces;\n\n // const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n // (s) =>\n // !!s.map_id &&\n // s.zones.includes(building.id) &&\n // s.zones.includes(this.payload?.payload)\n // );\n\n // this.resultSpaces.next(spacesFromSelection);\n\n // const listeners: MapListener[] = [];\n // const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach((space) => {\n // const status = filteredSpaces.statusMap[space.id];\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // listeners.push(\n // ...generateMapListenersForSpace(\n // space,\n // () => {},\n // () => {},\n // () => {\n // this.activeSpace.next(space);\n // this.focusOnRoom();\n // }\n // )\n // );\n // });\n // this.style_map.next(styles);\n // this.listeners.next(listeners);\n // })\n // );\n\n // this.subscription(\n // 'bookingResults',\n // this.resultSpaces\n // .pipe(withLatestFrom(this.activeSpace))\n // .subscribe(([resultSpaces, activeSpace]) => {\n // this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n // })\n // );\n // }\n\n public roomSelected(room: RoomResultsViewModel) {\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n let organiser = { display: this.currentUser.name, value: this.currentUser.email };\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n organiser: organiser,\n title: 'Ad hoc meeting',\n // attendees: [this.currentUser],\n code: '',\n notes: '',\n head_count: 1,\n selectedRoom: room,\n },\n })\n );\n\n this.router.navigate(['../create'], { relativeTo: this.route });\n }\n\n public getDayOfWeek(date: string | number | Date) {\n const dayOfWeek = new Date(date).getDay();\n return isNaN(dayOfWeek)\n ? null\n : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][\n dayOfWeek\n ];\n }\n\n public confirmBooking = (bookingData: {}) => {\n this.bookingConfirmed = true;\n this.bookingData = bookingData;\n };\n}\n","
\n
\n
\n \n \n \n \n
\n \n
\n
\n
\n
\n
\n
Booking Confirmed
\n
\n
\n \n
Confirmed
\n
\n
\n
Status: Confirmed
\n
Date: {{this.getDayOfWeek(this.bookingData?.date_string)}}, {{this.bookingData?.date_string}}
\n
Time: {{this.bookingData?.time_period}} GMT{{this.bookingData?.tz_offset}}
\n
{{this.bookingData?.booking_type}} meeting ({{this.bookingData?.duration}} minutes)
\n
Address: {{this.activeBuilding?.value.address}}, {{this.activeBuilding?.value.city}}
\n
Room: {{this.focusedRoom.value.title}}
\n
Room {{this.focusedRoom.value.capacity}}
\n
\n
\n
\n
\n
\n
\n
Host: {{this.currentUser?.name}}
\n
Attendees: {{this.currentUser?.name}}
\n
Charge Code: {{this.focusedRoom?.value.space.filters.charge_code === false ? \"No charge code\" : \"\"}}
\n
Headcount Estimate: {{this.bookingData?.attendees.length}}
\n
Additional Requirements: {{this.bookingData?.notes[0]}}
\n
\n
\n
\n
\n \n Close\n \n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n ActivatedRoute,\n ParamMap,\n Router\n} from '@angular/router';\nimport { deepDistinctUntilChanged } from '@mckinsey-converge/rx-utils';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-results-header',\n template: `\n
\n
\n

Results

\n Matching your search criteria {{resultsCount>=0 ? '('+resultsCount+')' : ''}} \n
\n \n \n
\n `,\n styleUrls: ['./results-header.component.scss']\n})\nexport class ResultsHeaderComponent extends BaseDirective implements OnInit {\n\n public toggleOptions: SelectOption[] = [\n {\n value: 0,\n display: 'List',\n meta: { \n mobile: true\n }\n },\n {\n value: 1,\n display: 'Map',\n meta: { \n mobile: true\n }\n },\n {\n value: 2,\n display: 'Calendar',\n meta: { \n route: 'booking-calendar',\n mobile: false\n }\n }\n ];\n\n public selectedToggle = new BehaviorSubject>(this.toggleOptions[0]);\n\n @Input()\n public resultsCount: number | undefined;\n\n @Output()\n public selectedToggleChange = new EventEmitter>();\n\n constructor(private router: Router,\n private route: ActivatedRoute) {\n super();\n }\n\n public ngOnInit(): void {\n this.selectedToggleChange.next(this.selectedToggle.value);\n\n this.subscription('paramsToUI', this.route.queryParamMap\n .pipe(deepDistinctUntilChanged())\n .subscribe((next: ParamMap) => {\n const retrievedOption = this.toggleOptions.find(o => o.display.toLowerCase() === next.get('display'));\n this.onSelectedChange(retrievedOption ?? this.toggleOptions[0]);\n }));\n }\n\n public onSelectedChange(option: SelectOption) {\n this.selectedToggle.next(option);\n this.selectedToggleChange.next(option);\n\n if(option.meta?.route) {\n this.router.navigate(['booking-calendar'], { relativeTo: this.route });\n }\n else {\n // toggle route.\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n display: option.display.toLowerCase()\n },\n queryParamsHandling: 'merge'\n });\n }\n \n\n }\n\n}\n","import {\n Component,\n Inject,\n OnInit,\n Output,\n EventEmitter,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\n\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport {\n dateBuildingFormatString,\n startEndTimeWithZoneFormatString,\n humaniseDuration,\n closestToTimeSlotTz\n} from '@mckinsey-converge/base';\nimport {\n Space,\n SpacesService,\n DEFAULT_BOOKING_DURATION,\n checkCollisions,\n Booking\n} from '@mckinsey-converge/data-common';\nimport { DateTZ, convertLocalTimestampToTimezonedDateTz, convertTimezonedTimestampToLocalDateTz, DateNow } from '@mckinsey-converge/date-tz';\n\ninterface ModalData {\n dateTz: DateTZ,\n duration: number,\n pendingDateTz: DateTZ,\n pendingDuration: number,\n space?: Space,\n rules?: any,\n bookingId?: string,\n currentBooking?: Booking,\n}\n\n@Component({\n selector: 'app-room-availability-preview-modal',\n template: `\n
\n \n
\n \n
New Booking Date/Time
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n

\n Room is available for selected date/time.\n \n But the following items\n \n \n \" {{ item.name }} {{ i === category.items.length - 1 ? '' : ', ' }} \"\n \n \n are restricted due to catering unavailability. Please select another time or remove these items.\n \n\n

\n

Room is unavailable for selected date/time.

\n

Checking availability for selected date/time...

\n

\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n

\n
\n
\n
\n
\n

Old

\n

Date: {{dateString}}

\n

Time: {{timeString}}

\n

({{durationString}})

\n \n
\n
\n

New

\n

Date: {{pendingDateString}}

\n

Time: {{pendingTimeString}}

\n

({{pendingDurationString}})

\n
\n
\n
\n
\n \n 0\"\n primaryLabel=\"Confirm\" (primarySubmit)=\"confirm()\"\n secondaryLabel=\"Cancel\" (secondarySubmit)=\"closeModal()\"\n >\n \n
\n `,\n styleUrls: ['./room-availability-preview-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class RoomAvailabilityPreviewModalComponent implements OnInit {\n @Output() public submitForm = new EventEmitter();\n public dateString: string;\n public timeString: string;\n public durationString: string;\n public pendingDateString: string;\n public pendingTimeString: string;\n public pendingDurationString: string;\n public mapBookingRules: readonly string[];\n public mapBookingSubtitle: string;\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ(), 15);\n public available: boolean = null;\n public formGroup = new FormGroup({\n dateTz: new FormControl(this.fromDateTz, [Validators.required]),\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required])\n });\n public localTimezone = \"\";\n public buildingTimezone = \"\";\n public localStart = \"\";\n public localEnd = \"\";\n\n // Declare the restrictedDueToCatering property\n public restrictedDueToCatering: any[] = [];\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: ModalData,\n private dialogRef: MatDialogRef,\n private _spaces: SpacesService,\n ) {}\n\n public get pending_date(){\n return this.data.pendingDateTz; // new DateTZ({ date: this.data.pendingDate.valueOf(), is_local_tz: false, building_tz: this.data?.space?.timezone })\n }\n\n public ngOnInit(): void {\n this.formGroup.setValue({\n dateTz: this.data.pendingDateTz,\n duration: this.data.pendingDuration,\n });\n this.updateDisplay();\n }\n\n // Method run when the confirming the modal.\n public applyChanges(changes: any): void {\n this.data.pendingDateTz = changes.pendingDateTz; // new Date(changes.pendingDate.valueOf());\n this.data.pendingDuration = changes.pendingDuration;\n this.updateDisplay();\n }\n\n public updateDisplay() {\n // this.data.dateTz is the existing time in building time\n // this.data.pendingDateTz is the new time in building time\n const dateTz = this.data.dateTz;\n this.dateString = dateBuildingFormatString(dateTz);\n this.timeString = startEndTimeWithZoneFormatString(dateTz, dateTz.addValue({ minutes: this.data.duration }));\n this.durationString = humaniseDuration(this.data.duration);\n\n const pendingDateTz = this.data.pendingDateTz;\n this.pendingDateString = dateBuildingFormatString(pendingDateTz);\n this.pendingTimeString = startEndTimeWithZoneFormatString(pendingDateTz, pendingDateTz.addValue({ minutes: this.data.pendingDuration }));\n this.pendingDurationString = humaniseDuration(this.data.pendingDuration);\n this.fromDateTz = closestToTimeSlotTz(pendingDateTz, 15); // building value\n\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n this.updateCoachmarkTimes(this.data?.space?.timezone);\n\n // Check if any restricted catering category included \n \n\n this.restrictedDueToCatering = this.data.currentBooking?.catering.filter(order => order.items.filter(category => category.within_category_restricted_time(this.data.pendingDateTz)).length )\n\n\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: this.data.pendingDateTz.seconds,\n end_epoch: this.data.pendingDateTz.addValue({ minutes: this.data.pendingDuration }).seconds,\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n }).catch(() => {\n this.available = false;\n });\n }\n\n public closeModal() {\n this.dialogRef.close(null);\n }\n\n public updateDatePickerValue(dateTz: DateTZ) {\n const pending_date: DateTZ = this.formGroup.value.dateTz\n const day = pending_date.setValue({ \n day: dateTz.dateDay,\n month: dateTz.dateMonth,\n year: dateTz.dateYear\n });\n this.setValue(day, this.formGroup.controls.dateTz);\n }\n\n public setValue($value, formControl: AbstractControl) {\n // valid options are in building time\n formControl.setValue($value); // bulding time\n this.submitForm.emit(this.formGroup.value);\n }\n\n public confirm() {\n const setup = {};\n setup[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n const breakdown = {};\n breakdown[this.data.space.email] = this.data?.currentBooking?.setup[this.data?.space?.email] || 0;\n\n const buildingDate = convertLocalTimestampToTimezonedDateTz(this.data.pendingDateTz.ms, this.data?.currentBooking?.timezone);\n const mockBooking = new Booking({\n id: this.data.bookingId,\n start_epoch: buildingDate.seconds,\n end_epoch: buildingDate.addValue({ minutes: this.data.pendingDuration }),\n room: this.data.space,\n setup,\n breakdown, \n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.available = bookable;\n this.dialogRef.close({\n ...this.formGroup.value,\n }); \n }).catch(() => {\n this.available = false;\n });\n }\n\n private updateCoachmarkTimes(timezone: string) {\n if (timezone) {\n this.buildingTimezone = timezone;\n const localizedStartDate = this.formGroup.value.dateTz;\n const localizedEndDate = localizedStartDate.addValue({ minutes: this.formGroup.value.duration });\n this.localStart = localizedStartDate.formatLocalDate(\"h:mma\");\n this.localEnd = localizedEndDate.formatLocalDate(\"h:mma\");\n } else {\n this.buildingTimezone = this.localTimezone.slice(0);\n this.localStart = \"\";\n this.localEnd = \"\";\n } \n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n Input,\n OnInit,\n OnChanges,\n ElementRef,\n ViewChild,\n EventEmitter,\n Output,\n SimpleChanges,\n ChangeDetectorRef,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { fromEvent, Subject, BehaviorSubject, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { CalendarEvent, CalendarEventTimesChangedEvent } from 'angular-calendar';\nimport { BaseClass, durationHumanized, isLessThanBreakpoint } from '@mckinsey-converge/base';\nimport {\n Booking,\n Building,\n BuildingLevel,\n Space,\n User,\n rulesForSpace,\n SpaceRules,\n} from '@mckinsey-converge/data-common';\nimport { generateFeedbackUrl, Urls } from '../../utilities/urls';\nimport { TopBarHeaderMode } from '../room-location-preview/room-location-preview.component';\nimport { RoomAvailabilityPreviewModalComponent } from '../room-availability-preview-modal/room-availability-preview-modal.component';\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n convertTimezonedTimestampToLocalDateTz,\n timezoneOffset,\n} from '@mckinsey-converge/date-tz';\nimport { utcToZonedTime } from 'date-fns-tz';\nimport { FormControl } from '@angular/forms';\nimport { DateTime } from 'luxon';\n\nconst WEEKEND_DAYS = [6, 7];\nconst colors = {\n grey: {\n secondary: '#D2D2D2',\n primary: '#A19F9F',\n },\n blue: {\n secondary: '#C0DBF5',\n primary: '#00A9F4',\n },\n red: {\n secondary: '#EB5757',\n primary: '#EB5757',\n },\n};\n\ninterface CalendarClickEvent {\n date: Date;\n}\n\nexport interface BookingBumper {\n top?: string;\n bottom?: string;\n height: string;\n backgroundColor: string;\n}\nexport interface BookingBumpers {\n top: BookingBumper;\n bottom: BookingBumper;\n}\n\nexport type BookingPlus = Booking & { start: number; end: number }; // R--- why again?\nexport type CalendarEventPlus = CalendarEvent & { bumper?: BookingBumpers; booking?: Booking };\n\n@Component({\n selector: 'room-availability-preview',\n templateUrl: './room-availability-preview.component.html',\n styleUrls: ['./room-availability-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RoomAvailabilityPreviewComponent extends BaseClass implements OnInit, OnChanges {\n @ViewChild('scrollContainer') scrollContainer: ElementRef;\n\n @Input() public alternativeWeekStartDateTz: DateTZ;\n // Used when editing a booking\n @Input() public bookingId?: string;\n @Input() public bookings: BookingPlus[];\n /** retain as mutable */\n @Input() public building: Building;\n // R--- could probably use the currentBooking ID edit,\n // The bookingId was an after thought\n @Input() public currentBooking: Booking;\n @Input() public currentUser: User;\n @Input() public dateTz: DateTZ;\n @Input() public duration: number;\n @Input() public expanded: boolean;\n @Input() public level: BuildingLevel;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Light;\n @Input() public space: Space;\n // @Input() public timezone: string;\n\n @Output() public confirmChanges: EventEmitter = new EventEmitter();\n @Output() public handleExpand: EventEmitter = new EventEmitter();\n @Output() public updateCalendarWeekView: EventEmitter = new EventEmitter();\n @Output() public warnIfItHasConflict: EventEmitter = new EventEmitter();\n\n /**\n * placeIntoModal: Input decorator indecate as a flag to adapt component design into a dialog modal \n * (by hiding header and adjusting height so that fit into a modal)\n */\n @Input() public placeIntoModal: boolean = false;\n\n constructor(public dialog: MatDialog) {\n super();\n }\n\n public breakpoint = 768;\n public mobile = false;\n public showDatePicker = false;\n public events: CalendarEventPlus[] = [];\n public dayStartHour: number;\n public dayEndHour: number;\n public viewDateTz: DateTZ;\n public weekViewDateTz: DateTZ;\n public weekViewRangeText: string;\n public showWeekend: boolean = false;\n public currentPage: string;\n public calendarPopupValue = new BehaviorSubject(DateNow(new Date()));\n public pendingChange: boolean = false;\n public pendingDateTz: DateTZ;\n public pendingDuration: number;\n public eventSnapSize: number = 15;\n public dayRefresh: Subject = new Subject();\n public weekRefresh: Subject = new Subject();\n public addMarginOnConflict: boolean = false; // helps to add html class to adjust margin top in case of QR code scan conflict\n public event: CalendarEventPlus = {\n start: new Date(),\n end: new Date(),\n title: '',\n color: colors.blue,\n cssClass: 'selected',\n actions: null,\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n };\n\n public get timezone(): string {\n return this.dateTz.building_tz;\n }\n\n public get one_day_in_millis() {\n return 86400000;\n }\n\n public get thirty_minutes_in_millis() {\n return 1800000;\n }\n public rules: SpaceRules;\n public modal_data: any = {};\n public scrollFired: boolean = false;\n\n // Values to display a span on the date picker, but the date picker doesn't support this.\n public date_span = {\n start: 0,\n end: 0,\n };\n\n // I can't think of any reason the calendar widget needs to go back further than 2 years, if even that.\n public fromDateTz = DateNow(new Date()).subtractValue({ years: 2 });\n\n public dateControl = new FormControl(new Date().valueOf());\n\n public isEventDate(d: CalendarClickEvent) {\n const date = new DateTZ({ date: d.date.valueOf() }); // local time I think.. problem TODO\n return this.pendingDateTz.isSameDate(date, 'day');\n }\n\n public get inputDate(): Observable {\n return this.calendarPopupValue.pipe(map((d) => d));\n }\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public ngOnInit(): void {\n // R--- retrun to document\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.pendingDateTz = this.dateTz.clone();\n const date = this.dateTz.clone();\n const currentBookingStartDate = this.currentBooking\n ? this.currentBooking.startDateTz.addValue({ seconds: 0 })\n : date;\n this.alternativeWeekStartDateTz = date.startOfValue('week').startOfValue('day');\n\n // Not sure if this is correct\n this.weekViewDateTz = this.alternativeWeekStartDateTz.clone();\n\n this.calendarCenter();\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.pendingDateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 });\n this.setCalendarValue(this.pendingDateTz);\n this.showWeekend =\n WEEKEND_DAYS.includes(currentBookingStartDate.dateWeekday) ||\n WEEKEND_DAYS.includes(date.dateWeekday);\n this.setupEventName();\n this.transformBookings();\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < this.breakpoint;\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n },\n })\n )\n .subscribe();\n\n this.rules = rulesForSpace({\n time: this.dateTz.ms,\n duration: this.duration,\n user: this.currentUser,\n rules: this.building?.booking_rules,\n space: this.space,\n });\n\n // Update the display when the screen resizes.\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n this.mobile = isLessThanBreakpoint(this.breakpoint);\n this.calendarCenter();\n this.setDislayValues();\n },\n })\n )\n .subscribe();\n this.dateControl.setValue(this.dateTz);\n this.transformBookings();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.expanded) {\n // set if the event is editable\n this.event.draggable = this.expanded;\n this.event.resizable = {\n beforeStart: this.expanded,\n afterEnd: this.expanded,\n };\n const date = this.dateTz;\n this.setCalendarValue(date);\n }\n\n if (this.dayStartHour) this.scrollTo();\n\n if (!this.pendingDateTz) return;\n\n if (changes.bookings || changes.expanded) {\n this.transformBookings();\n }\n if (changes.alternativeWeekStartDateTz) {\n this.setDislayValues();\n }\n if (changes.expanded) {\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n }\n\n public setDislayValues() {\n const tz_offset = timezoneOffset(this.alternativeWeekStartDateTz.building_tz).hours\n const week_start_date = this.alternativeWeekStartDateTz.subtractValue({hours: tz_offset}).clone(); // Operation needed to trick the mwl-calendar-week-view to display the correct day if the day changes between timezones \n this.weekViewDateTz = this.weekViewDateTz || this.alternativeWeekStartDateTz.clone();\n let week_view_date = this.weekViewDateTz.startOfValue('week'); // new DateTZ({date: this.weekViewDate?.valueOf()}).startOfValue('week')\n if (!this.showWeekend) {\n // Advance from Sunday to Monday\n week_view_date = week_view_date.addValue({ days: 1 });\n }\n\n if (this.mobile) {\n this.weekViewDateTz = week_start_date\n this.weekViewRangeText = `${this.weekViewDateTz.formatDate('d MMMM')}`;\n this.calendarPopupValue.next(this.weekViewDateTz);\n } else {\n this.weekViewDateTz = week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }); // new Date(week_start_date.addValue({ days: this.showWeekend ? 0 : 1 }).ms);\n this.weekViewRangeText = `${week_view_date.formatDate('d MMMM')} - ${week_view_date\n .addValue({ days: this.showWeekend ? 6 : 4 })\n .formatDate('d MMMM yyyy')}`;\n this.calendarPopupValue.next(week_view_date);\n }\n }\n\n public getBumpers(booking: Booking, selected: boolean = false) {\n const email = booking.space.email || this.space.email;\n const setup = booking.setup[email] ? booking.setup[email] / 60 : 0;\n const breakdown = booking.breakdown[email] ? booking.breakdown[email] / 60 : 0;\n\n return {\n top: {\n top: `-${setup - 1}px`,\n height: `${setup}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n bottom: {\n bottom: `-${breakdown - 1}px`,\n height: `${breakdown}px`,\n backgroundColor: selected ? colors.blue.secondary : colors.grey.secondary,\n },\n };\n }\n\n public setupEventName() {\n this.setDislayValues();\n const pending_date = this.pendingDateTz.clone();\n const start_date = pending_date.setValue({ second: 0, millisecond: 0 });\n this.event.start = start_date.JSDate;\n this.event.end = start_date.addValue({ minutes: this.pendingDuration }).JSDate;\n const startHour = parseInt(pending_date.formatDate('H'), 10);\n\n if (startHour === 0) {\n this.dayStartHour = startHour;\n } else if (startHour < 6) {\n const offset = startHour > 3 ? startHour - 2 : startHour;\n this.dayStartHour = startHour - offset;\n } else {\n // The min of 18 is needed so start times after 6pm\n // don't push the calendar view beyond midnight.\n const offset = Math.min(18, startHour - 3);\n this.dayStartHour = offset;\n }\n\n if (!this.scrollFired && this.dayStartHour) {\n this.scrollTo();\n }\n\n this.dayEndHour = Math.max(24, this.dayStartHour + 6);\n this.event.title = `${pending_date\n .formatDate('h:mma')\n .toLocaleLowerCase()} (${durationHumanized(this.pendingDuration, true)})`;\n this.event.cssClass = `selected ${this.showWeekend ? 'show-weekend' : ''} ${\n this.mobile && this.expanded ? 'mobile' : ''\n } `;\n\n if (this.currentBooking) {\n this.event.bumper = this.getBumpers(this.currentBooking);\n this.event.booking = this.currentBooking;\n }\n this.expanded ? this.weekRefresh.next() : this.dayRefresh.next();\n }\n\n public transformBookings() {\n this.calendarSpan();\n const events = [];\n if (Array.isArray(this.bookings)) {\n this.bookings.forEach((raw_booking) => {\n const booking = new Booking(raw_booking);\n const { mode, duration } = this.displayClass(\n booking.startDateTz.ms,\n booking.endDateTz.ms\n );\n\n // back off a ms when end of day to avoid all day wrapping to next day.\n let end = booking.endDateTz;\n const endTime = booking.endDateTz;\n if (endTime.minutes === 0 && endTime.seconds === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n end = booking.endDateTz.subtractValue({ seconds: 1 });\n }\n\n // When editing skip over the current booking\n if (booking.id === this.bookingId) return;\n\n const utcStart = booking.startDateTz; // building time\n const utcEnd = end; // building time\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n const adjustedStartDate = utcToZonedTime(utcStart.ms, booking.timezone); // return local time\n const adjustedEndDate = utcToZonedTime(utcEnd.ms, booking.timezone); // return local time\n\n events.push({\n start: adjustedStartDate,\n end: adjustedEndDate,\n title: `Booked by ${booking.booker['name']}`,\n color: colors.grey,\n actions: null,\n cssClass: `booked ${this.mobile && 'mobile'} ${\n this.showWeekend ? 'show-weekend' : ''\n } ${mode}`,\n bumper: this.getBumpers(booking),\n resizable: {\n beforeStart: false,\n afterEnd: false,\n },\n draggable: false,\n booking,\n });\n });\n }\n\n const { mode, duration } = this.displayClass(\n this.event.start.getTime(),\n this.event.end.getTime()\n );\n const event = Object.assign({}, this.event);\n const endTime = new DateTZ({ date: this.event.start.valueOf() }).addValue({\n minutes: this.pendingDuration,\n }); // building time\n if (endTime.minutes === 0 && endTime.second === 0) {\n // back off a ms when the end of day to avoid all day wrapping to next day.\n event.end = endTime.subtractValue({ milliseconds: 1 }).JSDate; // building time\n }\n\n // adjust the time to appear as the same time locally ( but technically incorrect for building timezone )\n // will need to adjust the other way with drag and drop and click actions.\n event.start = utcToZonedTime(event.start, this.timezone); // local time\n event.end = utcToZonedTime(event.end, this.timezone); // local time\n\n event.cssClass = `selected ${this.mobile && this.expanded ? 'mobile' : ''} ${mode}`;\n if (this.currentBooking) {\n event.bumper = this.getBumpers(this.currentBooking, true);\n event.booking = this.currentBooking;\n }\n\n events.push(event);\n this.events = events.slice();\n this.updateTileColor();\n }\n\n public updateTileColor() {\n const pending_date = this.pendingDateTz.clone();\n const start = pending_date.setValue({ second: 0, millisecond: 0 });\n const end = start.addValue({ minutes: this.pendingDuration });\n const booked = this.events.filter((e) => !e.draggable); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n const isEvents = this.events.filter((e) => e.draggable);\n if(isEvents.length ) {\n isEvents[0].color = conflict ? colors.red : colors.blue;\n this.addMarginOnConflict = conflict ? true : false;\n \n } \n !this.expanded && this.warnIfItHasConflict.emit({room: this.space, hasConflict: conflict});\n }\n public displayClass(start: number, end: number) {\n const duration = end - start;\n return {\n duration,\n mode: duration > this.thirty_minutes_in_millis ? 'extended' : 'minimal',\n };\n }\n\n public setCalendarValue(dateTz: DateTZ) {\n let toDate = DateNow().startOfValue('minute');\n if (dateTz) {\n toDate = dateTz.startOfValue('minute');\n }\n if (!this.mobile && toDate.dateWeekday !== 7) {\n toDate = toDate.startOfValue('week');\n }\n this.updateCalendarWeekView.emit(toDate);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = toDate;\n this.setDislayValues();\n }\n\n /**\n * Convert the true bulding based time object to a timestamp skewed to the local time\n *\n * @param buildingTz - DateTZ object of time in bulding timezone\n * @returns number - timestamp in local time skewed from bulding time\n */\n public convertTimezonedValueForCalendar(buildingTz: DateTZ) {\n return convertTimezonedTimestampToLocalDateTz(buildingTz.ms, this.timezone).ms;\n }\n\n public hasConflict(startTz, endTz, booked) {\n // Convert the start and end building times to the local timezone for comparison with the localized bookings.\n const localizedStartTime = startTz.ms;\n const localizedEndTime = endTz.ms;\n let email = this.space?.email || this.currentBooking?.room?.email;\n return booked.some((b) => {\n email = email || b.booking?.room?.email;\n // Booking here are local time to render on the calendar correctly\n const setup = b.booking?.setup[email] || 0;\n // R--- This weird augmented booking with start and end needs to be with DateTZ and a getter when ms is needed.\n const bookingStartTime = new DateTZ({ date: b.start.valueOf() }); // local times\n const bookingEndTime = new DateTZ({ date: b.end.valueOf() }); // local times\n const bstart = bookingStartTime.subtractValue({ seconds: setup }).ms;\n const breakdown = b.booking?.breakdown[email] || 0;\n const bend = bookingEndTime.addValue({ seconds: breakdown }).ms;\n\n if (\n (localizedStartTime >= bstart && localizedStartTime < bend) || // booking starts durring a meeting\n (localizedStartTime <= bstart && localizedEndTime > bstart) || // booking ends durring meeting\n (localizedStartTime >= bstart && localizedEndTime <= bend) || // booking starts and ends durring a meeting\n (localizedStartTime <= bstart && localizedEndTime >= bend) // booking overlaps entire meeting\n ) {\n return b.booking?.id !== this.currentBooking?.id;\n }\n return false;\n });\n }\n\n public eventTimesChanged({ event, newStart, newEnd }: CalendarEventTimesChangedEvent): void {\n const s = convertLocalTimestampToTimezonedDateTz(\n newStart.valueOf(),\n this.timezone\n );\n if (s.ms < Date.now()) return;\n // newStart and newEnd are local times from the calendar component\n // merging in with localized bookings in this.events\n this.events = this.events.map((iEvent) => {\n if (event.id && iEvent.id === event.id) {\n return {\n ...event,\n start: newStart,\n end: newEnd,\n };\n }\n return iEvent;\n }); // local times\n\n let buildingStartDateTz = new DateTZ(\n { date: newStart.valueOf()}\n );\n let buildingEndDateTz = new DateTZ(\n { date: Math.ceil(newEnd.valueOf()/900000)*900000 } //For latest bug in CNG-309, make sure end time follows a 15-min interval\n );\n\n // Clear out the seconds and miliseconds to avoid collision by seconds.\n buildingStartDateTz.setValue({ millisecond: 0, second: 0 });\n\n if (buildingStartDateTz < DateNow(new Date())) {\n // compare building time to now\n // Abandon updates if the past\n this.transformBookings();\n return;\n }\n\n let pendingDuration = Math.floor(\n (buildingEndDateTz.ms - buildingStartDateTz.ms) / 60 / 1000\n );\n // Make adjustments to the time and duration so the snap to behavior aligns\n // with the Mckinsey time and duration rules.\n const new_start = buildingStartDateTz.clone(); //new DateTZ({date: buildingNewStart.getTime()}); // building time\n if (pendingDuration >= 60) {\n // check that duration is inc of 1/2 hr\n const d = pendingDuration % 30;\n // if (d) {\n // pendingDuration = Math.floor(pendingDuration + (30 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // check that the start time is 1/2 hr\n const m = parseInt(new_start.formatDate('m'), 10);\n const md = m % 30;\n // if (md) {\n // buildingStartDateTz = new_start.addValue({ minutes: md }); // building time\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n // }\n // Update snap to rules\n // this.eventSnapSize = 30; //done for CNG-309\n } else {\n // check that duration is inc of 1/4 hr\n const d = pendingDuration % 15;\n if (d) {\n // pendingDuration = Math.floor(pendingDuration + (15 - d));\n // buildingEndDateTz = new_start.addValue({ minutes: pendingDuration }); // building time\n }\n this.eventSnapSize = 15;\n }\n\n // Drag and Drop / Resize duration\n const dnd_duration = buildingEndDateTz.ms - buildingStartDateTz.ms;\n if (dnd_duration >= this.one_day_in_millis - 1) {\n // Add that millisecond back in so the angular calender drag and drop snapping still works.\n buildingEndDateTz = buildingEndDateTz.addValue({ milliseconds: 1 });\n }\n\n if (this.rules?.max_length) {\n if (dnd_duration / 60000 > this.rules?.max_length) {\n // Abandon updates if exceeeds max duration\n this.transformBookings();\n return;\n }\n }\n\n // Setup values for conflict checking, add on the setup and breakdown times form comparison\n let conflictCheckStartTime = buildingStartDateTz.clone();\n let conflictCheckEndTime = buildingEndDateTz.clone();\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n const start = buildingStartDateTz.clone();\n conflictCheckStartTime = start.subtractValue({ seconds: setup });\n }\n const breakdown = this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n const end = buildingEndDateTz.subtractValue({ seconds: 1 });\n conflictCheckEndTime = end.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const start = conflictCheckStartTime;\n const end = conflictCheckEndTime;\n const booked = this.events.filter((e) => e.draggable === false); // this.events are in local time\n const conflict = this.hasConflict(start, end, booked);\n this.dateControl.setValue(start);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n // check if the time or duration has changed\n if (this.pendingDateTz !== buildingStartDateTz) {\n this.pendingChange = true;\n } else if (this.pendingDuration !== pendingDuration) {\n this.pendingChange = true;\n }\n\n // set the new Pending Date\n this.pendingDateTz = convertLocalTimestampToTimezonedDateTz(buildingStartDateTz.ms, this.timezone); // building time\n this.pendingDuration = pendingDuration;\n\n this.setupEventName();\n this.transformBookings();\n }\n\n public hourClicked(event: CalendarClickEvent) {\n // convert the calender local input to the building times\n const buildingStartDate = convertLocalTimestampToTimezonedDateTz(\n event.date.valueOf(),\n this.timezone\n ); // return building time\n let startTz = buildingStartDate.clone();\n let endTz = startTz.addValue({ minutes: this.pendingDuration });\n\n if (buildingStartDate.ms < Date.now()) {\n // compare building time to now\n // Abandon past events\n return;\n }\n\n // this.pendingDate is in building time\n if (this.pendingDateTz.ms !== startTz.ms) {\n // comparing building to building\n // Setup and Breakdown\n if (this.currentBooking) {\n const setup = this.currentBooking.setup[this.currentBooking.space.email] || 0;\n if (setup) {\n startTz = startTz.subtractValue({ seconds: setup });\n }\n const breakdown =\n this.currentBooking.breakdown[this.currentBooking.space.email] || 0;\n if (breakdown) {\n endTz = endTz.addValue({ minutes: breakdown });\n }\n }\n\n // check existing events\n const booked = this.events.filter((e) => e.draggable === false);\n // building start and end time but localized bookings\n const conflict = this.hasConflict(startTz, endTz, booked);\n if (conflict) {\n // Abandon updates if conflict\n this.transformBookings();\n return;\n }\n\n this.pendingChange = true;\n this.pendingDateTz = buildingStartDate; // building time\n\n this.setupEventName();\n this.transformBookings();\n }\n }\n\n public displayConfirmationModal() {\n this.modal_data = {\n pendingDateTz: this.pendingDateTz, // building time , new time\n pendingDuration: this.pendingDuration,\n dateTz: this.dateTz, // building time, existing time\n duration: this.duration,\n space: new Space(this.space),\n rules: this.rules,\n bookingId: this.bookingId,\n currentBooking: this.currentBooking,\n };\n\n const dialogRef = this.dialog.open(RoomAvailabilityPreviewModalComponent, {\n data: this.modal_data,\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n\n dialogRef.componentInstance.submitForm.subscribe((d: any) => {\n // Apply the confirmed changes\n this.pendingChange = true;\n this.pendingDateTz = d.dateTz;\n this.pendingDuration = d.duration;\n\n dialogRef.componentInstance.applyChanges({\n dateTz: d.dateTz,\n duration: this.pendingDuration,\n pendingDateTz: this.pendingDateTz,\n pendingDuration: this.pendingDuration,\n });\n this.setupEventName();\n this.transformBookings();\n // Change View\n this.setCalendarValue(d.dateTz);\n });\n\n dialogRef.afterClosed().subscribe((d) => {\n // Update the current with pending record\n if (d) {\n // convert the local input values returned into the same time in the building timezone\n const buildingDate = convertLocalTimestampToTimezonedDateTz(\n d.dateTz.ms,\n this.timezone\n );\n this.dateTz = buildingDate;\n this.duration = d.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(buildingDate.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.confirmChanges.emit({ ...d, mobile: this.mobile, save: true });\n } else {\n // this is ok\n const md = this.modal_data;\n this.dateTz = md.dateTz;\n this.duration = md.duration;\n this.pendingDateTz = md.dateTz;\n this.pendingDuration = md.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(md.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n // This is reverting the changes\n this.confirmChanges.emit({\n dateTz: md.dateTz,\n duration: this.duration,\n mobile: this.mobile,\n save: !!d,\n });\n this.setupEventName();\n this.transformBookings();\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = this.viewDateTz;\n this.setDislayValues();\n }\n });\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public scrollTo() {\n if (this.scrollFired) return;\n this.timeout(\n 'scroll_to',\n () => {\n const ele = document.getElementById('calendarScrollContainer');\n if (ele) {\n ele.scrollTo({\n top: this.dayStartHour * 64,\n left: 0,\n behavior: 'smooth',\n });\n this.scrollFired = true;\n }\n },\n 500\n );\n }\n\n public toggleDatePicker() {\n this.showDatePicker = !this.showDatePicker;\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n // Reset to the initial view\n this.pendingDateTz = this.dateTz; // = new Date(this.date);\n this.pendingDuration = this.duration;\n this.viewDateTz = new DateTZ({ \n date: DateTime.fromISO(this.dateTz.formatDate('yyyy-MM-dd'))\n }).setValue({ hour: 12, minute: 0 })\n this.pendingChange = false;\n this.setupEventName();\n this.transformBookings();\n this.dayRefresh.next();\n }\n\n public calendarBack() {\n let today = this.alternativeWeekStartDateTz; // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.subtractValue({ days: 1 });\n } else {\n today = today.subtractValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarSpan() {\n let today = this.pendingDateTz; // new DateTZ({date: this.pendingDate.valueOf()});\n if (this.mobile || !this.expanded) {\n this.date_span.start = today.startOfValue('day').ms;\n this.date_span.end = today.endOfValue('day').ms;\n } else {\n this.date_span.start = today.startOfValue('week').ms;\n this.date_span.end = today.endOfValue('week').ms;\n }\n }\n\n public calendarCenter() {\n let today = this.pendingDateTz.startOfValue('day');\n if (!this.mobile) {\n today = today.startOfValue('week');\n }\n\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public calendarForward() {\n let today = this.alternativeWeekStartDateTz // new DateTZ({date: this.alternativeWeekStartDate});\n if (this.mobile) {\n today = today.addValue({ days: 1 });\n } else {\n today = today.addValue({ weeks: 1 }).startOfValue('day');\n }\n this.updateCalendarWeekView.emit(today);\n this.weekRefresh.next();\n this.alternativeWeekStartDateTz = today;\n this.setDislayValues();\n }\n\n public toggleWeekend() {\n this.showWeekend = !this.showWeekend;\n this.setupEventName();\n }\n}\n","
\n
\n \n \n
\n
\n \n \n
\n
\n
\n

Room Availability

\n

{{space.local_name}}

\n

{{building?.name}}, {{level?.name}}, {{building?.address}}

\n
\n
\n
\n
\n \n \n \n
\n
\n {{weekViewRangeText}}\n \n \n
\n \n Show Weekend\n \n
\n
\n
\n \n\n \n
\n \n {{ day.date | calendarDate:'weekViewColumnHeader':locale }} {{ day.date | calendarDate:'weekViewColumnSubHeader':locale }}\n

{{ isEventDate(day) ? '(Current Selection)' : '' }}

\n
\n
\n \n\n \n \n
\n
\n
\n
\n \n \n &ngsp;\n \n \n
\n \n
\n
\n
\n\n
\n
\n \n \n
\n
\n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport {\n BehaviorSubject,\n Observable,\n of,\n Subject\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n first,\n map,\n switchMap,\n take,\n withLatestFrom,\n} from 'rxjs/operators';\nimport {\n Store\n} from '@ngrx/store';\nimport {\n checkCollisions,\n Booking,\n User,\n UsersService,\n BookingFormData,\n selectActiveForm,\n SpacesService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n matchToHighlight\n} from '@mckinsey-converge/base';\n\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\n@Component({\n selector: 'app-room-booking-details-form',\n templateUrl: './room-booking-details-form.component.html',\n styleUrls: ['./room-booking-details-form.component.scss']\n})\nexport class RoomBookingDetailsFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n public formRef: FormGroupDirective;\n /** Number of characters needed before a search will start */\n @Input() public limit = 3;\n /** When the value changes, the form is submitted */\n @Input() public triggerSubmit = '';\n /** Need booking details */\n @Input() public booking: Booking = null;\n /** Data returned to parent */\n @Output() public submitForm = new EventEmitter();\n /** Data returned to parent */\n @Output() public validateForm = new EventEmitter();\n /** Current User */\n public currentUser: User;\n /** Host list to display */\n public host_list: User[];\n /** User list to display from the Attendees search */\n public user_list: User[];\n /** Whether user list is loading */\n public loading: boolean;\n /** Whether to show the attendees hint */\n public showHint = false;\n /** Attendee Input / Search String */\n public searchString: string;\n /** List of users from an API search */\n public searchResults: Observable;\n /** Subject holding the value of the search */\n public searchSubject = new Subject();\n /** Host field options */\n public hostOptions = [];\n /** Attendees options */\n public options = new BehaviorSubject[]>([]);\n /** Selected Attendees */\n public selectedOptions = new BehaviorSubject[]>([]);\n public selectedUsers = new BehaviorSubject[]>([]);\n public needs_charge_code = false;\n public has_delegate = false;\n public available: boolean = null;\n public notesHandle = null;\n public noteValidationClass = '';\n public selectedCompanies = new BehaviorSubject[]>([]);\n public companyOptions = new BehaviorSubject[]>([]);\n\n /** Data collected on this form */\n public bookingFormGroup = new FormGroup({\n organiser: new FormControl(),\n title: new FormControl('', [ Validators.minLength(1)]), //Validators.pattern(\"[^=`~!@#$%*{};:'\\\",_.<>]*\")\n attendees: new FormControl(),\n code: new FormControl('', [Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]),\n notes: new FormControl(),\n head_count: new FormControl(1, [Validators.required, Validators.min(1)]),\n user_list: new FormControl(),\n host_list: new FormControl(),\n company: new FormControl(),\n opt_out: new FormControl(),\n outlook_opt_out: new FormControl(),\n\n });\n action: string;\n // Indecates that processing request to check availability of breakdown if special requirement being added by user\n checkingBreakdown: boolean = false;\n\n public get invalid_charge_error(): string {\n if (this.bookingFormGroup.controls.code.errors?.required) {\n return 'Charge Code is required';\n }\n if (this.bookingFormGroup.controls.code.errors?.minlength) {\n return 'Charge Code must be at least four characters';\n }\n if (this.bookingFormGroup.controls.code.errors?.pattern) {\n return 'Charge Code cannot contain spaces or special characters';\n }\n return '';\n }\n\n public get headCountControl(): AbstractControl {\n return this.bookingFormGroup.get('head_count');\n }\n\n constructor(\n private _spaces: SpacesService,\n private _snackBar: MatSnackBar,\n private store: Store,\n vcRef: ViewContainerRef,\n private _service: ApplicationService,\n private _users: UsersService) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this._users.initialised.pipe(first((_) => _)).subscribe(() => {\n const user: User = this._users.current;\n const delegates = user.delegates.map((del) => {\n // the kludgy or new User is for when the user service isn't ready.\n const ifUser = this._users.find(del.email);\n return ifUser ? \n new User({ email: ifUser.email, name: ifUser.name, opt_out: del.opt_out }) : \n new User({ email: del.email, name: del.email.split('@')[0].split('_').map((s) => s.charAt(0).toUpperCase() + s.substring(1))\n .join(' ')\n , opt_out: del.opt_out });\n\n // (del) => new User({ email: del.email, name: del.email.split('@')[0].split('_').join(' '), opt_out: del.opt_out })\n });\n if (delegates.length) {\n this.has_delegate = true;\n }\n this.host_list = [user].concat(delegates);\n this.hostOptions = this.host_list.map(h => ({ display: h.name, value: h.email, meta: { user: h } }));\n });\n\n // if we have an active form, refill the information here once.\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // Get the Equipment charge code mandatory requirement\n const { filters, settings } = next.selectedRoom?.space;\n const roomBasedEqCode = filters?.equipment_code || settings?.equipment_code;\n const officeBasedEqCode = next.selectedRoom?.building?.required?.equipment_code;\n this.needs_charge_code = roomBasedEqCode !== undefined ? roomBasedEqCode : officeBasedEqCode !== undefined ? officeBasedEqCode: false;\n \n\n if (this.needs_charge_code) {\n this.bookingFormGroup.controls.code.setValidators([Validators.required, Validators.minLength(4), Validators.pattern(/^[a-zA-Z0-9]*$/)]);\n }\n // build the initial options\n const options = [];\n const attendees = next?.attendees || [];\n const organiser = next?.organiser || { display: this.currentUser.name , value: this.currentUser.email, meta: { external: false, user: this.currentUser }};\n const company = next?.company || [];\n\n const opt_out = next?.opt_out || false;\n const outlook_opt_out = next?.outlook_opt_out || false;\n this.action = next.action || 'new';\n // Load the saved form\n this.bookingFormGroup.setValue({\n organiser,\n title: next.title || '',\n attendees, // options will display current user\n code: next.code || '',\n notes: next.notes || '',\n head_count: next.head_count || '',\n user_list: [],\n host_list: [],\n company,\n opt_out: opt_out,\n outlook_opt_out\n });\n this.selectedOptions.next(attendees);\n this.options.next(attendees);\n this.selectedCompanies.next(company);\n this.companyOptions.next(company);\n }\n })\n );\n\n // Listen for input changes\n this.searchResults = this.searchSubject.pipe(\n debounceTime(500),\n distinctUntilChanged(),\n switchMap((query) => {\n this.loading = true;\n return query.length >= this.limit\n ? this._users.query({\n q: query,\n cache: 60 * 1000\n })\n : Promise.resolve([]);\n }),\n catchError((_) => of([])),\n map((list: User[]) => {\n this.loading = false;\n return list;\n })\n );\n\n // Process API results\n this.subscription(\n 'search_results',\n this.searchResults.subscribe((list) => {\n this.user_list = list;\n this.user_list.forEach((i: any) => {\n i.match_name = matchToHighlight(i.match_name);\n i.match_email = matchToHighlight(i.match_email);\n return i;\n });\n\n // Build options from returned users\n const options = this.user_list.map(u => {\n return {\n value: u.email,\n display: `${u.name} ${u.email}`,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: `${u.name}`,\n meta: { external: false, user: u },\n };\n });\n // Add the manual option to the beginning of the array\n options.unshift({\n value: this.searchString,\n display: this.searchString,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: this.searchString,\n meta: { external: true, user: null },\n });\n // this.loading = false;\n this.options.next(options);\n })\n );\n\n this.bookingFormGroup.valueChanges.subscribe(val => {\n\n clearTimeout(this.notesHandle);\n if (val?.notes?.length) {\n this.checkingBreakdown = true;\n \n // Check for conflicts if adding a note and default setup and breakdown times.\n this.notesHandle = setTimeout(() => {\n this.validateForm.emit(false);\n const booking = this.booking.clone();\n const setup = {};\n setup[booking.space.email] = booking.setup[booking.space.email] || 900;\n const breakdown = {};\n breakdown[booking.space.email] = booking.breakdown[booking.space.email] || 900;\n\n const mockBooking = new Booking({\n id: booking.id,\n room: booking.space,\n start_epoch: booking.startDateTz.seconds,\n end_epoch: booking.endDateTz.seconds,\n setup,\n breakdown,\n });\n\n checkCollisions(\n this._spaces,\n mockBooking\n ).then((bookable: boolean) => {\n this.checkingBreakdown = false;\n this.available = bookable;\n // this.validateForm.emit(true);\n this.validateForm.emit(this.bookingFormGroup.valid);\n this.noteValidationClass = bookable === false ? 'booked' : 'available';\n // this.loading = false;\n }).catch(() => {\n this.checkingBreakdown = false;\n this.available = false;\n this.validateForm.emit(false);\n this.noteValidationClass = 'booked';\n // this.loading = false;\n\n return;\n });\n }, 200);\n } else {\n this.checkingBreakdown = false;\n this.available = null;\n this.noteValidationClass = '';\n this.validateForm.emit(this.bookingFormGroup.valid);\n }\n\n });\n }\n\n public setOrganiserOptOut(opt_out) {\n this.bookingFormGroup.controls.opt_out.setValue(opt_out);\n }\n\n public updateOrganiser(user) {\n console.log(user);\n }\n\n /** Listen for changes */\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n /**\n * \n * @param key : formcontrol name \n * Function trim value being submitted with only spaces/beginning/end \n */\n public trim(key: string): void {\n this.bookingFormGroup.get(key).setValue(this.bookingFormGroup.get(key).value.trim());\n }\n\n /** Toggle an attendee on/off */\n public toggle(option: SelectOption) {\n const inputValue = option.value\n .split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n let inputValueEmail = '';\n // Check if inputValue is a valid email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(inputValue)) {\n // If not, replace all spaces with underscores and append a random guest email string\n inputValueEmail = inputValue.replace(/\\s+/g, '_') + `${Math.floor(Math.random() * 99999)}@guest.mckinsey.com`;\n }\n\n // Check for character limit\n if (\n // this.selectedOptions.value.some((option: SelectOption) => option.value === inputValue) ||\n inputValue.length > 50\n ) {\n this._service.notifyWarn('Attendee name cannot exceed 50 characters');\n return;\n }\n\n this.selectedOptions\n .pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n let opts = selectedOptions.slice();\n const found = opts.some((v) => inputValue === v.value);\n if (found) {\n opts = opts.filter((v) => inputValue !== v.value);\n } else {\n const color = inputValue.toLowerCase().includes('mckinsey.')\n ? 'internal'\n : 'external';\n opts.push({\n ...option,\n value: inputValueEmail,\n display: inputValue,\n shortDisplay: inputValue,\n meta: {\n ...option.meta,\n color,\n },\n });\n }\n\n return opts;\n })\n )\n .subscribe((next) => {\n if (!this.bookingFormGroup.controls.head_count.touched) {\n this.bookingFormGroup.controls.head_count.setValue(next.length + 1);\n }\n this.selectedOptions.next(next);\n });\n }\n\n public clearHeadcount() {\n this.headCountControl.setValue(1);\n }\n\n /** Return the data to the listening parent */\n public onSubmitForm() {\n this.bookingFormGroup.markAllAsTouched();\n // a bit of an issue that the form state isn't saved unless valid\n if (this.bookingFormGroup.valid) {\n const form_data = this.bookingFormGroup.value;\n form_data.user_list = this.user_list;\n form_data.host_list = this.host_list;\n form_data.has_delegate = this.has_delegate;\n this.submitForm.emit(form_data);\n }\n }\n\n /** Take the input and feed it back to the parent to add to attendees array */\n public updateAttendeeOptionsFromUserInput(v: string) {\n const l = v.length;\n const options = this.selectedOptions.value.slice();\n if (!l) {\n this.options.next([]);\n return;\n }\n if (l > 2) {\n // Triggers the API call to search for the user input\n this.searchSubject.next(v);\n }\n\n options.unshift({\n value: v,\n display: v,\n groupId: 'one',\n groupHeader: true,\n shortDisplay: v,\n meta: { external: true },\n });\n this.searchString = v;\n this.options.next(options);\n }\n\n public toggleAttendeesHint() {\n this.showHint = !this.showHint;\n }\n\n public updateCompanyOptionsFromUserInput(v: string) {\n if (!v.length) {\n this.companyOptions.next([]);\n return;\n }\n this.companyOptions.next([{\n value: v,\n display: v,\n groupId: 'two',\n groupHeader: true,\n shortDisplay: v,\n }]);\n }\n\n public toggleCompany(option: SelectOption) {\n this.selectedCompanies.pipe(\n take(1),\n withLatestFrom(this.companyOptions),\n map(([selectedCompanies, options]) => {\n let opts = selectedCompanies.slice();\n const found = opts.some(v => option.value === v.value);\n if (found) {\n opts = opts.filter(v => option.value !== v.value);\n } else {\n opts.push(option);\n }\n\n return opts;\n })\n ).subscribe(next => {\n this.selectedCompanies.next(next);\n });\n }\n}\n","\n
\n
\n
\n \n Meeting Title*\n \n \n \n \n
\n \n {{ ( bookingFormGroup?.get('title').errors && bookingFormGroup?.get('title').hasError('pattern')) ? 'Some special characters (^=`~!@#$%*{};:\\'_\\\",.\\<>) are not allowed' : 'Meeting Title is required'}}\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n Opt out email notification \n
\n \n
\n\n\n \n\n
\n \n \n \n Why do we need this?\n
\n
\n Attendee emails are used for visitor management purposes.\n Converge won't send any emails to attendees.\n
\n \n
\n\n
\n
\n \n \n
\n
\n \n Charge Code{{ needs_charge_code ? '*' : '' }}\n \n \n \n \n
\n \n {{ invalid_charge_error }}\n \n
\n
\n
\n
\n \n Headcount estimate*\n \n \n \n \n
\n \n Headcount is required\n \n
\n
\n
\n
\n\n
\n
\n \n Additional requirements (e.g room setup, equipment...)\n \n \n \n \n \n \n

Checking breakdown availability for selected date/time...

\n

\n \n A set up and breakdown time of 15 mins was added to either side\n of your booking to cater for these additional requirements.\n

\n

\n \n A set up and break down time of 15mins was added to either side of your booking to cater for these additional requirements. This has resulted in a conflict with another booking. Please adjust your booking accordingly.\n

\n
\n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n OnChanges,\n Output,\n ViewContainerRef,\n ViewChild\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n FormGroupDirective,\n Validators\n} from '@angular/forms';\nimport { MatSnackBar } from '@angular/material/snack-bar';\n\nimport { closestToTimeSlot, closestToTimeSlotTz, resetSecondsOnTimestamp } from '@mckinsey-converge/base';\n\nimport {\n distinctUntilChanged,\n map,\n skip,\n take,\n withLatestFrom\n} from 'rxjs/operators';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingCity,\n flattenDisplayOffices,\n toggleSelectedByGroup,\n storeBookingFormData,\n BookingFormData,\n bookingTypeOptions,\n DEFAULT_BOOKING_DURATION,\n defaultRoomSizeOption,\n internalBookingTypeOption,\n roomSizeOptions,\n selectActiveForm,\n ApplicationService,\n roomSizeOptionsKiosk,\n\t\tRecurrencePeriod,\n generateBookingForm,\n SeriesAction,\n setRecurrenceStartsTime\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject } from 'rxjs';\nimport {\n BaseTemplateComponent,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Booking } from '../../../../../../libs/data-common/src';\nimport * as cloneDeep from 'lodash/cloneDeep';\n@Component({\n selector: 'app-room-booking-form',\n templateUrl: './room-booking-form.component.html',\n styleUrls: ['./room-booking-form.component.scss']\n})\nexport class RoomBookingFormComponent extends BaseTemplateComponent implements OnInit, OnChanges {\n @ViewChild('formRef')\n formRef: FormGroupDirective;\n\n @Output()\n public submitForm = new EventEmitter();\n\n @Input()\n public showCancel = false;\n\n @Input()\n public triggerSubmit: number;\n\n /**\n * Used only if showCancel is true.\n */\n @Output()\n public cancelSubmit = new EventEmitter();\n\n // fromDate is the selected date\n public fromDate: number = closestToTimeSlot(DateTime.now(), 15).valueOf(); // R--- depreciate\n /** DateTZ object of the date and time that the date and time picker will begin it's options from */\n public fromDateTz: DateTZ = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15);\n public bookingTypeOptions = bookingTypeOptions;\n public roomSizeOptions = roomSizeOptions;\n public localTimezone = DateNow(new Date()).building_tz;\n public localStart = \"\";\n public localEnd = \"\"\n\n public formGroup: FormGroup = new FormGroup({\n id: new FormControl('', []), // used in case of recurring series edit\n location: new FormControl([], [Validators.required]),\n date: new FormControl(this.fromDate, [Validators.required]),\n dateTz: new FormControl(this.fromDateTz, [Validators.required]), // starts out as the next closest available time interval\n duration: new FormControl(DEFAULT_BOOKING_DURATION, [Validators.required]),\n bookingType: new FormControl(internalBookingTypeOption),\n roomSize: new FormControl(defaultRoomSizeOption),\n selectedRoom: new FormControl({}),\n timezone: new FormControl(\"\"),\n offset: new FormControl(\"\"),\n\n\t\trecurrence_period: new FormControl(RecurrencePeriod.WEEKLY),\n recurrence_interval: new FormControl( 1),\n recurrence_endTz: new FormControl( new DateTZ({ date: 1 }).addValue({days: 1})),\n recurrence_count: new FormControl( 0),\n is_recurrent: new FormControl(null),\n recurrence_starts: new FormControl( []),\n recurrence_exceptions: new FormControl([]),\n recurrence_pattern: new FormControl(RecurrencePeriod.WEEKLY), //Helper value to store the last selected pattern (daily, weekly, monthly),\n recurrence_days: new FormControl( []),\n\n ignore: new FormControl('', []), // used in case of recurring series edit\n // TODO, there's a few missing from interface BookingFormData, libs/data-common/src/lib/booking/booking.form.data.ts\n });\n\n\n public options = new BehaviorSubject[]>([]);\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n constructor(private store: Store,\n // private _service: ApplicationService,\n vcRef: ViewContainerRef, \n private _snackBar: MatSnackBar,\n private _service: ApplicationService,\n ) {\n super(vcRef);\n // if(this._service?.kioskFormFilter) {\n // this.formGroup.setValue({\n // roomSize: roomSizeOptions[3]\n // })\n // }\n }\n\n public ngOnInit(): void {\n\n\n super.ngOnInit();\n // R--- Complicated, need the TZ aware inputs and to not init those inputs until the building timezone is available.\n // R--- See if there's any way to make the timezone retrieval less fragile.\n\n // if we have an active form, refill the information here once.\n // Doesn't run on initial steps, only if you go back to the home page\n this.subscription('reduxData', this.store.select(selectActiveForm)\n .pipe(take(1))\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set the fromDate correctly\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15); // R--- shouldn't this actually be the current date start of day to make all the options available?\n\n const form = cloneDeep(next);\n this.formGroup.patchValue({\n ...form,\n }, { emitEvent: true });\n\n // this.formGroup.markAllAsTouched();\n // this.formGroup.updateValueAndValidity();\n\n }\n })\n );\n\n // R--- I only see this fire when the modal opens or going to the home page\n this.subscription('formChanges', this.formGroup.valueChanges\n .pipe(\n skip(1), // initial form changes\n distinctUntilChanged())\n .subscribe((next) => {\n const timezone = next.timezone || this.localTimezone\n /**\n * When the selected date changes update the time picker's start time\n * to the nearest available slot of the current day\n */\n this.fromDateTz = next.is_recurrent ? next.dateTz : closestToTimeSlotTz(DateNow(), 15);\n\n /**\n * When the new selected date arrives, update the coachmark displayed below the date time picker\n */\n this.updateCoachmarkTimes(timezone);\n\n })\n );\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n )\n .subscribe(next => {\n this.options.next(next);\n }));\n }\n\n public ngOnChanges(changes: any) {\n if (changes.triggerSubmit && this.formRef) {\n // Trigger the form submit and validation\n this.formRef.onSubmit(undefined);\n }\n }\n\n public onSubmitForm() {\n if(this.formGroup.controls?.is_recurrent?.value){\n setRecurrenceStartsTime(this.formGroup)\n }\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const is_past = this._checkDateInPast();\n if (is_past) {\n this._service.notifyWarn('Start Time updated to after current time, please click search again.');\n return;\n } else {\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(formGroupData.dateTz.ms),\n dateTz: formGroupData.dateTz.setValue({ millisecond: 0, second: 0 })\n });\n }\n this.formGroup.markAllAsTouched();\n if (this.formGroup.valid) {\n this.submitForm.emit(this.formGroup.value);\n }\n }\n\n // public openSnackBar(message: string, action: string) {\n // this._snackBar.open(message, action, {\n // duration: 5000,\n // panelClass: ['yellow-snackbar']\n // });\n // }\n\n // Fires when the location selector value is changed\n public toggle(option: SelectOption) {\n // update the selected value\n this.selectedOptions.pipe(\n take(1),\n withLatestFrom(this.options),\n map(([selectedOptions, options]) => {\n return toggleSelectedByGroup(options, selectedOptions, option);\n })\n ).subscribe(next => {\n // deselecting the location option sets the timezone to local so convert.\n const formGroupDate = this.formGroup.value;\n if (!next.length) {\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: this.localTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(this.localTimezone)\n });\n } else {\n const buildingTimezone = next[0]?.meta?.building?.timezone || next[0]?.meta?.city?.timezone;\n this.formGroup.setValue({\n ...this.formGroup.value,\n timezone: buildingTimezone,\n date: formGroupDate.dateTz.ms,\n dateTz: formGroupDate.dateTz.toZone(buildingTimezone)\n });\n }\n this._checkDateInPast();\n // Must fire last or location picker will be buggy.\n this.selectedOptions.next(next);\n });\n }\n\n private _checkDateInPast() {\n // Check for past date time\n const formGroupData = this.formGroup.value;\n const date = new DateTZ({ date: this.formGroup.value.dateTz.ms, building_tz: formGroupData.timezone, is_local_tz:false }).addValue({ seconds: 30 })\n const now = DateNow(new Date())\n if (now.isAfterDate(date)) {\n // Reset the start time if in the past\n const closestTz = closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false, building_tz: formGroupData.timezone }).addValue({ minutes: 1 }), 15)\n const prevClosestTz = closestTz.subtractValue({minutes: 15})\n const prevDateTz = prevClosestTz.addValue({ seconds: 30 });\n // R-- why do I do this on submit? move to a another method.\n if(now.isAfterDate(prevDateTz)){\n this.fromDateTz = closestTz;\n }else{\n this.fromDateTz = prevClosestTz;\n }\n\n this.formGroup.setValue({\n ...formGroupData,\n date: resetSecondsOnTimestamp(this.fromDateTz.ms),\n dateTz: this.fromDateTz.setValue({ millisecond: 0, second: 0 })\n });\n return true;\n }\n return false;\n }\n\n private updateCoachmarkTimes(timezone: string) {\n // Resolve the problem that locally I might have the same TZ offset but the names don't match.\n const localTzOffset = DateTime.now().setZone(this.localTimezone).offset;\n const buildingTzOffset = DateTime.now().setZone(timezone).offset;\n\n this.fromDateTz = new DateTZ({ date: this.fromDateTz.ms, is_local_tz: false, building_tz: timezone });\n\n if (localTzOffset !== buildingTzOffset) {\n const startDate = this.formGroup.value.dateTz.clone();\n this.localStart = startDate.formatLocalDate(\"h:mma\");\n this.localEnd = startDate.addValue({ minutes: this.formGroup.value.duration }).formatLocalDate(\"h:mma\");\n } else {\n // No location is selected so coachmark is hidden\n this.localStart = \"\";\n this.localEnd = \"\";\n }\n }\n}\n","\n
\n \n\n\n
\n \n\n \n \n \n \n
\n Please be aware that this booking starts at {{localStart}} and ends at {{localEnd}} in your local timezone.\n
\n
\n\n
\n
\n Recurring booking\n
\n \n \n\n
\n\n \n\n \n \n \n \n \n
","import { Component, ViewEncapsulation, Inject } from '@angular/core';\nimport { BookingFormData, storeBookingFormData, SeriesAction} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { Store } from '@ngrx/store';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\n// import { Router, ActivatedRoute } from '@angular/router';\n\n@Component({\n selector: 'app-room-booking-modal',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-booking-modal.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomBookingModalComponent extends BaseDirective {\n public trigger = Date();\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) private _data: any ) {\n super();\n }\n\n public triggerSubmit() {\n this.trigger = Date();\n }\n\n public submitForm(next: BookingFormData) {\n /// submit\n\n const ignore = this._data?.action === SeriesAction.EDIT ? next.id : null;\n const bookable = this._data?.action === SeriesAction.EDIT || null;\n\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next,\n ignore, // ignore id in case of recurring edit series\n bookable, // true in case of recurring edit series\n action: this._data?.action || '' // 'edit' in case of recurring edit series\n }\n }));\n this.close('DoNotClearActiveForm'); // do not clear active form if for submit as form need forther in result module\n this._data && this._data.navigateTo && this._data.navigateTo(); // navigate to result in case of staff recurring edit\n\n }\n\n public close(flag: string = '') {\n this.dialogRef.close(flag);\n }\n}\n","import {\n Component,\n OnInit,\n OnDestroy\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n AlertMode,\n SelectOption\n} from '@mckinsey-converge/ui';\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BaseDirective,\n dateBuildingFormatString,\n} from '@mckinsey-converge/base';\nimport {\n Booking,\n User,\n Building,\n BuildingCity,\n IEngineResponse,\n flattenDisplayOffices,\n selectCancelledBookingsResultsFromState,\n selectHomepageBookingsResultsFromState,\n selectPastBookingsResultsFromState,\n BookingStoreState,\n BookingFormData,\n clearBookingFormData,\n storeBookingFormData,\n BookingsService\n} from '@mckinsey-converge/data-common';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { Urls } from 'src/app/utilities/urls';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { BookingDetailsModalComponent } from '../booking-details-modal/booking-details-modal.component';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\nimport { loadBookingsWithQuery, MyBookingsStoreState } from '@mckinsey-converge/bookings';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport {\n BehaviorSubject,\n} from 'rxjs';\nimport {\n distinctUntilChanged,\n elementAt,\n map,\n take,\n} from 'rxjs/operators';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n mapResultsToViewModels,\n BookingResultsViewModel\n} from 'src/app/booking/manage-bookings/manage-bookings.viewmodel';\nimport {\n buildingStateSelector,\n selectBuildingOptionsGroupedByCity\n} from '@mckinsey-converge/buildings';\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\nexport type RoomBookingStoreState = BookingStoreState & BuildingStoreState & MyBookingsStoreState & UserStoreState;\n\n@Component({\n selector: 'app-room-booking',\n template: `\n
\n
\n \n \n
\n
\n
\n
\n

Meeting Room Booking

\n
\n \"Booking\n
\n
\n
\n
\n
\n \n \n \n \n
\n
\n
\n

Your Bookings

\n
\n
\n \n
You have no upcoming bookings
\n
\n
\n \n \n
\n
\n \n \n \n \n
\n
\n \n Manage\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-booking.component.scss']\n})\nexport class RoomBookingComponent extends BaseDirective implements OnInit, OnDestroy {\n public TopBarHeaderMode = TopBarHeaderMode;\n public AlertMode = AlertMode;\n\n public width = 16;\n\n // public showBanner = true;\n public showBookings = false;\n public showManageButtonA = false;\n public showManageButtonB = false;\n public showManageButtonC = false;\n public dateString: string;\n\n public homepageBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public pastBookingResults = new BehaviorSubject>(LoadingModel.empty());\n public upcomingBookings: BookingResultsViewModel[];\n public buildings = new BehaviorSubject[]>([]);\n public reloading = false;\n\n /** Current User */\n public currentUser: User;\n master_booking: BookingResultsViewModel;\n allBookings: any[];\n\n constructor(private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _bookings: BookingsService,\n private dialog: MatDialog) {\n super();\n this.dateString = dateBuildingFormatString(DateNow(new Date()));\n }\n\n public ngOnDestroy() {\n if (typeof window === 'object') {\n window.onbeforeunload = undefined;\n }\n\t\t\t\t// clear interval\n\t\t\t\tthis.clearInterval('refreshBookings');\n }\n\n public ngOnInit(): void {\n // only run on window onload\n if (typeof window === 'object') {\n window.onbeforeunload = (event) => {\n const e = event || window.event;\n this.store.dispatch(clearBookingFormData())\n return e;\n };\n }\n\n this.store.dispatch(loadOrganisations.request());\n\n this.subscription('buildings', this.store.pipe(\n select(buildingStateSelector),\n select(selectBuildingOptionsGroupedByCity),\n map((grouped: Map) => {\n return flattenDisplayOffices(grouped);\n }),\n distinctUntilChanged()\n ).subscribe(next => {\n this.buildings.next(next);\n // console.log('on buildings ')\n // this.refresh('homepage');\n }));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User) => {\n // Once we know we have the user loaded\n this.currentUser = new User(user);\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, 'target': 'homepage' }));\n // start the timer at the top of the minute;\n // const offset = DateNow(new Date()).startOfValue('minute').addValue({ minutes: 1 }).ms - DateNow(new Date()).ms;\n // fetch it on one minute interval now that there is room data.\n // setTimeout(() => {\n // console.log('on setTimeout ')\n // this.refresh('homepage')\n this.interval('refreshBookings', () => {\n\t\t\t\t\t\t\t\t\t\t\tthis.refresh('homepage')\n\t\t\t\t\t\t\t\t\t\t}, 60 * 1000);\n // }, offset + 5000)\n\n })\n );\n\n this.reloading = true;\n this.subscription('homepageResults', this.store.pipe(\n select(selectHomepageBookingsResultsFromState)\n ).subscribe(next => {\n // this.reloading = true;\n this.homepageBookingResults.next(next);\n if (!next.isEmpty() && next.success && Array.isArray(next.success.results) && next.success.total) {\n this.reloading = false;\n this.showManageButtonA = true;\n this.upcomingBookings = mapResultsToViewModels(next.success.results).filter(b => !(b.booking.is_recurrent && b.booking.recurrence_type === 'master'));\n this.allBookings = next.success.results;\n\n if (this.upcomingBookings.length) {\n this.showBookings = true;\n }\n } else {\n this.reloading = false;\n this.showManageButtonA = false;\n this.upcomingBookings = [];\n this.showBookings = false;\n }\n }));\n\n this.subscription('pastResults', this.store.pipe(\n select(selectPastBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonB = true;\n }\n }));\n\n this.subscription('cancelledResults', this.store.pipe(\n select(selectCancelledBookingsResultsFromState)\n ).subscribe(next => {\n if (!next.isEmpty() && next.optionalSuccess?.total) {\n this.showManageButtonC = true;\n }\n }));\n }\n\n public showResults() {\n // Don't show the loading state while we're reloading with Building details.\n return !this.reloading; //|| this.homepageBookingResults.value.hasLoaded();\n }\n\n public getBuilding(booking: Booking) {\n if (this.buildings && booking.building_zone) {\n return this.buildings.value.find(b => booking.building_zone === b.value)?.meta.building;\n }\n return '';\n }\n\n // public hideBanner() {\n // this.showBanner = false;\n // }\n\n public learnMore() {\n window.open(Urls.LearnMore);\n }\n\n public routeToResults(next: BookingFormData) {\n this.store.dispatch(storeBookingFormData({\n payload: {\n ...next\n }\n }));\n this.store.dispatch(loadRoomsForResults.clear());\n this.router.navigate(['results'], { relativeTo: this.route });\n }\n\n public routeToManageBookings() {\n this.router.navigate(['manage'], { relativeTo: this.route });\n }\n\n public refresh(target: string) {\n if (!this.currentUser?.email) {\n return;\n }\n\n // tslint:disable-next-line: max-line-length\n this.store.dispatch(loadBookingsWithQuery({ 'email': this.currentUser.email, 'from': DateNow(new Date()).ms, target }));\n }\n\n\n\t\t/**\n\t\t * Displays detailed information about a booking in a modal dialog.\n\t\t * If the booking is part of a recurring series, it retrieves the master booking\n\t\t * details and displays them along with the selected booking. The modal allows\n\t\t * users to view and interact with the booking details. After the modal is closed,\n\t\t * it checks for special flags to determine if the active form and result data should be cleared.\n\t\t *\n\t\t * @param {BookingResultsViewModel} viewModel - The view model containing booking information to display.\n\t\t */\n public async viewBooking(viewModel: BookingResultsViewModel) {\n\n\t\t\t// Handle logic for recurring bookings to fetch the master booking details\n \t// and set the master_booking property for displaying in the modal\n\t\t\tif(viewModel.booking.is_recurrent) {\n\t\t\t\t\tlet booking = this.allBookings.find(bkn => bkn.id === viewModel.booking.recurrence_master_id && bkn.recurrence_type === 'master1') ;\n\t\t\t\t\tif (!booking) {\n\t\t\t\t\t\t\tbooking = await this._bookings.show(viewModel.booking.recurrence_master_id);\n\t\t\t\t\t}\n\t\t\t\t\tthis.master_booking = mapResultsToViewModels([booking])[0];\n\t\t\t}\n\n\t\t\t// Open a modal dialog to display the booking details along with master booking (if applicable)\n\t\t\tconst dialogRefX = this.dialog.open(BookingDetailsModalComponent, {\n\t\t\t\t\tpanelClass: 'mck-modal-wide-manage-booking',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tbooking: viewModel.booking,\t// Selected booking information\n\t\t\t\t\t\t\tbuilding: this.getBuilding(viewModel.booking),\t// Building information for the booking\n\t\t\t\t\t\t\tmaster_booking: this.master_booking?.booking || null,\t// Master booking details (if available)\n\t\t\t\t\t\t\trefresh: () => {\n\t\t\t\t\t\t\t\t\tthis.refresh('homepage');\t// Function to refresh the homepage after modal closure\n\t\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tautoFocus: false,\n\t\t\t\t\tbackdropClass: 'mck-modal-backdrop',\n\t\t\t});\n\n\t\t\tdialogRefX.afterClosed().subscribe((flag) => {\n\t\t\t\t// Clear form and result data if the flag indicates it's necessary\n\t\t\t\t\tflag !== 'DoNotClearActiveForm' && this.clearFormAndResultData();\n\t\t\t});\n }\n\n\t\t/**\n\t\t * Clears active form and result data from the store.\n\t\t *\n\t\t * This function dispatches actions to clear the active form data and the loaded\n\t\t * rooms data from the store. It is typically used after a modal interaction or\n\t\t * a specific user action to reset the form state and loaded room information.\n\t\t */\n public clearFormAndResultData() {\n this.store.dispatch(clearBookingFormData());\n this.store.dispatch(loadRoomsForResults.clear());\n }\n\n\n}\n","import { Component, OnInit } from '@angular/core';\nimport {\n TopBarHeaderMode,\n RoutePayload,\n} from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n Booking,\n User,\n Space,\n BookingFormData,\n selectActiveForm,\n selectFilteredByIdResults,\n BookingStoreState,\n storeBookingFormData,\n DateDurationData,\n OrganisationService,\n SpaceConflictAlertModalData,\n SpaceStatus,\n filterSpacesByAppliedFilters,\n FilteredSpaces,\n Building,\n SpaceFilterReason,\n getLastDateFromList,\n RoomResultsViewModel,\n stringToMinutes,\n} from '@mckinsey-converge/data-common';\nimport {\n BaseDirective,\n dateBuildingFormatString,\n DialogEvent,\n shorterLocalDateFormatString,\n startEndTimeWithZoneFormatString,\n} from '@mckinsey-converge/base';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { distinctUntilChanged, take, throttleTime, tap, filter } from 'rxjs/operators';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { RoomStoreState, loadByIdResults } from '@mckinsey-converge/rooms';\nimport { Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport { DateNow, DateTZ } from '@mckinsey-converge/date-tz';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n ConflictAlertModalComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n} from '@mckinsey-converge/ui';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\nconst EMPTY_ARRAY = [];\n\n@Component({\n selector: 'app-room-details',\n templateUrl: './room-details.component.html',\n styleUrls: ['./room-details.component.scss'],\n})\nexport class RoomDetailsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n public booking: Booking;\n // @TODO get this from current settings.\n public backRoute: RoutePayload = {\n route: ['/home', 'results'],\n queryParams: { display: 'list' },\n };\n\n public data = new BehaviorSubject(undefined);\n public byIdResults = new BehaviorSubject(undefined);\n public open: boolean = true;\n // Set to a config once we know where the files are hosted.\n public rootFolderURL = 'assets/img/rooms/';\n // Set in the room availablity callback\n public mobile: boolean = false;\n public expandedLocation: boolean = false;\n public expandedAvailability: boolean = false;\n // Track event date changes in the UI in this param\n public alternativeWeekStartDateTz: DateTZ = new DateTZ();\n /** Current User */\n public currentUser: User;\n /** Display warning banner by default */\n public showInfoBanner: boolean = true;\n /** Space class created from subscribed active form room data */\n public room: Space;\n /** Requested booking start time from subscribed active form data */\n public requestedDateTz: DateTZ;\n /** Requested booking end time from subscribed active form data */\n public requestedEndDateTz: DateTZ;\n\n /** Track alert dialog should display's only once for not bookable or unavailable */\n private isAlertDisplayed: boolean = false;\n /** Update availability status of current rooom */\n public availabilityStatus: string;\n /** Space validity per rule */\n public isSpaceValidAsPerRule: FilteredSpaces;\n\n public orgBuildings: Building[] = [];\n /** Subtype of a room or space. */\n public roomSubtype: string = '';\n\n /* recurrence booking - occurence availability */\n public occurenceAvailability: string = '';\n // set property if user room selection from next business day section on result page\n public nextBusinessDay: boolean = false;\n\n constructor(\n private store: Store,\n private router: Router,\n private _org: OrganisationService,\n public dialog: MatDialog\n ) {\n super();\n /**\n * Router extras expecting from\n * On navigation from result or home page after QR code scan\n */\n if ( this.router.getCurrentNavigation() !== null && this.router.getCurrentNavigation().extras?.state?.payload ) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = this.router.getCurrentNavigation().extras.state.payload?.nextBusinessDay\n this.store.dispatch(storeBookingFormData({\n payload: this.router.getCurrentNavigation().extras.state.payload,\n })\n );\n }\n }\n\n public ngOnInit(): void {\n this.availabilityStatus = 'unavailable';\n this.orgBuildings = this._org.buildings;\n\n this.subscription(\n 'currentUser',\n this.store\n .select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n // set property if user room selection from next business day section on result page\n this.nextBusinessDay = next?.nextBusinessDay || false;\n\n this.data.next(next);\n // R--- selectedRoom could sure use some clarity, why is everything but the kitchen sink in there?\n if (!this.data.value?.selectedRoom || !this.data.value?.dateTz.ms) {\n return;\n }\n // Create a full fledged Space object since the selectedRoom.space is just JSON\n this.room = new Space(this.data.value?.selectedRoom?.space);\n\n // Check room validtion of selected room to maintain status on detail page\n this.checkAvailabiltyAsPerRule();\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n\n // Query for the entire day for this room\n this.fetchRooms(false);\n this.setRoomSubType();\n\n this.requestedDateTz = this.data.value?.dateTz;\n if (next.is_recurrent) {\n const { is_local_tz, building_tz} = this?.data?.value?.dateTz;\n const endDateTz = getLastDateFromList( this?.data?.value?.recurrence_starts );\n const endDate = new DateTZ({ date: endDateTz.date.valueOf(), is_local_tz, building_tz }) \n // add one day if user room selection from next business day section on result page\n this.requestedEndDateTz = this.nextBusinessDay ? endDate.addValue({ minutes: this.data?.value.offset }) : endDate;\n\n this.occurenceAvailability = `${this?.room?.availableOccurrences} out of ${this?.room?.totalOccurrences}`;\n }\n }\n })\n );\n\n this.subscription(\n 'byId',\n this.store.pipe(select(selectFilteredByIdResults)).subscribe((next) => {\n this.byIdResults.next(\n next.success?.spaces?.length\n ? next.success.spaces[0].settings.bookings\n : EMPTY_ARRAY\n );\n })\n );\n\n const breakpoint = 450;\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize')\n .pipe(throttleTime(500))\n .pipe(\n tap({\n next: (val) => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n },\n })\n )\n .subscribe();\n }\n\n public setRoomSubType() {\n //test\n const room_type = `${this?.room.internal_or_external}_room_types`;\n const temp: string = Array.isArray(this?.room?.room_type)\n ? this?.room?.room_type[0]\n : this?.room?.room_type;\n const type = this?._org?.getOrganizationFiltersByRoomType(room_type)[temp];\n this.roomSubtype = type !== undefined ? `( ${type} Room )` : '';\n }\n\n public isConflictWithOccurences() {\n const conflicts = this?.room?.totalOccurrences - this?.room?.availableOccurrences;\n return { is_conflict: !!conflicts, total_Conflicts: conflicts };\n }\n\n /**\n\t\t * Opens a modal to display recurrence conflicts for a given room.\n\t\t *\n\t\t * @param {Space} room - The room for which recurrence conflicts are being displayed.\n\t\t *\n\t\t * This function opens a modal dialog to show recurrence exceptions (conflicts)\n\t\t * for the specified room.\n\t\t *\n\t\t * TO DO: SAME FUNCTION BEING USED IN apps/staff/src/app/booking/room-details/room-details.component.ts\n\t\t */\n public openRecurrenceConflictsModal(room: Space) {\n let { recurrence_exceptions } = this.data.value;\n\n const recurr_ref = this.dialog.open(\n ConflictsModalComponent,\n {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone,\n },\n }\n );\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t\t/**\n\t\t * Retrieves the end date string for the booking, considering recurrence if applicable.\n\t\t * If the booking is recurrent.\n\t\t *\n\t\t * @returns {string} The formatted end date string in a shorter local date format.\n\t\t */\n\t\t public get endDateString(): string {\n\t\t\t// if this.requestedEndDateTz is not in use anywhere here in this file than remove that property and use const here\n\t\t\tif(!this.requestedEndDateTz) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn this.requestedEndDateTz.formatDate('ccc d MMM yyyy'); // shorterLocalDateFormatString(this.requestedEndDateTz);\n\t\t}\n\n /**\n * Functino to check if room is available as per room/user rules\n */\n public checkAvailabiltyAsPerRule() {\n this.orgBuildings =\n !this.orgBuildings.length && this.data.value?.buildings\n ? this.data.value?.buildings\n : this.orgBuildings;\n this.isSpaceValidAsPerRule = filterSpacesByAppliedFilters(\n [],\n [this.room],\n this.data.value,\n this.orgBuildings,\n this.currentUser\n );\n }\n\n /**\n * Function popup advise alert dialog if scanned (QR code) room details found conflicts with other booking/s\n * @param room\n */\n alertIfItHasConflict(isBookable, isAvailable) {\n this.isAlertDisplayed = true;\n const data = {\n headerText: !isBookable\n ? SpaceConflictAlertModalData.NotBookableHeaderText\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableHeaderText\n : '',\n message:\n this.isSpaceValidAsPerRule.specificReason === SpaceFilterReason.OfficeRules\n ? SpaceConflictAlertModalData.NotBookableDueToOfficeRule\n : !isBookable\n ? SpaceConflictAlertModalData.NotBookableMessage\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableMessage\n : '',\n buttonLabel: !isBookable\n ? SpaceConflictAlertModalData.NotBookableButtonLabel\n : !isAvailable\n ? SpaceConflictAlertModalData.NotAvailableButtonLabel\n : '',\n callback: !isBookable\n ? this.goToBackRoute.bind(this)\n : !isAvailable\n ? this.expandAvailability.bind(this, true)\n : null,\n shouldClose: isBookable,\n };\n const dialog = this.dialog.open(ConflictAlertModalComponent, {\n data: data,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n disableClose: !isBookable,\n });\n }\n\n public warnIfItHasConflict({ room: room, hasConflict: hasConflict }) {\n if (\n (!room.bookable || !this.isSpaceValidAsPerRule.spaces.length) &&\n !this.isAlertDisplayed\n ) {\n // room is not bookable(not available to book) and no warning dialog displayed yet\n this.alertIfItHasConflict(false, true);\n this.updateAvailabilityStatus(SpaceStatus.Unavailable);\n } else if (!room.available && hasConflict && !this.isAlertDisplayed) {\n //room is not available AT THIS TIME to book (booked) and has conflict with other booking and no warning dialog displayed yet\n this.alertIfItHasConflict(room.bookable, !hasConflict); // (true, true/false)\n this.updateAvailabilityStatus(SpaceStatus.Booked);\n } else {\n /**\n * Update status of availability - Uavailable/Booked/Requestable/Bookable\n * If room is not bookable(not available to book) and warning dialog dispalyed once\n * If room is bookable but not available to boot AT THIS TIME (or and has conflict with other booking) and warning dialog displayed once\n * If room is bookable and availanle to book AT THIS TIME then check the type of room Requestable? or Bookable\n */\n const status =\n !room.bookable || !this.isSpaceValidAsPerRule.spaces.length\n ? SpaceStatus.Unavailable\n : !room.available && hasConflict\n ? SpaceStatus.Booked\n : this.is_request\n ? SpaceStatus.Requestable\n : SpaceStatus.Bookable;\n this.updateAvailabilityStatus(status);\n }\n }\n\n public updateAvailabilityStatus(primaryCheck: string, secondaryCheck?: string) {\n this.availabilityStatus =\n primaryCheck !== ''\n ? primaryCheck\n : this.data.value.is_recurrent ||\n ['unavailable', 'booked'].indexOf(this.availabilityStatus) === -1\n ? secondaryCheck\n : this.availabilityStatus;\n }\n\n public get catering(): string {\n return (\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.start })\n .formatDate('ha')\n .toLocaleLowerCase() +\n ' - ' +\n DateNow(new Date())\n .setValue({ minute: 0, hour: this.room?.building?.catering_hours.end })\n .formatDate('ha')\n .toLocaleLowerCase()\n );\n }\n\n public get dateString(): string {\n\t\t\t\tif(!this.requestedDateTz) return '';\n return this.requestedDateTz.formatDate('ccc d MMM yyyy');; //shorterLocalDateFormatString(this.requestedDateTz);\n \n }\n\n public get focusedRoomMapKey(): string {\n return `area-${this.room?.map_id}-status`;\n }\n\n /** Whether we are only allowed to 'request' the selected space */\n public get is_request(): boolean {\n const data = this.data.value;\n\n /* istanbul ignore else */\n if (!data?.selectedRoom?.space) {\n return false;\n }\n\n const space = new Space(data.selectedRoom.space);\n const isRequest = space.byRequest({\n dateTz: data.dateTz,\n duration: data.duration,\n host: this.currentUser,\n });\n this.updateAvailabilityStatus(\n '',\n isRequest ? SpaceStatus.Requestable : SpaceStatus.Bookable\n );\n return isRequest;\n }\n\n public get roomFeatures(): string[] {\n // const room_type = `${this.room.internal_or_external}_room_types`\n const combinedFeatures = {\n // ...this._org.getOrganizationFiltersByRoomType(room_type),\n ...this._org.getOrganizationFiltersByRoomType('equipment_types'),\n };\n const features = this.room !== undefined ? this.room?.featuresArray.map(\n (feature: string) => combinedFeatures[feature]\n ) : [];\n\n return [...new Set(features)].filter((f) => !!f);\n }\n\n public get roomHasCatering() {\n // Building scope catering available is true or false\n const building = this.data.value?.selectedRoom?.building;\n let hasCatering = building ? building.has_catering : false;\n // but if Room catering is false it overrides the building\n if (this.room?.has_catering === false) {\n hasCatering = false;\n }\n return hasCatering;\n }\n\n public get roomImagesFileSlug(): string {\n return this.room?.email.split('@')[0];\n }\n\n public get mapUrl(): string {\n return this.room?.level?.map_url;\n }\n\n public get timeString(): string {\n\t\t\tif(!this.requestedDateTz) return '';\n\t\t\treturn startEndTimeWithZoneFormatString(\n\t\t\t\t\tthis.requestedDateTz,\n\t\t\t\t\tthis.requestedDateTz.addValue({ minutes: this.data.value?.duration })\n\t\t\t);\n }\n\n /**\n * Get the timezone form the subscribed activeForm\n */\n public get timezone(): string {\n // R--- this.room.timezone wasn't reliable enough on page refresh, something to look into\n return this.data.value.selectedRoom?.building.timezone;\n }\n\n public setAlternativeWeekStartDate(bookingDate: DateTZ) {\n if (!bookingDate) {\n return;\n }\n\n const booking_date = bookingDate.clone();\n if (this.mobile) {\n this.alternativeWeekStartDateTz = booking_date;\n } else {\n this.alternativeWeekStartDateTz = booking_date.startOfValue('week');\n }\n }\n\n public updateCalendarWeekView(alternativeWeekStartDateTz: DateTZ) {\n this.alternativeWeekStartDateTz = alternativeWeekStartDateTz;\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n }\n\n public confirmChanges(data: DateDurationData) {\n // R-- refactor room-availability-preview to return DateTZ so setAlternativeWeekStartDate can use it.\n this.mobile = data.mobile;\n this.setAlternativeWeekStartDate(data.dateTz);\n\n this.fetchRooms(!this.mobile, this.alternativeWeekStartDateTz);\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n dateTz: data.dateTz,\n duration: data.duration,\n },\n })\n );\n }\n\n public fetchRooms(allWeek: boolean = true, alternativeWeekStartDateTz: DateTZ = null) {\n if (!this.room?.id) {\n return;\n }\n\n const day = 24 * 60;\n const week = day * 7;\n\n let start_date = (alternativeWeekStartDateTz || this.data.value.dateTz).clone();\n if (allWeek && start_date.dateWeekday !== 7) {\n start_date = start_date.startOfValue('week');\n }\n\n const startOfDay = start_date.startOfValue('day').setValue({ second: 0, millisecond: 0 });\n const startOfWeek = start_date.setValue({ second: 0, millisecond: 0 }).startOfValue('day');\n\n // Query for the entire day for this room\n const query = {\n dateTz: allWeek ? startOfWeek : startOfDay,\n duration: allWeek ? week : day,\n locations: this.room?.id,\n capacity: this.data.value?.roomSize.value,\n };\n this.store.dispatch(loadByIdResults.request(query));\n }\n\n public removeDateOffset() {\n const data = this.data.value;\n let { dateTz, offset } = data;\n dateTz = dateTz.subtractValue({ minutes: ((typeof offset === 'string' && offset == '') || (typeof offset === 'undefined')) ? 0 : Number(offset) });\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...data,\n dateTz: dateTz,\n offset: 0,\n },\n })\n );\n }\n\n public goToBackRoute() {\n this.removeDateOffset();\n this.router.navigate(this.backRoute.route, { queryParams: this.backRoute.queryParams });\n }\n\n public expandMap(open: boolean) {\n this.expandedLocation = open;\n }\n\n public expandAvailability(open: boolean) {\n this.fetchRooms(!this.mobile);\n this.expandedAvailability = open;\n }\n\n public handleClose() {\n this.expandedLocation = false;\n this.expandedAvailability = false;\n this.setAlternativeWeekStartDate(this.data.value?.dateTz);\n this.fetchRooms(false);\n }\n\n /**\n * Continue to Booking Form\n */\n public bookRoom() {\n // submit\n this.store.dispatch(\n storeBookingFormData({\n payload: {\n ...this.data.value,\n },\n })\n );\n\n const bookingRoute = this.data.value.id ? 'edit' : 'create';\n this.router.navigate(['/home', bookingRoute]);\n }\n\n public hideInfoBanner() {\n this.showInfoBanner = false;\n }\n}\n","
\n
\n \n \n
\n
\n \n

This room is not guaranteed until booking confirmation is received.

\n \n
\n
\n \n

This time slot is not available, drag or choose a diferent date or time.

\n
\n
\n
\n \n
\n
\n
\n {{ availabilityStatus | titlecase }} {{ occurenceAvailability }}\n
\n
\n

{{room?.local_name}}

{{data.value?.bookingType.display}}
\n \n
\n
\n \n Equipment\n
    \n
  • \n {{feature}}\n
  • \n
\n
\n
\n
\n \n Catering Available\n
    \n
  • {{catering}}
  • \n
  • (specified in the last booking step)
  • \n
\n
\n
\n
\n
\n
\n

Room Availability:

\n

{{dateString}}

\n \n
\n \n
\n
\n
\n

Room Location:

\n

{{room?.building?.name}}, {{room?.level?.name}}

\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n {{ open ? '(tap to close)' : '(tap to open)'}}\n
\n

{{ data?.value?.is_recurrent ? 'Recurring' : 'Room' }} Booking Detail

\n
\n\n
\n
Date: {{dateString}}
\n
Time: {{timeString}}
\n
\n
\n
{{data?.value?.recurrence_period === 'list' ? 'Specific dates' :\n data?.value?.recurrence_period | titlecase}}\n -\n Conflicts({{isConflictWithOccurences()?.total_Conflicts}}) \n
\n
Start date: {{dateString}}
\n
End date: {{endDateString}}
\n
Time: {{timeString}}
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n instantBookOptions,\n roomDetailsRequired,\n roomEquipmentRequiredOptions,\n selectFormFilters,\n selectIsInternal,\n roomCateringAvailable,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { BehaviorSubject } from 'rxjs';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport {\n map,\n take\n} from 'rxjs/operators';\n\n@Component({\n selector: 'app-room-filters-form',\n template: `\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-form.component.scss']\n})\nexport class RoomFiltersFormComponent extends BaseDirective implements OnInit {\n\n public instantBookOptions = instantBookOptions;\n public roomEquipmentRequiredOptions = roomEquipmentRequiredOptions;\n public roomDetailsRequired = roomDetailsRequired;\n public roomCateringAvailable = roomCateringAvailable;\n public internalRoomTypeRequiredOptions = [];\n public externalRoomTypeRequiredOptions = [];\n public isInternal = false;\n\n public selectedOptions = new BehaviorSubject[]>([]);\n\n @Output()\n public cancelSubmit = new EventEmitter();\n\n @Output()\n public filtersSubmit = new EventEmitter[]>();\n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('bookingType',\n this.store.pipe(\n select(selectIsInternal)\n ).subscribe(next => {\n this.isInternal = next;\n }));\n this.subscription('filters',\n this.store.pipe(\n select(selectFormFilters)\n ).subscribe(next => {\n this.selectedOptions.next(next);\n }));\n\n this.externalRoomTypeRequiredOptions = this.getFilters('external_room_types')\n this.internalRoomTypeRequiredOptions = this.getFilters('internal_room_types')\n }\n\n public toggleOptionChecked(selectOption: SelectOption) {\n this.selectedOptions.pipe(\n take(1),\n map(options => {\n const found = options.find(o => o.value === selectOption.value);\n if (found) {\n // remove\n return options.filter(o => o.value !== selectOption.value);\n }\n // add\n return [...options, selectOption];\n })\n ).subscribe(next => {\n this.selectedOptions.next(next);\n });\n }\n\n public submitFilters() {\n this.selectedOptions.pipe(\n take(1)\n ).subscribe(options => {\n this.filtersSubmit.emit(options);\n });\n }\n\n public getFilters(type:string) {\n const filters = this._org.getOrganizationFiltersByRoomType(type) || {}\n return Object.keys(filters).map((key) => {\n const display = filters[key]\n return {\n value: key,\n display,\n shortDisplay: display\n }\n })\n }\n}\n","import {\n Component,\n ViewChild\n} from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { Store } from '@ngrx/store';\nimport { storeRoomFilters } from '@mckinsey-converge/data-common';\nimport { RoomFiltersFormComponent } from 'src/app/booking/room-filters-form/room-filters-form.component';\n\n@Component({\n selector: 'app-room-filters',\n template: `\n
\n \n \n \n \n \n \n \n \n
\n `,\n styleUrls: ['./room-filters-modal.component.scss']\n})\nexport class RoomFiltersModalComponent {\n\n @ViewChild(RoomFiltersFormComponent)\n public form: RoomFiltersFormComponent;\n\n constructor(\n private store: Store,\n private dialogRef: MatDialogRef) {\n }\n\n public close() {\n this.dialogRef.close();\n }\n\n public submitFilters(filters: SelectOption[]) {\n this.store.dispatch(storeRoomFilters({\n payload: filters\n }));\n this.close();\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n OnChanges,\n EventEmitter,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n BehaviorSubject,\n combineLatest,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n CENTER_POINT,\n generateMapStyleForSpace,\n legendOptions,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n spaceToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n SpaceStatus,\n selectMapFilteredResults,\n FilteredSpaces\n} from '@mckinsey-converge/data-common';\nimport {\n Point,\n HashMap,\n BaseDirective,\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport { MapSearchStoreState } from '../../map/map-search/map-search.component';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\n@Component({\n selector: 'room-location-preview',\n template: `\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n {{building.name}}, {{level.name}}\n
\n \n
\n
The pinpoint indicates your selected room's location on the floor. No futher interaction is available.
\n \n
\n
\n \n
\n \n \n
\n \n
\n
\n\n\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n `,\n styleUrls: ['./room-location-preview.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class RoomLocationPreviewComponent extends BaseDirective implements OnInit, OnChanges {\n public legendOptions = legendOptions();\n\n @Input()\n public mapUrl: string;\n\n @Input()\n public focus: any; // @todo fix\n\n @Input()\n public expanded: boolean;\n\n @Input()\n public building: Building;\n\n @Input()\n public space: Space;\n\n @Input()\n public level: any; // @todo fix\n\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n\n // Use \"booking_preview\" to show smaller height with zoom icon\n @Input() public viewMode: String = null;\n\n @Output()\n public handleExpand: EventEmitter = new EventEmitter();\n\n public currentPage: string;\n\n public get feedback() {\n return generateFeedbackUrl(this.currentPage);\n }\n\n public get zoomLevel() {\n return this.expanded ? this.minZoom.value : this.zoom.value;\n }\n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService) {\n super();\n }\n\n public focusedRoom = new BehaviorSubject(undefined);\n public featuresRoom = new BehaviorSubject(undefined);\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n public minZoom = new BehaviorSubject(MAX_ZOOM_LEVEL / 3);\n public features = combineLatest([this.featuresRoom]).pipe(map(items => items.filter(i => !!i)));\n public setIntervalHandle: any = null;\n public count = 0;\n public center = new BehaviorSubject(CENTER_POINT);\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n public ngOnChanges(changes: any): void {\n if (changes.expanded && changes.expanded.currentValue) {\n this.activeSpace.pipe(\n take(1),\n filterUndefined(),\n map(spaceToMapFeature)\n ).subscribe(next => {\n this.featuresRoom.next(next);\n });\n } else if (changes.expanded && changes.expanded.previousValue && !changes.expanded.currentValue) {\n this.featuresRoom.next(undefined);\n }\n }\n\n public ngOnInit(): void {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n\n // MCK-1850 And it's even slower when loading form scratch via an email link, so 10 second interval.\n this.timeout('Zoom to Room', () => this.initMapZoom(), 2000);\n this.activeSpace.next(this.space);\n this.activeBuilding.next(this.building);\n this.activeLevel.next(this.level);\n\n this.subscription('bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => r.success)\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined())\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || [])\n .filter(s => !!s.map_id && s.zones.includes(building.id) && s.zones.includes(level.id));\n\n const styles: HashMap> = {};\n // const colour_map = this.settingService.get('app.explore.colors') || {};\n // spacesFromSelection.forEach(space => {\n // const status = filteredSpaces.statusMap[space.id] || SpaceStatus.Available;\n // const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n // styles[`#${mapStyle.id}`] = mapStyle.styles;\n // });\n this.style_map.next(styles);\n \n })\n );\n\n }\n\n public initMapZoom() {\n const self = this;\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n // But this alone is not enough when loading from an email link due to how slow the loading is. See the ngOnInit\n this.setIntervalHandle = setInterval(() => {\n if (!this.focus) {\n return;\n }\n \n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 1000);\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n public goToHelp() {\n window.open(Urls.Help);\n }\n\n public zoomToRoom(): void {\n this.focusedRoom.next(this.focus);\n this.zoom.next(MAX_ZOOM_LEVEL);\n }\n\n public zoomIn() {\n if (this.minZoom.value < MAX_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.minZoom.value > MIN_ZOOM_LEVEL) {\n this.minZoom.next(this.minZoom.value - 1);\n }\n }\n\n public resetZoomLevels() {\n this.minZoom.next(MIN_ZOOM_LEVEL);\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n }\n\n public collapse() {\n this.handleExpand.emit(false);\n const self = this;\n self.count = 0;\n\n this.zoom.next(MAX_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n\n // Doesn't reliably zoom to room until that component is finished loading and processing elements.\n this.setIntervalHandle = setInterval(() => {\n self.zoomToRoom();\n self.count ++;\n if (self.count > 4) {\n clearInterval(self.setIntervalHandle);\n self.setIntervalHandle = null;\n }\n }, 200);\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent,\n {\n data: this.building,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n OnInit,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport { ApplicationService, BookingFormData, RoomResultsViewModel, setupRoomImages, User } from '@mckinsey-converge/data-common';\nimport { ImageDirective, SpaceImageObject } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-room-result-item',\n template: `\n
\n
\n
\n
\n {{ availability === 'requestable' ? 'Requestable' : 'Bookable'}}\n {{ viewModel?.space?.availableOccurrences }} out of {{ viewModel?.space?.totalOccurrences }} \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n \n
\n
\n
\n
\n \n {{viewModel.levelDisplay}}, {{viewModel.title}}\n {{type}}\n {{viewModel.office}}\n {{viewModel.capacity}}\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-result-item.component.scss']\n})\nexport class RoomResultItemComponent extends ImageDirective implements OnInit, OnChanges {\n\n public rootFolderURL: string = 'assets/img/rooms/';\n public fileSlug: string = '';\n public type: string = '';\n\n /**\n * If undefined, we display in loading state.\n */\n @Input()\n public viewModel: RoomResultsViewModel | undefined;\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public user: User;\n\n @Output()\n public roomSelect = new EventEmitter();\n\n public availability: \"requestable\" | \"bookable\" | \"booked\" | \"non-bookable\" | null;\n\n public foundImages: SpaceImageObject[] = [1,2].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n constructor(\n private _appService: ApplicationService) {\n super();\n }\n\n public ngOnInit(): void {\n if (this.viewModel && this.viewModel.space) {\n this.fileSlug = this.viewModel.space.email.split('@')[0];\n setupRoomImages(this, [1,2], this.rootFolderURL, this.fileSlug);\n const t = this.viewModel.space.internal_or_external;// || 'internal';\n this.type = `${t[0]?.toUpperCase()}${t.toLocaleLowerCase().substring(1)}`\n\n // Set the viewing space in the app service so that the staff result page can receive event on loading previously selected room card \n // which will help to scroll to the selected room\n if(this.viewModel.space.id === this.data.selectedRoom?.space?.id) {\n this._appService.set('STAFF.result.card.viewing', this.viewModel.space.id);\n }\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (this.availability !== null && (\n changes.data &&\n changes.data.firstChange === true &&\n changes.data.currentValue &&\n changes.data.currentValue.dateTz &&\n changes.data.currentValue.duration\n )) {\n this.availability = this.viewModel.space.byRequest({\n dateTz: this.data.dateTz,\n duration: this.data.duration,\n host: this.user\n }) === false ? \"bookable\" : \"requestable\";\n\n }\n }\n\n public hasData() {\n return this.viewModel !== undefined;\n }\n\n public get typeClass() {\n return this.type.toLocaleLowerCase();\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n }\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n NgZone,\n OnInit,\n Output,\n ViewContainerRef\n} from '@angular/core';\nimport {\n select,\n Store\n} from '@ngrx/store';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable\n} from 'rxjs';\nimport {\n RoomResultsViewModel,\n BookingFormData,\n BookingStoreState,\n selectActiveForm,\n storeBookingFormData,\n SpaceFilterReason,\n User,\n OrganisationService,\n ApplicationService,\n} from '@mckinsey-converge/data-common';\nimport {\n map,\n take,\n distinctUntilChanged\n} from 'rxjs/operators';\nimport {\n AlertBannerDisplay,\n AlertMode,\n BaseTemplateComponent,\n ConflictsModalComponent,\n ConflictsModalComponentData,\n\t\tOverrideChangesModalComponent\n} from '@mckinsey-converge/ui';\nimport { RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n RoomStoreState\n} from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { selectCurrentUser, UserStoreState } from '@mckinsey-converge/user';\nimport { MatDialog } from '@angular/material/dialog';\nimport { DialogEvent } from '@mckinsey-converge/base';\n\n\nexport type RoomResultsState = BookingStoreState\n & RoomStoreState\n & BuildingStoreState\n & UserStoreState;\n\n@Component({\n selector: 'app-room-results-paginated',\n template: `\n \n
\n
\n \n \n \n \n \n \n \n \n \n\n
\n \n
\n
\n \n \n \n
\n \n
\n
\n
\n
\n
\n `,\n styleUrls: ['./room-results-paginated.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RoomResultsPaginatedComponent extends BaseTemplateComponent implements OnInit {\n public ROOM_DISPLAY_STEP = 10;\n public ROOM_DISPLAY_START = 3;\n public AlertMode = AlertMode;\n public AlertBannerDisplay = AlertBannerDisplay;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n @Input()\n public viewModels: Observable;\n\n @Input()\n public coachMark: Observable | undefined;\n\n /**\n * If true, show skeleton.\n */\n @Input()\n public isLoading: Observable;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay = false;\n\n @Input() public expanded_section_ids: string[] = [];\n @Input() public headerTitle: string = '';\n\n public displayCount = new BehaviorSubject(this.ROOM_DISPLAY_START);\n\n /**\n * Fake pagination since API does not support it.\n */\n public displayViewModels: Observable;\n\n public showLoadMore: Observable;\n\n public remainingResults: Observable;\n\n public data = new BehaviorSubject(undefined);\n public currentUser: User;\n noOfResultLoaded: number;\n\n constructor(vcRef: ViewContainerRef,\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _appService: ApplicationService,\n private cdRef: ChangeDetectorRef,\n private _dialog: MatDialog) {\n super(vcRef);\n }\n\n public ngOnInit(): void {\n super.ngOnInit();\n //test commet for to trigger build again\n this.displayViewModels = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => { this.cdRef.markForCheck(); return vm?.slice(0, displayCount) } ));\n\n this.showLoadMore = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => {\n return ((vm?.length ?? 0) > displayCount);\n })\n );\n this.remainingResults = combineLatest([this.viewModels, this.displayCount])\n .pipe(\n map(([vm, displayCount]) => vm && (vm.length - displayCount) || 0));\n\n this.subscription('currentUser', this.store.select(selectCurrentUser)\n .pipe(take(1))\n .subscribe((user: User | undefined) => {\n // Once we know we have the user loaded.\n this.currentUser = new User(user);\n })\n );\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.data.next(next);\n this.cdRef.detectChanges();\n\n }\n }));\n\n\n\n // Load more results if the section is expanded previously and the data is loaded \n const shouldLoadMore = this.data?.value?.expanded_section_ids?.includes(this?.headerTitle?.split('(')[0].split(' ').join('_'));\n if( this.showLoadMore && this?.data?.value?.resultLoaded && shouldLoadMore) {\n this.loadMore();\n } \n \n // Scroll to the selected room card if the user has selected a room from section previously \n this.subscription(\n 'viewing',\n this._appService\n ?.listen('STAFF.result.card.viewing')\n ?.subscribe((event) => {\n // Scroll to the selected room card \n if(event === this.data?.value?.selectedRoom?.space.id) {\n const spaceId = this.data?.value?.selectedRoom?.space.id;\n document.querySelectorAll(`[space-name=\"${spaceId}\"]`)[0].scrollIntoView();\n }\n \n })\n );\n\n this.cdRef.detectChanges();\n }\n\n public loadMore(isDom: boolean = false) {\n // fake pagination\n const previouslyLoadedCount = this.data.value.resultLoaded || 0; // previously loaded results count\n this.displayCount.pipe(\n take(1),\n // if the data is loaded from the dom then do not reset the count to previously loaded count\n map(v => (previouslyLoadedCount && !isDom) ? previouslyLoadedCount : v + this.ROOM_DISPLAY_STEP)\n ).subscribe(next => {\n this.displayCount.next(next);\n this.noOfResultLoaded = next;\n this.cdRef.detectChanges();\n });\n }\n\n\n public trackViewModelById(index: number, item: RoomResultsViewModel) {\n return item.space.id;\n }\n\n\n\t\t/**\n\t\t * Handles the selection of a room from the search results.\n\t\t * Depending on the room's availability and recurrence conflicts, this function decides\n\t\t * whether to open a modal for recurrence conflicts, override changes, or navigate to the\n\t\t * room details page. It updates the state and user interface accordingly.\n\t\t *\n\t\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t\t * @param {number} availableOccurrences - The number of available occurrences of the room.\n\t\t * @param {number} totalOccurrences - The total number of occurrences of the room.\n\t\t */\n public roomSelected(room: RoomResultsViewModel, availableOccurrences: number, totalOccurrences: number) {\n\n const { is_recurrent } = this.data.value;\n this.data.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.data.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\t\t// Determine the action based on recurrence conflicts, occurrence edits, and room availability\n\t\tif(this.data.value.recurrence_exceptions.length) {\n this.openRecurrenceConflictsModal(room);\t// Open modal for recurrence conflicts\n }\n else if( this.data.value.occurrence_edits && this.data.value.occurrence_edits.length) {\n this.overrideChanges(room);\t// Open modal to override changes\n }\n else {\n this.goToRoomDetail(room);\t// Navigate to the room details page\n }\n\n }\n\n /**\n * Navigates to the room details page for the selected room.\n * It updates the URL and navigates to the room details page with appropriate query parameters.\n *\n * @param {RoomResultsViewModel} room - The selected room from the search results.\n *\n * @remarks\n * The function manages timezone offset and other necessary details to provide accurate room information.\n * The state object is used to pass relevant data for correct page rendering and form population.\n *\n * @private\n */\n private goToRoomDetail(room) {\n this.cdRef.detectChanges();\n\t\t\t// Handle timezone offset for accurate date and time information\n let { dateTz } = this.data.value;\n if (this.offset) {\n dateTz = dateTz.addValue({ minutes: this.offset });\n }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.data.value.booking.room is not and does not contain the timezone\n * this.data.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.data.value,\n buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: this.offset,\n selectedRoom: room,\n nextBusinessDay: this.nextBusinessDay,\n expanded_section_ids: this.expanded_section_ids,\n resultLoaded: this?.expanded_section_ids?.length ? this.noOfResultLoaded : 0\n }\n }});\n }\n\n\n /**\n\t * Opens a modal to display recurrence conflicts for the selected room.\n\t * It shows recurrence conflicts, allowing the user to resolve them before proceeding.\n\t * After the modal is closed, it navigates to the room details page if there are no unresolved conflicts.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private openRecurrenceConflictsModal(room: RoomResultsViewModel) {\n let { recurrence_exceptions } = this.data.value;\n\n\t\t// Open modal for recurrence conflicts\n const recurr_ref = this._dialog.open(ConflictsModalComponent, {\n maxWidth: '95vw',\n width: '32em',\n data: {\n room_name: room.space.simple_name,\n conflicts: recurrence_exceptions,\n timezone: room.building.timezone\n }\n });\n this.subscription(\n 'conflicts_modal_events',\n recurr_ref.componentInstance.event.subscribe((event: DialogEvent) => {\n\n\t\t\t\tif (event.reason === 'done' && !(this.data.value.occurrence_edits && !this.data.value.occurrence_edits.length) ) {\n this.goToRoomDetail(room); \t// Navigate to room details page after resolving conflicts\n\t\t\t\t}\n recurr_ref.close();\n })\n );\n recurr_ref.afterClosed().subscribe(() => this.unsub('conflicts_modal_events'));\n }\n\n\t/**\n\t * Opens a modal to allow the user to override changes made to the booking.\n\t * It provides options to confirm or cancel the override, depending on user preference.\n\t * After the modal is closed, it navigates to the room details page if the user confirms the override.\n\t *\n\t * @param {RoomResultsViewModel} room - The selected room from the search results.\n\t *\n\t * @private\n\t */\n private overrideChanges(room: RoomResultsViewModel) {\n\t\t// Open modal for overriding changes made to the booking\n const ref = this._dialog.open(OverrideChangesModalComponent, {\n width: '576px',\n data: {\n edits: this.data.value.occurrence_edits,\n timezone: this.data.value.timezone\n }\n });\n ref.componentInstance.event.subscribe(event => {\n if (event.reason === 'done') {\n this.goToRoomDetail(room);\t// Navigate to room details page after confirming the override\n ref.close();\n } else if (event.reason === 'close') {\n ref.close();\n }\n });\n }\n\n\n\n\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, Observable, of, Subject } from 'rxjs';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { distinctUntilChanged, filter, map } from 'rxjs/operators';\nimport { BookingRulesLink, RoomResultsCoachmarkViewmodel } from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport {\n Building,\n BuildingLevel,\n mapResultsToViewModels,\n RoomResultsViewModel,\n FilteredSpaces,\n SpaceFilterReason,\n selectActiveForm,\n BookingStoreState,\n BookingFormData,\n OrganisationService,\n storeBookingFormData,\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { select, Store } from '@ngrx/store';\nimport { RoomStoreState } from '@mckinsey-converge/rooms';\nimport {\n BuildingStoreState,\n} from '@mckinsey-converge/buildings';\nimport { UserStoreState } from '@mckinsey-converge/user';\n\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n\n@Component({\n selector: 'app-room-results-section',\n template: `\n
\n \n
\n\n \n \n \n\n \n \n \n \n `,\n styleUrls: ['./room-results-section.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class RoomResultsSectionComponent extends BaseDirective implements OnInit {\n @Input() public rules_link?: BookingRulesLink;\n /** Offset to add to the start time when selecting a space */\n @Input() public offset = 0;\n\n // set property if user room selection from next business day section on result page\n @Input() public nextBusinessDay : boolean = false\n\n @Input()\n public collapsable: boolean;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseTitle: string;\n\n /**\n * If collapsable is true, this is used in the collapse header.\n */\n @Input()\n public collapseDescription: string;\n\n @Input()\n public levelBuildings: Observable<{ flattenedLevels: BuildingLevel[]; buildings: Building[] }>;\n\n @Input()\n public results: BehaviorSubject>;\n\n @Output()\n public coachMarkAction = new EventEmitter();\n\n public mainResultViewModels = new BehaviorSubject(\n undefined\n );\n\n public editing_form = new BehaviorSubject(false);\n\n public resultsLoading: Observable;\n public coachMarkDisplay: Observable;\n\n public AlternateBuildings = [];\n public location: any;\n\n public activeForm: BookingFormData; // active form data\n public expanded_section_ids: string[] = []; // expanded section ids\n\n\n private subscribeResultsToViewModels = (\n subName: string,\n resultsObservable: Observable>,\n flattenLevelBuildings: Observable<{ flattenedLevels: any; buildings: Building[] }>,\n viewModelSubject: Subject\n ) => {\n this.subscription(\n subName,\n combineLatest([\n resultsObservable.pipe(map((r) => r.optionalSuccess?.spaces || [])),\n flattenLevelBuildings,\n ])\n .pipe(\n map(([results, { flattenedLevels, buildings }]) =>\n mapResultsToViewModels(\n results?.length && results[0]?.building ? results : [],\n flattenedLevels,\n buildings\n )\n )\n )\n .subscribe((next) => {\n viewModelSubject.next(next);\n })\n );\n };\n \n \n\n constructor(private store: Store, private _org: OrganisationService) {\n super();\n }\n\n public ngOnInit(): void {\n this.resultsLoading = this.results.pipe(map((m) => m.isLoading));\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.location = next.location;\n this.updateCoachMark();\n this.activeForm = next;\n } else {\n }\n })\n );\n\n this.subscription(\n 'buildings',\n this._org.listen('buildings').subscribe(() => {\n this.updateCoachMark();\n })\n );\n\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n\n // Update opened section id and send it to child component\n private updateSectionIdOnOpen (event: { status: string; id: string }) {\n // if status is opened, then push to the expanded_section_ids in the store otherwise remove from the store\n if (event.status === 'opened') {\n const ids = this.activeForm?.expanded_section_ids ? this.activeForm?.expanded_section_ids : [];\n // Remove duplicates and add the new id to the list \n this.activeForm.expanded_section_ids = Array.from(new Set([...ids, event.id]));\n \n } else if (event.status === 'closed'){\n // Remove the id from the list \n this.activeForm.expanded_section_ids = this.activeForm?.expanded_section_ids.filter(\n (id) => id !== event.id\n )\n }\n }\n \n\n updateCoachMark() {\n const buildingsInSameCity = this._org.buildings?.filter(_ => {\n // Make sure this.location is populated to pass unit tests -\n if (!this.location || this.location.length === 0) return false;\n // If all offices are selected, city name will be at this.location[0]?.meta?.city.name, otherwise use this.location[0]?.meta?.city \n const cityFromLocation = typeof this.location[0]?.meta?.city === 'object' && this.location[0]?.meta?.city !== null\n ? this.location[0]?.meta?.city.name\n : this.location[0]?.meta?.city;\n return _.city === cityFromLocation;\n });\n const AlternateBuildings = buildingsInSameCity?.filter(\n (building) =>\n !this.location.some(\n (locationItem) => locationItem.meta?.building?.id === building.id\n )\n );\n this.AlternateBuildings = AlternateBuildings;\n this.coachMarkDisplay = this.results.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map(\n (r) =>\n new RoomResultsCoachmarkViewmodel(r, this.rules_link, this.AlternateBuildings)\n )\n );\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (changes.results || changes.levelBuildings || changes.mainResultViewModels) {\n this.subscribeResultsToViewModels(\n 'resultListing',\n this.results,\n this.levelBuildings || of({ flattenedLevels: [], buildings: [] }),\n this.mainResultViewModels\n );\n }\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n this.coachMarkAction.emit(reason);\n }\n}\n","import { SpaceFilterReason } from '@mckinsey-converge/data-common';\n\nexport interface BookingRulesLink {\n name: string;\n url: string;\n}\nexport class RoomResultsCoachmarkViewmodel {\n public visible: boolean;\n public title: string;\n public actionButtonText: string;\n\n constructor(public reason: SpaceFilterReason, public rules_link?: BookingRulesLink, alternateBuildings?:any[]) {\n this.visible = true;\n switch (reason) {\n case SpaceFilterReason.DateTime:\n this.title =\n 'There are no available rooms that match your search criteria. ' +\n 'Please adjust your search criteria and try again.';\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.OfficeRules:\n this.title =\n `There are no available rooms that match your search criteria.\n Please adjust your search criteria and try again.`;\n if (alternateBuildings && alternateBuildings.length > 0) {\n this.title += ` Alternatively, you can try ${alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n }\n if (rules_link) {\n this.title +=\n `
For information on booking rules please see ` +\n `${rules_link.name}`;\n }\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.Filters:\n this.title =\n 'No rooms available for your filter criteria. ' +\n 'Try to clear the filter please.';\n this.actionButtonText = 'Clear filter';\n break;\n case SpaceFilterReason.AlternateBuildingsFound:\n this.title = `There are no available rooms that match your search criteria. Please try ${\n alternateBuildings.length > 1 \n ? alternateBuildings.slice(0, -1).map(building => building.name).join(', ') + ', or ' + alternateBuildings[alternateBuildings.length - 1].name \n : alternateBuildings[0]?.name\n }.`;\n this.actionButtonText = 'Return to search';\n break;\n case SpaceFilterReason.None:\n this.visible = false;\n this.title = '';\n this.actionButtonText = '';\n break;\n }\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { TopBarHeaderMode } from 'src/app/components/topbar-header/topbar-header.component';\nimport { select, Store } from '@ngrx/store';\nimport {\n laterThatDayFromDateTz,\n loadRoomsWithQuery,\n RoomStoreState,\n mapRoomToSelectOption,\n loadRoomsForResultsMap,\n} from '@mckinsey-converge/rooms';\nimport { BaseDirective, timeWithZoneFormatString } from '@mckinsey-converge/base';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport {\n Building,\n BuildingLevel,\n flattenBuildingsWithLevels,\n BookingStoreState,\n FilteredSpaces,\n SpaceFilterReason,\n clearRoomFilters,\n selectActiveForm,\n selectFilteredLaterDayResults,\n selectFilteredNextDayResults,\n selectFilteredResults,\n selectFormFilters,\n BookingFormData,\n roomFormDataToQuery,\n selectFilteredDiffSizeResults,\n OrganisationService,\n CollapseService\n} from '@mckinsey-converge/data-common';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { debounceTime, distinctUntilChanged, filter, map, shareReplay } from 'rxjs/operators';\nimport {\n buildingStateSelector,\n BuildingStoreState,\n loadBuildings,\n} from '@mckinsey-converge/buildings';\nimport * as cloneDeep from 'lodash/cloneDeep';\nimport { filterUndefined, resultCountObservable } from '@mckinsey-converge/rx-utils';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { MatDialog } from '@angular/material/dialog';\nimport { RoomBookingModalComponent } from 'src/app/booking/room-booking-modal/room-booking-modal.component';\nimport { RoomFiltersModalComponent } from 'src/app/booking/room-filters-modal/room-filters-modal.component';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\nimport {\n BookingRulesLink,\n RoomResultsCoachmarkViewmodel,\n} from 'src/app/booking/room-results/room-results-coachmark.viewmodel';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { FormControl } from '@angular/forms';\nimport { Location } from '@angular/common';\n\nexport type RoomResultsState = BookingStoreState &\n RoomStoreState &\n BuildingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-room-results',\n template: `\n \n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n {{ open ? '(tap to close)' : '(tap to open)' }}\n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n `,\n styleUrls: ['./room-results.component.scss'],\n animations: [\n trigger('collapseHeight', [\n state(\n 'open',\n style({\n height: '*',\n opacity: 1,\n })\n ),\n state(\n 'closed',\n style({\n overflow: 'hidden',\n opacity: 0,\n height: '0px',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n trigger('expandWidth', [\n state(\n 'open',\n style({\n maxWidth: '1024px',\n })\n ),\n state(\n 'closed',\n style({\n maxWidth: '96%',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class RoomResultsComponent extends BaseDirective implements OnInit {\n public TopBarHeaderMode = TopBarHeaderMode;\n\n public day_offset = 1;\n\n public data = new BehaviorSubject(undefined);\n public filters = new BehaviorSubject[]>([]);\n\n public mainResults = new BehaviorSubject>(LoadingModel.empty());\n public mainResultsFiltered = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public laterThatDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public nextBusinessDayResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public diffSizeResults = new BehaviorSubject>(\n LoadingModel.empty()\n );\n public mainResultsSpaces: SelectOption[];\n\n public laterThatDayDisplay = new BehaviorSubject(undefined);\n\n public mainCoachMarkDisplay = this.mainResults.pipe(\n map((r) => r.optionalSuccess?.reason || SpaceFilterReason.None),\n map((r) => new RoomResultsCoachmarkViewmodel(r, this.rules_link))\n );\n\n public rules_link?: BookingRulesLink;\n\n public mainResultsCount = resultCountObservable(\n this.mainResultsFiltered,\n this.mainResultsFiltered.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public laterThatDayCount = resultCountObservable(\n this.laterThatDayResults,\n this.laterThatDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public nextBusinessDayCount = resultCountObservable(\n this.nextBusinessDayResults,\n this.nextBusinessDayResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n public diffSizeCount = resultCountObservable(\n this.diffSizeResults,\n this.diffSizeResults.pipe(map((r) => r.optionalSuccess?.spaces))\n );\n\n public selectedToggle = new BehaviorSubject(0);\n\n public flattenLevelBuildings: Observable<{\n flattenedLevels: BuildingLevel[];\n buildings: Building[];\n }>;\n\n public open: boolean = true;\n public editing_form = new BehaviorSubject(false);\n\n public spaceControl = new FormControl();\n\n public selectedSpace: SelectOption;\n public resetInput: number;\n\n public searchStringPresent = false;\n public payload: any = {\n payload: { name: 'test', id: 'test-id' },\n building: {},\n floorMap: true,\n };\n\n public isOpen = true;\n\n public toggle() {\n this.isOpen = !this.isOpen;\n }\n\n constructor(\n private store: Store,\n private router: Router,\n private route: ActivatedRoute,\n private dialog: MatDialog,\n private _org: OrganisationService,\n private location: Location,\n private collapseService: CollapseService\n ) {\n super();\n this.payload = location.getState();\n }\n\n public ngOnInit(): void {\n this.subscription(\n 'filters',\n this.store.pipe(select(selectFormFilters), distinctUntilChanged()).subscribe((next) => {\n return this.filters.next(next);\n })\n );\n\n this.subscription(\n 'activeForm',\n combineLatest([this.editing_form, this.store])\n .pipe(\n filter(([edit]) => !edit),\n map(([_, store]) => store),\n select(selectActiveForm),\n distinctUntilChanged()\n )\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n const day = next.dateTz.dateWeekday - 1;\n this.day_offset = day >= 4 ? 7 - day : 1;\n const building = this._org.buildings.find(\n (_) => _.id === next.location[0]?.meta?.building?.id\n );\n this.rules_link =\n building?.setting('booking.rules_link') ||\n next.location.find(\n office => office?.meta?.building?._settings?.discovery_info?.booking?.rules_link\n )?.meta?.building?._settings?.discovery_info?.booking?.rules_link;\n // next.location[0]?.meta?.building?.settings?.discovery_info?.booking\n // ?.rules_link;\n const nday = laterThatDayFromDateTz(next.dateTz);\n this.laterThatDayDisplay.next(`at ${timeWithZoneFormatString(nday)}`);\n // this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(next)));\n this.data.next(next);\n \n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n\n // this.data.next(next);\n } else {\n // no form data, likely visiting directly. navigate back to start\n this.router.navigate(['../'], {\n replaceUrl: true,\n relativeTo: this.route,\n });\n }\n })\n );\n\n this.subscription(\n 'results',\n this.store.pipe(select(selectFilteredResults)).subscribe((next) => {\n this.mainResults.next(next);\n this.mainResultsFiltered.next(next);\n // Populate results for Search\n this.mainResultsSpaces = next.success?.spaces\n ? next.success?.spaces?.map(mapRoomToSelectOption)\n : [];\n })\n );\n\n this.subscription(\n 'laterResults',\n this.store.pipe(select(selectFilteredLaterDayResults)).subscribe((next) => {\n this.laterThatDayResults.next(next);\n })\n );\n\n this.subscription(\n 'nextDayResults',\n this.store.pipe(select(selectFilteredNextDayResults)).subscribe((next) => {\n this.nextBusinessDayResults.next(next);\n })\n );\n\n this.subscription(\n 'diffSize',\n this.store.pipe(select(selectFilteredDiffSizeResults)).subscribe((next) => {\n this.diffSizeResults.next(next);\n })\n );\n\n this.flattenLevelBuildings = this.store.pipe(\n select(buildingStateSelector),\n select(loadBuildings.selectors.optionalSuccess),\n filterUndefined(),\n map(flattenBuildingsWithLevels),\n shareReplay(1)\n );\n\n this.subscription(\n 'spaceChanges',\n this.spaceControl.valueChanges.subscribe((value) => {\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults.value.success?.spaces?.filter((s) => {\n if (s.id === value.value) {\n return true;\n }\n return false;\n });\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n })\n );\n\n // if coming from kiosk map url, route there\n if (this.payload?.floorMap) {\n this.router.navigate([`../home/floor-map`], {\n state: { ...this.payload },\n queryParams: {\n display: '',\n },\n });\n }\n\n this.subscription(\n 'spaceChanges',\n this.selectedToggle.subscribe((value) => {\n //Dispatches actions to load rooms based on the provided value.\n this.despatchLoadRooms();\n })\n );\n }\n\n /**\n * Dispatches actions to load rooms based on the provided value.\n * @param {number} value - The value indicating the mode of operation.\n * 0: Load rooms for regular view.\n * 1: Load rooms for results map view.\n */\n public despatchLoadRooms() {\n const selectedMenuIndex = this.selectedToggle.value; // List/Map/Calendar\n const isForFloorMap = this.payload?.floorMap;\n // If value is 0 and floorMap is not present in payload\n if(selectedMenuIndex === 0 && !isForFloorMap) {\n // Dispatch action to load rooms with query generated from form data\n this.store.dispatch(loadRoomsWithQuery(roomFormDataToQuery(this.data.value)));\n }\n \n // If value is 1 or floorMap is present in payload\n if(selectedMenuIndex === 1 || isForFloorMap) {\n // Dispatch action to load rooms for results map view with query generated from form data\n this.store.dispatch( loadRoomsForResultsMap.request(roomFormDataToQuery(this.data.value)));\n }\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n const mainResults = cloneDeep(this.mainResults.value);\n this.mainResultsFiltered.next(mainResults);\n this.searchStringPresent = false;\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n\n public changeInput(event) {\n if (event) {\n this.clearRoomSearch();\n }\n }\n\n public filteredRoomsChange(event: SelectOption[]) {\n const roomIds = event.map((o) => o.value);\n const mainResultsFiltered = cloneDeep(this.mainResults.value);\n const filteredRooms = this.mainResults?.value?.success?.spaces\n ? this.mainResults?.value?.success?.spaces?.filter((s) => {\n if (roomIds.includes(s.id)) {\n return true;\n }\n return false;\n })\n : [];\n mainResultsFiltered.success.spaces = filteredRooms;\n this.mainResultsFiltered.next(mainResultsFiltered);\n }\n\n public changeSearchResults() {\n this.editing_form.next(true);\n const dialog_ref = this.dialog.open(RoomBookingModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n dialog_ref.afterClosed().subscribe(() => {\n this.editing_form.next(false);\n this.collapseService.collapsePanel();\n });\n }\n\n public filterResults() {\n this.dialog.open(RoomFiltersModalComponent, {\n panelClass: 'mck-modal',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public onCoachmarkAction(reason: SpaceFilterReason) {\n switch (reason) {\n case SpaceFilterReason.Filters:\n this.store.dispatch(clearRoomFilters());\n break;\n case SpaceFilterReason.OfficeRules:\n case SpaceFilterReason.DateTime:\n this.changeSearchResults();\n break;\n }\n }\n\n public selectedToggleChange(event: SelectOption) {\n this.selectedToggle.next(event.value);\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n humaniseDuration,\n timeFormatString,\n timeWithGmtOffsetFormatString,\n weekDayMonthYearFormat\n} from '@mckinsey-converge/base';\nimport {\n truncateLocationList,\n BookingFormData,\n getLastDateFromList\n} from '@mckinsey-converge/data-common';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { DateTZ } from '@mckinsey-converge/date-tz'\nimport { Store } from '@ngrx/store';\nimport { clearRoomFilters } from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'app-searched-location',\n template: `\n
\n
\n {{name}}\n {{date}}\n {{timing}}\n {{types}}\n No filters applied\n Filtering unavailable for this view\n {{filterDisplay}}\n
\n \n
\n `,\n styleUrls: ['./searched-location.component.scss']\n})\nexport class SearchedLocationComponent implements OnInit, OnChanges {\n\n @Input()\n public data: BookingFormData;\n\n @Input()\n public filters: SelectOption[] = [];\n\n @Output()\n public changeClick = new EventEmitter();\n\n @Output()\n public filterClick = new EventEmitter();\n\n @Input()\n public canFilter = true;\n\n public name = '';\n public date = '';\n public timing = '';\n public types = '';\n public filterDisplay = '';\n public filterCount = '';\n\n constructor(private store: Store) {}\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.data || changes.filters) {\n this.computeDisplay();\n }\n }\n\n public ngOnInit(): void {\n this.computeDisplay();\n }\n\n\n public computeDisplay() {\n if (!this.data) {\n return;\n }\n const { duration, dateTz, location, roomSize, bookingType, is_recurrent, recurrence_endTz } = this.data;\n\n \n // this.requestedEndDateTz = new DateTZ({ date: endDate.date.valueOf(), is_local_tz, building_tz })\n\n const group = location.find(l => l.groupHeader);\n if (group) {\n this.name = group.shortDisplay;\n } else {\n this.name = truncateLocationList(location);\n }\n\n // R--- blocked until TZ booking form inputs\n const building_tz = location[0]?.meta?.building?.timezone || location[0]?.meta?.city?.timezone;\n const startDate = new DateTZ({date: dateTz.ms, is_local_tz: false, building_tz })\n\n if(is_recurrent) {\n const occEndDate = getLastDateFromList( this?.data?.recurrence_starts );\n \tconst endRecDate = new DateTZ({date: occEndDate.ms, is_local_tz: false, building_tz });\n this.date = `From ${weekDayMonthYearFormat(startDate)} until ${weekDayMonthYearFormat(endRecDate)}` ;\n }\n else {\n this.date = weekDayMonthYearFormat(startDate);\n }\n\n const startDisplay = startDate.formatDate(`${timeFormatString()}`).toLocaleLowerCase();\n const endDate = startDate.addValue({ minutes: duration });\n const endDisplay = timeWithGmtOffsetFormatString(endDate);\n this.timing = `${startDisplay}-${endDisplay}`; // - TODO correct for DST?\n\n const durationDisplay = humaniseDuration(duration, 'short');\n this.types = `${durationDisplay}, ${bookingType.display}, ${roomSize.display}`;\n\n this.filterDisplay = this.filters.map(f => f.shortDisplay).join(', ');\n this.filterCount = this.filters.length > 0 ? `(${this.filters.length})` : '';\n }\n\n public clearAllFilters() {\n this.store.dispatch(clearRoomFilters());\n } \n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-footer-menu',\n templateUrl: './footer-menu.component.html',\n styleUrls: ['./footer-menu.component.scss']\n})\nexport class FooterMenuComponent extends BaseDirective implements OnInit {\n\n /** Tiles to display on the home page */\n public tiles: ApplicationLink[] = [];\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Angular Component initialisation lifecycle hook */\n public ngOnInit(): void {\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.tiles = this._service.setting('app.home.tiles') || [];\n });\n }\n}\n","\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router\n} from '@angular/router';\nimport { first } from 'rxjs/operators';\n\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport {\n ApplicationService,\n Building,\n BuildingLevel,\n OrganisationService\n} from '@mckinsey-converge/data-common';\n\n@Component({\n selector: 'a-map-controls',\n templateUrl: './map-controls.component.html',\n styleUrls: ['./map-controls.component.scss']\n})\nexport class MapControlsComponent extends BaseDirective implements OnInit {\n /** ID of the active building */\n @Input() public building: string;\n /** ID of the active level */\n @Input() public level: string;\n /** Emitter for changes to the active level */\n @Output() public levelChange = new EventEmitter();\n /** Details of the active building */\n public building_details: Building = this._org.building;\n /** List of available buildings */\n public building_list: Building[] = [];\n /** List of available levels */\n public level_list: readonly BuildingLevel[] = [];\n\n public get can_select_building(): boolean {\n return !!this._service.setting('app.explore.can_select_building');\n }\n\n constructor(\n private _route: ActivatedRoute,\n private _router: Router,\n private _service: ApplicationService,\n private _org: OrganisationService\n ) {\n super();\n }\n\n public ngOnInit() {\n this._org.listen('buildings').pipe(first(_ => !!_ && !!_.length)).subscribe(() => {\n this.subscription(\n 'route.query',\n this._route.queryParamMap.subscribe(params => {\n /* istanbul ignore else */\n if (params.has('level')) {\n const level_id = params.get('level');\n const level = this._org.levelWithID(level_id);\n this.level = level.id;\n this.setBuilding(level.building_id);\n this.levelChange.emit(this.level);\n this.clearTimeout('check_building');\n }\n })\n );\n this.building_list = this._org.buildings;\n this.timeout('check_building', () => {\n /* istanbul ignore else */\n if (!this.building) {\n this.setBuilding(this._org.building.id);\n }\n this.levelChange.emit(this.level);\n });\n });\n }\n\n public setBuilding(bld_id: string) {\n const building = this._org.buildings.find(bld => bld.id === bld_id);\n /* istanbul ignore else */\n if (building) {\n this.building_details = building;\n this.building = bld_id;\n this._org.building = building;\n this.level_list = building.levels;\n /* istanbul ignore else */\n if (this.level_list.length && !this.level_list.find(lvl => lvl.id === this.level)) {\n this.updateLevel(this.level_list[0].id);\n }\n }\n }\n\n public updateLevel(lvl_id: string) {\n this.level = lvl_id;\n this.levelChange.emit(this.level);\n this._router.navigate([], {\n relativeTo: this._route,\n queryParams: { level: lvl_id }\n });\n }\n}\n","
\n 1\"\n >\n \n {{ building_details?.code }} - {{ building_details?.name }} \n \n
\n
{{ bld.code }}
\n
{{ bld.name }}
\n
{{ bld.address }}
\n
\n
\n
\n \n \n \n \n {{ level.name }}\n \n \n \n
\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\nimport {\n ApplicationLink,\n ApplicationService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\nimport { DateNow } from '@mckinsey-converge/date-tz';\n\n\n@Component({\n selector: 'a-overlay-menu',\n templateUrl: './overlay-menu.component.html',\n styleUrls: ['./overlay-menu.component.scss']\n})\nexport class OverlayMenuComponent extends BaseDirective {\n /** Whether to show the menu */\n @Input() public show: boolean;\n /** Emitter for changes to show */\n @Output() public showChange = new EventEmitter();\n\n /** List of links to display on the menu */\n public get menu_items(): ApplicationLink[] {\n const settings = this._service.setting('app.general.menu') || { items: [] };\n return settings.items || [];\n }\n\n /** Copyright details for the application */\n public get copyright(): string {\n return (this._service.setting('app.general.menu') || {}).copyright || '';\n }\n\n public get settings() {\n const settings = this._service.setting('app.general.menu') || { position: '' };\n return settings;\n }\n\n constructor(private _service: ApplicationService) {\n super();\n }\n\n /** Current year to display for copyright */\n public get year(): number {\n return DateNow(new Date()).dateYear;\n }\n\n /** Close the overlay menu */\n public close() {\n this.show = false;\n this.showChange.emit(this.show);\n }\n\n public delayedClose() {\n this.timeout('close', () => this.close(), 50);\n }\n\n public cancelClose() {\n this.timeout('cancel_close', () => this.clearTimeout('close'), 10);\n }\n}\n","\n
\n
\n
\n \n
\n
\n \n
\n
\n Copyright © {{ year }} {{ copyright }}\n
\n
\n\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit\n} from '@angular/core';\nimport { throttleTime, tap } from 'rxjs/operators';\nimport { BehaviorSubject, fromEvent } from 'rxjs';\nimport { ImageDirective } from '@mckinsey-converge/base';\nimport { setupRoomImages } from '@mckinsey-converge/data-common';\nimport { SpaceImageObject } from 'libs/base/src/lib/types.utilities'\n\n@Component({\n selector: 'mck-responsive-inline-images',\n template: `\n
\n
\n \n
\n Images Coming Soon\n
\n \n
\n
\n
\n Images Coming Soon\n
\n
\n
\n `,\n styleUrls: ['./responsive-inline-images.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ResponsiveInlineImagesComponent extends ImageDirective implements OnInit {\n\n /** Input array of images */\n @Input() public rootFolderURL: string;\n @Input() public fileSlug: string;\n\n /** Ignore this param, it's only use is to bypass the image onload event in testing */\n @Input() public imagesLoaded: boolean;\n public loadImages = new BehaviorSubject([]);\n\n public foundImages: SpaceImageObject[] = [1,2,3].map(n => {\n return {path: `assets/img/rooms/placeholder-${n}.png`};\n });\n\n public mobile = false;\n\n constructor(private cdRef: ChangeDetectorRef,) {\n super();\n }\n\n public ngOnInit(): void {\n const breakpoint = 768;\n\n if (window) {\n this.mobile = window.innerWidth < breakpoint;\n }\n\n fromEvent(window, 'resize').pipe(throttleTime(500)).pipe(tap({\n next: val => {\n const target = val.target as Window;\n this.mobile = target.innerWidth < breakpoint;\n }\n })).subscribe();\n setupRoomImages(this, [1,2,3], this.rootFolderURL, this.fileSlug, this.imagesLoaded);\n this.subscription(\n\t\t\t\t\t\t'found_images',\n\t\t\t\t\t\tthis.loadImages.subscribe((imgArr: SpaceImageObject[]) => {\n\t\t\t\t\t\t\tif(imgArr.length) this.foundImages = imgArr;\n\t\t\t\t\t\t\tthis.cdRef.detectChanges();\n\t\t\t\t\t\t}));\n }\n\n public showLabel(path) {\n return path.includes('placeholder');\n } \n\n public get timestamp () {\n return (new Date()).getTime()\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n MatDialogRef,\n MAT_DIALOG_DATA\n} from '@angular/material/dialog';\nimport {\n BaseClass\n} from '@mckinsey-converge/base';\nimport { ComposerService } from '@placeos/composer';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'a-survey-modal',\n templateUrl: './survey-modal.component.html',\n styleUrls: ['./survey-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SurveyModalComponent extends BaseClass implements OnInit {\n constructor(\n @Inject(MAT_DIALOG_DATA) public _data: any,\n private _composer: ComposerService,\n private _dialog_ref: MatDialogRef,\n ) {\n super();\n }\n\n /* present experience question by default */\n public token = '';\n public phase = 'intro';\n public baseUrl = '';\n\n public questions = {\n created_at: 0,\n updated_at: 0,\n header_question: \"What went wrong?\",\n header_subtext: \"Select one or several options\",\n options: [],\n id: \"\"\n }\n\n public answers = {\n questions_id: \"\",\n positive: true, // Experience is positive until the questions are displayed\n option_responses: [],\n comments: \"\"\n };\n\n // Show the questions and mark the experience negative. (false positive)\n public showQuestions(): void {\n this.answers.positive = false;\n this.phase = 'questions';\n }\n\n public ngOnInit(): void {\n /* fetch the question options once composer is initialized */\n this._composer.initialised.pipe(first(_ => _)).subscribe(() => {\n const token = this._composer.auth.token;\n this.token = token;\n this.baseUrl = this._composer.auth.api_endpoint.replace(this._composer.auth.route, '/api/staff/feedback')\n this.getFeedbackQuestionsFromApi(token, this._data)\n });\n }\n\n public getFeedbackQuestionsFromApi(token: string, questionID: string) {\n new Promise((resolve, reject) => {\n const url = `${this.baseUrl}/questions/${questionID}`;\n let result: any = null;\n this._composer.http.get(url).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.questions = d;\n this.answers = {\n questions_id: this.questions.id,\n positive: true,\n option_responses: this.questions.options.map(q => ({ // map the questions to default answers.\n id: q.id,\n checked: false,\n })),\n comments: \"\"\n };\n }).catch(e => {\n console.log('error', e)\n });\n }\n\n // Handle the checkbox changes\n public handleChange(value: any) {\n this.answers.option_responses.some((o, i) => {\n if (o.id === value.id) {\n this.answers.option_responses[i].checked = !this.answers.option_responses[i].checked;\n return true;\n }\n });\n }\n\n // Handle the comment input changes\n public handleComment($evemt: any) {\n this.answers.comments = $evemt.target.value;\n }\n\n // Submit the Survey in it's current state.\n public confirm() {\n new Promise((resolve, reject) => {\n let result: any = null;\n this._composer.http.post(this.baseUrl, this.answers).subscribe(\n (d) => (result = d),\n (e) => {\n reject(e);\n },\n () => {\n resolve(result);\n }\n );\n }).then(d => {\n this.phase = 'exit';\n this.closeModal(true);\n }).catch(e => {\n console.log('error', e)\n this.phase = 'exit';\n this.closeModal(true);\n });\n \n }\n\n // Close the modal\n public closeModal(delayed: boolean = false) {\n if (delayed) {\n this.timeout('closeModal', () => {\n this._dialog_ref.close();\n }, 2000);\n } else {\n this._dialog_ref.close();\n }\n }\n}\n","
\n \n
\n
\n \n
\n How was your booking experience?\n
\n
\n
\n \n \n
\n
\n\n\n
\n
\n \n
\n \n What went wrong?\n

Select one or several options

\n
\n
\n
\n
\n {{question.option}}\n
\n
\n \n \n \n \n
\n
\n \n \n \n
\n\n
\n
\n \n
\n\n \n
\n Thank you!\n
\n \n
\n
\n
\n
","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n distinctUntilChanged,\n first,\n} from 'rxjs/operators';\nimport {\n ApplicationIcon,\n BookingFormState,\n SettingsService,\n openBookingSurvey,\n clearBookingFormData,\n BookingFormData,\n SeriesAction,\n selectActiveForm,\n OrganisationService\n} from '@mckinsey-converge/data-common';\nimport { loadRoomsForResults } from '@mckinsey-converge/rooms';\n\nimport { loadOrganisations } from '@mckinsey-converge/organisation';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport {\n NavigationEnd,\n Router,\n ActivatedRoute\n} from '@angular/router';\nimport {\n generateFeedbackUrl,\n Urls\n} from '../../utilities/urls';\nimport { SurveyModalComponent } from '../survey-modal/survey-modal.component';\nimport {\n Store, select\n} from '@ngrx/store';\n\nexport enum TopBarHeaderMode {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface RoutePayload {\n /** IE ['/home', 'results'] */\n route: string[];\n /** IE { display: '/list' } */\n queryParams?: object;\n}\n\nexport type RoomBookingStoreState = BookingFormState & BuildingStoreState;\n\n@Component({\n selector: 'a-topbar-header',\n template: `\n
\n
\n \n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n
\n `,\n styleUrls: ['./topbar-header.component.scss'],\n // encapsulation: ViewEncapsulation.None,\n})\nexport class TopbarHeaderComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether to show menu */\n @Input() public menu: boolean;\n /** Whether to show modal close icon */\n @Input() public modal: boolean = false;\n /** Whether t show modal back icon */\n @Input() public backModal: boolean = false;\n /** Whether to disable the survey triggers */\n @Input() public noSurvey: boolean = false;\n /** Name of the page being rendered */\n @Input() public page: string;\n /** The theme to use **/\n @Input() public mode: TopBarHeaderMode = TopBarHeaderMode.Dark;\n /** Override the home route. **/\n @Input() public homeOverride: string | undefined;\n /** Show history back instead of logo block */\n @Input() public back: RoutePayload;\n /** Emitter for changes to menu state */\n @Output() public menuChange = new EventEmitter();\n /** Emitter for the close button */\n @Output() public closeCallback = new EventEmitter();\n /** Emitter for the back button */\n @Output() public onBack = new EventEmitter();\n /** Name of the currently active page */\n public currentPage: string;\n /** Survey modal state */\n public modalOpen: boolean = false;\n isEditSeries: boolean = false;\n\n public get feedback() {\n const feedback_url = this._org.getOrganizationFiltersByRoomType('feedback_url');\n return `${feedback_url}${this.currentPage}`;\n // return generateFeedbackUrl(this.currentPage);\n }\n\n public surveyDialogRef: MatDialogRef = null;\n\n public bookingCompleted: Date = new Date();\n public feedbackId: string = null;\n\n constructor(private store: Store,\n private _settings: SettingsService,\n private _dialog: MatDialog,\n private route: ActivatedRoute,\n private _org: OrganisationService,\n private _router: Router) {\n super();\n }\n\n public ngOnInit(): void {\n this.store.dispatch(loadOrganisations.request());\n this._settings.initialised.pipe(first(_ => _)).subscribe(() => {\n this.logo = this._settings.get(`app.logo_${this.mode}`) || { type: 'icon' };\n });\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n this._router.events.subscribe((event: NavigationEnd) => {\n /* istanbul ignore else */\n if (event instanceof NavigationEnd) {\n this.timeout('Getting Title', () => this.updateRoute(document.title));\n }\n });\n\n // if the survey is allowed (don't in modals! due to duplicate appearances)\n if (!this.noSurvey) {\n // get the active form values\n this.subscription('openSurveyModal', this.store.pipe(\n distinctUntilChanged()\n ).subscribe((next: any | undefined) => {\n const feedbackId = next.organisation?.data?.success?._settings?.discovery_info?.feedback_id;\n if (feedbackId && this.feedbackId !== feedbackId) {\n this.feedbackId = feedbackId;\n }\n if (next.bookingForm?.bookingCompleted && this.bookingCompleted.getTime() < next.bookingForm.bookingCompleted.getTime()) {\n this.bookingCompleted = new Date(next.bookingForm.bookingCompleted.getTime());\n this.openFeedbackModal();\n }\n }));\n }\n\n\n this.subscription('activeForm', this.store.pipe(\n select(selectActiveForm),\n distinctUntilChanged()\n ).subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.isEditSeries = next.action === SeriesAction.EDIT;\n }\n }));\n }\n\n public updateRoute(location) {\n location = location.substr(0, location.indexOf(' |'));\n this.currentPage = location;\n }\n\n /** Set menu state to `true` */\n public showMenu() {\n this.menu = true;\n this.menuChange.emit(this.menu);\n }\n\n public async goToHome() {\n // this.isEditSeries && this.clearFormAndResultData();\n // Clear the form and result data before navigating to home for a fresh start for all type of bookings\n this.clearFormAndResultData();\n await this._router.navigate([this.homeOverride ?? '/']);\n // await this._router.navigate(['/', 'home'], { relativeTo: this.route });\n this._dialog.closeAll();\n }\n\n\n\tpublic clearFormAndResultData() {\n\t\tthis.store.dispatch(clearBookingFormData());\n\t\tthis.store.dispatch(loadRoomsForResults.clear());\n\t}\n\n public goToHelp() {\n const help_url = this._org.getOrganizationFiltersByRoomType('help_url');\n window.open(help_url || Urls.Help);\n }\n\n public goToFeedback() {\n // Over-engineered button action to mimic/test booking confirmation event.\n this.store.dispatch(openBookingSurvey());\n }\n\n public openFeedbackModal() {\n if (!this.modalOpen && !this.surveyDialogRef) {\n this.modalOpen = true;\n this.surveyDialogRef = this._dialog.open(SurveyModalComponent, {\n disableClose: true,\n panelClass: 'mck-modal-survey',\n data: this.feedbackId,\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n this.surveyDialogRef.afterClosed().subscribe(() => {\n this.modalOpen = false;\n this.surveyDialogRef = null;\n });\n }\n\n }\n\n public async goToBackRoute() {\n this.onBack.emit();\n await this._router.navigate(this.back.route, { queryParams: this.back.queryParams });\n }\n\n}\n","import {\n Component,\n OnInit\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n Validators\n} from '@angular/forms';\nimport { first } from 'rxjs/operators';\n\nimport {\n ApplicationIcon,\n ApplicationService,\n UsersService\n} from '@mckinsey-converge/data-common';\nimport { BaseDirective } from '@mckinsey-converge/base';\n\n@Component({\n selector: 'app-login',\n templateUrl: './login.component.html',\n styleUrls: ['./login.component.scss']\n})\nexport class LoginComponent extends BaseDirective implements OnInit {\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n /** Whether the user credentials are being checked */\n public loading: boolean;\n /** Form fields for the login form */\n public form: FormGroup;\n\n constructor(private _service: ApplicationService, private _users: UsersService) {\n super();\n }\n\n public ngOnInit(): void {\n this.loading = true;\n this.form = new FormGroup({\n username: new FormControl('', [Validators.required]),\n password: new FormControl('', [Validators.required])\n });\n this._service.initialised.pipe(first(_ => _)).subscribe(() => {\n this.loading = false;\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n }\n\n /** Perform user login */\n public login() {\n this.loading = true;\n const form = this.form.value;\n this._users.login({\n username: form.username,\n password: form.password\n }, { form: true }).then(() => {\n this.loading = false;\n }, () => {\n this.loading = false;\n this.form.controls.password.setErrors({ check: true });\n });\n }\n\n}\n","
\n
\n
\n
\n
\n {{ logo.content }}\n \n
\n
\n
\n \n
\n \n Username:\n \n \n \n Username is required\n \n
\n
\n \n Password:\n \n \n \n Invalid username or password\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n\n
\n
\n \n
\n
Converge is loading
\n
\n
\n","import {\n Component,\n EventEmitter,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\n@Component({\n selector: 'app-map-controls',\n template: `\n
\n
\n \n
\n \n \n
\n \n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-controls.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class MapControlsComponent implements OnInit {\n @Output()\n public zoomOutClick = new EventEmitter();\n\n @Output()\n public zoomInClick = new EventEmitter();\n\n @Output()\n public refreshClick = new EventEmitter();\n\n @Output()\n public infoClick = new EventEmitter();\n\n @Output() toggleEvent = new EventEmitter();\n\n public isClosed = true;\n\n toggle() {\n this.toggleEvent.emit();\n this.isClosed = !this.isClosed;\n }\n\n constructor() {}\n\n ngOnInit(): void {}\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { FormControl } from '@angular/forms';\nimport { BaseDirective } from '@mckinsey-converge/base';\nimport { legendOptions } from '../map.utils';\n\n@Component({\n selector: 'app-map-filters',\n template: `\n
\n
\n \n \n
\n \n \n
\n \n
\n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-filters.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapFiltersComponent extends BaseDirective implements OnInit {\n\n public legendOptions = legendOptions();\n\n @Input()\n public buildings: SelectOption[];\n\n @Input()\n public selectedBuilding: SelectOption;\n\n @Output()\n public selectedBuildingChange = new EventEmitter>();\n\n @Input()\n public levels: SelectOption[];\n\n @Input()\n public selectedLevel: SelectOption;\n\n @Output()\n public selectedLevelChange = new EventEmitter>();\n\n @Input()\n public spaces: SelectOption[];\n\n @Output()\n public selectedSpaceChange = new EventEmitter>();\n\n @Input()\n public selectedSpace: SelectOption;\n\n @Output()\n public searchClick = new EventEmitter();\n\n public buildingControl = new FormControl();\n\n public levelControl = new FormControl();\n\n public spaceControl = new FormControl();\n\n public resetInput: number;\n\n public searchStringPresent = false;\n\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.subscription('buildingChanges',\n this.buildingControl.valueChanges.subscribe(value => this.selectedBuildingChange.emit(value)));\n this.subscription('levelChanges',\n this.levelControl.valueChanges.subscribe(value => this.selectedLevelChange.emit(value)));\n this.subscription('spaceChanges',\n this.spaceControl.valueChanges.subscribe(value => {\n this.selectedSpaceChange.emit(value);\n this.searchClick.emit();\n }));\n }\n\n public clearRoomSearch() {\n this.resetInput = Date.now();\n this.selectedSpace = null;\n this.searchStringPresent = false;\n // TODO, reset the focused room if required?\n }\n\n public inputTextChange(event: any) {\n this.searchStringPresent = !!event.length;\n }\n}\n","import {\n Component,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n Space,\n RoomResultsViewModel,\n} from '@mckinsey-converge/data-common';\nimport { MAP_OVERLAY_DATA } from '@acaprojects/ngx-interactive-map';\n\n\ninterface SpaceWithReturnData extends Space {\n // callback?: Function,\n room?: RoomResultsViewModel,\n parentComponent?: any,\n}\n/**\n * Replaces the built-in {@link MapPinComponent} based on design.\n */\n@Component({\n selector: 'app-map-overlay',\n template: `\n
\n \n
\n
\n
\n \n
\n
\n
\n {{data.simple_name || 'No Label'}}\n \n \n
{{ data.status === 'requestable' ? 'Requestable' : 'Bookable'}} {{ data?.room?.space?.availableOccurrences }} out of {{ data?.room?.space?.totalOccurrences }}
\n
\n
\n
\n\n
\n `,\n styleUrls: ['./map-overlay.component.scss'],\n encapsulation: ViewEncapsulation.Emulated\n})\nexport class MapOverlayComponent implements OnInit {\n constructor(\n @Inject(MAP_OVERLAY_DATA) public data: SpaceWithReturnData,\n ) {\n }\n public ngOnInit(): void {\n }\n\n\n public roomDataCallback() {\n if (this.data.parentComponent.roomSelected && this.data.room) {\n this.data.parentComponent.roomSelected(this.data.room)\n }\n }\n\n public get is_recurrent () {\n return this.data.parentComponent?.bookingFormData?.value?.is_recurrent || false;\n }\n\n public closeOverlay() {\n this.data.parentComponent?.closeMapOverlayOutlet();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, interval } from 'rxjs';\nimport { BaseDirective, HashMap, Point } from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { select, Store } from '@ngrx/store';\nimport { BuildingStoreState } from '@mckinsey-converge/buildings';\nimport {\n Building,\n BuildingLevel,\n SettingsService,\n Space,\n mapBuildingLevelToOption,\n mapResultsToViewModels,\n RoomResultsViewModel,\n selectActiveForm,\n selectBookingLocations,\n selectMapFilteredResults,\n selectSelectedBuildingOptions,\n roomFormDataToQuery,\n FilteredSpaces,\n BookingStoreState,\n storeBookingFormData,\n BookingFormData,\n MapListener,\n selectFilteredDiffSizeResults\n} from '@mckinsey-converge/data-common';\nimport { distinctUntilChanged, map, take, withLatestFrom } from 'rxjs/operators';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\nimport { MatDialog } from '@angular/material/dialog';\nimport { OfficeInformationModalComponent } from 'src/app/map/office-information-modal/office-information-modal.component';\nimport {\n CENTER_POINT,\n generateMapListenersForSpace,\n generateMapStyleForSpace,\n MAX_ZOOM_LEVEL,\n MIN_ZOOM_LEVEL,\n roomToMapFeature,\n} from 'src/app/map/map.utils';\nimport {\n loadRoomsForResults,\n loadRoomsForResultsMap,\n mapRoomToSelectOption,\n RoomStoreState,\n} from '@mckinsey-converge/rooms';\nimport { LoadingModel } from '@mckinsey-converge/loading';\nimport { UserStoreState } from '@mckinsey-converge/user';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\n\nexport type MapSearchStoreState = BuildingStoreState &\n RoomStoreState &\n BookingStoreState &\n UserStoreState;\n\n@Component({\n selector: 'app-map-search',\n template: `\n
\n
\n \n \n
\n
\n
\n \n
\n \n \n \n \n
\n
\n `,\n styleUrls: ['./map-search.component.scss'],\n encapsulation: ViewEncapsulation.Emulated,\n animations: [\n trigger('expandHeight', [\n state(\n 'open',\n style({\n height: '470px',\n })\n ),\n state(\n 'closed',\n style({\n height: 'calc(100vh - 270px)',\n })\n ),\n transition('open <=> closed', animate('600ms ease-out')),\n ]),\n ],\n})\nexport class MapSearchComponent extends BaseDirective implements OnInit {\n @Input()\n public openHeader: boolean = true;\n\n public zoom = new BehaviorSubject(MIN_ZOOM_LEVEL);\n\n public center = new BehaviorSubject(CENTER_POINT);\n public listeners = new BehaviorSubject([]);\n\n public focusedMapSpace = new BehaviorSubject(undefined);\n public features = combineLatest([this.focusedMapSpace]).pipe(\n map((items) => items.filter((i) => !!i))\n );\n\n public focusedRoom = new BehaviorSubject(undefined);\n\n public resultBuildings = new BehaviorSubject([]);\n public resultSpaces = new BehaviorSubject([]);\n // public resultSpaces = new BehaviorSubject>(\n // LoadingModel.empty()\n // );\n\n public activeBuilding = new BehaviorSubject(undefined);\n public activeLevel = new BehaviorSubject(undefined);\n public activeSpace = new BehaviorSubject(undefined);\n\n /** Mapping of elements to CSS styles */\n public style_map = new BehaviorSubject>>({});\n\n public mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''));\n\n public bookingLocations = new BehaviorSubject[]>([]);\n public buildingLevelOptions = new BehaviorSubject[]>([]);\n public spaceListOptions = new BehaviorSubject[]>([]);\n\n public activeBuildingOption = combineLatest([this.activeBuilding, this.bookingLocations]).pipe(\n map(([building, locations]) => locations.find((l) => l.value === building?.id))\n );\n\n public activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n public activeSpaceOption = this.activeSpace.pipe(map(mapRoomToSelectOption));\n public bookingFormData = new BehaviorSubject(undefined);\n public floorData: any;\n public floorDataParam: any;\n @Output() toggleEvent = new EventEmitter();\n\n //to capture state for toggling expandHeight animation\n public isOpen = true;\n resultsLoading: any;\n\n propagateToggle() {\n this.toggleEvent.emit();\n this.isOpen = !this.isOpen;\n }\n \n\n constructor(\n private store: Store,\n public dialog: MatDialog,\n private settingService: SettingsService,\n private router: Router,\n private location: Location,\n private route: ActivatedRoute\n ) {\n super();\n this.floorData = location.getState();\n }\n\n public ngOnInit(): void {\n // this.resultsLoading = this.resultSpaces.pipe(map((m) => m.isLoading));\n \n this.subscription(\n 'bookingLocations',\n this.store.pipe(select(selectBookingLocations)).subscribe((next) => {\n this.bookingLocations.next(next);\n // update the map view MCK-1100 when location changes\n const self = this;\n setTimeout(() => {\n self.selectActiveBuilding(self.bookingLocations.value[0]);\n }, 0);\n })\n );\n this.subscription(\n 'bookingSpaceResults',\n combineLatest([\n this.store.pipe(\n select(selectMapFilteredResults),\n map((r: LoadingModel) => { \n this.resultsLoading = r.isLoading;\n return r.success;})\n ),\n this.activeBuilding.pipe(filterUndefined()),\n this.activeLevel.pipe(filterUndefined()),\n ]).subscribe(([filteredSpaces, building, level]) => {\n const spacesFromSelection = (filteredSpaces.spaces || []).filter(\n (s) => !!s.map_id && s.zones.includes(building.id)\n );\n this.resultSpaces.next(spacesFromSelection);\n\n const listeners: MapListener[] = [];\n const styles: HashMap> = {};\n const colour_map = this.settingService.get('app.explore.colors') || {};\n spacesFromSelection.forEach((space) => {\n const status = filteredSpaces.statusMap[space.id];\n const mapStyle = generateMapStyleForSpace(space, status, colour_map);\n styles[`#${mapStyle.id}`] = mapStyle.styles;\n listeners.push(\n ...generateMapListenersForSpace(\n space,\n () => {},\n () => {},\n status !== 'in-use' ? \n () => {\n this.activeSpace.next(space);\n this.focusOnRoom(status);\n } \n : ()=> {}\n )\n );\n });\n this.style_map.next(styles);\n this.listeners.next(listeners);\n })\n );\n this.subscription(\n 'bookingResults',\n this.resultSpaces\n .pipe(withLatestFrom(this.activeSpace))\n .subscribe(([resultSpaces, activeSpace]) => {\n this.spaceListOptions.next(resultSpaces.map(mapRoomToSelectOption));\n })\n );\n\n this.subscription(\n 'storeResultedBuildings',\n this.store.pipe(select(selectSelectedBuildingOptions)).subscribe((buildings) => {\n this.resultBuildings.next(buildings);\n // if we dont have active building yet, set it here.\n if (buildings.length > 0 && !this.activeBuilding.value) {\n const firstBuilding = buildings[0];\n this.activeBuilding.next(firstBuilding);\n }\n })\n );\n\n this.subscription(\n 'activeBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n map((b: Building) => b.levels)\n )\n .subscribe((levels) => {\n this.buildingLevelOptions.next(levels.map(mapBuildingLevelToOption));\n \n if(this.activeLevel.value){\n this.floorDataParam = {\n display: this.activeLevel.value.name,\n value: this.activeLevel.value.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n \n })\n );\n\n // if levels change and active level no longer part of list, pick first.\n this.subscription(\n 'updateActiveLevelOnActiveBuildingChange',\n this.activeBuilding\n .pipe(\n filterUndefined(),\n distinctUntilChanged(),\n withLatestFrom(this.activeLevel),\n map(\n ([building, activeLevel]) =>\n (activeLevel && building.levels.find((l) => l.id === activeLevel.id)) ||\n building.levels[0]\n )\n )\n .subscribe((level) => {\n this.activeLevel.next(level);\n })\n );\n\n // re-request rooms every minute to update space status.\n this.subscription(\n 'updateSpaceStatusInterval',\n interval(60 * 1000)\n .pipe(withLatestFrom(this.store.select(selectActiveForm)))\n .subscribe(([, form]) => {\n this.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(form) ));\n })\n );\n\n // get the active form values\n this.subscription(\n 'activeForm',\n this.store\n .pipe(select(selectActiveForm), distinctUntilChanged())\n .subscribe((next: BookingFormData | undefined) => {\n if (next) {\n this.bookingFormData.next(next);\n }\n })\n );\n\n if (this.floorData?.payload) {\n this.floorDataParam = {\n display: this.floorData?.payload.name,\n value: this.floorData?.payload.id,\n };\n this.selectBuildingLevel(this.floorDataParam);\n setTimeout(() => {\n this.refreshFloorNumber();\n });\n }\n }\n\n public refreshFloorNumber(): void {\n this.activeLevelOption = this.activeLevel.pipe(map(mapBuildingLevelToOption));\n }\n\n public zoomIn() {\n if (this.zoom.value < MAX_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value + 1);\n }\n }\n\n public zoomOut() {\n if (this.zoom.value > MIN_ZOOM_LEVEL) {\n this.zoom.next(this.zoom.value - 1);\n }\n }\n\n public displayOfficeInformation() {\n this.dialog.open(OfficeInformationModalComponent, {\n data: this.activeBuilding.value,\n panelClass: 'mck-alert',\n autoFocus: false,\n backdropClass: 'mck-modal-backdrop',\n });\n }\n\n public resetZoomLevels() {\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n // this.focusedMapSpace.next(undefined);\n }\n\n public closeMapOverlayOutlet = () => {\n this.focusedMapSpace.next(undefined)\n this.zoom.next(MIN_ZOOM_LEVEL);\n this.center.next(CENTER_POINT);\n this.focusedRoom.next(undefined);\n };\n \n\n public selectActiveBuilding(selection: SelectOption) {\n this.resultBuildings\n .pipe(\n map((all) => all.find((b) => b.id === selection.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeBuilding.next(next);\n });\n }\n\n public selectBuildingLevel(selection: SelectOption) {\n this.activeBuilding\n .pipe(\n map((b) => b.levels?.find((l) => l.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n\t\t\t\tthis.store.dispatch(loadRoomsForResultsMap.request(roomFormDataToQuery(this.bookingFormData.value) ));\n this.activeLevel.next(next);\n\n /**\n * update mapUrl as per active level on change of filter search\n */\n this.mapUrl = this.activeLevel.pipe(map((level) => level?.map_url ?? ''))\n });\n }\n\n public selectActiveSpace(selection: SelectOption) {\n this.resultSpaces\n .pipe(\n map((all) => all.find((s) => s.id === selection?.value)),\n take(1),\n filterUndefined()\n )\n .subscribe((next) => {\n this.activeSpace.next(next);\n });\n }\n\n public focusOnRoom(status?:string) {\n this.activeSpace.pipe(take(1), filterUndefined()).subscribe((next) => {\n let delay = 0;\n if (next.level.id !== this.activeLevel.value.id) {\n this.activeLevel.next(next.level);\n delay = 500;\n }\n this.timeout(\n 'updateLevelAndRoom',\n () => {\n const focusedRoom = mapResultsToViewModels(\n [this.activeSpace.value],\n [this.activeLevel.value],\n [this.activeBuilding.value]\n );\n this.focusedRoom.next(focusedRoom[0]);\n this.focusedMapSpace.next(roomToMapFeature(this.focusedRoom.value, this, status));\n this.zoom.next(MAX_ZOOM_LEVEL);\n },\n delay\n );\n });\n }\n\n public roomSelected(room: RoomResultsViewModel) {\n\n\n const { is_recurrent } = this.bookingFormData.value;\n this.bookingFormData.value.recurrence_exceptions = [];\n if(is_recurrent){\n // Handle recurrence conflicts if the booking is part of a recurring series\n const spaceConflicts = room.space.recurrence_availability.filter(recurr => !recurr.available);\n this.bookingFormData.value.recurrence_exceptions = spaceConflicts.map((recurr)=> recurr.date);\n }\n\n\n // Handle timezone offset for accurate date and time information\n let { dateTz } = this.bookingFormData.value;\n // if (this.offset) {\n dateTz = dateTz.addValue({ minutes: 0 });\n // }\n\n /**\n * selectedRoom.space is fully fledged Space class\n * this.bookingFormData.value.booking.room is not and does not contain the timezone\n * this.bookingFormData.value.booking.timezone is legit\n */\n // UPDATE: providing payload as part of extras instead dispatching storeBookingFormData event to avoid redundant backend request calls\n this.router.navigate(['room'], { relativeTo: this.route, state:{payload : {\n ...this.bookingFormData.value,\n // buildings: this._org.buildings, // require to manage browser refresh on room detail screen!\n dateTz,\n offset: 0,\n selectedRoom: room\n }\n }});\n\n\n // submit\n // this.store.dispatch(\n // storeBookingFormData({\n // payload: {\n // ...this.bookingFormData.value,\n // selectedRoom: room,\n // },\n // })\n // );\n\n // this.router.navigate(['room'], { relativeTo: this.route });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MapSearchComponent } from './map-search/map-search.component';\nimport { MapControlsComponent } from './map-controls/map-controls.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { LibraryModule } from '@acaprojects/ngx-interactive-map';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MapFiltersComponent } from './map-filters/map-filters.component';\nimport { UiModule } from '@mckinsey-converge/ui';\nimport { OfficeInformationModalComponent } from './office-information-modal/office-information-modal.component';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MapOverlayComponent } from './map-overlay/map-overlay.component';\nimport { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';\n\nexport const mapModuleImports = [\n CommonModule,\n MatButtonModule,\n LibraryModule,\n MatSelectModule,\n UiModule,\n MatDialogModule,\n NgxSkeletonLoaderModule\n];\n\nexport const mapModuleDeclarations = [\n MapSearchComponent,\n MapControlsComponent,\n MapFiltersComponent,\n OfficeInformationModalComponent,\n MapOverlayComponent\n];\n\n@NgModule({\n declarations: [\n ...mapModuleDeclarations\n ],\n exports: [\n ...mapModuleDeclarations\n ],\n imports: [\n ...mapModuleImports\n ]\n})\nexport class MapModule {\n}\n","import { SelectOption } from '@mckinsey-converge/ui';\nimport {\n Space,\n SpaceStatus,\n RoomResultsViewModel,\n MapListener\n} from '@mckinsey-converge/data-common';\nimport {\n HashMap,\n Point\n} from '@mckinsey-converge/base';\nimport { MapFeature } from '@acaprojects/ngx-interactive-map/lib/helpers/map.interfaces';\nimport { MapOverlayComponent } from 'src/app/map/map-overlay/map-overlay.component';\n\nexport const MIN_ZOOM_LEVEL = 1;\nexport const MAX_ZOOM_LEVEL = 10;\nexport const CENTER_POINT: Point = { x: 0.5, y: 0.5 };\n\nconst mapSpaceStatusToDisplay = (status: SpaceStatus): string => {\n switch (status) {\n case SpaceStatus.NotBookable:\n return 'Not Bookable';\n case SpaceStatus.Requestable:\n return 'Available by Request';\n case SpaceStatus.Unavailable:\n return 'In Use';\n case SpaceStatus.Available:\n default:\n return 'Available';\n }\n};\n\nconst mapSpaceStatusToOption = (status: SpaceStatus) => ({\n value: status,\n display: mapSpaceStatusToDisplay(status)\n});\n\nexport const legendOptions = (): SelectOption[] => [\n SpaceStatus.Available,\n SpaceStatus.Requestable,\n SpaceStatus.Unavailable,\n SpaceStatus.NotBookable\n].map(mapSpaceStatusToOption);\n\n\nexport const defaultMapBookingRules = [\n 'Rooms showing yellow are restricted and must be requested',\n 'Rooms showing green are available to book for one hour',\n 'Rooms showing red are booked',\n 'Rooms showing grey are not bookable but may be used if they are empty'\n];\n\nexport const defaultMapBookingSubtitle = 'You may request restricted rooms but they will need to be approved by an admin';\n\nexport const generateMapStyleForSpace = (\n space: Space,\n status: SpaceStatus,\n colorStatusMap: HashMap) => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n return (\n {\n id,\n styles: {\n fill: colorStatusMap[`space-${status}`] || '#000',\n opacity: 0.99\n }\n });\n};\n\n/**\n * Generates actions for mapview handling.\n * @param space - the space to generate\n * @param clickSpace - called when clicked or touched\n * @param hoverSpace - called when you hover over a space\n * @param leaveSpace - called when you leave a space.\n */\nexport const generateMapListenersForSpace = (\n space: Space,\n hoverSpace: () => void,\n leaveSpace: () => void,\n clickSpace: () => void\n): MapListener[] => {\n const id =\n `${space.map_id}`.indexOf('area') < 0\n ? `area-${space.map_id}-status`\n : space.map_id;\n const listeners: MapListener[] = [];\n listeners.push({\n id,\n event: 'mouseenter',\n callback: hoverSpace\n });\n listeners.push({\n id,\n event: 'mouseleave',\n callback: leaveSpace\n });\n if (space.bookable) {\n listeners.push({\n id,\n event: 'click',\n callback: clickSpace\n });\n listeners.push({\n id,\n event: 'touchend',\n callback: clickSpace\n });\n }\n return listeners;\n};\n\n\nexport const spaceToMapFeature = (space: Space): MapFeature => ({\n id: `area-${space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...space\n }\n});\n\nexport const roomToMapFeature = (room: RoomResultsViewModel, parentComponent?: any, status?: string): MapFeature => ({\n id: `area-${room.space.map_id}-status`,\n coordinates: null,\n content: MapOverlayComponent,\n data: {\n ...room.space,\n parentComponent,\n room,\n status:status\n }\n});","import {\n Component,\n Inject,\n ViewEncapsulation\n} from '@angular/core';\nimport { HashMap } from '@mckinsey-converge/base';\nimport { \n BookingRuleDetails,\n Building,\n} from '@mckinsey-converge/data-common';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n defaultMapBookingRules,\n defaultMapBookingSubtitle\n} from 'src/app/map/map.utils';\n\n@Component({\n selector: 'app-office-information-modal',\n template: `\n \n
\n
Booking in {{building?.name}}
\n
{{targetLinks(info)}}
\n
\n
\n
    \n \n
\n
\n
\n {{group.title}}\n
    \n \n
\n
\n
\n When booking from maps:\n
    \n \n
\n \n

\n For more info email: {{contact}}\n

\n

\n
\n
\n
\n \n
\n
\n `,\n styleUrls: ['./office-information-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OfficeInformationModalComponent {\n constructor(@Inject(MAT_DIALOG_DATA) public building: Building,\n private dialogRef: MatDialogRef) {\n }\n\n\n /** Booking rule details */\n public get rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.rules || [] as any;\n }\n\n /** Booking rule details */\n public get info(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.info || defaultMapBookingSubtitle;\n }\n\n public get customHtml(): string | undefined {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.custom_html;\n }\n\n /** Booking map rule details */\n public get map_rules(): string[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.map_rules || defaultMapBookingRules as any;\n }\n\n /** Other special booking rules */\n public get other_rules(): { title: string, rules: string[] }[] {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n const rules: HashMap = (details as any)?.other_rules || {};\n return Object.keys(rules).reduce((a, v) => {\n \n a.push({ title: v, rules: rules[v] || [] });\n return a;\n }, []);\n }\n\n public get contact(): string {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.contact || '';\n }\n\n public get link(): { url?: string, name?: string } {\n const building: Building = this.building;\n const details: BookingRuleDetails = building?.booking_details;\n return details?.link || {};\n }\n\n public closeModal() {\n this.dialogRef.close();\n }\n\n public targetLinks(info: string) {\n const regex = /[] = [\n BaseDirective,\n LoginComponent,\n TopbarHeaderComponent,\n ResponsiveInlineImagesComponent,\n OverlayMenuComponent,\n FooterMenuComponent,\n MapControlsComponent\n];\n\nconst MATERIAL_MODULES: any[] = [\n MatButtonModule,\n MatSnackBarModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatProgressBarModule,\n MatAutocompleteModule,\n MatSelectModule,\n MatChipsModule,\n MatRippleModule,\n MatMenuModule,\n MatCheckboxModule,\n MatTooltipModule,\n MatRadioModule,\n MatTabsModule,\n MatSlideToggleModule\n];\n\nconst CDK_MODULES: any[] = [\n ScrollingModule,\n DragDropModule,\n CdkTableModule\n];\n\n\n@NgModule({\n declarations: [\n ...COMPONENTS\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n RouterModule,\n EditorModule,\n ComposerModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n IvyCarouselModule,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ],\n exports: [\n APipesModule,\n AInteractiveMapModule,\n ACustomEventsModule,\n LegacyUiModule,\n LegacyOverlaysModule,\n ...COMPONENTS,\n ...MATERIAL_MODULES,\n ...CDK_MODULES\n ]\n})\nexport class SharedContentModule {\n}\n","import { Component, OnInit } from '@angular/core';\nimport { filter, first, map, distinctUntilChanged, shareReplay } from 'rxjs/operators';\nimport {\n ApplicationLoadingState,\n BaseDirective,\n closestToTimeSlot,\n closestToTimeSlotTz,\n LoadingState,\n} from '@mckinsey-converge/base';\nimport {\n ApplicationIcon,\n ApplicationService,\n Building,\n BuildingCity,\n defaultRoomSizeOption,\n DEFAULT_BOOKING_DURATION,\n flattenDisplayOffices,\n internalBookingTypeOption,\n mapBuildingToSelectOption,\n mapCityToAllSelectOption,\n mapResultsToViewModels,\n OrganisationService,\n SpacesService,\n storeBookingFormData,\n availabilityOptionsToQuery,\n bookingTypeOptions,\n selectFilteredDiffSizeResults,\n flattenBuildingsWithLevels,\n clearRoomFilters,\n allBookingTypeOption,\n roomSizeOptions,\n roomSizeOptionsKiosk,\n} from '@mckinsey-converge/data-common';\nimport { BehaviorSubject, combineLatest, Observable } from 'rxjs';\nimport { select, Store } from '@ngrx/store';\nimport { loadUser, selectHasUserData, UserStoreState } from '@mckinsey-converge/user';\nimport { ComposerService } from '@placeos/composer';\nimport { ActivatedRoute, Router, NavigationStart, Event as NavigationEvent } from '@angular/router';\n\nimport {\n DateNow,\n DateTZ,\n convertLocalTimestampToTimezonedDateTz,\n} from '@mckinsey-converge/date-tz';\nimport { DateTime } from 'luxon';\nimport { SelectOption } from '@mckinsey-converge/ui';\nimport { selectCurrentUser } from '@mckinsey-converge/user';\nimport {\n buildingStateSelector,\n loadBuildings,\n selectBuildingOptionsGroupedByCity,\n} from '@mckinsey-converge/buildings';\nimport { loadDiffSizeResults, loadRoomsForResults, loadRoomsForResultsMap } from '@mckinsey-converge/rooms';\nimport { timeStamp } from 'console';\nimport { filterUndefined } from '@mckinsey-converge/rx-utils';\n\n@Component({\n selector: 'app-shell-wrapper',\n templateUrl: './shell.component.html',\n styleUrls: ['./shell.component.scss'],\n})\nexport class ShellWrapperComponent extends BaseDirective implements OnInit {\n /** Loading state of the application */\n public loading_state: ApplicationLoadingState;\n /** Logo of the application organisation */\n public logo: ApplicationIcon;\n\n private userLoading = new BehaviorSubject(true);\n public isQRCode = new BehaviorSubject(true);\n public buildingOptions = new BehaviorSubject[]>([]);\n public zone_id: any;\n public floor: any;\n\n constructor(\n private _service: ApplicationService,\n private placeOs: ComposerService,\n private _org: OrganisationService,\n private activatedRoute: ActivatedRoute,\n private _spaces: SpacesService,\n private router: Router,\n private store: Store\n ) {\n super();\n\n // Initialize roomID\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n // roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n\n // Initialize zoneID\n let zone_id = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('zone_id')) {\n zone_id = this.activatedRoute.snapshot.queryParamMap.get('zone_id');\n } else if (\n localStorage.oauth_redirect &&\n localStorage.oauth_redirect.includes('?zone_id=')\n ) {\n zone_id = localStorage.oauth_redirect.split('=')[1];\n if (zone_id.includes('&')) {\n zone_id = zone_id.split('&')[0];\n }\n }\n\n this.zone_id = zone_id;\n\n // Initialize floor number\n let floor = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('floor')) {\n floor = this.activatedRoute.snapshot.queryParamMap.get('floor');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('&floor=')) {\n floor = localStorage.oauth_redirect.split('&floor=')[1];\n }\n this.floor = floor;\n (floor && zone_id) || roomId ? this.isQRCode.next(false) : this.isQRCode.next(true);\n }\n\n /** Whether the user needs to login */\n public get show_login(): Observable {\n return this.userLoading;\n }\n\n /** Whether a module is still loading data */\n public get is_loading(): Observable {\n return this.userLoading;\n }\n\n /** List of modules with a loading state */\n public get loading_state_list(): LoadingState[] {\n const list: LoadingState[] = [];\n for (const mod in this.loading_state) {\n if (this.loading_state[mod]) {\n list.push(this.loading_state[mod]);\n }\n }\n return list;\n }\n\n /**\n * Function: To check and fetch room details if available for the scanned roomId\n * @param buildings\n * @param roomId\n */\n public checkRoomId(buildings: Building[], roomId: string) {\n let formGroup = {\n location: [],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: true }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType: bookingTypeOptions[0],\n roomSize: defaultRoomSizeOption,\n selectedRoom: null,\n timezone: null,\n buildings: buildings,\n };\n\n const params = {\n room_ids: roomId,\n };\n\n const availibityParams = {\n room_ids: roomId,\n dateTz: closestToTimeSlotTz(new DateTZ({ date: Date.now(), is_local_tz: false }), 15),\n duration: DEFAULT_BOOKING_DURATION,\n hide_declined: true,\n };\n const query = availabilityOptionsToQuery(availibityParams);\n this._spaces.queryRooms(query).subscribe(\n (res) => {\n //Convert raw data into API object\n const list = res.map((i) => this._spaces.process(i));\n this._spaces.setSpaceList(list);\n /**\n * Building form data to resue to navigate to result page if room is not available!\n */\n const bookingRoom = mapResultsToViewModels(\n list,\n list[0].building.levels,\n buildings\n );\n const city = list[0].building.city;\n const timezone = list[0].timezone;\n const grouped_by_city = {\n key: { name: city, timezone },\n value: buildings?.filter((bld) => bld.city === city) || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [mapCityToAllSelectOption(grouped_by_city.key), ...city_buildings];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === list[0].building.id\n )[0];\n const buildingTimezone = list[0].timezone;\n // form group data\n formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(DateTime.now(), 15).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({ date: Date.now(), is_local_tz: false }),\n 15\n ).toZone(buildingTimezone),\n duration: DEFAULT_BOOKING_DURATION,\n bookingType:\n list[0].internal_or_external === 'internal'\n ? bookingTypeOptions[0]\n : bookingTypeOptions[1],\n roomSize: defaultRoomSizeOption,\n selectedRoom: bookingRoom[0],\n timezone: buildingTimezone,\n buildings: buildings,\n };\n\n this.store.dispatch(\n storeBookingFormData({\n payload: formGroup,\n })\n );\n this.router.navigate([`../home/results/room`], {\n state: { payload: { ...formGroup, offset: 0 } },\n });\n localStorage.oauth_redirect = localStorage.oauth_redirect.split('?')[0];\n this.isQRCode.next(true);\n },\n (error) => {\n // console.log(error);\n this.isQRCode.next(true);\n // this.router.navigate([`home/`]); // to navigate to default route if room dont exists\n /**\n * Navigate to room result page if no room/id exist in the db/ removed from the db in future -\n */\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n this.router.navigate([`../home/results`], {\n state: { payload: { ...formGroup, offset: 0 } },\n queryParams: { display: 'list' },\n });\n }\n );\n }\n\n public ngOnInit(): void {\n // when qr code lands on a url for the second time, reload it (to compensate for different browser/device combination default behaviors)\n this.subscription(\n 'navigationEventShell',\n this.router.events\n .pipe(filter((event) => event instanceof NavigationStart))\n .subscribe((event: NavigationEvent) => {\n if (event instanceof NavigationStart) {\n if (\n event.navigationTrigger === 'popstate' &&\n (event.url.includes('home?zone_id=') || event.url.includes('home?id='))\n ) {\n this.userLoading.next(true);\n window.location.reload();\n }\n }\n })\n );\n\n let roomId = null;\n if (this.activatedRoute.snapshot.queryParamMap.get('id')) {\n roomId = this.activatedRoute.snapshot.queryParamMap.get('id');\n } else if (localStorage.oauth_redirect && localStorage.oauth_redirect.includes('?id=')) {\n roomId = localStorage.oauth_redirect.split('=')[1];\n }\n\n if (roomId) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n this.checkRoomId(bld_list, roomId);\n })\n );\n }\n\n if (this.zone_id && this.floor) {\n this.subscription(\n 'buildings',\n this._org\n .listen('buildings')\n .pipe(first((_) => !!_ && !!_.length))\n .subscribe((bld_list: Building[]) => {\n const building = bld_list.filter((el) => el.id === this.zone_id);\n\n const city = building[0].city;\n const timezone = building[0].timezone;\n\n const grouped_by_city = {\n key: { name: city, timezone },\n value: building || [],\n };\n const city_buildings = grouped_by_city.value.map((bld) =>\n mapBuildingToSelectOption(grouped_by_city.key.name, bld)\n );\n const options = [\n mapCityToAllSelectOption(grouped_by_city.key),\n ...city_buildings,\n ];\n\n const seledtedZone: SelectOption = options.filter(\n (e) => e.value === building[0].id\n )[0];\n const buildingTimezone = building[0].timezone;\n // form group data\n const addMin = DateTime.now().get('minute') % 5 === 0 ? 1 : 0;\n const formGroup = {\n location: [seledtedZone],\n date: closestToTimeSlot(\n DateTime.now().plus({ minutes: addMin }),\n 15\n ).valueOf(),\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n bookingType: allBookingTypeOption, // all rooms (including internal and external both)\n roomSize: roomSizeOptionsKiosk[3],\n selectedRoom: null,\n timezone: buildingTimezone,\n buildings: bld_list,\n };\n\n const query2 = {\n // capacity: 3,\n locations: this.zone_id,\n // capacity_max: 9,\n // diff_capacity: true,\n hide_declined: true,\n dateTz: closestToTimeSlotTz(\n new DateTZ({\n date: DateTime.now().plus({ minutes: addMin }),\n is_local_tz: false,\n building_tz: buildingTimezone,\n }),\n 15\n ),\n duration: 35,\n };\n\n //clear search filters first if any applied previously\n this.store.dispatch(clearRoomFilters());\n\n this.store.dispatch(loadRoomsForResults.clear());\n this.store.dispatch(storeBookingFormData({ payload: formGroup }));\n\n this.store.dispatch(loadRoomsForResults.request(query2));\n localStorage.oauth_redirect = '';\n // To do: navigate to floor-map route\n this.router.navigate([`../home/results`], {\n state: {\n payload: this.floor,\n building: building,\n floorMap: true,\n url: window.location.href,\n },\n queryParams: { display: '' },\n });\n this.isQRCode.next(true);\n })\n );\n }\n\n this.subscription(\n 'loading',\n this._service.listen('loading').subscribe((loading) => {\n this.loading_state = loading;\n })\n );\n\n this._service.initialised.pipe(first((_) => _)).subscribe(() => {\n this.logo = this._service.setting('app.logo_light') || { type: 'icon' };\n });\n\n /**\n * Load current user into redux. this is meant to remove old way of loading user from user's service.\n */\n this.subscription(\n 'currentUser',\n combineLatest([\n this.store.pipe(select(selectHasUserData)),\n this.placeOs.initialised,\n this.isQRCode, // added to track room details if QR code used to open app\n ])\n .pipe(\n filter(([_, initialized, isQRCodeScanedAndReady]) => {\n console.log(_);\n return initialized && isQRCodeScanedAndReady;\n })\n )\n .subscribe(([next]) => {\n this.userLoading.next(!next);\n if (!next) {\n this.store.dispatch(loadUser.request());\n }\n })\n );\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
Converge is loading
\n
\n
\n
\n","export enum Urls {\n LearnMore = 'https://our-firm.intranet.mckinsey.com/covid-portal/travel',\n Feedback = 'mailto:converge_feedback@mckinsey.com?subject=Feedback for page: ',\n Help = 'https://mckinsey.service-now.com/ghd?id=topic_simple&topic_id=54e8eb091bea3d1831b17449cd4bcbed',\n OfficeContacts = 'https://our-firm.intranet.mckinsey.com/ourfirm/geographies',\n}\n\nexport const generateFeedbackUrl = (page: string) => {\n return `${Urls.Feedback}${page}`;\n};\n","import { EnvironmentData } from '@mckinsey-converge/environment';\n\nexport const environment: EnvironmentData = {\n production: true,\n hmr: false,\n heap_io_id: 91016686,\n};\n","import { SettingsData } from '@mckinsey-converge/data-common';\n\n;\n/**\n * GENERAL APPLICATION SETTINGS\n */\nconst general = {\n menu: {\n items: [],\n copyright: 'McKinsey & Company',\n position: 'left'\n }\n};\n\n/**\n * HOME PAGE SETTINGS\n */\nconst home = {\n background: 'assets/img/skyline.jpg',\n tiles: [\n {\n name: 'Book',\n route: '/book/spaces',\n icon: {\n type: 'icon',\n class: 'custom-book'\n }\n },\n {\n name: 'Maps',\n route: '/explore/space',\n icon: {\n type: 'icon',\n class: 'custom-spaces'\n }\n },\n {\n name: 'My Day',\n route: '/schedule',\n icon: {\n type: 'icon',\n class: 'custom-schedule'\n }\n }\n ]\n};\n/**\n * HELP/SUPPORT SETTINGS\n */\nconst help = {\n tiles: [],\n columns: 2\n};\n/**\n * BOOKING FLOW SETTINGS\n */\nconst booking = {\n booking_types: [\n { name: 'Internal', id: 'internal' },\n { name: 'External', id: 'external' },\n ],\n show_fields: [\n 'attendees',\n 'body',\n 'catering',\n 'dateTz',\n 'duration',\n 'organiser',\n 'title',\n 'type',\n 'all_day',\n 'needs_space',\n 'has_catering'\n ],\n html_body: false,\n multiple_spaces: true,\n desk_start: 9\n};\n/*===========================*\\\n|| SPACE LISTING SETTINGS ||\n\\*===========================*/\nconst space_display = {\n show_images: false\n};\n/*===========================*\\\n|| USER DIRECTORY SETTINGS ||\n\\*===========================*/\nconst directory = {\n show_avatars: true,\n min_search_length: 3\n};\n/*===========================*\\\n|| EXPLORE MAP SETTINGS ||\n\\*===========================*/\nconst explore = {\n colors: {\n 'space-available': '#43a047',\n 'space-requestable': '#ffb300',\n 'space-unavailable': '#e53935',\n 'space-in-use': '#d4483e',\n 'space-not-bookable': '#ccc',\n 'desk-available': '#43a047',\n 'desk-available-stroke': '#1b5e20',\n 'desk-unavailable': '#e53935',\n 'desk-unavailable-stroke': '#b71c1c',\n 'desk-reserved': '#ffb300',\n 'desk-reserved-stroke': '#ff6f00',\n 'desk-not-bookable': '#fff',\n 'desk-not-bookable-stroke': '#ccc',\n 'zone-low': '#43a047',\n 'zone-medium': '#ffb300',\n 'zone-high': '#e53935'\n },\n can_select_building: true,\n show_legend_group_names: false,\n show_timeline: true,\n legend: {\n General: [\n { key: 'space-available', name: 'Available' },\n { key: 'space-requestable', name: 'Available by request' },\n { key: 'space-unavailable', name: 'In use' },\n { key: 'space-not-bookable', name: 'Not Bookable' }\n ]\n }\n};\n\n/*=========================*\\\n|| DAY VIEW SETTINGS ||\n\\*=========================*/\nconst day_view = {\n dragdrop: false,\n};\n\n\n/**\n * ROOT APPLICATION SETTINGS\n */\nconst app = {\n title: 'McKinsey & Company',\n description: 'McKinsey & Company Staff UI written with Angular Framework',\n short_name: 'STAFF',\n logo_light: {\n type: 'img',\n src: 'assets/img/logo.svg',\n background: ''\n },\n logo_dark: {\n type: 'img',\n src: 'assets/img/logo-inverse.svg',\n background: ''\n },\n heap_io: {\n app_id: 3540602199,\n force_ssl: true,\n secure_cookie: true,\n disable_text_capture: true,\n cookie_path: '/staff/'\n },\n general,\n home,\n help,\n booking,\n space_display,\n directory,\n explore,\n day_view\n}\n\n\n/**\n * ROOT SETTIGNS\n */\nexport const DEFAULT_SETTINGS: SettingsData = {\n debug: true,\n composer: {\n domain: '',\n route: '/staff',\n protocol: '',\n port: '',\n use_domain: false,\n local_login: false\n },\n app,\n mock: false,\n frontend: 'staff',\n};\n","import { ApplicationRef, NgModuleRef } from '@angular/core';\nimport { createNewHosts } from '@angularclass/hmr';\n\nexport const hmrBootstrap = (\n module: any,\n bootstrap: () => Promise>,\n) => {\n let ngModule: NgModuleRef;\n module.hot.accept();\n bootstrap().then(mod => (ngModule = mod));\n module.hot.dispose(() => {\n const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef);\n const elements = appRef.components.map(c => c.location.nativeElement);\n const makeVisible = createNewHosts(elements);\n ngModule.destroy();\n makeVisible();\n });\n};\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\nimport { environment } from './environments/environment';\nimport { hmrBootstrap } from './hmr';\nimport { AppModule } from './app/app.module';\n\nif (environment.production) {\n enableProdMode();\n}\n\nconst bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);\n\n// comes from https://medium.com/wizardnet972/hot-module-replacement-with-angular-cli-5fc7a3ae4a9c\nif (environment.hmr) {\n if ((module as any).hot) {\n hmrBootstrap(module, bootstrap);\n } else {\n console.error('HMR is not enabled for webpack-dev-server!');\n console.log('Are you using the --hmr flag for ng serve?');\n }\n} else {\n bootstrap().catch(err => console.log(err));\n}\n"]} \ No newline at end of file
\n \n
\n \n
\n Booking Details\n Confirmed!\n Requested!\n
\n
Please await confirmation of room
\n
\n
\n \n
{{ title || 'No title' }}
\n
\n
\n \n
{{ when }}
\n
\n
\n \n
{{ recurrence }}
\n 0\"\n (click)=\"openConflictsModal()\"\n >\n Conflicts\n
\n \n
\n \n
{{ duration }}
\n
\n
\n Locations({{ spaces.length || '0' }})*:\n
\n
\n
\n
{{ item?.local_name }}
\n \n Notes\n
\n \n Code\n
\n
\n
No Locations
\n
\n 1\"\n (click)=\"toggleList('locations')\"\n >\n {{ show_locations ? 'Hide' : 'Show more' }} Locations\n \n \n \n
\n \n
{{ organiser?.name || organiser?.email }}
\n
\n
\n \n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n \n
\n \n
\n Booking Details\n Confirmed!\n Requested!\n
\n
Please await confirmation of room
\n
\n
\n \n
{{ title || 'No title' }}
\n
\n
\n \n
{{ when }}
\n
\n
\n \n
{{ recurrence }}
\n 0\"\n (click)=\"openConflictsModal()\"\n >\n Conflicts\n
\n \n
\n \n
{{ duration }}
\n
\n
\n Locations({{ spaces.length || '0' }})*:\n
\n
\n
\n
{{ item?.local_name }}
\n \n Notes\n
\n \n Code\n
\n
\n
No Locations
\n
\n 1\"\n (click)=\"toggleList('locations')\"\n >\n {{ show_locations ? 'Hide' : 'Show more' }} Locations\n \n \n \n
\n \n
{{ organiser?.name || organiser?.email }}
\n
\n
\n \n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n
\n \n
\n \n
\n Booking Details\n Confirmed!\n Requested!\n
\n
Please await confirmation of room
\n
\n
\n \n
{{ title || 'No title' }}
\n
\n
\n \n
{{ when }}
\n
\n
\n \n
{{ recurrence }}
\n 0\"\n (click)=\"openConflictsModal()\"\n >\n Conflicts\n
\n \n
\n \n
{{ duration }}
\n
\n
\n Locations({{ spaces.length || '0' }})*:\n
\n
\n
\n
{{ item?.local_name }}
\n \n Notes\n
\n \n Code\n
\n
\n
No Locations
\n
\n 1\"\n (click)=\"toggleList('locations')\"\n >\n {{ show_locations ? 'Hide' : 'Show more' }} Locations\n \n \n \n
\n \n
{{ organiser?.name || organiser?.email }}
\n
\n
\n \n
\n {{ bookingDetails.bookedBy.value }}\n
\n
\n