1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/diamond-filters-bidDvn-Y.js","chunks/polyfazer-app-DumDTOPg.js","chunks/main-BEpca-0G.js","assets/polyfazer-app-BxOL82Ft.css","chunks/PolyfazerFiltersManager-B20DzVOd.js","chunks/PolyfazerFilter-G6wDdeD6.js","chunks/ExtendedDate-BLMVein7.js","chunks/filters-behavior-BUO4aVrX.js","chunks/diamond-icon-button-AIbsxFeD.js","chunks/BetterPolymerElement-Dg3wVY7D.js","chunks/BetterTemplateHandling-CTXk4mRb.js","chunks/question-tag-C9ym_uv9.js","chunks/tippy-tooltip-BFt4tVnx.js","chunks/dialog-wrapper-B17FG1Y7.js","chunks/polymer-utils-B8xivS0d.js","chunks/BetterHTML-BN6nzApa.js"])))=>i.map(i=>d[i]); 2import{ad as me,A as F,cw as E,bS as ge,I as A,Q as Y,aN as fe,_ as ve,c6 as K,bc as J}from"./main-BEpca-0G.js";import{C as re,P as z,h as H}from"./polyfazer-app-DumDTOPg.js";import"./google-maps-B5_jwQnp.js";import"./question-tag-C9ym_uv9.js";import{l as ne}from"./location-services-B-Yo7g_g.js";import{g as ye}from"./_commonjsHelpers-CqkleIqs.js";import"./image-frame-DZbP5vtK.js";import{L as V}from"./lang-helper-behavior-D3p_DZHb.js";import{F as be}from"./filters-behavior-BUO4aVrX.js";import{L as B}from"./opening-hours-BdSXBAB1.js";import"./diamond-collapsible-wrapper-DbPGScyB.js";import{P as we,m as M}from"./PolyfazerFiltersManager-B20DzVOd.js";import{h as P}from"./polymer-utils-B8xivS0d.js";import"./theme-mixin-UzPGm89E.js";import"./ExtendedDate-BLMVein7.js";import"./BetterPolymerElement-Dg3wVY7D.js";import"./BetterTemplateHandling-CTXk4mRb.js";import"./collapsible-mixin-DFzWPmrp.js";import"./PolyfazerFilter-G6wDdeD6.js";import"./BetterHTML-BN6nzApa.js";var N,X;function _e(){return X||(X=1,N=function a(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var o,s,i;if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(s=o;s--!==0;)if(!a(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(t).length)return!1;for(s=o;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=o;s--!==0;){var r=i[s];if(!a(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}),N}var xe=_e();const ee=ye(xe),te=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],R=1,O=8;class q{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,o]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=o>>4;if(s!==R)throw new Error(`Got v${s} data when expected v${R}.`);const i=te[o&15];if(!i)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new q(l,r,i,e)}constructor(e,t=64,o=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=te.indexOf(this.ArrayType),r=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,n=(8-l%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${o}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,O,e),this.coords=new this.ArrayType(this.data,O+l+n,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(O+r+l+n),this.ids=new this.IndexArrayType(this.data,O,e),this.coords=new this.ArrayType(this.data,O+l+n,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(R<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=t,o}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return j(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,o,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:r,nodeSize:l}=this,n=[0,i.length-1,0],p=[];for(;n.length;){const d=n.pop()||0,c=n.pop()||0,h=n.pop()||0;if(c-h<=l){for(let m=h;m<=c;m++){const v=r[2*m],b=r[2*m+1];v>=e&&v<=o&&b>=t&&b<=s&&p.push(i[m])}continue}const u=h+c>>1,g=r[2*u],f=r[2*u+1];g>=e&&g<=o&&f>=t&&f<=s&&p.push(i[u]),(d===0?e<=g:t<=f)&&(n.push(h),n.push(u-1),n.push(1-d)),(d===0?o>=g:s>=f)&&(n.push(u+1),n.push(c),n.push(1-d))}return p}within(e,t,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:r}=this,l=[0,s.length-1,0],n=[],p=o*o;for(;l.length;){const d=l.pop()||0,c=l.pop()||0,h=l.pop()||0;if(c-h<=r){for(let m=h;m<=c;m++)oe(i[2*m],i[2*m+1],e,t)<=p&&n.push(s[m]);continue}const u=h+c>>1,g=i[2*u],f=i[2*u+1];oe(g,f,e,t)<=p&&n.push(s[u]),(d===0?e-o<=g:t-o<=f)&&(l.push(h),l.push(u-1),l.push(1-d)),(d===0?e+o>=g:t+o>=f)&&(l.push(u+1),l.push(c),l.push(1-d))}return n}}function j(a,e,t,o,s,i){if(s-o<=t)return;const r=o+s>>1;ae(a,e,r,o,s,i),j(a,e,t,o,r-1,1-i),j(a,e,t,r+1,s,1-i)}function ae(a,e,t,o,s,i){for(;s>o;){if(s-o>600){const p=s-o+1,d=t-o+1,c=Math.log(p),h=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*h*(p-h)/p)*(d-p/2<0?-1:1),g=Math.max(o,Math.floor(t-d*h/p+u)),f=Math.min(s,Math.floor(t+(p-d)*h/p+u));ae(a,e,t,g,f,i)}const r=e[2*t+i];let l=o,n=s;for(I(a,e,o,t),e[2*s+i]>r&&I(a,e,o,s);l<n;){for(I(a,e,l,n),l++,n--;e[2*l+i]<r;)l++;for(;e[2*n+i]>r;)n--}e[2*o+i]===r?I(a,e,o,n):(n++,I(a,e,n,s)),n<=t&&(o=n+1),t<=n&&(s=n-1)}}function I(a,e,t,o){U(a,t,o),U(e,2*t,2*o),U(e,2*t+1,2*o+1)}function U(a,e,t){const o=a[e];a[e]=a[t],a[t]=o}function oe(a,e,t,o){const s=a-t,i=e-o;return s*s+i*i}const ke={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},ie=Math.fround||(a=>(e=>(a[0]=+e,a[0])))(new Float32Array(1)),L=2,x=3,$=4,_=5,le=6;class Ae{constructor(e){this.options=Object.assign(Object.create(ke),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:o,maxZoom:s}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const r=[];for(let n=0;n<e.length;n++){const p=e[n];if(!p.geometry)continue;const[d,c]=p.geometry.coordinates,h=ie(S(d)),u=ie(T(c));r.push(h,u,1/0,n,-1,1),this.options.reduce&&r.push(0)}let l=this.trees[s+1]=this._createTree(r);t&&console.timeEnd(i);for(let n=s;n>=o;n--){const p=+Date.now();l=this.trees[n]=this._createTree(this._cluster(l,n)),t&&console.log("z%d: %d clusters in %dms",n,l.numItems,+Date.now()-p)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let o=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let i=e[2]===180?180:((e[2]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,i=180;else if(o>i){const c=this.getClusters([o,s,180,r],t),h=this.getClusters([-180,s,i,r],t);return c.concat(h)}const l=this.trees[this._limitZoom(t)],n=l.range(S(o),T(r),S(i),T(s)),p=l.data,d=[];for(const c of n){const h=this.stride*c;d.push(p[h+_]>1?se(p,h,this.clusterProps):this.points[p[h+x]])}return d}getChildren(e){const t=this._getOriginId(e),o=this._getOriginZoom(e),s="No cluster with the specified id.",i=this.trees[o];if(!i)throw new Error(s);const r=i.data;if(t*this.stride>=r.length)throw new Error(s);const l=this.options.radius/(this.options.extent*Math.pow(2,o-1)),n=r[t*this.stride],p=r[t*this.stride+1],d=i.within(n,p,l),c=[];for(const h of d){const u=h*this.stride;r[u+$]===e&&c.push(r[u+_]>1?se(r,u,this.clusterProps):this.points[r[u+x]])}if(c.length===0)throw new Error(s);return c}getLeaves(e,t,o){t=t||10,o=o||0;const s=[];return this._appendLeaves(s,e,t,o,0),s}getTile(e,t,o){const s=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:r,radius:l}=this.options,n=l/r,p=(o-n)/i,d=(o+1+n)/i,c={features:[]};return this._addTileFeatures(s.range((t-n)/i,p,(t+1+n)/i,d),s.data,t,o,i,c
2),t===0&&this._addTileFeatures(s.range(1-n/i,p,1,d),s.data,i,o,i,c),t===i-1&&this._addTileFeatures(s.range(0,p,n/i,d),s.data,-1,o,i,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const o=this.getChildren(e);if(t++,o.length!==1)break;e=o[0].properties.cluster_id}return t}_appendLeaves(e,t,o,s,i){const r=this.getChildren(t);for(const l of r){const n=l.properties;if(n&&n.cluster?i+n.point_count<=s?i+=n.point_count:i=this._appendLeaves(e,n.cluster_id,o,s,i):i<s?i++:e.push(l),e.length===o)break}return i}_createTree(e){const t=new q(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let o=0;o<e.length;o+=this.stride)t.add(e[o],e[o+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,o,s,i,r){for(const l of e){const n=l*this.stride,p=t[n+_]>1;let d,c,h;if(p)d=ce(t,n,this.clusterProps),c=t[n],h=t[n+1];else{const f=this.points[t[n+x]];d=f.properties;const[m,v]=f.geometry.coordinates;c=S(m),h=T(v)}const u={type:1,geometry:[[Math.round(this.options.extent*(c*i-o)),Math.round(this.options.extent*(h*i-s))]],tags:d};let g;p||this.options.generateId?g=t[n+x]:g=this.points[t[n+x]].id,g!==void 0&&(u.id=g),r.features.push(u)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:o,extent:s,reduce:i,minPoints:r}=this.options,l=o/(s*Math.pow(2,t)),n=e.data,p=[],d=this.stride;for(let c=0;c<n.length;c+=d){if(n[c+L]<=t)continue;n[c+L]=t;const h=n[c],u=n[c+1],g=e.within(n[c],n[c+1],l),f=n[c+_];let m=f;for(const v of g){const b=v*d;n[b+L]>t&&(m+=n[b+_])}if(m>f&&m>=r){let v=h*f,b=u*f,w,W=-1;const D=((c/d|0)<<5)+(t+1)+this.points.length;for(const ue of g){const k=ue*d;if(n[k+L]<=t)continue;n[k+L]=t;const Q=n[k+_];v+=n[k]*Q,b+=n[k+1]*Q,n[k+$]=D,i&&(w||(w=this._map(n,c,!0),W=this.clusterProps.length,this.clusterProps.push(w)),i(w,this._map(n,k)))}n[c+$]=D,p.push(v/m,b/m,1/0,D,-1,m),i&&p.push(W)}else{for(let v=0;v<d;v++)p.push(n[c+v]);if(m>1)for(const v of g){const b=v*d;if(!(n[b+L]<=t)){n[b+L]=t;for(let w=0;w<d;w++)p.push(n[b+w])}}}}return p}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,o){if(e[t+_]>1){const r=this.clusterProps[e[t+le]];return o?Object.assign({},r):r}const s=this.points[e[t+x]].properties,i=this.options.map(s);return o&&i===s?Object.assign({},i):i}}function se(a,e,t){return{type:"Feature",id:a[e+x],properties:ce(a,e,t),geometry:{type:"Point",coordinates:[Me(a[e]),Le(a[e+1])]}}}function ce(a,e,t){const o=a[e+_],s=o>=1e4?`${Math.round(o/1e3)}k`:o>=1e3?`${Math.round(o/100)/10}k`:o,i=a[e+le],r=i===-1?{}:Object.assign({},t[i]);return Object.assign(r,{cluster:!0,cluster_id:a[e+x],point_count:o,point_count_abbreviated:s})}function S(a){return a/360+.5}function T(a){const e=Math.sin(a*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function Me(a){return(a-.5)*360}function Le(a){const e=(180-a*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function Ee(a,e){var t={};for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&e.indexOf(o)<0&&(t[o]=a[o]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(a);s<o.length;s++)e.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(a,o[s])&&(t[o[s]]=a[o[s]]);return t}class y{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class Z{constructor({markers:e,position:t}){this.markers=e,t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(y.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>y.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(y.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class Ce{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return Oe(e)}}const Oe=a=>a.map(t=>new Z({position:y.getPosition(t),markers:[t]}));class Ie extends Ce{constructor(e){var{maxZoom:t,radius:o=60}=e,s=Ee(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1}
2,this.superCluster=new Ae(Object.assign({maxZoom:this.maxZoom,radius:o},s))}calculate(e){let t=!1;const o={zoom:e.map.getZoom()};if(!ee(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const s=this.markers.map(i=>{const r=y.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[r.lng(),r.lat()]},properties:{marker:i}}});this.superCluster.load(s)}return t||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(t=!ee(this.state,o)),this.state=o,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[e,t]},properties:o}){if(o.cluster)return new Z({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:t,lng:e}});const s=o.marker;return new Z({markers:[s],position:y.getPosition(s)})}}class pe{constructor(e,t){this.markers={sum:e.length};const o=t.map(i=>i.count),s=o.reduce((i,r)=>i+r,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...o),max:Math.max(...o)}}}}class de{render({count:e,position:t},o,s){const r=`<svg fill="${e>Math.max(10,o.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50"> 3<circle cx="120" cy="120" opacity=".6" r="70" /> 4<circle cx="120" cy="120" opacity=".3" r="90" /> 5<circle cx="120" cy="120" opacity=".2" r="110" /> 6<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text> 7</svg>`,l=`Cluster of ${e} markers`,n=Number(google.maps.Marker.MAX_ZINDEX)+e;if(y.isAdvancedMarkerAvailable(s)){const c=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const h={map:s,position:t,zIndex:n,title:l,content:c};return new google.maps.marker.AdvancedMarkerElement(h)}const p={position:t,zIndex:n,title:l,icon:{url:`data:image/svg+xml;base64,${btoa(r)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(p)}}function Se(a,e){for(let t in e.prototype)a.prototype[t]=e.prototype[t]}class G{constructor(){Se(G,google.maps.OverlayView)}}var C;(function(a){a.CLUSTERING_BEGIN="clusteringbegin",a.CLUSTERING_END="clusteringend",a.CLUSTER_CLICK="click"})(C||(C={}));const Te=(a,e,t)=>{t.fitBounds(e.bounds)};class Pe extends G{constructor({map:e,markers:t=[],algorithmOptions:o={},algorithm:s=new Ie(o),renderer:i=new de,onClusterClick:r=Te}){super(),this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=i,this.onClusterClick=r,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(o=>{this.addMarker(o,!0)}),t||this.render()}removeMarker(e,t){const o=this.markers.indexOf(e);return o===-1?!1:(y.setMap(e,null),this.markers.splice(o,1),t||this.render(),!0)}removeMarkers(e,t){let o=!1;return e.forEach(s=>{o=this.removeMarker(s,!0)||o}),o&&!t&&this.render(),o}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,C.CLUSTERING_BEGIN,this);const{clusters:t,changed:o}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(o||o==null){const s=new Set;for(const r of t)r.markers.length==1&&s.add(r.markers[0]);const i=[];for(const r of this.clusters)r.marker!=null&&(r.markers.length==1?s.has(r.marker)||y.setMap(r.marker,null):i.push(r.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>i.forEach(r=>y.setMap(r,null)))}google.maps.event.trigger(this,C.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>y.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}
7renderClusters(){const e=new pe(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(o=>{o.markers.length===1?o.marker=o.markers[0]:(o.marker=this.renderer.render(o,e,t),o.markers.forEach(s=>y.setMap(s,null)),this.onClusterClick&&o.marker.addListener("click",s=>{google.maps.event.trigger(this,C.CLUSTER_CLICK,o),this.onClusterClick(s,o,t)})),y.setMap(o.marker,t)})}}class Fe extends re(V(z)){static get template(){return H` 8 ${super.template} 9 <style> 10 :host { 11 display: block; 12 width: 450px; 13 max-width: 100%; 14 max-height: 100%; 15 overflow: hidden auto; 16 } 17 18 nav { 19 display: flex; 20 justify-content: flex-end; 21 } 22 23 .header { 24 display: flex; 25 align-items: center; 26 justify-content: space-between; 27 background: var(--state-color); 28 color: var(--on-state-color); 29 padding: 2px 10px; 30 font-weight: bold; 31 position: sticky; 32 position: -webkit-sticky; 33 top: 0; 34 z-index: 2; 35 } 36 37 .header h2 { 38 color: inherit; 39 margin: 0; 40 } 41 42 .status-circle { 43 width: 20px; 44 height: 20px; 45 border-radius: 50%; 46 border: 1px solid rgba(0,0,0,0.3); 47 padding: 5px; 48 margin-right: 20px; 49 } 50 51 [availability="AVAILABLE"], 52 [availability="AVAILABLE_UNCERTAIN"] { 53 --state-color: var(--success-color); 54 --on-state-color: var(--on-success-color); 55 } 56 57 [availability="NOT_AVAILABLE_OCCUPIED"] { 58 --state-color: var(--charging-color); 59 --on-state-color: var(--on-charging-color); 60 } 61 62 [availability="NOT_AVAILABLE_OUT_OF_ORDER"] { 63 --state-color: var(--error-color); 64 --on-state-color: var(--on-error-color); 65 } 66 67 [availability="NOT_AVAILABLE_OFF_HOURS"] { 68 --state-color: var(--not-available-color-1); 69 --on-state-color: var(--on-not-available-color-1); 70 } 71 72 [availability="NOT_AVAILABLE_MANUALLY_DISABLED"] { 73 --state-color: var(--not-available-color-2); 74 --on-state-color: var(--on-not-available-color-2); 75 } 76 77 hr.fancy { 78 margin: 0.5rem 0; 79 display: block; 80 } 81 82 .opening-hours { 83 display: flex; 84 padding: 0.4rem 1rem; 85 } 86 87 .opening-hours > iron-icon { 88 margin: 0.1rem 0.5em 0 0; 89 color: var(--application-color); 90 font-size: 2em; 91 } 92 93 .opening-hours .opened, 94 .opening-hours .closed { 95 display: none; 96 } 97 98 .opening-hours[state="OPENED"] .opened { 99 display: block; 100 color: var(--success-color); 101 } 102 103 .opening-hours[state="CLOSED"] .closed { 104 display: block; 105 color: var(--error-color); 106 } 107 108 .opening-hours .out-of-order { 109 color: var(--light-text-color); 110 margin-top: 0.5em; 111 } 112 113 .opening-hours diamond-collapsible-wrapper { 114 --indicator-size: 1.4em; 115 --indicator-padding: 0; 116 --primary-background-color: transparent; 117 } 118 119 .opening-hours .closest-time { 120 display: block; 121 margin-top: -0.5em; 122 font-size: 0.8em; 123 color: var(--light-text-color); 124 } 125 126 .opening-hours .allow-charging-after-hours { 127 font-size: 0.8em; 128 color: var(--light-text-color); 129 font-weight: bold; 130 } 131 132 .opening-hours opening-hours { 133 margin: 0.5rem 0 1rem; 134 } 135 136 .address { 137 text-transform: inherit; 138 color: var(--primary-text-color); 139 margin: 0; 140 padding: 0.4rem 1rem; 141 } 142 143 .address iron-icon { 144 color: var(--application-color); 145 font-size: 2em; 146 margin-right: 0.5em !important; 147 } 148 149 div > label { 150 color: var(--light-text-color); 151 font-size: 0.8em; 152 font-weight: 400; 153 letter-spacing: .3px; 154 margin-left: 10px; 155 } 156 157 footer { 158 position: sticky; 159 position: -webkit-sticky; 160 bottom: 0; 161 background: var(--surface-color); 162 padding: 0.5rem 0.5rem 1rem; 163 } 164 165 footer paper-button { 166 text-transform: none; 167 border: 2px solid var(--application-color); 168 border-radius: 0; 169 } 170 </style> 171 172 <paper-material elevation="2" class="info-box" no-rounding> 173 <header class="header" availability$="[[location.availabilityState]]"> 174 <div> 175 <paper-material class="status-circle" status$="[[location.availabilityState]]" style="visibility: hidden"></paper-material> 176 </div> 177 178 <h2>[[location.name]]</h2> 179 <nav> 180 <paper-icon-button icon="close" on-click="_clearSelection"></paper-icon-button> 181 </nav> 182 </header> 183 184 <diamond-section-overlay loading="[[loading]]" error="[[error]]"></diamond-section-overlay> 185 186 <div style="margin: 1rem 0"> 187 <label>[[_lang('information')]]</label> 188 <div class="grid-table"> 189 <label>[[_lang('availabilityState')]]</label> 190 <div class="item-value">[[translateAvailabilityState(location.availabilityState)]]</div> 191 <template is="dom-if" if="[[location.locationType]]"> 192 <label>[[_lang('place')]]</label> 193 <div class="item-value">[[translateLocationPlace(location.locationType)]]</div> 194 </template> 195 </div> 196 <hr class="fancy"> 197 198 <template is="dom-if" if="[[location.openingHours]]"> 199 <div class="opening-hours-wrapper"> 200 <label>[[_lang('openingHours')]]</label> 201
202 <div class="opening-hours" state$="[[_getLocationOpenedStateFromOpeningHours(location.openingHours)]]"> 203 <iron-icon icon="schedule" class="unify"></iron-icon> 204 205 <diamond-collapsible-wrapper collapsed="{{openingHoursCollapsed}}"> 206 <div slot="header" style="margin-right: 1rem"> 207 <template is="dom-if" if="[[!isEqual(location.availabilityState, 'NOT_AVAILABLE_OUT_OF_ORDER', 'NOT_AVAILABLE_MANUALLY_DISABLED')]]"> 208 <div> 209 <span class="opened">[[_lang('opened')]]</span> 210 <span class="closed">[[_lang('closed')]]</span> 211 212 <span class="closest-time">[[_getClosestStateChangeHour(location.openingHours)]]</span> 213 </div> 214 215 <template is="dom-if" if="[[location.openingHours.allowChargingAfterHours]]"> 216 <div class="allow-charging-after-hours">[[_lang('chargingWhenClosedLocationHint')]]</div> 217 </template> 218 </template> 219 <template is="dom-if" if="[[isEqual(location.availabilityState, 'NOT_AVAILABLE_OUT_OF_ORDER', 'NOT_AVAILABLE_MANUALLY_DISABLED')]]"> 220 <div class="out-of-order">[[_lang('closed')]]</div> 221 </template> 222 </div> 223 224 <opening-hours hours="[[location.openingHours]]" variation="fancy" show-active></opening-hours> 225 </diamond-collapsible-wrapper> 226 </div> 227 </div> 228 </template> 229 <hr class="fancy"/> 230 231 <template is="dom-if" if="[[_hasAddress(location.address)]]"> 232 <label>[[_lang('address')]]</label> 233 <a href$="[[_getAddressQueryLink(location.address)]]" target="_blank" rel="noopener noreferrer"> 234 <paper-button class="address flex-row" style="border-radius: 0;"> 235 <iron-icon icon="directions" class="unify"></iron-icon> 236 <div class="column"> 237 [[location.address.street]] [[location.address.houseNumber]] <br> 238 [[location.address.city]] [[location.address.postalCode]] <br> 239 [[location.address.country]] 240 <template is="dom-if" if="[[locationDetail.address.floor]]"> 241 <br> [[_lang('floor')]]: [[location.address.floor]] 242 </template> 243 </div> 244 </paper-button> 245 </a> 246 </template>
247 </div> 248 <hr class="fancy"/> 249 250 <footer> 251 <nav> 252 <template is="dom-if" if="[[!isEqual(location.address.latitude, location.address.longitude, 0)]]"> 253 <a href="https://www.google.com/maps/search/?api=1&query=[[location.address.latitude]],[[location.address.longitude]]" target="_blank" rel="noopener noreferrer"> 254 <paper-button> 255 <iron-icon icon="google-maps" class="unify"></iron-icon> 256 <span>[[_lang('goToCoords')]]</span> 257 </paper-button> 258 </a> 259 260 <a href$="/locations/[[locationId]]" target="[[_getTarget(standalone)]]"> 261 <paper-button> 262 [[_lang('locationDetail')]] 263 </paper-button> 264 </a> 265 </template> 266 </nav> 267 </footer> 268 </paper-material> 269 `}static get properties(){return{locationId:{type:Number,value:null,observer:"refresh"},location:{type:Object,value:null}}}connectedCallback(){super.connectedCallback(),window.locationInfobox=this}init(){}refresh(){this.get("locationId")&&(this.set("openingHoursCollapsed",!0),this.set("loading",!0),this.clearErrorFromResponse(),ne.getItem(this.get("locationId")).then(e=>{this.set("location",e)},e=>{this.setErrorFromResponse(e)}).finally(()=>{this.set("loading",!1)}))}_clearSelection(){this.dispatchEvent(new Event("clear-selection"))}_getAddressQueryLink(e){let t=me(e).filter(o=>["city","country","street","houseNumber","postalCode"].includes(o.key),!0).map(o=>o.value).join(" ");return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`}_hasAddress(e){return e&&(e.street||e.houseNumber||e.city||e.postalCode||e.country||e.floor)}_getLocationOpenedStateFromOpeningHours(e){return B.getCurrentState(e)}_getClosestStateChangeHour(e){let t=B.getNextClosestChangeOfState(e);if(!t)return;const o=B.getCurrentState(e);let s="hour",i=(t.interval.from.getTime()-Date.now())/36e5;if(!(i>12))return i<1&&(i=i*60,s="minute"),this._lang(o=="OPENED"?"locationClosingIn":"locationOpeningIn",Math.round(i),this._quantityLang(s,i))}_getTarget(e){return e?"_blank":""}}window.customElements.define("location-infobox",Fe);class ze extends Pe{removeMarker(e,t){const o=this.markers.indexOf(e);return o===-1?!1:(this.markers[o].setMap?.(this.map),this.markers.splice(o,1),t||this.render(),!0)}reset(){this.clusters=[]}
269renderClusters(){const e=this.clusters.filter(i=>i.markers.length>1);this.prevClusters?.filter(i=>!e.some(r=>F.equals(i.markers,r.markers))).forEach(i=>i.delete());const t=new pe(this.markers,this.clusters),o=this.getMap(),s=[];e.forEach(i=>{s.push(...i.markers);for(const r of this.prevClusters)if(F.equals(r.markers,i.markers)){i.marker=r.marker;return}i.marker=this.renderer.render(i,t,o),this.onClusterClick&&i.marker.addListener("click",r=>{google.maps.event.trigger(this,C.CLUSTER_CLICK,i),this.onClusterClick(r,i,o)}),i.marker.setMap(o)}),this.prevClusters=[...e],this.markers.forEach(i=>{s.includes(i)?i.setMap(null):i.map!==this.map&&i.setMap(this.map)})}}class De extends z{static get template(){return P` 270 <style> 271 :host { 272 position: relative; 273 display: flex; 274 align-items: center; 275 justify-content: center; 276 } 277 278 img, 279 svg { 280 width: 48px; 281 height: 48px; 282 fill: var(--cluster-color, var(--secondary-color)); 283 } 284 285 span { 286 position: absolute; 287 font-size: 1.3em; 288 font-weight: bold; 289 color: var(--on-cluster-color, var(--on-secondary-color)); 290 ${window.activeEnvironment.clusterLabelColor?P`color: ${window.activeEnvironment.clusterLabelColor};`:""} 291 } 292 </style> 293 294 ${window.activeEnvironment.clusterIcon??P` 295 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"> 296 <circle cx="120" cy="120" opacity=".8" r="70"/> 297 <circle cx="120" cy="120" opacity=".5" r="90" fill="#fff"/> 298 <circle cx="120" cy="120" opacity=".3" r="100"/> 299 <circle cx="120" cy="120" r="70" stroke-width="3px" stroke-linejoin="round" stroke="#fff"/> 300 </svg> 301 `} 302 303 <span>[[count]]</span> 304 `}static get properties(){return{markers:Array,count:Number,stats:Object}}connectedCallback(){super.connectedCallback(),window.locationClusterMarker=this}}window.customElements.define("location-cluster-marker",De);class Be extends re(V(z)){#e={id:null,play:!1,revert:!1,direction:1};static get template(){return P` 305 ${super.template} 306 307 <style> 308 :root { 309 --location-marker-color: var(--status-color); 310 --location-marker-border-color: var(--surface-color); 311 --location-marker-image-size: 24px; 312 } 313 314 :host { 315 display: flex; 316 flex-direction: column; 317 margin-bottom: 10px; /*Compensate for the longer tail*/ 318 outline: none; 319 } 320 321 :host, 322 * { 323 pointer-events: none; 324 } 325 326 :host([interactive]), 327 :host([interactive]) * { 328 pointer-events: auto; 329 } 330 331 :host([availability="${E.AVAILABLE}"]), 332 :host([availability="${E.AVAILABLE_UNCERTAIN}"]) { 333 --state-color: var(--success-color); 334 } 335 336 :host([availability="${E.NOT_AVAILABLE_OCCUPIED}"]) { 337 --state-color: var(--charging-color); 338 } 339 340 :host([availability="${E.NOT_AVAILABLE_OUT_OF_ORDER}"]) { 341 --state-color: var(--error-color); 342 } 343 344 :host([availability="${E.NOT_AVAILABLE_OFF_HOURS}"]) { 345 --state-color: var(--not-available-color-1); 346 } 347 348 :host([availability="${E.NOT_AVAILABLE_MANUALLY_DISABLED}"]) { 349 --state-color: var(--not-available-color-2); 350 } 351 352 h1 { 353 margin-bottom: 0.5rem; 354 margin-top: 0; 355 } 356 357 .marker-wrapper { 358 margin: 0 auto; 359 transform-origin: center bottom; 360 } 361 362 :host([size="SMALL"]) .marker-wrapper { 363 transform: scale(0.5); 364 } 365 366 :host([size="BIG"]) .marker-wrapper { 367 transform: scale(1.5); 368 } 369 370 .marker { 371 align-items: center; 372 background-color: var(--state-color); 373 border-radius: 50%; 374 display: flex; 375 justify-content: center; 376 padding: 4px; 377 position: relative; 378 border: 3px solid var(--location-marker-border-color); 379 margin: 0 auto; 380 transform-origin: center bottom; 381 } 382 383 :host(:not([no-hover])) .marker { 384 pointer-events: auto; 385 } 386 387 .marker::after { 388 content: ""; 389 position: absolute; 390 width: calc(var(--location-marker-image-size) / 1.2); 391 height: calc(var(--location-marker-image-size) / 1.2); 392 background: var(--state-color); 393 left: 50%; 394 bottom: 0.6px; 395 transform: translate(-50%, 30%) scaleY(1.5) rotate(45deg); 396 z-index: 1; 397 border-radius: 3px; 398 border: 3px solid var(--location-marker-border-color); 399 border-top: none; 400 border-left: none; 401 } 402 403 :host(:not([no-hover])) .marker::after { 404 pointer-events: auto; 405 } 406 407 .icon {
408 align-items: center; 409 display: flex; 410 justify-content: center; 411 background: var(--location-marker-inset-color); 412 border-radius: 50%; 413 position: relative; 414 overflow: hidden; 415 transform: scale(1.1); 416 z-index: 2; 417 } 418 419 :host([size="SMALL"]) .icon { 420 transform: scale(1); 421 } 422 423 .icon::before { 424 content: ""; 425 position: absolute; 426 width: calc(var(--location-marker-image-size) / 1.5); 427 height: calc(var(--location-marker-image-size) / 1.5); 428 left: 50%; 429 bottom: 0; 430 transform: translate(-50%, 9%) rotate(45deg); 431 z-index: 2; 432 border-radius: 3px; 433 background: var(--location-marker-inset-color); 434 } 435 436 .image-proxy { 437 height: var(--location-marker-image-size); 438 width: var(--location-marker-image-size); 439 position: relative; 440 z-index: 2; 441 display: flex; 442 align-items: center; 443 justify-content: center; 444 background: white; 445 overflow: hidden; 446 } 447 448 .image-proxy::before { 449 content: ""; 450 position: absolute; 451 top: 0; 452 bottom: 50%; 453 left: 0; 454 right: 0; 455 background: rgba(0, 0, 0, 0.05); 456 } 457 458 .image-proxy iron-icon.unify { 459 font-size: 1.5em; 460 color: var(--state-color); 461 } 462 463 .info-window { 464 align-items: center; 465 display: none; 466 gap: 15px; 467 justify-content: center; 468 position: relative; 469 border: 3px solid var(--location-marker-border-color); 470 flex: 1; 471 z-index: 3; 472 cursor: default; 473 background: var(--elevation-3-color); 474 color: var(--on-elevation-3-color); 475 border-radius: 8px; 476 box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.2); 477 padding: 8px 15px; 478 width: auto; 479 margin-bottom: -6px; 480 } 481 482 :host([size="SMALL"]) .info-window { 483 margin-bottom: -16px; 484 } 485 486 :host([size="BIG"]) .info-window { 487 margin-bottom: 10px; 488 } 489 490 /* 491 * Property styles in opened state. 492 */ 493 :host([opened]) .info-window, 494 :host([interactive]:hover) .info-window, 495 :host(:focus) .info-window, 496 :host(:focus-within) .info-window { 497 display: flex; 498 } 499 500 .info-window::before { 501 content: ""; 502 position: absolute; 503 left: 50%; 504 background: inherit; 505 transform: translateX(-50%) rotate(45deg); 506 bottom: -10px; 507 width: 30px; 508 height: 30px; 509 box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.2); 510 z-index: -1; 511 } 512 513 .big-icon vehicle-tint-image { 514 height: 150px; 515 max-width: 150px; 516 } 517 518 .grid-table { 519 display: grid; 520 grid-template-columns: auto 1fr; 521 grid-gap: 0.2rem 0.5rem; 522 align-items: baseline; 523 } 524 525 .grid-table label { 526 color: var(--light-text-color); 527 font-size: 0.9em; 528 text-align: right; 529 } 530 531 .availability { 532 color: var(--state-color); 533 } 534 535 @media (orientation: portrait) or (max-width: 600px) { 536 .info-window { 537 flex-direction: column; 538 } 539 } 540 </style> 541 542 <div class="info-window" on-mousedown="stopPropagation" on-click="stopPropagation" on-mousemove="stopPropagation"> 543 <div class="big-icon"> 544 </div> 545 546 <div class="details" id="details"> 547 <h1 style="max-width: 200px">[[location.name]]</h1> 548 549 <div class="grid-table"> 550 <label>[[_lang('availability')]]</label> 551 <div class="value"> 552 <div class="value availability">[[translateAvailabilityState(location.availabilityState)]]</div> 553 </div> 554 </div> 555 </div> 556 </div> 557 558 <div class="marker-wrapper"> 559 <div class="marker" id="marker" on-mouseenter="_setOpened" on-mousemove="_setOpened" on-touchstart="_setOpened" on-touchend="_setClosed" on-mouseleave="_setClosed"> 560 <div class="icon"> 561 <div class="image-proxy"> 562 <iron-icon class="unify" icon="charge"></iron-icon> 563 </div> 564 </div> 565 </div> 566 </div> 567 `}static get properties(){return{location:Object,availability:{type:Boolean,reflectToAttribute:!0,computed:"_pass(location.availabilityState)"},visibility:{type:Boolean,reflectToAttribute:!0,computed:"_pass(location.visibility)"},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_observeSelected"},opened:{type:Boolean,value:!1,reflectToAttribute:!0},interactive:{type:Boolean,value:!1,reflectToAttribute:!0},noHover:{type:Boolean,value:!1,reflectToAttribute:!0},size:{type:String,value:"REGULAR",reflectToAttribute:!0}}}connectedCallback(){super.connectedCallback(),window.locationMarker=this,window.google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.$.details)}disconnectedCallback(){this._stopBounceAnimation()}onMapSet({visible:e}){!e&&this.opened&&this._setClosed()}_pass(e){return e}_setOpened(){this.opened||this.noHover||this.interactive||this.set("opened",!0)}_setClosed(){this.interactive||this.set("opened",!1)}_observeSelected(e,t){e?this._startBounceAnimation():this._revertBounceAnimation()}_startBounceAnimation(){let e=150,t=0,o=this.#e.id=ge();this.#e.direction=1,this.#e.play=!0,this.#e.revert=!1;const s=()=>{window.requestAnimationFrame(()=>{if(this.#e.play&&this.#e.id===o){if(t+=this.#e.direction,this.#e.direction>0&&this.#e.revert&&t<e/2&&(this.#e.direction=-1),(t>=e||t<=0)&&(t=0,this.#e.revert)){this.#e.play=!1;return}let i=-15*Math.abs(Math.sin(Math.PI*t/e));this.$.marker.style.transform=`translateY(${i}%)`,s()}})};s()}_revertBounceAnimation(){this.#e.revert=!0}
567_stopBounceAnimation(){this.#e.play=!1}}window.customElements.get("location-marker")||window.customElements.define("location-marker",Be);const he=1e6;class Ne extends de{render({markers:e,count:t,position:o},s){const i=document.createElement("location-cluster-marker");i.setProperties({markers:e,count:t,stats:s});let r=new window.google.maps.marker.AdvancedMarkerElement({position:o,content:i,zIndex:Number(he)+t});return i.addEventListener("mouseover",()=>{r.infoWindow=r.infoWindow??new google.maps.InfoWindow({content:` 568 <div style="color: var(--primary-text-color)"> 569 ${e.slice(0,10).map(l=>l.location.name).join("<br>")+(e.length>10?"<br>...":"")} 570 </div> 571 `,disableAutoPan:!0}),r.infoWindow.open(this._gmaps,r)}),i.addEventListener("mouseout",()=>{r.infoWindow.close()}),r}}const Re=H` 572 <style> 573 .marker-info-window { 574 font-size: 0.7em; 575 color: var(--primary-text-color); 576 } 577 578 #infoboxMessage .warning-wrap { 579 display: none; 580 } 581 582 #infoboxMessage location-infobox { 583 position: static; 584 } 585 586 .warning { 587 padding: 10px; 588 background-color: var(--warning-color); 589 color: var(--on-warning-color); 590 text-align: center; 591 display: flex; 592 align-items: center; 593 } 594 595 .warning iron-icon { 596 margin-right: 10px; 597 } 598 599 .toggle-clusters { 600 padding: 0; 601 text-transform: unset; 602 } 603 604 .toggle-clusters paper-toggle-button { 605 padding: 0.4em 0.5em; 606 height: 100%; 607 } 608 609 .maps-buttons paper-button[filters-active] { 610 color: var(--application-color-light); 611 } 612 613 @media screen and (max-width: 850px) { 614 .maps-buttons { 615 margin-top: 50px; 616 } 617 } 618 619 @media screen and (max-width: 700px) { 620 .maps-buttons { 621 margin-top: 0; 622 } 623 } 624 625 @media screen and (max-width: 600px) { 626 #infoboxMessage .warning-wrap { 627 display: block; 628 } 629 630 #infoboxMessage location-infobox { 631 display: none; 632 } 633 634 .maps-buttons { 635 margin-top: 50px; 636 } 637 } 638 </style> 639`;class Ue extends be(V(z)){static get template(){return H` 640 ${super.template} 641 <style> 642 :host { 643 display: block; 644 width: 100%; 645 height: 100%; 646 } 647 648 :host([standalone]) { 649 height: 100vh; 650 } 651 652 .loader { 653 position: absolute; 654 top: 0; 655 left: 0; 656 width: 100%; 657 height: 5px; 658 z-index: 2; 659 } 660 661 location-infobox { 662 z-index: 1; 663 max-height: 70vh; 664 position: absolute; 665 top: 0; 666 right: 0; 667 } 668 669 #infoboxMessage, 670 #actionButtons { 671 display: none; 672 } 673 674 @media screen and (max-width: 600px) { 675 location-infobox { 676 width: 100%; 677 } 678 } 679 </style> 680 <template is="dom-if" if="[[loading]]"> 681 <paper-progress class="loader" indeterminate></paper-progress> 682 </template> 683 684 <div id="infoboxMessage"> 685 <template is="dom-if" if="[[fullscreen]]"> 686 <template is="dom-if" if="[[selectedLocationID]]"> 687 <div class="warning-wrap"> 688 <div class="warning"> 689 <iron-icon icon="warning"></iron-icon> 690 <span>[[_lang('locationInfoboxFullscreenMessage')]]</span> 691 </div> 692 </div> 693 <location-infobox location-id="[[selectedLocationID]]" on-clear-selection="_clearLocationFocus" standalone="[[standalone]]"></location-infobox> 694 </template> 695 </template> 696 </div> 697 698 <template is="dom-if" if="[[selectedLocationID]]"> 699 <location-infobox location-id="[[selectedLocationID]]" on-clear-selection="_clearLocationFocus" standalone="[[standalone]]"></location-infobox> 700 </template> 701 702 <google-maps id="maps" auto-init="0" goto-user-on-init="[[!standalone]]" on-initialized="_handleMapsInitialized"></google-maps> 703 704 <div class="maps-buttons" id="actionButtons"> 705 <paper-button class="no-style toggle-clusters"> 706 <paper-toggle-button checked="{{clustersEnabled}}">[[_lang('toggleClusters')]]</paper-toggle-button> 707 </paper-button> 708 <template is="dom-if" if="[[!or(fullscreen, standalone)]]"> 709 <paper-button class="no-text no-style" on-click="forceRefresh" disabled="[[loading]]"> 710 <question-tag icon="refresh">[[_lang('refresh')]]</question-tag> 711 </paper-button> 712 <paper-button class="no-text no-style" on-click="_openFilters" filters-active$="[[filtersActive]]"> 713 <question-tag icon="filter-list">[[_lang('filters')]]</question-tag> 714 </paper-button> 715 </template> 716 </div> 717 718 <diamond-filters id="filters" filters-active="[[filtersActive]]" on-apply-filters="_applyFilters" on-reset-filters="_resetFilters"></diamond-filters> 719 `}static get properties(){return{loading:Boolean,mapsInitialized:{type:Boolean,value:!1},locations:{type:Array,value:()=>[],observer:"_handleLocationsChange"},page:Number,locationsMarkers:Array,locationToFocus:Number,fullscreen:{type:Boolean,value:!1}
719,clustersEnabled:{type:Boolean,value:A.valid(localStorage.getItem("clusterLocationsMaps"))?JSON.parse(localStorage.getItem("clusterLocationsMaps")):!0,observer:"_handleClustersToggle"},filtersActive:Boolean,standalone:{type:Boolean,value:!1,reflectToAttribute:!0}}}get dialogs(){return[this.$.filters]}connectedCallback(){super.connectedCallback(),window.locationsMap=this,this.set("mapsInitialized",!1),this._filtersManager=new we({defaultFormula:"name * connector * lifecycleStage * chargepointIdentity * visibility * region * partner"}),this._filtersManager.onFiltersUpdated(()=>{this.setProperties({filtersActive:this._filtersManager.hasAnyFilterActive()})}),this._filtersManager.setFilters({name:{...M.text,label:this._lang("locationName")},lifecycleStage:M.locationLifecycleStage,chargepointIdentity:{...M.text,field:"evses.connectors.unit.chargePointIdentity",restricted:"ADMIN"},visibility:M.locationVisibility,region:M.region,partner:M.partner,connector:M.connectorStandard})}get _getMapsElement(){return this.$.maps}get _gmaps(){return this._getMapsElement.maps}onPageEnter(){this._interruptRefresh=!1,this._clearAllData()}onPageLeave(){super.onPageLeave?.(),this._interruptRefresh=!0}init(){let e=new Y(window.location.search).toObject(),{formula:t,location:o,pos:s,zoom:i,gestureHandling:r}=e,l=fe(e,"location","formula");this._filtersManager.setFilterValues(l,t),this.get("mapsInitialized")?this.forceRefresh():(o&&this.set("locationToFocus",o),this._getMapsElement.init().then(()=>{this.set("mapsInitialized",!0),this._handleData({maps:this._gmaps,pos:s,zoom:i,gestureHandling:r}),this.forceRefresh()}))}_handleMapsInitialized(e){e.detail.reloadAfterFailure&&(this.set("mapsInitialized",!0),this._handleData({maps:e.detail.maps}),this.forceRefresh())}forceRefresh(){this._clearAllData(),this.set("loading",!0),this.refresh()}refresh(){if(this._interruptRefresh)return;let{page:e}=this,{lat:t,lng:o}=this._gmaps.getCenter(),s=this._filtersManager.getDataForRequest(),i={size:30,page:e,latitude:t(),longitude:o(),...s};this.wrapWith("locations",ne.getListOrdered(i,{signal:this.createSignal()})).then(this._handleData.bind(this),this._handleError.bind(this))}_handleData(e){if(e.maps){if([...Re.content.children||[]].forEach(t=>this._getMapsElement.shadowRoot.appendChild(t)),this._setupClusterer(),e.maps.addListener("bounds_changed",()=>{let t=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;this.set("fullscreen",t)}),e.gestureHandling&&(e.maps.gestureHandling=e.gestureHandling),e.pos){let[t,o]=e.pos.split(",").map(s=>parseFloat(s));window.google.maps.event.addListenerOnce(e.maps,"bounds_changed",function(){e.maps.center=new window.google.maps.LatLng(t,o)})}e.zoom&&window.google.maps.event.addListenerOnce(e.maps,"bounds_changed",function(){e.maps.setZoom(parseFloat(e.zoom))}),window.google.maps.event.addListenerOnce(e.maps,"tilesloaded",()=>{e.maps.controls[window.google.maps.ControlPosition.TOP_RIGHT].push(this.$.actionButtons),e.maps.controls[window.google.maps.ControlPosition.RIGHT_TOP].push(this.$.infoboxMessage)})}else if(e.locations){let t=[];e.locations.content.forEach(o=>{F.contains(this.get("locations"),o.id,"id")||t.push(o)}),this.set("locations",[...this.get("locations"),...t]),e.locations.empty?this._handleFinally():(this.set("page",this.get("page")+1),this.refresh())}}_handleError(e){e.maps?window.toaster.show(this._lang("googleMapsUnavailable")):e.locations}_handleFinally(){this.set("loading",!1)}_clearAllData(){this.set("page",0),(this.get("locations")||[]).forEach(e=>{e.marker&&(e.marker.setMap(null),this.locationsClusterer.removeMarker(e.marker))}),this.set("locationsMarkers",[]),this.set("locations",[])}_handleLocationsChange(e,t){let{added:o,same:s,removed:i}=F.diff(e,t||[],{solver:"id"});A.empty(o)||this._attachLocations(o).forEach(r=>{this.push("locationsMarkers",r),r.location.id==this.get("locationToFocus")&&(this._focusOnLocation(r.location.id),this.set("locationToFocus",null))}),s.forEach(r=>{let l=this.locationsMarkers.find(n=>n.location.id==r.id);l&&(l.setPosition({lat:this.serve(r,"address.latitude",0),lng:this.serve(r,"address.longitude",0)}),l.content.setProperties({location:r}),l.location=r)}
719),A.empty(i)||i.forEach(r=>{r.marker&&(this.locationsClusterer.removeMarker(r.marker),r.marker.setMap(null),delete r.marker)})}_attachLocations(e=this.get("locations")){return e.map(t=>{let{latitude:o,longitude:s}=t.address;if(o&&s){const i=document.createElement("location-marker");i.setProperties({location:t});const r=new window.google.maps.marker.AdvancedMarkerElement({position:{lat:o||0,lng:s||0},content:i,map:this._gmaps,zIndex:55});return r.defaultZIndex=r.zIndex,r.location=t,this._setLocationMarkerSize(r),t.marker=r,this.get("clustersEnabled")&&this.locationsClusterer.addMarker(r),this._setupMarkerEvents(r),r}return null}).filter(t=>!!t)}_setLocationMarkerLabelData(e,t=this.mapSettings){e.label.setVisibility(t?.vehicleMarkerLabel!="NONE"),e.label.setLabel({text:e.location.name,style:{fontWeight:"bold",textShadow:"-2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white, 2px 2px 0 white"}})}_setLocationMarkerSize(e,t=this.mapSettings){const o=s=>{switch(s){case"SMALL":return[14,-28];case"BIG":return[40,-50];default:case"REGULAR":return[27,-40]}};e.content.set("size",t?.locationMarkerSize),e.label?.setPixelOffset(o(t?.locationMarkerSize))}_openFilters(){this.appImport(()=>ve(()=>import("./diamond-filters-bidDvn-Y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),"/src/elements/tools/diamond/diamond-filters/diamond-filters.js").then(()=>{let{filterTypes:e,composition:t,modifiers:o}=this._filtersManager.getCompositionData();this.$.filters.open(e,t,o)})}_setupMarkerEvents(e){e.addListener("click",()=>{this._focusOnLocation(e.location.id,!1)}),e.content.addEventListener("dblclick",()=>{this._focusOnLocation(e.location.id,!0),new K(this._gmaps.getCenter()).isWithinRadius(new K(e.position),5e-4)&&this._gmaps.setZoom(this._gmaps.getZoom()+2)}),e.content.addEventListener("mouseover",()=>{e.zIndex=he+e.defaultZIndex+1}),e.content.addEventListener("mouseout",()=>{e.zIndex=e.defaultZIndex||null})}_focusOnLocation(e,t=!0){this.updateQueryStringParameter("location",e),this.set("selectedLocationID",parseInt(e));let o=this.get("locationsMarkers").find(s=>s.location.id==e);this.set("focusedMarker",o),t&&o&&this._focusOnMarker(o)}_clearLocationFocus(){this.updateQueryStringParameter("location",null),this.set("focusedMarker",null),this.set("selectedLocationID",null),J.clearAnimatedPanInterval()}_focusOnMarker(e){e&&(this.set("focusedMarker",e),J.animatedPanTo(this._gmaps,e.position))}_getLocationInfoWindowContent(e){const{location:t}=e;return` 720 <div class="marker-info-window"> 721 <div>${this._lang("locationName")}: <b>${t.name}</b></div> 722 <div>${this._lang("availabilityState")}: <b>${this.translateAvailabilityState(t.availabilityState)}</b></div> 723 </div> 724 `}_setupClusterer(){this.locationsClusterer=new ze({map:this._gmaps,markers:[],renderer:new Ne})}_applyFilters(e){let{filterValues:t,formula:o}=e.detail;this._filtersManager.applyFilters(t,o),this._updateURL()}_updateURL(){let{filters:e,formula:t}=this._filtersManager.getDataForURL();(!A.empty(e)||!A.empty(t)||!A.empty(window.location.search))&&page(window.location.pathname+new Y({...e,formula:t}).toValidDataString())}_resetFilters(){page(window.location.pathname)}_handleClustersToggle(e,t){A.defined(t)&&(e?this.locationsClusterer.addMarkers(this.get("locationsMarkers")):(this.locationsClusterer.removeMarkers(this.get("locationsMarkers")),this.get("locationsMarkers").forEach(o=>{o.setMap(this._gmaps)})),localStorage.setItem("clusterLocationsMaps",JSON.stringify(e)))}}window.customElements.define("location-map",Ue); 725//# sourceMappingURL=locations-map-CZldwqxm.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.