{"version":3,"sources":["webpack:///./node_modules/google-maps/lib/cjs/loader.js","webpack:///./node_modules/google-maps/lib/cjs/types.js","webpack:///./LeLab.Web/src/utils/google-maps-recycler.js","webpack:///./LeLab.Web/src/utils/google-maps-styles/shades-of-grey.js","webpack:///./LeLab.Web/src/utils/google-maps-icons/pin.js","webpack:///./LeLab.Web/src/js/dealers-map.entry.js","webpack:///./node_modules/google-maps/lib/cjs/index.js"],"names":["Object","defineProperty","exports","value","Loader","apiKey","options","this","window","Error","api","Promise","resolve","loader","CALLBACK_NAME","reject","script","document","createElement","src","createUrl","async","onerror","e","head","appendChild","parameters","push","name","hasOwnProperty","join","constructor","record","element","google","load","maps","mapObj","find","x","node","parentNode","map","append","style","position","top","left","height","width","Map","maxZoom","detachMap","key","apiRecord","entries","obj","removeChild","path","fillColor","fillOpacity","scale","strokeColor","strokeWeight","PageComponent","mapElement","querySelector","dataset","dealerElements","querySelectorAll","markers","initialize","createMap","createAllMarkers","fitMapToMarkers","GoogleMapsRecycler","attachMap","setOptions","disableDefaultUI","styles","ShadesOfGreyStyles","dealer","id","getAttribute","num","dealerNum","innerText","lat","parseFloat","dealerLat","lng","dealerLng","createMarker","number","targetId","marker","Marker","LatLng","clickable","title","label","color","fontFamily","fontSize","fontWeight","text","icon","PinIcon","labelOrigin","Point","addListener","scrollToTarget","deleteAllMarkers","forEach","deleteMarker","event","clearInstanceListeners","setMap","bounds","LatLngBounds","extend","getPosition","fitBounds","requestAnimationFrame","scrollToNode","destroy","__createBinding","create","o","m","k","k2","undefined","enumerable","get","__exportStar","p"],"mappings":"4FACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDD,EAAQE,YAAS,EACjB,MAAMA,EACF,YAAYC,EAAS,KAAMC,EAAU,IAGjC,GAFAC,KAAKF,OAASA,EACdE,KAAKD,QAAUA,EACO,oBAAXE,OACP,MAAM,IAAIC,MAAM,wDAGxB,OACI,YAAwB,IAAbF,KAAKG,IACLC,QAAQC,QAAQL,KA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AAUC,EAAGC,EAAGC,EAAGC,QAC7EC,IAAPD,IAAkBA,EAAKD,GAC3BlI,OAAOC,eAAe+H,EAAGG,EAAI,CAAEE,YAAY,EAAMC,IAAK,WAAa,OAAOL,EAAEC,OAC3E,SAAUF,EAAGC,EAAGC,EAAGC,QACTC,IAAPD,IAAkBA,EAAKD,GAC3BF,EAAEG,GAAMF,EAAEC,KAEVK,EAAgBhI,MAAQA,KAAKgI,cAAiB,SAASN,EAAG/H,GAC1D,IAAK,IAAIsI,KAAKP,EAAa,YAANO,GAAoBtI,EAAQ2B,eAAe2G,IAAIV,EAAgB5H,EAAS+H,EAAGO,IAEpGxI,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDoI,EAAa,EAAQ,KAAarI,GAClCqI,EAAa,EAAQ,KAAYrI,K","file":"dealers-map.js","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Loader = void 0;\nclass Loader {\n constructor(apiKey = null, options = {}) {\n this.apiKey = apiKey;\n this.options = options;\n if (typeof window === 'undefined') {\n throw new Error('google-maps is supported only in browser environment');\n }\n }\n load() {\n if (typeof this.api !== 'undefined') {\n return Promise.resolve(this.api);\n }\n if (typeof this.loader !== 'undefined') {\n return this.loader;\n }\n window[Loader.CALLBACK_NAME] = () => {\n this.api = window['google'];\n if (typeof this.resolve === 'undefined') {\n throw new Error('Should not happen');\n }\n this.resolve(this.api);\n };\n window['gm_authFailure'] = () => {\n if (typeof this.reject === 'undefined') {\n throw new Error('Should not happen');\n }\n this.reject(new Error('google-maps: authentication error'));\n };\n return this.loader = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n const script = document.createElement('script');\n script.src = this.createUrl();\n script.async = true;\n script.onerror = (e) => reject(e);\n document.head.appendChild(script);\n });\n }\n createUrl() {\n const parameters = [\n `callback=${Loader.CALLBACK_NAME}`,\n ];\n if (this.apiKey) {\n parameters.push(`key=${this.apiKey}`);\n }\n for (let name in this.options) {\n if (this.options.hasOwnProperty(name)) {\n let value = this.options[name];\n if (name === 'version') {\n name = 'v';\n }\n if (name === 'libraries') {\n value = value.join(',');\n }\n parameters.push(`${name}=${value}`);\n }\n }\n return `//maps.googleapis.com/maps/api/js?${parameters.join('&')}`;\n }\n}\nexports.Loader = Loader;\nLoader.CALLBACK_NAME = '_dk_google_maps_loader_cb';\n//# sourceMappingURL=loader.js.map","\"use strict\";\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","/**\r\n * Recycle Google Map\r\n * \r\n * It is impossible to destroy a Google Maps, it must\r\n * be reused (recycle). This is a controller to retreive\r\n * am existing \"free\" map, or create a new one if none\r\n * are available.\r\n */\r\n\r\nimport { Loader } from \"google-maps\"\r\n\r\nclass GoogleMapsRecycler {\r\n\r\n constructor() {\r\n this.record = {}\r\n }\r\n\r\n /**\r\n * Attach an exist map to the an HTMLElement, if available,\r\n * else create a new map.\r\n * \r\n * @param {any} element\r\n * @param {any} apiKey\r\n * @param {any} options\r\n */\r\n async attachMap(element, apiKey) {\r\n \r\n // Create a record for the apiKey if none exist\r\n\r\n if (!this.record[apiKey]) {\r\n const loader = new Loader(apiKey, {});\r\n const google = await loader.load();\r\n this.record[apiKey] = {\r\n loader,\r\n google,\r\n maps: []\r\n }\r\n }\r\n\r\n // Check for a \"free\" map\r\n\r\n const mapObj = this.record[apiKey].maps.find(x => x.node.parentNode === null)\r\n \r\n if (mapObj && mapObj.map) {\r\n element.append(mapObj.node)\r\n return mapObj.map\r\n\r\n }\r\n\r\n // None free, create a new map\r\n\r\n const node = document.createElement('div')\r\n node.style.position = \"absolute\"\r\n node.style.top = \"0\"\r\n node.style.left = \"0\"\r\n node.style.height = \"100%\"\r\n node.style.width = \"100%\"\r\n\r\n const map = new this.record[apiKey].google.maps.Map(node, {\r\n maxZoom: 15\r\n })\r\n\r\n this.record[apiKey].maps.push({ node, map })\r\n\r\n element.append(node)\r\n return map\r\n }\r\n\r\n /**\r\n * Detach a map, alowing it to be reused (recycle)\r\n * \r\n * VERY IMPORTANT\r\n * Clean up the map before detaching. This method won't\r\n * remove any options, addition (ex. marker) fromt he map.\r\n * \r\n * @param {any} map\r\n */\r\n detachMap(map) {\r\n for (const [key, apiRecord] of Object.entries(this.record)) {\r\n\r\n const obj = apiRecord.maps.find(x => x.map === map)\r\n\r\n if (!obj) continue\r\n\r\n // Detach from DOM\r\n if (obj.node.parentNode) {\r\n obj.node.parentNode.removeChild(obj.node)\r\n }\r\n\r\n break\r\n }\r\n }\r\n\r\n}\r\n\r\nexport default new GoogleMapsRecycler()","// https://snazzymaps.com/style/38/shades-of-grey\r\n\r\nexport default [\r\n {\r\n \"featureType\": \"all\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": 36\r\n },\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 40\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"all\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"on\"\r\n },\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 16\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"all\",\r\n \"elementType\": \"labels.icon\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"off\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 20\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 17\r\n },\r\n {\r\n \"weight\": 1.2\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"landscape\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 20\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 21\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 17\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 29\r\n },\r\n {\r\n \"weight\": 0.2\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 18\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.local\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 16\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 19\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n },\r\n {\r\n \"lightness\": 17\r\n }\r\n ]\r\n }\r\n]","// Based on : https://developers.google.com/maps/documentation/javascript/symbols\r\n\r\nexport default {\r\n path: \"M11.711-11.696L11.711-11.696C9.112-8.511,1.104-1.026,0,0c-1.104-1.027-9.113-8.512-11.711-11.696C-13.833-14.297-15-17.567-15-20.902c0-8.107,6.714-14.732,15-14.732s15,6.625,15,14.732 C15-17.566,13.832-14.296,11.711-11.696z\",\r\n fillColor: \"#FECB00\",\r\n fillOpacity: 1,\r\n scale: 1,\r\n strokeColor: \"#FFF1C3\",\r\n strokeWeight: 2\r\n};\r\n","import { PageComponent } from \"barba\";\r\nimport GoogleMapsRecycler from \"utils/google-maps-recycler\";\r\nimport ShadesOfGreyStyles from \"utils/google-maps-styles/shades-of-grey\";\r\nimport PinIcon from \"utils/google-maps-icons/pin\";\r\nimport scrollToNode from \"utils/scroll-to-node\";\r\n\r\n/*\r\n\r\n Attributes:\r\n data-dealers-map: marks the element that contains both the map and the list of locations\r\n data-map: marks the element where the map will be injected. Value should be the API Key to use.\r\n data-dealer: marks a single dealer element. Should also have these attributes:\r\n data-dealer-lat: latitude\r\n data-dealer-lng: longitude\r\n\r\n Should also contain child elements with these attributes:\r\n data-dealer-num: marks the element containing the label to put on the marker\r\n data-dealer-name: marks the element containing the title text to put on the marker\r\n\r\n*/\r\n\r\nclass DealersMap {\r\n constructor({ node }) {\r\n this.mapElement = node.querySelector(\"[data-map]\");\r\n this.apiKey = this.mapElement.dataset.map;\r\n this.dealerElements = node.querySelectorAll(\"[data-dealer]\");\r\n this.map = null;\r\n this.markers = [];\r\n\r\n this.initialize();\r\n }\r\n\r\n async initialize() {\r\n await this.createMap();\r\n this.createAllMarkers();\r\n this.fitMapToMarkers();\r\n }\r\n\r\n async createMap() {\r\n this.map = await GoogleMapsRecycler.attachMap(this.mapElement, this.apiKey);\r\n\r\n this.map.setOptions({\r\n disableDefaultUI: true,\r\n styles: ShadesOfGreyStyles\r\n });\r\n }\r\n\r\n createAllMarkers() {\r\n for (const dealer of this.dealerElements) {\r\n const id = dealer.getAttribute(\"id\");\r\n const num = dealer.querySelector(\"[data-dealer-num]\").dataset.dealerNum;\r\n const name = dealer.querySelector(\"[data-dealer-name]\").innerText;\r\n const lat = parseFloat(dealer.dataset.dealerLat);\r\n const lng = parseFloat(dealer.dataset.dealerLng);\r\n\r\n this.markers.push(this.createMarker(lat, lng, num, name, id));\r\n }\r\n }\r\n\r\n createMarker(lat, lng, number, name, targetId) {\r\n const marker = new google.maps.Marker({\r\n map: this.map,\r\n position: new google.maps.LatLng(lat, lng),\r\n clickable: true,\r\n title: name,\r\n label: {\r\n color: \"#252523\",\r\n fontFamily: \"Montserrat, Roboto, sans-serif\",\r\n fontSize: \"16px\",\r\n fontWeight: \"700\",\r\n text: number\r\n },\r\n icon: {\r\n ...PinIcon,\r\n labelOrigin: new google.maps.Point(0, -20)\r\n }\r\n });\r\n\r\n marker.addListener(\"click\", () => this.scrollToTarget(targetId));\r\n\r\n return marker;\r\n }\r\n\r\n deleteAllMarkers() {\r\n this.markers.forEach((x) => this.deleteMarker(x));\r\n }\r\n\r\n deleteMarker(marker) {\r\n google.maps.event.clearInstanceListeners(marker);\r\n marker.setMap(null);\r\n }\r\n\r\n fitMapToMarkers() {\r\n const bounds = new google.maps.LatLngBounds();\r\n for (const marker of this.markers) {\r\n bounds.extend(marker.getPosition());\r\n }\r\n\r\n this.map.fitBounds(bounds, 20);\r\n }\r\n\r\n scrollToTarget(targetId) {\r\n const node = document.querySelector(`#${targetId}`);\r\n if (node) {\r\n window.requestAnimationFrame(() => scrollToNode(node));\r\n }\r\n }\r\n\r\n destroy() {\r\n delete this.mapElement;\r\n delete this.apiKey;\r\n delete this.dealerElements;\r\n\r\n this.deleteAllMarkers();\r\n delete this.markers;\r\n\r\n if (this.map) {\r\n GoogleMapsRecycler.detachMap(this.map);\r\n }\r\n\r\n delete this.map;\r\n }\r\n}\r\n\r\nnew PageComponent(\"[data-dealers-map]\", DealersMap);\r\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./loader\"), exports);\n__exportStar(require(\"./types\"), exports);\n//# sourceMappingURL=index.js.map"],"sourceRoot":""}