text: /*! Source: https://github.com/Turbo87/leaflet-sidebar
  Date: 2015-01-01 */
  L.Control.Sidebar=L.Control.extend({includes:L.Mixin.Events,options:{closeButton:true,position:"left",autoPan:true},initialize:function(e,t){L.setOptions(this,t);var n=this._contentContainer=L.DomUtil.get(e);n.parentNode.removeChild(n);var r="leaflet-";var i=this._container=L.DomUtil.create("div",r+"sidebar "+this.options.position);L.DomUtil.addClass(n,r+"control");i.appendChild(n);if(this.options.closeButton){var s=this._closeButton=L.DomUtil.create("a","close",i);s.innerHTML="&times;"}},addTo:function(e){var t=this._container;var n=this._contentContainer;if(this.options.closeButton){var r=this._closeButton;L.DomEvent.on(r,"click",this.hide,this)}L.DomEvent.on(t,"transitionend",this._handleTransitionEvent,this).on(t,"webkitTransitionEnd",this._handleTransitionEvent,this);var i=e._controlContainer;i.insertBefore(t,i.firstChild);this._map=e;var s=L.DomEvent.stopPropagation;L.DomEvent.on(n,"contextmenu",s).on(n,"click",s).on(n,"mousedown",s).on(n,"touchstart",s).on(n,"dblclick",s).on(n,"mousewheel",s).on(n,"MozMousePixelScroll",s);return this},removeFrom:function(e){this.hide();var t=this._contentContainer;var n=e._controlContainer;n.removeChild(this._container);this._map=null;var r=L.DomEvent.stopPropagation;L.DomEvent.off(t,"contextmenu",r).off(t,"click",r).off(t,"mousedown",r).off(t,"touchstart",r).off(t,"dblclick",r).off(t,"mousewheel",r).off(t,"MozMousePixelScroll",r);L.DomEvent.off(container,"transitionend",this._handleTransitionEvent,this).off(container,"webkitTransitionEnd",this._handleTransitionEvent,this);if(this._closeButton&&this._close){var i=this._closeButton;L.DomEvent.off(i,"click",this.hide,this)}return this},isVisible:function(){return L.DomUtil.hasClass(this._container,"visible")},show:function(){if(!this.isVisible()){L.DomUtil.addClass(this._container,"visible");if(this.options.autoPan){this._map.panBy([-this.getOffset()/2,0],{duration:.5})}this.fire("show")}},hide:function(e){if(this.isVisible()){L.DomUtil.removeClass(this._container,"visible");if(this.options.autoPan){this._map.panBy([this.getOffset()/2,0],{duration:.5})}this.fire("hide")}if(e){L.DomEvent.stopPropagation(e)}},toggle:function(){if(this.isVisible()){this.hide()}else{this.show()}},getContainer:function(){return this._contentContainer},getCloseButton:function(){return this._closeButton},setContent:function(e){this.getContainer().innerHTML=e;return this},getOffset:function(){if(this.options.position==="right"){return-this._container.offsetWidth}else{return this._container.offsetWidth}},_handleTransitionEvent:function(e){if(e.propertyName=="left"||e.propertyName=="right")this.fire(this.isVisible()?"shown":"hidden")}});L.control.sidebar=function(e,t){return new L.Control.Sidebar(e,t)}
  