\n\t`;\n}\n\nexport function renderVisitorRegistrationSuccess(): TemplateResult {\n\treturn html`\n\t\t ): TemplateResult {\n\tlet feedback = html``;\n\n\tif ( withErrors && 0 < withErrors.length ) {\n\t\tconst messagesHTML = withErrors.map( ( error, index ) => {\n\t\t\tif ( index === withErrors.length - 1 ) {\n\t\t\t\treturn html`${error}`;\n\t\t\t}\n\n\t\t\treturn html`${error}
`;\n\t\t} );\n\n\t\tfeedback = html`\n\t\t\t\n\t\t\t\t${messagesHTML}\n\t\t\t
\n\t\t`;\n\t}\n\n\tlet termsAndConditionsLinkHTML = html``;\n\tif ( window.translations.locationRegistrationForm.termsAndConditionsLink ) {\n\t\ttermsAndConditionsLinkHTML = html`\n\t\t\t\n\t\t\t\t${window.translations.locationRegistrationForm.termsAndConditionsLink.title}\n\t\t\t\n\t\t`;\n\t}\n\n\treturn html`\n\t\t\n\t`;\n}\n\nexport function renderLocationRegistrationSuccess(): TemplateResult {\n\treturn html`\n\t\t\n\t\t\t${window.translations.successMessages.ok}\n\t\t
\n\t`;\n}\n","import { render } from 'lit';\nimport { bugsnagClient } from '@mrhenry/wp--bugsnag-config';\nimport { init } from '@mrhenry/wp--mr-interactive';\nimport { MutationFeedback } from './data';\nimport { renderVisitorRegistrationForm, renderVisitorRegistrationSuccess } from './view';\nimport '../globals/globals';\n\nconst REGISTER_VISITOR_MUTATION = `\n\tmutation (\n\t\t$name: String!,\n\t\t$email: String!,\n\t\t$contactAboutFutureEditionsConsent: Boolean!,\n\t\t$additionalInformation: JSONObject!,\n\t\t$language: Language!,\n\t) {\n\t\tregisterVisitor(\n\t\t\tinput: {\n\t\t\t\tname: $name,\n\t\t\t\temail: $email,\n\t\t\t\tcontactAboutFutureEditionsConsent: $contactAboutFutureEditionsConsent,\n\t\t\t\tadditionalInformation: $additionalInformation\n\t\t\t},\n\t\t\tlanguage: $language\n\t\t)\n\t}\n`;\n\ntype RegistrationResult = {\n\tsuccess: boolean;\n\tmessages: string[];\n}\n\nfunction visitorRegistrationForm( parent: HTMLElement ) {\n\n\tasync function handleSubmit( event: Event ) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst form = event.target as HTMLFormElement;\n\t\tif ( !form ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst result = await submitData(\n\t\t\tform.firstName.value,\n\t\t\tform.lastName.value,\n\t\t\tform.email.value,\n\t\t\tform.phoneNumber.value,\n\t\t\tform.studentNumber.value,\n\t\t\tform.school.value,\n\t\t\tform.education.value,\n\t\t\tform.communicationOptIn.checked\n\t\t);\n\n\t\tif ( result && !result.success ) {\n\t\t\tconst withErrors = result.messages;\n\n\t\t\trender(\n\t\t\t\trenderVisitorRegistrationForm( handleSubmit, withErrors ),\n\t\t\t\tparent\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\trender(\n\t\t\trenderVisitorRegistrationSuccess(),\n\t\t\tparent\n\t\t);\n\n\t\tdocument.getElementById( 'visitor-registration-form' )?.scrollIntoView( {\n\t\t\tblock: 'start',\n\t\t} );\n\n\t\treturn;\n\t}\n\n\tasync function submitData(\n\t\tfirstName: string,\n\t\tlastName: string,\n\t\temail: string,\n\t\tphoneNumber: string,\n\t\tstudentNumber: string,\n\t\tschool: string,\n\t\teducation: string,\n\t\tcommunicationOptIn: boolean\n\t): Promise {\n\n\t\ttry {\n\t\t\tconst response = await fetch( 'https://study360-api.mrhenry.eu/graphql', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify( {\n\t\t\t\t\tquery: REGISTER_VISITOR_MUTATION,\n\t\t\t\t\tvariables: {\n\t\t\t\t\t\tname: firstName + ' ' + lastName,\n\t\t\t\t\t\temail: email,\n\t\t\t\t\t\tcontactAboutFutureEditionsConsent: communicationOptIn,\n\t\t\t\t\t\tadditionalInformation: {\n\t\t\t\t\t\t\tphoneNumber: phoneNumber,\n\t\t\t\t\t\t\tstudentNumber: studentNumber,\n\t\t\t\t\t\t\tschool: school,\n\t\t\t\t\t\t\teducation: education,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlanguage: document.documentElement.getAttribute( 'lang' )?.toUpperCase() || 'NL',\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\t\tif ( !response.ok ) {\n\t\t\t\tbugsnagClient.notify( new Error( `[study360 signup student] API Error: ${response.status}: ${response.statusText}` ) );\n\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\tmessages: [\n\t\t\t\t\t\twindow.translations.errorMessages.generic,\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst responseBody = await response.json();\n\n\t\t\tif ( responseBody.data.registerVisitor === MutationFeedback.OK ) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\tmessages: [],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tbugsnagClient.notify( new Error( `[study360 signup student] API Error: ${responseBody}` ) );\n\n\t\t\tconst messages: string[] = [];\n\t\t\tresponseBody.errors.forEach( ( message:string ) => {\n\t\t\t\tmessages.push( message );\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tmessages: messages,\n\t\t\t};\n\t\t} catch ( err ) {\n\t\t\tbugsnagClient.notify( err );\n\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tmessages: [\n\t\t\t\t\twindow.translations.errorMessages.generic,\n\t\t\t\t\terr,\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t}\n\n\trender(\n\t\trenderVisitorRegistrationForm( handleSubmit, [] ),\n\t\tparent\n\t);\n}\n\ninit( (): boolean => {\n\tconst visitorRegistrationElement = document.getElementById( 'visitor-registration-form' );\n\n\tif ( !visitorRegistrationElement ) {\n\t\treturn false;\n\t}\n\n\twhile ( visitorRegistrationElement.firstChild ) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tvisitorRegistrationElement.removeChild( visitorRegistrationElement.lastChild! );\n\t}\n\n\tvisitorRegistrationForm( visitorRegistrationElement );\n\n\treturn true;\n} );\n","import { render } from 'lit';\nimport { bugsnagClient } from '@mrhenry/wp--bugsnag-config';\nimport { init } from '@mrhenry/wp--mr-interactive';\nimport { MutationFeedback } from './data';\nimport { renderLocationRegistrationForm, renderLocationRegistrationSuccess } from './view';\n\nconst REGISTER_LOCATION_MUTATION = `\n\tmutation (\n\t\t$name: String!,\n\t\t$additionalInformation: JSONObject!\n\t) {\n\t\tregisterLocation(\n\t\t\tinput: {\n\t\t\t\tname: $name,\n\t\t\t\tadditionalInformation: $additionalInformation,\n\t\t\t}\n\t\t)\n\t}\n`;\n\ntype LocationRegistrationResult = {\n\tsuccess: boolean;\n\tmessages: string[];\n}\n\nfunction locationRegistrationForm( parent: HTMLElement ) {\n\n\tasync function handleSubmit( event: Event ) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst form = event.target as HTMLFormElement;\n\t\tif ( !form ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst servicesArray:Array = [];\n\t\tconst servicesOptions = form.querySelectorAll( '[name=\"services[]\"]' ) as NodeListOf;\n\t\tfor ( let i = 0; i < servicesOptions.length; i++ ) {\n\t\t\tif ( servicesOptions[i].checked ) {\n\t\t\t\tservicesArray.push( servicesOptions[i].value );\n\t\t\t}\n\t\t}\n\n\t\tconst result = await submitData(\n\t\t\tform.email.value,\n\t\t\tform.organizationName.value,\n\t\t\tform.contactPerson.value,\n\t\t\tform.location.value,\n\t\t\tform.description.value,\n\t\t\tform.capacity.value,\n\t\t\tform.openingHours.value,\n\t\t\tservicesArray\n\t\t);\n\n\t\tif ( result && !result.success ) {\n\t\t\tconst withErrors = result.messages;\n\n\t\t\trender(\n\t\t\t\trenderLocationRegistrationForm( handleSubmit, withErrors ),\n\t\t\t\tparent\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\trender(\n\t\t\trenderLocationRegistrationSuccess(),\n\t\t\tparent\n\t\t);\n\n\t\tdocument.getElementById( 'location-registration-form' )?.scrollIntoView( {\n\t\t\tblock: 'start',\n\t\t} );\n\n\t\treturn;\n\t}\n\n\tasync function submitData(\n\t\temail: string,\n\t\torganizationName: string,\n\t\tcontactPerson: string,\n\t\tlocation: string,\n\t\tdescription: string,\n\t\tcapacity: string,\n\t\topeningHours: string,\n\t\tservices: Array\n\t): Promise {\n\t\ttry {\n\t\t\tconst response = await fetch( 'https://study360-api.mrhenry.eu/graphql', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify( {\n\t\t\t\t\tquery: REGISTER_LOCATION_MUTATION,\n\t\t\t\t\tvariables: {\n\t\t\t\t\t\tname: organizationName,\n\t\t\t\t\t\tadditionalInformation: {\n\t\t\t\t\t\t\temail: email,\n\t\t\t\t\t\t\torganizationName: organizationName,\n\t\t\t\t\t\t\tcontactPerson: contactPerson,\n\t\t\t\t\t\t\tlocation: location,\n\t\t\t\t\t\t\tdescription: description,\n\t\t\t\t\t\t\tcapacity: capacity,\n\t\t\t\t\t\t\topeningHours: openingHours,\n\t\t\t\t\t\t\tservices: services,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\t\tif ( !response.ok ) {\n\t\t\t\tbugsnagClient.notify( new Error() );\n\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\tmessages: [\n\t\t\t\t\t\twindow.translations.errorMessages.generic,\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst responseBody = await response.json();\n\n\t\t\tif ( responseBody.data.registerLocation === MutationFeedback.OK ) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\tmessages: [],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tbugsnagClient.notify( new Error() );\n\n\t\t\tconst messages: string[] = [];\n\t\t\tresponseBody.errors.forEach( ( message: string ) => {\n\t\t\t\tmessages.push( message );\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tmessages: messages,\n\t\t\t};\n\n\t\t} catch ( err ) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tmessages: [\n\t\t\t\t\twindow.translations.errorMessages.generic,\n\t\t\t\t\terr,\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t}\n\n\trender(\n\t\trenderLocationRegistrationForm( handleSubmit, [] ),\n\t\tparent\n\t);\n}\n\ninit( (): boolean => {\n\tconst locationRegistrationElement = document.getElementById( 'location-registration-form' );\n\n\tif ( !locationRegistrationElement ) {\n\t\treturn false;\n\t}\n\n\twhile ( locationRegistrationElement.firstChild ) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tlocationRegistrationElement.removeChild( locationRegistrationElement.lastChild! );\n\t}\n\n\tlocationRegistrationForm( locationRegistrationElement );\n\n\treturn true;\n} );\n",";(function(){ try { var _reflectConstructHack = Reflect.construct } catch(err) {} })();\n(function(){\n/*\n\n Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n This code may only be used under the BSD style license found at\n http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n Google as part of the polymer project is also subject to an additional IP\n rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';var n=window.Document.prototype.createElement,p=window.Document.prototype.createElementNS,aa=window.Document.prototype.importNode,ba=window.Document.prototype.prepend,ca=window.Document.prototype.append,da=window.DocumentFragment.prototype.prepend,ea=window.DocumentFragment.prototype.append,q=window.Node.prototype.cloneNode,r=window.Node.prototype.appendChild,t=window.Node.prototype.insertBefore,u=window.Node.prototype.removeChild,v=window.Node.prototype.replaceChild,w=Object.getOwnPropertyDescriptor(window.Node.prototype,\n\"textContent\"),y=window.Element.prototype.attachShadow,z=Object.getOwnPropertyDescriptor(window.Element.prototype,\"innerHTML\"),A=window.Element.prototype.getAttribute,B=window.Element.prototype.setAttribute,C=window.Element.prototype.removeAttribute,D=window.Element.prototype.toggleAttribute,E=window.Element.prototype.getAttributeNS,F=window.Element.prototype.setAttributeNS,G=window.Element.prototype.removeAttributeNS,H=window.Element.prototype.insertAdjacentElement,fa=window.Element.prototype.insertAdjacentHTML,\nha=window.Element.prototype.prepend,ia=window.Element.prototype.append,ja=window.Element.prototype.before,ka=window.Element.prototype.after,la=window.Element.prototype.replaceWith,ma=window.Element.prototype.remove,na=window.HTMLElement,I=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,\"innerHTML\"),oa=window.HTMLElement.prototype.insertAdjacentElement,pa=window.HTMLElement.prototype.insertAdjacentHTML;var qa=new Set;\"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph\".split(\" \").forEach(function(a){return qa.add(a)});function ra(a){var b=qa.has(a);a=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(a);return!b&&a}var sa=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);\nfunction J(a){var b=a.isConnected;if(void 0!==b)return b;if(sa(a))return!0;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))}function K(a){var b=a.children;if(b)return Array.prototype.slice.call(b);b=[];for(a=a.firstChild;a;a=a.nextSibling)a.nodeType===Node.ELEMENT_NODE&&b.push(a);return b}\nfunction L(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null}\nfunction M(a,b,d){for(var f=a;f;){if(f.nodeType===Node.ELEMENT_NODE){var c=f;b(c);var e=c.localName;if(\"link\"===e&&\"import\"===c.getAttribute(\"rel\")){f=c.import;void 0===d&&(d=new Set);if(f instanceof Node&&!d.has(f))for(d.add(f),f=f.firstChild;f;f=f.nextSibling)M(f,b,d);f=L(a,c);continue}else if(\"template\"===e){f=L(a,c);continue}if(c=c.__CE_shadowRoot)for(c=c.firstChild;c;c=c.nextSibling)M(c,b,d)}f=f.firstChild?f.firstChild:L(a,f)}};function N(){var a=!(null===O||void 0===O||!O.noDocumentConstructionObserver),b=!(null===O||void 0===O||!O.shadyDomFastWalk);this.m=[];this.g=[];this.j=!1;this.shadyDomFastWalk=b;this.I=!a}function P(a,b,d,f){var c=window.ShadyDOM;if(a.shadyDomFastWalk&&c&&c.inUse){if(b.nodeType===Node.ELEMENT_NODE&&d(b),b.querySelectorAll)for(a=c.nativeMethods.querySelectorAll.call(b,\"*\"),b=0;b}\n\t\t\t* All managed focusable nodes in this InertRoot's subtree.\n\t\t\t*/\n\t\t\tthis._managedNodes = new Set();\n\n\t\t\t// Make the subtree hidden from assistive technology\n\t\t\tif (this._rootElement.hasAttribute('aria-hidden')) {\n\t\t\t\t/** @type {?string} */\n\t\t\t\tthis._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');\n\t\t\t} else {\n\t\t\t\tthis._savedAriaHidden = null;\n\t\t\t}\n\t\t\tthis._rootElement.setAttribute('aria-hidden', 'true');\n\n\t\t\t// Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n\t\t\tthis._makeSubtreeUnfocusable(this._rootElement);\n\n\t\t\t// Watch for:\n\t\t\t// - any additions in the subtree: make them unfocusable too\n\t\t\t// - any removals from the subtree: remove them from this inert root's managed nodes\n\t\t\t// - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable\n\t\t\t// element, make that node a managed node.\n\t\t\tthis._observer = new MutationObserver(this._onMutation.bind(this));\n\t\t\tthis._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });\n\t\t}\n\n\t\t/**\n\t\t* Call this whenever this object is about to become obsolete. This unwinds all of the state\n\t\t* stored in this object and updates the state of all of the managed nodes.\n\t\t*/\n\n\n\t\t_createClass(InertRoot, [{\n\t\t\tkey: 'destructor',\n\t\t\tvalue: function destructor() {\n\t\t\t\tthis._observer.disconnect();\n\n\t\t\t\tif (this._rootElement) {\n\t\t\t\t\tif (this._savedAriaHidden !== null) {\n\t\t\t\t\t\tthis._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._rootElement.removeAttribute('aria-hidden');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._managedNodes.forEach(function (inertNode) {\n\t\t\t\t\tthis._unmanageNode(inertNode.node);\n\t\t\t\t}, this);\n\n\t\t\t\t// Note we cast the nulls to the ANY type here because:\n\t\t\t\t// 1) We want the class properties to be declared as non-null, or else we\n\t\t\t\t// need even more casts throughout this code. All bets are off if an\n\t\t\t\t// instance has been destroyed and a method is called.\n\t\t\t\t// 2) We don't want to cast \"this\", because we want type-aware optimizations\n\t\t\t\t// to know which properties we're setting.\n\t\t\t\tthis._observer = /** @type {?} */null;\n\t\t\t\tthis._rootElement = /** @type {?} */null;\n\t\t\t\tthis._managedNodes = /** @type {?} */null;\n\t\t\t\tthis._inertManager = /** @type {?} */null;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* @return {!Set} A copy of this InertRoot's managed nodes set.\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_makeSubtreeUnfocusable',\n\n\n\t\t\t/**\n\t\t\t* @param {!Node} startNode\n\t\t\t*/\n\t\t\tvalue: function _makeSubtreeUnfocusable(startNode) {\n\t\t\t\tvar _this2 = this;\n\n\t\t\t\tcomposedTreeWalk(startNode, function (node) {\n\t\t\t\t\treturn _this2._visitNode(node);\n\t\t\t\t});\n\n\t\t\t\tvar activeElement = document.activeElement;\n\n\t\t\t\tif (!document.body.contains(startNode)) {\n\t\t\t\t\t// startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.\n\t\t\t\t\tvar node = startNode;\n\t\t\t\t\t/** @type {!ShadowRoot|undefined} */\n\t\t\t\t\tvar root = undefined;\n\t\t\t\t\twhile (node) {\n\t\t\t\t\t\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\t\t\t\t\t\troot = /** @type {!ShadowRoot} */node;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode = node.parentNode;\n\t\t\t\t\t}\n\t\t\t\t\tif (root) {\n\t\t\t\t\t\tactiveElement = root.activeElement;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (startNode.contains(activeElement)) {\n\t\t\t\t\tactiveElement.blur();\n\t\t\t\t\t// In IE11, if an element is already focused, and then set to tabindex=-1\n\t\t\t\t\t// calling blur() will not actually move the focus.\n\t\t\t\t\t// To work around this we call focus() on the body instead.\n\t\t\t\t\tif (activeElement === document.activeElement) {\n\t\t\t\t\t\tdocument.body.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* @param {!Node} node\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_visitNode',\n\t\t\tvalue: function _visitNode(node) {\n\t\t\t\tif (node.nodeType !== Node.ELEMENT_NODE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar element = /** @type {!HTMLElement} */node;\n\n\t\t\t\t// If a descendant inert root becomes un-inert, its descendants will still be inert because of\n\t\t\t\t// this inert root, so all of its managed nodes need to be adopted by this InertRoot.\n\t\t\t\tif (element !== this._rootElement && element.hasAttribute('inert')) {\n\t\t\t\t\tthis._adoptInertRoot(element);\n\t\t\t\t}\n\n\t\t\t\tif (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {\n\t\t\t\t\tthis._manageNode(element);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Register the given node with this InertRoot and with InertManager.\n\t\t\t* @param {!Node} node\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_manageNode',\n\t\t\tvalue: function _manageNode(node) {\n\t\t\t\tvar inertNode = this._inertManager.register(node, this);\n\t\t\t\tthis._managedNodes.add(inertNode);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Unregister the given node with this InertRoot and with InertManager.\n\t\t\t* @param {!Node} node\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_unmanageNode',\n\t\t\tvalue: function _unmanageNode(node) {\n\t\t\t\tvar inertNode = this._inertManager.deregister(node, this);\n\t\t\t\tif (inertNode) {\n\t\t\t\t\tthis._managedNodes.delete(inertNode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Unregister the entire subtree starting at `startNode`.\n\t\t\t* @param {!Node} startNode\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_unmanageSubtree',\n\t\t\tvalue: function _unmanageSubtree(startNode) {\n\t\t\t\tvar _this3 = this;\n\n\t\t\t\tcomposedTreeWalk(startNode, function (node) {\n\t\t\t\t\treturn _this3._unmanageNode(node);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* If a descendant node is found with an `inert` attribute, adopt its managed nodes.\n\t\t\t* @param {!HTMLElement} node\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_adoptInertRoot',\n\t\t\tvalue: function _adoptInertRoot(node) {\n\t\t\t\tvar inertSubroot = this._inertManager.getInertRoot(node);\n\n\t\t\t\t// During initialisation this inert root may not have been registered yet,\n\t\t\t\t// so register it now if need be.\n\t\t\t\tif (!inertSubroot) {\n\t\t\t\t\tthis._inertManager.setInert(node, true);\n\t\t\t\t\tinertSubroot = this._inertManager.getInertRoot(node);\n\t\t\t\t}\n\n\t\t\t\tinertSubroot.managedNodes.forEach(function (savedInertNode) {\n\t\t\t\t\tthis._manageNode(savedInertNode.node);\n\t\t\t\t}, this);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Callback used when mutation observer detects subtree additions, removals, or attribute changes.\n\t\t\t* @param {!Array} records\n\t\t\t* @param {!MutationObserver} self\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_onMutation',\n\t\t\tvalue: function _onMutation(records, _self) {\n\t\t\t\trecords.forEach(function (record) {\n\t\t\t\t\tvar target = /** @type {!HTMLElement} */record.target;\n\t\t\t\t\tif (record.type === 'childList') {\n\t\t\t\t\t\t// Manage added nodes\n\t\t\t\t\t\tslice.call(record.addedNodes).forEach(function (node) {\n\t\t\t\t\t\t\tthis._makeSubtreeUnfocusable(node);\n\t\t\t\t\t\t}, this);\n\n\t\t\t\t\t\t// Un-manage removed nodes\n\t\t\t\t\t\tslice.call(record.removedNodes).forEach(function (node) {\n\t\t\t\t\t\t\tthis._unmanageSubtree(node);\n\t\t\t\t\t\t}, this);\n\t\t\t\t\t} else if (record.type === 'attributes') {\n\t\t\t\t\t\tif (record.attributeName === 'tabindex') {\n\t\t\t\t\t\t\t// Re-initialise inert node if tabindex changes\n\t\t\t\t\t\t\tthis._manageNode(target);\n\t\t\t\t\t\t} else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {\n\t\t\t\t\t\t\t// If a new inert root is added, adopt its managed nodes and make sure it knows about the\n\t\t\t\t\t\t\t// already managed nodes from this inert subroot.\n\t\t\t\t\t\t\tthis._adoptInertRoot(target);\n\t\t\t\t\t\t\tvar inertSubroot = this._inertManager.getInertRoot(target);\n\t\t\t\t\t\t\tthis._managedNodes.forEach(function (managedNode) {\n\t\t\t\t\t\t\t\tif (target.contains(managedNode.node)) {\n\t\t\t\t\t\t\t\t\tinertSubroot._manageNode(managedNode.node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\t\t\t}\n\t\t}, {\n\t\t\tkey: 'managedNodes',\n\t\t\tget: function get() {\n\t\t\t\treturn new Set(this._managedNodes);\n\t\t\t}\n\n\t\t\t/** @return {boolean} */\n\n\t\t}, {\n\t\t\tkey: 'hasSavedAriaHidden',\n\t\t\tget: function get() {\n\t\t\t\treturn this._savedAriaHidden !== null;\n\t\t\t}\n\n\t\t\t/** @param {?string} ariaHidden */\n\n\t\t}, {\n\t\t\tkey: 'savedAriaHidden',\n\t\t\tset: function set(ariaHidden) {\n\t\t\t\tthis._savedAriaHidden = ariaHidden;\n\t\t\t}\n\n\t\t\t/** @return {?string} */\n\t\t\t,\n\t\t\tget: function get() {\n\t\t\t\treturn this._savedAriaHidden;\n\t\t\t}\n\t\t}]);\n\n\t\treturn InertRoot;\n\t}();\n\n\t/**\n\t* `InertNode` initialises and manages a single inert node.\n\t* A node is inert if it is a descendant of one or more inert root elements.\n\t*\n\t* On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and\n\t* either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element\n\t* is intrinsically focusable or not.\n\t*\n\t* `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an\n\t* `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the\n\t* `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s\n\t* remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,\n\t* or removes the `tabindex` attribute if the element is intrinsically focusable.\n\t*/\n\n\n\tvar InertNode = function () {\n\t\t/**\n\t\t* @param {!Node} node A focusable element to be made inert.\n\t\t* @param {!InertRoot} inertRoot The inert root element associated with this inert node.\n\t\t*/\n\t\tfunction InertNode(node, inertRoot) {\n\t\t\t_classCallCheck(this, InertNode);\n\n\t\t\t/** @type {!Node} */\n\t\t\tthis._node = node;\n\n\t\t\t/** @type {boolean} */\n\t\t\tthis._overrodeFocusMethod = false;\n\n\t\t\t/**\n\t\t\t* @type {!Set} The set of descendant inert roots.\n\t\t\t* If and only if this set becomes empty, this node is no longer inert.\n\t\t\t*/\n\t\t\tthis._inertRoots = new Set([inertRoot]);\n\n\t\t\t/** @type {?number} */\n\t\t\tthis._savedTabIndex = null;\n\n\t\t\t/** @type {boolean} */\n\t\t\tthis._destroyed = false;\n\n\t\t\t// Save any prior tabindex info and make this node untabbable\n\t\t\tthis.ensureUntabbable();\n\t\t}\n\n\t\t/**\n\t\t* Call this whenever this object is about to become obsolete.\n\t\t* This makes the managed node focusable again and deletes all of the previously stored state.\n\t\t*/\n\n\n\t\t_createClass(InertNode, [{\n\t\t\tkey: 'destructor',\n\t\t\tvalue: function destructor() {\n\t\t\t\tthis._throwIfDestroyed();\n\n\t\t\t\tif (this._node && this._node.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\tvar element = /** @type {!HTMLElement} */this._node;\n\t\t\t\t\tif (this._savedTabIndex !== null) {\n\t\t\t\t\t\telement.setAttribute('tabindex', this._savedTabIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.removeAttribute('tabindex');\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use `delete` to restore native focus method.\n\t\t\t\t\tif (this._overrodeFocusMethod) {\n\t\t\t\t\t\tdelete element.focus;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// See note in InertRoot.destructor for why we cast these nulls to ANY.\n\t\t\t\tthis._node = /** @type {?} */null;\n\t\t\t\tthis._inertRoots = /** @type {?} */null;\n\t\t\t\tthis._destroyed = true;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* @type {boolean} Whether this object is obsolete because the managed node is no longer inert.\n\t\t\t* If the object has been destroyed, any attempt to access it will cause an exception.\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_throwIfDestroyed',\n\n\n\t\t\t/**\n\t\t\t* Throw if user tries to access destroyed InertNode.\n\t\t\t*/\n\t\t\tvalue: function _throwIfDestroyed() {\n\t\t\t\tif (this.destroyed) {\n\t\t\t\t\tthrow new Error('Trying to access destroyed InertNode');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @return {boolean} */\n\n\t\t}, {\n\t\t\tkey: 'ensureUntabbable',\n\n\n\t\t\t/** Save the existing tabindex value and make the node untabbable and unfocusable */\n\t\t\tvalue: function ensureUntabbable() {\n\t\t\t\tif (this.node.nodeType !== Node.ELEMENT_NODE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar element = /** @type {!HTMLElement} */this.node;\n\t\t\t\tif (matches.call(element, _focusableElementsString)) {\n\t\t\t\t\tif ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (element.hasAttribute('tabindex')) {\n\t\t\t\t\t\tthis._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n\t\t\t\t\t}\n\t\t\t\t\telement.setAttribute('tabindex', '-1');\n\t\t\t\t\tif (element.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\telement.focus = function () {};\n\t\t\t\t\t\tthis._overrodeFocusMethod = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (element.hasAttribute('tabindex')) {\n\t\t\t\t\tthis._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n\t\t\t\t\telement.removeAttribute('tabindex');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Add another inert root to this inert node's set of managing inert roots.\n\t\t\t* @param {!InertRoot} inertRoot\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: 'addInertRoot',\n\t\t\tvalue: function addInertRoot(inertRoot) {\n\t\t\t\tthis._throwIfDestroyed();\n\t\t\t\tthis._inertRoots.add(inertRoot);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Remove the given inert root from this inert node's set of managing inert roots.\n\t\t\t* If the set of managing inert roots becomes empty, this node is no longer inert,\n\t\t\t* so the object should be destroyed.\n\t\t\t* @param {!InertRoot} inertRoot\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: 'removeInertRoot',\n\t\t\tvalue: function removeInertRoot(inertRoot) {\n\t\t\t\tthis._throwIfDestroyed();\n\t\t\t\tthis._inertRoots.delete(inertRoot);\n\t\t\t\tif (this._inertRoots.size === 0) {\n\t\t\t\t\tthis.destructor();\n\t\t\t\t}\n\t\t\t}\n\t\t}, {\n\t\t\tkey: 'destroyed',\n\t\t\tget: function get() {\n\t\t\t\treturn (/** @type {!InertNode} */this._destroyed\n\t\t\t\t);\n\t\t\t}\n\t\t}, {\n\t\t\tkey: 'hasSavedTabIndex',\n\t\t\tget: function get() {\n\t\t\t\treturn this._savedTabIndex !== null;\n\t\t\t}\n\n\t\t\t/** @return {!Node} */\n\n\t\t}, {\n\t\t\tkey: 'node',\n\t\t\tget: function get() {\n\t\t\t\tthis._throwIfDestroyed();\n\t\t\t\treturn this._node;\n\t\t\t}\n\n\t\t\t/** @param {?number} tabIndex */\n\n\t\t}, {\n\t\t\tkey: 'savedTabIndex',\n\t\t\tset: function set(tabIndex) {\n\t\t\t\tthis._throwIfDestroyed();\n\t\t\t\tthis._savedTabIndex = tabIndex;\n\t\t\t}\n\n\t\t\t/** @return {?number} */\n\t\t\t,\n\t\t\tget: function get() {\n\t\t\t\tthis._throwIfDestroyed();\n\t\t\t\treturn this._savedTabIndex;\n\t\t\t}\n\t\t}]);\n\n\t\treturn InertNode;\n\t}();\n\n\t/**\n\t* InertManager is a per-document singleton object which manages all inert roots and nodes.\n\t*\n\t* When an element becomes an inert root by having an `inert` attribute set and/or its `inert`\n\t* property set to `true`, the `setInert` method creates an `InertRoot` object for the element.\n\t* The `InertRoot` in turn registers itself as managing all of the element's focusable descendant\n\t* nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance\n\t* is created for each such node, via the `_managedNodes` map.\n\t*/\n\n\n\tvar InertManager = function () {\n\t\t/**\n\t\t* @param {!Document} document\n\t\t*/\n\t\tfunction InertManager(document) {\n\t\t\t_classCallCheck(this, InertManager);\n\n\t\t\tif (!document) {\n\t\t\t\tthrow new Error('Missing required argument; InertManager needs to wrap a document.');\n\t\t\t}\n\n\t\t\t/** @type {!Document} */\n\t\t\tthis._document = document;\n\n\t\t\t/**\n\t\t\t* All managed nodes known to this InertManager. In a map to allow looking up by Node.\n\t\t\t* @type {!Map}\n\t\t\t*/\n\t\t\tthis._managedNodes = new Map();\n\n\t\t\t/**\n\t\t\t* All inert roots known to this InertManager. In a map to allow looking up by Node.\n\t\t\t* @type {!Map}\n\t\t\t*/\n\t\t\tthis._inertRoots = new Map();\n\n\t\t\t/**\n\t\t\t* Observer for mutations on `document.body`.\n\t\t\t* @type {!MutationObserver}\n\t\t\t*/\n\t\t\tthis._observer = new MutationObserver(this._watchForInert.bind(this));\n\n\t\t\t// Add inert style.\n\t\t\taddInertStyle(document.head || document.body || document.documentElement);\n\n\t\t\t// Wait for document to be loaded.\n\t\t\tif (document.readyState === 'loading') {\n\t\t\t\tdocument.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));\n\t\t\t} else {\n\t\t\t\tthis._onDocumentLoaded();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Set whether the given element should be an inert root or not.\n\t\t* @param {!HTMLElement} root\n\t\t* @param {boolean} inert\n\t\t*/\n\n\n\t\t_createClass(InertManager, [{\n\t\t\tkey: 'setInert',\n\t\t\tvalue: function setInert(root, inert) {\n\t\t\t\tif (inert) {\n\t\t\t\t\tif (this._inertRoots.has(root)) {\n\t\t\t\t\t\t// element is already inert\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar inertRoot = new InertRoot(root, this);\n\t\t\t\t\troot.setAttribute('inert', '');\n\t\t\t\t\tthis._inertRoots.set(root, inertRoot);\n\t\t\t\t\t// If not contained in the document, it must be in a shadowRoot.\n\t\t\t\t\t// Ensure inert styles are added there.\n\t\t\t\t\tif (!this._document.body.contains(root)) {\n\t\t\t\t\t\tvar parent = root.parentNode;\n\t\t\t\t\t\twhile (parent) {\n\t\t\t\t\t\t\tif (parent.nodeType === 11) {\n\t\t\t\t\t\t\t\taddInertStyle(parent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!this._inertRoots.has(root)) {\n\t\t\t\t\t\t// element is already non-inert\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar _inertRoot = this._inertRoots.get(root);\n\t\t\t\t\t_inertRoot.destructor();\n\t\t\t\t\tthis._inertRoots.delete(root);\n\t\t\t\t\troot.removeAttribute('inert');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Get the InertRoot object corresponding to the given inert root element, if any.\n\t\t\t* @param {!Node} element\n\t\t\t* @return {!InertRoot|undefined}\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: 'getInertRoot',\n\t\t\tvalue: function getInertRoot(element) {\n\t\t\t\treturn this._inertRoots.get(element);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Register the given InertRoot as managing the given node.\n\t\t\t* In the case where the node has a previously existing inert root, this inert root will\n\t\t\t* be added to its set of inert roots.\n\t\t\t* @param {!Node} node\n\t\t\t* @param {!InertRoot} inertRoot\n\t\t\t* @return {!InertNode} inertNode\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: 'register',\n\t\t\tvalue: function register(node, inertRoot) {\n\t\t\t\tvar inertNode = this._managedNodes.get(node);\n\t\t\t\tif (inertNode !== undefined) {\n\t\t\t\t\t// node was already in an inert subtree\n\t\t\t\t\tinertNode.addInertRoot(inertRoot);\n\t\t\t\t} else {\n\t\t\t\t\tinertNode = new InertNode(node, inertRoot);\n\t\t\t\t}\n\n\t\t\t\tthis._managedNodes.set(node, inertNode);\n\n\t\t\t\treturn inertNode;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* De-register the given InertRoot as managing the given inert node.\n\t\t\t* Removes the inert root from the InertNode's set of managing inert roots, and remove the inert\n\t\t\t* node from the InertManager's set of managed nodes if it is destroyed.\n\t\t\t* If the node is not currently managed, this is essentially a no-op.\n\t\t\t* @param {!Node} node\n\t\t\t* @param {!InertRoot} inertRoot\n\t\t\t* @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: 'deregister',\n\t\t\tvalue: function deregister(node, inertRoot) {\n\t\t\t\tvar inertNode = this._managedNodes.get(node);\n\t\t\t\tif (!inertNode) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tinertNode.removeInertRoot(inertRoot);\n\t\t\t\tif (inertNode.destroyed) {\n\t\t\t\t\tthis._managedNodes.delete(node);\n\t\t\t\t}\n\n\t\t\t\treturn inertNode;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Callback used when document has finished loading.\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_onDocumentLoaded',\n\t\t\tvalue: function _onDocumentLoaded() {\n\t\t\t\t// Find all inert roots in document and make them actually inert.\n\t\t\t\tvar inertElements = slice.call(this._document.querySelectorAll('[inert]'));\n\t\t\t\tinertElements.forEach(function (inertElement) {\n\t\t\t\t\tthis.setInert(inertElement, true);\n\t\t\t\t}, this);\n\n\t\t\t\t// Comment this out to use programmatic API only.\n\t\t\t\tthis._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true });\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Callback used when mutation observer detects attribute changes.\n\t\t\t* @param {!Array} records\n\t\t\t* @param {!MutationObserver} self\n\t\t\t*/\n\n\t\t}, {\n\t\t\tkey: '_watchForInert',\n\t\t\tvalue: function _watchForInert(records, _self) {\n\t\t\t\tvar _this = this;\n\t\t\t\trecords.forEach(function (record) {\n\t\t\t\t\tswitch (record.type) {\n\t\t\t\t\t\tcase 'childList':\n\t\t\t\t\t\t\tslice.call(record.addedNodes).forEach(function (node) {\n\t\t\t\t\t\t\t\tif (node.nodeType !== Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar inertElements = slice.call(node.querySelectorAll('[inert]'));\n\t\t\t\t\t\t\t\tif (matches.call(node, '[inert]')) {\n\t\t\t\t\t\t\t\t\tinertElements.unshift(node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tinertElements.forEach(function (inertElement) {\n\t\t\t\t\t\t\t\t\tthis.setInert(inertElement, true);\n\t\t\t\t\t\t\t\t}, _this);\n\t\t\t\t\t\t\t}, _this);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'attributes':\n\t\t\t\t\t\t\tif (record.attributeName !== 'inert') {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar target = /** @type {!HTMLElement} */record.target;\n\t\t\t\t\t\t\tvar inert = target.hasAttribute('inert');\n\t\t\t\t\t\t\t_this.setInert(target, inert);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\t\t\t}\n\t\t}]);\n\n\t\treturn InertManager;\n\t}();\n\n\t/**\n\t* Recursively walk the composed tree from |node|.\n\t* @param {!Node} node\n\t* @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed,\n\t* before descending into child nodes.\n\t* @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.\n\t*/\n\n\n\tfunction composedTreeWalk(node, callback, shadowRootAncestor) {\n\t\tif (node.nodeType == Node.ELEMENT_NODE) {\n\t\t\tvar element = /** @type {!HTMLElement} */node;\n\t\t\tif (callback) {\n\t\t\t\tcallback(element);\n\t\t\t}\n\n\t\t\t// Descend into node:\n\t\t\t// If it has a ShadowRoot, ignore all child elements - these will be picked\n\t\t\t// up by the or elements. Descend straight into the\n\t\t\t// ShadowRoot.\n\t\t\tvar shadowRoot = /** @type {!HTMLElement} */element.shadowRoot;\n\t\t\tif (shadowRoot) {\n\t\t\t\tcomposedTreeWalk(shadowRoot, callback, shadowRoot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If it is a element, descend into distributed elements - these\n\t\t\t// are elements from outside the shadow root which are rendered inside the\n\t\t\t// shadow DOM.\n\t\t\tif (element.localName == 'content') {\n\t\t\t\tvar content = /** @type {!HTMLContentElement} */element;\n\t\t\t\t// Verifies if ShadowDom v0 is supported.\n\t\t\t\tvar distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];\n\t\t\t\tfor (var i = 0; i < distributedNodes.length; i++) {\n\t\t\t\t\tcomposedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If it is a element, descend into assigned nodes - these\n\t\t\t// are elements from outside the shadow root which are rendered inside the\n\t\t\t// shadow DOM.\n\t\t\tif (element.localName == 'slot') {\n\t\t\t\tvar slot = /** @type {!HTMLSlotElement} */element;\n\t\t\t\t// Verify if ShadowDom v1 is supported.\n\t\t\t\tvar _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : [];\n\t\t\t\tfor (var _i = 0; _i < _distributedNodes.length; _i++) {\n\t\t\t\t\tcomposedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If it is neither the parent of a ShadowRoot, a element, a \n\t\t// element, nor a element recurse normally.\n\t\tvar child = node.firstChild;\n\t\twhile (child != null) {\n\t\t\tcomposedTreeWalk(child, callback, shadowRootAncestor);\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\n\t/**\n\t* Adds a style element to the node containing the inert specific styles\n\t* @param {!Node} node\n\t*/\n\tfunction addInertStyle(node) {\n\t\tif (node.querySelector('style#inert-style, link#inert-style')) {\n\t\t\treturn;\n\t\t}\n\t\tvar style = document.createElement('style');\n\t\tstyle.setAttribute('id', 'inert-style');\n\t\tstyle.textContent = '\\n' + '[inert] {\\n' + ' pointer-events: none;\\n' + ' cursor: default;\\n' + '}\\n' + '\\n' + '[inert], [inert] * {\\n' + ' -webkit-user-select: none;\\n' + ' -moz-user-select: none;\\n' + ' -ms-user-select: none;\\n' + ' user-select: none;\\n' + '}\\n';\n\t\tnode.appendChild(style);\n\t}\n\n\t// eslint-disable-next-line no-prototype-builtins\n\tif (!HTMLElement.prototype.hasOwnProperty('inert')) {\n\t\t/** @type {!InertManager} */\n\t\tvar inertManager = new InertManager(document);\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'inert', {\n\t\t\tenumerable: true,\n\t\t\t/** @this {!HTMLElement} */\n\t\t\tget: function get() {\n\t\t\t\treturn this.hasAttribute('inert');\n\t\t\t},\n\t\t\t/** @this {!HTMLElement} */\n\t\t\tset: function set(inert) {\n\t\t\t\tinertManager.setInert(this, inert);\n\t\t\t}\n\t\t});\n\t}\n\t})();\n\n})));\n}}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});\n","/** Simple accordion pattern\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/examples/accordion/accordion.html\n */\n\nexport class MrAccordion extends HTMLElement {\n\t// Handle click events\n\t#clickHandler = ( event: MouseEvent ): void => {\n\t\tconst target = event.target;\n\n\t\tif ( !target || !( target instanceof Element ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !target.hasAttribute( 'accordion-trigger' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handled = this.handleToggleEvent( target, false );\n\t\tif ( handled ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t};\n\n\t#beforeMatchHandler = ( event: Event ): void => {\n\t\tif ( !event.target ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !( event.target instanceof Element ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst trigger = this.findTriggerFromPanelContents( event.target );\n\t\tif ( trigger ) {\n\t\t\tthis.handleToggleEvent( trigger, true );\n\t\t}\n\t};\n\n\tconstructor() {\n\t\t/** If you define a constructor, always call super() first!\n\t\t * This is specific to CE and required by the spec.\n\t\t */\n\t\tsuper();\n\t}\n\n\t// Life cycle\n\tconnectedCallback() :void {\n\t\tthis._addEventListeners();\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis._removeEventListeners();\n\t}\n\n\t_addEventListeners(): void {\n\t\tthis.addEventListener( 'click', this.#clickHandler );\n\t\tthis.addEventListener( 'beforematch', this.#beforeMatchHandler );\n\t\taddKeypressEventListener( this.tagName );\n\t}\n\n\t_removeEventListeners(): void {\n\t\tthis.removeEventListener( 'click', this.#clickHandler );\n\t\tthis.removeEventListener( 'beforematch', this.#beforeMatchHandler );\n\t}\n\n\thandleToggleEvent( trigger: Element, onlyOpen: boolean ): boolean {\n\t\tif ( !trigger.hasAttribute( 'accordion-trigger' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only use events from current mr-accordion\n\t\tif (\n\t\t\t!trigger.getAttribute( 'accordion' ) ||\n\t\t\t( trigger.getAttribute( 'accordion' ) !== this.id )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isExpanded = 'true' === trigger.getAttribute( 'aria-expanded' );\n\n\t\tif ( !isExpanded ) { // Open panel\n\t\t\t// Set the expanded state on the triggering element\n\t\t\ttrigger.setAttribute( 'aria-expanded', 'true' );\n\n\t\t\t// Hide the accordion sections, using the 'for'-attribute to specify the desired section\n\t\t\tconst panel = this.querySelector( '#' + trigger.getAttribute( 'for' ) );\n\n\t\t\tif ( !panel ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpanel.inert = false;\n\t\t\tpanel.removeAttribute( 'hidden' );\n\n\t\t} else if ( isExpanded && !onlyOpen ) { // Close panel\n\t\t\t// Set the expanded state on the triggering element\n\t\t\ttrigger.setAttribute( 'aria-expanded', 'false' );\n\n\t\t\t// Hide the accordion sections, using the 'for'-attribute to specify the desired section\n\t\t\tconst panel = this.querySelector( '#' + trigger.getAttribute( 'for' ) );\n\n\t\t\tif ( !panel ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpanel.inert = true;\n\t\t\tpanel.setAttribute( 'hidden', 'until-found' );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate findTriggerFromPanelContents( el: Element ): Element|null {\n\t\tconst ids: Array = [];\n\n\t\tif ( el.id ) {\n\t\t\tids.push( el.id );\n\t\t}\n\n\t\tlet walker = el;\n\t\twhile ( walker.parentNode ) {\n\t\t\tif ( walker === this ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( walker.id ) {\n\t\t\t\tids.push( walker.id );\n\t\t\t}\n\n\t\t\tif ( !walker.parentNode || !( walker.parentNode instanceof Element ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\twalker = walker.parentNode;\n\t\t}\n\n\t\tif ( 0 === ids.length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Build a query to match triggers. We do not know which ID corresponds to a trigger so we try a lot. We will however only find one thing.\n\t\tconst query = ids.map( ( id ) => {\n\t\t\treturn `[accordion-trigger][for=\"${id}\"]`;\n\t\t} ).join( ', ' );\n\n\t\treturn this.querySelector( query );\n\t}\n}\n\n\nconst _didAddKeypressEventListener: Map = new Map();\n\nfunction addKeypressEventListener( tagName: string ): void {\n\tif ( _didAddKeypressEventListener.has( tagName ) ) {\n\t\treturn;\n\t}\n\n\t_didAddKeypressEventListener.set( tagName, true );\n\n\tconst getTriggers = (): Array|null => {\n\t\tif ( !document.activeElement ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst activeAccordion = document.activeElement.closest( tagName );\n\t\tif ( !activeAccordion ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst activeAccordionSelector = '[accordion-trigger][accordion=\"' + activeAccordion.id + '\"]';\n\t\tconst triggers = activeAccordion.querySelectorAll( activeAccordionSelector );\n\n\t\tif ( !triggers || !triggers.length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst out: Array = [];\n\t\ttriggers.forEach( ( el ) => {\n\t\t\tif ( el instanceof HTMLElement ) {\n\t\t\t\tout.push( el );\n\t\t\t}\n\t\t} );\n\n\t\treturn out;\n\t};\n\n\t// Handle keydown events\n\tconst keydownHandler = ( event: KeyboardEvent ): void => {\n\t\tconst target = event.target;\n\t\tif ( !target || !( target instanceof HTMLElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !target.hasAttribute( 'accordion-trigger' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst key = event.which.toString();\n\t\tif ( !key ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// 33 = Page Up, 34 = Page Down\n\t\tconst ctrlModifier = ( event.ctrlKey && key.match( /33|34/ ) );\n\n\t\t// Up/ Down arrow and Control + Page Up/ Page Down keyboard operations\n\t\t// 38 = Up, 40 = Down\n\t\tif ( key.match( /38|40/ ) || ctrlModifier ) {\n\t\t\tconst triggers = getTriggers();\n\t\t\tif ( !triggers ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet direction = -1;\n\t\t\tif ( key.match( /34|40/ ) ) {\n\t\t\t\tdirection = 1;\n\t\t\t}\n\n\t\t\tconst index = triggers.indexOf( target );\n\t\t\tconst length = triggers.length;\n\t\t\tconst newIndex = ( index + length + direction ) % length;\n\n\t\t\ttriggers[newIndex].focus();\n\n\t\t\tevent.preventDefault();\n\n\t\t\t// 35 = End, 36 = Home keyboard operations\n\t\t} else if ( key.match( /35|36/ ) ) {\n\t\t\tconst triggers = getTriggers();\n\t\t\tif ( !triggers ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch ( key ) {\n\n\t\t\t\t// Go to first accordion\n\t\t\t\tcase '36':\n\t\t\t\t\ttriggers[0].focus();\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Go to last accordion\n\t\t\t\tcase '35':\n\t\t\t\t\ttriggers[triggers.length - 1].focus();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tdocument.addEventListener( 'keydown', keydownHandler );\n}\n","export function mapboxLoadDependencies() {\n\tconst mapboxVersion = 'v1.1.0'; // previously v0.53.1\n\n\tconst loadJS = function() {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tconst script = document.createElement( 'script' );\n\t\t\tscript.src = `https://api.mapbox.com/mapbox-gl-js/${mapboxVersion}/mapbox-gl.js`;\n\t\t\tscript.onload = () => {\n\t\t\t\tresolve();\n\n\t\t\t\treturn;\n\t\t\t};\n\t\t\tscript.onerror = () => {\n\t\t\t\treject( new Error( 'mapbox gl js failed to load' ) );\n\n\t\t\t\treturn;\n\t\t\t};\n\t\t\tscript.async = true;\n\n\t\t\tconst first = document.head.getElementsByTagName( 'script' )[0];\n\t\t\tfirst.parentNode.insertBefore( script, first );\n\t\t} );\n\t};\n\n\tconst loadCSS = function() {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tconst link = document.createElement( 'link' );\n\t\t\tlink.rel = 'stylesheet';\n\t\t\tlink.href = `https://api.mapbox.com/mapbox-gl-js/${mapboxVersion}/mapbox-gl.css`;\n\t\t\tlink.onload = () => {\n\t\t\t\tresolve();\n\n\t\t\t\treturn;\n\t\t\t};\n\t\t\tlink.onerror = () => {\n\t\t\t\treject( new Error( 'mapbox gl css failed to load' ) );\n\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\tconst first = document.head.getElementsByTagName( 'link' )[0];\n\t\t\tfirst.parentNode.insertBefore( link, first );\n\t\t} );\n\t};\n\n\treturn Promise.all( [\n\t\tloadJS(),\n\t\tloadCSS(),\n\t] );\n}\n\nexport function mapboxInitializeMap( node, center ) {\n\treturn new Promise( ( resolve ) => {\n\t\tlet zoom = 13;\n\t\tif ( window.innerWidth <= 768 ) {\n\t\t\tzoom = 11;\n\t\t} else if ( window.innerWidth <= 1440 ) {\n\t\t\tzoom = 12;\n\t\t}\n\n\t\tconst map = new window.mapboxgl.Map( {\n\t\t\tcontainer: node,\n\t\t\tstyle: 'mapbox://styles/mapbox/streets-v10?optimize=true',\n\t\t\tcenter: center,\n\t\t\tzoom: zoom,\n\t\t} );\n\n\t\tmap.dragRotate.disable();\n\t\tmap.touchZoomRotate.disableRotation();\n\t\tmap.scrollZoom.disable();\n\n\t\tconst nav = new window.mapboxgl.NavigationControl( {\n\t\t\tshowCompass: false,\n\t\t\tshowZoom: true,\n\t\t} );\n\n\t\tmap.addControl( nav, 'top-left' );\n\t\tmap.addControl( new window.mapboxgl.FullscreenControl(), 'top-left' );\n\n\t\tmap.on( 'load', () => {\n\t\t\treturn resolve( map );\n\t\t} );\n\t} );\n}\n\nexport function mapboxBuildGeoJSON( locations ) {\n\treturn {\n\t\ttype: 'FeatureCollection',\n\t\tfeatures: Array.from( locations, ( location, i ) => {\n\t\t\tconst latitude = parseFloat( location.dataset.latitude );\n\t\t\tconst longitude = parseFloat( location.dataset.longitude );\n\n\t\t\tif ( (\n\t\t\t\tNumber.isNaN( latitude ) || Number.isNaN( longitude ) ) ||\n\t\t\t\tlocation.hidden\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: 'Feature',\n\t\t\t\tgeometry: {\n\t\t\t\t\ttype: 'Point',\n\t\t\t\t\tcoordinates: [\n\t\t\t\t\t\tlongitude,\n\t\t\t\t\t\tlatitude,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\tproperties: {\n\t\t\t\t\tlocationId: location.id,\n\t\t\t\t\tpopup: location.id,\n\t\t\t\t\tid: i,\n\t\t\t\t},\n\t\t\t};\n\t\t} ).filter( ( location ) => {\n\t\t\treturn !!location;\n\t\t} ),\n\t};\n}\n\nexport function mapboxRenderMarkers( geoJSON, map ) {\n\tif ( map.getLayer( 'markers' ) ) {\n\t\tmap.removeLayer( 'markers' ).removeSource( 'markers' );\n\t}\n\n\tmap.addLayer( {\n\t\tid: 'markers',\n\t\ttype: 'circle',\n\t\tsource: {\n\t\t\ttype: 'geojson',\n\t\t\tdata: geoJSON,\n\t\t\tgenerateId: true,\n\t\t},\n\t\tpaint: {\n\t\t\t'circle-color': [\n\t\t\t\t'case',\n\t\t\t\t[\n\t\t\t\t\t'==',\n\t\t\t\t\t[\n\t\t\t\t\t\t'feature-state',\n\t\t\t\t\t\t'color',\n\t\t\t\t\t],\n\t\t\t\t\t'red',\n\t\t\t\t],\n\t\t\t\t'#e81830',\n\t\t\t\t[\n\t\t\t\t\t'==',\n\t\t\t\t\t[\n\t\t\t\t\t\t'feature-state',\n\t\t\t\t\t\t'color',\n\t\t\t\t\t],\n\t\t\t\t\t'green',\n\t\t\t\t],\n\t\t\t\t'#00dd00',\n\t\t\t\t'#999',\n\t\t\t],\n\t\t\t'circle-radius': 12,\n\t\t\t'circle-stroke-width': 1,\n\t\t\t'circle-stroke-opacity': 0.75,\n\t\t\t'circle-stroke-color': '#fff',\n\t\t},\n\t} );\n\n\tsetTimeout( () => {\n\t\tupdateFeatureState( map );\n\n\t\tsetInterval( () => {\n\t\t\tupdateFeatureState( map );\n\t\t}, 10_000 );\n\t}, 250 );\n}\n\nfunction updateFeatureState( map ) {\n\tmap.queryRenderedFeatures( {\n\t\tlayers: [\n\t\t\t'markers',\n\t\t],\n\t} ).forEach( ( feature ) => {\n\t\tconst locationEl = document.getElementById( feature.properties.locationId );\n\t\tconst color = locationEl?.dataset?.color ?? 'grey';\n\n\t\tmap.setFeatureState( {\n\t\t\tsource: feature.source,\n\t\t\tid: feature.id,\n\t\t}, {\n\t\t\tcolor: color,\n\t\t} );\n\t} );\n}\n\nexport function mapboxRenderUserPosition( latitude, longitude, map ) {\n\tif ( !map.getLayer( 'user' ) ) {\n\t\tmap.addLayer( {\n\t\t\tid: 'user',\n\t\t\ttype: 'circle',\n\t\t\tsource: {\n\t\t\t\ttype: 'geojson',\n\t\t\t\tdata: {\n\t\t\t\t\ttype: 'Feature',\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\ttype: 'Point',\n\t\t\t\t\t\tcoordinates: [\n\t\t\t\t\t\t\tlongitude,\n\t\t\t\t\t\t\tlatitude,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpaint: {\n\t\t\t\t'circle-color': '#eb5d0b',\n\t\t\t\t'circle-radius': 12,\n\t\t\t\t'circle-stroke-width': 1,\n\t\t\t\t'circle-stroke-opacity': 0.75,\n\t\t\t\t'circle-stroke-color': '#fff',\n\t\t\t},\n\t\t} );\n\t}\n\n\tmap.flyTo( {\n\t\tcenter: [\n\t\t\tlongitude,\n\t\t\tlatitude,\n\t\t],\n\t\tbearing: 0,\n\t\tspeed: 1,\n\t} );\n}\n","import { MrAccordion } from '@mrhenry/wp--mr-interactive';\n\ncustomElements.define( 'mr-accordion', MrAccordion );\n","import { mapboxBuildGeoJSON, mapboxInitializeMap, mapboxLoadDependencies, mapboxRenderMarkers, mapboxRenderUserPosition } from './mapbox/mapbox';\n\nclass MrLocationPicker extends HTMLElement {\n\tconnectedCallback() {\n\t\trequestAnimationFrame( () => {\n\t\t\tthis._init();\n\t\t} );\n\t}\n\n\t_init() {\n\t\tmapboxLoadDependencies().then( () => {\n\t\t\twindow.mapboxgl.accessToken = 'pk.eyJ1IjoibXJoZW5yeSIsImEiOiJjaWkxczFpbmgwMGVhdHptMGJ4MmhiMjhyIn0._tUMWvSNQW3qk1-CuvH1-g';\n\n\t\t\tthis.elements = {};\n\t\t\tthis.elements.locations = Array.from( this.getElementsByClassName( 'js-location-picker-location' ) );\n\t\t\tthis.elements.map = this.getElementsByClassName( 'js-location-picker-map' )[0];\n\n\t\t\treturn mapboxInitializeMap( this.elements.map, [\n\t\t\t\t4.414358,\n\t\t\t\t51.2120714,\n\t\t\t] );\n\t\t} ).then( ( map ) => {\n\t\t\tthis.map = map;\n\t\t\tthis.markers = mapboxRenderMarkers( mapboxBuildGeoJSON( this.elements.locations ), map );\n\n\t\t\twindow.addEventListener( 'filter-changed', () => {\n\t\t\t\tmapboxRenderMarkers( mapboxBuildGeoJSON( this.elements.locations ), this.map );\n\t\t\t} );\n\n\t\t\tthis._addEventListeners();\n\t\t} ).catch( ( err ) => {\n\t\t\tconsole.warn( err );\n\t\t\tdocument.getElementById( 'location-data-error-dialog' )?.updateState( 'open' );\n\t\t} );\n\t}\n\n\t_addEventListeners() {\n\t\tthis.querySelector( '[data-find-my-location-button]' )?.addEventListener( 'click', () => {\n\t\t\tthis.focusUserLocation();\n\t\t} );\n\n\t\tlet currentPopupKey;\n\n\t\tconst popup = new window.mapboxgl.Popup( {\n\t\t\tcloseButton: true,\n\t\t\tcloseOnClick: false,\n\t\t\toffset: 18,\n\t\t} );\n\n\t\tconst showPopup = ( feature ) => {\n\t\t\tif ( popup ) {\n\t\t\t\tpopup.remove();\n\t\t\t}\n\n\t\t\tconst wrapped = ``;\n\n\t\t\tpopup.setLngLat( feature.geometry.coordinates )\n\t\t\t\t.setHTML( wrapped )\n\t\t\t\t.addTo( this.map )\n\t\t\t\t.setMaxWidth( '400px' ); // larger than the actual value which is 390px\n\t\t};\n\n\t\tconst hidePopup = () => {\n\t\t\tif ( popup ) {\n\t\t\t\tpopup.remove();\n\t\t\t}\n\t\t};\n\n\t\tthis.map.on( 'mouseenter', 'markers', () => {\n\t\t\tconst canvas = this.map.getCanvas();\n\t\t\tObject.assign( canvas.style, {\n\t\t\t\tcursor: 'pointer',\n\t\t\t} );\n\t\t} );\n\n\t\tthis.map.on( 'click', 'markers', ( e ) => {\n\t\t\tconst canvas = this.map.getCanvas();\n\t\t\tObject.assign( canvas.style, {\n\t\t\t\tcursor: 'pointer',\n\t\t\t} );\n\n\t\t\tconst [\n\t\t\t\tfeature,\n\t\t\t] = e.features;\n\n\t\t\tif ( currentPopupKey === feature.properties.id ) {\n\t\t\t\thidePopup();\n\t\t\t\tcurrentPopupKey = undefined;\n\t\t\t} else {\n\t\t\t\tshowPopup( feature );\n\t\t\t\tcurrentPopupKey = feature.properties.id;\n\t\t\t}\n\t\t} );\n\n\t\tthis.map.on( 'mouseleave', 'markers', () => {\n\t\t\tconst canvas = this.map.getCanvas();\n\t\t\tObject.assign( canvas.style, {\n\t\t\t\tcursor: '',\n\t\t\t} );\n\t\t} );\n\t}\n\n\tfocusUserLocation() {\n\t\tif ( navigator.geolocation ) {\n\t\t\tnavigator.geolocation.getCurrentPosition( ( position ) => {\n\t\t\t\tconst {\n\t\t\t\t\tlatitude, longitude,\n\t\t\t\t} = position.coords;\n\t\t\t\tmapboxRenderUserPosition( latitude, longitude, this.map );\n\t\t\t} );\n\t\t}\n\t}\n}\n\ncustomElements.define( 'mr-location-picker', MrLocationPicker );\n","import { BaseController } from '../controllers/base';\n\nfunction convertAttributeToPropertyName( attribute: string ): string {\n\treturn attribute.split( '-' ).reduce( ( camelcased, part, index ) => {\n\t\tif ( 0 === index ) {\n\t\t\treturn part;\n\t\t}\n\n\t\treturn camelcased + part[0].toUpperCase() + part.substr( 1 );\n\t} );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nfunction addMethod, U extends HTMLElement>( controllerType: new ( el: U | HTMLElement ) => T, name: string, method: any ): void {\n\tif ( 'undefined' !== typeof controllerType.prototype[name] ) {\n\t\tconsole.warn( `${controllerType.name} already has a property ${name}` );\n\t}\n\n\tcontrollerType.prototype[name] = method;\n}\n\nfunction addGetter, U extends HTMLElement, V>( controllerType: new ( el: U | HTMLElement ) => T, name: string, method: () => V|null ): void {\n\tconst getterName = convertAttributeToPropertyName( name );\n\n\tif ( 'undefined' !== typeof controllerType.prototype[getterName] ) {\n\t\tconsole.warn( `${controllerType.name} already has a property ${getterName}` );\n\t}\n\n\tObject.defineProperty( controllerType.prototype, getterName, {\n\t\tconfigurable: false,\n\t\tget: method,\n\t} );\n}\n\nfunction addSetter, U extends HTMLElement, V>( controllerType: new ( el: U | HTMLElement ) => T, name: string, method: ( x:V|null ) => void ): void {\n\tconst setterName = convertAttributeToPropertyName( name );\n\n\tif ( 'undefined' !== typeof controllerType.prototype[setterName] ) {\n\t\tconsole.warn( `${controllerType.name} already has a property ${setterName}` );\n\t}\n\n\tObject.defineProperty( controllerType.prototype, setterName, {\n\t\tconfigurable: false,\n\t\tset: method,\n\t} );\n}\n\nfunction addProperty, U extends HTMLElement, V>( controllerType: new ( el: U | HTMLElement ) => T, name: string, getter: ( () => V|null )|null = null, setter: ( ( x:V|null ) => void )|null = null ): void {\n\tconst propertyName = convertAttributeToPropertyName( name );\n\n\tif ( 'undefined' !== typeof controllerType.prototype[propertyName] ) {\n\t\tconsole.warn( `${controllerType.name} already has a property \"${propertyName}\"` );\n\t}\n\n\tlet g = function(): V | null {\n\t\treturn null;\n\t};\n\n\tif ( ( 'function' === typeof getter ) ) {\n\t\tg = getter;\n\t}\n\n\t/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n\tlet s = function( x: V | null ): void {\n\t\treturn;\n\t};\n\n\tif ( ( 'function' === typeof setter ) ) {\n\t\ts = setter;\n\t}\n\n\tconst property = {\n\t\tconfigurable: false,\n\t\tget: g,\n\t\tset: s,\n\t};\n\n\tlet descriptor;\n\t// https://stackoverflow.com/questions/55193973/cannot-read-property-disguisetoken-of-undefined\n\t// These try/catch blocks might help us gain more insights\n\ttry {\n\t\tdescriptor = Object.getOwnPropertyDescriptor( controllerType.prototype, propertyName );\n\t} catch ( err ) {\n\t\t// \"Cannot read property 'disguiseToken' of undefined\"\n\t\t// We can't pinpoint this error and are phasing out CEH.\n\t\tconsole.warn( err );\n\t}\n\n\tif ( descriptor ) {\n\t\tconsole.warn( `${controllerType.name} already has a property \"${propertyName}\"` );\n\n\t\tif ( 'function' === typeof descriptor.set ) {\n\t\t\tconst existing = descriptor.set;\n\n\t\t\tproperty.set = function set( to ) {\n\t\t\t\texisting.call( this, to );\n\t\t\t};\n\t\t}\n\n\t\tif ( 'function' === typeof descriptor.get ) {\n\t\t\tconst generated = property.get;\n\t\t\tconst existing = descriptor.get;\n\n\t\t\tproperty.get = function get() {\n\t\t\t\tconst value = existing.call( this );\n\n\t\t\t\tif ( 'undefined' !== typeof value ) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\n\t\t\t\treturn generated.call( this );\n\t\t\t};\n\t\t}\n\t}\n\n\tObject.defineProperty( controllerType.prototype, propertyName, property );\n}\n\nexport {\n\tconvertAttributeToPropertyName,\n\taddMethod,\n\taddGetter,\n\taddSetter,\n\taddProperty\n};\n","interface Stringable {\n\ttoString(): string\n}\n\ninterface StringGetterSetterPair {\n\tgetter(): string | Stringable | null\n\tsetter( x: string|Stringable|null ): void\n}\n\nexport function generateStringAttributeMethods( attribute: string ): StringGetterSetterPair {\n\tconst getter = function( this: { el: HTMLElement } ): string|Stringable|null {\n\t\treturn this.el.getAttribute( attribute );\n\t};\n\n\tconst setter = function( this: { el: HTMLElement }, x: string | Stringable | null ): void {\n\t\tlet parsed = null;\n\t\tif ( x && x.toString ) {\n\t\t\tparsed = x.toString();\n\t\t}\n\n\t\tconst oldValue = getter.call( this );\n\n\t\tif ( parsed === oldValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( parsed ) {\n\t\t\tthis.el.setAttribute( attribute, parsed );\n\t\t} else {\n\t\t\tthis.el.removeAttribute( attribute );\n\t\t}\n\t};\n\n\treturn {\n\t\tgetter,\n\t\tsetter,\n\t};\n}\n\ninterface BooleanGetterSetterPair {\n\tgetter(): boolean\n\tsetter( x: boolean ): void\n}\n\nexport function generateBoolAttributeMethods( attribute: string ): BooleanGetterSetterPair {\n\tconst getter = function( this: { el: HTMLElement } ): boolean {\n\t\treturn this.el.hasAttribute( attribute );\n\t};\n\n\tconst setter = function( this: { el: HTMLElement }, x: boolean ): void {\n\t\tconst parsed = ( 'string' === typeof x ) || !!x;\n\t\tconst oldValue = getter.call( this );\n\n\t\tif ( parsed === oldValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( parsed ) {\n\t\t\tthis.el.setAttribute( attribute, '' );\n\t\t} else {\n\t\t\tthis.el.removeAttribute( attribute );\n\t\t}\n\t};\n\n\treturn {\n\t\tgetter,\n\t\tsetter,\n\t};\n}\n\ninterface IntegerGetterSetterPair {\n\tgetter(): number|null\n\tsetter( x: number|null ): void\n}\n\nexport function generateIntegerAttributeMethods( attribute: string ): IntegerGetterSetterPair {\n\tconst getter = function( this: { el: HTMLElement } ): number | null {\n\t\tconst x = this.el.getAttribute( attribute );\n\t\tif ( !x ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn parseInt( x, 10 );\n\t};\n\n\tconst setter = function( this: { el: HTMLElement }, x: number | null ): void {\n\t\tlet parsed = null;\n\t\tif ( 'string' === typeof x ) {\n\t\t\tparsed = parseInt( x, 10 ); // keep string support internally\n\t\t} else {\n\t\t\tparsed = x;\n\t\t}\n\n\t\tconst oldValue = getter.call( this );\n\n\t\tif ( parsed === oldValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( null !== parsed && 'undefined' !== typeof parsed && !Number.isNaN( parsed ) ) {\n\t\t\tthis.el.setAttribute( attribute, parsed.toString() );\n\t\t} else {\n\t\t\tconsole.warn( `Could not set ${attribute} to ${x}` );\n\t\t\tthis.el.removeAttribute( attribute );\n\t\t}\n\t};\n\n\treturn {\n\t\tgetter,\n\t\tsetter,\n\t};\n}\n\ninterface NumberGetterSetterPair {\n\tgetter(): number|null\n\tsetter( x: number|null ): void\n}\n\nexport function generateNumberAttributeMethods( attribute: string ): NumberGetterSetterPair {\n\tconst getter = function( this: { el: HTMLElement } ): number | null {\n\t\tconst x = this.el.getAttribute( attribute );\n\t\tif ( !x ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn parseFloat( x );\n\t};\n\n\tconst setter = function( this: { el: HTMLElement }, x: number | null ): void {\n\t\tlet parsed = null;\n\t\tif ( 'string' === typeof x ) {\n\t\t\tparsed = parseFloat( x ); // keep string support internally\n\t\t} else {\n\t\t\tparsed = x;\n\t\t}\n\n\t\tconst oldValue = getter.call( this );\n\n\t\tif ( parsed === oldValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( parsed && !Number.isNaN( parsed ) ) {\n\t\t\tthis.el.setAttribute( attribute, parsed.toString() );\n\t\t} else {\n\t\t\tconsole.warn( `Could not set ${attribute} to ${x}` );\n\t\t\tthis.el.removeAttribute( attribute );\n\t\t}\n\t};\n\n\treturn {\n\t\tgetter,\n\t\tsetter,\n\t};\n}\n\ninterface JSONGetterSetterPair {\n\tgetter(): T | string | null\n\tsetter( x: T | string | null ): void\n}\n\nexport function generateJSONAttributeMethods( attribute: string ): JSONGetterSetterPair {\n\t// @param value Whatever you want to parse\n\t// @param strict If true, return null when non-JSON parsed\n\t// If false, return whatever was passed to parse\n\tconst parse = function( value: T|string|null, strict = false ): T|string|null {\n\t\tif ( 'string' === typeof value ) {\n\t\t\ttry {\n\t\t\t\tconst decoded = JSON.parse( value );\n\n\t\t\t\tif ( decoded ) {\n\t\t\t\t\treturn decoded as T;\n\t\t\t\t}\n\t\t\t} catch ( e ) {\n\t\t\t\t// noop\n\t\t\t}\n\t\t}\n\n\t\tif ( strict ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn value;\n\t};\n\n\tconst getter = function( this: { el: HTMLElement } ): T | string | null {\n\t\tconst value = this.el.getAttribute( attribute );\n\n\t\treturn parse( value, true );\n\t};\n\n\tconst setter = function( this: { el: HTMLElement }, x: T | string | null ): void {\n\t\tif ( !x ) {\n\t\t\tthis.el.removeAttribute( attribute );\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst encoded = JSON.stringify( parse( x ) );\n\t\tconst oldValue = this.el.getAttribute( attribute );\n\n\t\tif ( encoded === oldValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( encoded ) {\n\t\t\tthis.el.setAttribute( attribute, encoded );\n\t\t} else {\n\t\t\tthis.el.removeAttribute( attribute );\n\t\t}\n\t};\n\n\treturn {\n\t\tgetter,\n\t\tsetter,\n\t};\n}\n\ninterface GetterSetterPair {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tgetter(): any\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsetter( x: any ): void\n}\n\nexport function generateAttributeMethods( attribute: string, type = 'string' ): GetterSetterPair {\n\tif ( 'bool' === type || 'boolean' === type ) {\n\t\treturn generateBoolAttributeMethods( attribute );\n\t} else if ( 'int' === type || 'integer' === type ) {\n\t\treturn generateIntegerAttributeMethods( attribute );\n\t} else if ( 'float' === type || 'number' === type ) {\n\t\treturn generateNumberAttributeMethods( attribute );\n\t} else if ( 'string' === type ) {\n\t\treturn generateStringAttributeMethods( attribute );\n\t} else if ( 'json' === type ) {\n\t\treturn generateJSONAttributeMethods( attribute );\n\t}\n\n\treturn {\n\t\tgetter: function(): null {\n\t\t\treturn null;\n\t\t},\n\t\tsetter: function(): void {\n\t\t\treturn;\n\t\t},\n\t};\n}\n","import { convertAttributeToPropertyName, addProperty } from '../internal/decorators';\nimport { generateAttributeMethods } from '../internal/attribute-methods-generator';\nimport { BaseController } from '../controllers/base';\n\nconst CONTROLLER = Symbol( 'controller' );\n\nfunction registerElement, U extends HTMLElement>( tag: string, options: DefineElementOptions ) {\n\tconst observedAttributes = options.observedAttributes || [];\n\tconst Controller: new ( el: HTMLElement ) => T = options.controller;\n\n\tcustomElements.define( tag, class extends HTMLElement {\n\t\t[CONTROLLER]: T|null = null;\n\n\t\tstatic get observedAttributes() {\n\t\t\treturn observedAttributes;\n\t\t}\n\n\t\tattributeChangedCallback( attribute: string, oldValue: string|null, newValue: string|null ): void {\n\t\t\tif ( oldValue === newValue ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst ctrl = this[CONTROLLER];\n\t\t\tif ( !ctrl ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst propertyName = convertAttributeToPropertyName( attribute );\n\n\t\t\tconst prototype = Object.getPrototypeOf( ctrl );\n\t\t\tconst propertyDescriptor = Object.getOwnPropertyDescriptor( prototype, propertyName );\n\n\t\t\tif ( propertyDescriptor && propertyDescriptor.set ) {\n\t\t\t\tpropertyDescriptor.set.call( ctrl, newValue );\n\t\t\t}\n\n\t\t\t// If for argument `current` the method\n\t\t\t// `currentChangedCallback` exists, trigger\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tconst callback = ( ctrl )[`${propertyName}ChangedCallback`];\n\n\t\t\tif ( 'function' === typeof callback ) {\n\t\t\t\tcallback.call( ctrl, oldValue, newValue );\n\t\t\t}\n\t\t}\n\n\t\tconstructor() {\n\t\t\tsuper();\n\n\t\t\tobservedAttributes.forEach( ( attribute ) => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\tif ( 'undefined' !== typeof( this )[attribute] ) {\n\t\t\t\t\tconsole.warn( `Requested syncing on attribute '${attribute}' that already has defined behavior` );\n\t\t\t\t}\n\n\t\t\t\tObject.defineProperty( this, attribute, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tget: (): any => {\n\t\t\t\t\t\tconst ctrl = this[CONTROLLER];\n\t\t\t\t\t\tif ( !ctrl ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\treturn ( ctrl )[attribute];\n\t\t\t\t\t},\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tset: ( to: any ): void => {\n\t\t\t\t\t\tconst ctrl = this[CONTROLLER];\n\t\t\t\t\t\tif ( !ctrl ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t( ctrl )[attribute] = to;\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\t// eslint-disable-next-line new-cap\n\t\t\tthis[CONTROLLER] = new Controller( this );\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tconst ctrl = this[CONTROLLER];\n\t\t\tif ( !ctrl ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tctrl.unbind();\n\t\t\tctrl.destroy();\n\n\t\t\tthis[CONTROLLER] = null;\n\t\t}\n\t} );\n}\n\ninterface AttributeOptions {\n\ttype: string\n\tattribute: string\n}\n\nfunction addAttributesToController, U extends HTMLElement>( controller: new ( el: U | HTMLElement ) => T, attributes: Array = [] ) {\n\tconst out: Array = [];\n\n\tattributes.forEach( ( attribute ) => {\n\t\t// String, sync with actual element attribute\n\t\tif ( 'string' === typeof attribute ) {\n\t\t\tconst {\n\t\t\t\tgetter, setter,\n\t\t\t} = generateAttributeMethods( attribute, 'string' );\n\t\t\taddProperty( controller, attribute, getter, setter );\n\n\t\t\tout.push( attribute );\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'object' === typeof attribute ) {\n\t\t\tconst type = attribute.type || 'string';\n\t\t\tconst name = attribute.attribute;\n\t\t\tconst {\n\t\t\t\tgetter, setter,\n\t\t\t} = generateAttributeMethods( name, type );\n\t\t\taddProperty( controller, name, getter, setter );\n\n\t\t\tout.push( name );\n\n\t\t\treturn;\n\t\t}\n\n\t} );\n\n\treturn out;\n}\n\ninterface DefineElementOptions, U extends HTMLElement> {\n\tcontroller: new ( el: U | HTMLElement ) => T\n\textends?: null | ( new () => U | HTMLElement )\n\tattributes?: Array\n\tobservedAttributes?: Array | null\n\ttype?: string | null\n}\n\nexport default function defineCustomElement, U extends HTMLElement>( tag: string, options: DefineElementOptions ): void {\n\t// Validate tag\n\tconst isValidTag = 1 < tag.split( '-' ).length;\n\n\t// Validate type\n\t// Needs a freaking fallback default value...\n\toptions.type = options.type || 'element';\n\tif ( 'element' !== options.type ) {\n\t\tconsole.warn( 'attribute definitions are no longer supported as they are stupid! Refactor : ' + tag );\n\n\t\treturn;\n\t}\n\n\t// Validate attributes\n\tlet attributes: Array = [];\n\tif ( Array.isArray( options.attributes ) ) {\n\t\tattributes = options.attributes;\n\t}\n\n\t// Validate controller\n\tconst controller = options.controller;\n\tconst _extends = options.extends;\n\n\tif ( !isValidTag ) {\n\t\tconsole.warn( tag, 'is not a valid Custom Element name. Register as an attribute instead.' );\n\n\t\treturn;\n\t}\n\n\tif ( _extends ) {\n\t\tconsole.warn( '`extends` is not supported on element-registered Custom Elements. Register as an attribute instead.' );\n\n\t\treturn;\n\t}\n\n\tconst observedAttributes = addAttributesToController( controller, attributes );\n\n\tconst validatedOptions = {\n\t\ttype: 'element',\n\t\textends: null,\n\t\tattributes: attributes,\n\t\tcontroller: controller,\n\t\tobservedAttributes: observedAttributes,\n\t};\n\n\treturn registerElement( tag, validatedOptions );\n}\n","interface EventDescriptor {\n\tevent: string\n\tselector: string | null\n}\n\nexport function parse( name: string ) :EventDescriptor {\n\tconst clean = name.trim();\n\tconst parts = clean.split( ' ' );\n\n\tlet event = clean;\n\tlet selector = null;\n\n\tif ( 1 < parts.length ) {\n\t\tevent = parts[0];\n\t\tselector = parts.slice( 1 ).join( ' ' );\n\t}\n\n\treturn {\n\t\tevent,\n\t\tselector,\n\t};\n}\n\ndeclare global {\n\tinterface Event {\n\t\t// Non-standard but used in older browsers\n\t\tpath: NodeList|Array|null\n\t}\n}\n\nexport function getPath( e: Event ): Array {\n\tif ( e.path ) {\n\t\tif ( Array.isArray( e.path ) ) {\n\t\t\treturn e.path;\n\t\t}\n\n\t\treturn Array.from( e.path );\n\t}\n\n\tif ( e.composedPath ) {\n\t\tconst composedPath = e.composedPath();\n\t\tconst out: Array = [];\n\n\t\tcomposedPath.forEach( ( eventTarget ) => {\n\t\t\tif (\n\t\t\t\teventTarget instanceof Document ||\n\t\t\t\teventTarget instanceof Element ||\n\t\t\t\teventTarget instanceof Node ||\n\t\t\t\teventTarget instanceof Window\n\t\t\t) {\n\t\t\t\tout.push( eventTarget );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t} );\n\n\t\treturn out;\n\t}\n\n\tif ( e.target && e.target instanceof Node ) {\n\t\tconst out: Array = [\n\t\t\te.target,\n\t\t];\n\n\t\tlet node = e.target;\n\t\twhile ( node instanceof Node && node.parentNode ) {\n\t\t\tnode = node.parentNode;\n\t\t\tout.push( node );\n\t\t}\n\n\t\treturn out;\n\t}\n\n\treturn [];\n}\n","\nexport default function promisify( method: () => T | Promise ): Promise {\n\treturn new Promise( ( resolve, reject ) => {\n\t\tconst wait = method();\n\n\t\tif ( wait instanceof Promise ) {\n\t\t\twait.then( ( x ) => {\n\t\t\t\tresolve( x );\n\t\t\t} ).catch( ( err ) => {\n\t\t\t\treject( err );\n\t\t\t} );\n\t\t} else {\n\t\t\tresolve( wait );\n\t\t}\n\t} );\n}\n","export default function waitForDOMReady(): Promise {\n\treturn new Promise( ( resolve ) => {\n\t\tif ( isInteractive() ) {\n\t\t\tresolve();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst handler = () => {\n\t\t\tif ( isInteractive() ) {\n\t\t\t\tdocument.removeEventListener( 'readystatechange', handler, false );\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener( 'readystatechange', handler, false );\n\t} );\n}\n\nfunction isInteractive(): boolean {\n\treturn (\n\t\t'complete' === document.readyState || 'interactive' === document.readyState\n\t);\n}\n","export default function elementIsInDOM( element: HTMLElement, root: HTMLElement = document.body ) :boolean {\n\tif ( !element ) {\n\t\treturn false;\n\t}\n\n\tif ( element === root ) {\n\t\treturn false;\n\t}\n\n\treturn root.contains( element );\n}\n","import { parse as parseEvent, getPath } from '../util/events';\nimport promisify from '../util/promise';\nimport waitForDOMReady from '../util/dom-ready';\nimport elementIsInDOM from '../util/element-is-in-dom';\n\nconst BASE_CONTROLLER_HANDLERS = Symbol( 'BASE_CONTROLLER_HANDLERS' );\n\ninterface Listener {\n\t\ttarget: EventTarget\n\t\tselector: string|null\n\t\tevent: string\n\t\thandler: ( e: T|Event ) => void\n\t\toptions: EventListenerOptions|boolean|undefined\n}\n\nexport class BaseController {\n\tel: HTMLElement|T;\n\n\t[BASE_CONTROLLER_HANDLERS]: Array = [];\n\n\tconstructor( el: HTMLElement|T ) {\n\t\tthis.el = el;\n\n\t\tconst elementDisappearedMessage = 'The element has disappeared';\n\n\t\tthis.resolve().then( () => {\n\t\t\tif ( !elementIsInDOM( this.el ) ) {\n\t\t\t\treturn Promise.reject( new Error( elementDisappearedMessage ) );\n\t\t\t}\n\n\t\t\tthis.el.classList.add( 'is-resolved' );\n\n\t\t\tconst init = () => {\n\t\t\t\treturn promisify( () => {\n\t\t\t\t\tif ( !elementIsInDOM( this.el ) ) {\n\t\t\t\t\t\treturn Promise.reject( new Error( elementDisappearedMessage ) );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.init();\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tconst render = () => {\n\t\t\t\treturn promisify( () => {\n\t\t\t\t\tif ( !elementIsInDOM( this.el ) ) {\n\t\t\t\t\t\treturn Promise.reject( new Error( elementDisappearedMessage ) );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.render();\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tconst bind = () => {\n\t\t\t\treturn promisify( () => {\n\t\t\t\t\tif ( !elementIsInDOM( this.el ) ) {\n\t\t\t\t\t\treturn Promise.reject( new Error( elementDisappearedMessage ) );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.bind();\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\treturn init().then( () => {\n\t\t\t\treturn render();\n\t\t\t} ).then( () => {\n\t\t\t\treturn bind();\n\t\t\t} ).then( () => {\n\t\t\t\treturn this;\n\t\t\t} );\n\t\t} ).catch( ( err ) => {\n\t\t\t// Because the lifecycle of CEH is promisified it happens a lot that elements are starting to come alive\n\t\t\t// while at the same time the DOM is changed.\n\t\t\t// JS will keep trying to start the controller while the DOM element is already removed.\n\t\t\t// This is normal and handled gracefully in native elements.\n\t\t\t// If we detect this scenario we try to clean up and shut down silently.\n\t\t\tif ( err && ( err.message === elementDisappearedMessage ) ) {\n\t\t\t\tconsole.warn( this.el.tagName, err );\n\n\t\t\t\ttry {\n\t\t\t\t\tthis.unbind();\n\t\t\t\t\tthis.destroy();\n\t\t\t\t} catch ( _ ) {\n\t\t\t\t\t// noop;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// These are errors from the lifecycle of the sub class.\n\t\t\t\t// Do not silence these!\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t} );\n\t}\n\n\tdestroy(): void {\n\t\tthis.el.classList.remove( 'is-resolved' );\n\t}\n\n\tresolve(): Promise {\n\t\treturn waitForDOMReady();\n\t}\n\n\tinit(): Promise|void {\n\t\treturn;\n\t}\n\n\trender(): Promise|void {\n\t\treturn;\n\t}\n\n\tbind(): Promise|void {\n\t\treturn;\n\t}\n\n\tunbind(): void {\n\t\tif ( this[BASE_CONTROLLER_HANDLERS] ) {\n\t\t\tthis[BASE_CONTROLLER_HANDLERS].forEach( ( listener ) => {\n\t\t\t\tlistener.target.removeEventListener( listener.event, listener.handler, listener.options );\n\t\t\t} );\n\n\t\t\tthis[BASE_CONTROLLER_HANDLERS] = [];\n\t\t}\n\t}\n\n\ton( name: string, handler: ( e: U|Event, target: EventTarget|null ) => void, target: Element|Window|null = null, options: EventListenerOptions|boolean|undefined = false ): void {\n\t\tthis[BASE_CONTROLLER_HANDLERS] = this[BASE_CONTROLLER_HANDLERS] || [];\n\n\t\tconst {\n\t\t\tevent, selector,\n\t\t} = parseEvent( name );\n\n\t\tconst parsedTarget = target || this.el;\n\n\t\tlet wrappedHandler = function( e: U|Event ) {\n\t\t\thandler( e, e.target );\n\t\t};\n\n\t\tif ( selector ) {\n\t\t\twrappedHandler = function( e ) {\n\t\t\t\tconst path = getPath( e );\n\n\t\t\t\tconst matchingTarget = path.find( ( tag ) => {\n\t\t\t\t\tif ( tag instanceof Element ) {\n\t\t\t\t\t\treturn tag.matches( selector );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t} );\n\n\t\t\t\tif ( matchingTarget ) {\n\t\t\t\t\thandler( e, matchingTarget );\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tconst listener = {\n\t\t\ttarget: parsedTarget,\n\t\t\tselector: selector,\n\t\t\tevent: event,\n\t\t\thandler: wrappedHandler,\n\t\t\toptions: options,\n\t\t};\n\n\t\tlistener.target.addEventListener( listener.event, listener.handler, listener.options );\n\n\t\tthis[BASE_CONTROLLER_HANDLERS].push( listener );\n\t}\n\n\tonce( name: string, handler: ( e: U|Event, target: EventTarget|null ) => void, target: Element|Window|null = null, options: EventListenerOptions|boolean|undefined = false ): void {\n\t\tconst wrappedHandler = ( e: U|Event, matchingTarget: EventTarget|null ) => {\n\t\t\tthis.off( name, target );\n\t\t\thandler( e, matchingTarget );\n\t\t};\n\n\t\tthis.on( name, wrappedHandler, target, options );\n\t}\n\n\toff( name: string, target: EventTarget|null = null ): void {\n\t\tthis[BASE_CONTROLLER_HANDLERS] = this[BASE_CONTROLLER_HANDLERS] || [];\n\n\t\tconst {\n\t\t\tevent, selector,\n\t\t} = parseEvent( name );\n\t\tconst parsedTarget = target || this.el;\n\n\t\tconst listener = this[BASE_CONTROLLER_HANDLERS].find( ( handler ) => {\n\t\t\t// Selectors don't match\n\t\t\tif ( handler.selector !== selector ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Event type don't match\n\t\t\tif ( handler.event !== event ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Parsed a target, but the targets don't match\n\t\t\tif ( !!parsedTarget && handler.target !== parsedTarget ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Else, we found a match\n\t\t\treturn true;\n\t\t} );\n\n\t\tif ( !!listener && !!listener.target ) {\n\t\t\tthis[BASE_CONTROLLER_HANDLERS].splice( this[BASE_CONTROLLER_HANDLERS].indexOf( listener ), 1 );\n\n\t\t\tlistener.target.removeEventListener( listener.event, listener.handler, listener.options );\n\t\t}\n\t}\n\n\temit( name: string, data = {}, options = {} ): void {\n\t\tconst params = Object.assign( {\n\t\t\tdetail: data,\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t}, options );\n\n\t\tconst event = new CustomEvent( name, params );\n\n\t\tthis.el.dispatchEvent( event );\n\t}\n}\n","export function templateAvailableSeats( lang: string, availableSeats: number ): string {\n\tif ( 0 === availableSeats ) {\n\t\tif ( 'en' === lang ) {\n\t\t\treturn 'Full';\n\t\t}\n\n\t\treturn 'Volzet';\n\t}\n\n\tif ( 'en' === lang ) {\n\t\tif ( 1 === availableSeats ) {\n\t\t\treturn '1 available seat';\n\t\t}\n\n\t\treturn availableSeats.toString() + ' available seats';\n\t}\n\n\tif ( 1 === availableSeats ) {\n\t\treturn '1 beschikbare plaats';\n\t}\n\n\treturn availableSeats.toString() + ' beschikbare plaatsen';\n}\n","export function templateOpenFromTo( lang: string, from: string, to: string ): string {\n\tif ( 'en' === lang ) {\n\t\treturn `Open from ${from} to ${to}`;\n\t}\n\n\treturn `Open van ${from} tot ${to}`;\n}\n","export function templateOccupancyStudy360( lang: string, locations: number, visitors: number ): string {\n\tif ( 'en' === lang ) {\n\t\treturn `There ${studentsPart( lang, visitors )} revising ${locationsPart( lang, locations )} in Antwerp.`;\n\t}\n\n\treturn `Momenteel ${studentsPart( lang, visitors )} ${locationsPart( lang, locations )} in Antwerpen aan het studeren.`;\n}\n\nfunction studentsPart( lang: string, amount: number ): string {\n\tswitch ( lang ) {\n\t\tcase 'en':\n\t\t\tswitch ( amount ) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn 'are currently no students';\n\t\t\t\tcase 1:\n\t\t\t\t\treturn 'is currently 1 student';\n\t\t\t\tdefault:\n\t\t\t\t\treturn `are currently ${amount} students`;\n\t\t\t}\n\n\t\tdefault:\n\n\t\t\tswitch ( amount ) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn 'zijn er geen studenten';\n\t\t\t\tcase 1:\n\t\t\t\t\treturn 'is er 1 student';\n\t\t\t\tdefault:\n\t\t\t\t\treturn `zijn er ${amount} studenten`;\n\t\t\t}\n\t}\n}\n\nfunction locationsPart( lang: string, amount: number ): string {\n\tswitch ( lang ) {\n\t\tcase 'en':\n\t\t\tswitch ( amount ) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn 'at our locations';\n\t\t\t\tcase 1:\n\t\t\t\t\treturn 'at one of our locations';\n\t\t\t\tdefault:\n\t\t\t\t\treturn `at ${amount} of our locations`;\n\t\t\t}\n\n\t\tdefault:\n\n\t\t\tswitch ( amount ) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn 'op onze locaties';\n\t\t\t\tcase 1:\n\t\t\t\t\treturn 'op één van onze locaties';\n\t\t\t\tdefault:\n\t\t\t\t\treturn `op ${amount} van onze locaties`;\n\t\t\t}\n\t}\n}\n","enum LocationStatusIndicatorColor {\n\t/**\n\t * The location is closed, or the data is not available.\n\t */\n\tGrey = 'grey',\n\t/**\n\t * The location is open but no space is available.\n\t * Either the `atMaximumCapacity` flag has been set or\n\t * the `currentOccupation` equals `capacity`.\n\t */\n\tRed = 'red',\n\t/**\n\t * The location is open and space is available.\n\t */\n\tGreen = 'green'\n}\n\ntype LocationDataForStatus = {\n\tisCurrentlyOpen: boolean,\n\tcurrentOpeningTimeToday: {\n\t\tcapacity: number,\n\t},\n\tcurrentOccupation: number,\n\tatMaximumCapacity: boolean,\n}\n\nfunction isDataForLocationStatus( location: unknown ): location is LocationDataForStatus {\n\treturn typeof location === 'object' &&\n\t\tlocation !== null &&\n\t\t'isCurrentlyOpen' in location &&\n\t\t'currentOpeningTimeToday' in location &&\n\t\t'currentOccupation' in location &&\n\t\t'atMaximumCapacity' in location;\n}\n\nexport function getIndicatorColorForLocation( location: unknown ): LocationStatusIndicatorColor {\n\tif ( !isDataForLocationStatus( location ) ) {\n\t\treturn LocationStatusIndicatorColor.Grey;\n\t}\n\n\tif ( !location.isCurrentlyOpen ) {\n\t\treturn LocationStatusIndicatorColor.Grey;\n\t}\n\n\tif ( !location.currentOpeningTimeToday ) {\n\t\treturn LocationStatusIndicatorColor.Grey;\n\t}\n\n\tif ( location.atMaximumCapacity ) {\n\t\treturn LocationStatusIndicatorColor.Red;\n\t}\n\n\tif ( location.currentOpeningTimeToday.capacity <= location.currentOccupation ) {\n\t\treturn LocationStatusIndicatorColor.Red;\n\t}\n\n\treturn LocationStatusIndicatorColor.Green;\n}\n","import { defineCustomElement, BaseController } from '@mrhenry/wp--custom-elements-helpers';\n\ndefineCustomElement( 'mr-sidenav', {\n\tattributes: [],\n\tcontroller: class extends BaseController {\n\t\tinit() {\n\t\t\tthis.elements = {};\n\t\t\tthis.elements.buttons = Array.from( this.el.querySelectorAll( 'button' ) );\n\t\t\tthis.elements.dashboardContent = Array.from( document.querySelectorAll( '.js-dashboard-item' ) );\n\t\t}\n\n\t\tbind() {\n\t\t\tthis.elements.buttons.forEach( ( button ) => {\n\t\t\t\tthis.on( 'click', ( e, target ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.toggle( target );\n\t\t\t\t}, button );\n\t\t\t} );\n\t\t}\n\n\t\thide( button ) {\n\t\t\tbutton.classList.remove( 'is-active' );\n\n\t\t\tconst activeContentItem = this.elements.dashboardContent.find( ( contentItem ) => {\n\t\t\t\treturn contentItem.getAttribute( 'aria-labelledby' ) === button.id;\n\t\t\t} );\n\n\t\t\tactiveContentItem.setAttribute( 'hidden', 'hidden' );\n\t\t}\n\n\t\tshow( button ) {\n\t\t\tbutton.classList.add( 'is-active' );\n\n\t\t\tconst activeContentItem = this.elements.dashboardContent.find( ( contentItem ) => {\n\t\t\t\treturn contentItem.getAttribute( 'aria-labelledby' ) === button.id;\n\t\t\t} );\n\n\t\t\tactiveContentItem.removeAttribute( 'hidden' );\n\t\t}\n\n\t\ttoggle( button ) {\n\t\t\tthis.hideAll();\n\t\t\tthis.show( button );\n\t\t}\n\n\t\thideAll() {\n\t\t\tthis.elements.buttons.forEach( ( button ) => {\n\t\t\t\tthis.hide( button );\n\t\t\t} );\n\t\t}\n\t},\n} );\n","import { defineCustomElement, BaseController } from '@mrhenry/wp--custom-elements-helpers';\n\ndefineCustomElement( 'mr-toggle', {\n\tattributes: [\n\t\t{\n\t\t\tattribute: 'target',\n\t\t\ttype: 'string',\n\t\t},\n\t\t{\n\t\t\tattribute: 'toggle',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n\tcontroller: class extends BaseController {\n\t\tinit() {\n\t\t\tthis.elements = {};\n\n\t\t\tif ( this.target ) {\n\t\t\t\tthis.elements.target = document.querySelector( this.target );\n\t\t\t}\n\t\t}\n\n\t\tbind() {\n\t\t\tthis.on( 'click', () => {\n\t\t\t\tif ( this.elements.target ) {\n\t\t\t\t\tthis.elements.target.classList.toggle( this.toggle );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t},\n} );\n","import { templateAvailableSeats } from '../templates/available-seats';\nimport { templateOpenFromTo } from '../templates/open-from-to';\nimport type { MrDialog } from '@mrhenry/wp--mr-interactive';\nimport { templateOccupancyStudy360 } from '../templates/occupancy-study360';\nimport { getIndicatorColorForLocation } from './location-status-indication-color';\n\ntype langOption = 'nl' | 'en';\nconst lang : langOption = ( ( document.documentElement.getAttribute( 'lang' ) ?? 'nl' ) as langOption );\nlet didShowErrorDialog = false;\n\nlet init = async() => {\n\tconst list = document.querySelectorAll( '[archive-location-id]' );\n\tif ( !list || !list.length ) {\n\t\treturn;\n\t}\n\n\tinit = async() => {\n\t\t/* noop */\n\t};\n\n\tawait updateView( );\n\tsetInterval( async() => {\n\t\tawait updateView();\n\t}, 31 * 1000 );\n};\n\nasync function updateView() {\n\tconst location_ids = ( Array.from( document.querySelectorAll( '[archive-location-id]' ) ) as Array ).map( ( el ) => {\n\t\t// If this is not set it is a fatal error.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn el.getAttribute( 'archive-location-id' )!;\n\t} );\n\n\tawait fetch( 'https://study360-api.mrhenry.eu/graphql', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tbody: JSON.stringify( {\n\t\t\tquery: `query q ($location_ids: [ID!]!) {\n currentOccupationStudy360 {\n locations\n visitors\n }\n locations(ids: $location_ids) {\n id\n name\n currentOpeningTimeToday {\n capacity\n closingTime\n openingTime\n }\n nextOpeningTimeToday {\n capacity\n closingTime\n openingTime\n }\n currentOccupation\n atMaximumCapacity\n isCurrentlyOpen\n\tadditionalInformation(language: EN)\n }\n}\n`,\n\t\t\tvariables: {\n\t\t\t\tlocation_ids: location_ids,\n\t\t\t},\n\t\t} ),\n\t} ).then( ( response ) => {\n\t\treturn response.json();\n\t} ).then( ( data ) => {\n\t\tif ( !data || !( data.data?.locations?.length ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst list = Array.from( document.querySelectorAll( '[archive-location-id]' ) ) as Array;\n\t\tlist.forEach( ( el ) => {\n\t\t\t// We selected elements with this attribute, if the attribute isn't here we want an exception.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst id = el.getAttribute( 'archive-location-id' )!;\n\t\t\tconst location = data.data.locations.find( ( x: {id: string} ) => {\n\t\t\t\treturn x.id === id;\n\t\t\t} );\n\t\t\tif ( !location ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst parentEl = el.parentElement;\n\t\t\tif ( parentEl ) {\n\t\t\t\tparentEl.setAttribute( 'data-color', getIndicatorColorForLocation( location ) );\n\t\t\t}\n\n\t\t\tif ( location.isCurrentlyOpen && location.currentOpeningTimeToday ) {\n\t\t\t\tel.setAttribute( 'location-is-currently-open', 'location-is-currently-open' );\n\n\t\t\t\tif ( location.currentOpeningTimeToday.capacity > location.currentOccupation ) {\n\t\t\t\t\tel.setAttribute( 'location-has-capacity', 'location-has-capacity' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst sortable = el.closest( '[sortable]' );\n\t\t\tif ( sortable ) {\n\t\t\t\tsortable.setAttribute( 'sort-by-value', '-1' );\n\t\t\t}\n\n\t\t\tconst closedAction = el.querySelector( '[list-item-template^=\"archive--closed--\"]' );\n\t\t\tif ( closedAction ) {\n\t\t\t\tif ( ( !location.currentOpeningTimeToday && !location.nextOpeningTimeToday ) ) {\n\t\t\t\t\tclosedAction.removeAttribute( 'hidden' );\n\t\t\t\t} else {\n\t\t\t\t\tclosedAction.setAttribute( 'hidden', '' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst openAction = el.querySelector( '[list-item-template^=\"archive--open--\"]' );\n\t\t\tconst openActionHours = el.querySelector( '[list-item-template^=\"archive--open--hours--\"]' );\n\t\t\tif ( openAction && openActionHours ) {\n\t\t\t\tif ( location.currentOpeningTimeToday || location.nextOpeningTimeToday ) {\n\t\t\t\t\topenAction.removeAttribute( 'hidden' );\n\n\t\t\t\t\tconst slot = location.currentOpeningTimeToday ?? location.nextOpeningTimeToday;\n\t\t\t\t\topenActionHours.innerHTML = templateOpenFromTo( lang, slot.openingTime, slot.closingTime );\n\t\t\t\t} else {\n\t\t\t\t\topenAction.setAttribute( 'hidden', '' );\n\t\t\t\t\topenActionHours.innerHTML = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst seatsAction = el.querySelector( '[list-item-template^=\"archive--available-seats--\"]' );\n\t\t\tconst seatsActionCounter = el.querySelector( '[list-item-template^=\"archive--available-seats--counter--\"]' );\n\t\t\tif ( seatsAction && seatsActionCounter ) {\n\t\t\t\tif ( location.currentOpeningTimeToday ) {\n\t\t\t\t\tlet availableSeats = Math.max( 0, location.currentOpeningTimeToday.capacity - location.currentOccupation );\n\t\t\t\t\tif ( location.atMaximumCapacity ) {\n\t\t\t\t\t\tavailableSeats = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( sortable ) {\n\t\t\t\t\t\tsortable.setAttribute( 'sort-by-value', availableSeats.toString() );\n\t\t\t\t\t}\n\n\t\t\t\t\tseatsAction.removeAttribute( 'hidden' );\n\t\t\t\t\tseatsActionCounter.innerHTML = templateAvailableSeats( lang, availableSeats );\n\t\t\t\t} else {\n\t\t\t\t\tseatsAction.setAttribute( 'hidden', '' );\n\t\t\t\t\tseatsActionCounter.innerHTML = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 0 < data.data?.currentOccupationStudy360?.visitors ) {\n\t\t\t\tconst currentOccupationEl = document.getElementById( 'doormat-check-in-count-students' );\n\t\t\t\tif ( currentOccupationEl ) {\n\t\t\t\t\tcurrentOccupationEl.innerHTML = templateOccupancyStudy360( lang, data.data.currentOccupationStudy360.locations ?? 1, data.data.currentOccupationStudy360.visitors );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t} ).catch( ( err ) => {\n\t\tconsole.warn( err );\n\n\t\tif ( !didShowErrorDialog ) {\n\t\t\tdidShowErrorDialog = true;\n\t\t\t( document.getElementById( 'location-data-error-dialog' ) as MrDialog | null )?.updateState( 'open' );\n\t\t}\n\t} );\n}\n\ninit();\n\nrequestAnimationFrame( () => {\n\tinit();\n} );\n\ndocument.addEventListener( 'readystatechange', () => {\n\tinit();\n} );\n","import { templateOccupancyStudy360 } from '../templates/occupancy-study360';\n\ntype langOption = 'nl' | 'en';\nconst lang : langOption = ( ( document.documentElement.getAttribute( 'lang' ) ?? 'nl' ) as langOption );\n\nasync function init() {\n\tif ( document.querySelector( '[single-location-id]' ) ) {\n\t\t// Handled by single location query.\n\t\treturn;\n\t}\n\n\tif ( document.querySelector( '[archive-location-id]' ) ) {\n\t\t// Handled by archive locations query.\n\t\treturn;\n\t}\n\n\tconst el = document.getElementById( 'doormat-check-in-count-students' );\n\tif ( !el ) {\n\t\treturn;\n\t}\n\n\tawait updateView();\n\tsetInterval( async() => {\n\t\tawait updateView();\n\t}, 31 * 1000 );\n}\n\nasync function updateView() {\n\t// This can throw, but Bugsnag report frequency will tell us if it's worth providing a visible error message.\n\tawait fetch( 'https://study360-api.mrhenry.eu/graphql', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tbody: JSON.stringify( {\n\t\t\tquery: `query q {\n currentOccupationStudy360 {\n locations\n visitors\n }\n}\n`,\n\t\t} ),\n\t} ).then( ( response ) => {\n\t\treturn response.json();\n\t} ).then( ( data ) => {\n\t\tif ( 0 < data?.data?.currentOccupationStudy360?.visitors ) {\n\t\t\tconst currentOccupationEl = document.getElementById( 'doormat-check-in-count-students' );\n\t\t\tif ( currentOccupationEl ) {\n\t\t\t\tcurrentOccupationEl.innerHTML = templateOccupancyStudy360( lang, data.data.currentOccupationStudy360.locations ?? 1, data.data.currentOccupationStudy360.visitors );\n\t\t\t}\n\t\t}\n\t} ).catch( ( err ) => {\n\t\tconsole.warn( err );\n\t\t// non-critical functionality.\n\t} );\n}\n\ninit();\n\nrequestAnimationFrame( () => {\n\tinit();\n} );\n\ndocument.addEventListener( 'readystatechange', () => {\n\tinit();\n} );\n","const query = window.matchMedia( '(prefers-reduced-motion: no-preference)' );\n\nexport function prefersReducedMotion(): boolean {\n\treturn !query.matches;\n}\n","/* core-web-ignore @mrhenry/core-web/modules/WebAnimations */\n\nimport { prefersReducedMotion } from '@mrhenry/wp--prefers-reduced-motion';\n\nfunction getMaxTiming( timing: EffectTiming ): number {\n\tlet max = 0;\n\n\tif ( ( timing.delay ?? 0 ) > max ) {\n\t\tmax = timing.delay ?? max;\n\t}\n\n\tif ( ( timing.endDelay ?? 0 ) > max ) {\n\t\tmax = timing.endDelay ?? max;\n\t}\n\n\tif ( 'auto' === timing.duration ) {\n\t\t// noop\n\t} else if ( 'number' === typeof timing.duration && timing.duration > max ) {\n\t\tmax = timing.duration;\n\t}\n\n\treturn max;\n}\n\nfunction scaleToMaxTiming( timing: EffectTiming, max: number ): OptionalEffectTiming {\n\tif ( timing.delay ) {\n\t\ttiming.delay = timing.delay / max;\n\t} else {\n\t\ttiming.delay = 0;\n\t}\n\n\tif ( timing.endDelay ) {\n\t\ttiming.endDelay = timing.endDelay / max;\n\t} else {\n\t\ttiming.endDelay = 0;\n\t}\n\n\tif ( 'auto' === timing.duration ) {\n\t\ttiming.duration = 1;\n\t} else if ( 'number' === typeof timing.duration ) {\n\t\ttiming.duration = timing.duration / max;\n\t} else if ( 'undefined' === typeof timing.duration ) {\n\t\t// see: https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1567\n\t\ttiming.duration = undefined;\n\t} else {\n\t\t// see: https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1567\n\t\ttiming.duration = 1;\n\t}\n\n\tif ( timing.iterations === Infinity ) {\n\t\ttiming.iterations = 1.0;\n\t}\n\n\t// see: https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1567\n\treturn timing as OptionalEffectTiming;\n}\n\n// Keep the same timing scale, just make it all very small\nfunction reduceMotion( keyframeEffects: KeyframeEffect[] ): void {\n\tif ( !( 'KeyframeEffect' in window ) || ( 'undefined' === typeof KeyframeEffect ) ) {\n\t\treturn;\n\t}\n\n\tif ( !KeyframeEffect.prototype.getTiming ) {\n\t\treturn;\n\t}\n\n\tif ( !KeyframeEffect.prototype.updateTiming ) {\n\t\treturn;\n\t}\n\n\tlet maxTiming = 0;\n\tkeyframeEffects.forEach( ( keyframeEffect ) => {\n\t\tconst newMax = getMaxTiming( keyframeEffect.getTiming() );\n\t\tif ( newMax > maxTiming ) {\n\t\t\tmaxTiming = newMax;\n\t\t}\n\t} );\n\n\tkeyframeEffects.forEach( ( keyframeEffect ) => {\n\t\tkeyframeEffect.updateTiming(\n\t\t\tscaleToMaxTiming(\n\t\t\t\tkeyframeEffect.getTiming(),\n\t\t\t\tmaxTiming\n\t\t\t)\n\t\t);\n\t} );\n}\n\n/**\n * Plays all animations and resolves when all animations are done.\n * Is aware of \"@mrhenry/wp--prefers-reduced-motion\"\n * @param {KeyframeEffect[]} keyframeEffects Collection of KeyFrameEffects to play and wait for.\n */\nexport function playAllAnimations( keyframeEffects: KeyframeEffect[] ): Promise {\n\tif ( !( 'Animation' in self ) ) {\n\t\treturn Promise.resolve();\n\t}\n\n\tif ( !( 'play' in Animation.prototype ) ) {\n\t\treturn Promise.resolve();\n\t}\n\n\tconst promises: Promise[] = [];\n\n\tif ( prefersReducedMotion() ) {\n\t\t// Very short animation without any delays\n\t\treduceMotion( keyframeEffects );\n\t}\n\n\tkeyframeEffects.forEach( ( keyframeEffect ) => {\n\t\tpromises.push( new Promise( ( resolve ) => {\n\t\t\tconst animation = new Animation( keyframeEffect, document.timeline );\n\t\t\tanimation.onfinish = ( (): void => {\n\t\t\t\tresolve();\n\t\t\t} );\n\n\t\t\tanimation.play();\n\t\t} ) );\n\t} );\n\n\treturn Promise.all( promises );\n}\n","import { playAllAnimations } from '@mrhenry/wp--play-all-animations';\n\ndeclare global {\n\tinterface Element {\n\t\tinert: boolean\n\t}\n}\n\ntype FocusableElement = Element & Record<'focus', () => void> | null;\n\nexport class MrDialog extends HTMLElement {\n\tstatic get observedAttributes(): Array {\n\t\treturn [\n\t\t\t'disabled',\n\t\t\t'data-state',\n\t\t];\n\t}\n\n\t// https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-7\n\t// Escape: Closes the dialog.\n\t#escapeHandler = ( e: KeyboardEvent ): void => {\n\t\tif ( 'Escape' !== e.code ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ( document.activeElement !== this ) && ( !this.contains( document.activeElement ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateState( 'close' );\n\t};\n\n\t#previousActiveElement:FocusableElement = null;\n\n\tconstructor() {\n\t\t// If you define a constructor, always call super() first!\n\t\t// This is specific to CE and required by the spec.\n\t\tsuper();\n\t}\n\n\tconnectedCallback(): void {\n\t\t// Default State\n\t\tif ( !this.state ) {\n\t\t\tthis.state = 'closed';\n\n\t\t\ttry {\n\t\t\t\tthis.inert = true;\n\t\t\t} catch ( err ) {\n\t\t\t\tconsole.warn( err );\n\t\t\t}\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\t// https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-7\n\t\t// Escape: Closes the dialog.\n\t\twindow.removeEventListener( 'keydown', this.#escapeHandler );\n\t}\n\n\t// Attributes\n\toverride setAttribute( attr: string, value: string ): void {\n\t\tif ( this.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'data-state' === attr ) {\n\t\t\tconst states = [\n\t\t\t\t'opening',\n\t\t\t\t'open',\n\t\t\t\t'closing',\n\t\t\t\t'closed',\n\t\t\t\t'broken',\n\t\t\t];\n\n\t\t\tif ( -1 === states.indexOf( value ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsuper.setAttribute( 'data-state', value );\n\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.setAttribute( attr, value );\n\t}\n\n\toverride removeAttribute( attr: string ): void {\n\t\tif ( this.disabled && 'disabled' !== attr ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.removeAttribute( attr );\n\t}\n\n\tget disabled(): boolean {\n\t\treturn this.hasAttribute( 'disabled' );\n\t}\n\n\tset disabled( value: boolean ) {\n\t\tif ( value ) {\n\t\t\tthis.setAttribute( 'disabled', '' );\n\t\t} else {\n\t\t\tthis.removeAttribute( 'disabled' );\n\t\t}\n\t}\n\n\tget state() :string {\n\t\treturn this.getAttribute( 'data-state' ) || '';\n\t}\n\n\tset state( value: string ) {\n\t\tthis.setAttribute( 'data-state', value );\n\t}\n\n\t/**\n\t * Update the state of the dialog\n\t * @param {string} directive The directive for the state machine\n\t * @return\n\t */\n\tasync updateState( directive: string ): Promise {\n\t\tif ( this.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\tswitch ( this.state ) {\n\t\t\t\tcase 'closed':\n\t\t\t\t\tswitch ( directive ) {\n\t\t\t\t\t\tcase 'open':\n\t\t\t\t\t\t\t// Store current focus\n\t\t\t\t\t\t\tif ( document.activeElement && 'focus' in document.activeElement ) {\n\t\t\t\t\t\t\t\tthis.#previousActiveElement = document.activeElement as FocusableElement;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tawait this.willOpen();\n\n\t\t\t\t\t\t\t// Update focusability\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tthis.inert = false;\n\t\t\t\t\t\t\t} catch ( err ) {\n\t\t\t\t\t\t\t\tconsole.warn( err );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Update state\n\t\t\t\t\t\t\tthis.state = 'opening';\n\n\t\t\t\t\t\t\t// Set focus\n\t\t\t\t\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\t\t\t\t\t// https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-7\n\t\t\t\t\t\t\t\t// When a dialog opens, focus placement depends on the nature and size of the content.\n\t\t\t\t\t\t\t\t// In all circumstances, focus moves to an element contained in the dialog.\n\t\t\t\t\t\t\t\tthis.firstFocusableElement()?.focus();\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tawait playAllAnimations( this.openAnimations() );\n\n\t\t\t\t\t\t\tawait this.didOpen();\n\n\t\t\t\t\t\t\t// Update state\n\t\t\t\t\t\t\tthis.state = 'open';\n\n\t\t\t\t\t\t\t// https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-7\n\t\t\t\t\t\t\t// Escape: Closes the dialog.\n\t\t\t\t\t\t\twindow.addEventListener( 'keydown', this.#escapeHandler );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'open':\n\t\t\t\t\tswitch ( directive ) {\n\t\t\t\t\t\tcase 'close':\n\t\t\t\t\t\t\tawait this.willClose();\n\n\t\t\t\t\t\t\t// Update focusability\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tthis.inert = true;\n\t\t\t\t\t\t\t} catch ( err ) {\n\t\t\t\t\t\t\t\tconsole.warn( err );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Update state\n\t\t\t\t\t\t\tthis.state = 'closing';\n\n\t\t\t\t\t\t\t// Reset current focus\n\t\t\t\t\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\t\t\t\t\tif ( this.#previousActiveElement ) {\n\t\t\t\t\t\t\t\t\tthis.#previousActiveElement.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tawait playAllAnimations( this.closeAnimations() );\n\n\t\t\t\t\t\t\tawait this.didClose();\n\n\t\t\t\t\t\t\t// Update state\n\t\t\t\t\t\t\tthis.state = 'closed';\n\n\t\t\t\t\t\t\t// https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-7\n\t\t\t\t\t\t\t// Escape: Closes the dialog.\n\t\t\t\t\t\t\twindow.removeEventListener( 'keydown', this.#escapeHandler );\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\n\t\t} catch ( err ) {\n\t\t\tthis.state = 'broken';\n\t\t\tthis.disabled = true;\n\n\t\t\tconsole.warn( err );\n\n\t\t\tif ( 'bugsnagClient' in window ) {\n\t\t\t\twindow.bugsnagClient.notify( err );\n\t\t\t}\n\n\t\t\tthis.gracefullShutdown();\n\t\t}\n\t}\n\n\t/**\n\t * Called when an unexpected error occurs.\n\t * Make sure to do all needed cleanup.\n\t */\n\tgracefullShutdown(): void {\n\t\ttry {\n\t\t\tthis.inert = true;\n\t\t} catch ( err ) {\n\t\t\tthis.hidden = true;\n\t\t\tconsole.warn( err );\n\t\t}\n\t}\n\n\t/**\n\t * Called before transitioning to the \"open\" state\n\t * Optionally implement this in your sub class\n\t */\n\tasync willOpen(): Promise {\n\t\tawait Promise.resolve();\n\t}\n\n\t/**\n\t * Called after transitioning to the \"open\" state\n\t * Optionally implement this in your sub class\n\t */\n\tasync didOpen(): Promise {\n\t\tawait Promise.resolve();\n\t}\n\n\t/**\n\t * Called before transitioning to the \"closed\" State\n\t * Optionally implement this in your sub class\n\t */\n\tasync willClose(): Promise {\n\t\tawait Promise.resolve();\n\t}\n\n\t/**\n\t * Called after transitioning to the \"closed\" state\n\t * Optionally implement this in your sub class\n\t */\n\tasync didClose(): Promise {\n\t\tawait Promise.resolve();\n\t}\n\n\t/**\n\t * The animations to play and wait for when opening the dialog\n\t * Optionally implement this in your sub class\n\t * @return {Array} The KeyframeEffects to play\n\t */\n\topenAnimations(): Array {\n\t\treturn [];\n\t}\n\n\t/**\n\t * The animations to play and wait for when closing the dialog\n\t * Implement this in your sub class\n\t * @return {Array} The KeyframeEffects to play\n\t */\n\tcloseAnimations(): Array {\n\t\treturn [];\n\t}\n\n\t// https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-7\n\t// When a dialog opens, focus placement depends on the nature and size of the content.\n\t// - In all circumstances, focus moves to an element contained in the dialog.\n\t// - Unless a condition where doing otherwise is advisable,\n\t// focus is initially set on the first focusable element.\n\t// - If content is large enough that focusing the first interactive element could cause the beginning of content to scroll out of view,\n\t// it is advisable to add tabindex=-1 to a static element at the top of the dialog,\n\t// such as the dialog title or first paragraph, and initially focus that element.\n\t// - If a dialog contains the final step in a process that is not easily reversible,\n\t// such as deleting data or completing a financial transaction,\n\t// it may be advisable to set focus on the least destructive action,\n\t// especially if undoing the action is difficult or impossible.\n\t// The Alert Dialog Pattern is often employed in such circumstances.\n\t// - If a dialog is limited to interactions that either provide additional information or continue processing,\n\t// it may be advisable to set focus to the element that is likely to be most frequently used,\n\t// such as an OK or Continue button.\n\tfirstFocusableElement(): HTMLElement | void {\n\t\tif ( !this.parentNode ) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst autoFocusChild = this.querySelector( '[modal-autofocus]' );\n\t\tif ( autoFocusChild && autoFocusChild instanceof HTMLElement ) {\n\t\t\treturn autoFocusChild;\n\t\t}\n\n\t\tconst firstFocusableChild = this.querySelector( 'button, [href], input, radio, select, textarea, [tabindex]' );\n\t\tif ( firstFocusableChild && firstFocusableChild instanceof HTMLElement ) {\n\t\t\treturn firstFocusableChild;\n\t\t}\n\n\t\treturn this;\n\t}\n}\n","import { MrDialog } from '@mrhenry/wp--mr-interactive';\n\nclass MrLocationDataErrorDialog extends MrDialog {\n\toverride firstFocusableElement(): HTMLElement | void {\n\t\t/**\n\t\t * Override the super so the focus isn't moved to this dialog when it\n\t\t * is shown. The dialog is informative, so we let the user keep their\n\t\t * focus on the currently active element.\n\t\t */\n\t\tif ( document.activeElement && ( document.activeElement instanceof HTMLElement ) ) {\n\t\t\treturn document.activeElement;\n\t\t}\n\n\t\treturn super.firstFocusableElement();\n\t}\n}\n\ncustomElements.define( 'mr-location-data-error-dialog', MrLocationDataErrorDialog );\n","class MrLocationsFilter extends HTMLElement {\n\t#clickHandler = ( e: Event ) => {\n\t\tconst target = e.target;\n\t\tif ( !isLocationButtonElement( target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst clickedFilterButton = target.closest( '[data-location-filter-button]' );\n\t\tif ( !clickedFilterButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( clickedFilterButton.getAttribute( 'aria-pressed' ) === 'true' ) {\n\t\t\tclickedFilterButton.setAttribute( 'aria-pressed', 'false' );\n\t\t} else {\n\t\t\tclickedFilterButton.setAttribute( 'aria-pressed', 'true' );\n\t\t}\n\n\t\tconst filters = this.querySelectorAll( '[data-location-filter-button]' );\n\t\tif ( !filters.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet query = '';\n\t\tlet onlyCurrentlyOpen = false;\n\n\t\tfilters.forEach( ( filter ) => {\n\t\t\tconst filterType = filter.getAttribute( 'data-filter-type' );\n\t\t\tconst filterValue = filter.getAttribute( 'data-filter-value' );\n\t\t\tconst active = filter.getAttribute( 'aria-pressed' ) === 'true';\n\n\t\t\tif ( filterType === 'location-service' && active ) {\n\t\t\t\tquery += `[data-location-services~=\"${filterValue}\"]`;\n\t\t\t}\n\n\t\t\tif ( filterType === 'open-status' && active ) {\n\t\t\t\tonlyCurrentlyOpen = true;\n\t\t\t}\n\t\t} );\n\n\t\tdocument.querySelectorAll( '[filterable]' ).forEach( ( item ) => {\n\t\t\titem.setAttribute( 'hidden', '' );\n\t\t} );\n\n\t\tdocument.querySelectorAll( '[filterable]' + query ).forEach( ( item ) => {\n\t\t\tif ( !onlyCurrentlyOpen ) {\n\t\t\t\titem.removeAttribute( 'hidden' );\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( item.querySelector( '[location-is-currently-open]' ) !== null ) {\n\t\t\t\titem.removeAttribute( 'hidden' );\n\t\t\t}\n\t\t} );\n\n\t\tconst noResultsMessage = document.querySelector( '[data-no-location-results]' );\n\t\tif ( noResultsMessage ) {\n\t\t\tnoResultsMessage.removeAttribute( 'hidden' );\n\t\t\tif ( document.querySelectorAll( '[filterable]:not([hidden])' ).length > 0 ) {\n\t\t\t\tnoResultsMessage.setAttribute( 'hidden', 'hidden' );\n\t\t\t}\n\t\t}\n\n\t\tthis.dispatchEvent( new CustomEvent( 'filter-changed', {\n\t\t\tbubbles: true,\n\t\t} ) );\n\t};\n\n\tconnectedCallback() {\n\t\tthis.addEventListener( 'click', this.#clickHandler );\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeEventListener( 'click', this.#clickHandler );\n\t}\n}\n\ncustomElements.define( 'mr-locations-filter', MrLocationsFilter );\n\nfunction isLocationButtonElement( el: EventTarget|null ): el is HTMLElement {\n\treturn !!el && ( 'className' in el ) && ( 'getAttribute' in el ) && ( 'closest' in el );\n}\n","class MrLocationsSorter extends HTMLElement {\n\t#changeHandler = ( e: Event ) => {\n\t\tconst target = e.target;\n\n\t\tif ( !( target instanceof HTMLSelectElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !target.hasAttribute( 'filter-location-sorting' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst locations = Array.from( document.querySelectorAll( '[sortable]' ) );\n\t\tif ( !locations ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet order = 'ASC';\n\t\tlet sortAttribute = 'sort-by-alphabet';\n\n\t\tif ( target.value === 'capacity' ) {\n\t\t\tsortAttribute = 'sort-by-value';\n\t\t\torder = 'DESC';\n\t\t}\n\n\t\tconst direction = ( x: number ) => {\n\t\t\tif ( order === 'ASC' ) {\n\t\t\t\treturn x;\n\t\t\t}\n\n\t\t\treturn -x;\n\t\t};\n\n\t\t// The actual sorting.\n\t\tconst sortableAttributeValues = new Map();\n\n\t\tlocations.forEach( ( location ) => {\n\t\t\tsortableAttributeValues.set( location, location.getAttribute( sortAttribute ) ?? '0' );\n\t\t} );\n\n\t\tlocations.sort( ( a, b ) => {\n\t\t\tlet aSortValue = sortableAttributeValues.get( a );\n\t\t\tlet bSortValue = sortableAttributeValues.get( b );\n\n\t\t\tif ( sortAttribute === 'sort-by-value' ) {\n\t\t\t\taSortValue = parseInt( aSortValue, 10 );\n\t\t\t\tbSortValue = parseInt( bSortValue, 10 );\n\t\t\t}\n\n\t\t\tif ( aSortValue < bSortValue ) {\n\t\t\t\treturn direction( -1 );\n\t\t\t}\n\n\t\t\tif ( aSortValue > bSortValue ) {\n\t\t\t\treturn direction( 1 );\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t} );\n\n\t\tlocations.forEach( ( el ) => {\n\t\t\tel.parentElement?.appendChild( el );\n\t\t} );\n\t};\n\n\tconnectedCallback() {\n\t\tthis.addEventListener( 'change', this.#changeHandler );\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeEventListener( 'change', this.#changeHandler );\n\t}\n}\n\ncustomElements.define( 'mr-locations-sorter', MrLocationsSorter );\n","export const i18nDaysOfWeek = {\n\tnl: [\n\t\t'Zondag',\n\t\t'Maandag',\n\t\t'Dinsdag',\n\t\t'Woensdag',\n\t\t'Donderdag',\n\t\t'Vrijdag',\n\t\t'Zaterdag',\n\n\t],\n\ten: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nexport const i18nToday = {\n\tnl: 'Vandaag',\n\ten: 'Today',\n};\n\nexport const i18nTomorrow = {\n\tnl: 'Morgen',\n\ten: 'Tomorrow',\n};\n","import { templateAvailableSeats } from '../templates/available-seats';\nimport { templateOpenFromTo } from '../templates/open-from-to';\nimport { i18nDaysOfWeek, i18nToday, i18nTomorrow } from '../templates/time';\nimport type { MrDialog } from '@mrhenry/wp--mr-interactive';\nimport { templateOccupancyStudy360 } from '../templates/occupancy-study360';\nimport { getIndicatorColorForLocation } from './location-status-indication-color';\n\ntype langOption = 'nl' | 'en';\nconst lang : langOption = ( ( document.documentElement.getAttribute( 'lang' ) ?? 'nl' ) as langOption );\nlet didShowErrorDialog = false;\n\nasync function init() {\n\n\tconst el = document.querySelector( '[single-location-id]' );\n\tif ( !el ) {\n\t\treturn;\n\t}\n\n\tconst locationId = el.getAttribute( 'single-location-id' );\n\tif ( !locationId ) {\n\t\treturn;\n\t}\n\n\tel.removeAttribute( 'single-location-id' );\n\n\tawait updateView( locationId );\n\tsetInterval( async() => {\n\t\tawait updateView( locationId );\n\t}, 31 * 1000 );\n}\n\nasync function updateView( locationId: string ) {\n\tawait fetch( 'https://study360-api.mrhenry.eu/graphql', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tbody: JSON.stringify( {\n\t\t\tquery: `query q($location_id: ID!) {\n currentOccupationStudy360 {\n locations\n visitors\n }\n location(id: $location_id) {\n id\n name\n currentOpeningTimeToday {\n capacity\n closingTime\n openingTime\n }\n nextOpeningTimeToday {\n capacity\n closingTime\n openingTime\n }\n openingDays {\n dayAndMonth\n dayOfWeek\n isToday\n isTomorrow\n openingTimes {\n capacity\n closingTime\n openingTime\n }\n }\n currentOccupation\n atMaximumCapacity\n calendarURL\n isCurrentlyOpen\n }\n}\n`,\n\t\t\tvariables: {\n\t\t\t\tlocation_id: locationId,\n\t\t\t},\n\t\t} ),\n\t} ).then( ( response ) => {\n\t\treturn response.json();\n\t} ).then( ( data ) => {\n\t\tif ( !( data?.data?.location ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst locationStatusColor = getIndicatorColorForLocation( data.data.location );\n\n\t\tdocument.head.querySelectorAll( 'link[data-dynamic-icon]' ).forEach( ( link ) => {\n\t\t\tconst prefix = link.getAttribute( 'data-href-prefix' );\n\t\t\tif ( !prefix ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst suffix = link.getAttribute( 'data-href-suffix' );\n\t\t\tif ( !suffix ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlink.href = `${prefix}/assets/favicons/${locationStatusColor}/${suffix}`;\n\t\t} );\n\n\t\tconst openingHoursTableEl = document.getElementById( 'opening-hours-table' );\n\t\tif ( openingHoursTableEl ) {\n\t\t\topeningHoursTableEl.innerHTML = tableTemplate( data.data.location.openingDays as Array );\n\t\t}\n\n\t\tconst closedAction = document.getElementById( 'hero-action--closed' );\n\t\tif ( closedAction ) {\n\t\t\tif ( ( !data.data.location.currentOpeningTimeToday && !data.data.location.nextOpeningTimeToday ) ) {\n\t\t\t\tclosedAction.removeAttribute( 'hidden' );\n\t\t\t} else {\n\t\t\t\tclosedAction.setAttribute( 'hidden', '' );\n\t\t\t}\n\t\t}\n\n\t\tconst openAction = document.getElementById( 'hero-action--open' );\n\t\tconst openActionHours = document.getElementById( 'hero-action--open--hours' );\n\t\tif ( openAction && openActionHours ) {\n\t\t\tif ( data.data.location.currentOpeningTimeToday || data.data.location.nextOpeningTimeToday ) {\n\t\t\t\topenAction.removeAttribute( 'hidden' );\n\n\t\t\t\tconst slot = data.data.location.currentOpeningTimeToday ?? data.data.location.nextOpeningTimeToday;\n\t\t\t\topenActionHours.innerHTML = templateOpenFromTo( lang, slot.openingTime, slot.closingTime );\n\t\t\t} else {\n\t\t\t\topenAction.setAttribute( 'hidden', '' );\n\t\t\t\topenActionHours.innerHTML = '';\n\t\t\t}\n\t\t}\n\n\t\tconst seatsAction = document.getElementById( 'hero-action--available-seats' );\n\t\tconst seatsActionCounter = document.getElementById( 'hero-action--available-seats--counter' );\n\t\tif ( seatsAction && seatsActionCounter ) {\n\t\t\tif ( data.data.location.currentOpeningTimeToday ) {\n\t\t\t\tlet availableSeats = Math.max( 0, data.data.location.currentOpeningTimeToday.capacity - data.data.location.currentOccupation );\n\t\t\t\tif ( data.data.location.atMaximumCapacity ) {\n\t\t\t\t\tavailableSeats = 0;\n\t\t\t\t}\n\n\t\t\t\tseatsAction.removeAttribute( 'hidden' );\n\t\t\t\tseatsActionCounter.innerHTML = templateAvailableSeats( lang, availableSeats );\n\t\t\t} else {\n\t\t\t\tseatsAction.setAttribute( 'hidden', '' );\n\t\t\t\tseatsActionCounter.innerHTML = '';\n\t\t\t}\n\t\t}\n\n\t\tif ( 0 < data?.data?.currentOccupationStudy360?.visitors ) {\n\t\t\tconst currentOccupationEl = document.getElementById( 'doormat-check-in-count-students' );\n\t\t\tif ( currentOccupationEl ) {\n\t\t\t\tcurrentOccupationEl.innerHTML = templateOccupancyStudy360( lang, data.data.currentOccupationStudy360.locations ?? 1, data.data.currentOccupationStudy360.visitors );\n\t\t\t}\n\t\t}\n\t} ).catch( ( err ) => {\n\t\tconsole.warn( err );\n\n\t\tif ( !didShowErrorDialog ) {\n\t\t\tdidShowErrorDialog = true;\n\t\t\t( document.getElementById( 'calendar-data-error-dialog' ) as MrDialog | null )?.updateState( 'open' );\n\t\t}\n\t} );\n}\n\ntype OpeningDay = {\n\tdate: string,\n\tdayAndMonth: string,\n\tdayOfWeek: number,\n\tisToday: boolean,\n\tisTomorrow: boolean,\n\topeningTimes?: Array,\n}\n\ntype OpeningTime = {\n\tcapacity: number,\n\tclosingTime: string,\n\tdate: string,\n\topeningTime: string\n}\n\nfunction tableTemplate( days: Array ) {\n\tlet rows = '';\n\n\tfor ( let i = 0; i < days.length; i++ ) {\n\t\tconst day = days[i];\n\n\t\tlet dayOfWeekLabel = '';\n\t\tif ( day.isToday ) {\n\t\t\tdayOfWeekLabel = i18nToday[lang];\n\t\t} else if ( day.isTomorrow ) {\n\t\t\tdayOfWeekLabel = i18nTomorrow[lang];\n\t\t} else {\n\t\t\tdayOfWeekLabel = `${i18nDaysOfWeek[lang][day.dayOfWeek]} ${day.dayAndMonth}`;\n\t\t}\n\n\t\trows += templateTableRow( dayOfWeekLabel, day.openingTimes ?? [] );\n\t}\n\n\treturn `\n\t\t\n\t\t\t\n\t\t\t\t${rows}\n\t\t\t\n\t\t
\n\t`;\n}\n\n\nfunction templateTableRow( dayOfWeekLabel: string, times: Array ) {\n\tconst slotsFormatted = times.map( ( time ) => {\n\t\treturn `${time.openingTime} - ${time.closingTime}`;\n\t} ).join( '' );\n\n\tconst seats = {\n\t\tnl: 'plaatsen',\n\t\ten: 'seats',\n\t};\n\n\tconst capacitiesFormatted = times.map( ( time ) => {\n\t\treturn `${time.capacity} ${seats[lang]}`;\n\t} ).join( '' );\n\n\tlet closedLabel = 'Gesloten';\n\tif ( 'en' === lang ) {\n\t\tclosedLabel = 'Closed';\n\t}\n\n\tlet slotsHTML = `\n\t\t\n\t\t\t${closedLabel}\n\t\t | `;\n\n\tlet capacitiesHTML = ' | ';\n\n\tif ( 0 < times.length ) {\n\t\tslotsHTML = `\n\t\t\t\n\t\t\t\t${slotsFormatted}\n\t\t\t | `;\n\n\t\tcapacitiesHTML = `\n\t\t\t\n\t\t\t\t${capacitiesFormatted}\n\t\t\t | `;\n\t}\n\n\treturn `\n\t\t\n\t\t\t${dayOfWeekLabel} | \n\n\t\t\t${slotsHTML}\n\n\t\t\t${capacitiesHTML}\n\t\t
\n\t`;\n}\n\ninit();\n\nrequestAnimationFrame( () => {\n\tinit();\n} );\n\ndocument.addEventListener( 'readystatechange', () => {\n\tinit();\n} );\n","import '@mrhenry/wp--bugsnag-config';\n\n// polyfills for lit\nimport '@mrhenry/core-web/modules/CustomEvent';\nimport '@mrhenry/core-web/modules/DOMTokenList';\nimport '@mrhenry/core-web/modules/DOMTokenList.prototype.@@iterator';\nimport '@mrhenry/core-web/modules/DOMTokenList.prototype.forEach';\nimport '@mrhenry/core-web/modules/DOMTokenList.prototype.replace';\nimport '@mrhenry/core-web/modules/DocumentFragment';\nimport '@mrhenry/core-web/modules/DocumentFragment.prototype.append';\nimport '@mrhenry/core-web/modules/Element.prototype.append';\nimport '@mrhenry/core-web/modules/Element.prototype.classList';\nimport '@mrhenry/core-web/modules/Element.prototype.getAttributeNames';\nimport '@mrhenry/core-web/modules/Element.prototype.matches';\nimport '@mrhenry/core-web/modules/Element.prototype.remove';\nimport '@mrhenry/core-web/modules/Event';\nimport '@mrhenry/core-web/modules/HTMLTemplateElement';\nimport '@mrhenry/core-web/modules/MediaQueryList.prototype.addEventListener';\nimport '@mrhenry/core-web/modules/MutationObserver';\nimport '@mrhenry/core-web/modules/Node.prototype.contains';\nimport '@mrhenry/core-web/modules/NodeList.prototype.@@iterator';\nimport '@mrhenry/core-web/modules/NodeList.prototype.forEach';\nimport '@mrhenry/core-web/modules/console';\nimport '@mrhenry/core-web/modules/console.error';\nimport '@mrhenry/core-web/modules/console.log';\nimport '@mrhenry/core-web/modules/matchMedia';\nimport '@mrhenry/core-web/modules/requestAnimationFrame';\nif ( 1 === parseInt( '0', 10 ) ) { // fix to force globalThis polyfill\n\t// eslint-disable-next-line no-undef\n\tconsole.log( globalThis );\n}\n// polyfills for lit\n\nimport './modules/visitor-registration/visitor-registration';\nimport './modules/visitor-registration/visitor-verification';\n\nimport './modules/location-registration/location-registration';\n\nimport './modules/accordion';\nimport './modules/location-picker';\nimport './modules/sidenav';\nimport './modules/toggle';\n\nimport './modules/archive-location-api-data';\nimport './modules/doormat-count';\nimport './modules/location-data-error-dialog';\nimport './modules/location-status-indication-color';\nimport './modules/locations-filter';\nimport './modules/locations-sorter';\nimport './modules/single-location-api-data';\n"],"names":["isCallable","tryToString","$TypeError","TypeError","module","exports","argument","isConstructor","isPossiblePrototype","$String","String","has","it","wellKnownSymbol","create","defineProperty","UNSCOPABLES","ArrayPrototype","Array","prototype","undefined","configurable","value","key","charAt","S","index","unicode","length","isPrototypeOf","Prototype","isObject","ArrayBuffer","DataView","uncurryThisAccessor","classof","O","byteLength","uncurryThis","arrayBufferByteLength","slice","error","global","toIndex","isDetached","detachTransferable","PROPER_STRUCTURED_CLONE_TRANSFER","structuredClone","min","Math","ArrayBufferPrototype","DataViewPrototype","isResizable","maxByteLength","getInt8","setInt8","arrayBuffer","newLength","preserveResizability","newBuffer","newByteLength","fixedLength","transfer","options","a","b","copyLength","i","NAME","Constructor","NATIVE_ARRAY_BUFFER","DESCRIPTORS","hasOwn","createNonEnumerableProperty","defineBuiltIn","defineBuiltInAccessor","getPrototypeOf","setPrototypeOf","uid","InternalStateModule","enforceInternalState","enforce","getInternalState","get","Int8Array","Int8ArrayPrototype","Uint8ClampedArray","Uint8ClampedArrayPrototype","TypedArray","TypedArrayPrototype","ObjectPrototype","Object","TO_STRING_TAG","TYPED_ARRAY_TAG","TYPED_ARRAY_CONSTRUCTOR","NATIVE_ARRAY_BUFFER_VIEWS","opera","TYPED_ARRAY_TAG_REQUIRED","TypedArrayConstructorsList","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigIntArrayConstructorsList","BigInt64Array","BigUint64Array","getTypedArrayConstructor","proto","state","isTypedArray","klass","Function","this","aTypedArray","aTypedArrayConstructor","C","exportTypedArrayMethod","KEY","property","forced","ARRAY","TypedArrayConstructor","error2","exportTypedArrayStaticMethod","isView","FunctionName","defineBuiltIns","fails","anInstance","toIntegerOrInfinity","toLength","fround","IEEE754","arrayFill","arraySlice","inheritIfRequired","copyConstructorProperties","setToStringTag","PROPER_FUNCTION_NAME","PROPER","CONFIGURABLE_FUNCTION_NAME","CONFIGURABLE","ARRAY_BUFFER","DATA_VIEW","PROTOTYPE","WRONG_INDEX","getInternalArrayBufferState","getterFor","getInternalDataViewState","setInternalState","set","NativeArrayBuffer","$ArrayBuffer","$DataView","RangeError","fill","reverse","packIEEE754","pack","unpackIEEE754","unpack","packInt8","number","packInt16","packInt32","unpackInt32","buffer","packFloat32","packFloat64","addGetter","view","count","isLittleEndian","store","intIndex","boolIsLittleEndian","bytes","start","byteOffset","conversion","INCORRECT_ARRAY_BUFFER_NAME","name","NaN","constructor","testView","$setInt8","setUint8","unsafe","type","detached","bufferState","bufferLength","offset","getUint8","getInt16","arguments","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","toObject","toAbsoluteIndex","lengthOfArrayLike","argumentsLength","end","endPos","list","$length","result","toIndexedObject","createMethod","IS_INCLUDES","$this","el","fromIndex","includes","indexOf","bind","IndexedObject","TYPE","IS_FIND_LAST_INDEX","callbackfn","that","self","boundFunction","findLast","findLastIndex","arraySpeciesCreate","push","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","IS_FILTER_REJECT","NO_HOLES","specificCreate","target","forEach","map","filter","some","every","find","findIndex","filterReject","METHOD_NAME","method","call","aCallable","REDUCE_EMPTY","IS_RIGHT","memo","left","right","isArray","getOwnPropertyDescriptor","SILENT_ON_NON_WRITABLE_LENGTH_SET","writable","floor","sort","array","comparefn","element","j","middle","llength","rlength","lindex","rindex","SPECIES","$Array","originalArray","arraySpeciesConstructor","len","A","k","$RangeError","relativeIndex","actualIndex","ITERATOR","SAFE_CLOSING","called","iteratorWithReturn","next","done","from","exec","SKIP_CLOSING","ITERATION_SUPPORT","object","toString","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","$Object","CORRECT_ARGUMENTS","tag","tryGet","callee","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","source","exceptions","keys","f","F","createPropertyDescriptor","bitmap","enumerable","makeBuiltIn","descriptor","getter","setter","defineGlobalProperty","simple","nonConfigurable","nonWritable","src","P","WorkerThreads","channel","$detach","tryNodeRequire","$MessageChannel","MessageChannel","detach","transferable","port1","postMessage","document","EXISTS","createElement","IndexSizeError","s","c","m","DOMStringSizeError","HierarchyRequestError","WrongDocumentError","InvalidCharacterError","NoDataAllowedError","NoModificationAllowedError","NotFoundError","NotSupportedError","InUseAttributeError","InvalidStateError","SyntaxError","InvalidModificationError","NamespaceError","InvalidAccessError","ValidationError","TypeMismatchError","SecurityError","NetworkError","AbortError","URLMismatchError","QuotaExceededError","TimeoutError","InvalidNodeTypeError","DataCloneError","firefox","match","IS_DENO","IS_NODE","window","Deno","version","UA","test","userAgent","Pebble","process","navigator","versions","v8","split","webkit","$Error","Error","replace","TEST","stack","V8_OR_CHAKRA_STACK_ENTRY","IS_V8_OR_CHAKRA_STACK","dropEntries","prepareStackTrace","clearErrorStack","ERROR_STACK_INSTALLABLE","captureStackTrace","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","dontCallGetSet","sham","regexpExec","RegExpPrototype","RegExp","FORCED","SHAM","SYMBOL","DELEGATES_TO_SYMBOL","DELEGATES_TO_EXEC","execCalled","re","flags","nativeRegExpMethod","methods","nativeMethod","regexp","str","arg2","forceStringMethod","$exec","NATIVE_BIND","FunctionPrototype","apply","Reflect","fn","hasOwnProperty","getDescriptor","uncurryThisWithBind","namespace","obj","iterator","getMethod","isNullOrUndefined","Iterators","anObject","getIteratorMethod","usingIterator","iteratorMethod","replacer","rawLength","keysLength","root","V","func","getIteratorDirect","INVALID_SIZE","max","SetRecord","intSize","size","getIterator","numSize","SUBSTITUTION_SYMBOLS","SUBSTITUTION_SYMBOLS_NO_NAMED","matched","position","captures","namedCaptures","replacement","tailPos","symbols","ch","capture","n","check","globalThis","g","console","getBuiltIn","abs","pow","log","LN2","mantissaLength","exponent","mantissa","exponentLength","eMax","eBias","rt","sign","Infinity","nBits","propertyIsEnumerable","dummy","Wrapper","NewTarget","NewTargetPrototype","functionToString","inspectSource","cause","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","metadata","facade","STATE","documentAll","all","noop","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","feature","detection","data","normalize","POLYFILL","NATIVE","string","toLowerCase","Number","isInteger","isFinite","USE_SYMBOL_AS_UID","$Symbol","record","ITERATOR_INSTEAD_OF_RECORD","step","isArrayIteratorMethod","iteratorClose","Result","stopped","ResultPrototype","iterable","unboundFunction","iterFn","AS_ENTRIES","IS_RECORD","IS_ITERATOR","INTERRUPTED","stop","condition","callFn","kind","innerResult","innerError","IteratorPrototype","returnThis","IteratorConstructor","ENUMERABLE_NEXT","$","IS_PURE","createIteratorConstructor","IteratorsCore","BUGGY_SAFARI_ITERATORS","KEYS","VALUES","ENTRIES","Iterable","DEFAULT","IS_SET","CurrentIteratorPrototype","getIterationMethod","KIND","defaultIterator","IterablePrototype","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","entries","values","PrototypeOfArrayIteratorPrototype","arrayIterator","join","CONFIGURABLE_LENGTH","TEMPLATE","arity","EPSILON","INVERSE_EPSILON","x","FLOAT_EPSILON","FLOAT_MAX_VALUE","FLOAT_MIN_VALUE","absolute","roundTiesToEven","floatRound","ceil","trunc","notify","toggle","node","promise","then","safeGetBuiltIn","macrotask","Queue","IS_IOS","IS_IOS_PEBBLE","IS_WEBOS_WEBKIT","MutationObserver","WebKitMutationObserver","Promise","microtask","queue","flush","parent","domain","exit","head","enter","resolve","nextTick","createTextNode","observe","characterData","add","PromiseCapability","reject","$$resolve","$$reject","$default","activeXDocument","definePropertiesModule","enumBugKeys","html","documentCreateElement","SCRIPT","IE_PROTO","EmptyConstructor","scriptTag","content","LT","NullProtoObjectViaActiveX","write","close","temp","parentWindow","NullProtoObject","ActiveXObject","iframeDocument","iframe","JS","style","display","appendChild","contentWindow","open","Properties","V8_PROTOTYPE_DEFINE_BUG","objectKeys","defineProperties","props","IE8_DOM_DEFINE","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","concat","getOwnPropertyNames","getOwnPropertySymbols","CORRECT_PROTOTYPE_GETTER","names","$propertyIsEnumerable","NASHORN_BUG","requireObjectCoercible","aPossiblePrototype","CORRECT_SETTER","__proto__","input","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","NativePromiseConstructor","IS_BROWSER","V8_VERSION","NativePromisePrototype","SUBCLASSING","NATIVE_PROMISE_REJECTION_EVENT","PromiseRejectionEvent","FORCED_PROMISE_CONSTRUCTOR","PROMISE_CONSTRUCTOR_SOURCE","GLOBAL_CORE_JS_PROMISE","FakePromise","CONSTRUCTOR","REJECTION_EVENT","newPromiseCapability","promiseCapability","checkCorrectnessOfIteration","Target","Source","tail","item","entry","R","re1","re2","regexpFlags","stickyHelpers","UNSUPPORTED_DOT_ALL","UNSUPPORTED_NCG","nativeReplace","nativeExec","patchedExec","UPDATES_LAST_INDEX_WRONG","lastIndex","UNSUPPORTED_Y","BROKEN_CARET","NPCG_INCLUDED","reCopy","group","raw","groups","sticky","charsAdded","strCopy","multiline","hasIndices","ignoreCase","dotAll","unicodeSets","$RegExp","MISSED_STICKY","SetHelpers","iterate","Set","aSet","clone","getSetRecord","iterateSet","iterateSimple","remove","other","otherRec","e","SetPrototype","interruptible","createSetLike","CONSTRUCTOR_NAME","keysIter","TAG","SHARED","mode","copyright","license","aConstructor","defaultConstructor","charCodeAt","CONVERT_TO_STRING","pos","first","second","codeAt","whitespaces","ltrim","rtrim","trim","V8","symbol","Symbol","$location","defer","port","validateArgumentsLength","setImmediate","clear","clearImmediate","Dispatch","counter","ONREADYSTATECHANGE","location","run","id","runner","eventListener","event","globalPostMessageDefer","protocol","host","handler","args","now","port2","onmessage","addEventListener","importScripts","removeChild","setTimeout","integer","toPrimitive","prim","BigInt","toPositiveInteger","BYTES","isSymbol","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","round","TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS","ArrayBufferViewCore","ArrayBufferModule","isIntegralNumber","toOffset","toUint8Clamped","typedArrayFrom","setSpecies","arrayFromConstructorAndList","nativeDefineProperty","nativeGetOwnPropertyDescriptor","BYTES_PER_ELEMENT","WRONG_LENGTH","isArrayBuffer","isTypedArrayIndex","wrappedGetOwnPropertyDescriptor","wrappedDefineProperty","wrapper","CLAMPED","GETTER","SETTER","NativeTypedArrayConstructor","TypedArrayConstructorPrototype","exported","addElement","typedArrayOffset","$len","isBigIntArray","toBigInt","thisIsBigIntArray","mapfn","mapping","postfix","random","url","URL","params","searchParams","params2","URLSearchParams","pathname","toJSON","href","username","hash","NATIVE_SYMBOL","passed","required","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","proxyAccessor","normalizeStringArgument","installErrorCause","installErrorStack","FULL_NAME","IS_AGGREGATE_ERROR","STACK_TRACE_LIMIT","OPTIONS_POSITION","path","ERROR_NAME","OriginalError","OriginalErrorPrototype","BaseError","WrappedError","message","speciesConstructor","nativeArrayBufferSlice","fin","viewSource","viewTarget","$transfer","transferToFixedLength","addToUnscopables","defineIterator","createIterResultObject","ARRAY_ITERATOR","iterated","Arguments","setArrayLength","doesNotExceedSafeInteger","properErrorOnNonWritableLength","argCount","$reduce","arrayMethodIsStrict","CHROME_VERSION","reduce","deletePropertyOrThrow","internalSort","FF","IE_OR_EDGE","WEBKIT","nativeSort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","STRICT_METHOD","STABLE_SORT","code","chr","fromCharCode","v","itemsLength","items","arrayLength","y","getSortCompare","unshift","to","wrapErrorConstructorWithCause","WEB_ASSEMBLY","WebAssembly","exportGlobalErrorCauseWrapper","exportWebAssemblyErrorCauseWrapper","init","getReplacerFunction","$stringify","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","$replacer","fixIllFormed","prev","stringify","space","newPromiseCapabilityModule","perform","capability","$promiseResolve","remaining","alreadyCalled","real","onRejected","Internal","OwnPromiseCapability","nativeThen","task","hostReportErrors","PromiseConstructorDetection","PROMISE","NATIVE_PROMISE_SUBCLASSING","getInternalPromiseState","PromiseConstructor","PromisePrototype","newGenericPromiseCapability","DISPATCH_EVENT","createEvent","dispatchEvent","UNHANDLED_REJECTION","isThenable","callReaction","reaction","exited","ok","fail","rejection","onHandleUnhandled","isReject","notified","reactions","onUnhandled","reason","initEvent","isUnhandled","emit","unwrap","internalReject","internalResolve","executor","onFulfilled","PromiseWrapper","wrap","race","r","capabilityReject","promiseResolve","PromiseConstructorWrapper","CHECK_WRAPPER","difference","setMethodAcceptSetLike","intersection","isDisjointFrom","isSubsetOf","isSupersetOf","symmetricDifference","union","fixRegExpWellKnownSymbolLogic","advanceStringIndex","getSubstitution","regExpExec","REPLACE","stringIndexOf","REPLACE_KEEPS_$0","REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE","_","maybeCallNative","UNSAFE_SUBSTITUTE","searchValue","replaceValue","rx","res","functionalReplace","fullUnicode","results","accumulatedResult","nextSourcePosition","replacerArgs","$trim","forcedStringTrimMethod","NativeSymbol","SymbolPrototype","description","EmptyStringDescriptionStore","SymbolWrapper","thisSymbolValue","symbolDescriptiveString","desc","$fill","actualValue","$findLastIndex","predicate","$findLast","$set","WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS","TO_OBJECT_BUG","arrayLike","ACCEPT_INCORRECT_ARGUMENTS","mod","expected","arrayToReversed","compareFn","createTypedArrayConstructor","arrayWith","PROPER_ORDER","DOMExceptionConstants","DOM_EXCEPTION","NativeDOMException","$DOMException","DOMExceptionPrototype","ERROR_HAS_STACK","DOM_EXCEPTION_HAS_STACK","BUGGY_DESCRIPTOR","FORCED_CONSTRUCTOR","DOMException","PolyfilledDOMException","PolyfilledDOMExceptionPrototype","constant","constantName","INCORRECT_VALUE","USE_NATIVE_URL","$toString","arraySort","URL_SEARCH_PARAMS","URL_SEARCH_PARAMS_ITERATOR","getInternalParamsState","getInternalIteratorState","nativeFetch","NativeRequest","Headers","RequestPrototype","HeadersPrototype","decodeURIComponent","encodeURIComponent","shift","splice","plus","sequences","percentSequence","percentDecode","sequence","deserialize","replacements","serialize","URLSearchParamsIterator","URLSearchParamsState","parseObject","parseQuery","bindURL","update","entryIterator","entryNext","query","attribute","attributes","updateURL","URLSearchParamsConstructor","URLSearchParamsPrototype","append","$value","getAll","found","callback","headersHas","headersSet","wrapRequestOptions","headers","body","fetch","RequestConstructor","Request","getState","$URLSearchParams","$delete","dindex","entriesLength","$has","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","amdO","dpSupport","__defineGetter__","classList","token","newToken","tokenString","newTokenString","contains","tokensTobeMoved","newTokenFound","currentToken","matchMedia","listener","removeListener","addListener","once","_this","remover","removeEventListener","onchangeDescriptor","_onchangeHandler","_onchangeListener","_addListener","MediaQueryList","_removeListener","handleEvent","_matchMedia","media","_mql","FetchDelivery","client","sendEvent","apiKey","events","notifier","payloadVersion","sentAt","Date","toISOString","JSON","endpoints","credentials","referrerPolicy","CircularReference","AccessError","safeFilter","seen","depth","depthLimit","edgeIndex","edgesLimit","hasToJson","safeAccess","copy","limit","currentKey","pop","accessor","_a","objectToString","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","extractLocation","urlLike","parts","line","parseInt","col","toException","maybeError","component","err","isError","getStringMember","field","newError","fromSimpleError","normalizeError","exception","errorClass","stacktrace","getStacktrace","stackString","getStackString","sanitizedLine","tokens","locationParts","file","lineNumber","columnNumber","parseV8OrIE","functionNameRegex","matches","parseFFOrSafari","parseStack","curr","_e","MAX_STACK_SIZE","$1","caller","generateBacktrace","browserNotifyUnhandledExceptions","load","evt","_b","ErrorEvent","filename","lineno","colno","isSafeInteger","firstStackFrame","notifyEvent","unhandled","severity","severityReason","browserNotifyUnhandledRejections","consoleBreadcrumbs","methodsToHook","original","leaveBreadcrumb","arg","stringified","errorBreadcrumbs","addOnPostError","errorMessage","userAgentRules","operatingSystemRules","browserContext","uaParser","matchedRule","browser","regex","uaMatch","matchUserAgent","os","osName","osVersion","detectOS","device","manufacturer","model","maxTouchPoints","detectAppleDevice","browserName","browserVersion","addOnError","request","context","locale","language","languages","metaData","_key","Map","maxLength","substring","truncateString","stringifyValues","breadcrumbs","breadcrumb","browserHandledRejectionBreadcrumbs","Bugsnag","delivery","errorCallbacks","postErrorCallbacks","plugins","config","onError","plugin","timestamp","maxBreadcrumbs","originalError","releaseStage","enabledReleaseStages","user","app","appVersion","appType","time","sortLast","callbackResult","eventForDelivery","payload","getUser","setUser","email","removeOnError","delete","removeOnPostError","getPlugin","setDelivery","metaValue","metaTag","querySelector","bugsnagClient","collectUserIp","reset","limitEvents","theme","site","documentElement","Element","scrollTo","t","top","o","setAttribute","factory","ease","cos","PI","isScrollBehaviorSupported","_elementScroll","elementScroll","HTMLElement","scroll","scrollLeft","scrollTop","_elementScrollIntoView","elementScrollIntoView","scrollIntoView","_windowScroll","windowScroll","modifyPrototypes","modification","SVGElement","_c","performance","elapsed","timeStamp","duration","targetX","targetY","timingFunc","currentX","startX","currentY","startY","rafId","requestAnimationFrame","nonFinite","__assign","assign","p","__read","ar","originalBoundFunc","behavior","cancelScroll","cancelAnimationFrame","passive","elementScrollPolyfill","animationOptions","originalFunc","scrollOptions","elementScrollBy","elementScrollByPolyfill","scrollBy","scrollByOptions","alignNearest","scrollingEdgeStart","scrollingEdgeEnd","scrollingSize","scrollingBorderStart","scrollingBorderEnd","elementEdgeStart","elementEdgeEnd","elementSize","canOverflow","overflow","isScrollable","computedStyle","clientHeight","scrollHeight","clientWidth","scrollWidth","overflowY","overflowX","frame","ownerDocument","defaultView","frameElement","getFrameElement","isHiddenByFrame","parentElement","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","clamp","width","isCSSPropertySupported","getElementScrollSnapArea","getBoundingClientRect","bottom","edge","scrollProperty","getPropertyValue","isConnected","scrollingElement","frames","documentElementStyle","getComputedStyle","cursor","cursorStyle","viewportWidth","visualViewport","innerWidth","viewportHeight","height","innerHeight","viewportX","scrollX","pageXOffset","viewportY","scrollY","pageYOffset","targetTop","targetRight","targetBottom","targetLeft","targetHeight","targetWidth","writingMode","normalizeWritingMode","isLTR","direction","block","inline","xPos","yPos","layout","toPhysicalAlignment","alignX","alignY","targetBlock","targetInline","actions","frameStyle","borderLeft","borderLeftWidth","borderTop","borderTopWidth","borderRight","borderRightWidth","borderBottom","borderBottomWidth","blockScroll","inlineScroll","scrollbarWidth","offsetWidth","scrollbarHeight","offsetHeight","elementScrollIntoViewPolyfill","scrollIntoViewOptions","elementScrollToPolyfill","scrollToOptions","top_1","windowScrollPolyfill","windowScrollBy","windowScrollByPolyfill","windowScrollToPolyfill","polyfill","elementScrollTo","seamless","windowScrollTo","support","Blob","viewClasses","isArrayBufferView","normalizeName","normalizeValue","iteratorFor","header","consumed","bodyUsed","fileReaderReady","reader","onload","onerror","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","bufferClone","buf","Body","_initBody","_bodyInit","_bodyText","_bodyBlob","FormData","_bodyFormData","_bodyArrayBuffer","rejected","text","readAsText","chars","readArrayBufferAsText","formData","decode","json","parse","oldValue","thisArg","upcased","signal","toUpperCase","referrer","cache","reParamSearch","getTime","form","Response","bodyInit","status","statusText","response","redirectStatuses","redirect","aborted","xhr","XMLHttpRequest","abortXhr","abort","rawHeaders","getAllResponseHeaders","substr","responseURL","responseText","ontimeout","onabort","fixUrl","withCredentials","responseType","setRequestHeader","onreadystatechange","readyState","send","define","WHATWGFetch","ShadowRoot","ShadyCSS","nativeShadow","Document","CSSStyleSheet","_$cssResult$","cssText","styleSheet","replaceSync","adoptedStyleSheets","litNonce","textContent","cssRules","is","h","trustedTypes","l","emptyScript","reactiveElementPolyfillSupport","d","u","toAttribute","Boolean","fromAttribute","converter","reflect","hasChanged","litPropertyMetadata","addInitializer","_$Ei","observedAttributes","finalize","_$Eh","createProperty","elementProperties","noAccessor","getPropertyDescriptor","requestUpdate","getPropertyOptions","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","flat","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","enableUpdating","_$AL","_$E_","addController","_$EO","renderRoot","hostConnected","removeController","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$EC","removeAttribute","_$ET","_$Ej","scheduleUpdate","performUpdate","wrapped","shouldUpdate","willUpdate","hostUpdate","_$EU","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","toFixed","createComment","_$litType$","strings","w","for","T","E","createTreeWalker","startsWith","currentNode","firstChild","replaceWith","childNodes","nextNode","hasAttributes","getAttributeNames","endsWith","getAttribute","ctor","H","I","tagName","innerHTML","N","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","_$AV","_$AN","_$AD","_$AM","_$AU","creationScope","importNode","M","nextSibling","L","_$AI","_$Cv","_$AH","_$AA","_$AB","startNode","endNode","_$AR","insertBefore","_$AC","_$AP","setConnected","toggleAttribute","Z","litHtmlPolyfillSupport","litHtmlVersions","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions","didInitFor","doOnce","MutationFeedback","_taggedTemplateLiteral","freeze","renderVisitorRegistrationForm","handleSubmit","withErrors","feedback","_templateObject","messagesHTML","_templateObject2","_templateObject3","_templateObject4","termsAndConditionsLinkHTML","_templateObject5","translations","registrationForm","termsAndConditionsLink","_templateObject6","title","privacyPolicyLinkHTML","_templateObject7","privacyPolicyLink","_templateObject8","_templateObject9","emailAddress","firstName","lastName","phoneNumber","covidMessage","studentNumber","school","schoolOptions","education","communicationOptIn1","communicationOptIn2","acceptTerms","registerButton","clearTokenFromHash","_document$documentEle3","alert","renderLocationRegistrationForm","locationRegistrationForm","organizationName","contactPerson","locationPlaceholder","descriptionPlaceholder","capacity","capacityPlaceholder","openingHours","services","servicesOptions","option","label","visitorRegistrationElement","getElementById","lastChild","async","_document$getElementB","preventDefault","stopPropagation","communicationOptIn","_document$documentEle","variables","contactAboutFutureEditionsConsent","additionalInformation","success","messages","errorMessages","generic","responseBody","registerVisitor","OK","errors","submitData","checked","_templateObject10","successMessages","verifyVisitorEmail","_document$documentEle2","emailVerificationFlow","locationRegistrationElement","servicesArray","querySelectorAll","registerLocation","createElementNS","aa","ba","prepend","ca","da","DocumentFragment","ea","q","cloneNode","replaceChild","z","B","D","getAttributeNS","setAttributeNS","G","removeAttributeNS","insertAdjacentElement","fa","insertAdjacentHTML","ha","ia","ja","before","ka","after","la","ma","na","oa","pa","qa","ra","sa","J","__CE_isImportDocument","K","children","ELEMENT_NODE","localName","import","__CE_shadowRoot","noDocumentConstructionObserver","shadyDomFastWalk","ShadyDOM","inUse","nativeMethods","Q","__CE_patched","__CE_state","U","upgrade","__CE_registry","__CE_documentLoadHandled","W","constructionStack","constructorFunction","__CE_definition","X","va","namespaceURI","HTMLUnknownElement","sourceURL","fileName","column","initErrorEvent","cancelable","defaultPrevented","wa","xa","childList","subtree","ya","disconnect","Y","za","Ba","adoptedCallback","Aa","addedNodes","whenDefined","polyfillWrapFlushCallback","polyfillDefineLazy","Fa","customElements","Ia","Ga","Ca","TEXT_NODE","ta","COMMENT_NODE","Ha","previousSibling","ua","Da","Ea","CustomElementRegistry","forcePolyfill","__CE_installPolyfill","_createClass","protoProps","staticProps","_classCallCheck","instance","msMatchesSelector","_focusableElementsString","InertRoot","rootElement","inertManager","_inertManager","_rootElement","_managedNodes","hasAttribute","_savedAriaHidden","_makeSubtreeUnfocusable","_observer","_onMutation","inertNode","_unmanageNode","_this2","composedTreeWalk","_visitNode","activeElement","blur","focus","_adoptInertRoot","_manageNode","register","deregister","_this3","inertSubroot","getInertRoot","setInert","managedNodes","savedInertNode","records","_self","removedNodes","_unmanageSubtree","attributeName","managedNode","ariaHidden","InertNode","inertRoot","_node","_overrodeFocusMethod","_inertRoots","_savedTabIndex","_destroyed","ensureUntabbable","_throwIfDestroyed","destroyed","tabIndex","hasSavedTabIndex","destructor","InertManager","_document","_watchForInert","addInertStyle","_onDocumentLoaded","inert","addInertRoot","removeInertRoot","inertElement","inertElements","shadowRootAncestor","distributedNodes","getDistributedNodes","slot","_distributedNodes","assignedNodes","flatten","_i","child","MrAccordion","_MrAccordion_clickHandler","handleToggleEvent","_MrAccordion_beforeMatchHandler","trigger","findTriggerFromPanelContents","_addEventListeners","_removeEventListeners","__classPrivateFieldGet","_didAddKeypressEventListener","getTriggers","activeAccordion","closest","activeAccordionSelector","triggers","out","which","ctrlModifier","ctrlKey","addKeypressEventListener","onlyOpen","isExpanded","panel","ids","walker","mapboxBuildGeoJSON","locations","features","latitude","parseFloat","dataset","longitude","isNaN","hidden","geometry","coordinates","locationId","popup","mapboxRenderMarkers","geoJSON","getLayer","removeLayer","removeSource","addLayer","generateId","paint","updateFeatureState","setInterval","queryRenderedFeatures","layers","_locationEl$dataset$c","_locationEl$dataset","locationEl","color","setFeatureState","MrLocationPicker","_init","mapboxVersion","script","getElementsByTagName","link","rel","mapboxLoadDependencies","mapboxgl","accessToken","elements","getElementsByClassName","center","zoom","container","dragRotate","disable","touchZoomRotate","disableRotation","scrollZoom","nav","NavigationControl","showCompass","showZoom","addControl","FullscreenControl","on","markers","catch","warn","updateState","_this$querySelector","currentPopupKey","focusUserLocation","Popup","closeButton","closeOnClick","showPopup","setLngLat","setHTML","addTo","setMaxWidth","canvas","getCanvas","geolocation","getCurrentPosition","coords","flyTo","bearing","speed","mapboxRenderUserPosition","convertAttributeToPropertyName","camelcased","part","addProperty","controllerType","propertyName","existing","generated","generateAttributeMethods","parsed","generateBoolAttributeMethods","generateIntegerAttributeMethods","generateNumberAttributeMethods","generateStringAttributeMethods","strict","decoded","encoded","generateJSONAttributeMethods","CONTROLLER","defineCustomElement","isValidTag","controller","_extends","extends","addAttributesToController","Controller","newValue","ctrl","propertyDescriptor","unbind","destroy","registerElement","clean","selector","promisify","wait","isInteractive","elementIsInDOM","BASE_CONTROLLER_HANDLERS","BaseController","elementDisappearedMessage","parseEvent","parsedTarget","wrappedHandler","composedPath","eventTarget","Window","getPath","matchingTarget","off","detail","bubbles","CustomEvent","templateAvailableSeats","lang","availableSeats","templateOpenFromTo","templateOccupancyStudy360","visitors","studentsPart","locationsPart","amount","LocationStatusIndicatorColor","getIndicatorColorForLocation","isDataForLocationStatus","isCurrentlyOpen","currentOpeningTimeToday","atMaximumCapacity","currentOccupation","Red","Green","Grey","buttons","dashboardContent","button","hide","contentItem","show","hideAll","didShowErrorDialog","updateView","location_ids","_data$data","_data$data2","parentEl","sortable","closedAction","nextOpeningTimeToday","openAction","openActionHours","_location$currentOpen","openingTime","closingTime","seatsAction","seatsActionCounter","currentOccupationStudy360","currentOccupationEl","_data$data$currentOcc","playAllAnimations","keyframeEffects","Animation","promises","KeyframeEffect","getTiming","updateTiming","maxTiming","keyframeEffect","newMax","timing","_timing$delay","_timing$endDelay","_timing$delay2","_timing$endDelay2","delay","endDelay","getMaxTiming","iterations","reduceMotion","animation","timeline","onfinish","play","MrDialog","_MrDialog_escapeHandler","_MrDialog_previousActiveElement","attr","disabled","directive","__classPrivateFieldSet","willOpen","_this$firstFocusableE","firstFocusableElement","openAnimations","didOpen","willClose","closeAnimations","didClose","gracefullShutdown","autoFocusChild","firstFocusableChild","MrLocationsFilter","_MrLocationsFilter_clickHandler","clickedFilterButton","filters","onlyCurrentlyOpen","filterType","filterValue","active","noResultsMessage","MrLocationsSorter","_MrLocationsSorter_changeHandler","HTMLSelectElement","order","sortAttribute","sortableAttributeValues","_location$getAttribut","aSortValue","bSortValue","_el$parentElement","i18nDaysOfWeek","nl","en","i18nToday","i18nTomorrow","location_id","locationStatusColor","prefix","suffix","openingHoursTableEl","days","rows","_day$openingTimes","day","dayOfWeekLabel","isToday","isTomorrow","dayOfWeek","dayAndMonth","templateTableRow","openingTimes","tableTemplate","openingDays","_data$data$location$c","times","slotsFormatted","seats","capacitiesFormatted","closedLabel","slotsHTML","capacitiesHTML"],"sourceRoot":""}