a||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1\r\n \r\n ${productParts.map((part) => `\r\n
`;\r\n\r\n return html;\r\n }\r\n}\r\n\r\nexport default ProductContentTables;\r\n","import Utilities from './utilities';\r\nimport Spinner from './spinner';\r\n/**\r\n * init from product-content-tables\r\n * */\r\nclass IntoleranceFilter {\r\n constructor() {\r\n this.selectedIntolerances = [];\r\n }\r\n\r\n init() {\r\n const intoleranceFilterCheckboxes = document.querySelectorAll('.js-intolerance-filter');\r\n\r\n if (intoleranceFilterCheckboxes.length === 0) {\r\n return;\r\n }\r\n\r\n // checkbox change event\r\n [...intoleranceFilterCheckboxes].forEach((checkbox) => {\r\n checkbox.addEventListener('change', (item) => {\r\n // show loader\r\n const spinner = new Spinner('.js-spinner', '.js-spinner-results');\r\n spinner.toggle(true);\r\n\r\n setTimeout(() => {\r\n spinner.toggle(false);\r\n }, 400);\r\n\r\n this.filterIntolerances(item.currentTarget);\r\n }, true);\r\n });\r\n }\r\n\r\n filterIntolerances(item) {\r\n if (item.checked) {\r\n this.selectedIntolerances.push(item.name); // append\r\n } else {\r\n this.selectedIntolerances = this.selectedIntolerances\r\n .filter((x) => x !== item.name); // remove\r\n }\r\n\r\n // clear all previous filters and badges\r\n const filterCssClass = 'is-filtered';\r\n const filteredRows = document.querySelectorAll(`.${filterCssClass}`);\r\n [...filteredRows].forEach((row) => row.classList.remove(filterCssClass));\r\n\r\n // initially hide all badges\r\n const badges = document.querySelectorAll('.js-intolerance-badge');\r\n [...badges].forEach((badge) => badge.classList.add('d-none'));\r\n\r\n // loop all selected and hide matching products\r\n this.selectedIntolerances.forEach((intolerance) => {\r\n const productTables = document.querySelectorAll('.js-product-content-table');\r\n const selector = `input[type='checkbox'][name=\"${intolerance}\"].js-intolerance-checkbox`;\r\n const matchingIntolerances = [];\r\n\r\n // fetch matching checkboxes\r\n [...productTables].forEach((table) => {\r\n const nodeList = table.querySelectorAll(selector);\r\n const filteredNodeList = [...nodeList].filter((x) => x.checked === true);\r\n matchingIntolerances.push(...filteredNodeList);\r\n });\r\n\r\n matchingIntolerances.forEach((checkbox) => {\r\n const topRow = Utilities.findAncestor(checkbox, 'tr');\r\n const middleRow = Utilities.getNextSibling(topRow, 'tr');\r\n const bottomRow = Utilities.getNextSibling(middleRow, 'tr');\r\n\r\n topRow.classList.add(filterCssClass);\r\n middleRow.classList.add(filterCssClass);\r\n bottomRow.classList.add(filterCssClass);\r\n });\r\n\r\n // remove product table if no visible product rows\r\n productTables.forEach((table) => {\r\n const rows = table.querySelectorAll(`tbody tr:not(.${filterCssClass})`);\r\n const container = Utilities.findAncestor(table, '.js-product-content-table-container');\r\n\r\n if (rows.length > 1) {\r\n container.classList.remove('d-none');\r\n } else {\r\n container.classList.add('d-none');\r\n }\r\n });\r\n\r\n // badge\r\n const badge = document.querySelector(`.js-intolerance-badge[data-intolerance=\"${intolerance}\"]`);\r\n badge.classList.remove('d-none');\r\n });\r\n\r\n // show/hide information\r\n const hasSelectedIntoleranceFilters = document.querySelectorAll('.js-has-selected-intolerances');\r\n\r\n if (this.selectedIntolerances.length > 0) {\r\n [...hasSelectedIntoleranceFilters].forEach((x) => x.classList.remove('d-none'));\r\n } else {\r\n [...hasSelectedIntoleranceFilters].forEach((x) => x.classList.add('d-none'));\r\n }\r\n }\r\n}\r\n\r\nexport default IntoleranceFilter;\r\n","/**\r\n* Adds functionality to contact forms\r\n*/\r\nclass Forms {\r\n static init() {\r\n const form = document.querySelector('.js-form');\r\n const formButton = document.querySelector('.js-form-button');\r\n const formContainer = document.querySelector('.js-form-container');\r\n const contactFormSubject = document.querySelector('.js-contact-form-subject');\r\n const franchiseFormCountry = document.querySelector('.js-franchise-form-country');\r\n\r\n if (!formContainer || formContainer.length === 0) {\r\n return;\r\n }\r\n\r\n // Checks for the contact page form\r\n if (contactFormSubject && contactFormSubject.length !== 0) {\r\n contactFormSubject.addEventListener('change', this.toggleRestaurantFields, true);\r\n }\r\n\r\n // Checks for the contact page form\r\n if (franchiseFormCountry && franchiseFormCountry.length !== 0) {\r\n const locations = window.countryDetails;\r\n franchiseFormCountry.addEventListener('change', () => this.populateDetailsField(locations, franchiseFormCountry), true);\r\n }\r\n\r\n // Enable reCaptcha and expose callBacks\r\n if (formButton && formButton.length !== 0) {\r\n window.reCaptchaChecked = false;\r\n window.reCaptchaCheckCallback = this.reCaptchaCheckCallback;\r\n window.reCaptchaExpiredCallback = this.reCaptchaExpiredCallback;\r\n }\r\n\r\n if (form && form.length !== 0) {\r\n form.addEventListener('submit', this.reCaptchaValidate);\r\n }\r\n\r\n this.toggleRestaurantFields();\r\n }\r\n\r\n static toggleRestaurantFields() {\r\n const restaurantInputContainer = document.querySelector('.js-form-restaurants');\r\n const receiptInputContainer = document.querySelector('.js-form-receipt');\r\n const visitTimeInputContainer = document.querySelector('.js-form-visit-time');\r\n const visitDateInputContainer = document.querySelector('.js-form-visit-date');\r\n const paymentAmountInputContainer = document.querySelector('.js-form-payment-amount');\r\n const selIndex = this.selectedIndex;\r\n if (!this.selectedIndex || !this.options || this.options.length === 0) {\r\n return;\r\n }\r\n\r\n const { showRestaurants, showReceiptNumber, showVisitTime, showPaymentAmount } = this.options[selIndex].dataset;\r\n\r\n if (showRestaurants === 'true') {\r\n restaurantInputContainer.classList.remove('d-none');\r\n document.getElementById('Restaurant').disabled = false;\r\n } else {\r\n restaurantInputContainer.classList.add('d-none');\r\n document.getElementById('Restaurant').disabled = true;\r\n }\r\n\r\n if (showReceiptNumber === 'true') {\r\n receiptInputContainer.classList.remove('d-none');\r\n document.getElementById('ReceiptNumber').disabled = false;\r\n } else {\r\n receiptInputContainer.classList.add('d-none');\r\n document.getElementById('ReceiptNumber').disabled = true;\r\n }\r\n\r\n if (showVisitTime === 'true') {\r\n visitTimeInputContainer.classList.remove('d-none');\r\n visitDateInputContainer.classList.remove('d-none');\r\n document.getElementById('VisitTime').disabled = false;\r\n document.getElementById('VisitDate').disabled = false;\r\n } else {\r\n visitTimeInputContainer.classList.add('d-none');\r\n visitDateInputContainer.classList.add('d-none');\r\n document.getElementById('VisitTime').disabled = true;\r\n document.getElementById('VisitDate').disabled = true;\r\n }\r\n\r\n if (showPaymentAmount === 'true') {\r\n paymentAmountInputContainer.classList.remove('d-none');\r\n document.getElementById('PaymentAmount').disabled = false;\r\n } else {\r\n paymentAmountInputContainer.classList.add('d-none');\r\n document.getElementById('PaymentAmount').disabled = true;\r\n }\r\n }\r\n\r\n static populateDetailsField(locations, franchiseFormCountry) {\r\n const currentValue = franchiseFormCountry.options[franchiseFormCountry.selectedIndex].value;\r\n const detailOptions = locations[currentValue];\r\n\r\n if (locations[currentValue]) {\r\n const detailsSelect = document.querySelector('.js-franchise-form-country-details');\r\n const firstOption = franchiseFormCountry.querySelector('.js-franchise-form-first-option');\r\n\r\n detailsSelect.disabled = false;\r\n detailsSelect.innerHTML = '';\r\n\r\n if (firstOption) {\r\n firstOption.parentNode.removeChild(firstOption);\r\n }\r\n\r\n detailOptions.forEach((detailOption) => {\r\n const optionEl = document.createElement('option');\r\n optionEl.text = detailOption;\r\n optionEl.value = detailOption;\r\n detailsSelect.appendChild(optionEl);\r\n });\r\n }\r\n }\r\n\r\n static reCaptchaValidate(e) {\r\n if (!window.reCaptchaChecked) {\r\n e.preventDefault();\r\n }\r\n }\r\n\r\n static reCaptchaCheckCallback() {\r\n const formButton = document.querySelector('.js-form-button');\r\n window.reCaptchaChecked = true;\r\n formButton.removeAttribute('disabled');\r\n }\r\n\r\n static reCaptchaExpiredCallback() {\r\n const formButton = document.querySelector('.js-form-button');\r\n window.reCaptchaChecked = false;\r\n formButton.setAttribute('disabled', true);\r\n }\r\n}\r\n\r\nexport default Forms;\r\n","import Utilities from './utilities';\r\n\r\nclass LanguageModal {\r\n static init() {\r\n /**\r\n * Opens the language selector modal\r\n */\r\n\r\n const modal = document.querySelector('.js-modal');\r\n\r\n if (!modal || modal.length === 0) {\r\n return;\r\n }\r\n\r\n const blackout = document.querySelector('.js-body-blackout');\r\n const cookieName = 'MaxSelectedLanguage';\r\n const languageSelectors = document.querySelectorAll('.a-current-language');\r\n const enableLanguageOverlay = modal.getAttribute('data-enable-language-overlay');\r\n\r\n if (document.cookie.indexOf(cookieName) === -1 && enableLanguageOverlay !== null) {\r\n this.showModal(modal, blackout, cookieName);\r\n }\r\n\r\n languageSelectors.forEach((element) => {\r\n element.addEventListener('click', (event) => {\r\n event.stopPropagation();\r\n this.showModal(modal, blackout, cookieName);\r\n });\r\n });\r\n }\r\n\r\n static showModal(modal, blackout, cookieName) {\r\n const body = document.querySelector('body');\r\n\r\n modal.classList.add('is-visible');\r\n blackout.classList.add('is-open');\r\n body.classList.add('modal-open');\r\n\r\n body.addEventListener('click', () => {\r\n modal.classList.remove('is-visible');\r\n blackout.classList.remove('is-open');\r\n body.classList.remove('modal-open');\r\n\r\n Utilities.setCookie(cookieName, true, 30);\r\n });\r\n }\r\n}\r\n\r\nexport default LanguageModal;\r\n","/**\r\n * Google Maps store finder\r\n */\r\nclass StoreFinder {\r\n mapMarkers = [];\r\n\r\n static init() {\r\n const settings = this.getSettings();\r\n const mapContainer = document.getElementById(\"map\");\r\n const restaurantMapContainer = document.getElementById(\"restaurantMap\");\r\n const restaurantControlsContainer = document.getElementById(\r\n \"restaurantMapControls\"\r\n );\r\n\r\n this.mapMarkers = [];\r\n\r\n if (settings.isRestaurantPageMap) {\r\n this.renderRestaurantMap(settings, restaurantMapContainer);\r\n }\r\n\r\n if (mapContainer !== null) {\r\n this.renderFindMaxMap(settings, mapContainer);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n static renderFindMaxMap(settings, mapContainer) {\r\n const latlng = new window.google.maps.LatLng(\r\n settings.defaultLatitude,\r\n settings.defaultLongitude\r\n );\r\n const mapOptions = this.getMapOptions(latlng, false);\r\n const map = new window.google.maps.Map(mapContainer, mapOptions);\r\n\r\n const restList = document.getElementById(\"restList\");\r\n const restaurants = restList.querySelectorAll(\".js-restaurant-item\");\r\n const locations = this.getRestaurants(restaurants);\r\n\r\n const submitButton = document.querySelector(\".js-maps-submit\")\r\n ? document.querySelector(\".js-maps-submit\")\r\n : false;\r\n const inputField = document.getElementById(\"mapsPlace\")\r\n ? document.getElementById(\"mapsPlace\")\r\n : false;\r\n\r\n if (submitButton) {\r\n submitButton.addEventListener(\"click\", (e) => {\r\n e.preventDefault();\r\n this.searchAddress(map, locations);\r\n });\r\n }\r\n\r\n if (inputField) {\r\n inputField.addEventListener(\"keypress\", (e) => {\r\n if (e.which === 13) {\r\n e.preventDefault();\r\n this.searchAddress(map, locations);\r\n e.target.blur();\r\n }\r\n });\r\n }\r\n\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition((e) => {\r\n const userPos = new window.google.maps.LatLng(\r\n e.coords.latitude,\r\n e.coords.longitude\r\n );\r\n const closestMarker =\r\n locations[\r\n this.findClosestMarker(\r\n locations,\r\n e.coords.latitude,\r\n e.coords.longitude\r\n )\r\n ];\r\n const coordinates = new window.google.maps.LatLng(\r\n closestMarker.lat,\r\n closestMarker.lon\r\n );\r\n const bounds = new window.google.maps.LatLngBounds();\r\n\r\n bounds.extend(userPos);\r\n bounds.extend(coordinates);\r\n map.fitBounds(bounds);\r\n\r\n this.getMarker(\r\n `${settings.markerPath}current-pos.svg`,\r\n userPos,\r\n map,\r\n window.MAX.translations.yourPosition,\r\n \"\"\r\n );\r\n\r\n this.sortLocations(locations, userPos);\r\n this.buildRestaurantsList(locations);\r\n });\r\n }\r\n\r\n const bounds = new window.google.maps.LatLngBounds();\r\n\r\n for (let i = 0; i < locations.length; i += 1) {\r\n const location = locations[i];\r\n const extnd = new window.google.maps.LatLng(location.lat, location.lon);\r\n bounds.extend(extnd);\r\n }\r\n\r\n const zoomChangeBoundsListener = window.google.maps.event.addListener(\r\n map,\r\n \"bounds_changed\",\r\n () => {\r\n window.google.maps.event.removeListener(zoomChangeBoundsListener);\r\n map.setZoom(Math.min(13, map.getZoom()));\r\n }\r\n );\r\n\r\n map.fitBounds(bounds);\r\n\r\n this.setMarkers(locations, map);\r\n this.bindMapControls(map);\r\n }\r\n\r\n static async renderRestaurantMap(settings, mapContainer) {\r\n const latlng = new window.google.maps.LatLng(\r\n settings.restLatitude,\r\n settings.restLongitude\r\n );\r\n const mapOptions = this.getMapOptions(latlng, true);\r\n const restaurantMap = new window.google.maps.Map(mapContainer, {\r\n ...mapOptions,\r\n mapId: \"226b09c969746719\",\r\n });\r\n\r\n const marker = await this.getMarker(\r\n settings.markerPath,\r\n latlng,\r\n restaurantMap,\r\n settings.restName,\r\n `\r\n \r\n \r\n ${part.name}\r\n \r\n\r\n ${Object.entries(part.intolerances).map(([key, intolerance]) => `\r\n \r\n \r\n `).join('')}\r\n ${(() => {\r\n if (part.ingredients !== null) {\r\n return `\r\n \r\n \r\n `;\r\n }\r\n\r\n return '';\r\n })()}\r\n `).join('')}\r\n \r\n ${part.ingredients} \r\n ${settings.restName}
`\r\n );\r\n\r\n marker.setMap(restaurantMap);\r\n }\r\n\r\n static async getMarker(markerPath, latlng, map, title, html) {\r\n const { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\r\n const glyphImg = document.createElement(\"img\");\r\n glyphImg.src = \"/build/images/map/pin.svg\";\r\n\r\n return new AdvancedMarkerElement({\r\n map,\r\n position: latlng,\r\n title,\r\n content: glyphImg,\r\n });\r\n }\r\n\r\n static getSettings() {\r\n const isRestaurantPageMap =\r\n document.getElementById(\"restaurantMap\") !== null;\r\n let lat = 0;\r\n let lng = 0;\r\n let name = \"\";\r\n let theme = \"max\";\r\n\r\n if (isRestaurantPageMap) {\r\n lat = window.MAX.restaurant.latitude;\r\n lng = window.MAX.restaurant.longitude;\r\n name = window.MAX.restaurant.name;\r\n theme = window.MAX.restaurant.theme ?? theme;\r\n }\r\n\r\n return {\r\n markerPath: `/build/svg/logo-${theme}-small-map.svg`,\r\n locationMarkerPath: \"/build/svg/location-map.svg\",\r\n linkTxt: window.MAX.translations.linkText,\r\n noResultTxt: window.MAX.translations.noResultText,\r\n defaultLatitude: 18.07,\r\n defaultLongitude: 59.33,\r\n isRestaurantPageMap,\r\n restLatitude: lat,\r\n restLongitude: lng,\r\n restName: name,\r\n };\r\n }\r\n\r\n static getMapOptions(latlng, isSmallMap) {\r\n if (document.body.clientWidth >= 768 && !isSmallMap) {\r\n return {\r\n zoom: 14,\r\n center: latlng,\r\n panControl: !1,\r\n zoomControl: !0,\r\n scrollwheel: !1,\r\n scaleControl: !0,\r\n streetViewControl: !0,\r\n mapTypeControl: !0,\r\n clickableIcons: !1,\r\n mapTypeId: window.google.maps.MapTypeId.ROADMAP,\r\n };\r\n }\r\n\r\n return {\r\n zoom: 14,\r\n center: latlng,\r\n panControl: !1,\r\n zoomControl: !0,\r\n scrollwheel: !1,\r\n zoomControlOptions: {\r\n style: window.google.maps.ZoomControlStyle.SMALL,\r\n position: window.google.maps.ControlPosition.LEFT_BOTTOM,\r\n },\r\n scaleControl: !1,\r\n streetViewControl: !1,\r\n mapTypeControl: !1,\r\n clickableIcons: !1,\r\n mapTypeId: window.google.maps.MapTypeId.ROADMAP,\r\n };\r\n }\r\n\r\n static findClosestMarker(locations, userLat, userLng) {\r\n const pi = Math.PI;\r\n const R = 6371;\r\n const distances = [];\r\n let closest = -1;\r\n\r\n for (let i = 0; i < locations.length; i += 1) {\r\n const location = locations[i];\r\n const latDiff = location.lat - userLat;\r\n const lngDiff = location.lon - userLng;\r\n const latDiffDeg = latDiff * (pi / 180);\r\n const lngDiffDeg = lngDiff * (pi / 180);\r\n const userLatDeg = userLat * (pi / 180);\r\n const latDegrees = location.lat * (pi / 180);\r\n const a =\r\n Math.sin(latDiffDeg / 2) * Math.sin(latDiffDeg / 2) +\r\n Math.sin(lngDiffDeg / 2) *\r\n Math.sin(lngDiffDeg / 2) *\r\n Math.cos(userLatDeg) *\r\n Math.cos(latDegrees);\r\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\r\n const d = R * c;\r\n\r\n distances[i] = d;\r\n\r\n if (closest === -1 || d < distances[closest]) {\r\n closest = i;\r\n }\r\n }\r\n\r\n return closest;\r\n }\r\n\r\n static getRestaurants(restaurants) {\r\n const restaurantsArray = [...restaurants];\r\n const arr = [];\r\n\r\n if (restaurantsArray.length > 0) {\r\n restaurantsArray.forEach((restaurant) => {\r\n arr.push({\r\n link: restaurant.getAttribute(\"href\"),\r\n name: restaurant.querySelector(\".o-restaurant-list__location h2\")\r\n .innerHTML,\r\n street: restaurant.querySelector(\".o-restaurant-list__location span\")\r\n .innerHTML,\r\n postal: restaurant.getAttribute(\"data-postal\"),\r\n city: restaurant.querySelector(\".o-restaurant-list__city\").innerHTML,\r\n hours: restaurant.querySelector(\".o-restaurant-list__opening-hours\")\r\n .innerHTML,\r\n lat: restaurant.getAttribute(\"data-coords\").split(\",\")[0],\r\n lon: restaurant.getAttribute(\"data-coords\").split(\",\")[1],\r\n fromPos: 0,\r\n toPos: 0,\r\n data: restaurant,\r\n });\r\n });\r\n }\r\n\r\n return arr;\r\n }\r\n\r\n static calcDistance(userPos, locationPos) {\r\n const distance =\r\n window.google.maps.geometry.spherical.computeDistanceBetween(\r\n userPos,\r\n locationPos\r\n );\r\n let t = \"\";\r\n\r\n if (distance < 1e3) {\r\n t = `${Math.round(distance)} m`;\r\n } else {\r\n t =\r\n distance >= 1e3 && distance < 2e3\r\n ? `${(distance / 1e3).toFixed(1)} km`\r\n : `${Math.round(distance / 1e3)} km`;\r\n }\r\n\r\n return { from: t, to: Math.round(distance) };\r\n }\r\n\r\n static compareDistance(e, o) {\r\n if (e.toPos === o.toPos) {\r\n return 0;\r\n }\r\n return e.toPos < o.toPos ? -1 : 1;\r\n }\r\n\r\n static sortLocations(locations, userPos) {\r\n for (let i = 0; i < locations.length; i += 1) {\r\n const location = locations[i];\r\n const locationPos = new window.google.maps.LatLng(\r\n location.lat,\r\n location.lon\r\n );\r\n const distance = this.calcDistance(userPos, locationPos);\r\n location.fromPos = distance.from;\r\n location.toPos = distance.to;\r\n }\r\n locations.sort(this.compareDistance);\r\n }\r\n\r\n static buildRestaurantsList(locations) {\r\n const restList = document.getElementById(\"restList\");\r\n const node = restList.cloneNode(false);\r\n for (let i = 0; i < locations.length; i += 1) {\r\n const location = locations[i];\r\n location.data.querySelector(\".o-restaurant-list__distance\").innerHTML =\r\n location.fromPos;\r\n node.appendChild(location.data);\r\n }\r\n restList.parentNode.replaceChild(node, restList);\r\n }\r\n\r\n static searchAddress(map, locations) {\r\n const settings = this.getSettings();\r\n let geocoder;\r\n let markers = [];\r\n let saveTxt;\r\n let saveMapCenter;\r\n let saveMapZoom;\r\n\r\n if (document.getElementById(\"mapsPlace\").value.length > 0) {\r\n const address = document.getElementById(\"mapsPlace\").value;\r\n\r\n const findResult = document.querySelector(\".js-findresult\");\r\n saveTxt = findResult.innerText;\r\n saveMapCenter = map.getCenter();\r\n saveMapZoom = map.getZoom();\r\n\r\n geocoder = new window.google.maps.Geocoder();\r\n geocoder.geocode({ address }, (results, status) => {\r\n const latLng = results[0].geometry.location;\r\n\r\n if (status === window.google.maps.GeocoderStatus.OK) {\r\n const icon = {\r\n url: settings.locationMarkerPath,\r\n scaledSize: new window.google.maps.Size(30, 43),\r\n origin: new window.google.maps.Point(0, 0),\r\n anchor: new window.google.maps.Point(15, 42),\r\n };\r\n const shape = {\r\n coords: [1, 1, 1, 43, 30, 43, 30, 1],\r\n type: \"poly\",\r\n };\r\n const marker = new window.google.maps.Marker({\r\n position: latLng,\r\n map,\r\n icon,\r\n shape,\r\n optimized: !1,\r\n title: address,\r\n zIndex: 1,\r\n });\r\n\r\n if (markers.length) {\r\n markers[0].setMap(null);\r\n markers = [];\r\n }\r\n markers.push(marker);\r\n\r\n const r =\r\n locations[\r\n this.findClosestMarker(\r\n locations,\r\n results[0].geometry.location.lat(),\r\n results[0].geometry.location.lng()\r\n )\r\n ];\r\n const i = new window.google.maps.LatLng(r.lat, r.lon);\r\n const p = new window.google.maps.LatLngBounds();\r\n\r\n p.extend(latLng);\r\n p.extend(i);\r\n\r\n const g = window.google.maps.event.addListener(\r\n map,\r\n \"bounds_changed\",\r\n () => {\r\n window.google.maps.event.removeListener(g);\r\n map.setZoom(Math.min(14, map.getZoom()));\r\n }\r\n );\r\n\r\n map.fitBounds(p);\r\n this.setMarkers(locations, map);\r\n this.sortLocations(locations, latLng);\r\n this.buildRestaurantsList(locations);\r\n\r\n findResult.innerText = saveTxt;\r\n findResult.classList.remove(\"alert\");\r\n } else if (latLng === window.google.maps.GeocoderStatus.ZERO_RESULTS) {\r\n findResult.innerText = settings.noResultTxt;\r\n findResult.classList.add(\"alert\");\r\n } else {\r\n findResult.innerText(`Geocode failed: ${latLng}`);\r\n findResult.classList.add(\"alert\");\r\n }\r\n });\r\n } else if (saveMapCenter) {\r\n map.setCenter(saveMapCenter);\r\n map.setZoom(saveMapZoom);\r\n\r\n if (markers.length) {\r\n markers[0].setMap(null);\r\n markers = [];\r\n }\r\n }\r\n }\r\n\r\n static setMarkers(locations, map) {\r\n const settings = this.getSettings();\r\n const infoWindow = new window.google.maps.InfoWindow({\r\n content: \"\",\r\n });\r\n\r\n for (let i = 0; i < locations.length; i += 1) {\r\n const location = locations[i];\r\n\r\n const coordinates = new window.google.maps.LatLng(\r\n location.lat,\r\n location.lon\r\n );\r\n\r\n const marker = this.getMarker(\r\n settings.markerPath,\r\n coordinates,\r\n map,\r\n location.name,\r\n `${location.name}
${location.street}
${location.postal}
${location.hours}
${settings.linkTxt}`\r\n );\r\n\r\n window.google.maps.event.addListener(marker, \"click\", function info() {\r\n infoWindow.setContent(this.html);\r\n infoWindow.open(map, this);\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default StoreFinder;\r\n","/**\r\n* Tabs navigation\r\n*/\r\nclass Tabs {\r\n static init() {\r\n const tabsContainer = document.querySelectorAll('.js-tabs');\r\n\r\n if (tabsContainer.length === 0) {\r\n return;\r\n }\r\n\r\n const tabLinks = document.querySelectorAll('.js-tab-link');\r\n const tabPanes = document.querySelectorAll('.js-tab-pane');\r\n\r\n Object.keys(tabLinks).forEach((tab) => {\r\n tabLinks[tab].addEventListener('click', (e) => {\r\n this.makeInactive(tabLinks);\r\n this.activateTab(e);\r\n this.makeInactive(tabPanes);\r\n this.activateTabContent(e);\r\n\r\n e.preventDefault();\r\n });\r\n });\r\n }\r\n\r\n // makes a tab and it's content incactive\r\n static makeInactive(items) {\r\n Object.keys(items).forEach((item) => {\r\n items[item].classList.remove('active');\r\n });\r\n }\r\n\r\n // display the selected tab.\r\n static activateTab(e) {\r\n const clickedTab = e.currentTarget;\r\n clickedTab.classList.add('active');\r\n }\r\n\r\n // display the selected tab content.\r\n static activateTabContent(e) {\r\n // gets the element on which the event originally occurred\r\n const anchorReference = e.target;\r\n const activePaneID = anchorReference.getAttribute('href');\r\n const activePane = document.querySelector(activePaneID);\r\n activePane.classList.add('active');\r\n }\r\n}\r\n\r\nexport default Tabs;\r\n","/**\r\n* Toggles visibility of collapse\r\n*/\r\nclass Collapse {\r\n static init() {\r\n const collapse = document.querySelectorAll('.js-collapse');\r\n\r\n if (collapse.length === 0) {\r\n return;\r\n }\r\n\r\n const collapseTriggers = document.querySelectorAll('.js-collapse-trigger');\r\n\r\n Object.keys(collapseTriggers).forEach((index) => {\r\n collapseTriggers[index].addEventListener('click', (e) => {\r\n const link = e.currentTarget;\r\n const expanded = link.getAttribute('aria-expanded') === 'true' ? 'false' : 'true';\r\n const icon = link.querySelector('svg');\r\n\r\n // toggle arrow icon\r\n if (expanded === 'true') {\r\n icon.innerHTML = '';\r\n } else {\r\n icon.innerHTML = '';\r\n }\r\n\r\n link.setAttribute('aria-expanded', expanded);\r\n document.querySelector(link.getAttribute('href')).classList.toggle('show');\r\n\r\n e.preventDefault();\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport default Collapse;\r\n","import { createContext } from \"react\";\r\n\r\nexport interface Localization {\r\n countryId: string;\r\n [key: string]: string;\r\n}\r\n\r\nexport const LocalizationContext = createContext{restaurantList}
\r\n \r\n >\r\n );\r\n};\r\n\r\nexport default RestaurantList;\r\n","import { AnimatePresence, motion } from \"framer-motion\";\r\nimport React, { useEffect, useMemo, useState } from \"react\";\r\nimport {\r\n useRestaurantMap,\r\n useRestaurantMapDispatch,\r\n} from \"../RestaurantMapContext\";\r\nimport Button from \"./Button\";\r\nimport useLocalization from \"../../Common/Localization/UseLocalization\";\r\n\r\ninterface EvFilterSettingsProps {\r\n show?: boolean;\r\n onClose?: () => void;\r\n}\r\n\r\nfunction EvFilterSettings({ show, onClose }: EvFilterSettingsProps) {\r\n const { filters, restaurants, carChargerCompanies } = useRestaurantMap();\r\n const dispatch = useRestaurantMapDispatch();\r\n const localization = useLocalization();\r\n\r\n const setCompanyFilter = (companies: string[]) => {\r\n dispatch?.setFilters({\r\n ...filters,\r\n ev: {\r\n ...filters.ev,\r\n company: companies,\r\n },\r\n });\r\n };\r\n\r\n const setKilowattFilter = (\r\n kw: number | null,\r\n e: React.ChangeEvent\r\n {localization(\"/pages/restaurantlistpage/ev-charger-company\")}\r\n
\r\n Effekt
\r\n \r\n \r\n {title}
\r\n {subtitle && {subtitle}}\r\n {localization(\"/pages/restaurantlistpage/openinghours\")}
\r\n \r\n {openingHoursItems}\r\n
\r\n {localization(\"/pages/restaurantlistpage/ev-chargers\")}
\r\n \r\n {carChargerElements}\r\n
\r\n