{"version":3,"sources":["apps/flex/src/environments/environment.prod.ts","libs/shared/src/lib/utils/resetZoom.ts","libs/shared/src/lib/components/fullscreen/fullscreen.component.ts","libs/shared/src/lib/components/fullscreen/fullscreen.component.html","libs/shared/src/lib/directives/container-resize.directive.ts","node_modules/date-fns/addMonths.js","node_modules/date-fns/isWeekend.js","node_modules/date-fns/addMilliseconds.js","node_modules/date-fns/addSeconds.js","node_modules/date-fns/isSameDay.js","node_modules/date-fns/differenceInDays.js","node_modules/date-fns/getHours.js","node_modules/date-fns/startOfSecond.js","node_modules/date-fns/isSameYear.js","node_modules/date-fns/setHours.js","node_modules/date-fns/subMonths.js","libs/shared/src/lib/directives/directives.module.ts","libs/shared/src/lib/components/fullscreen/fullscreen.module.ts","node_modules/dompurify/dist/purify.es.mjs","libs/shared/src/lib/map/symbols.ts","libs/shared/src/lib/map/map.service.ts","libs/shared/src/lib/map/map.component.ts","libs/shared/src/lib/map/map.component.html","libs/shared/src/lib/map/map.module.ts","apps/flex/src/app/shared/booking/booking.model.ts","libs/shared/src/lib/crypto/hmac.ts","apps/flex/src/app/shared/parking/parking-cache.service.ts","apps/flex/src/app/shared/booking/booking.service.ts"],"sourcesContent":["import { getEnv } from '@logic-suite/shared/utils/getEnv';\n\nexport const environment = {\n production: true,\n auth: {\n clientId: 'flexClient',\n tenantId: 'Flex',\n get issuer() {\n const env = getEnv('env');\n const s = env === 'production' || env === 'prod' ? '' : `${env}.`;\n return `https://${s}auth.noova.no/realms/`;\n },\n redirectUri: '/callback',\n },\n get errorLevel() {\n return getEnv('env') === 'dev' ? 'warn' : 'none';\n },\n customLogin: true,\n showHoodColors: getEnv('env') !== 'prod',\n};\n","export function resetZoom() {\n // Hack to reset pinch zoom\n const viewport = document.querySelector('meta[name=\"viewport\"]');\n if (viewport) {\n viewport.setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0');\n setTimeout(() => {\n viewport.setAttribute(\n 'content',\n 'width=device-width, height=device-height, initial-scale=1.0, viewport-fit=cover',\n );\n }, 100);\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n Output,\n signal,\n} from '@angular/core';\nimport { resetZoom } from '@logic-suite/shared/utils/resetZoom';\nimport { FullscreenCanvas, Viewport } from '../../map';\n\nexport enum ViewState {\n FULLSCREEN,\n NORMAL,\n}\n@Component({\n selector: 'lib-fullscreen',\n templateUrl: './fullscreen.component.html',\n styleUrls: ['./fullscreen.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class FullscreenComponent implements AfterViewInit {\n @HostBinding('class.fullscreen')\n get _isFullscreen() {\n return this.showFullscreen();\n }\n\n showFullscreen = signal(false);\n lastTouch?: number;\n lastToggled?: number;\n __created = performance.now();\n startPointers = 0;\n startPos = { x: 0, y: 0 };\n\n @Input() disableFullscreen = false;\n @Input() view?: FullscreenCanvas;\n @Output() viewPortChanged = new EventEmitter();\n @Output() stateChanged = new EventEmitter();\n\n constructor(public el: ElementRef) {}\n\n ngAfterViewInit() {\n this.stateChanged.emit(ViewState.NORMAL);\n this.onScroll({ target: this.el.nativeElement } as Event);\n }\n\n @HostListener('touchstart', ['$event'])\n onTouchStart(evt: TouchEvent) {\n // It's only a tap if it is with one finger. Check if 1 finger is down\n this.startPointers = evt.touches.length;\n this.startPos = { x: evt.touches[0].clientX, y: evt.touches[0].clientX };\n }\n\n @HostListener('touchend', ['$event'])\n onTouchEnd(evt: TouchEvent) {\n // It's only a tap if it is with one finger. Check if 0 fingers are down\n // and that the start position is nearly the same as the end position\n const deltaX = Math.abs(evt.touches[0].clientX - this.startPos.x);\n const deltaY = Math.abs(evt.touches[0].clientY - this.startPos.y);\n const hasMoved = deltaX > 10 || deltaY > 10;\n if (evt.touches.length === 0 && this.startPointers === 1 && !hasMoved) {\n // It's only a doubletap if last touch was less than 500ms ago\n if (this.lastTouch && performance.now() - this.lastTouch < 500) {\n this.lastTouch = undefined;\n return this.toggleFullscreen();\n } else {\n this.lastTouch = performance.now();\n }\n }\n }\n\n @HostListener('dblclick')\n dblClick() {\n if (performance.now() - this.__created > 500) {\n this.toggleFullscreen();\n }\n }\n\n toggleFullscreen() {\n if (this.disableFullscreen === true) return;\n\n if (!this.lastToggled || performance.now() - this.lastToggled > 500) {\n if (this.showFullscreen()) {\n this.closeFullscreen();\n } else {\n this.showFullscreen.set(true);\n this.stateChanged.emit(ViewState.FULLSCREEN);\n }\n this.lastToggled = performance.now();\n }\n }\n\n @HostListener('keydown.escape', ['$event'])\n closeFullscreen($event?: KeyboardEvent) {\n if (this.disableFullscreen === true || !this.showFullscreen()) return;\n if ($event) {\n $event.preventDefault();\n $event.stopPropagation();\n }\n resetZoom();\n\n // Reset the fullscreen state\n this.showFullscreen.set(false);\n this.stateChanged.emit(ViewState.NORMAL);\n }\n\n @HostListener('scroll', ['$event'])\n onScroll(evt: Event) {\n // Die quickly if noone is listening\n if (!this.viewPortChanged.observers.length) return;\n\n // Calculate the current scroll position of the viewport\n // so that we can update the rect on the minimaps accordingly\n const el = evt.target as HTMLElement;\n const atStart = el.scrollLeft == 0 && el.scrollTop == 0;\n const from = atStart\n ? { x: 0, y: 0 }\n : this.view?.toPoint(el.scrollLeft / this.view.zoom, el.scrollTop / this.view.zoom);\n const to = this.view?.toPoint(\n (el.scrollLeft + el.clientWidth) / this.view.zoom,\n (el.scrollTop + el.clientHeight) / this.view.zoom,\n );\n if (from && to) {\n const viewport = { x: from.x, y: from.y, width: to.x - from.x, height: to.y - from.y };\n this.viewPortChanged.emit(viewport);\n }\n }\n}\n","@if (showFullscreen()) {\n \n}\n\n
\n \n
\n","import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';\n\nlet observer: ResizeObserver;\n\nexport interface BreakpointConfig {\n [point: string]: number | string | BreakPoint;\n}\n\nexport interface PointValue {\n value: number;\n unit: string;\n}\nexport interface BreakPoint {\n minWidth?: number | string;\n maxWidth?: number | string;\n minHeight?: number | string;\n maxHeight?: number | string;\n minRatio?: number;\n maxRatio?: number;\n operator?: 'and' | 'or';\n}\n\nconst enum BreakPointType {\n SET_AND_REACHED = 1,\n SET_AND_NOT_REACHED = 2,\n NOT_SET = 3,\n}\n\nconst breakPointConfig: BreakpointConfig[] = [];\n// Default breakpoints that should apply to all observed\n// elements that don't define their own custom breakpoints.\nconst defaultBreakpoints: BreakpointConfig = { SM: 384, MD: 576, LG: 768, XL: 960 };\n\n// Only run if ResizeObserver is supported.\nif ('ResizeObserver' in self) {\n // Create a single ResizeObserver instance to handle all\n // container elements. The instance is created with a callback,\n // which is invoked as soon as an element is observed as well\n // as any time that element's size changes.\n observer = new ResizeObserver((entries: any) => {\n // We wrap it in requestAnimationFrame to avoid this error - ResizeObserver loop limit exceeded\n window.requestAnimationFrame(() =>\n entries.forEach((entry: any) => {\n // If breakpoints are defined on the observed element,\n // use them. Otherwise use the defaults.\n const breakpoints = breakPointConfig[+entry.target.dataset.breakpoint];\n if (!breakpoints) throw new Error('No breakpoints defined for this element, but observer still initialized!');\n\n // Update the matching breakpoints on the observed element.\n Object.keys(breakpoints).forEach((breakpoint) => {\n const point = breakpoints[breakpoint];\n if (typeof point === 'string' || typeof point === 'number') {\n toggleClass(entry.target, breakpoint, sizeGreaterThan(entry.target, entry.contentRect.width, point));\n } else if (typeof point === 'object') {\n // This is a more complex breakpoint.\n const currentState = {\n minHeight:\n 'minHeight' in point && point.minHeight != null\n ? sizeGreaterThan(entry.target, entry.contentRect.height, point.minHeight) === true\n ? BreakPointType.SET_AND_REACHED\n : BreakPointType.SET_AND_NOT_REACHED\n : BreakPointType.NOT_SET,\n minWidth:\n 'minWidth' in point && point.minWidth != null\n ? sizeGreaterThan(entry.target, entry.contentRect.width, point.minWidth) === true\n ? BreakPointType.SET_AND_REACHED\n : BreakPointType.SET_AND_NOT_REACHED\n : BreakPointType.NOT_SET,\n maxHeight:\n 'maxHeight' in point && point.maxHeight != null\n ? sizeLessThan(entry.target, entry.contentRect.height, point.maxHeight) === true\n ? BreakPointType.SET_AND_REACHED\n : BreakPointType.SET_AND_NOT_REACHED\n : BreakPointType.NOT_SET,\n maxWidth:\n 'maxWidth' in point && point.maxWidth != null\n ? sizeLessThan(entry.target, entry.contentRect.width, point.maxWidth) === true\n ? BreakPointType.SET_AND_REACHED\n : BreakPointType.SET_AND_NOT_REACHED\n : BreakPointType.NOT_SET,\n minRatio:\n 'minRatio' in point && point.minRatio != null\n ? getRatio(entry.target, entry.contentRect) >= point.minRatio\n ? BreakPointType.SET_AND_REACHED\n : BreakPointType.SET_AND_NOT_REACHED\n : BreakPointType.NOT_SET,\n maxRatio:\n 'maxRatio' in point && point.maxRatio != null\n ? getRatio(entry.target, entry.contentRect) < point.maxRatio\n ? BreakPointType.SET_AND_REACHED\n : BreakPointType.SET_AND_NOT_REACHED\n : BreakPointType.NOT_SET,\n };\n\n // Toggle the class based on the breakpoint type.\n const config = Object.entries(currentState)\n // Only include properties which are set\n .filter(([key, value]) => value !== BreakPointType.NOT_SET);\n const shouldSet =\n point.operator === 'or'\n ? // Some set properties in the breakpoint must be reached in order for the class to be added.\n config.some(([key, value]) => value === BreakPointType.SET_AND_REACHED)\n : // All set properties in the breakpoint must be reached in order for the class to be added.\n config.every(([key, value]) => value === BreakPointType.SET_AND_REACHED);\n toggleClass(entry.target, breakpoint, shouldSet);\n }\n });\n }),\n );\n });\n}\n\nfunction sizeGreaterThan(element: HTMLElement, elmSize: number, point: string | number) {\n const pointValues = getUnitValue(point);\n const minSize = convertToPixel(element, pointValues);\n return elmSize >= minSize;\n}\nfunction sizeLessThan(element: HTMLElement, elmSize: number, point: string | number) {\n const pointValues = getUnitValue(point);\n const maxSize = convertToPixel(element, pointValues);\n return elmSize < maxSize;\n}\nfunction getRatio(element: HTMLElement, contentRect: any) {\n const { width, height } = contentRect;\n return width / height;\n}\nfunction toggleClass(element: HTMLElement, className: string, flag: boolean) {\n const hasClass = element.classList.contains(className);\n if (!flag && !hasClass) return;\n\n return flag ? !hasClass && element.classList.add(className) : element.classList.remove(className);\n}\nfunction convertToPixel(element: HTMLElement, pointValue: PointValue) {\n // prettier-ignore\n switch (pointValue.unit) {\n case 'em': return pointValue.value * (getUnitValue(getComputedStyle(element).fontSize).value || 1);\n case 'rem': return pointValue.value * (getUnitValue(getComputedStyle(document.body).fontSize).value || 1);\n case 'px':\n default: return pointValue.value;\n }\n}\nfunction getUnitValue(point: string | number): PointValue {\n // eslint-disable-next-line no-useless-escape\n const pointValues = /([\\d\\.]+)(em|rem|px)*/.exec(`${point}`) || [];\n return { value: +pointValues[1], unit: pointValues[2] || 'px' };\n}\n\n@Directive({ selector: '[libContainerResize]', standalone: true })\nexport class ContainerResizeDirective implements OnInit, OnDestroy {\n @Input() libContainerResize: BreakpointConfig = defaultBreakpoints; // Breakpoints to set\n\n constructor(private el: ElementRef) {}\n\n ngOnInit() {\n if (!observer || !this.el) {\n return;\n }\n if (this.libContainerResize != null) {\n const index = breakPointConfig.push(this.libContainerResize);\n this.el.nativeElement.setAttribute('data-breakpoint', `${index - 1}`);\n observer.observe(this.el.nativeElement);\n }\n }\n\n ngOnDestroy() {\n observer?.unobserve(this.el.nativeElement);\n }\n}\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMonths} function options.\n */\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n * @param options - The options object\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link isWeekend} function options.\n */\n\n/**\n * @name isWeekend\n * @category Weekday Helpers\n * @summary Does the given date fall on a weekend?\n *\n * @description\n * Does the given date fall on a weekend? A weekend is either Saturday (`6`) or Sunday (`0`).\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date falls on a weekend\n *\n * @example\n * // Does 5 October 2014 fall on a weekend?\n * const result = isWeekend(new Date(2014, 9, 5))\n * //=> true\n */\nexport function isWeekend(date, options) {\n const day = toDate(date, options?.in).getDay();\n return day === 0 || day === 6;\n}\n\n// Fallback for modularized imports:\nexport default isWeekend;","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMilliseconds} function options.\n */\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n * @param options - The options object\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount, options) {\n return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;","import { addMilliseconds } from \"./addMilliseconds.js\";\n\n/**\n * The {@link addSeconds} function options.\n */\n\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be added.\n * @param options - An object with options\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport function addSeconds(date, amount, options) {\n return addMilliseconds(date, amount * 1000, options);\n}\n\n// Fallback for modularized imports:\nexport default addSeconds;","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link isSameDay} function options.\n */\n\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same day (and year and month)\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n *\n * @example\n * // Are 4 September and 4 October in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n *\n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\nexport function isSameDay(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(options?.in, laterDate, earlierDate);\n return +startOfDay(dateLeft_) === +startOfDay(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameDay;","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\n\n/**\n * The {@link differenceInDays} function options.\n */\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full days according to the local timezone\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n *\n * @example\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n * //=> 92\n */\nexport function differenceInDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const sign = compareLocalAsc(laterDate_, earlierDate_);\n const difference = Math.abs(differenceInCalendarDays(laterDate_, earlierDate_));\n laterDate_.setDate(laterDate_.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastDayNotFull = Number(compareLocalAsc(laterDate_, earlierDate_) === -sign);\n const result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(laterDate, earlierDate) {\n const diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();\n if (diff < 0) return -1;\n if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInDays;","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getHours} function options.\n */\n\n/**\n * @name getHours\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The hours\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * const result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\nexport function getHours(date, options) {\n return toDate(date, options?.in).getHours();\n}\n\n// Fallback for modularized imports:\nexport default getHours;","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfSecond} function options.\n */\n\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nexport function startOfSecond(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setMilliseconds(0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfSecond;","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameYear} function options.\n */\n\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same year\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\nexport function isSameYear(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return laterDate_.getFullYear() === earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default isSameYear;","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setHours} function options.\n */\n\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param hours - The hours of the new date\n * @param options - An object with options\n *\n * @returns The new date with the hours set\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nexport function setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setHours;","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The subMonths function options.\n */\n\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function subMonths(date, amount, options) {\n return addMonths(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subMonths;","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { AutofocusDirective } from './autofocus/autofocus.directive';\nimport { ContainerResizeDirective } from './container-resize.directive';\nimport { InlineSvgDirective } from './inline-svg.directive';\nimport { LongPressDirective } from './long-press.directive';\nimport { DelayedRouterLinkWithHrefDirective } from './router-link.directive';\n\n@NgModule({\n declarations: [InlineSvgDirective, DelayedRouterLinkWithHrefDirective, LongPressDirective],\n imports: [CommonModule, ContainerResizeDirective, AutofocusDirective],\n exports: [\n ContainerResizeDirective,\n AutofocusDirective,\n InlineSvgDirective,\n DelayedRouterLinkWithHrefDirective,\n LongPressDirective,\n ],\n})\nexport class DirectivesModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FullscreenComponent } from './fullscreen.component';\nimport { DirectivesModule } from '../../directives';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\n@NgModule({\n declarations: [FullscreenComponent],\n imports: [CommonModule, DirectivesModule, MatButtonModule, MatIconModule],\n exports: [FullscreenComponent],\n})\nexport class FullscreenModule {}\n","/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*}/gm); // eslint-disable-line unicorn/better-regex\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ARIA_ATTR: ARIA_ATTR,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n DATA_ATTR: DATA_ATTR,\n DOCTYPE_NAME: DOCTYPE_NAME,\n ERB_EXPR: ERB_EXPR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.2.3';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n };\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function _isNode(value) {\n return typeof Node === 'function' && value instanceof Node;\n };\n function _executeHooks(hooks, currentNode, data) {\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ;else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ;else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ;else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ;else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ;else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ;else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ;else if (value) {\n return false;\n } else ;\n return true;\n };\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const {\n attributes\n } = currentNode;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ;else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint) {\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\nexport { purify as default };\n","import { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\nexport function getSymbol(type: string, sec: DomSanitizer): IMapSymbol {\n const symbol = mapSymbols.find(s => s.id === type);\n const [minX, miny, width, height] = symbol?.viewbox.split(' ') ?? [];\n return Object.assign({ width, height, safeSymbol: sec.bypassSecurityTrustHtml(symbol?.symbol ?? '') }, symbol);\n}\nconst mapSymbols = [\n // ICONS -------------------------------------------\n {\n id: 'icon_stairs',\n title: 'stairs',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_phone',\n title: 'phone',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_kitchen',\n title: 'kitchen',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_lockers',\n title: 'lockers',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_wardrobe',\n title: 'wardrobe',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_toilet',\n title: 'toilet',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_handicap',\n title: 'handicap',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_shower',\n title: 'shower',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_elevator',\n title: 'elevator',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_m1',\n title: 'meeting room #1',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_m2',\n title: 'meeting room #2',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_m3',\n title: 'meeting room #3',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_m4',\n title: 'meeting room #4',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_m5',\n title: 'meeting room #5',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_m6',\n title: 'meeting room #6',\n type: 'icon',\n width: 20,\n height: 20,\n viewbox: '0 0 18 18',\n symbol: ``,\n },\n {\n id: 'icon_pediatrics',\n title: 'pediatrics',\n type: 'icon',\n width: 24,\n height: 24,\n viewbox: '0 0 24 24',\n symbol: ``,\n },\n {\n id: 'icon_bed',\n title: 'bed',\n type: 'icon',\n width: 24,\n height: 24,\n viewbox: '0 0 24 24',\n symbol: ``,\n },\n // RESOURCES ---------------------------------------\n {\n id: 'locker',\n title: 'locker',\n type: 'resource',\n width: 13,\n height: 13,\n viewbox: '0 0 13.7 13.7',\n symbol: ``,\n },\n {\n id: 'cabinet',\n title: 'cabinet',\n type: 'resource',\n width: 55,\n height: 17,\n viewbox: '0 0 55 17',\n symbol: ``,\n },\n {\n id: 'square',\n title: 'square',\n type: 'resource',\n width: 20,\n height: 20,\n viewbox: '0 0 20 20',\n symbol: ``,\n },\n {\n id: 'chair_back',\n title: 'chair back',\n type: 'resource',\n width: 19,\n height: 6,\n viewbox: '0 0 19 6',\n symbol: ``,\n },\n {\n id: 'sink',\n title: 'sink',\n width: 10,\n height: 15,\n type: 'resource',\n viewbox: '0 0 9.93 15.133',\n symbol: ``,\n },\n {\n id: 'sink_large',\n title: 'sink large',\n width: 16,\n height: 15,\n type: 'resource',\n viewbox: '0 0 15.93 15.34',\n symbol: ``,\n },\n {\n id: 'toilet',\n title: 'toilet',\n width: 17,\n height: 10,\n type: 'resource',\n viewbox: '0 0 16.29 10.22',\n symbol: ``,\n },\n {\n id: 'toilet_handicap',\n title: 'toilet handicap',\n width: 19,\n height: 16,\n type: 'resource',\n viewbox: '0 0 19 16',\n symbol: ``,\n },\n {\n id: 'chair',\n title: 'chair',\n width: 21,\n height: 16,\n type: 'resource',\n viewbox: '0 0 21.08 15.96',\n symbol: ``,\n },\n {\n id: 'round_table',\n title: 'round table',\n width: 20,\n height: 20,\n type: 'resource',\n viewbox: '0 0 20 20',\n symbol: ``,\n },\n {\n id: 'large_round_table',\n title: 'large round table',\n width: 30,\n height: 30,\n type: 'resource',\n viewbox: '0 0 30 30',\n symbol: ``,\n },\n {\n id: 'square_table',\n title: 'square table',\n width: 21,\n height: 19,\n type: 'resource',\n viewbox: '0 0 20.513 18.9759',\n symbol: ``,\n },\n {\n id: 'ball',\n title: 'ball',\n width: 19,\n height: 19,\n type: 'resource',\n viewbox: '0 0 18.968498 18.968401',\n symbol: ``,\n },\n {\n id: 'tv',\n title: 'tv',\n width: 36,\n height: 3,\n type: 'resource',\n viewbox: '0 0 35.46576 2.2881136',\n symbol: ``,\n },\n {\n id: 'small_sofa',\n title: 'small sofa',\n width: 18,\n height: 18,\n type: 'resource',\n viewbox: '0 0 17.673901 17.673901',\n symbol: ``,\n },\n {\n id: 'small_sofa_corner',\n title: 'small sofa corner',\n width: 18,\n height: 18,\n type: 'resource',\n viewbox: '0 0 17.6744 17.673901',\n symbol: ``,\n },\n {\n id: 'sofa',\n title: 'sofa',\n width: 41,\n height: 28,\n type: 'resource',\n viewbox: '0 0 40.849998 27.55006',\n symbol: ``,\n },\n {\n id: 'sofa2',\n title: 'sofa2',\n width: 30,\n height: 20,\n type: 'resource',\n viewbox: '0 0 30.16 20.35',\n symbol: ``,\n },\n {\n id: 'shelf',\n title: 'shelf',\n width: 45,\n height: 21,\n type: 'resource',\n viewbox: '0 0 44.510036 21',\n symbol: ``,\n },\n {\n id: 'workstation',\n title: 'workstation',\n width: 45,\n height: 29,\n type: 'resource',\n viewbox: '0 0 44.510036 28.57',\n symbol: ``,\n },\n {\n id: 'workstation_singleMonitor',\n title: 'workstation single monitor',\n width: 45,\n height: 29,\n type: 'resource',\n viewbox: '0 0 44.510036 28.57',\n symbol: ``,\n },\n {\n id: 'workstation_dualMonitor',\n title: 'workstation dual monitor',\n width: 45,\n height: 29,\n type: 'resource',\n viewbox: '0 0 44.510036 28.57',\n symbol: ``,\n },\n {\n id: 'double_workstation',\n title: 'double workstation',\n width: 51,\n height: 30,\n type: 'resource',\n viewbox: '0 0 50.52 29.799999',\n symbol: ``,\n },\n {\n id: 'small_meeting_table',\n title: 'small meeting table',\n width: 41,\n height: 40,\n type: 'resource',\n viewbox: '0 0 41.369999 39.439999',\n symbol: ``,\n },\n {\n id: 'small_round_meeting_table',\n title: 'small round meeting table',\n width: 42,\n height: 42,\n type: 'resource',\n viewbox: '0 0 41.981579 41.981566',\n symbol: ``,\n },\n {\n id: 'half_round_meeting_table',\n title: 'half round meeting table',\n width: 42,\n height: 23,\n type: 'resource',\n viewbox: '0 0 41.380284 22.78005',\n symbol: ``,\n },\n {\n id: 'trapezoid_meeting_table',\n title: 'trapezoid meeting table',\n width: 72,\n height: 47,\n type: 'resource',\n viewbox: '0 0 71.448975 46.579998',\n symbol: ``,\n },\n {\n id: 'meeting_table',\n title: 'meeting table',\n width: 59,\n height: 49,\n type: 'resource',\n viewbox: '0 0 59.380001 48.68',\n symbol: ``,\n },\n {\n id: 'large_meeting_table',\n title: 'large meeting table',\n width: 101,\n height: 51,\n type: 'resource',\n viewbox: '0 0 100.91004 51.419998',\n symbol: ``,\n },\n {\n id: 'largest_meeting_table',\n title: 'largest meeting table',\n width: 122,\n height: 50,\n type: 'resource',\n viewbox: '0 0 121.73 50.189999',\n symbol: ``,\n },\n {\n id: 'long_table',\n title: 'long table',\n width: 161,\n height: 63,\n type: 'resource',\n viewbox: '0 0 161.47 63.439999',\n symbol: ``,\n },\n {\n id: 'art_table',\n title: 'art table',\n width: 65,\n height: 41,\n type: 'resource',\n viewbox: '0 0 64.578621 41.35844',\n symbol: ``,\n },\n] as const;\nexport type MapSymbolIconTypes = Pick, 'id'>['id'];\nexport type MapSymbolResourceTypes = Pick, 'id'>['id'];\nexport type MapSymbolTypes = MapSymbolIconTypes | MapSymbolResourceTypes;\n\nexport interface IMapSymbol {\n id: MapSymbolTypes;\n viewbox: string;\n title: string;\n type: 'icon' | 'resource';\n width: number;\n height: number;\n symbol: string;\n safeSymbol?: SafeHtml;\n}\nexport const MapSymbol: Readonly = mapSymbols;\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { BehaviorSubject, Observable, map } from 'rxjs';\nimport { ThemeService } from '../theme';\nimport { SharedObservable, getEnv, retryOn504 } from '../utils';\nimport { MapConfig, MapDoorElement, MapLabelElement, MapResource, MapSymbolElement, MapZoneElement } from './map.model';\nimport { IMapSymbol, MapSymbol, getSymbol } from './symbols';\n\n// eslint-disable-next-line no-useless-escape\nexport const VIEWBOX_REGEX = /viewBox=[\"|']([0-9\\.\\s]+)[\"|']/gm;\n\nexport enum Limit {\n WARNING = 'warning',\n NOTGOOD = 'not-good',\n GOOD = 'good',\n\n WARMEST = 'warmest',\n WARM = 'warmer',\n COLD = 'cool',\n\n NA = 'notActive',\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MapService {\n theme = inject(ThemeService);\n\n private numberFormatter = new Intl.NumberFormat('nb-NO', {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n });\n debug$ = new BehaviorSubject('');\n\n symbols: IMapSymbol[] = []; // All the symbols used\n\n limits: { [key: string]: (val: number, variant?: boolean) => Limit } = {\n co2: (val: number): Limit => (val >= 1000 ? Limit.WARNING : val >= 800 ? Limit.NOTGOOD : Limit.GOOD),\n\n humidity: (val: number): Limit =>\n val >= 70\n ? Limit.WARNING\n : val >= 60\n ? Limit.NOTGOOD\n : val >= 30\n ? Limit.GOOD\n : val >= 25\n ? Limit.NOTGOOD\n : Limit.WARNING,\n\n tvoc: (val: number): Limit => (val >= 2000 ? Limit.WARNING : val >= 250 ? Limit.NOTGOOD : Limit.GOOD),\n\n temperature: (val: number, tempCol = true): Limit =>\n val >= 23\n ? tempCol\n ? Limit.WARMEST\n : Limit.WARNING\n : val >= 19\n ? tempCol\n ? Limit.WARM\n : Limit.GOOD\n : tempCol\n ? Limit.COLD\n : Limit.NOTGOOD,\n\n radon: (val: number): Limit => (val >= 150 ? Limit.WARNING : val >= 100 ? Limit.NOTGOOD : Limit.GOOD),\n\n pressure: (val: number): Limit => Limit.GOOD,\n // return val >= 150 ? Limit.WARNING\n // : val >= 100 ? Limit.NOTGOOD\n // : Limit.GOOD;\n\n light: (val: number): Limit => Limit.GOOD,\n // return val >= 150 ? Limit.WARNING\n // : val >= 100 ? Limit.NOTGOOD\n // : Limit.GOOD;\n };\n\n constructor(\n private http: HttpClient,\n // private customer: CustomerService,\n // private app: AppService,\n private sec: DomSanitizer,\n ) {\n this.symbols = MapSymbol.map(r => getSymbol(r.id, this.sec));\n }\n\n debug(msg: string) {\n // this.debug$.next(msg);\n // setTimeout(() => this.debug$.next(''), 1000);\n }\n\n flatMap(config: MapConfig, markResourceID: number) {\n return this.http.post(\n `/api/map/`,\n {\n mapConfig: config,\n markResourceID,\n showNeighborhoods: true,\n theme: this.theme.colorScheme,\n },\n { responseType: 'blob' },\n );\n }\n\n /**\n * This method must work on all systems.\n * - Logic-Suite requires us to have a customerID in the query, since a user can have access to multiple customers.\n * - Flex does not have a customerID since a user can only have access to one customer.\n * - Officemap has the customerID in the URL as a hashed token.\n *\n * @param mapID The mapID to load\n * @returns A MapConfig object\n */\n @SharedObservable()\n getConfig(url: string): Observable {\n return this.http\n .get(url.replace('//', '/'))\n .pipe(retryOn504())\n .pipe(\n map(config => {\n // Filter out null values\n config.resources = config.resources?.filter(r => r != null) ?? [];\n config.neighborhoods =\n config.neighborhoods\n ?.filter(n => n != null)\n .map(n => Object.assign(n, { vectors: n.vectors?.filter(v => v != null) ?? [] })) ?? [];\n config.meetingRooms =\n config.meetingRooms\n ?.filter(m => m != null)\n .map(m => Object.assign(m, { vectors: m.vectors?.filter(v => v != null) ?? [] })) ?? [];\n return config;\n }),\n );\n }\n\n getCoordinates(config: MapConfig) {\n VIEWBOX_REGEX.lastIndex = 0;\n const match = VIEWBOX_REGEX.exec(config.floorPlanSVG);\n if (match && match.length > 0) {\n // Derive coordinates from floorPlans viewBox\n return match[1];\n } else {\n // ... or set the coordinate system as defined by the floorPlan, or a default\n return config.coordinateSystem || '0 0 2000 500';\n }\n }\n\n private _getColor(key: Limit) {\n const color = getComputedStyle(document.body).getPropertyValue(`--${key}`).trim();\n return color.indexOf('rgb') > -1 ? this.rgbStrToHex(color) : color;\n }\n\n getColor(type: string, value: string) {\n return this._getColor(this.getLimit(type, value));\n }\n\n getLimit(type: string, value: string | undefined): Limit {\n if (value == null) return Limit.NA;\n\n const num = parseInt(this.numberFormatter.format(+value));\n return this.limits[type](num);\n }\n\n /**\n * Convert a `rgb(rrr, ggg, bbb)` string value to a hexadecimal color code.\n * Will also accept alpha.\n *\n * Because react-scripts turn hex with alpha to `rgba` at build time and I cannot find\n * any way to disable this behavior, and svg color-stops does not render `rgba`,\n * we need to convert it back at runtime.\n */\n private rgbStrToHex(rgb: string) {\n const [r, g, b, a] = rgb\n .trim()\n .substring(rgb.indexOf('(') + 1, rgb.indexOf(')'))\n .split(',')\n .map(n => +n);\n return this.rgbToHex(r, g, b, a);\n }\n\n /**\n * Convert red, green and blue values to a hexadecimal color code.\n * Will also accept alpha\n */\n private rgbToHex(r: number, g: number, b: number, a?: number): string {\n return (\n '#' +\n [r, g, b, a]\n .filter(x => x != null) // Remove null\n .map(x => x?.toString(16).padStart(2, '0') ?? x)\n .join('')\n );\n }\n\n configureMap(config: MapConfig) {\n return {\n coordinates: this.getCoordinates(config),\n useHoodColorsOnDesks: config.showNeighborhoodColors ? config.showNeighborhoodColors : getEnv('showHoodColors'),\n config,\n ...this.setResources(structuredClone(config.resources)),\n };\n }\n\n /**\n * Create all symbols\n */\n setResources(resources: MapResource[]) {\n if (!Array.isArray(resources)) resources = [];\n\n // Set resources\n return {\n resources: (resources.filter(r => !['zone', 'icon', 'door', 'label'].some(t => r.type?.startsWith(t))) ?? []).map(\n r => {\n const symbol = this.symbols.find(s => s.id === r.type);\n const resource = Object.assign(r, {\n width: symbol?.width ?? 2,\n height: symbol?.height ?? 2,\n layer: 'resources',\n transform: this.applyTransform(r),\n filter: this.getFilter(r),\n }) as MapSymbolElement;\n resource.style = `transform: ${r.transform}; transform-origin: ${r.width! / 2}px ${r.height! / 2}px;`;\n return resource;\n },\n ),\n\n // Set icons\n icons: (resources.filter(r => r.type?.startsWith('icon')) ?? []).map(r => {\n const symbol = this.symbols.find(s => s.id === r.type);\n const resource = Object.assign(r, {\n width: symbol?.width ?? 2,\n height: symbol?.height ?? 2,\n layer: 'icons',\n transform: this.applyTransform(r),\n }) as MapSymbolElement;\n resource.style = `transform: ${r.transform}; transform-origin: ${r.width! / 2}px ${r.height! / 2}px;`;\n return resource;\n }),\n\n // Set doors\n doors: (resources.filter(r => r.type?.startsWith('door')) ?? []).map(r => {\n return Object.assign(r, { layer: 'doors' }) as MapDoorElement;\n }),\n\n // Set zones\n zones: (resources.filter(r => r.type?.startsWith('zone')) ?? []).map(r => {\n return Object.assign(r, {\n layer: 'zones',\n transform: this.applyTransform(r),\n filter: this.getFilter(r),\n }) as MapZoneElement;\n }),\n\n labels: (resources.filter(r => r.type === 'label') ?? []).map(r => {\n return Object.assign(r, {\n layer: 'label',\n scale: r.scale || 1,\n rotate: r.rotate || 0,\n transform: this.applyTransform(r),\n }) as MapLabelElement;\n }),\n };\n }\n\n applyPosition(r: MapResource, offsetX = 0, offsetY = 0): string {\n const x = r.x + (r.width || 1) / 2;\n const y = r.y;\n return `transform: translate(${x + offsetX}px, ${y + offsetY}px`;\n }\n\n optimizeX(elX: number, el: HTMLElement, offset = 10, r: string) {\n const canvas = el.closest('svg') as SVGSVGElement;\n const [newX, newY] = this.optimizeTextPosition(r, canvas, elX, 0, offset, 0, 0);\n return newX;\n }\n\n optimizeY(elY: number, el: HTMLElement, offset = 10, r: string) {\n const canvas = el.closest('svg') as SVGSVGElement;\n const [newX, newY] = this.optimizeTextPosition(r, canvas, 0, elY, offset, 0, 0);\n return newY;\n }\n\n dimensionCache = new Map();\n getDimensions(str: string, canvas: SVGSVGElement) {\n if (!str) return new DOMRect(0, 0, 0, 0);\n if (this.dimensionCache.has(str.length)) return this.dimensionCache.get(str.length)!;\n // Create a dummy element for the text\n const text = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n text.innerHTML = str;\n canvas.appendChild(text);\n const result = text.getBBox();\n text.remove();\n\n this.dimensionCache.set(str.length, result);\n return result;\n }\n\n optimizeTextPosition(\n str: string, // The string to calculate\n canvas: SVGSVGElement, // The svg canvas to draw the string on\n x: number, // The center x position of the box to draw the text relative to\n y: number, // The center y position of the box to draw the text relative to\n boxHeight: number, // The height of the box to draw the text relative to\n boxWidth: number, // The width of the box to draw the text relative to\n offset = 0, // an offset to keep the text inside the canvas\n // yPos: 'above' | 'below' | 'center' = 'below',\n ): [number, number] {\n // Get the rendered text dimensions\n const textBox = this.getDimensions(str, canvas);\n // Get the dimensions of the svg canvas\n const canvasBox = this.getBBox(canvas);\n // Calculate the center of the box\n const boxCenterX = x + 5 + boxWidth / 2;\n const boxCenterY = y + 5 + boxHeight / 2;\n\n // Calculate the absolute center of the text relative to the box\n let newX = boxCenterX - textBox.width / 2;\n let newY = boxCenterY + textBox.height / 2;\n // let newY = boxCenterY - textBox.height / 2;\n\n // Check X position\n if (newX < offset) newX = offset; // To the right of box\n if (newX + textBox.width > canvasBox.width - offset) newX = canvasBox.width - offset - textBox.width; // Left\n\n // Check Y position\n if (newY + textBox.height > canvasBox.height - offset) newY = boxCenterY - 8 - textBox.height; // Above box\n\n // Return the new position\n return [Math.abs(newX), Math.abs(newY)];\n }\n\n getBBox(canvas: SVGSVGElement) {\n if (canvas.hasAttribute('viewBox')) {\n const [x, y, width, height] = (canvas.getAttribute('viewBox')?.split(' ') ?? ['0', '0', '0', '0']).map(v =>\n parseFloat(v),\n );\n return { x, y, width, height };\n }\n return canvas.getBBox();\n }\n\n applyTransform(r: MapResource, forceRotation?: number, el?: HTMLElement): string {\n const x = el && r.textX ? r.textX : r.x;\n const y = el && r.textY ? r.textY : r.y;\n\n const operations = [];\n operations.push(`translate(${x}px, ${y}px)`);\n if ('flip' in r) {\n const vFlip = (r.flip?.toLowerCase().indexOf('v') ?? -1) > -1;\n const hFlip = (r.flip?.toLowerCase().indexOf('h') ?? -1) > -1;\n if ((hFlip || vFlip) && forceRotation === undefined) {\n const s = r.scale || 1;\n operations.push(`scale(${hFlip ? `-${s}` : s}, ${vFlip ? `-${s}` : s})`);\n }\n } else if (r.scale && forceRotation === undefined) {\n operations.push(`scale(${r.scale})`);\n }\n if (!el && (r.rotate || forceRotation !== undefined)) {\n const rotation = forceRotation !== undefined ? forceRotation : r.rotate;\n if (rotation != null && rotation != 0) {\n operations.push(`rotate(${rotation}deg)`);\n }\n }\n const transforms = operations.join(' ');\n return transforms;\n }\n\n getFilter(r: MapResource) {\n return r.type?.startsWith('sink') || r.type?.startsWith('toilet') ? '' : 'url(#drop-shadow)';\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport DOMPurify from 'dompurify';\nimport { Observable, ReplaySubject, Subscription, firstValueFrom } from 'rxjs';\n\nimport { ViewState } from '../components/fullscreen';\nimport { Debouncer as Denounced, getAlphaValue, getEnv, logger, waitForElement } from '../utils';\nimport { resetZoom } from '../utils/resetZoom';\nimport { ScrollPosition, scrollIntoView } from '../utils/scrollIntoView';\nimport { abbreviate, underscore } from '../utils/stringUtils';\nimport {\n ColleagueBookings,\n FullscreenCanvas,\n MapConfig,\n MapDoorElement,\n MapLabelElement,\n MapResource,\n MapSymbolElement,\n MapZoneElement,\n Neighborhood,\n Point,\n ResourceCheckCallback,\n Viewport,\n ZoneSelection,\n} from './map.model';\nimport { MapService, VIEWBOX_REGEX } from './map.service';\nimport { IMapSymbol } from './symbols';\n\nconst debug = false;\n\n@Component({\n selector: 'lib-map',\n templateUrl: './map.component.html',\n styleUrls: ['./map.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class MapComponent implements OnChanges, AfterViewInit, OnDestroy, FullscreenCanvas {\n private map = inject(MapService);\n private sec = inject(DomSanitizer);\n public rootElement = inject(ElementRef);\n private snack = inject(MatSnackBar);\n private cdr = inject(ChangeDetectorRef);\n private ngZone = inject(NgZone);\n\n subscriptions: Subscription[] = [];\n\n @HostBinding('class.displayed') display = false;\n @HostBinding('class.fullscreen') showFullscreen = false;\n @HostBinding('class.resourceSelection') canSelectResource = true;\n @HostBinding('class.zoomed') isZoomed = false;\n\n /** This is true for maps which require user interaction. The map-search in booking dialog is a good example */\n @HostBinding('class.interactive') @Input() interactive = false;\n @HostBinding('class') @Input() type = '';\n\n @Input() isAvailable?: ResourceCheckCallback;\n @Input() isFavorite?: ResourceCheckCallback;\n @Input() viewport?: Viewport; // For thumbnail map\n @Input() viewStateChange?: Observable;\n\n visibleLayers = input(['zones', 'icons', 'resources', 'doors']);\n showZones = input(true, { transform: (v) => v === true });\n focusOn = input<'neighborhood' | 'all' | 'youAreHere'>('all');\n selectableTypes = input([\n 'workstation',\n 'workstation_singleMonitor',\n 'workstation_dualMonitor',\n 'double_workstation',\n ]);\n\n selectionMade = output();\n zoneSelectionMade = output();\n mapLoaded = output();\n mapRendered = output();\n\n rendered = false;\n private _zoom = 1;\n get zoom() {\n return this._zoom;\n }\n set zoom(n: number) {\n this._zoom = n;\n this.rootElement.nativeElement.setAttribute('style', `transform: scale(${this.zoom})`);\n }\n\n useHoodColorOnDesks = computed(() => {\n return this._internalConfig()?.showNeighborhoodColors != null\n ? this._internalConfig()!.showNeighborhoodColors\n : getEnv('showHoodColors');\n });\n // For marking where your spot is\n resourceID = input(undefined);\n // For marking colleague spot\n markResourceID = input(undefined);\n markResource = computed(() => this.resources().find((r) => r.resourceID === this.markResourceID()));\n markResourceName = input('', { transform: (v) => (v ? v : '') }); // Naming colleague spot\n\n colleagues = input([]);\n\n enableZoom = input(null, { transform: (v) => v === true });\n _zoomEnabled = computed(() => {\n return (\n this._internalConfig() != null &&\n this.resources().length > 0 &&\n (this.enableZoom() != null ? (this.enableZoom() as boolean) : this._internalConfig()!.enableZoom === true)\n );\n });\n\n mapLoaded$ = new ReplaySubject(1);\n\n // Process map configuration\n configUrl = input('/api/flex/Map');\n mapID = input(undefined);\n myZoneID = input(undefined);\n config = input(undefined);\n _internalConfig = signal(undefined);\n floorPlanSVG = computed(() => {\n if (this._internalConfig()?.floorPlanSVG == null) return undefined;\n const value = (this._internalConfig()?.floorPlanSVG ?? '').replace(VIEWBOX_REGEX, '');\n return this.sec.bypassSecurityTrustHtml(\n DOMPurify.sanitize(value, {\n USE_PROFILES: { svg: true, svgFilters: true },\n }),\n );\n });\n coordinates = computed(() =>\n this._internalConfig() == null ? '0 0 0 0' : this.map.getCoordinates(this._internalConfig()!),\n );\n // All the symbols used\n symbols = signal(this.map.symbols);\n // All icons\n resources = computed(() => {\n const config = this._internalConfig();\n const useHoodColorOnDesks = this.useHoodColorOnDesks();\n return config == null || this.coordinates() == '0 0 0 0'\n ? []\n : (\n config!.resources.filter((r) => !['zone', 'icon', 'door', 'label'].some((t) => r.type?.startsWith(t))) ?? []\n ).map((resource) => {\n const r = resource as MapSymbolElement;\n const symbol = this.map.symbols.find((s) => s.id === r.type);\n r.width = symbol?.width ?? 2;\n r.height = symbol?.height ?? 2;\n r.layer = 'resources';\n r.transform = this.map.applyTransform(r);\n r.style = `transform: ${r.transform}; transform-origin: ${r.width! / 2}px ${r.height! / 2}px;`;\n r.filter = this.type != 'minimap' ? this.map.getFilter(r) : '';\n r.available = this.type != 'minimap' && this._isAvailable(r);\n r.isFavorite = this.type != 'minimap' && this._isFavorite(r);\n if (useHoodColorOnDesks && r.zoneID) {\n const hood = this.neighborhoods().find((n) => n.zoneID === r.zoneID);\n if (hood) {\n r.hoodColor = hood.colorCode;\n r.style = `${r.style} ${`--hoodColor: ${r.hoodColor}; --hoodColorAlpha: ${hood.alpha}%;`}`;\n }\n }\n r.classList = Object.entries({\n [r.type]: true,\n // Seat available means that nobody is occupying it at the moment\n available:\n r.available !== false &&\n r.unavailable !== true &&\n !(this.selectableTypes().includes(r.type) && !r.resourceID),\n // Blocked seats cannot be booked\n blocked: r.unavailable === true || (this.selectableTypes().includes(r.type) && !r.resourceID),\n favorite: r.isFavorite,\n selected: r.selected,\n booked: r.state?.booked,\n partlyBooked: r.available === 'partly',\n occupied: r.state?.type === 'aggregated' && +(r.state?.value ?? 0) > 0,\n you: this.resourceID() != null && r.resourceID != null && r.resourceID === this.resourceID(),\n })\n .filter(([k, v]) => v == true)\n .map(([k, v]) => k);\n r.resourceID != null && r.classList.push('resourceID_' + r.resourceID);\n return r;\n });\n });\n selectableResources = computed(() => this.resources().filter((r) => r.resourceName != null));\n icons = computed(() =>\n this._internalConfig() == null || this.type == 'minimap'\n ? []\n : (this._internalConfig()!.resources.filter((r) => r.type?.startsWith('icon')) ?? []).map((r) => {\n const symbol = this.map.symbols.find((s) => s.id === r.type);\n const resource = Object.assign(r, {\n width: symbol?.width ?? 2,\n height: symbol?.height ?? 2,\n layer: 'icons',\n transform: this.map.applyTransform(r),\n }) as MapSymbolElement;\n resource.style = `transform: ${r.transform}; transform-origin: ${r.width! / 2}px ${r.height! / 2}px;`;\n return resource;\n }),\n );\n doors = computed(() =>\n this._internalConfig() == null || this.type == 'minimap'\n ? []\n : (this._internalConfig()!.resources.filter((r) => r.type?.startsWith('door')) ?? []).map((r) => {\n return Object.assign(r, { layer: 'doors' }) as MapDoorElement;\n }),\n );\n zones = computed(() =>\n this._internalConfig() == null || this.type == 'minimap'\n ? []\n : (this._internalConfig()!.resources.filter((r) => r.type?.startsWith('zone')) ?? []).map((r) => {\n return Object.assign(r, {\n layer: 'zones',\n transform: this.map.applyTransform(r),\n filter: this.map.getFilter(r),\n }) as MapZoneElement;\n }),\n );\n labels = computed(() =>\n this._internalConfig() == null\n ? []\n : (this._internalConfig()!.resources.filter((r) => r.type === 'label') ?? []).map((r) => {\n const label = Object.assign(r, { layer: 'label', transform: this.map.applyTransform(r) }) as MapLabelElement;\n label.style = `transform: ${r.transform}; transform-origin: 0px 0px;`;\n return label;\n }),\n );\n neighborhoods = computed(() =>\n this._internalConfig() == null || this.type == 'minimap'\n ? []\n : (this._internalConfig()!.neighborhoods || []).map((n) => {\n n.safeName = `_${underscore(n.name).replace('.', '')}`;\n n.alpha = (getAlphaValue(n.colorCode) / 255) * 100;\n n.d = this.getPathFromHood(n);\n return n;\n }),\n );\n\n hoverResource = signal(undefined);\n hoverColleague = signal(undefined);\n\n optimizeX = this.map.optimizeX;\n optimizeY = this.map.optimizeY;\n\n abbreviate = abbreviate;\n\n youAreHere = computed(() => {\n if (this.resourceID() != null) {\n let youAreHeareResource;\n if (Array.isArray(this.resourceID())) {\n youAreHeareResource = this.resources().find((r) =>\n (this.resourceID() as number[]).includes(r.resourceID || -1),\n );\n } else {\n youAreHeareResource = this.resources().find((r) => r.resourceID === this.resourceID());\n }\n if (youAreHeareResource)\n return Object.assign(youAreHeareResource, {\n selected: true,\n style2: this.map.applyPosition(youAreHeareResource, -11, 4),\n }) as MapSymbolElement;\n }\n return undefined;\n });\n selectedNeighborhood?: Neighborhood;\n\n canvas = viewChild>('canvas');\n private _canvasEl?: SVGSVGElement;\n get canvasEl(): SVGSVGElement {\n // If no canvas is set, try to set it\n if (!this._canvasEl) this._canvasEl = this.canvas()?.nativeElement.querySelector('svg') || undefined;\n // If no canvas was found, shortcut to parent svg temporarilly\n if (!this._canvasEl) return this.canvas()?.nativeElement.closest('svg') as SVGSVGElement;\n // Return the canvas\n return this._canvasEl as SVGSVGElement;\n }\n\n constructor() {\n effect(async () => {\n // Use provided map config, ...\n if (this.config()) this._internalConfig.set(structuredClone(this.config()) as MapConfig);\n // ... or load map config\n else if (this.configUrl() && this.mapID() != null) {\n try {\n this._internalConfig.set(\n structuredClone(await firstValueFrom(this.map.getConfig(`${this.configUrl()}/${this.mapID()}`))),\n );\n } catch (ex) {\n this.snack.open('Warning', 'Could not load map', { duration: 5000 });\n }\n }\n // Die if none are provided\n else return;\n // Exclude loading config from the performance measurement\n performance.mark('map-config-start');\n });\n effect(() => {\n // Check if we need to zoom into neighborhoods before desks can be selected\n if (this._internalConfig() != null && this.resources().length > 0) {\n if (this.interactive) {\n this.canSelectResource = !(this._zoomEnabled() === true);\n this.autoScroll();\n } else if (this.resourceID() != null || this.markResourceID() != null) {\n this.autoScroll();\n }\n if (!this.rendered) {\n this.rendered = true;\n this.mapLoaded.emit(this._internalConfig()!);\n this.mapLoaded$.next(this._internalConfig());\n waitForElement(`#elementID_${this.resources().at(-1)?.mapElementID}`).then((elm) => {\n // Emit this only when the last element is visible in the DOM\n logger(\n `Render: ${performance.measure('map-rendered', 'map-config-start').duration}`,\n 'MAP',\n debug,\n 'green',\n );\n this.resources().forEach((r) => {\n if (this.type != 'minimap') {\n this.optimizeTextPosition(r, r.resourceNameAlias || r.resourceName || '', 0);\n }\n });\n\n this.mapRendered.emit(true);\n });\n }\n }\n });\n effect(() => {\n if (this.colleagues().length && this.resources().length) {\n this.decorateColleagues(this.colleagues(), this.resources());\n this.markChanged();\n }\n });\n effect(() => {\n if (this.focusOn() === 'neighborhood' && this.myZoneID()?.length) {\n const hood = this.neighborhoods().find((h) => +h.zoneID === +this.myZoneID()![0]);\n if (hood) {\n const el = document.querySelector(`#${hood.safeName}`) as SVGElement;\n this.zoomTo(el);\n }\n }\n });\n }\n\n async ngOnChanges(change: SimpleChanges) {\n if (change.viewStateChange?.currentValue && this.viewStateChange != null) {\n this.subscriptions.push(\n this.viewStateChange.subscribe((state) => {\n if (\n state === ViewState.FULLSCREEN &&\n ['all', 'youAreHere'].includes(this.focusOn()) &&\n this.youAreHere() != null\n ) {\n this.autoScroll();\n }\n if (['all', 'neighborhood'].includes(this.focusOn()) && this.selectedNeighborhood != null) {\n const el = document.querySelector(`#${this.selectedNeighborhood.safeName}`) as SVGElement;\n this.zoomTo(el);\n }\n }),\n );\n }\n }\n\n private decorateColleagues(colleagues = this.colleagues(), resources = this.resources()) {\n colleagues\n .filter((c) => c.transform == null || (c.textX == null && c.textY == 0))\n .forEach(async (c) => {\n c.abbreviation = abbreviate(c.name);\n c.domain = this.fetchDomain(c.name);\n // Find resource this booking is for\n const resource = resources.find((r) => r.resourceID === c.resourceID);\n if (!resource) return;\n\n resource.isColleague =\n (this.markResourceID() != null && resource.resourceID === this.markResourceID()) ||\n (this.type === 'minimap' && this.isColleague(resource));\n if (resource.isColleague) {\n if (!resource.classList) resource.classList = [];\n resource.classList.push('colleague');\n }\n\n // Attach the colleague to this resource\n const transform = this.map.applyTransform(resource, 0);\n Object.assign(c, resource, {\n style: `transform: ${transform}; transform-origin: ${(resource.width || 2) / 2}px ${\n (resource.height || 2) / 2\n }px`,\n });\n if (this.type != 'minimap') {\n this.optimizeTextPosition(c, c.isGuest ? this.fetchDomain(c.name) : abbreviate(c.name), 10);\n }\n // Apply colleague image\n if (c.isGuest) c.imageUrl = c.thumbUrl = '/media/asset/guest.svg';\n else if (!c.imageUrl) c.imageUrl = c.thumbUrl = '/media/asset/person.png';\n else if (!c.thumbUrl && c.imageUrl != null) {\n const file = c.imageUrl.substring(0, c.imageUrl.lastIndexOf('.'));\n const ext = c.imageUrl.substring(c.imageUrl.lastIndexOf('.') + 1);\n c.thumbUrl = `${file}.thumbnail.${ext}`;\n }\n c.cx = (c.width || 2) / 2 + 0.5;\n c.cy = (c.height || 2) / 2 + 0.5;\n c.r = (c.width || 2) / 3 - 0.5;\n\n // Set hover box width\n const canvas = this.canvas()!.nativeElement.closest('svg') as SVGSVGElement;\n const colleagueBox = this.map.getDimensions(c.name, canvas);\n const resourceBox = this.map.getDimensions(resource.resourceNameAlias || resource.resourceName || '', canvas);\n c.textWidth = Math.max(colleagueBox.width, resourceBox.width) + 25;\n c.isRightAligned = resource.x + 30 + c.textWidth > canvas.getBBox().width;\n });\n return colleagues;\n }\n\n markChanged() {\n this.cdr.markForCheck();\n }\n\n ngAfterViewInit() {\n setTimeout(() => {\n this.display = true;\n this.markChanged();\n });\n }\n\n optimizeTextPosition(r: MapResource, text: string, offset = 20) {\n const canvas = this.canvas()!.nativeElement.closest('svg') as SVGSVGElement;\n const [newX, newY] = this.map.optimizeTextPosition(\n text,\n canvas,\n r.x,\n r.y,\n // r.x + (r.width || 2) / 2,\n // r.y + (r.height || 2) / 2,\n r.width || 0,\n r.height || 0,\n offset,\n );\n r.textX = newX;\n r.textY = newY;\n }\n\n ngOnDestroy() {\n this.display = false;\n }\n\n fetchDomain(name: string) {\n if (name == null) return '';\n // eslint-disable-next-line no-useless-escape\n const match = name.match(/(@[a-zA-Z1-9\\._-]*)/);\n const domain = match ? match[1].substring(0, match[1].lastIndexOf('.')) : name;\n return `${domain}`.toUpperCase();\n }\n\n getPathFromHood(hood: Neighborhood) {\n const path = hood.vectors\n ?.filter((n) => n != null && 'x' in n)\n .map((v, i) => `${i == 0 ? 'M' : 'L'}${v.x},${v.y}`)\n .join(' ');\n return path?.length ? `${path}Z` : '';\n }\n\n isColleague(resource: MapResource): boolean {\n return (\n this.colleagues()?.length > -1 && this.colleagues().findIndex((c) => c.resourceID === resource.resourceID) > -1\n );\n }\n\n hideAllTitles(evt?: Event) {\n if (!this.rendered) return;\n if (evt) evt.stopPropagation();\n this.resources().forEach((r) => (r.titleShown = false));\n this.hoverResource.set(undefined);\n this.hoverColleague.set(undefined);\n }\n\n hideTitle(r: MapResource, evt?: Event) {\n if (!this.rendered) return;\n if (evt) evt.stopPropagation();\n r.titleShown = false;\n if (this.hoverResource()?.resourceID === r.resourceID) this.hoverResource.set(undefined);\n if (this.hoverColleague()?.resourceID === r.resourceID) this.hoverColleague.set(undefined);\n }\n\n showTitle(r: MapResource, evt?: Event) {\n if (!this.rendered) return;\n if (evt) evt.stopPropagation();\n this.hideAllTitles();\n if (r.titleShown || !this.canSelectResource) return;\n\n r.titleShown = true;\n this.hoverResource.set(r);\n this.hoverColleague.set(this.colleagues().find((c) => c.resourceID === r.resourceID));\n }\n\n getLimit(r: MapResource) {\n return this.map.getLimit('temperature', r.state?.value);\n }\n\n private _isAvailable(r: MapSymbolElement) {\n if (this.selectableTypes().includes(r.type) && r.resourceID != null) {\n return this.isAvailable != null\n ? this.isAvailable(r)\n : ('unavailable' in r && 'available' in r && !r.unavailable && r.available) || true;\n }\n return false;\n }\n\n _isFavorite(r: MapSymbolElement) {\n return this.isFavorite != null ? this.isFavorite(r) : false;\n }\n\n /**\n * Transform positions to point in svg coordinate system\n */\n toPoint(x: number, y: number): Point {\n if (!this.canvasEl || !('createSVGPoint' in this.canvasEl)) {\n // This will never happen, except in unit testing\n return { x, y };\n }\n\n const point = this.canvasEl.createSVGPoint();\n if (!point) {\n return { x: 0, y: 0 };\n }\n point.x = x;\n point.y = y;\n return point.matrixTransform(this.canvasEl.getCTM()?.inverse());\n }\n\n // My own click event handler because Angular's click event is not always working on iOS devices\n downAt: Point = { x: 0, y: 0 };\n pointerDown(r: MapResource, evt: PointerEvent) {\n this.downAt = this.toPoint(evt.clientX, evt.clientY);\n }\n\n pointerUp(r: MapResource, evt: PointerEvent) {\n const upAt = this.toPoint(evt.clientX, evt.clientY);\n if (Math.abs(this.downAt.x - upAt.x) < 5 && Math.abs(this.downAt.y - upAt.y) < 5) {\n this.select(r, evt);\n }\n }\n\n select(r: MapResource, evt: MouseEvent) {\n if (!this.rendered) return;\n if (!r.titleShown) this.showTitle(r, evt);\n if (this.interactive && this.rendered && this.canSelectResource) {\n evt.stopPropagation();\n if (this.selectableTypes().includes(r.type) && r.state?.booked !== true) {\n r = r as MapSymbolElement;\n if (r.available === false || r.unavailable === true) return;\n evt.preventDefault();\n evt.stopImmediatePropagation();\n this.selectionMade.emit(r);\n }\n }\n // r.titleShown = false;\n }\n\n resetNeighborhood() {\n // Programmatic zoom out\n this.selectedNeighborhood = undefined;\n this.zoom = 1;\n if (this.interactive) {\n this.autoScroll();\n this.canSelectResource = !(this._internalConfig()!.enableZoom === true);\n }\n this.isZoomed = false;\n }\n\n getMyZoneElement(): Element {\n return this.rootElement.nativeElement.querySelector('.myZone');\n }\n\n @Denounced(50)\n private autoScroll(scrollPadding = 0, position: ScrollPosition = 'center') {\n let elm: Element | null = null;\n if (!elm && this.resourceID()) {\n elm = this.rootElement.nativeElement.querySelector('.youAreHere') as SVGElement;\n }\n if (!elm && this.markResourceID()) {\n elm = document.querySelector(`.resourceID_${this.markResourceID()}`);\n }\n if (!elm && this.selectedNeighborhood) {\n elm = document.querySelector(`#${this.selectedNeighborhood.safeName}`);\n }\n if (!elm && this.myZoneID()) {\n elm = this.getMyZoneElement();\n }\n if (elm == null) {\n elm = this.rootElement.nativeElement;\n position = position || 'left';\n }\n if (elm != null) {\n this.ngZone.runOutsideAngular(() => {\n elm != null &&\n scrollIntoView({\n elm: elm,\n containerSearchFrom: this.rootElement.nativeElement.parentElement,\n scrollPadding,\n position: position,\n });\n });\n }\n }\n\n selectNeighborhood(hood: Neighborhood, evt: MouseEvent, force = false) {\n if (!this.rendered) return;\n if (this.interactive && this._internalConfig()!.enableZoom === true && (!this.canSelectResource || force)) {\n evt.stopPropagation();\n\n // Select neighborhood and emit selection\n this.selectedNeighborhood = hood;\n const hoodEl = evt?.target as SVGSVGElement; // This should be the actual path element for this neighborhood\n const rootEl = this.zoomTo(hoodEl);\n\n // Activate resource selection\n this.canSelectResource = true;\n this.zoneSelectionMade.emit({ hood, rootEl, hoodEl });\n resetZoom();\n }\n }\n\n zoomTo(elm: SVGElement) {\n if (elm == null) return;\n this.isZoomed = true;\n\n // Scale and scroll to neighborhood\n const rootEl = this.rootElement.nativeElement;\n // The viewport to scale this element to\n const viewport = this.getOverflowParent(rootEl);\n // Get the width & height of the element\n const elBox = (elm as SVGSVGElement).getBoundingClientRect();\n // Get the width & height of the viewport\n const viewportHeight = viewport.clientHeight;\n const viewportWidth = viewport.clientWidth;\n // Calculate the scale\n const elmHeight = viewportHeight / elBox.height;\n const elmWidth = viewportWidth / elBox.width;\n // Zoom to the smallest scale\n this.zoom = Math.max(1, Math.min(elmHeight, elmWidth));\n this.autoScroll();\n return rootEl;\n }\n\n getBox(elm: Element) {\n if ('getBBox' in elm) return (elm as SVGSVGElement).getBBox();\n const rect = elm.getBoundingClientRect();\n const topLeft = this.toPoint(rect.left, rect.top);\n const bottomRight = this.toPoint(rect.right, rect.bottom);\n return {\n x: topLeft.x,\n y: topLeft.y,\n width: bottomRight.x,\n height: bottomRight.y,\n } as SVGRect;\n }\n\n getOverflowParent(element = this.rootElement.nativeElement) {\n let parent = element.parentElement;\n while (parent && (parent.scrollHeight < parent.clientHeight || parent.scrollWidth < parent.clientWidth)) {\n parent = parent.parentElement;\n }\n return parent;\n }\n}\n","\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n @for (symbol of symbols(); track symbol.id) {\n \n }\n \n \n \n @if (showZones()) {\n \n @for (hood of neighborhoods(); track hood.zoneID) {\n \n }\n \n }\n\n \n \n @if (visibleLayers().includes('zones') && !showZones()) {\n \n @for (r of zones(); track r.mapElementID) {\n @if (r.filter !== 'notActive') {\n \n @if (r.type === 'zone_text' && r.state?.value != null) {\n \n {{ r.state?.value }} °C\n \n }\n }\n }\n \n }\n\n \n @if (visibleLayers().includes('resources')) {\n \n @for (r of resources(); track r.mapElementID) {\n \n }\n @if (youAreHere() != null) {\n \n }\n \n }\n @if (visibleLayers().includes('doors')) {\n \n @for (r of doors(); track r.mapElementID) {\n \n }\n \n }\n @if (visibleLayers().includes('icons')) {\n \n @for (r of icons(); track r.mapElementID) {\n \n }\n \n }\n @if (type !== 'minimap') {\n \n @for (colleague of colleagues(); track colleague.employeeID) {\n @if (colleague.employeeID !== hoverColleague()?.employeeID) {\n \n }\n }\n \n\n \n \n @if (markResource() != null && markResourceID() !== hoverResource()?.resourceID) {\n \n {{ markResourceName() }}\n \n }\n \n @if (interactive && canSelectResource) {\n @for (r of selectableResources(); track r.mapElementID) {\n @if (r.titleShown && hoverColleague()?.resourceID !== r.resourceID) {\n \n @if (r.titleShown) {\n \n {{ r.resourceNameAlias || r.resourceName }}\n \n }\n \n }\n }\n }\n \n }\n \n @for (label of labels(); track label.mapElementID) {\n \n {{ label.content }}\n \n }\n @if (hoverColleague() != null) {\n \n }\n \n\n \n\n @if (type === 'minimap' && viewport != null) {\n \n }\n\n\n\n\n \n @if (colleague.resourceID === hoverResource()?.resourceID) {\n \n }\n \n \n \n \n \n\n \n \n @if (colleague.isGuest) {\n {{ colleague.domain }}\n } @else {\n @if (colleague.resourceID === hoverResource()?.resourceID) {\n {{ colleague.name }}\n {{ hoverResource()?.resourceNameAlias || hoverResource()?.resourceName }}\n } @else if (colleague.resourceID !== markResourceID()) {\n {{ colleague.abbreviation }}\n }\n }\n \n \n\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { DirectivesModule } from '../directives/directives.module';\nimport { PipesModule } from '../pipes';\nimport { MapComponent } from './map.component';\n\n@NgModule({\n declarations: [MapComponent],\n imports: [CommonModule, PipesModule, DirectivesModule, MatSnackBarModule, MatButtonModule, MatIconModule],\n exports: [MapComponent],\n})\nexport class MapModule {}\n","import { EmployeeParking } from '../parking/parking.model';\n\nexport const FLEX = 'flex';\nexport const UNAVAILABLE = 'unavailable';\nexport interface Bookable {\n icon: string;\n color?: string;\n resourceNameAlias?: string;\n nameAlias?: string;\n category: string;\n assetName: string;\n levelID: number;\n levelName: string;\n resourceID?: number;\n resourceName: string;\n zoneID?: number;\n zoneName?: string;\n}\nexport interface Entry extends Bookable {\n className?: string;\n name: string;\n identifier: string;\n favorite?: boolean;\n favoriteSortOrder: number;\n totalResourceCount?: number;\n usedResourceCount?: number;\n entryType: string;\n entryID: number;\n quickBooking?: boolean;\n occupied?: number[];\n // Convenience properties when converting from booking to entry group\n parentEntryType?: string;\n parentEntryID?: number;\n fromMs?: number;\n toMs?: number;\n mapID?: number;\n isAvailable?: boolean;\n isAutoBooking?: boolean;\n}\n\nexport interface EntryDetails extends Bookable {\n originalName: string;\n entryType: string;\n entryID: number;\n mapID: number;\n assetGroupName: string;\n assetName: string;\n assetImageUrl: string;\n sectionName: string;\n levelName: string;\n zoneName: string;\n resourceName: string;\n}\n\nexport interface CalendarDay {\n isHoliday: boolean;\n isAutoBooking: boolean;\n fromMs: number;\n toMs: number;\n bookings: Booking[];\n tempBookings?: Booking[];\n colleague?: Booking[];\n available?: boolean;\n}\nexport interface Booking extends Bookable {\n isAutoBooking?: boolean;\n exception?: string;\n sectionName: string;\n entryType: string;\n entryID: number;\n mapID: number;\n assetImageUrl: string;\n withLunch: boolean;\n withParking: boolean;\n storeAsQuickBooking: boolean;\n storeAsAutoBooking: boolean;\n markDelete?: boolean;\n endTimeMs?: number;\n startTimeMs?: number;\n favorite?: boolean; // Present when read from api\n storeAsFavorite?: boolean; // Present only when booking is created from search dialog.\n bookingID?: number;\n resourceID: number;\n resourceNameAlias?: string;\n category: string;\n fromMs: number;\n toMs: number;\n employeeParking?: EmployeeParking;\n}\n\nexport interface TeamBookings {\n employeeID: number;\n name: string;\n imageUrl: string;\n booking: Booking[];\n}\n\nexport interface Paged {\n pageSize: number;\n pageStart: number;\n totalPages: number;\n data: T;\n}\n\nexport interface FavoriteSort {\n entryType: string;\n entryID: number;\n sortOrder: number;\n}\n\nexport interface CategoryOverview {\n left: Category[];\n right: Category[];\n}\nexport interface Category {\n style: { width: string };\n color: string;\n count: number;\n side: 'l' | 'r';\n}\n\nexport interface BookedResources {\n endTime: string;\n endTimeMs: number;\n resourceID: number;\n startTime: string;\n startTimeMs: number;\n}\n\nexport interface TimeTuple {\n fromMs: number;\n toMs: number;\n}\n\nexport interface BookedResourceAvailability {\n resourceID: number;\n startTimeMs: number;\n endTimeMs: number;\n}\n","export async function createHmac(secretKey: string, data: string, method = 'SHA-1') {\n const enc = new TextEncoder();\n\n const key = await crypto.subtle.importKey(\n 'raw', // raw format of the key - should be Uint8Array\n enc.encode(secretKey),\n { name: 'HMAC', hash: { name: method } },\n false, // export = false\n ['sign', 'verify'], // what this key can do\n );\n const signature = await crypto.subtle.sign('HMAC', key, enc.encode(data));\n return btoa(String.fromCharCode(...new Uint8Array(signature)));\n}\n","import { Injectable, inject } from '@angular/core';\nimport { EmployeeParking } from './parking.model';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ParkingCacheService {\n // Tiny in-memory cache of current parking state per date\n private myParkings = new Map();\n sec = inject(DomSanitizer);\n\n private decorateParking(parking: EmployeeParking): EmployeeParking {\n if (parking?.assetImageUrl) {\n parking.safeAssetImage = this.sec.bypassSecurityTrustResourceUrl(parking.assetImageUrl);\n }\n return parking;\n }\n\n get(date: number) {\n const parking = this.myParkings.get(date);\n return parking != null ? this.decorateParking(parking) : parking;\n }\n\n set(date: number, parking: EmployeeParking | null) {\n parking = parking != null ? this.decorateParking(parking) : parking;\n this.myParkings.set(date, parking);\n }\n\n has(date: number) {\n return this.myParkings.has(date);\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable, signal } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { AuthService } from '@logic-suite/shared/auth';\nimport { RequestCache } from '@logic-suite/shared/cache';\nimport { createHmac } from '@logic-suite/shared/crypto/hmac';\nimport { MapConfig, MapService } from '@logic-suite/shared/map';\nimport { deepMerge, retryOn504, SharedObservable, titleCase } from '@logic-suite/shared/utils';\nimport { environment } from 'apps/flex/src/environments/environment';\nimport {\n addDays,\n addMonths,\n addSeconds,\n differenceInDays,\n endOfDay,\n getHours,\n isAfter,\n isSameDay,\n isSameYear,\n isWeekend,\n setHours,\n startOfDay,\n startOfSecond,\n} from 'date-fns';\nimport { firstValueFrom, from, Observable, of, throwError } from 'rxjs';\nimport { catchError, filter, map, share, switchMap, take, tap } from 'rxjs/operators';\nimport { EmployeeService } from '../../views/user/profile/employee.service';\nimport { Employee } from '../../views/user/profile/profile.model';\nimport { ParkingCacheService } from '../parking/parking-cache.service';\nimport {\n BookWorkdaysAhead,\n Features,\n NextWorkdayStartsAt,\n PolicyService,\n PolicyType,\n WorkOnWeekends,\n} from '../policy/policy.service';\nimport { AvailableResources, BookableResource } from '../search-dialog/search-dialog.model';\nimport {\n Bookable,\n BookedResourceAvailability,\n BookedResources,\n Booking,\n Entry,\n EntryDetails,\n FavoriteSort,\n FLEX,\n TimeTuple,\n UNAVAILABLE,\n} from './booking.model';\n\n@Injectable({ providedIn: 'root' })\nexport class BookingService {\n private map = inject(MapService);\n private http = inject(HttpClient);\n private policy = inject(PolicyService);\n private profile = inject(EmployeeService);\n private auth = inject(AuthService);\n private cache = inject(RequestCache);\n\n public autoBooking = signal(undefined);\n private currentDay?: Date;\n private emp!: Employee;\n myParkings = inject(ParkingCacheService);\n private bookingUpdated = signal(0);\n bookingUpdated$ = toObservable(this.bookingUpdated) as Observable;\n holidays = signal>(new Set());\n canBookWeekends = false;\n\n constructor() {\n firstValueFrom(\n this.auth.isLoggedIn$.pipe(\n filter(l => !!l),\n take(1),\n switchMap(() => this.profile.getEmployee()),\n ),\n ).then((emp: Employee) => (this.emp = emp));\n this.policy.ensurePolicyLoaded().subscribe(() => {\n this.canBookWeekends =\n ((this.policy.getPolicy(PolicyType.WorkOnWeekends) as WorkOnWeekends)?.value ?? false) == true;\n });\n }\n\n getHollidays(date = this.getSelectedDay()) {\n // Check if holidays for the given date's year are already cached\n if (Array.from(this.holidays()).some(h => isSameYear(h, date))) return of(Array.from(this.holidays()));\n\n // No holidays registered for selected year. Fetch holidays for this year.\n const accessKey = 'r0BAU0TEyj';\n const secretKey = 'B15tspjr9ccK7HBWOG5x';\n const expires = new Date();\n\n return from(createHmac(secretKey, `${accessKey}holidays${expires.toISOString()}`)).pipe(\n switchMap(signature =>\n environment.production\n ? this.http.get(`/time/holidays`, {\n params: {\n version: '3',\n accesskey: accessKey,\n signature: signature,\n timestamp: expires.toISOString(),\n country: 'no',\n lang: 'no',\n year: date.getFullYear().toString(),\n types: 'federal,federallocal,religious',\n },\n })\n : of({ holidays: [] }),\n ),\n map((res: any) => {\n if ('errors' in res) throw new Error(JSON.stringify(res.errors));\n // Add holidays to cache\n this.holidays.set(\n new Set(\n [...Array.from(this.holidays()), ...res.holidays.map((h: any) => new Date(h.date.iso).getTime())].sort(),\n ),\n );\n return Array.from(this.holidays());\n }),\n );\n }\n\n private mapColors(res: Bookable[]): Bookable[] {\n return res.map(r => this.addColor(r));\n }\n\n addColor(r: Bookable): Bookable {\n if (!r) return r;\n r.icon = r.icon || 'office';\n r.resourceNameAlias = r.resourceNameAlias || r.nameAlias || (r as Booking).resourceName || (r as Entry).name;\n // if (r.color) return r;\n if (r.category) {\n // prettier-ignore\n switch (r.category) {\n case FLEX: r.color = 'grad2'; break;\n case UNAVAILABLE: r.color = 'grad5'; break;\n case 'office': r.color = 'grad1'; break;\n case 'coworking': r.color = 'grad3'; break;\n }\n } else {\n // prettier-ignore\n switch(r.icon) {\n case 'office': r.color = 'grad1'; break;\n case FLEX: r.color = 'grad2'; break;\n case UNAVAILABLE: r.color = 'grad5'; break;\n case 'mesh': r.color = 'grad3'; break;\n case 'target': r.color = 'grad4'; break;\n }\n }\n if ('entryType' in r && 'category' in r && (r as Entry).identifier == null) {\n (r as Entry).identifier = `${(r as Entry).category}${(r as Entry).entryType}${(r as Entry).entryID}`;\n }\n if (\n this.autoBooking()?.entryID != null &&\n (this.autoBooking()?.entryID === (r as Entry).entryID ||\n this.autoBooking()?.entryID === (r as Booking).resourceID)\n ) {\n r.category = 'auto';\n r.icon = 'autoBooking';\n r.color = 'grad12';\n }\n return r;\n }\n\n registerSubscription(sub: PushSubscription): Observable {\n return this.http.post(`/api/flex/PushNotification`, sub);\n }\n\n flatMap(mapID: number, markResourceID: number) {\n return this.http.get(`/api/flex/Map/${mapID}`).pipe(\n switchMap(config => this.map.flatMap(config, markResourceID)),\n map(map => URL.createObjectURL(map)),\n );\n }\n\n /**\n *\n * @returns The current day as set in date-selector\n */\n getSelectedDay(): Date {\n if (this.currentDay) return this.currentDay;\n return this.getToday();\n }\n\n setSelectedDay(date?: Date) {\n if (date && isSameDay(date, this.getToday())) date = undefined;\n this.currentDay = date;\n }\n\n /**\n *\n * @returns The current day as defined in policy based on todays date.\n */\n getToday() {\n const now = Date.now();\n const nextDayStartsAt = this.policy.getPolicy(PolicyType.NextWorkdayStartsAt) as NextWorkdayStartsAt;\n const reference = setHours(startOfDay(now), nextDayStartsAt?.value ?? 17);\n // After 17:00, we should be scheduling next day.\n return isAfter(now, reference) ? startOfDay(addDays(now, 1)) : startOfDay(now);\n }\n\n getMaxBookingDate(entry?: Entry) {\n let maxDay = addMonths(new Date(), 3); // Default allow 3 months ahead in time\n const startDate = startOfDay(this.getToday()); // Either today or if policy dictates it, tomorrow\n const bookWorkdays = this.policy.getPolicy(PolicyType.BookWorkdaysAhead) as BookWorkdaysAhead[];\n\n if (bookWorkdays) {\n const defaultPolicy = bookWorkdays.find(b => !('entryID' in b) || b.entryID == null);\n let policy = defaultPolicy;\n // If entry has a policy override, use it. Otherwise, use default.\n if (entry != null) {\n // Find the policy matching this entry\n policy = bookWorkdays.find(p => p.entryID === '' + entry.zoneID) || bookWorkdays[0];\n } else {\n // No entry given, find the policy with the largest amongst the policies in my neighborhoods\n const myPolicies = bookWorkdays.filter(b => this.emp.zoneIDs?.includes(+(b.entryID || -1)));\n if (myPolicies.length) {\n const max = Math.max(\n ...myPolicies.map(p => p.allocatedBookDaysAhead || -1),\n ...bookWorkdays.map(p => p.bookDaysAhead || -1),\n defaultPolicy?.bookDaysAhead ?? -1,\n );\n policy = myPolicies.find(p => p.allocatedBookDaysAhead === max) || defaultPolicy;\n } else {\n const max = Math.max(...bookWorkdays.map(p => p.bookDaysAhead || -1), defaultPolicy?.bookDaysAhead ?? -1);\n policy = bookWorkdays.find(p => p.bookDaysAhead === max) || defaultPolicy;\n }\n }\n\n // If entry is in users neighborhood, use `allocatedBookDaysAhead`. If not, use `bookDaysAhead`.\n // If no policy is set, or if any of these properties are missing in the current policy for this entry,\n // use `bookDaysAhead` from default policy.\n const isUserInNeighborhood = this.emp.zoneIDs?.includes(+(policy?.entryID || -1)) ?? false;\n // Default policy used\n let allowDaysAhead = defaultPolicy?.bookDaysAhead || 90;\n if (isUserInNeighborhood && policy?.allocatedBookDaysAhead != null) {\n // Special privileges for user in own neighborhoods\n allowDaysAhead = policy.allocatedBookDaysAhead;\n } else if (!isUserInNeighborhood && policy?.bookDaysAhead != null) {\n // Policy for everyone else in this neighborhood\n allowDaysAhead = policy.bookDaysAhead as number;\n }\n\n // Add base number of days\n maxDay = addDays(startDate, allowDaysAhead);\n\n // Add weekends if policy says weekend days are *not* workdays\n if (this.canBookWeekends != true) {\n // Does not allow work on weekends. Add days to maxDay if we hit a weekend in the near future.\n let i = 0;\n while (i <= allowDaysAhead) {\n if (isWeekend(addDays(startDate, i))) {\n // Next day is weekend. Add one more day to stack.\n maxDay = addDays(maxDay, 1);\n allowDaysAhead++;\n }\n i++;\n }\n }\n }\n return addSeconds(maxDay, 1);\n }\n\n bookingToGroup(b: Booking): Entry {\n const entry = this.addColor({\n name: b.resourceName,\n assetName: b.assetName,\n levelName: b.levelName,\n resourceNameAlias: b.resourceNameAlias,\n icon: b.icon || '',\n category: b.category || '',\n color: b.color,\n favorite: b.favorite || b.storeAsFavorite || false,\n entryType: 'resource',\n entryID: b.resourceID,\n parentEntryType: b.entryType,\n parentEntryID: b.entryID,\n // fromMs: b.startTimeMs || b.fromMs,\n // toMs: b.endTimeMs || b.toMs,\n isAutoBooking: b.storeAsAutoBooking === true || b.isAutoBooking === true,\n } as unknown as Bookable) as Entry;\n return entry as Entry;\n }\n\n groupToBooking(g: Entry | Booking): Booking {\n const booking = {\n bookingID: (g as Booking).bookingID || undefined,\n resourceID: ((g as Booking).resourceID || (g.entryType == 'resource' ? g.entryID : undefined)) as number,\n resourceName: ((g as Booking).resourceName || (g as Entry).name || undefined) as string,\n resourceNameAlias: (g.nameAlias || g.resourceNameAlias) as string,\n assetName: (g as Booking).assetName as string,\n category: g.category,\n color: g.color,\n icon: g.icon,\n fromMs: g.fromMs as number,\n toMs: g.toMs as number,\n withLunch: (g as Booking).withLunch || false,\n withParking: (g as Booking).withParking || false,\n storeAsFavorite: (g as Booking).storeAsFavorite || g.favorite || false,\n storeAsQuickBooking: (g as Booking).storeAsQuickBooking || (g as Entry).quickBooking || false,\n storeAsAutoBooking: (g as Booking).storeAsAutoBooking || (g as Entry).isAutoBooking || false,\n isAutoBooking: g.isAutoBooking || false,\n sectionName: (g as any).sectionName as string,\n levelID: ((g as Entry).parentEntryType === 'level' ? (g as Entry).parentEntryID : undefined) as number,\n levelName: (g as Entry).levelName as string,\n zoneName: (g as Entry).zoneName as string,\n entryType: g.entryType,\n entryID: g.entryID,\n mapID: g.mapID as number,\n assetImageUrl: (g as any).assetImageUrl as string,\n };\n return booking as Booking;\n }\n\n groupToMapResource(entry: Entry): BookableResource {\n const resource = {\n resourceID: entry.entryID,\n resourceName: entry.name,\n assetName: entry.assetName,\n levelName: entry.levelName,\n resourceNameAlias: entry.resourceNameAlias,\n type: entry.entryType,\n category: entry.category,\n x: -1,\n y: -1,\n unavailable: false,\n selected: false,\n } as BookableResource;\n return deepMerge(structuredClone(entry), resource) as BookableResource;\n }\n\n getCurrentTimeTuple(tuple?: TimeTuple): TimeTuple {\n return {\n fromMs: tuple?.fromMs || startOfDay(this.getSelectedDay()).getTime(),\n toMs: tuple?.toMs || startOfSecond(endOfDay(this.getSelectedDay())).getTime(),\n };\n }\n\n /**\n * Get a list of Bookings for a particular date range\n */\n @SharedObservable({ emitOnce: true })\n getBookings(fromMs?: number, toMs?: number, employeeID?: number): Observable {\n const tuple = this.getCurrentTimeTuple({ fromMs, toMs } as TimeTuple);\n return this.http\n .get(`/api/flex/Booking`, {\n params: {\n fromMs: '' + tuple.fromMs,\n toMs: '' + tuple.toMs,\n ...(employeeID ? { employeeID: '' + employeeID } : {}),\n },\n })\n .pipe(\n retryOn504(),\n map(r => this.mapColors(r) as Booking[]),\n map(r =>\n r.map(i => {\n i.withLunch = true;\n return i;\n }),\n ),\n );\n }\n\n async getHoursBooked(date: Date, resourceID?: number) {\n if (date) {\n const bookings = await firstValueFrom(\n this.getBookings(startOfDay(date).getTime(), startOfSecond(endOfDay(date)).getTime()),\n );\n return this.toHoursBooked(bookings, resourceID);\n }\n return [] as number[];\n }\n\n toHoursBooked(bookings: Booking[], resourceID?: number) {\n return (\n bookings\n ?.filter(b => resourceID == null || b.resourceID == resourceID)\n .reduce((acc, t) => {\n // Convert timestamps to hour strings\n const from = getHours(t.fromMs);\n const to = getHours(t.toMs);\n for (let i = from; i <= to; i++) {\n acc.push(i);\n }\n return acc;\n }, [] as number[]) ?? []\n );\n }\n\n /**\n * Get a resource configured as a \"quick booking\"\n */\n @SharedObservable()\n getQuickBooking(\n fromMs = startOfDay(new Date()).getTime(),\n toMs = startOfSecond(endOfDay(new Date())).getTime(),\n ): Observable {\n toMs = startOfSecond(toMs).getTime();\n return this.http\n .get(`/api/flex/QuickBooking`, {\n params: {\n fromMs: '' + fromMs,\n toMs: '' + toMs,\n },\n })\n .pipe(\n retryOn504(),\n map((res: Entry) => this.addColor(res) as Entry),\n );\n }\n\n /**\n * Get the resource configured as an \"auto booking\"\n *\n * @returns The resource configured as an \"auto booking\", or {entryID: -1}\n * if no auto booking is configured. If the request fails for any reason, null is returned.\n */\n @SharedObservable()\n getAutoBooking(fromMs = startOfDay(new Date()).getTime(), toMs = startOfSecond(endOfDay(new Date())).getTime()) {\n return this.http\n .get(`/api/flex/QuickBooking/AutoBooking`, {\n params: {\n fromMs: '' + fromMs,\n toMs: '' + toMs,\n },\n })\n .pipe(\n retryOn504(),\n map((res: Entry) => {\n if (res) {\n this.autoBooking.set(res);\n this.addColor(res);\n return this.autoBooking() as Entry;\n }\n this.autoBooking.set(undefined);\n return { entryID: -1 } as Entry;\n }),\n catchError(() => of(null as unknown as Entry)),\n );\n }\n\n /**\n * Removes the resource from the auto-booking system. This will\n * stop recurring bookings from being made, but it will not delete\n * bookings already done.\n */\n removeAutoBooking() {\n return this.http.delete(`/api/flex/QuickBooking/AutoBooking`).pipe(\n tap(() => {\n this.autoBooking.set(undefined);\n this.cache.invalidate(`/api/flex/QuickBooking`);\n this.cache.invalidate(`/api/flex/Booking`);\n this.cache.invalidate(`/api/flex/Entry`);\n }),\n );\n }\n\n /**\n * Get any AssetTree object user has specified as a favorite,\n * or use the `filter` to limit the AssetTree objects to specific\n * types. I.E. Only \"resource\" types.\n */\n @SharedObservable()\n getFavorites(\n fromMs = startOfDay(new Date()).getTime(),\n toMs = endOfDay(new Date()).getTime(),\n filter?: string,\n ): Observable {\n toMs = startOfSecond(toMs).getTime();\n return this.http\n .get(`/api/flex/Favorite`, {\n params: {\n fromMs: '' + fromMs,\n toMs: '' + toMs,\n ...(!!filter && { entryTypeFilter: filter }),\n },\n })\n .pipe(\n retryOn504(),\n switchMap((res: Entry[]) => this.policy.ensurePolicyLoaded().pipe(map(() => res))),\n map((res: Entry[]) => {\n if (this.policy.hasFeature(Features.Unavailable) && res.findIndex(r => r.icon === UNAVAILABLE) < 0) {\n res.unshift({\n name: titleCase(UNAVAILABLE),\n icon: UNAVAILABLE,\n category: UNAVAILABLE,\n entryType: 'resource',\n favoriteSortOrder: -1,\n totalResourceCount: 1,\n usedResourceCount: 0,\n quickBooking: true,\n } as Entry);\n }\n if (res.findIndex(r => r.icon === FLEX) < 0) {\n res.unshift({\n name: titleCase(FLEX),\n icon: FLEX,\n category: FLEX,\n entryType: 'resource',\n favoriteSortOrder: -1,\n totalResourceCount: 1,\n usedResourceCount: 0,\n quickBooking: true,\n } as Entry);\n }\n const sortOrder: any = { [FLEX]: 1, [UNAVAILABLE]: 2, default: 100 };\n const typeOrder: any = {\n assetGroup: 2,\n asset: 3,\n section: 4,\n level: 5,\n zone: 6,\n room: 7,\n resource: 8,\n default: 1,\n };\n\n return (this.mapColors(res) as Entry[]).sort((a: Entry, b: Entry): number => {\n const aOrder = sortOrder[a.category] || sortOrder['default'] + (a.favoriteSortOrder || 0);\n const bOrder = sortOrder[b.category] || sortOrder['default'] + (b.favoriteSortOrder || 0);\n // Flex and Unavailable should always be first\n if (aOrder - bOrder != 0) return aOrder - bOrder;\n // After that, the user should define the order of the favorites\n if (a.favoriteSortOrder && b.favoriteSortOrder) return a.favoriteSortOrder - b.favoriteSortOrder;\n // If no order is set, sort by entryType where each entryType is alphabetically ordered.\n if (a.entryType === b.entryType) return a.name > b.name ? 1 : -1;\n const aType = typeOrder[a.entryType] || typeOrder['default'];\n const bType = typeOrder[b.entryType] || typeOrder['default'];\n return aType - bType;\n });\n }),\n );\n }\n\n getFavoriteDetails(group: Entry): Observable {\n if (!group) return throwError(() => 'No entryType or entryID given');\n return this.http.get(`/api/flex/Favorite/${group.entryType}/${group.entryID}`).pipe(\n retryOn504(),\n map(details => this.addColor(details) as EntryDetails),\n map(details => {\n details.resourceName = details.originalName;\n return details;\n }),\n );\n }\n\n setFavoriteSortOrder(favorites: FavoriteSort[]): Observable {\n return this.http\n .post(`/api/flex/Favorite/SortOrder`, favorites)\n .pipe(tap(() => this.cache.invalidate(`/api/flex/Favorite`)));\n }\n\n setFavoriteAlias(fav: EntryDetails): Observable {\n return this.http\n .post(`/api/flex/Favorite/NameAlias`, {\n entryType: fav.entryType,\n entryID: fav.entryID,\n name: fav.resourceNameAlias,\n })\n .pipe(tap(() => this.cache.invalidate(`/api/flex/Favorite`)));\n }\n\n setFavoriteIcon(fav: EntryDetails): Observable {\n return this.http\n .post(`/api/flex/Favorite/Icon`, {\n entryType: fav.entryType,\n entryID: fav.entryID,\n icon: fav.icon,\n })\n .pipe(\n tap(() => {\n this.cache.invalidate(`/api/flex/Favorite`);\n this.cache.invalidate(`/api/flex/QuickBooking`);\n }),\n );\n }\n\n private toTimeString(times: TimeTuple[]) {\n return times.map(t => `${t.fromMs}-${t.toMs}`);\n }\n\n formatHour(hour: number) {\n return hour < 10 ? `0${hour}` : `${hour}`;\n }\n\n timeTupleToHours(times: TimeTuple[]) {\n return (\n times.reduce((acc, t) => {\n const hourFrom = getHours(t.fromMs);\n const hourTo = getHours(t.toMs);\n for (let i = hourFrom; i <= hourTo; i++) {\n acc.push(i);\n }\n return acc;\n }, [] as number[]) ?? []\n );\n }\n\n timeTupleToHourString(times: TimeTuple[]) {\n return this.timeTupleToHours(times).map(t => this.formatHour(t));\n }\n\n /**\n * Get\n */\n @SharedObservable()\n getEntries(entry = 'root', times: TimeTuple[], id?: number): Observable {\n return this.http\n .get(`/api/flex/Entry`, {\n params: {\n timeMs: this.toTimeString(times),\n entryType: entry,\n ...(id && { entryID: id }),\n },\n })\n .pipe(\n retryOn504(),\n share(),\n map((res: Entry[]) => this.mapColors(res) as Entry[]),\n );\n }\n\n toggleFavorite(entryType: string, entryID: number, flag: boolean): Observable {\n return this.http\n .post(`/api/flex/Favorite`, {\n entryType,\n entryID,\n favorite: flag,\n })\n .pipe(\n tap(() => {\n this.cache.invalidate(`/api/flex/Favorite`);\n this.cache.invalidate(`/api/flex/Team`);\n }),\n );\n }\n\n @SharedObservable()\n getBookedResources(resourceID: number, fromMs: number, toMs: number): Observable {\n if (!resourceID) return throwError(() => 'No resourceID given');\n return this.http\n .get(`/api/flex/Booking/${resourceID}`, {\n params: {\n fromMs: '' + fromMs,\n toMs: '' + toMs,\n },\n })\n .pipe(retryOn504());\n }\n\n @SharedObservable()\n getBookedResourceAvailability(resourceIDs: number[], fromMs: number, toMs: number) {\n return this.http\n .get(`/api/flex/Booking/Resources`, {\n params: { resourceID: resourceIDs, fromMs, toMs },\n })\n .pipe(retryOn504());\n }\n\n @SharedObservable()\n getResourceAvailability(time: TimeTuple[], entryType?: string, entryID?: number): Observable {\n return this.http\n .get(`/api/flex/Entry/Resource`, {\n params: {\n timeMs: this.toTimeString(time),\n ...(entryType && { entryType }),\n ...(entryID && { entryID }),\n },\n })\n .pipe(\n retryOn504(),\n map((res: AvailableResources[]) => {\n return (structuredClone(res) as AvailableResources[]).map(curr => {\n const maxDay = this.getMaxBookingDate(this.bookingToGroup(JSON.parse(JSON.stringify(curr)) as Booking));\n const now = this.getSelectedDay();\n const weekend = time.some(t => isWeekend(t.fromMs) || isWeekend(t.toMs));\n if ((!this.canBookWeekends && weekend) || (maxDay != null && isAfter(now, maxDay))) {\n curr.occupied = Array.from(new Array(24)).map((_, i) => i);\n }\n return this.addColor(curr);\n }) as AvailableResources[];\n }),\n );\n }\n\n bookResource(selectedSeat: Booking[]): Observable {\n selectedSeat.forEach(b => (b.bookingID = undefined));\n\n // Normal booking by default\n let doBooking$ = this.http.post(`/api/flex/Booking`, selectedSeat);\n\n // But if the given input contains `storeAsAutoBooking`...\n if (selectedSeat.every(b => b.storeAsAutoBooking === true)) {\n // ... we need to extend the booking to contain the entire booking horizon\n // for this seat, excluding days where user has booked something else.\n const maxDay = this.getMaxBookingDate(this.bookingToGroup(selectedSeat[0]));\n const fromMs = selectedSeat[0].fromMs;\n const toMs = startOfSecond(endOfDay(maxDay || selectedSeat[0].toMs)).getTime();\n\n let autoBookings: Booking[] = [...new Array(differenceInDays(toMs, fromMs))].reduce(\n (acc, c, idx) => [\n ...acc,\n Object.assign(structuredClone(selectedSeat[0]), {\n fromMs: addDays(fromMs, idx).getTime(),\n toMs: addDays(startOfSecond(endOfDay(fromMs)), idx).getTime(),\n }) as Booking,\n ],\n [],\n );\n doBooking$ = this.getBookings(fromMs, toMs).pipe(\n switchMap(bookings => {\n autoBookings = autoBookings.filter(day => {\n return (\n // Remove days from autoBookings where user has already booked something\n bookings.find(bk => isSameDay(bk.fromMs, day.fromMs) && bk.isAutoBooking !== true) == null &&\n // Remove days from autoBookings where day is a holiday\n !Array.from(this.holidays()).some(h => isSameDay(h, day.fromMs)) &&\n // Remove days from autoBookings where day is a weekend and user is not allowed to book weekends\n (this.canBookWeekends || !isWeekend(day.fromMs))\n );\n });\n return this.http.post(`/api/flex/Booking`, autoBookings);\n }),\n );\n }\n\n // Do the work\n return doBooking$.pipe(\n tap(res => {\n res.forEach(booking => {\n if ('employeeParking' in booking && booking.employeeParking != null) {\n this.myParkings.set(booking.employeeParking.dateMs, booking.employeeParking);\n }\n if (\n this.autoBooking()?.entryID !== booking.resourceID &&\n (booking.storeAsAutoBooking === true || booking.isAutoBooking === true)\n ) {\n this.autoBooking.set(this.bookingToGroup(booking));\n }\n this.addColor(booking);\n });\n this.cache.invalidate(`/api/flex/Booking`);\n this.cache.invalidate(`/api/flex/QuickBooking`);\n this.cache.invalidate(`/api/flex/Favorite`);\n this.cache.invalidate(`/api/flex/Transport`);\n this.cache.invalidate(`/api/flex/Entry`);\n this.cache.invalidate(`/api/flex/Team`);\n this.cache.invalidate(`/api/flex/MeetingRoom`);\n this.cache.invalidate(`/api/flex/EmployeeParking`);\n this.bookingUpdated.set(this.bookingUpdated() + 1);\n }),\n );\n }\n\n removeBookings(bookings: Booking[]) {\n if (!bookings.length) return throwError(() => 'No bookingID given');\n return this.http\n .delete(`/api/flex/Booking`, {\n responseType: 'text',\n params: {\n bookingIDs: bookings.map(b => '' + b.bookingID),\n },\n })\n .pipe(\n tap(() => {\n this.cache.invalidate(`/api/flex/Booking`);\n this.cache.invalidate(`/api/flex/QuickBooking`);\n this.cache.invalidate(`/api/flex/Favorite`);\n this.cache.invalidate(`/api/flex/Transport`);\n this.cache.invalidate(`/api/flex/Entry`);\n this.cache.invalidate(`/api/flex/Team`);\n this.cache.invalidate(`/api/flex/MeetingRoom`);\n this.cache.invalidate(`/api/flex/EmployeeParking`);\n this.bookingUpdated.set(this.bookingUpdated() + 1);\n }),\n map((res: string) => true),\n );\n }\n\n compileOccupied(fromMs: number, toMs: number) {\n const from = getHours(fromMs);\n const to = getHours(toMs);\n const occupied = [];\n for (let j = from; j <= to; j++) {\n occupied.push(j);\n }\n return occupied;\n }\n\n showColleagues(mapId: number, fromMs?: number, toMs?: number) {\n if (!mapId) return throwError(() => 'No mapID given');\n return this.http.post(`/api/flex/Map/${mapId}/ShowColleagues`, {\n ...(fromMs && { fromMs }),\n ...(toMs && { toMs }),\n });\n }\n\n getNeighborhoods(times: TimeTuple[]): Observable {\n return this.http\n .get(`/api/flex/Neighborhood`, {\n params: { timeMs: this.toTimeString(times) },\n })\n .pipe(\n share(),\n map((res: Entry[]) => this.mapColors(res) as Entry[]),\n );\n }\n}\n"],"mappings":"ogCAEO,IAAMA,GAAc,CACzBC,WAAY,GACZC,KAAM,CACJC,SAAU,aACVC,SAAU,OACV,IAAIC,QAAM,CACR,IAAMC,EAAMC,GAAO,KAAK,EAExB,MAAO,WADGD,IAAQ,cAAgBA,IAAQ,OAAS,GAAK,GAAGA,CAAG,GAC3C,uBACrB,EACAE,YAAa,aAEf,IAAIC,YAAU,CACZ,OAAOF,GAAO,KAAK,IAAM,MAAQ,OAAS,MAC5C,EACAG,YAAa,GACbC,eAAgBJ,GAAO,KAAK,IAAM,QClB9B,SAAUK,IAAS,CAEvB,IAAMC,EAAWC,SAASC,cAAc,uBAAuB,EAC3DF,IACFA,EAASG,aAAa,UAAW,uEAAuE,EACxGC,WAAW,IAAK,CACdJ,EAASG,aACP,UACA,iFAAiF,CAErF,EAAG,GAAG,EAEV,kDEXEE,EAAA,EAAA,SAAA,CAAA,EAAqCC,GAAA,QAAA,UAAA,CAAAC,EAAAC,CAAA,EAAA,IAAAC,EAAAC,EAAA,EAAA,OAAAC,EAASF,EAAAG,gBAAA,CAAiB,CA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AA,MAAA,CAAA,EAAAA,EAAA,oBAAA,MAAA,CAAA,EAAA/R,GAAA,UAAA,iBAAA,IAAA,EA8CnB4R,EAAA,CADCC,GAAgB,EAAEE,EAAA,cAAA,QAAA,EAAAA,EAAA,oBAAA,CAAA,OAAA,OAAA,MAAA,CAAA,EAAAA,EAAA,oBAKhBC,EAAU,CAAA,EAAAhS,GAAA,UAAA,eAAA,IAAA,EA2Ib4R,EAAA,CADCC,GAAgB,EAAEE,EAAA,cAAA,QAAA,EAAAA,EAAA,oBAAA,CAAA,OAAA,MAAA,MAAA,CAAA,EAAAA,EAAA,oBAC0CC,EAAU,CAAA,EAAAhS,GAAA,UAAA,aAAA,IAAA,EAgCvE4R,EAAA,CADCC,GAAgB,EAAEE,EAAA,cAAA,QAAA,EAAAA,EAAA,oBAAA,CAAA,OAAA,OAAA,MAAA,CAAA,EAAAA,EAAA,oBACmDC,EAAU,CAAA,EAAAhS,GAAA,UAAA,qBAAA,IAAA,EAahF4R,EAAA,CADCC,GAAgB,EAAEE,EAAA,cAAA,QAAA,EAAAA,EAAA,oBAAA,CAAA,MAAA,OAAA,MAAA,CAAA,EAAAA,EAAA,oBAAA,MAAA,CAAA,EAAA/R,GAAA,UAAA,gCAAA,IAAA,EAUnB4R,EAAA,CADCC,GAAgB,EAAEE,EAAA,cAAA,QAAA,EAAAA,EAAA,oBAAA,CAAA,MAAA,OAAA,MAAA,CAAA,EAAAA,EAAA,oBAC+DC,EAAU,CAAA,EAAAhS,GAAA,UAAA,0BAAA,IAAA","names":["environment","production","auth","clientId","tenantId","issuer","env","getEnv","redirectUri","errorLevel","customLogin","showHoodColors","resetZoom","viewport","document","querySelector","setAttribute","setTimeout","ɵɵelementStart","ɵɵlistener","ɵɵrestoreView","_r1","ctx_r1","ɵɵnextContext","ɵɵresetView","closeFullscreen","ɵɵtext","ɵɵelementEnd","ViewState","FullscreenComponent","_isFullscreen","showFullscreen","constructor","el","signal","__created","performance","now","startPointers","startPos","x","y","disableFullscreen","viewPortChanged","EventEmitter","stateChanged","ngAfterViewInit","emit","NORMAL","onScroll","target","nativeElement","onTouchStart","evt","touches","length","clientX","onTouchEnd","deltaX","Math","abs","deltaY","clientY","hasMoved","lastTouch","undefined","toggleFullscreen","dblClick","lastToggled","set","FULLSCREEN","$event","preventDefault","stopPropagation","resetZoom","observers","from","scrollLeft","scrollTop","view","toPoint","zoom","to","clientWidth","clientHeight","viewport","width","height","ɵɵdirectiveInject","ElementRef","selectors","hostVars","hostBindings","rf","ctx","ɵɵclassProp","ɵɵtemplate","FullscreenComponent_Conditional_0_Template","ɵɵprojection","ɵɵconditional","observer","breakPointConfig","self","observer","ResizeObserver","entries","window","requestAnimationFrame","forEach","entry","breakpoints","breakPointConfig","target","dataset","breakpoint","Error","Object","keys","point","toggleClass","sizeGreaterThan","contentRect","width","currentState","minHeight","height","minWidth","maxHeight","sizeLessThan","maxWidth","minRatio","getRatio","maxRatio","config","filter","key","value","shouldSet","operator","some","every","element","elmSize","pointValues","getUnitValue","minSize","convertToPixel","maxSize","className","flag","hasClass","classList","contains","add","remove","pointValue","unit","getComputedStyle","fontSize","document","body","exec","addMonths","date","amount","options","_date","toDate","constructFrom","dayOfMonth","endOfDesiredMonth","daysInMonth","isWeekend","date","options","day","toDate","addMilliseconds","date","amount","options","constructFrom","toDate","addSeconds","date","amount","options","addMilliseconds","isSameDay","laterDate","earlierDate","options","dateLeft_","dateRight_","normalizeDates","startOfDay","differenceInDays","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","sign","compareLocalAsc","difference","differenceInCalendarDays","isLastDayNotFull","result","diff","getHours","date","options","toDate","startOfSecond","date","options","date_","toDate","isSameYear","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","setHours","date","hours","options","_date","toDate","subMonths","date","amount","options","addMonths","DirectivesModule","CommonModule","FullscreenModule","CommonModule","DirectivesModule","MatButtonModule","MatIconModule","entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","create","apply","construct","x","fun","thisValue","args","Func","arrayForEach","unapply","arrayPop","arrayPush","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","objectHasOwnProperty","regExpTest","typeErrorCreate","unconstruct","func","thisArg","_len","_key","_len2","_key2","addToSet","set","array","transformCaseFunc","l","element","lcElement","cleanArray","index","clone","object","newObject","property","value","lookupGetter","prop","desc","fallbackValue","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","text","html","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","NODE_TYPE","getGlobal","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","suffix","ATTR_NAME","policyName","scriptUrl","_createHooksMap","createDOMPurify","window","DOMPurify","root","document","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","remove","getNextSibling","getChildNodes","getParentNode","template","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","parentTagName","_forceRemove","node","_removeAttribute","name","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","body","_createNodeIterator","_isClobbered","_isNode","_executeHooks","currentNode","data","hook","_sanitizeElements","content","_isBasicCustomElement","parentNode","childNodes","childCount","i","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attributes","hookEvent","attr","namespaceURI","attrValue","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","importedNode","returnNode","nodeIterator","serializedHTML","tag","entryPoint","hookFunction","purify","getSymbol","type","sec","symbol","mapSymbols","find","s","id","minX","miny","width","height","viewbox","split","Object","assign","safeSymbol","bypassSecurityTrustHtml","title","MapSymbol","VIEWBOX_REGEX","Limit","MapService","constructor","http","sec","theme","inject","ThemeService","numberFormatter","Intl","NumberFormat","style","minimumFractionDigits","maximumFractionDigits","debug$","BehaviorSubject","symbols","limits","co2","val","WARNING","NOTGOOD","GOOD","humidity","tvoc","temperature","tempCol","WARMEST","WARM","COLD","radon","pressure","light","dimensionCache","Map","MapSymbol","map","r","getSymbol","id","debug","msg","flatMap","config","markResourceID","post","mapConfig","showNeighborhoods","colorScheme","responseType","getConfig","url","get","replace","pipe","retryOn504","resources","filter","neighborhoods","n","Object","assign","vectors","v","meetingRooms","m","getCoordinates","lastIndex","match","exec","floorPlanSVG","length","coordinateSystem","_getColor","key","color","getComputedStyle","document","body","getPropertyValue","trim","indexOf","rgbStrToHex","getColor","type","value","getLimit","NA","num","parseInt","format","rgb","g","b","a","substring","split","rgbToHex","x","toString","padStart","join","configureMap","__spreadValues","coordinates","useHoodColorsOnDesks","showNeighborhoodColors","getEnv","setResources","structuredClone","Array","isArray","some","t","startsWith","symbol","find","s","resource","width","height","layer","transform","applyTransform","getFilter","icons","doors","zones","labels","scale","rotate","applyPosition","offsetX","offsetY","y","optimizeX","elX","el","offset","canvas","closest","newX","newY","optimizeTextPosition","optimizeY","elY","getDimensions","str","DOMRect","has","text","createElementNS","innerHTML","appendChild","result","getBBox","remove","set","boxHeight","boxWidth","textBox","canvasBox","boxCenterX","boxCenterY","Math","abs","hasAttribute","getAttribute","parseFloat","forceRotation","textX","textY","operations","push","vFlip","flip","toLowerCase","hFlip","undefined","rotation","ɵɵinject","HttpClient","DomSanitizer","factory","ɵfac","providedIn","__decorate","SharedObservable","__metadata","Observable","ɵɵelement","ɵɵproperty","symbol_r2","safeSymbol","ɵɵsanitizeHtml","ɵɵelementStart","ɵɵlistener","$event","hood_r4","ɵɵrestoreView","_r3","$implicit","ctx_r4","ɵɵnextContext","ɵɵresetView","selectNeighborhood","ɵɵelementEnd","ɵɵstyleMap","colorCode","safeName","ɵɵpureFunction1","_c2","tmp_15_0","myZoneID","includes","zoneID","ɵɵrepeaterCreate","MapComponent_Conditional_61_For_2_Template","_forTrack2","ɵɵadvance","ɵɵrepeater","neighborhoods","ɵɵtext","ɵɵtextInterpolate1","r_r7","state","value","ɵɵtemplate","MapComponent_Conditional_62_For_2_Conditional_0_Conditional_1_Template","ɵɵconditional","type","MapComponent_Conditional_62_For_2_Conditional_0_Template","filter","MapComponent_Conditional_62_For_2_Template","_forTrack1","zones","r_r9","_r8","select","pointerDown","pointerUp","showTitle","hideTitle","ɵɵclassMap","classList","join","MapComponent_Conditional_63_For_2_Template","MapComponent_Conditional_63_Conditional_3_Template","_c3","interactive","canSelectResource","resources","youAreHere","r_r10","MapComponent_Conditional_64_For_2_Template","doors","MapComponent_Conditional_65_For_2_Template","icons","ɵɵelementContainer","MapComponent_Conditional_66_For_2_Conditional_0__svg_ng_container_0_Template","colleagueTpl_r13","_c4","colleague_r12","MapComponent_Conditional_66_For_2_Conditional_0_Template","employeeID","tmp_13_0","hoverColleague","markResource","textX","x","textY","y","ɵɵtextInterpolate","markResourceName","r_r14","resourceNameAlias","resourceName","MapComponent_Conditional_66_Conditional_5_For_1_Conditional_0_Conditional_1_Template","titleShown","MapComponent_Conditional_66_Conditional_5_For_1_Conditional_0_Template","tmp_14_0","resourceID","MapComponent_Conditional_66_Conditional_5_For_1_Template","selectableResources","MapComponent_Conditional_66_For_2_Template","_forTrack3","MapComponent_Conditional_66_Conditional_4_Template","MapComponent_Conditional_66_Conditional_5_Template","colleagues","markResourceID","tmp_4_0","hoverResource","label_r15","content","MapComponent_Conditional_70__svg_ng_container_0_Template","colleague_r17","domain","name","tmp_8_0","abbreviation","MapComponent_ng_template_73_Conditional_9_Conditional_0_Template","MapComponent_ng_template_73_Conditional_9_Conditional_1_Template","tmp_6_0","MapComponent_ng_template_73_Conditional_1_Template","_r16","thumbUrl","imageUrl","MapComponent_ng_template_73_Conditional_8_Template","MapComponent_ng_template_73_Conditional_9_Template","ɵɵpropertyInterpolate1","ɵɵpureFunction2","_c5","isRightAligned","_c6","isGuest","debug","MapComponent","zoom","_zoom","n","rootElement","nativeElement","setAttribute","canvasEl","_canvasEl","canvas","querySelector","undefined","closest","constructor","map","inject","MapService","sec","DomSanitizer","ElementRef","snack","MatSnackBar","cdr","ChangeDetectorRef","ngZone","NgZone","subscriptions","display","showFullscreen","isZoomed","visibleLayers","input","showZones","transform","v","focusOn","selectableTypes","selectionMade","output","zoneSelectionMade","mapLoaded","mapRendered","rendered","useHoodColorOnDesks","computed","_internalConfig","showNeighborhoodColors","getEnv","find","r","enableZoom","_zoomEnabled","length","mapLoaded$","ReplaySubject","configUrl","mapID","config","signal","floorPlanSVG","replace","VIEWBOX_REGEX","bypassSecurityTrustHtml","DOMPurify","sanitize","USE_PROFILES","svg","svgFilters","coordinates","getCoordinates","symbols","some","t","startsWith","resource","symbol","s","id","width","height","layer","applyTransform","style","getFilter","available","_isAvailable","isFavorite","_isFavorite","hood","hoodColor","alpha","Object","entries","unavailable","blocked","favorite","selected","booked","partlyBooked","occupied","you","k","push","assign","labels","label","underscore","getAlphaValue","d","getPathFromHood","optimizeX","optimizeY","abbreviate","youAreHeareResource","Array","isArray","style2","applyPosition","viewChild","downAt","effect","__async","set","structuredClone","firstValueFrom","getConfig","open","duration","performance","mark","autoScroll","emit","next","waitForElement","at","mapElementID","then","elm","logger","measure","forEach","optimizeTextPosition","decorateColleagues","markChanged","h","el","document","zoomTo","ngOnChanges","change","viewStateChange","currentValue","subscribe","ViewState","FULLSCREEN","selectedNeighborhood","c","fetchDomain","isColleague","file","substring","lastIndexOf","ext","cx","cy","colleagueBox","getDimensions","resourceBox","textWidth","Math","max","getBBox","markForCheck","ngAfterViewInit","setTimeout","text","offset","newX","newY","ngOnDestroy","match","toUpperCase","path","vectors","i","findIndex","hideAllTitles","evt","stopPropagation","getLimit","isAvailable","toPoint","point","createSVGPoint","matrixTransform","getCTM","inverse","clientX","clientY","upAt","abs","preventDefault","stopImmediatePropagation","resetNeighborhood","getMyZoneElement","scrollPadding","position","runOutsideAngular","scrollIntoView","containerSearchFrom","parentElement","force","hoodEl","target","rootEl","resetZoom","viewport","getOverflowParent","elBox","getBoundingClientRect","viewportHeight","clientHeight","viewportWidth","clientWidth","elmHeight","elmWidth","min","getBox","rect","topLeft","left","top","bottomRight","right","bottom","element","parent","scrollHeight","scrollWidth","selectors","viewQuery","rf","ctx","ɵɵclassProp","i0","_r1","MapComponent_For_58_Template","_forTrack0","MapComponent_Conditional_61_Template","MapComponent_Conditional_62_Template","MapComponent_Conditional_63_Template","MapComponent_Conditional_64_Template","MapComponent_Conditional_65_Template","MapComponent_Conditional_66_Template","MapComponent_For_69_Template","MapComponent_Conditional_70_Template","ɵɵprojection","MapComponent_Conditional_72_Template","MapComponent_ng_template_73_Template","ɵɵtemplateRefExtractor","__decorate","Denounced","__metadata","MapModule","CommonModule","PipesModule","DirectivesModule","MatSnackBarModule","MatButtonModule","MatIconModule","FLEX","UNAVAILABLE","createHmac","secretKey","data","method","__async","enc","TextEncoder","key","crypto","subtle","importKey","encode","name","hash","signature","sign","btoa","String","fromCharCode","Uint8Array","ParkingCacheService","constructor","myParkings","Map","sec","inject","DomSanitizer","decorateParking","parking","assetImageUrl","safeAssetImage","bypassSecurityTrustResourceUrl","get","date","set","has","factory","ɵfac","providedIn","BookingService","constructor","map","inject","MapService","http","HttpClient","policy","PolicyService","profile","EmployeeService","auth","AuthService","cache","RequestCache","autoBooking","signal","undefined","myParkings","ParkingCacheService","bookingUpdated","bookingUpdated$","toObservable","holidays","Set","canBookWeekends","firstValueFrom","isLoggedIn$","pipe","filter","l","take","switchMap","getEmployee","then","emp","ensurePolicyLoaded","subscribe","getPolicy","PolicyType","WorkOnWeekends","value","getHollidays","date","getSelectedDay","Array","from","some","h","isSameYear","of","accessKey","secretKey","expires","Date","createHmac","toISOString","signature","environment","production","get","params","version","accesskey","timestamp","country","lang","year","getFullYear","toString","types","res","Error","JSON","stringify","errors","set","iso","getTime","sort","mapColors","r","addColor","icon","resourceNameAlias","nameAlias","resourceName","name","category","FLEX","color","UNAVAILABLE","identifier","entryType","entryID","resourceID","registerSubscription","sub","post","flatMap","mapID","markResourceID","config","URL","createObjectURL","currentDay","getToday","setSelectedDay","isSameDay","now","nextDayStartsAt","NextWorkdayStartsAt","reference","setHours","startOfDay","isAfter","addDays","getMaxBookingDate","entry","maxDay","addMonths","startDate","bookWorkdays","BookWorkdaysAhead","defaultPolicy","find","b","p","zoneID","myPolicies","zoneIDs","includes","length","max","Math","allocatedBookDaysAhead","bookDaysAhead","isUserInNeighborhood","allowDaysAhead","i","isWeekend","addSeconds","bookingToGroup","assetName","levelName","favorite","storeAsFavorite","parentEntryType","parentEntryID","isAutoBooking","storeAsAutoBooking","groupToBooking","g","bookingID","fromMs","toMs","withLunch","withParking","storeAsQuickBooking","quickBooking","sectionName","levelID","zoneName","assetImageUrl","groupToMapResource","resource","type","x","y","unavailable","selected","deepMerge","structuredClone","getCurrentTimeTuple","tuple","startOfSecond","endOfDay","getBookings","employeeID","__spreadValues","retryOn504","getHoursBooked","__async","bookings","toHoursBooked","reduce","acc","t","getHours","to","push","getQuickBooking","getAutoBooking","catchError","removeAutoBooking","delete","tap","invalidate","getFavorites","entryTypeFilter","hasFeature","Features","Unavailable","findIndex","unshift","titleCase","favoriteSortOrder","totalResourceCount","usedResourceCount","sortOrder","default","typeOrder","assetGroup","asset","section","level","zone","room","a","aOrder","bOrder","aType","bType","getFavoriteDetails","group","details","originalName","throwError","setFavoriteSortOrder","favorites","setFavoriteAlias","fav","setFavoriteIcon","toTimeString","times","formatHour","hour","timeTupleToHours","hourFrom","hourTo","timeTupleToHourString","getEntries","id","timeMs","share","toggleFavorite","flag","getBookedResources","getBookedResourceAvailability","resourceIDs","getResourceAvailability","time","curr","parse","weekend","occupied","_","bookResource","selectedSeat","forEach","doBooking$","every","autoBookings","differenceInDays","c","idx","Object","assign","day","bk","booking","employeeParking","dateMs","removeBookings","responseType","bookingIDs","compileOccupied","j","showColleagues","mapId","getNeighborhoods","factory","ɵfac","providedIn","__decorate","SharedObservable","emitOnce","__metadata","Observable"],"x_google_ignoreList":[5,6,7,8,9,10,11,12,13,14,15,18]}