{ "version": 3, "sources": ["../src/js/map-styles.js", "../src/js/popup-map.js", "../src/js/property-popup.js"], "sourcesContent": ["export const mapStyles = [\n\t{\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#212121',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\telementType: 'labels.icon',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tvisibility: 'off',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#757575',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\telementType: 'labels.text.stroke',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#212121',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'administrative',\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#757575',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'administrative.country',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#9e9e9e',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'administrative.land_parcel',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tvisibility: 'off',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'administrative.locality',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#bdbdbd',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'poi',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#757575',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'poi.business',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tvisibility: 'off',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'poi.park',\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#181818',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'poi.park',\n\t\telementType: 'labels.text',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tvisibility: 'off',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'poi.park',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#616161',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'poi.park',\n\t\telementType: 'labels.text.stroke',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#1b1b1b',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'road',\n\t\telementType: 'geometry.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#2c2c2c',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'road',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#8a8a8a',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'road.arterial',\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#373737',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'road.highway',\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#3c3c3c',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'road.highway.controlled_access',\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#4e4e4e',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'road.local',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#616161',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'transit',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#757575',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'water',\n\t\telementType: 'geometry',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#000000',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tfeatureType: 'water',\n\t\telementType: 'labels.text.fill',\n\t\tstylers: [\n\t\t\t{\n\t\t\t\tcolor: '#3d3d3d',\n\t\t\t},\n\t\t],\n\t},\n]\n", "import { mapStyles } from './map-styles.js'\n\nexport function createPopupMap(element, lat, lng) {\n\tconst map = new google.maps.Map(element, {\n\t\tcenter: { lat, lng },\n\t\tzoom: 15, // 13\n\t\tstreetViewControl: false,\n\t\tmapTypeControl: false,\n\t\tfullscreenControl: false,\n\t\tscrollwheel: false,\n\t\tstyles: mapStyles,\n\t})\n\n\tconst image = {\n\t\turl: '/wp-content/themes/Ultra/images/map-marker.svg',\n\t\t// This marker is 20 pixels wide by 32 pixels high.\n\t\tsize: new google.maps.Size(66, 66),\n\t\t// The origin for this image is (0, 0).\n\t\torigin: new google.maps.Point(0, 0),\n\t\t// The anchor for this image is the base of the flagpole at (0, 32).\n\t\tanchor: new google.maps.Point(26, 66),\n\t}\n\n\tconst marker = new google.maps.Marker({\n\t\tposition: { lat, lng },\n\t\tmap,\n\t\ticon: image,\n\t\ttitle: 'Material Icon Font Marker',\n\t})\n}\n", "import { createPopupMap } from './popup-map'\n\nconst SLIDER_SYMBOL = Symbol('KeenSlider')\nconst SELECTORS = {\n\tcontainer: '.property-popup-container',\n\tinfo: '.info',\n\tcloseBtn: '.close-popup',\n\tpropertyInfo: '.property .property-info',\n}\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tconst popupContainer = document.querySelector(SELECTORS.container)\n\tif (!popupContainer) return\n\n\tconst info = popupContainer.querySelector(SELECTORS.info)\n\tconst closeBtn = popupContainer.querySelector(SELECTORS.closeBtn)\n\tconst form = popupContainer.querySelector('.form')\n\tconst formElement = form?.querySelector('form')\n\tconst buildingNameField = form?.querySelector('[name=\"Building\"]')\n\n\t// When page loads for the first time, check if a hash is present, and if so, open the popup\n\trespondToHashChange()\n\n\twindow.addEventListener('hashchange', respondToHashChange)\n\n\tpopupContainer.addEventListener('toggle', (e) => {\n\t\tif (e.newState === 'closed') {\n\t\t\t// get rid of the hash in the url\n\t\t\thistory.replaceState(null, null, location.pathname)\n\t\t}\n\t})\n\n\tpopupContainer.addEventListener('transitionend', () => {\n\t\tif (!popupContainer.matches(':popover-open')) {\n\t\t\tconst slider = popupContainer[SLIDER_SYMBOL]\n\t\t\tif (slider) {\n\t\t\t\tslider.destroy()\n\t\t\t\tdelete popupContainer[SLIDER_SYMBOL]\n\t\t\t}\n\t\t\tresetForm()\n\t\t}\n\t})\n\n\tcloseBtn.addEventListener('click', () => {\n\t\tpopupContainer.hidePopover()\n\t})\n\n\tfunction respondToHashChange() {\n\t\tconst hash = location.hash.substring(1)\n\t\tif (hash) {\n\t\t\tconst el = document.getElementById(hash)\n\t\t\tif (el) {\n\t\t\t\tconst property = el.cloneNode(true)\n\t\t\t\topenPopup(property)\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction openPopup(property) {\n\t\tproperty.removeAttribute('id')\n\t\tinfo.replaceChildren()\n\t\tinfo.append(property)\n\n\t\t// button toggle for scheduling a tour\n\t\tconst scheduleButton = info.querySelector('.property-loop-button-margin .arrow-link')\n\t\tscheduleButton.addEventListener('click', (e) => {\n\t\t\tif (window.innerWidth >= 992 && scheduleButton.contains('schedule-tour')) {\n\t\t\t\te.preventDefault()\n\n\t\t\t\tif (form.classList.contains('active')) {\n\t\t\t\t\tform.classList.remove('active')\n\t\t\t\t\tgallery.classList.remove('disable')\n\t\t\t\t} else {\n\t\t\t\t\tbuildingNameField.value = property.querySelector('.heading-wrapper .heading').innerText\n\t\t\t\t\tform.classList.add('active')\n\t\t\t\t\tgallery.classList.add('disable')\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tconst mapLocation = info.querySelector(SELECTORS.propertyInfo)\n\t\ttry {\n\t\t\tconst latlng = JSON.parse(property.dataset.location)\n\t\t\tif (latlng && latlng.lat && latlng.lng) {\n\t\t\t\tconst mapHolder = document.createElement('div')\n\t\t\t\tmapHolder.className = 'map-holder'\n\t\t\t\tmapLocation.append(mapHolder)\n\t\t\t\tcreatePopupMap(mapHolder, latlng.lat, latlng.lng)\n\t\t\t}\n\t\t} catch {\n\t\t\tconsole.log('No map data found')\n\t\t}\n\n\t\tpopupContainer.showPopover()\n\n\t\tconst gallery = info.querySelector('.gallery')\n\t\tconst sliderEl = gallery.querySelector('.keen-slider')\n\t\tconst prevBtn = gallery.querySelector('.prev')\n\t\tconst nextBtn = gallery.querySelector('.next')\n\t\tconst dots = gallery.querySelectorAll('button.dot')\n\n\t\t// Save the slider instance to the element for destruction on close\n\t\tpopupContainer[SLIDER_SYMBOL] = createSlider(sliderEl, prevBtn, nextBtn, dots)\n\t}\n\n\tfunction resetForm() {\n\t\tformElement.reset()\n\t\tform.classList.remove('active')\n\t}\n\n\tfunction createSlider(sliderEl, prevBtn, nextBtn, dots) {\n\t\tconst slider = new KeenSlider(\n\t\t\tsliderEl,\n\t\t\t{\n\t\t\t\tloop: true,\n\t\t\t\tslides: {\n\t\t\t\t\tperView: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t[\n\t\t\t\t(slider) => {\n\t\t\t\t\tfunction updateClasses() {\n\t\t\t\t\t\tlet slide = slider.track.details.rel\n\t\t\t\t\t\tdots.forEach((dot) => {\n\t\t\t\t\t\t\tdot.classList.remove('active')\n\t\t\t\t\t\t})\n\t\t\t\t\t\tdots[slide].classList.add('active')\n\t\t\t\t\t}\n\n\t\t\t\t\tprevBtn.addEventListener('click', () => slider.prev())\n\t\t\t\t\tnextBtn.addEventListener('click', () => slider.next())\n\n\t\t\t\t\tdots.forEach((dot) => {\n\t\t\t\t\t\tdot.addEventListener('click', () => {\n\t\t\t\t\t\t\tlet targetIndex = parseInt(dot.dataset.index)\n\t\t\t\t\t\t\tslider.moveToIdx(targetIndex)\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\n\t\t\t\t\tslider.on('slideChanged', updateClasses)\n\t\t\t\t},\n\t\t\t]\n\t\t)\n\n\t\treturn slider\n\t}\n})\n"], "mappings": "MAAO,GAAM,GAAY,CACxB,CACC,YAAa,WACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,cACb,QAAS,CACR,CACC,WAAY,SAIf,CACC,YAAa,mBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,qBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,iBACb,YAAa,WACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,yBACb,YAAa,mBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,6BACb,QAAS,CACR,CACC,WAAY,SAIf,CACC,YAAa,0BACb,YAAa,mBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,MACb,YAAa,mBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,eACb,QAAS,CACR,CACC,WAAY,SAIf,CACC,YAAa,WACb,YAAa,WACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,WACb,YAAa,cACb,QAAS,CACR,CACC,WAAY,SAIf,CACC,YAAa,WACb,YAAa,mBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,WACb,YAAa,qBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,OACb,YAAa,gBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,OACb,YAAa,mBACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,gBACb,YAAa,WACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,eACb,YAAa,WACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,iCACb,YAAa,WACb,QAAS,CACR,CACC,MAAO,aAIV,CACC,YAAa,aACb,YA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