/*
  leaflet control list plugin
  https://github.com/adammertel/Leaflet.Control.List
  Adam Mertel | univie
*/
'use strict';L.MarkerCluster.List=L.Control.extend({options:{position:'topright'},initialize:function a(b,c){this.group=b;L.Control.prototype.initialize.call(this,c)},onAdd:function a(b){var c=this;var d=L.DomUtil.create('div','markercluster-list leaflet-bar');b.setListContainer(d);setTimeout(function(){c.moveContainer(b)},100);return d},moveContainer:function a(b){var c=b.getContainer().parentElement;var d=this.getContainer();c.appendChild(d);L.DomUtil.toFront(d)},show:function a(b){var c=this;var d=b.markers;var e=b.cluster;var f=d.sort(this.options.sortFn);var g=f.map(function(a,b){var d=b%2?'cluster-list-row-even':'cluster-list-row-odd';d+=' cluster-list-row';return'<tr class="'+d+'"><td>'+c.options.labelFn(a,b,e)+'</td></tr>'});var h=this.options.showHeader?'<div class="cluster-list-header">'+this.options.headerFn(d,e)+'</div>':'';var i=h;i+='<div id="marker-cluster-list-content">';i+='<div class="table-wrapper" style="margin-right: '+this.sidePanelWidth()+'px">';i+='<table><tbody>'+g.join('')+'</tbody></table>';i+='</div>';i+=this.sidePanelBuild();i+='</div>';this.updateContent(i);this.sidePanelBindEvent()},sidePanelBindEvent:function a(){var b=this;if(this.isSidePanel()){var c=document.getElementById('cluster-list-side-panel-button');c.addEventListener('click',function(){return b.handleCloseClick()})}},sidePanelBuild:function a(){var b='';if(this.isSidePanel()){b+='<div class="cluster-list-side-panel" style="width: '+this.sidePanelWidth()+'px">';b+='<button id="cluster-list-side-panel-button" class="cluster-list-side-panel-button" value="x" ></button>';b+='</div>'}return b},isSidePanel:function a(){return this.options.sidePanel},sidePanelWidth:function a(){return this.isSidePanel()?this.options.sidePanelWidth:0},handleCloseClick:function a(){this.group.listCloseButtonClick()},updateContent:function a(b){this.getContainer().innerHTML=b},hide:function a(){this.updateContent('')}});L.markerClusterGroup.list=function(a,b){return new L.MarkerCluster.List(a,b)};'use strict';L.MarkerCluster.ListMarker=L.CircleMarker.extend({options:{fillColor:'blue',radius:8,fill:true,stroke:true,color:'grey',weight:2.5,opacity:0.7,fillOpacity:1,className:'markercluster-list-marker'},initialize:function a(b,c){L.Util.setOptions(this,c);L.CircleMarker.prototype.initialize.call(this,b,c)}});L.markerClusterGroup.listMarker=function(a,b){return new L.MarkerCluster.ListMarker(a,b)};'use strict';L.MarkerCluster.include({_spiderfy:L.MarkerCluster.prototype.spiderfy,_unspiderfy:L.MarkerCluster.prototype.unspiderfy,spiderfy:function a(){var b=this._group;if(b.options.list){var c=this.getAllChildMarkers();b._spiderfied=this;b.fire('spiderfied',{cluster:this,markers:c});this._map.on('click',this.unspiderfy,this);b.unassignSelectedClass();this.assignSelectedClass()}else{this._spiderfy()}},unspiderfy:function a(){var b=this._group;b.unassignSelectedClass();if(b.options.list){var c=this.getAllChildMarkers();b._spiderfied=this;b.fire('unspiderfied',{cluster:this,markers:c})}else{this._unspiderfy()}},assignSelectedClass:function a(){this._icon.classList.add('marker-cluster-selected')}});L.Map=L.Map.include({_remove:L.Map.prototype.remove,setListContainer:function a(b){this.listContainer=b},remove:function a(){this.listContainer.remove();this._remove()}});'use strict';L.MarkerClusterGroup.WithList=L.MarkerClusterGroup.extend({options:{labelFn:function a(){return'...'},headerFn:function a(){return''},sortFn:function a(){return 1},showHeader:false,sidePanel:false,sidePanelWidth:50,list:true,centerOnChange:false},initialize:function a(b){L.MarkerClusterGroup.prototype.initialize.call(this,b)},onAdd:function a(b){var c=this;this.list=L.markerClusterGroup.list(this,this.options);this.list.addTo(b);this.on('spiderfied',function(a){if(c.options.centerOnChange){b.panTo(a.cluster.getLatLng())}c.refreshList(a)});this.on('unspiderfied',function(){c.hideList()});L.MarkerClusterGroup.prototype.onAdd.call(this,b)},refreshList:function a(b){if(this.options.list){this.list.show(b)}},hideList:function a(){if(this.options.list===true){this.list.hide()}},listCloseButtonClick:function a(){this._spiderfied.unspiderfy()},clearLayers:function a(){this.hideList();L.MarkerClusterGroup.prototype.clearLayers.call(this)},unassignSelectedClass:function a(){var b=document.getElementsByClassName('marker-cluster-selected');var c=[];for(var d=0;d<b.length;d++){c.push(b[d])};c.map(function(a){a.classList.remove('marker-cluster-selected')})}});L.markerClusterGroup.withList=function(a){return new L.MarkerClusterGroup.WithList(a)};
