{"version":3,"file":"map_controller-BOlVtGz2.js","names":["L","icon","iconShadow"],"sources":["../../../app/javascript/entrypoints/site_controllers/map_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\"\nimport L from \"leaflet\"\nimport \"leaflet/dist/leaflet.css\"\nimport icon from \"leaflet/dist/images/marker-icon.png\"\nimport iconShadow from \"leaflet/dist/images/marker-shadow.png\"\n\n// Static office map: one marker, no visitor geolocation (no permission prompt).\nexport default class extends Controller {\n static values = { latitude: Number, longitude: Number, label: String }\n\n connect() {\n const position = [this.latitudeValue, this.longitudeValue]\n this.map = L.map(this.element, { scrollWheelZoom: false }).setView(position, 14)\n L.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\", {\n attribution: \"© OpenStreetMap contributors\"\n }).addTo(this.map)\n const marker = L.icon({ iconUrl: icon, shadowUrl: iconShadow, iconSize: [25, 41], iconAnchor: [12, 41] })\n L.marker(position, { icon: marker }).addTo(this.map).bindPopup(this.labelValue)\n }\n\n disconnect() {\n this.map?.remove()\n }\n}\n"],"mappings":"uLAOA,EAAA,cAA6B,CAAW,CACtC,OAAO,OAAS,CAAE,SAAU,OAAQ,UAAW,OAAQ,MAAO,OAAQ,CAEtE,SAAU,CACR,IAAM,EAAW,CAAC,KAAK,cAAe,KAAK,eAAe,CAC1D,KAAK,IAAMA,EAAAA,QAAE,IAAI,KAAK,QAAS,CAAE,gBAAiB,GAAO,CAAC,CAAC,QAAQ,EAAU,GAAG,CAChF,EAAA,QAAE,UAAU,qDAAsD,CAChE,YAAa,+BACd,CAAC,CAAC,MAAM,KAAK,IAAI,CAClB,IAAM,EAASA,EAAAA,QAAE,KAAK,CAAE,QAASC,EAAM,UAAWC,EAAY,SAAU,CAAC,GAAI,GAAG,CAAE,WAAY,CAAC,GAAI,GAAG,CAAE,CAAC,CACzG,EAAA,QAAE,OAAO,EAAU,CAAE,KAAM,EAAQ,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,KAAK,WAAW,CAGjF,YAAa,CACX,KAAK,KAAK,QAAQ"}