function pointsEqual(n,t){for(var i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}function closeRing(n){return pointsEqual(n[0],n[n.length-1])||n.push(n[0]),n}function ringIsClockwise(n){var u=0,t=0,f=n.length,r=n[t],i;for(t;t<f-1;t++)i=n[t+1],u+=(i[0]-r[0])*(i[1]+r[1]),r=i;return u>=0}function vertexIntersectsVertex(n,t,i,r){var o=(r[0]-i[0])*(n[1]-i[1])-(r[1]-i[1])*(n[0]-i[0]),s=(t[0]-n[0])*(n[1]-i[1])-(t[1]-n[1])*(n[0]-i[0]),u=(r[1]-i[1])*(t[0]-n[0])-(r[0]-i[0])*(t[1]-n[1]),f,e;return u!==0&&(f=o/u,e=s/u,f>=0&&f<=1&&e>=0&&e<=1)?!0:!1}function arrayIntersectsArray(n,t){for(var r,i=0;i<n.length-1;i++)for(r=0;r<t.length-1;r++)if(vertexIntersectsVertex(n[i],n[i+1],t[r],t[r+1]))return!0;return!1}function coordinatesContainPoint(n,t){for(var u=!1,i=-1,f=n.length,r=f-1;++i<f;r=i)(n[i][1]<=t[1]&&t[1]<n[r][1]||n[r][1]<=t[1]&&t[1]<n[i][1])&&t[0]<(n[r][0]-n[i][0])*(t[1]-n[i][1])/(n[r][1]-n[i][1])+n[i][0]&&(u=!u);return u}function coordinatesContainCoordinates(n,t){var i=arrayIntersectsArray(n,t),r=coordinatesContainPoint(n,t[0]);return!i&&r?!0:!1}function convertRingsToGeoJSON(n){for(var u,l,e,h,c,t=[],o=[],i,f,r,s=0;s<n.length;s++)(u=closeRing(n[s].slice(0)),u.length<4)||(ringIsClockwise(u)?(l=[u],t.push(l)):o.push(u));for(e=[];o.length;){for(r=o.pop(),h=!1,i=t.length-1;i>=0;i--)if(f=t[i][0],coordinatesContainCoordinates(f,r)){t[i].push(r);h=!0;break}h||e.push(r)}while(e.length){for(r=e.pop(),c=!1,i=t.length-1;i>=0;i--)if(f=t[i][0],arrayIntersectsArray(f,r)){t[i].push(r);c=!0;break}c||t.push([r.reverse()])}return t.length===1?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}function orientRings(n){var u=[],f=n.slice(0),i=closeRing(f.shift().slice(0)),r,t;if(i.length>=4)for(ringIsClockwise(i)||i.reverse(),u.push(i),r=0;r<f.length;r++)t=closeRing(f[r].slice(0)),t.length>=4&&(ringIsClockwise(t)&&t.reverse(),u.push(t));return u}function flattenMultiPolygonRings(n){for(var r,t,f,u=[],i=0;i<n.length;i++)for(r=orientRings(n[i]),t=r.length-1;t>=0;t--)f=r[t].slice(0),u.push(f);return u}function shallowClone(n){var i={};for(var t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}function arcgisToGeoJSON(n,t){var i={};return typeof n.x=="number"&&typeof n.y=="number"&&(i.type="Point",i.coordinates=[n.x,n.y]),n.points&&(i.type="MultiPoint",i.coordinates=n.points.slice(0)),n.paths&&(n.paths.length===1?(i.type="LineString",i.coordinates=n.paths[0].slice(0)):(i.type="MultiLineString",i.coordinates=n.paths.slice(0))),n.rings&&(i=convertRingsToGeoJSON(n.rings.slice(0))),(n.geometry||n.attributes)&&(i.type="Feature",i.geometry=n.geometry?arcgisToGeoJSON(n.geometry):null,i.properties=n.attributes?shallowClone(n.attributes):null,n.attributes&&(i.id=n.attributes[t]||n.attributes.OBJECTID||n.attributes.FID)),i}function geojsonToArcGIS(n,t){t=t||"OBJECTID";var u={wkid:4326},i={},r;switch(n.type){case"Point":i.x=n.coordinates[0];i.y=n.coordinates[1];i.spatialReference=u;break;case"MultiPoint":i.points=n.coordinates.slice(0);i.spatialReference=u;break;case"LineString":i.paths=[n.coordinates.slice(0)];i.spatialReference=u;break;case"MultiLineString":i.paths=n.coordinates.slice(0);i.spatialReference=u;break;case"Polygon":i.rings=orientRings(n.coordinates.slice(0));i.spatialReference=u;break;case"MultiPolygon":i.rings=flattenMultiPolygonRings(n.coordinates.slice(0));i.spatialReference=u;break;case"Feature":n.geometry&&(i.geometry=geojsonToArcGIS(n.geometry,t));i.attributes=n.properties?shallowClone(n.properties):{};n.id&&(i.attributes[t]=n.id);break;case"FeatureCollection":for(i=[],r=0;r<n.features.length;r++)i.push(geojsonToArcGIS(n.features[r],t));break;case"GeometryCollection":for(i=[],r=0;r<n.geometries.length;r++)i.push(geojsonToArcGIS(n.geometries[r],t))}return i}function DataLayerClusterer(n){DataLayerClusterer.extend(DataLayerClusterer,google.maps.OverlayView);this.addListener=function(n,t){return this._dataLayer.addListener(n,t)};var t=n||{};this.clusters_=[];this.ready_=!1;this.map=t.map||null;this.gridSize_=t.gridSize||60;this.minClusterSize_=t.minimumClusterSize||2;this.minPolySize_=t.minimumPolySize||50;this.setProperty_=t.setProperty||!1;this.maxZoom_=t.maxZoom||null;this.className_=t.className||"cluster";this.style_=t.style||[];this.name=t.name;this.zoomOnClick_=t.zoomOnClick!==undefined?t.zoomOnClick:!0;this.averageCenter_=t.averageCenter!==undefined?t.averageCenter:!0;this._dataLayer=new google.maps.Data;this.firstIdle_=!0;this.prevBounds_=null;this.init_()}function FeatureCluster(n){this.featureClusterer_=n;this.map_=n.getMap();this.minClusterSize_=n.getMinClusterSize();this.averageCenter_=n.isAverageCenter();this.center_=null;this.features_=[];this.bounds_=null;this.classId=n.className_+"-"+this.featureClusterer_.clusters_.length;this.clusterIcon_=new FeatureClusterIcon(this,n.getStyles(),n.getGridSize(),this.classId,n.name);this.forced_=!1}function FeatureClusterIcon(n,t,i,r,u){DataLayerClusterer.extend(FeatureClusterIcon,google.maps.OverlayView);this.style_=t;this.padding_=i||0;this.cluster_=n;this.center_=null;this.map_=n.getMap();this.div_=null;this.sums_=null;this.visible_=!1;this.classId=r;this.name=u;this.setMap(this.map_)}function ContextMenu(n,t){t=t||{};this.setMap(n);this.map_=n;this.mapDiv_=n.getDiv();this.id=t.id;this.classNames_=t.classNames||{};this.menuItems_=t.menuItems||[];this.pixelOffset=t.pixelOffset||new google.maps.Point(10,-5);this.zIndex=t.zIndex||null}var Mrwa;DataLayerClusterer.CLUSTER_PROPERTY_NAME="in_cluster";DataLayerClusterer.VISIBLE_FEATURE={visible:!0};DataLayerClusterer.HIDDEN_FEATURE={visible:!1};DataLayerClusterer.prototype.setVisible=function(n){n?(this.map__||(this.map__=this.map||this.map_),this.setMap(this.map__),this._dataLayer.setMap(this.map__),this.onAdd(),this.redraw()):(this.map__=this.getMap(),google.maps.event.removeListener(this._idle),google.maps.event.removeListener(this._zoomchanged),this._dataLayer.setMap(null),this.setMap(null),this.resetViewport())};DataLayerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};DataLayerClusterer.prototype.getClusterById=function(n){for(var t=0;t<this.clusters_.length;t++)if(this.clusters_[t].classId===n)return this.clusters_[t];return null};DataLayerClusterer.prototype.getExtendedBounds=function(n){var t=this.getProjection(),e=new google.maps.LatLng(n.getNorthEast().lat(),n.getNorthEast().lng()),o=new google.maps.LatLng(n.getSouthWest().lat(),n.getSouthWest().lng()),r=t.fromLatLngToDivPixel(e),i,u,f;return r.x+=this.gridSize_,r.y-=this.gridSize_,i=t.fromLatLngToDivPixel(o),i.x-=this.gridSize_,i.y+=this.gridSize_,u=t.fromDivPixelToLatLng(r),f=t.fromDivPixelToLatLng(i),n.extend(u),n.extend(f),n};DataLayerClusterer.prototype.redraw=function(){var n=this.clusters_.slice();this.clusters_.length=0;this.createClusters_();window.requestAnimationFrame(function(){for(var i=n.length,t=0;t!==i;++t)n[t].remove()});this.map_&&(this.prevBounds_=this.map_.getBounds())};DataLayerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};DataLayerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};DataLayerClusterer.prototype.setMaxZoom=function(n){this.maxZoom_=n};DataLayerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};DataLayerClusterer.prototype.getGridSize=function(){return this.gridSize_};DataLayerClusterer.prototype.setGridSize=function(n){this.gridSize_=n};DataLayerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};DataLayerClusterer.prototype.setMinClusterSize=function(n){this.minClusterSize_=n};DataLayerClusterer.prototype.add=function(n){return this._dataLayer.add(n)};DataLayerClusterer.prototype.addListener=function(n,t){return this._dataLayer.addListener(n,t)};DataLayerClusterer.prototype.addGeoJson=function(n,t){return this._dataLayer.addGeoJson(n,t)};DataLayerClusterer.prototype.contains=function(n){return this._dataLayer.contains(n)};DataLayerClusterer.prototype.forEach=function(n){return this._dataLayer.forEach(n)};DataLayerClusterer.prototype.getControlPosition=function(){return this._dataLayer.getControlPosition()};DataLayerClusterer.prototype.getControls=function(){return this._dataLayer.getControls()};DataLayerClusterer.prototype.getDrawingMode=function(){return this._dataLayer.getDrawingMode()};DataLayerClusterer.prototype.getFeatureById=function(n){return this._dataLayer.getFeatureById(n)};DataLayerClusterer.prototype.getStyle=function(){return this._dataLayer.getStyle()};DataLayerClusterer.prototype.loadGeoJson=function(n,t,i){return this._dataLayer.loadGeoJson(n,t,i)};DataLayerClusterer.prototype.overrideStyle=function(n,t){return this._dataLayer.overrideStyle(n,t)};DataLayerClusterer.prototype.remove=function(n){return this._dataLayer.remove(n)};DataLayerClusterer.prototype.revertStyle=function(n){return this._dataLayer.revertStyle(n)};DataLayerClusterer.prototype.setControlPosition=function(n){return this._dataLayer.setControlPosition(n)};DataLayerClusterer.prototype.setControls=function(n){return this._dataLayer.setControls(n)};DataLayerClusterer.prototype.setDrawingMode=function(n){return this._dataLayer.setDrawingMode(n)};DataLayerClusterer.prototype.setStyle=function(n){var t=this._dataLayer.setStyle(n);return this.setProperty_&&this.redraw(),t};DataLayerClusterer.prototype.toGeoJson=function(n){return this._dataLayer.toGeoJson(n)};DataLayerClusterer.prototype.resetViewport=function(){for(var t=this.clusters_.length,n=0;n!==t;++n)this.clusters_[n].remove();this.clusters_=[]};DataLayerClusterer.prototype.setReady_=function(n){this.ready_=n;n&&this.createClusters_()};DataLayerClusterer.prototype.isFeatureInBounds_=function(n,t){var r=n.getGeometry(),i=!1,u;return r.getType()=="Point"?i=t.contains(r.get()):(u=this,r.getArray().forEach(function(n){return i=n instanceof google.maps.LatLng?t.contains(n):t.contains(u.featureCenter_(n)),!i})),i};DataLayerClusterer.prototype.distanceBetweenPoints_=function(n,t){if(!n||!t)return 0;var i=(t.lat()-n.lat())*Math.PI/180,r=(t.lng()-n.lng())*Math.PI/180,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2),f=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return 6371*f};DataLayerClusterer.prototype.featureBounds_=function(n,t){var r=n.getGeometry?n.getGeometry():n,i=t||new google.maps.LatLngBounds;return r.getType()=="Point"?i.extend(r.get()):r.getArray().forEach(function(n){n instanceof google.maps.LatLng?i.extend(n):n.getArray().forEach(function(n){i.extend(n)})}),i};DataLayerClusterer.prototype.featureCenter_=function(n){var t=n.getGeometry?n.getGeometry():n;return t.getType()=="Point"?t.get():this.featureBounds_(n).getCenter()};DataLayerClusterer.prototype.addToClosestCluster_=function(n){var e=4e4,c=this.featureCenter_(n),t,o=!0,s,i,h,r,u,f;if(this.setProperty_&&(s=n.getProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME),n.setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,!1),i=this.getStyle(n),typeof i=="function"&&(i=i(n)),o=typeof i.visible=="undefined"||i.visible,n.setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,s)),o){for(h=this.clusters_.length,r=0;r!==h;++r)u=this.clusters_[r].getCenter(),u&&(f=this.distanceBetweenPoints_(u,c),f<e&&(e=f,t=this.clusters_[r]));t&&t.isFeatureInClusterBounds(n)?t.addFeature(n):(t=new FeatureCluster(this),t.addFeature(n),this.clusters_.push(t))}};DataLayerClusterer.prototype.createClusters_=function(){if(this.ready_&&this.map_){var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),i=this.getExtendedBounds(t),n=this;this.forEach(function(t){n.isFeatureInBounds_(t,i)&&n.addToClosestCluster_(t)})}};DataLayerClusterer.prototype.onAdd=function(){var t=this.getMap(),n;this.map_!==t&&this.onRemove();this.map_=t;this.map_!==null?(this._dataLayer.setMap(this.map_),this.prevZoom_=this.map_.getZoom(),n=this,this._zoomchanged=google.maps.event.addListener(this.map_,"zoom_changed",function(){var t=n.map_.getZoom(),i=n.prevBounds_&&n.prevBounds_.equals(n.map_.getBounds());n.prevZoom_!==t&&i!==!0&&(n.prevZoom_=t,n.resetViewport())}),this._idle=google.maps.event.addListener(this.map_,"idle",function(){var t=n.map_&&n.prevZoom_&&n.prevZoom_===n.map_.getZoom()&&n.prevBounds_&&n.prevBounds_.equals(n.map_.getBounds());n.firstIdle_||t===!0||n.redraw();n.firstIdle_=!1}),this.setReady_(!0)):this.setReady_(!1)};DataLayerClusterer.prototype.onRemove=function(){if(this.map_!==null){if(this._zoomchanged!==null)try{this.map_.removeListener(this._zoomchanged)}catch(n){}if(this._idle!==null)try{this.map_.removeListener(this._idle)}catch(n){}}this._dataLayer.setMap(null);this.map_=null;this.setReady_(!1)};DataLayerClusterer.prototype.draw=function(){};DataLayerClusterer.extend=function(n,t){return function(n){for(var t in n.prototype)n.prototype[t]&&(this.prototype[t]=n.prototype[t]);return this}.apply(n,[t])};FeatureCluster.prototype.isFeatureAlreadyAdded=function(n){var i,t;if(this.features_.indexOf)return this.features_.indexOf(n)!==-1;for(i=this.features_.length,t=0;t!==i;++t)if(this.features_[t]===n)return!0;return!1};FeatureCluster.prototype.addFeature=function(n){var c,r,i,t;if(this.isFeatureAlreadyAdded(n))return!1;if(c=n.getGeometry(),r=this.center_||this.featureClusterer_.featureCenter_(n),this.center_){var b=new google.maps.LatLngBounds,u=this.features_.length+1,l=(this.center_.lat()*(u-1)+r.lat())/u,a=(this.center_.lng()*(u-1)+r.lng())/u;this.center_=new google.maps.LatLng(l,a);this.calculateBounds_()}else this.center_=r,this.calculateBounds_();if(n.setProperty("clusterID",this.classId),this.features_.push(n),i=this.features_.length,i==1&&!!this.featureClusterer_.minPolySize_&&n.getGeometry().getType()!="Point"){var f=this.featureClusterer_.minPolySize_,e=this.featureClusterer_.featureBounds_(n),v=e.getSouthWest(),y=e.getNorthEast(),o=this.map_.getProjection(),s=o.fromLatLngToPoint(v),h=o.fromLatLngToPoint(y),p=Math.round(Math.abs((h.x-s.x)*Math.pow(2,this.map_.getZoom()))),w=Math.round(Math.abs((s.y-h.y)*Math.pow(2,this.map_.getZoom())));this.forced_=p<f&&w<f?!0:!1}if(i<this.minClusterSize_&&!this.forced_&&(this.featureClusterer_.setProperty_?n.setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,!1):(n.setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,!1),this.featureClusterer_.overrideStyle(n,DataLayerClusterer.VISIBLE_FEATURE))),i>=this.minClusterSize_||this.forced_)for(t=0;t<i;t++)this.featureClusterer_.setProperty_?this.features_[t].setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,!0):(this.features_[t].setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,!0),this.featureClusterer_.overrideStyle(this.features_[t],DataLayerClusterer.HIDDEN_FEATURE));return this.updateIcon(),!0};FeatureCluster.prototype.getDataLayerClusterer=function(){return this.featureClusterer_};FeatureCluster.prototype.getBounds=function(){for(var n=new google.maps.LatLngBounds(this.center_,this.center_),i=this.features_.length,t=0;t!==i;++t)n=this.featureClusterer_.featureBounds_(this.features_[t],n);return n};FeatureCluster.prototype.remove=function(){this.clusterIcon_.remove();this.features_.length=0;delete this.features_};FeatureCluster.prototype.getSize=function(){return this.features_.length};FeatureCluster.prototype.getFeatures=function(){return this.features_};FeatureCluster.prototype.getCenter=function(){return this.center_};FeatureCluster.prototype.calculateBounds_=function(){var n=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.featureClusterer_.getExtendedBounds(n)};FeatureCluster.prototype.isFeatureInClusterBounds=function(n){return this.bounds_.contains(this.featureClusterer_.featureCenter_(n))};FeatureCluster.prototype.getMap=function(){return this.map_};FeatureCluster.prototype.updateIcon=function(){var f=this.map_.getZoom(),t=this.featureClusterer_.getMaxZoom(),i,n,r,u;if(t&&f>t){for(i=this.features_.length,n=0;n!==i;++n)this.featureClusterer_.setProperty_?this.features_[n].setProperty(DataLayerClusterer.CLUSTER_PROPERTY_NAME,!1):this.featureClusterer_.overrideStyle(this.features_[n],DataLayerClusterer.VISIBLE_FEATURE);return}if(this.features_.length<this.minClusterSize_&&!this.forced_){this.clusterIcon_.hide();return}r=this.featureClusterer_.getStyles().length;u=this.featureClusterer_.getCalculator()(this.features_,r);this.clusterIcon_.setSums(u);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.show()};FeatureClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none");this.visible_=!1};FeatureClusterIcon.prototype.show=function(){if(this.div_){var n=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(n);this.div_.style.display=""}this.visible_=!0};FeatureClusterIcon.prototype.remove=function(){this.setMap(null)};FeatureClusterIcon.prototype.setCenter=function(n){this.center_=n};FeatureClusterIcon.prototype.onAdd=function(){var n,t,i;this.div_=document.createElement("DIV");this.visible_&&(n=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(n),this.div_.className=this.cluster_.featureClusterer_.className_+" "+this.classId+" clustericon",this.div_.title=this.sums_.text+" "+this.name);t=this.getPanes();t.overlayMouseTarget.appendChild(this.div_);i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})};FeatureClusterIcon.prototype.draw=function(){if(this.visible_){var n=this.getPosFromLatLng_(this.center_);this.div_.style.top=n.y+"px";this.div_.style.left=n.x+"px"}};FeatureClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)};FeatureClusterIcon.prototype.triggerClusterClick=function(){var n=this.cluster_.getDataLayerClusterer();google.maps.event.trigger(n,"clusterclick",this.cluster_);n.isZoomOnClick()&&this.map_.fitBounds(this.cluster_.getBounds())};FeatureClusterIcon.prototype.getPosFromLatLng_=function(n){var t=this.getProjection().fromLatLngToDivPixel(n);return t.x-=parseInt(this.width_/2,10),t.y-=parseInt(this.height_/2,10),t};FeatureClusterIcon.prototype.createCss=function(n){var t=[],i,r,u;return t.push("background-image:url("+this.url_+");"),i=this.backgroundPosition_?this.backgroundPosition_:"0 0",t.push("background-position:"+i+";"),t.push("height:"+this.height_+"px; line-height:"+this.anchor_+"px; width:"+this.width_+"px; text-align:center;"),r=this.textColor_?this.textColor_:"black",u=this.textSize_?this.textSize_:11,t.push("cursor:pointer; top:"+n.y+"px; left:"+n.x+"px; color:"+r+"; position:absolute; font-size:"+u+"px; font-family:Arial,sans-serif; font-weight:bold"),t.join("")};FeatureClusterIcon.prototype.useStyle=function(){var n=this.style_;this.url_=n.url;this.height_=n.height;this.width_=n.width;this.textColor_=n.textColor;this.anchor_=n.anchor;this.textSize_=n.textSize;this.backgroundPosition_=n.backgroundPosition};FeatureClusterIcon.prototype.setSums=function(n){this.sums_=n;this.text_=n.text;this.index_=n.index;this.div_&&(this.div_.innerHTML=n.text);this.useStyle()};DataLayerClusterer.prototype.init_=function(){this.setupStyles_();this.map!==null&&this.setMap(this.map)};DataLayerClusterer.prototype.SetMap=function(n){this.map=n;this.setMap(this.map)};DataLayerClusterer.prototype.setupStyles_=function(){this.style_};DataLayerClusterer.prototype.setStyles=function(n){this.style_=n};DataLayerClusterer.prototype.getStyles=function(){return this.style_};DataLayerClusterer.prototype.setCalculator=function(n){this.calculator_=n};DataLayerClusterer.prototype.getCalculator=function(){return this.calculator_};DataLayerClusterer.prototype.calculator_=function(n,t){for(var i=0,u=n.length,r=u;r!==0;)r=parseInt(r/10,10),i++;return i=Math.min(i,t),{text:u,index:i}};window.DataLayerClusterer=DataLayerClusterer;ContextMenu.prototype=new google.maps.OverlayView;ContextMenu.prototype.draw=function(){if(this.isVisible_){var u=new google.maps.Size(this.mapDiv_.offsetWidth,this.mapDiv_.offsetHeight),n=new google.maps.Size(this.menu_.offsetWidth,this.menu_.offsetHeight),t=this.getProjection().fromLatLngToDivPixel(this.position_),i=t.x,r=t.y;t.x>u.width-n.width-this.pixelOffset.x?i=i-n.width-this.pixelOffset.x:i+=this.pixelOffset.x;t.y>u.height-n.height-this.pixelOffset.y?r=r-n.height-this.pixelOffset.y:r+=this.pixelOffset.y;this.menu_.style.left=i+"px";this.menu_.style.top=r+"px"}};ContextMenu.prototype.getVisible=function(){return this.isVisible_};ContextMenu.prototype.hide=function(){this.isVisible_&&(this.menu_.style.display="none",this.isVisible_=!1)};ContextMenu.prototype.onAdd=function(){function f(i){var r=document.createElement("div");return r.innerHTML=i.label,this.id&&(n.id=this.id),i.className&&(r.className=i.className||self.classNames_.menuItem),i.id&&(r.id=i.id),r.style.cssText="cursor:pointer; white-space:nowrap",r.onclick=function(){google.maps.event.trigger(t,"menu_item_selected",t.position_,i.eventName,t.source);t.hide()},r}function e(){var n=document.createElement("div");return t.classNames_.menuSeparator&&(n.className=t.classNames_.menuSeparator),n}var t=this,n=document.createElement("div"),i,r,u;for(this.classNames_.menu&&(n.className=this.classNames_.menu),n.style.cssText="display:none; position:absolute",this.zIndex!=null&&(n.style.zIndex=this.zIndex),i=function(n){var t=n?n:window.event;t.stopPropagation&&t.stopPropagation();t.cancelBubble!=null&&(t.cancelBubble=!0)},n.onclick=i,n.onmouseover=i,n.onmousemove=i,n.onmouseenter=i,n.onmouseleave=i,n.onmouseout=i,r=0,u=this.menuItems_.length;r<u;r++)this.menuItems_[r].label&&this.menuItems_[r].eventName?n.appendChild(f(this.menuItems_[r])):n.appendChild(e());delete this.classNames_;delete this.menuItems_;this.isVisible_=!1;this.menu_=n;this.position_=new google.maps.LatLng(0,0);google.maps.event.addListener(this.map_,"click",function(){t.hide()});this.getPanes().floatPane.appendChild(n)};ContextMenu.prototype.onRemove=function(){this.menu_.parentNode.removeChild(this.menu_);delete this.mapDiv_;delete this.menu_;delete this.position_};ContextMenu.prototype.show=function(n,t){this.source=t;this.isVisible_||(this.menu_.style.display="block",this.isVisible_=!0);this.position_=n;this.draw()};!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.moment=t()}(this,function(){"use strict";function t(){return he.apply(null,arguments)}function g(n){return n instanceof Array||"[object Array]"===Object.prototype.toString.call(n)}function ei(n){return null!=n&&"[object Object]"===Object.prototype.toString.call(n)}function fo(n){for(var t in n)return!1;return!0}function y(n){return void 0===n}function bt(n){return"number"==typeof n||"[object Number]"===Object.prototype.toString.call(n)}function pi(n){return n instanceof Date||"[object Date]"===Object.prototype.toString.call(n)}function wu(n,t){for(var r=[],i=0;i<n.length;++i)r.push(t(n[i],i));return r}function c(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function lt(n,t){for(var i in t)c(t,i)&&(n[i]=t[i]);return c(t,"toString")&&(n.toString=t.toString),c(t,"valueOf")&&(n.valueOf=t.valueOf),n}function it(n,t,i,r){return pf(n,t,i,r,!0).utc()}function eo(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function u(n){return null==n._pf&&(n._pf=eo()),n._pf}function hr(n){if(null==n._isValid){var t=u(n),r=ce.call(t.parsedDateParts,function(n){return null!=n}),i=!isNaN(n._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(n._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(n))return i;n._isValid=i}return n._isValid}function wi(n){var t=it(NaN);return null!=n?lt(u(t),n):u(t).userInvalidated=!0,t}function cr(n,t){var i,r,f;if(y(t._isAMomentObject)||(n._isAMomentObject=t._isAMomentObject),y(t._i)||(n._i=t._i),y(t._f)||(n._f=t._f),y(t._l)||(n._l=t._l),y(t._strict)||(n._strict=t._strict),y(t._tzm)||(n._tzm=t._tzm),y(t._isUTC)||(n._isUTC=t._isUTC),y(t._offset)||(n._offset=t._offset),y(t._pf)||(n._pf=u(t)),y(t._locale)||(n._locale=t._locale),eu.length>0)for(i=0;i<eu.length;i++)r=eu[i],f=t[r],y(f)||(n[r]=f);return n}function oi(n){cr(this,n);this._d=new Date(null!=n._d?n._d.getTime():NaN);this.isValid()||(this._d=new Date(NaN));!1===ou&&(ou=!0,t.updateOffset(this),ou=!1)}function at(n){return n instanceof oi||null!=n&&null!=n._isAMomentObject}function b(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function f(n){var t=+n,i=0;return 0!==t&&isFinite(t)&&(i=b(t)),i}function bu(n,t,i){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),u=0,r=0;r<e;r++)(i&&n[r]!==t[r]||!i&&f(n[r])!==f(t[r]))&&u++;return u+o}function ku(n){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+n)}function k(n,i){var r=!0;return lt(function(){var u,e,f,o;if(null!=t.deprecationHandler&&t.deprecationHandler(null,n),r){for(e=[],f=0;f<arguments.length;f++){if(u="","object"==typeof arguments[f]){u+="\n["+f+"] ";for(o in arguments[0])u+=o+": "+arguments[0][o]+", ";u=u.slice(0,-2)}else u=arguments[f];e.push(u)}ku(n+"\nArguments: "+Array.prototype.slice.call(e).join("")+"\n"+(new Error).stack);r=!1}return i.apply(this,arguments)},i)}function du(n,i){null!=t.deprecationHandler&&t.deprecationHandler(n,i);le[n]||(ku(i),le[n]=!0)}function rt(n){return n instanceof Function||"[object Function]"===Object.prototype.toString.call(n)}function oo(n){var t;for(var i in n)t=n[i],rt(t)?this[i]=t:this["_"+i]=t;this._config=n;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function gu(n,t){var i,r=lt({},n);for(i in t)c(t,i)&&(ei(n[i])&&ei(t[i])?(r[i]={},lt(r[i],n[i]),lt(r[i],t[i])):null!=t[i]?r[i]=t[i]:delete r[i]);for(i in n)c(n,i)&&!c(t,i)&&ei(n[i])&&(r[i]=lt({},r[i]));return r}function lr(n){null!=n&&this.set(n)}function so(n,t,i){var r=this._calendar[n]||this._calendar.sameElse;return rt(r)?r.call(t,i):r}function ho(n){var t=this._longDateFormat[n],i=this._longDateFormat[n.toUpperCase()];return t||!i?t:(this._longDateFormat[n]=i.replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n])}function co(){return this._invalidDate}function lo(n){return this._ordinal.replace("%d",n)}function ao(n,t,i,r){var u=this._relativeTime[i];return rt(u)?u(n,t,i,r):u.replace(/%d/i,n)}function vo(n,t){var i=this._relativeTime[n>0?"future":"past"];return rt(i)?i(t):i.replace(/%s/i,t)}function p(n,t){var i=n.toLowerCase();li[i]=li[i+"s"]=li[t]=n}function d(n){if("string"==typeof n)return li[n]||li[n.toLowerCase()]}function ar(n){var i,t,r={};for(t in n)c(n,t)&&(i=d(t))&&(r[i]=n[t]);return r}function w(n,t){ve[n]=t}function yo(n){var t=[];for(var i in n)t.push({unit:i,priority:ve[i]});return t.sort(function(n,t){return n.priority-t.priority}),t}function ii(n,i){return function(r){return null!=r?(nf(this,n,r),t.updateOffset(this,i),this):bi(this,n)}}function bi(n,t){return n.isValid()?n._d["get"+(n._isUTC?"UTC":"")+t]():NaN}function nf(n,t,i){n.isValid()&&n._d["set"+(n._isUTC?"UTC":"")+t](i)}function po(n){return n=d(n),rt(this[n])?this[n]():this}function wo(n,t){if("object"==typeof n){n=ar(n);for(var r=yo(n),i=0;i<r.length;i++)this[r[i].unit](n[r[i].unit])}else if(n=d(n),rt(this[n]))return this[n](t);return this}function ot(n,t,i){var r=""+Math.abs(n),u=t-r.length;return(n>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,u)).toString().substr(1)+r}function r(n,t,i,r){var u=r;"string"==typeof r&&(u=function(){return this[r]()});n&&(fi[n]=u);t&&(fi[t[0]]=function(){return ot(u.apply(this,arguments),t[1],t[2])});i&&(fi[i]=function(){return this.localeData().ordinal(u.apply(this,arguments),n)})}function bo(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function ko(n){for(var t=n.match(ye),i=0,r=t.length;i<r;i++)t[i]=fi[t[i]]?fi[t[i]]:bo(t[i]);return function(i){for(var f="",u=0;u<r;u++)f+=rt(t[u])?t[u].call(i,n):t[u];return f}}function vr(n,t){return n.isValid()?(t=tf(t,n.localeData()),su[t]=su[t]||ko(t),su[t](n)):n.localeData().invalidDate()}function tf(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(ur.lastIndex=0;i>=0&&ur.test(n);)n=n.replace(ur,r),ur.lastIndex=0,i-=1;return n}function i(n,t,i){hu[n]=rt(t)?t:function(n){return n&&i?i:t}}function go(n,t){return c(hu,n)?hu[n](t._strict,t._locale):new RegExp(ns(n))}function ns(n){return kt(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u}))}function kt(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(n,t){var i,r=t;for("string"==typeof n&&(n=[n]),bt(t)&&(r=function(n,i){i[t]=f(n)}),i=0;i<n.length;i++)cu[n[i]]=r}function si(n,t){s(n,function(n,i,r,u){r._w=r._w||{};t(n,r._w,r,u)})}function ts(n,t,i){null!=t&&c(cu,n)&&cu[n](t,i._a,i,n)}function yr(n,t){return new Date(Date.UTC(n,t+1,0)).getUTCDate()}function is(n,t){return n?g(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||pe).test(t)?"format":"standalone"][n.month()]:g(this._months)?this._months:this._months.standalone}function rs(n,t){return n?g(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[pe.test(t)?"format":"standalone"][n.month()]:g(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function us(n,t,i){var u,r,e,f=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],u=0;u<12;++u)e=it([2e3,u]),this._shortMonthsParse[u]=this.monthsShort(e,"").toLocaleLowerCase(),this._longMonthsParse[u]=this.months(e,"").toLocaleLowerCase();return i?"MMM"===t?(r=a.call(this._shortMonthsParse,f),-1!==r?r:null):(r=a.call(this._longMonthsParse,f),-1!==r?r:null):"MMM"===t?-1!==(r=a.call(this._shortMonthsParse,f))?r:(r=a.call(this._longMonthsParse,f),-1!==r?r:null):-1!==(r=a.call(this._longMonthsParse,f))?r:(r=a.call(this._shortMonthsParse,f),-1!==r?r:null)}function fs(n,t,i){var r,u,f;if(this._monthsParseExact)return us.call(this,n,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if((u=it([2e3,r]),i&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(u,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(u,"").replace(".","")+"$","i")),i||this._monthsParse[r]||(f="^"+this.months(u,"")+"|^"+this.monthsShort(u,""),this._monthsParse[r]=new RegExp(f.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[r].test(n))||i&&"MMM"===t&&this._shortMonthsParse[r].test(n)||!i&&this._monthsParse[r].test(n))return r}function rf(n,t){var i;if(!n.isValid())return n;if("string"==typeof t)if(/^\d+$/.test(t))t=f(t);else if(t=n.localeData().monthsParse(t),!bt(t))return n;return i=Math.min(n.date(),yr(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n}function uf(n){return null!=n?(rf(this,n),t.updateOffset(this,!0),this):bi(this,"Month")}function es(){return yr(this.year(),this.month())}function os(n){return this._monthsParseExact?(c(this,"_monthsRegex")||ff.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=gv),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function ss(n){return this._monthsParseExact?(c(this,"_monthsRegex")||ff.call(this),n?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=ny),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function ff(){function f(n,t){return t.length-n.length}for(var i,r=[],u=[],t=[],n=0;n<12;n++)i=it([2e3,n]),r.push(this.monthsShort(i,"")),u.push(this.months(i,"")),t.push(this.months(i,"")),t.push(this.monthsShort(i,""));for(r.sort(f),u.sort(f),t.sort(f),n=0;n<12;n++)r[n]=kt(r[n]),u[n]=kt(u[n]);for(n=0;n<24;n++)t[n]=kt(t[n]);this._monthsRegex=new RegExp("^("+t.join("|")+")","i");this._monthsShortRegex=this._monthsRegex;this._monthsStrictRegex=new RegExp("^("+u.join("|")+")","i");this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function hi(n){return ef(n)?366:365}function ef(n){return n%4==0&&n%100!=0||n%400==0}function hs(){return ef(this.year())}function cs(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return n<100&&n>=0&&isFinite(o.getFullYear())&&o.setFullYear(n),o}function ki(n){var t=new Date(Date.UTC.apply(null,arguments));return n<100&&n>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(n),t}function di(n,t,i){var r=7+t-i;return-(7+ki(n,0,r).getUTCDay()-t)%7+r-1}function of(n,t,i,r,u){var f,o,s=(7+i-r)%7,h=di(n,r,u),e=1+7*(t-1)+s+h;return e<=0?(f=n-1,o=hi(f)+e):e>hi(n)?(f=n+1,o=e-hi(n)):(f=n,o=e),{year:f,dayOfYear:o}}function ci(n,t,i){var f,r,e=di(n.year(),t,i),u=Math.floor((n.dayOfYear()-e-1)/7)+1;return u<1?(r=n.year()-1,f=u+dt(r,t,i)):u>dt(n.year(),t,i)?(f=u-dt(n.year(),t,i),r=n.year()+1):(r=n.year(),f=u),{week:f,year:r}}function dt(n,t,i){var r=di(n,t,i),u=di(n+1,t,i);return(hi(n)-r+u)/7}function ls(n){return ci(n,this._week.dow,this._week.doy).week}function as(){return this._week.dow}function vs(){return this._week.doy}function ys(n){var t=this.localeData().week(this);return null==n?t:this.add(7*(n-t),"d")}function ps(n){var t=ci(this,1,4).week;return null==n?t:this.add(7*(n-t),"d")}function ws(n,t){return"string"!=typeof n?n:isNaN(n)?(n=t.weekdaysParse(n),"number"==typeof n?n:null):parseInt(n,10)}function bs(n,t){return"string"==typeof n?t.weekdaysParse(n)%7||7:isNaN(n)?null:n}function ks(n,t){return n?g(this._weekdays)?this._weekdays[n.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][n.day()]:g(this._weekdays)?this._weekdays:this._weekdays.standalone}function ds(n){return n?this._weekdaysShort[n.day()]:this._weekdaysShort}function gs(n){return n?this._weekdaysMin[n.day()]:this._weekdaysMin}function nh(n,t,i){var f,r,e,u=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)e=it([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(e,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(e,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(e,"").toLocaleLowerCase();return i?"dddd"===t?(r=a.call(this._weekdaysParse,u),-1!==r?r:null):"ddd"===t?(r=a.call(this._shortWeekdaysParse,u),-1!==r?r:null):(r=a.call(this._minWeekdaysParse,u),-1!==r?r:null):"dddd"===t?-1!==(r=a.call(this._weekdaysParse,u))?r:-1!==(r=a.call(this._shortWeekdaysParse,u))?r:(r=a.call(this._minWeekdaysParse,u),-1!==r?r:null):"ddd"===t?-1!==(r=a.call(this._shortWeekdaysParse,u))?r:-1!==(r=a.call(this._weekdaysParse,u))?r:(r=a.call(this._minWeekdaysParse,u),-1!==r?r:null):-1!==(r=a.call(this._minWeekdaysParse,u))?r:-1!==(r=a.call(this._weekdaysParse,u))?r:(r=a.call(this._shortWeekdaysParse,u),-1!==r?r:null)}function th(n,t,i){var r,u,f;if(this._weekdaysParseExact)return nh.call(this,n,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if((u=it([2e3,1]).day(r),i&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(u,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(u,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(u,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(f="^"+this.weekdays(u,"")+"|^"+this.weekdaysShort(u,"")+"|^"+this.weekdaysMin(u,""),this._weekdaysParse[r]=new RegExp(f.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[r].test(n))||i&&"ddd"===t&&this._shortWeekdaysParse[r].test(n)||i&&"dd"===t&&this._minWeekdaysParse[r].test(n)||!i&&this._weekdaysParse[r].test(n))return r}function ih(n){if(!this.isValid())return null!=n?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=n?(n=ws(n,this.localeData()),this.add(n-t,"d")):t}function rh(n){if(!this.isValid())return null!=n?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==n?t:this.add(n-t,"d")}function uh(n){if(!this.isValid())return null!=n?this:NaN;if(null!=n){var t=bs(n,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function fh(n){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||pr.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=uy),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function eh(n){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||pr.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fy),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function oh(n){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||pr.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ey),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function pr(){function u(n,t){return t.length-n.length}for(var f,e,o,s,h=[],i=[],r=[],t=[],n=0;n<7;n++)f=it([2e3,1]).day(n),e=this.weekdaysMin(f,""),o=this.weekdaysShort(f,""),s=this.weekdays(f,""),h.push(e),i.push(o),r.push(s),t.push(e),t.push(o),t.push(s);for(h.sort(u),i.sort(u),r.sort(u),t.sort(u),n=0;n<7;n++)i[n]=kt(i[n]),r[n]=kt(r[n]),t[n]=kt(t[n]);this._weekdaysRegex=new RegExp("^("+t.join("|")+")","i");this._weekdaysShortRegex=this._weekdaysRegex;this._weekdaysMinRegex=this._weekdaysRegex;this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i");this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i");this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function wr(){return this.hours()%12||12}function sh(){return this.hours()||24}function sf(n,t){r(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function hf(n,t){return t._meridiemParse}function hh(n){return"p"===(n+"").toLowerCase().charAt(0)}function ch(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"}function cf(n){return n?n.toLowerCase().replace("_","-"):n}function lh(n){for(var i,t,f,r,u=0;u<n.length;){for(r=cf(n[u]).split("-"),i=r.length,t=cf(n[u+1]),t=t?t.split("-"):null;i>0;){if(f=lf(r.slice(0,i).join("-")))return f;if(t&&t.length>=i&&bu(r,t,!0)>=i-1)break;i--}u++}return null}function lf(n){var t=null;if(!l[n]&&"undefined"!=typeof module&&module&&module.exports)try{t=or._abbr;require("./locale/"+n);ri(t)}catch(n){}return l[n]}function ri(n,t){var i;return n&&(i=y(t)?vt(n):br(n,t))&&(or=i),or._abbr}function br(n,t){if(null!==t){var i=be;if(t.abbr=n,null!=l[n])du("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=l[n]._config;else if(null!=t.parentLocale){if(null==l[t.parentLocale])return vi[t.parentLocale]||(vi[t.parentLocale]=[]),vi[t.parentLocale].push({name:n,config:t}),null;i=l[t.parentLocale]._config}return l[n]=new lr(gu(i,t)),vi[n]&&vi[n].forEach(function(n){br(n.name,n.config)}),ri(n),l[n]}return delete l[n],null}function ah(n,t){if(null!=t){var i,r=be;null!=l[n]&&(r=l[n]._config);t=gu(r,t);i=new lr(t);i.parentLocale=l[n];l[n]=i;ri(n)}else null!=l[n]&&(null!=l[n].parentLocale?l[n]=l[n].parentLocale:null!=l[n]&&delete l[n]);return l[n]}function vt(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return or;if(!g(n)){if(t=lf(n))return t;n=[n]}return lh(n)}function vh(){return ae(l)}function kr(n){var i,t=n._a;return t&&-2===u(n).overflow&&(i=t[st]<0||t[st]>11?st:t[ft]<1||t[ft]>yr(t[nt],t[st])?ft:t[v]<0||t[v]>24||24===t[v]&&(0!==t[tt]||0!==t[ht]||0!==t[ti])?v:t[tt]<0||t[tt]>59?tt:t[ht]<0||t[ht]>59?ht:t[ti]<0||t[ti]>999?ti:-1,u(n)._overflowDayOfYear&&(i<nt||i>ft)&&(i=ft),u(n)._overflowWeeks&&-1===i&&(i=wv),u(n)._overflowWeekday&&-1===i&&(i=bv),u(n).overflow=i),n}function af(n){var t,r,o,e,f,s,h=n._i,i=sy.exec(h)||hy.exec(h);if(i){for(u(n).iso=!0,t=0,r=sr.length;t<r;t++)if(sr[t][1].exec(i[1])){e=sr[t][0];o=!1!==sr[t][2];break}if(null==e)return void(n._isValid=!1);if(i[3]){for(t=0,r=au.length;t<r;t++)if(au[t][1].exec(i[3])){f=(i[2]||" ")+au[t][0];break}if(null==f)return void(n._isValid=!1)}if(!o&&null!=f)return void(n._isValid=!1);if(i[4]){if(!cy.exec(i[4]))return void(n._isValid=!1);s="Z"}n._f=e+(f||"")+(s||"");gi(n)}else n._isValid=!1}function vf(n){var f,t,e,o,s,h,i,r,c={" GMT":" +0000"," EDT":" -0400"," EST":" -0500"," CDT":" -0500"," CST":" -0600"," MDT":" -0600"," MST":" -0700"," PDT":" -0700"," PST":" -0800"},l,a;if(f=n._i.replace(/\([^\)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s|\s$/g,""),t=ay.exec(f)){if((e=t[1]?"ddd"+(5===t[1].length?", ":" "):"",o="D MMM "+(t[2].length>10?"YYYY ":"YY "),s="HH:mm"+(t[4]?":ss":""),t[1])&&(l=new Date(t[2]),a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][l.getDay()],t[1].substr(0,3)!==a))return u(n).weekdayMismatch=!0,void(n._isValid=!1);switch(t[5].length){case 2:0===r?i=" +0000":(r="YXWVUTSRQPONZABCDEFGHIKLM".indexOf(t[5][1].toUpperCase())-12,i=(r<0?" -":" +")+(""+r).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:i=c[t[5]];break;default:i=c[" GMT"]}t[5]=i;n._i=t.splice(1).join("");h=" ZZ";n._f=e+o+s+h;gi(n);u(n).rfc2822=!0}else n._isValid=!1}function yh(n){var i=ly.exec(n._i);if(null!==i)return void(n._d=new Date(+i[1]));af(n);!1===n._isValid&&(delete n._isValid,vf(n),!1===n._isValid&&(delete n._isValid,t.createFromInputFallback(n)))}function ui(n,t,i){return null!=n?n:null!=t?t:i}function ph(n){var i=new Date(t.now());return n._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function dr(n){var t,i,r,f,e=[];if(!n._d){for(r=ph(n),n._w&&null==n._a[ft]&&null==n._a[st]&&wh(n),null!=n._dayOfYear&&(f=ui(n._a[nt],r[nt]),(n._dayOfYear>hi(f)||0===n._dayOfYear)&&(u(n)._overflowDayOfYear=!0),i=ki(f,0,n._dayOfYear),n._a[st]=i.getUTCMonth(),n._a[ft]=i.getUTCDate()),t=0;t<3&&null==n._a[t];++t)n._a[t]=e[t]=r[t];for(;t<7;t++)n._a[t]=e[t]=null==n._a[t]?2===t?1:0:n._a[t];24===n._a[v]&&0===n._a[tt]&&0===n._a[ht]&&0===n._a[ti]&&(n._nextDay=!0,n._a[v]=0);n._d=(n._useUTC?ki:cs).apply(null,e);null!=n._tzm&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm);n._nextDay&&(n._a[v]=24)}}function wh(n){var t,o,f,i,r,e,c,s,l;(t=n._w,null!=t.GG||null!=t.W||null!=t.E)?(r=1,e=4,o=ui(t.GG,n._a[nt],ci(h(),1,4).year),f=ui(t.W,1),((i=ui(t.E,1))<1||i>7)&&(s=!0)):(r=n._locale._week.dow,e=n._locale._week.doy,l=ci(h(),r,e),o=ui(t.gg,n._a[nt],l.year),f=ui(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(s=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(s=!0)):i=r);f<1||f>dt(o,r,e)?u(n)._overflowWeeks=!0:null!=s?u(n)._overflowWeekday=!0:(c=of(o,f,i,r,e),n._a[nt]=c.year,n._dayOfYear=c.dayOfYear)}function gi(n){if(n._f===t.ISO_8601)return void af(n);if(n._f===t.RFC_2822)return void vf(n);n._a=[];u(n).empty=!0;for(var i,f,s,r=""+n._i,c=r.length,h=0,o=tf(n._f,n._locale).match(ye)||[],e=0;e<o.length;e++)f=o[e],i=(r.match(go(f,n))||[])[0],i&&(s=r.substr(0,r.indexOf(i)),s.length>0&&u(n).unusedInput.push(s),r=r.slice(r.indexOf(i)+i.length),h+=i.length),fi[f]?(i?u(n).empty=!1:u(n).unusedTokens.push(f),ts(f,i,n)):n._strict&&!i&&u(n).unusedTokens.push(f);u(n).charsLeftOver=c-h;r.length>0&&u(n).unusedInput.push(r);n._a[v]<=12&&!0===u(n).bigHour&&n._a[v]>0&&(u(n).bigHour=void 0);u(n).parsedDateParts=n._a.slice(0);u(n).meridiem=n._meridiem;n._a[v]=bh(n._locale,n._a[v],n._meridiem);dr(n);kr(n)}function bh(n,t,i){var r;return null==i?t:null!=n.meridiemHour?n.meridiemHour(t,i):null!=n.isPM?(r=n.isPM(i),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function kh(n){var t,e,f,r,i;if(0===n._f.length)return u(n).invalidFormat=!0,void(n._d=new Date(NaN));for(r=0;r<n._f.length;r++)i=0,t=cr({},n),null!=n._useUTC&&(t._useUTC=n._useUTC),t._f=n._f[r],gi(t),hr(t)&&(i+=u(t).charsLeftOver,i+=10*u(t).unusedTokens.length,u(t).score=i,(null==f||i<f)&&(f=i,e=t));lt(n,e||t)}function dh(n){if(!n._d){var t=ar(n._i);n._a=wu([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)});dr(n)}}function gh(n){var t=new oi(kr(yf(n)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function yf(n){var t=n._i,i=n._f;return n._locale=n._locale||vt(n._l),null===t||void 0===i&&""===t?wi({nullInput:!0}):("string"==typeof t&&(n._i=t=n._locale.preparse(t)),at(t)?new oi(kr(t)):(pi(t)?n._d=t:g(i)?kh(n):i?gi(n):nc(n),hr(n)||(n._d=null),n))}function nc(n){var i=n._i;y(i)?n._d=new Date(t.now()):pi(i)?n._d=new Date(i.valueOf()):"string"==typeof i?yh(n):g(i)?(n._a=wu(i.slice(0),function(n){return parseInt(n,10)}),dr(n)):ei(i)?dh(n):bt(i)?n._d=new Date(i):t.createFromInputFallback(n)}function pf(n,t,i,r,u){var f={};return!0!==i&&!1!==i||(r=i,i=void 0),(ei(n)&&fo(n)||g(n)&&0===n.length)&&(n=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=u,f._l=i,f._i=n,f._f=t,f._strict=r,gh(f)}function h(n,t,i,r){return pf(n,t,i,r,!1)}function wf(n,t){var r,i;if(1===t.length&&g(t[0])&&(t=t[0]),!t.length)return h();for(r=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][n](r)||(r=t[i]);return r}function tc(){return wf("isBefore",[].slice.call(arguments,0))}function ic(){return wf("isAfter",[].slice.call(arguments,0))}function rc(n){var i,r,t;for(i in n)if(-1===yi.indexOf(i)||null!=n[i]&&isNaN(n[i]))return!1;for(r=!1,t=0;t<yi.length;++t)if(n[yi[t]]){if(r)return!1;parseFloat(n[yi[t]])!==f(n[yi[t]])&&(r=!0)}return!0}function uc(){return this._isValid}function fc(){return ut(NaN)}function nr(n){var t=ar(n),i=t.year||0,r=t.quarter||0,u=t.month||0,f=t.week||0,e=t.day||0,o=t.hour||0,s=t.minute||0,h=t.second||0,c=t.millisecond||0;this._isValid=rc(t);this._milliseconds=+c+1e3*h+6e4*s+36e5*o;this._days=+e+7*f;this._months=+u+3*r+12*i;this._data={};this._locale=vt();this._bubble()}function gr(n){return n instanceof nr}function nu(n){return n<0?-1*Math.round(-1*n):Math.round(n)}function bf(n,t){r(n,0,0,function(){var n=this.utcOffset(),i="+";return n<0&&(n=-n,i="-"),i+ot(~~(n/60),2)+t+ot(~~n%60,2)})}function tu(n,t){var i=(t||"").match(n);if(null===i)return null;var e=i[i.length-1]||[],r=(e+"").match(ke)||["-",0,0],u=60*r[1]+f(r[2]);return 0===u?0:"+"===r[0]?u:-u}function iu(n,i){var r,u;return i._isUTC?(r=i.clone(),u=(at(n)||pi(n)?n.valueOf():h(n).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+u),t.updateOffset(r,!1),r):h(n).local()}function ru(n){return 15*-Math.round(n._d.getTimezoneOffset()/15)}function ec(n,i,r){var u,f=this._offset||0;if(!this.isValid())return null!=n?this:NaN;if(null!=n){if("string"==typeof n){if(null===(n=tu(er,n)))return this}else Math.abs(n)<16&&!r&&(n*=60);return!this._isUTC&&i&&(u=ru(this)),this._offset=n,this._isUTC=!0,null!=u&&this.add(u,"m"),f!==n&&(!i||this._changeInProgress?ne(this,ut(n-f,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?f:ru(this)}function oc(n,t){return null!=n?("string"!=typeof n&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}function sc(n){return this.utcOffset(0,n)}function hc(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(ru(this),"m")),this}function cc(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var n=tu(pv,this._i);null!=n?this.utcOffset(n):this.utcOffset(0,!0)}return this}function lc(n){return!!this.isValid()&&(n=n?h(n).utcOffset():0,(this.utcOffset()-n)%60==0)}function ac(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function vc(){var n,t;return y(this._isDSTShifted)?(n={},(cr(n,this),n=yf(n),n._a)?(t=n._isUTC?it(n._a):h(n._a),this._isDSTShifted=this.isValid()&&bu(n._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted):this._isDSTShifted}function yc(){return!!this.isValid()&&!this._isUTC}function pc(){return!!this.isValid()&&this._isUTC}function kf(){return!!this.isValid()&&this._isUTC&&0===this._offset}function ut(n,t){var u,e,o,i=n,r=null;return gr(n)?i={ms:n._milliseconds,d:n._days,M:n._months}:bt(n)?(i={},t?i[t]=n:i.milliseconds=n):(r=de.exec(n))?(u="-"===r[1]?-1:1,i={y:0,d:f(r[ft])*u,h:f(r[v])*u,m:f(r[tt])*u,s:f(r[ht])*u,ms:f(nu(1e3*r[ti]))*u}):(r=ge.exec(n))?(u="-"===r[1]?-1:1,i={y:gt(r[2],u),M:gt(r[3],u),w:gt(r[4],u),d:gt(r[5],u),h:gt(r[6],u),m:gt(r[7],u),s:gt(r[8],u)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=wc(h(i.from),h(i.to)),i={},i.ms=o.milliseconds,i.M=o.months),e=new nr(i),gr(n)&&c(n,"_locale")&&(e._locale=n._locale),e}function gt(n,t){var i=n&&parseFloat(n.replace(",","."));return(isNaN(i)?0:i)*t}function df(n,t){var i={milliseconds:0,months:0};return i.months=t.month()-n.month()+12*(t.year()-n.year()),n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function wc(n,t){var i;return n.isValid()&&t.isValid()?(t=iu(t,n),n.isBefore(t)?i=df(n,t):(i=df(t,n),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function gf(n,t){return function(i,r){var u,f;return null===r||isNaN(+r)||(du(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=i,i=r,r=f),i="string"==typeof i?+i:i,u=ut(i,r),ne(this,u,n),this}}function ne(n,i,r,u){var o=i._milliseconds,f=nu(i._days),e=nu(i._months);n.isValid()&&(u=null==u||u,o&&n._d.setTime(n._d.valueOf()+o*r),f&&nf(n,"Date",bi(n,"Date")+f*r),e&&rf(n,bi(n,"Month")+e*r),u&&t.updateOffset(n,f||e))}function bc(n,t){var i=n.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function kc(n,i){var u=n||h(),f=iu(u,this).startOf("day"),r=t.calendarFormat(this,f)||"sameElse",e=i&&(rt(i[r])?i[r].call(this,u):i[r]);return this.format(e||this.localeData().calendar(r,this,h(u)))}function dc(){return new oi(this)}function gc(n,t){var i=at(n)?n:h(n);return!(!this.isValid()||!i.isValid())&&(t=d(y(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf())}function nl(n,t){var i=at(n)?n:h(n);return!(!this.isValid()||!i.isValid())&&(t=d(y(t)?"millisecond":t),"millisecond"===t?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf())}function tl(n,t,i,r){return r=r||"()",("("===r[0]?this.isAfter(n,i):!this.isBefore(n,i))&&(")"===r[1]?this.isBefore(t,i):!this.isAfter(t,i))}function il(n,t){var i,r=at(n)?n:h(n);return!(!this.isValid()||!r.isValid())&&(t=d(t||"millisecond"),"millisecond"===t?this.valueOf()===r.valueOf():(i=r.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf()))}function rl(n,t){return this.isSame(n,t)||this.isAfter(n,t)}function ul(n,t){return this.isSame(n,t)||this.isBefore(n,t)}function fl(n,t,i){var f,e,r,u;return this.isValid()?(f=iu(n,this),f.isValid()?(e=6e4*(f.utcOffset()-this.utcOffset()),t=d(t),"year"===t||"month"===t||"quarter"===t?(u=el(this,f),"quarter"===t?u/=3:"year"===t&&(u/=12)):(r=this-f,u="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-e)/864e5:"week"===t?(r-e)/6048e5:r),i?u:b(u)):NaN):NaN}function el(n,t){var r,f,u=12*(t.year()-n.year())+(t.month()-n.month()),i=n.clone().add(u,"months");return t-i<0?(r=n.clone().add(u-1,"months"),f=(t-i)/(i-r)):(r=n.clone().add(u+1,"months"),f=(t-i)/(r-i)),-(u+f)||0}function ol(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function sl(){if(!this.isValid())return null;var n=this.clone().utc();return n.year()<0||n.year()>9999?vr(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):rt(Date.prototype.toISOString)?this.toDate().toISOString():vr(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function hl(){var n,t;if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";n="moment";t="";this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var i="["+n+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",u=t+'[")]';return this.format(i+r+"-MM-DD[T]HH:mm:ss.SSS"+u)}function cl(n){n||(n=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=vr(this,n);return this.localeData().postformat(i)}function ll(n,t){return this.isValid()&&(at(n)&&n.isValid()||h(n).isValid())?ut({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function al(n){return this.from(h(),n)}function vl(n,t){return this.isValid()&&(at(n)&&n.isValid()||h(n).isValid())?ut({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function yl(n){return this.to(h(),n)}function te(n){var t;return void 0===n?this._locale._abbr:(t=vt(n),null!=t&&(this._locale=t),this)}function ie(){return this._locale}function pl(n){switch(n=d(n)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===n&&this.weekday(0),"isoWeek"===n&&this.isoWeekday(1),"quarter"===n&&this.month(3*Math.floor(this.month()/3)),this}function wl(n){return void 0===(n=d(n))||"millisecond"===n?this:("date"===n&&(n="day"),this.startOf(n).add(1,"isoWeek"===n?"week":n).subtract(1,"ms"))}function bl(){return this._d.valueOf()-6e4*(this._offset||0)}function kl(){return Math.floor(this.valueOf()/1e3)}function dl(){return new Date(this.valueOf())}function gl(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function na(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function ta(){return this.isValid()?this.toISOString():null}function ia(){return hr(this)}function ra(){return lt({},u(this))}function ua(){return u(this).overflow}function fa(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function tr(n,t){r(0,[n,n.length],0,t)}function ea(n){return re.call(this,n,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function oa(n){return re.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function sa(){return dt(this.year(),1,4)}function ha(){var n=this.localeData()._week;return dt(this.year(),n.dow,n.doy)}function re(n,t,i,r,u){var f;return null==n?ci(this,r,u).year:(f=dt(n,r,u),t>f&&(t=f),ca.call(this,n,t,i,r,u))}function ca(n,t,i,r,u){var e=of(n,t,i,r,u),f=ki(e.year,0,e.dayOfYear);return this.year(f.getUTCFullYear()),this.month(f.getUTCMonth()),this.date(f.getUTCDate()),this}function la(n){return null==n?Math.ceil((this.month()+1)/3):this.month(3*(n-1)+this.month()%3)}function aa(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==n?t:this.add(n-t,"d")}function va(n,t){t[ti]=f(1e3*("0."+n))}function ya(){return this._isUTC?"UTC":""}function pa(){return this._isUTC?"Coordinated Universal Time":""}function wa(n){return h(1e3*n)}function ba(){return h.apply(null,arguments).parseZone()}function ue(n){return n}function ir(n,t,i,r){var u=vt(),f=it().set(r,t);return u[i](f,n)}function fe(n,t,i){if(bt(n)&&(t=n,n=void 0),n=n||"",null!=t)return ir(n,t,i,"month");for(var u=[],r=0;r<12;r++)u[r]=ir(n,r,i,"month");return u}function uu(n,t,i,r){var o,f,u,e;if("boolean"==typeof n?(bt(t)&&(i=t,t=void 0),t=t||""):(t=n,i=t,n=!1,bt(t)&&(i=t,t=void 0),t=t||""),o=vt(),f=n?o._week.dow:0,null!=i)return ir(t,(i+f)%7,r,"day");for(e=[],u=0;u<7;u++)e[u]=ir(t,(u+f)%7,r,"day");return e}function ka(n,t){return fe(n,t,"months")}function da(n,t){return fe(n,t,"monthsShort")}function ga(n,t,i){return uu(n,t,i,"weekdays")}function nv(n,t,i){return uu(n,t,i,"weekdaysShort")}function tv(n,t,i){return uu(n,t,i,"weekdaysMin")}function iv(){var n=this._data;return this._milliseconds=ct(this._milliseconds),this._days=ct(this._days),this._months=ct(this._months),n.milliseconds=ct(n.milliseconds),n.seconds=ct(n.seconds),n.minutes=ct(n.minutes),n.hours=ct(n.hours),n.months=ct(n.months),n.years=ct(n.years),this}function ee(n,t,i,r){var u=ut(t,i);return n._milliseconds+=r*u._milliseconds,n._days+=r*u._days,n._months+=r*u._months,n._bubble()}function rv(n,t){return ee(this,n,t,1)}function uv(n,t){return ee(this,n,t,-1)}function oe(n){return n<0?Math.floor(n):Math.ceil(n)}function fv(){var u,f,e,s,o,r=this._milliseconds,n=this._days,t=this._months,i=this._data;return r>=0&&n>=0&&t>=0||r<=0&&n<=0&&t<=0||(r+=864e5*oe(fu(t)+n),n=0,t=0),i.milliseconds=r%1e3,u=b(r/1e3),i.seconds=u%60,f=b(u/60),i.minutes=f%60,e=b(f/60),i.hours=e%24,n+=b(e/24),o=b(se(n)),t+=o,n-=oe(fu(o)),s=b(t/12),t%=12,i.days=n,i.months=t,i.years=s,this}function se(n){return 4800*n/146097}function fu(n){return 146097*n/4800}function ev(n){if(!this.isValid())return NaN;var t,r,i=this._milliseconds;if("month"===(n=d(n))||"year"===n)return t=this._days+i/864e5,r=this._months+se(t),"month"===n?r:r/12;switch(t=this._days+Math.round(fu(this._months)),n){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+n);}}function ov(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*f(this._months/12):NaN}function yt(n){return function(){return this.as(n)}}function sv(n){return n=d(n),this.isValid()?this[n+"s"]():NaN}function ni(n){return function(){return this.isValid()?this._data[n]:NaN}}function hv(){return b(this.days()/7)}function cv(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function lv(n,t,i){var r=ut(n).abs(),u=wt(r.as("s")),e=wt(r.as("m")),o=wt(r.as("h")),s=wt(r.as("d")),h=wt(r.as("M")),c=wt(r.as("y")),f=u<=et.ss&&["s",u]||u<et.s&&["ss",u]||e<=1&&["m"]||e<et.m&&["mm",e]||o<=1&&["h"]||o<et.h&&["hh",o]||s<=1&&["d"]||s<et.d&&["dd",s]||h<=1&&["M"]||h<et.M&&["MM",h]||c<=1&&["y"]||["yy",c];return f[2]=t,f[3]=+n>0,f[4]=i,cv.apply(null,f)}function av(n){return void 0===n?wt:"function"==typeof n&&(wt=n,!0)}function vv(n,t){return void 0!==et[n]&&(void 0===t?et[n]:(et[n]=t,"s"===n&&(et.ss=t-1),!0))}function yv(n){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),i=lv(this,!n,t);return n&&(i=t.pastFuture(+this,i)),t.postformat(i)}function rr(){if(!this.isValid())return this.localeData().invalidDate();var n,e,o,t=pu(this._milliseconds)/1e3,a=pu(this._days),i=pu(this._months);n=b(t/60);e=b(n/60);t%=60;n%=60;o=b(i/12);i%=12;var s=o,h=i,c=a,r=e,u=n,f=t,l=this.asSeconds();return l?(l<0?"-":"")+"P"+(s?s+"Y":"")+(h?h+"M":"")+(c?c+"D":"")+(r||u||f?"T":"")+(r?r+"H":"")+(u?u+"M":"")+(f?f+"S":""):"P0D"}var he,ce,ae,lu,we,ke,de,ge,no,to,vu,yu,io,ro,pt,uo,n,o;ce=Array.prototype.some?Array.prototype.some:function(n){for(var i=Object(this),r=i.length>>>0,t=0;t<r;t++)if(t in i&&n.call(this,i[t],t,i))return!0;return!1};var eu=t.momentProperties=[],ou=!1,le={};t.suppressDeprecationWarnings=!1;t.deprecationHandler=null;ae=Object.keys?Object.keys:function(n){var t,i=[];for(t in n)c(n,t)&&i.push(t);return i};var a,li={},ve={},ye=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ur=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,su={},fi={},fr=/[+-]?\d{6}/,pv=/Z|[+-]\d\d:?\d\d/gi,er=/Z|[+-]\d\d(?::?\d\d)?/gi,ai=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,hu={},cu={},nt=0,st=1,ft=2,v=3,tt=4,ht=5,ti=6,wv=7,bv=8;a=Array.prototype.indexOf?Array.prototype.indexOf:function(n){for(var t=0;t<this.length;++t)if(this[t]===n)return t;return-1};r("M",["MM",2],"Mo",function(){return this.month()+1});r("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)});r("MMMM",0,0,function(n){return this.localeData().months(this,n)});p("month","M");w("month",8);i("M",/\d\d?/);i("MM",/\d\d?/,/\d\d/);i("MMM",function(n,t){return t.monthsShortRegex(n)});i("MMMM",function(n,t){return t.monthsRegex(n)});s(["M","MM"],function(n,t){t[st]=f(n)-1});s(["MMM","MMMM"],function(n,t,i,r){var f=i._locale.monthsParse(n,r,i._strict);null!=f?t[st]=f:u(i).invalidMonth=n});var pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,kv="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),dv="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),gv=ai,ny=ai;r("Y",0,0,function(){var n=this.year();return n<=9999?""+n:"+"+n});r(0,["YY",2],0,function(){return this.year()%100});r(0,["YYYY",4],0,"year");r(0,["YYYYY",5],0,"year");r(0,["YYYYYY",6,!0],0,"year");p("year","y");w("year",1);i("Y",/[+-]?\d+/);i("YY",/\d\d?/,/\d\d/);i("YYYY",/\d{1,4}/,/\d{4}/);i("YYYYY",/[+-]?\d{1,6}/,fr);i("YYYYYY",/[+-]?\d{1,6}/,fr);s(["YYYYY","YYYYYY"],nt);s("YYYY",function(n,i){i[nt]=2===n.length?t.parseTwoDigitYear(n):f(n)});s("YY",function(n,i){i[nt]=t.parseTwoDigitYear(n)});s("Y",function(n,t){t[nt]=parseInt(n,10)});t.parseTwoDigitYear=function(n){return f(n)+(f(n)>68?1900:2e3)};lu=ii("FullYear",!0);r("w",["ww",2],"wo","week");r("W",["WW",2],"Wo","isoWeek");p("week","w");p("isoWeek","W");w("week",5);w("isoWeek",5);i("w",/\d\d?/);i("ww",/\d\d?/,/\d\d/);i("W",/\d\d?/);i("WW",/\d\d?/,/\d\d/);si(["w","ww","W","WW"],function(n,t,i,r){t[r.substr(0,1)]=f(n)});we={dow:0,doy:6};r("d",0,"do","day");r("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)});r("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)});r("dddd",0,0,function(n){return this.localeData().weekdays(this,n)});r("e",0,0,"weekday");r("E",0,0,"isoWeekday");p("day","d");p("weekday","e");p("isoWeekday","E");w("day",11);w("weekday",11);w("isoWeekday",11);i("d",/\d\d?/);i("e",/\d\d?/);i("E",/\d\d?/);i("dd",function(n,t){return t.weekdaysMinRegex(n)});i("ddd",function(n,t){return t.weekdaysShortRegex(n)});i("dddd",function(n,t){return t.weekdaysRegex(n)});si(["dd","ddd","dddd"],function(n,t,i,r){var f=i._locale.weekdaysParse(n,r,i._strict);null!=f?t.d=f:u(i).invalidWeekday=n});si(["d","e","E"],function(n,t,i,r){t[r]=f(n)});var ty="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),iy="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ry="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),uy=ai,fy=ai,ey=ai;r("H",["HH",2],0,"hour");r("h",["hh",2],0,wr);r("k",["kk",2],0,sh);r("hmm",0,0,function(){return""+wr.apply(this)+ot(this.minutes(),2)});r("hmmss",0,0,function(){return""+wr.apply(this)+ot(this.minutes(),2)+ot(this.seconds(),2)});r("Hmm",0,0,function(){return""+this.hours()+ot(this.minutes(),2)});r("Hmmss",0,0,function(){return""+this.hours()+ot(this.minutes(),2)+ot(this.seconds(),2)});sf("a",!0);sf("A",!1);p("hour","h");w("hour",13);i("a",hf);i("A",hf);i("H",/\d\d?/);i("h",/\d\d?/);i("k",/\d\d?/);i("HH",/\d\d?/,/\d\d/);i("hh",/\d\d?/,/\d\d/);i("kk",/\d\d?/,/\d\d/);i("hmm",/\d\d\d\d?/);i("hmmss",/\d\d\d\d\d\d?/);i("Hmm",/\d\d\d\d?/);i("Hmmss",/\d\d\d\d\d\d?/);s(["H","HH"],v);s(["k","kk"],function(n,t){var i=f(n);t[v]=24===i?0:i});s(["a","A"],function(n,t,i){i._isPm=i._locale.isPM(n);i._meridiem=n});s(["h","hh"],function(n,t,i){t[v]=f(n);u(i).bigHour=!0});s("hmm",function(n,t,i){var r=n.length-2;t[v]=f(n.substr(0,r));t[tt]=f(n.substr(r));u(i).bigHour=!0});s("hmmss",function(n,t,i){var r=n.length-4,e=n.length-2;t[v]=f(n.substr(0,r));t[tt]=f(n.substr(r,2));t[ht]=f(n.substr(e));u(i).bigHour=!0});s("Hmm",function(n,t){var i=n.length-2;t[v]=f(n.substr(0,i));t[tt]=f(n.substr(i))});s("Hmmss",function(n,t){var i=n.length-4,r=n.length-2;t[v]=f(n.substr(0,i));t[tt]=f(n.substr(i,2));t[ht]=f(n.substr(r))});var or,oy=ii("Hours",!0),be={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:kv,monthsShort:dv,week:we,weekdays:ty,weekdaysMin:ry,weekdaysShort:iy,meridiemParse:/[ap]\.?m?\.?/i},l={},vi={},sy=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,hy=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,cy=/Z|[+-]\d\d(?::?\d\d)?/,sr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],au=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ly=/^\/?Date\((\-?\d+)/i,ay=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;t.createFromInputFallback=k("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});t.ISO_8601=function(){};t.RFC_2822=function(){};var vy=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=h.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:wi()}),yy=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=h.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:wi()}),py=function(){return Date.now?Date.now():+new Date},yi=["year","quarter","month","week","day","hour","minute","second","millisecond"];for(bf("Z",":"),bf("ZZ",""),i("Z",er),i("ZZ",er),s(["Z","ZZ"],function(n,t,i){i._useUTC=!0;i._tzm=tu(er,n)}),ke=/([\+\-]|\d\d)/gi,t.updateOffset=function(){},de=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,ge=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/,ut.fn=nr.prototype,ut.invalid=fc,no=gf(1,"add"),to=gf(-1,"subtract"),t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",vu=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return void 0===n?this.localeData():this.locale(n)}),r(0,["gg",2],0,function(){return this.weekYear()%100}),r(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tr("gggg","weekYear"),tr("ggggg","weekYear"),tr("GGGG","isoWeekYear"),tr("GGGGG","isoWeekYear"),p("weekYear","gg"),p("isoWeekYear","GG"),w("weekYear",1),w("isoWeekYear",1),i("G",/[+-]?\d+/),i("g",/[+-]?\d+/),i("GG",/\d\d?/,/\d\d/),i("gg",/\d\d?/,/\d\d/),i("GGGG",/\d{1,4}/,/\d{4}/),i("gggg",/\d{1,4}/,/\d{4}/),i("GGGGG",/[+-]?\d{1,6}/,fr),i("ggggg",/[+-]?\d{1,6}/,fr),si(["gggg","ggggg","GGGG","GGGGG"],function(n,t,i,r){t[r.substr(0,2)]=f(n)}),si(["gg","GG"],function(n,i,r,u){i[u]=t.parseTwoDigitYear(n)}),r("Q",0,"Qo","quarter"),p("quarter","Q"),w("quarter",7),i("Q",/\d/),s("Q",function(n,t){t[st]=3*(f(n)-1)}),r("D",["DD",2],"Do","date"),p("date","D"),w("date",9),i("D",/\d\d?/),i("DD",/\d\d?/,/\d\d/),i("Do",function(n,t){return n?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),s(["D","DD"],ft),s("Do",function(n,t){t[ft]=f(n.match(/\d\d?/)[0],10)}),yu=ii("Date",!0),r("DDD",["DDDD",3],"DDDo","dayOfYear"),p("dayOfYear","DDD"),w("dayOfYear",4),i("DDD",/\d{1,3}/),i("DDDD",/\d{3}/),s(["DDD","DDDD"],function(n,t,i){i._dayOfYear=f(n)}),r("m",["mm",2],0,"minute"),p("minute","m"),w("minute",14),i("m",/\d\d?/),i("mm",/\d\d?/,/\d\d/),s(["m","mm"],tt),io=ii("Minutes",!1),r("s",["ss",2],0,"second"),p("second","s"),w("second",15),i("s",/\d\d?/),i("ss",/\d\d?/,/\d\d/),s(["s","ss"],ht),ro=ii("Seconds",!1),r("S",0,0,function(){return~~(this.millisecond()/100)}),r(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),r(0,["SSS",3],0,"millisecond"),r(0,["SSSS",4],0,function(){return 10*this.millisecond()}),r(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),r(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),r(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),r(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),r(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),p("millisecond","ms"),w("millisecond",16),i("S",/\d{1,3}/,/\d/),i("SS",/\d{1,3}/,/\d\d/),i("SSS",/\d{1,3}/,/\d{3}/),pt="SSSS";pt.length<=9;pt+="S")i(pt,/\d+/);for(pt="S";pt.length<=9;pt+="S")s(pt,va);uo=ii("Milliseconds",!1);r("z",0,0,"zoneAbbr");r("zz",0,0,"zoneName");n=oi.prototype;n.add=no;n.calendar=kc;n.clone=dc;n.diff=fl;n.endOf=wl;n.format=cl;n.from=ll;n.fromNow=al;n.to=vl;n.toNow=yl;n.get=po;n.invalidAt=ua;n.isAfter=gc;n.isBefore=nl;n.isBetween=tl;n.isSame=il;n.isSameOrAfter=rl;n.isSameOrBefore=ul;n.isValid=ia;n.lang=vu;n.locale=te;n.localeData=ie;n.max=yy;n.min=vy;n.parsingFlags=ra;n.set=wo;n.startOf=pl;n.subtract=to;n.toArray=gl;n.toObject=na;n.toDate=dl;n.toISOString=sl;n.inspect=hl;n.toJSON=ta;n.toString=ol;n.unix=kl;n.valueOf=bl;n.creationData=fa;n.year=lu;n.isLeapYear=hs;n.weekYear=ea;n.isoWeekYear=oa;n.quarter=n.quarters=la;n.month=uf;n.daysInMonth=es;n.week=n.weeks=ys;n.isoWeek=n.isoWeeks=ps;n.weeksInYear=ha;n.isoWeeksInYear=sa;n.date=yu;n.day=n.days=ih;n.weekday=rh;n.isoWeekday=uh;n.dayOfYear=aa;n.hour=n.hours=oy;n.minute=n.minutes=io;n.second=n.seconds=ro;n.millisecond=n.milliseconds=uo;n.utcOffset=ec;n.utc=sc;n.local=hc;n.parseZone=cc;n.hasAlignedHourOffset=lc;n.isDST=ac;n.isLocal=yc;n.isUtcOffset=pc;n.isUtc=kf;n.isUTC=kf;n.zoneAbbr=ya;n.zoneName=pa;n.dates=k("dates accessor is deprecated. Use date instead.",yu);n.months=k("months accessor is deprecated. Use month instead",uf);n.years=k("years accessor is deprecated. Use year instead",lu);n.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",oc);n.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",vc);o=lr.prototype;o.calendar=so;o.longDateFormat=ho;o.invalidDate=co;o.ordinal=lo;o.preparse=ue;o.postformat=ue;o.relativeTime=ao;o.pastFuture=vo;o.set=oo;o.months=is;o.monthsShort=rs;o.monthsParse=fs;o.monthsRegex=ss;o.monthsShortRegex=os;o.week=ls;o.firstDayOfYear=vs;o.firstDayOfWeek=as;o.weekdays=ks;o.weekdaysMin=gs;o.weekdaysShort=ds;o.weekdaysParse=th;o.weekdaysRegex=fh;o.weekdaysShortRegex=eh;o.weekdaysMinRegex=oh;o.isPM=hh;o.meridiem=ch;ri("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10;return n+(1===f(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}});t.lang=k("moment.lang is deprecated. Use moment.locale instead.",ri);t.langData=k("moment.langData is deprecated. Use moment.localeData instead.",vt);var ct=Math.abs,wy=yt("ms"),by=yt("s"),ky=yt("m"),dy=yt("h"),gy=yt("d"),np=yt("w"),tp=yt("M"),ip=yt("y"),rp=ni("milliseconds"),up=ni("seconds"),fp=ni("minutes"),ep=ni("hours"),op=ni("days"),sp=ni("months"),hp=ni("years"),wt=Math.round,et={ss:44,s:45,m:45,h:22,d:26,M:11},pu=Math.abs,e=nr.prototype;return e.isValid=uc,e.abs=iv,e.add=rv,e.subtract=uv,e.as=ev,e.asMilliseconds=wy,e.asSeconds=by,e.asMinutes=ky,e.asHours=dy,e.asDays=gy,e.asWeeks=np,e.asMonths=tp,e.asYears=ip,e.valueOf=ov,e._bubble=fv,e.get=sv,e.milliseconds=rp,e.seconds=up,e.minutes=fp,e.hours=ep,e.days=op,e.weeks=hv,e.months=sp,e.years=hp,e.humanize=yv,e.toISOString=rr,e.toString=rr,e.toJSON=rr,e.locale=te,e.localeData=ie,e.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rr),e.lang=vu,r("X",0,0,"unix"),r("x",0,0,"valueOf"),i("x",/[+-]?\d+/),i("X",/[+-]?\d+(\.\d{1,3})?/),s("X",function(n,t,i){i._d=new Date(1e3*parseFloat(n,10))}),s("x",function(n,t,i){i._d=new Date(f(n))}),t.version="2.18.2",function(n){he=n}(h),t.fn=n,t.min=tc,t.max=ic,t.now=py,t.utc=it,t.unix=wa,t.months=ka,t.isDate=pi,t.locale=ri,t.invalid=wi,t.duration=ut,t.isMoment=at,t.weekdays=ga,t.parseZone=ba,t.localeData=vt,t.isDuration=gr,t.monthsShort=da,t.weekdaysMin=tv,t.defineLocale=br,t.updateLocale=ah,t.locales=vh,t.weekdaysShort=nv,t.normalizeUnits=d,t.relativeTimeRounding=av,t.relativeTimeThreshold=vv,t.calendarFormat=bc,t.prototype=n,t});!function(n,t){if("function"==typeof define&&define.amd)define("SnazzyInfoWindow",["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var i={exports:{}};t(i,i.exports);n.SnazzyInfoWindow=i.exports}}(this,function(n,t){"use strict";function h(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function c(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}function l(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}function f(n,t){n&&t&&Object.keys(t).forEach(function(i){n[i]=t[i]})}function a(n){var t={};return f(t,u),f(t,n),Object.keys(u).forEach(function(n){var r=u[n],i;"object"===(void 0===r?"undefined":p(r))&&(i={},f(i,r),f(i,t[n]),t[n]=i)}),t}function i(n,t){var u=/^(-{0,1}\.{0,1}\d+(\.\d+)?)[\s|\.]*(\w*)$/,r;return n&&u.test(n)?(r=u.exec(n),{value:1*r[1],units:r[3]||"px",original:n}):t?i(t):{original:t}}function e(n,t){if(n){for(;n.firstChild;)n.removeChild(n.firstChild);t&&("string"==typeof t?n.innerHTML=t:n.appendChild(t))}}function v(n){return"top"===n?"bottom":"bottom"===n?"top":"left"===n?"right":"right"===n?"left":n}function o(n){return n.charAt(0).toUpperCase()+n.slice(1)}function s(n){if(void 0!==n&&null!==n&&google){if(n instanceof google.maps.LatLng)return n;if(void 0!==n.lat&&void 0!==n.lng)return new google.maps.LatLng(n)}return null}Object.defineProperty(t,"__esModule",{value:!0});var y=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r={h:"0px",v:"3px",blur:"6px",spread:"0px",color:"#000"},u={placement:"top",pointer:!0,openOnMarkerClick:!0,closeOnMapClick:!0,closeWhenOthersOpen:!1,showCloseButton:!0,panOnOpen:!0,edgeOffset:{top:20,right:20,bottom:20,left:20}},w=function(n){function t(n){var i,r;return h(this,t),i=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n)),i._html=null,i._opts=a(n),i._callbacks=i._opts.callbacks||{},i._marker=i._opts.marker,i._map=i._opts.map,i._position=s(i._opts.position),i._isOpen=!1,i._listeners=[],google&&i._marker&&i._opts.openOnMarkerClick&&i.trackListener(google.maps.event.addListener(i._marker,"click",function(){i.getMap()||i.open()}),!0),i._position&&!i._opts.offset&&(i._opts.offset={top:"0px",left:"0px"}),r=n.placement||i._opts.position,("string"==typeof r||r instanceof String)&&(r=r.toLowerCase()),i._opts.placement="top"!==r&&"bottom"!==r&&"left"!==r&&"right"!==r?u.placement:r,r=i._opts.position,void 0===r||null===r||"string"==typeof r||r instanceof String||(i._opts.position=r),void 0!==i._opts.border&&i._opts.border!==!0||(i._opts.border={}),void 0===i._opts.pointer&&(i._opts.pointer=u.pointer),void 0!==i._opts.shadow&&i._opts.shadow!==!0||(i._opts.shadow={}),i}return l(t,n),y(t,[{key:"activateCallback",value:function(n){var t=this._callbacks[n];if(t)return t.apply(this)}},{key:"trackListener",value:function(n,t){this._listeners.push({listener:n,persistent:t})}},{key:"clearListeners",value:function(n){google&&this._listeners&&(this._listeners.forEach(function(t){!n&&t.persistent||(google.maps.event.removeListener(t.listener),t.listener=null)}),this._listeners=this._listeners.filter(function(n){return null!=n.listener}))}},{key:"isOpen",value:function(){return this._isOpen}},{key:"open",value:function(){var n=this.activateCallback("beforeOpen");(void 0===n||n)&&(this._marker?this.setMap(this._marker.getMap()):this._map&&this._position&&this.setMap(this._map))}},{key:"close",value:function(){var n=this.activateCallback("beforeClose");(void 0===n||n)&&(this.clearListeners(),this.setMap(null))}},{key:"destroy",value:function(){this.getMap()&&this.setMap(null);this.clearListeners(!0)}},{key:"setContent",value:function(n){this._opts.content=n;this._html&&this._html.content&&e(this._html.content,n)}},{key:"setPosition",value:function(n){this._position=s(n);this._isOpen&&this._position&&(this.draw(),this.resize(),this.reposition())}},{key:"getWrapper",value:function(){return this._html?this._html.wrapper:null}},{key:"draw",value:function(){var u,h,n,f,s,p,c,t,e,b,k,y;if(this.getMap()&&this._html&&(this._marker||this._position)){if(u=this._opts.offset,u&&(u.left&&(this._html.wrapper.style.marginLeft=u.left),u.top&&(this._html.wrapper.style.marginTop=u.top)),h=this._opts.backgroundColor,(h&&(this._html.contentWrapper.style.backgroundColor=h,this._opts.pointer&&(this._html.pointerBg.style["border"+o(this._opts.placement)+"Color"]=h)),this._opts.padding&&(this._html.contentWrapper.style.padding=this._opts.padding,this._opts.shadow&&(this._html.shadowFrame.style.padding=this._opts.padding)),this._opts.borderRadius&&(this._html.contentWrapper.style.borderRadius=this._opts.borderRadius,this._opts.shadow&&(this._html.shadowFrame.style.borderRadius=this._opts.borderRadius)),this._opts.fontSize&&(this._html.wrapper.style.fontSize=this._opts.fontSize),this._opts.fontColor&&(this._html.contentWrapper.style.color=this._opts.fontColor),this._opts.pointer&&this._opts.pointer!==!0&&(this._opts.shadow&&(this._html.shadowPointer.style.width=this._opts.pointer,this._html.shadowPointer.style.height=this._opts.pointer),this._html.pointerBorder&&(this._html.pointerBorder.style.borderWidth=this._opts.pointer),this._html.pointerBg.style.borderWidth=this._opts.pointer),this._opts.border)&&(n=0,(void 0!==this._opts.border.width&&(n=i(this._opts.border.width,"0px"),this._html.contentWrapper.style.borderWidth=n.value+n.units),n=Math.round((this._html.contentWrapper.offsetWidth-this._html.contentWrapper.clientWidth)/2),n=i(n+"px","0px"),this._opts.pointer)&&(f=Math.min(this._html.pointerBorder.offsetHeight,this._html.pointerBorder.offsetWidth),f=i(f+"px","0px"),s=Math.round(n.value*(1.41421356237-1)),s=Math.min(s,f.value),this._html.pointerBg.style.borderWidth=f.value-s+f.units,p=o(v(this._opts.placement)),this._html.pointerBg.style["margin"+p]=s+n.units,this._html.pointerBg.style[this._opts.placement]=-n.value+n.units),c=this._opts.border.color,c&&(this._html.contentWrapper.style.borderColor=c,this._html.pointerBorder&&(this._html.pointerBorder.style["border"+o(this._opts.placement)+"Color"]=c))),this._opts.shadow){if(t=this._opts.shadow,e=function(n){var i=t[n];return void 0!==i&&null!=i},e("h")||e("v")||e("blur")||e("spread")||e("color")){var l=i(t.h,r.h),a=i(t.v,r.v),d=i(t.blur,r.blur),g=i(t.spread,r.spread),nt=t.color||r.color,w=function(n,t){return n+" "+t+" "+d.original+" "+g.original+" "+nt};this._html.shadowFrame.style.boxShadow=w(l.original,a.original);b=.70710678118654735*(l.value-a.value)+l.units;k=.70710678118654735*(l.value+a.value)+a.units;this._html.shadowPointerInner.style.boxShadow=w(b,k)}this._opts.shadow.opacity&&(this._html.shadowWrapper.style.opacity=this._opts.shadow.opacity)}y=this.getProjection().fromLatLngToDivPixel(this._position||this._marker.position);y&&(this._html.floatWrapper.style.top=Math.floor(y.y)+"px",this._html.floatWrapper.style.left=Math.floor(y.x)+"px");this._isOpen||(this._isOpen=!0,this.resize(),this.reposition(),this.activateCallback("afterOpen"),google&&google.maps.event.trigger(this.getMap(),"snazzy-info-window-opened",this))}}},{key:"onAdd",value:function(){var n=this,r,t,u,i;this._html||(r=function(n,t){var i,r;if(n&&t)for(i=0;i<t.length;i++)r=t[i],r&&(n.className&&(n.className+=" "),n.className+="si-"+r)},t=function(){for(var t,i=arguments.length,u=Array(i),n=0;n<i;n++)u[n]=arguments[n];return t=document.createElement("div"),r(t,u),t},(this._html={},this._html.wrapper=t("wrapper-"+this._opts.placement),this._opts.wrapperClass&&(this._html.wrapper.className+=" "+this._opts.wrapperClass),this._opts.border&&r(this._html.wrapper,["has-border"]),this._opts.shadow&&(this._html.shadowWrapper=t("shadow-wrapper-"+this._opts.placement),this._html.shadowFrame=t("frame","shadow-frame"),this._html.shadowWrapper.appendChild(this._html.shadowFrame),this._opts.pointer&&(this._html.shadowPointer=t("shadow-pointer-"+this._opts.placement),this._html.shadowPointerInner=t("shadow-inner-pointer-"+this._opts.placement),this._html.shadowPointer.appendChild(this._html.shadowPointerInner),this._html.shadowWrapper.appendChild(this._html.shadowPointer)),this._html.wrapper.appendChild(this._html.shadowWrapper)),this._html.contentWrapper=t("frame","content-wrapper"),this._html.content=t("content"),this._opts.content&&e(this._html.content,this._opts.content),this._opts.showCloseButton)&&(this._opts.closeButtonMarkup?(u=document.createElement("div"),e(u,this._opts.closeButtonMarkup),this._html.closeButton=u.firstChild):(this._html.closeButton=document.createElement("button"),this._html.closeButton.setAttribute("type","button"),this._html.closeButton.innerHTML="&#215;",r(this._html.closeButton,["close-button"])),this._html.contentWrapper.appendChild(this._html.closeButton)),this._html.contentWrapper.appendChild(this._html.content),this._html.wrapper.appendChild(this._html.contentWrapper),this._opts.pointer&&(this._opts.border&&(this._html.pointerBorder=t("pointer-"+this._opts.placement,"pointer-border-"+this._opts.placement),this._html.wrapper.appendChild(this._html.pointerBorder)),this._html.pointerBg=t("pointer-"+this._opts.placement,"pointer-bg-"+this._opts.placement),this._html.wrapper.appendChild(this._html.pointerBg)),this._html.floatWrapper=t("float-wrapper"),this._html.floatWrapper.appendChild(this._html.wrapper),this.getPanes().floatPane.appendChild(this._html.floatWrapper),i=this.getMap(),(this.clearListeners(),this._opts.closeOnMapClick&&this.trackListener(google.maps.event.addListener(i,"click",function(){n.close()})),this._opts.closeWhenOthersOpen&&this.trackListener(google.maps.event.addListener(i,"snazzy-info-window-opened",function(t){n!==t&&n.close()})),google)&&(this._previousWidth=null,this._previousHeight=null,this.trackListener(google.maps.event.addListener(i,"bounds_changed",function(){var t=i.getDiv(),r=t.offsetWidth,u=t.offsetHeight,f=n._previousWidth,e=n._previousHeight;null!==f&&null!==e&&f===r&&e===u||(n._previousWidth=r,n._previousHeight=u,n.resize())})),this._marker&&this.trackListener(google.maps.event.addListener(this._marker,"position_changed",function(){n.draw()})),this._opts.showCloseButton&&!this._opts.closeButtonMarkup&&this.trackListener(google.maps.event.addDomListener(this._html.closeButton,"click",function(t){t.cancelBubble=!0;t.stopPropagation&&t.stopPropagation();n.close()})),["click","dblclick","rightclick","contextmenu","drag","dragend","dragstart","mousedown","mouseout","mouseover","mouseup","touchstart","touchend","touchmove","wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"].forEach(function(t){n.trackListener(google.maps.event.addDomListener(n._html.wrapper,t,function(n){n.cancelBubble=!0;n.stopPropagation&&n.stopPropagation()}))})),this.activateCallback("open"))}},{key:"onRemove",value:function(){if(this.activateCallback("close"),this._html){var n=this._html.floatWrapper.parentElement;n&&n.removeChild(this._html.floatWrapper);this._html=null}this._isOpen=!1;this.activateCallback("afterClose")}},{key:"getMapInnerBounds",value:function(){var t=this.getMap().getDiv().getBoundingClientRect(),n={top:t.top+this._opts.edgeOffset.top,right:t.right-this._opts.edgeOffset.right,bottom:t.bottom-this._opts.edgeOffset.bottom,left:t.left+this._opts.edgeOffset.left};return n.width=n.right-n.left,n.height=n.bottom-n.top,n}},{key:"reposition",value:function(){if(this._opts.panOnOpen&&this._html){var t=this.getMapInnerBounds(),n=this._html.wrapper.getBoundingClientRect(),i=0,r=0;t.left>=n.left?i=n.left-t.left:t.right<=n.right&&(i=n.left-(t.right-n.width));t.top>=n.top?r=n.top-t.top:t.bottom<=n.bottom&&(r=n.top-(t.bottom-n.height));0===i&&0===r||this.getMap().panBy(i,r)}}},{key:"resize",value:function(){var i,n,t;this._html&&(i=this.getMapInnerBounds(),n=i.width,void 0!==this._opts.maxWidth&&(n=Math.min(n,this._opts.maxWidth)),n-=this._html.wrapper.offsetWidth-this._html.content.offsetWidth,this._html.content.style.maxWidth=n+"px",t=i.height,void 0!==this._opts.maxHeight&&(t=Math.min(t,this._opts.maxHeight)),t-=this._html.wrapper.offsetHeight-this._html.content.offsetHeight,this._html.content.style.maxHeight=t+"px")}}]),t}(google.maps.OverlayView);t.default=w;n.exports=t.default}),function(n){var t=function(){function t(){this.IsOpen=ko.observable(n.Settings.IsMobile);this.LastUpdatedDateTime=ko.observable();this.LastUpdated=ko.observable("");this.IsRefreshing=ko.observable(!1);this.allAlertsOff=ko.observable(!1);this.ToggleAllAlertsDisplayText=ko.observable("Turn all alerts OFF");this.ViewPortFilterDisplayText=ko.observable("Turn location filter ON");this.ViewPortFilteringActive=ko.observable(!1);this.TravelingOnValue=ko.observable("");this.dateFilteredFeatures=ko.observableArray([]);this.AlertSearchControlValue=ko.observable("");this.alertSearchFilteredFeatures=ko.observableArray([])}return t.prototype.Initialise=function(n){var t=this;this.Parent=n;this.travelingOn=$(".traveldatefilter").find("#travelingOn")[0];this.TravelingOnValue.subscribe(function(n){if(n===""){t.resetDateFilter();return}var i=moment(n,"DDMMMYYYY");t.dateFilterFeatures(i)});this.alertSearchControlInput=$(".alertsearchcontrol").find("#alertsearchinput")[0];this.AlertSearchControlValue.subscribe(function(n){if(n===""){t.alertSearchResetFilter();return}t.alertSearchFilterFeatures(n)});this.LastUpdatedDateTime(moment());this.LastUpdated("Updated "+this.LastUpdatedDateTime().fromNow());this.timerToken=setInterval(function(){t.autoUpdate()},6e4);this.ViewPortFilteringActive.subscribe(function(n){t.Parent.Map.ViewPortFilteringActive(n)})},t.prototype.dateFilterFeatures=function(t){var i=this;$.each(this.Parent.ArcGisDataLoader.GetLeftPanelFeatureClusters(),function(r,u){u.IsDateFilterable()&&($.each(u.Features(),function(r,u){t.isBetween(u.StartDate(),u.EndDate())?(u.RemoveFilter(n.Enums.FilteredBy.TravelDateFilterControl),i.dateFilteredFeatures.remove(u)):(u.AddFilter(n.Enums.FilteredBy.TravelDateFilterControl),i.dateFilteredFeatures().indexOf(u)<0&&i.dateFilteredFeatures.push(u))}),u.DataLayerCluster().redraw())})},t.prototype.resetDateFilter=function(){$.each(this.dateFilteredFeatures(),function(t,i){i.RemoveFilter(n.Enums.FilteredBy.TravelDateFilterControl)});this.dateFilteredFeatures([]);$.each(this.Parent.ArcGisDataLoader.GetLeftPanelFeatureClusters(),function(n,t){t.DataLayerCluster().redraw()})},t.prototype.ClearDateFilterVal=function(){this.TravelingOnValue("")},t.prototype.ClearSearchFilterVal=function(){this.AlertSearchControlValue("")},t.prototype.alertSearchFilterFeatures=function(t){var i=this;$.each(this.Parent.ArcGisDataLoader.GetLeftPanelFeatureClusters(),function(r,u){$.each(u.Features(),function(r,u){u.Description()!=null&&(u.Description().toLowerCase().indexOf($.trim(t.toLowerCase()))<0?(u.AddFilter(n.Enums.FilteredBy.FeatureFilterSearchControl),i.alertSearchFilteredFeatures().indexOf(u)<0&&i.alertSearchFilteredFeatures.push(u)):(u.RemoveFilter(n.Enums.FilteredBy.FeatureFilterSearchControl),i.alertSearchFilteredFeatures.remove(u)))});u.DataLayerCluster().redraw()})},t.prototype.alertSearchResetFilter=function(){$.each(this.alertSearchFilteredFeatures(),function(t,i){i.RemoveFilter(n.Enums.FilteredBy.FeatureFilterSearchControl)});this.alertSearchFilteredFeatures([]);$.each(this.Parent.ArcGisDataLoader.GetLeftPanelFeatureClusters(),function(n,t){t.DataLayerCluster().redraw()})},t.prototype.autoUpdate=function(){this.LastUpdated("Updated "+this.LastUpdatedDateTime().fromNow())},t.prototype.RefreshData=function(){var t=this;this.IsRefreshing(!0);this.Parent.ArcGisDataLoader.FeatureClusters.removeAll();this.Parent.ArcGisDataLoader.LoadFeatureClusters(n.Settings.ArcGisMapServices,function(){t.IsRefreshing(!1);t.LastUpdatedDateTime(moment());t.LastUpdated("Updated "+t.LastUpdatedDateTime().fromNow());t.Parent.Map.SetupClusters()})},t.prototype.ToggleAllAlerts=function(){this.allAlertsOff(!this.allAlertsOff());var n=this.Parent.ArcGisDataLoader.GetLeftPanelFeatureClustersThatCanHide();this.allAlertsOff()?(this.ToggleAllAlertsDisplayText("Turn all alerts ON"),$.each(n,function(n,t){t.HideAllFeatures()})):(this.ToggleAllAlertsDisplayText("Turn all alerts OFF"),$.each(n,function(n,t){t.ShowAllFeatures()}))},t.prototype.Toggle=function(){this.IsOpen()?($("#currentalertscontrol > .collapse").collapse("hide"),this.IsOpen(!1)):($("#currentalertscontrol  > .collapse").collapse("show"),this.IsOpen(!0))},t.prototype.Close=function(){$("#currentalertscontrol > .collapse").collapse("hide");this.IsOpen(!1)},t.prototype.ToggleViewportFiltering=function(){this.ViewPortFilteringActive(!this.ViewPortFilteringActive());this.ViewPortFilteringActive()?this.ViewPortFilterDisplayText("Turn location filter OFF"):this.ViewPortFilterDisplayText("Turn location filter ON")},t}();n.CurrentAlertsControl=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(n,t,i){this.ClusterName=ko.observable("");this.ClassName=ko.observable("");this.Feature=ko.observable(null);this.ClusterName(n);this.ClassName(t);this.Feature(i)}return n}(),i;n.RouteAlert=t;i=function(){function i(){this.fromInputValue=ko.observable("");this.toInputValue=ko.observable("");this.IsOpen=ko.observable(!1);this.selectedTravelMode=ko.observable("DRIVING");this.currentRouteIndex=ko.observable(0);this.RouteAlerts=ko.observableArray([]);this.TravelingOnValue=ko.observable("");this.dateFilteredFeatures=ko.observableArray([])}return i.prototype.Initialise=function(n){var t=this;this.parent=n;this.htmlControlElementId="#planjourneycontrol";this.travelingOn=$(".traveldatefiltertrip").find("#travelingOn")[0];this.TravelingOnValue.subscribe(function(n){if(n===""){t.resetDateFilter();t.findRoute();return}var i=moment(n,"DDMMMYYYY");t.dateFilterFeatures(i);t.findRoute()});this.fromInput=$(this.htmlControlElementId).find("#routingFrom")[0];this.toInput=$(this.htmlControlElementId).find("#routingTo")[0];this.routePanel=$(this.htmlControlElementId).find("#route-panel")[0];this.travelmode=$(this.htmlControlElementId).find(".traveloptions")[0];this.directionService=new google.maps.DirectionsService;this.directionRenderer=new google.maps.DirectionsRenderer({map:this.parent.Map.GoogleMap,draggable:!1,polylineOptions:{strokeWeight:8,strokeColor:"#0e1e63"}});var r=new google.maps.LatLng(-35.803938,112.414691),u=new google.maps.LatLng(-12.880811,128.850237),i=new google.maps.LatLngBounds(r,u);this.FromSearchBox=new google.maps.places.SearchBox(this.fromInput,{bounds:i});this.ToSearchBox=new google.maps.places.SearchBox(this.toInput,{bounds:i});this.participatingFeatureClusters=$.grep(this.parent.ArcGisDataLoader.FeatureClusters(),function(n){return n.ShowOnRoute()});this.directionRenderer.setPanel(this.routePanel);google.maps.event.addListener(this.FromSearchBox,"places_changed",function(){t.calculateRoute()});google.maps.event.addListener(this.ToSearchBox,"places_changed",function(){t.calculateRoute()});google.maps.event.addListener(this.directionRenderer,"directions_changed",function(){t.findRoute()});google.maps.event.addListener(this.directionRenderer,"routeindex_changed",function(){t.currentRouteIndex()!==t.directionRenderer.getRouteIndex()&&(t.currentRouteIndex(t.directionRenderer.getRouteIndex()),t.calculateWarnings())})},i.prototype.findRoute=function(){var t;if($(this.htmlControlElementId).LoadingOverlay("show",{}),t=this.directionRenderer.getDirections(),t==null){$(this.htmlControlElementId).LoadingOverlay("hide",{});return}var r=this.directionRenderer.getRouteIndex(),i=t.routes[r],u=i.legs[0].start_address,f=i.legs[0].end_address;this.fromInputValue(u);this.toInputValue(f);this.calculateWarnings();$(this.htmlControlElementId).LoadingOverlay("hide",{});n.Settings.IsMobile&&this.parent.LeftPanel.Toggle()},i.prototype.dateFilterFeatures=function(t){var i=this;$.each(this.parent.ArcGisDataLoader.GetLeftPanelFeatureClusters(),function(r,u){u.IsDateFilterable()&&($.each(u.Features(),function(r,u){t.isBetween(u.StartDate(),u.EndDate())?(u.RemoveFilter(n.Enums.FilteredBy.TripTravelDateFilterControl),i.dateFilteredFeatures.remove(u)):(u.AddFilter(n.Enums.FilteredBy.TripTravelDateFilterControl),i.dateFilteredFeatures().indexOf(u)<0&&i.dateFilteredFeatures.push(u))}),u.DataLayerCluster().redraw())})},i.prototype.resetDateFilter=function(){$.each(this.dateFilteredFeatures(),function(t,i){i.RemoveFilter(n.Enums.FilteredBy.TripTravelDateFilterControl)});this.dateFilteredFeatures([]);$.each(this.parent.ArcGisDataLoader.GetLeftPanelFeatureClusters(),function(n,t){t.DataLayerCluster().redraw()})},i.prototype.ClearDateFilterVal=function(){this.TravelingOnValue("")},i.prototype.calculateRoute=function(){var t=this,n;$(this.fromInput).val()!==""&&$(this.toInput).val()!==""&&($(this.htmlControlElementId).LoadingOverlay("show",{}),n={origin:$(this.fromInput).val(),destination:$(this.toInput).val(),travelMode:google.maps.TravelMode[this.selectedTravelMode()],provideRouteAlternatives:!0},this.directionService.route(n,function(n,i){i===google.maps.DirectionsStatus.OK&&t.directionRenderer.setDirections(n)}))},i.prototype.calculateWarnings=function(){var n=this;this.RouteAlerts.removeAll();$.each(this.participatingFeatureClusters,function(t,i){n.getWarningsOnRoute(i,n.directionRenderer.getDirections().routes[n.currentRouteIndex()])})},i.prototype.getWarningsOnRoute=function(i,r){var u=this;$.each(i.Features(),function(f,e){var o,s,h,c,l;e.IsVisible()&&(o=new google.maps.Polyline({path:r.overview_path}),e instanceof n.Models.RoadClosureLine?(s=e.GoogleFeature().getGeometry().getArray(),$.each(s,function(r,f){var h=google.maps.geometry.poly.isLocationOnEdge(f,o,.001),s;if(h)return s=i.Type()===n.Enums.FeatureClusterTypes.ClosedRoadLines?"route-danger":"route-warning",u.RouteAlerts.push(new t(i.DisplayName(),s,e)),!1})):(h=e.GoogleFeature().getGeometry().get(),c=google.maps.geometry.poly.isLocationOnEdge(h,o,.001),c&&(l=i.Type()===n.Enums.FeatureClusterTypes.Alerts?"route-danger":"route-warning",u.RouteAlerts.push(new t(i.DisplayName(),l,e)))))})},i.prototype.ClearFromInput=function(){this.fromInputValue("");this.Reset()},i.prototype.ClearToInput=function(){this.toInputValue("");this.Reset()},i.prototype.Toggle=function(){this.IsOpen()?($(this.htmlControlElementId+" .collapse").collapse("hide"),this.IsOpen(!1)):($(this.htmlControlElementId+" .collapse").collapse("show"),this.IsOpen(!0))},i.prototype.Close=function(){$(this.htmlControlElementId+" .collapse").collapse("hide");this.IsOpen(!1)},i.prototype.Open=function(){$(this.htmlControlElementId+" .collapse").collapse("show");this.IsOpen(!0)},i.prototype.TravelModeSelect=function(n,t,i){i!==this.selectedTravelMode()&&($(this.travelmode).find(".travel-options-selected").removeClass("travel-options-selected"),this.selectedTravelMode(i),$(t.target).addClass("travel-options-selected"),this.calculateRoute())},i.prototype.Reset=function(){$(this.routePanel).html("");this.directionRenderer.set("directions",null);this.RouteAlerts.removeAll()},i.prototype.ClearAll=function(){this.fromInputValue("");this.toInputValue("");this.Reset()},i}();n.PlanJourneyControl=i}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(){}return n.prototype.Initialise=function(n){this.Parent=n},n}();n.RoadLegendControl=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(){this.IsOpen=ko.observable(!0);this.PlanJourneyControl=new n.PlanJourneyControl;this.CurrentAlertsControl=new n.CurrentAlertsControl;this.RoadLegendControl=new n.RoadLegendControl}return t.prototype.Initialise=function(t){var i=this;this.Parent=t;this.htmlElementId="#leftpanel";this.CurrentAlertsControl.Initialise(this.Parent);this.PlanJourneyControl.Initialise(this.Parent);this.RoadLegendControl.Initialise(this.Parent);this.IsOpen.subscribe(function(t){t?($(i.htmlElementId).removeClass("menu-closed"),$(i.htmlElementId).addClass("leftpanel-open"),n.Settings.IsMobile&&($("#rightmenu").hide(),i.Parent.Footer.IsOpen(!1))):($(i.htmlElementId).addClass("menu-closed"),$(i.htmlElementId).removeClass("leftpanel-open"),n.Settings.IsMobile&&$("#rightmenu").show())});n.Settings.IsMobile&&this.IsOpen(!1);this.resize();$(this.htmlElementId).show();$(window).resize(function(){i.resize()})},t.prototype.resize=function(){var n=$("body").height();$(this.htmlElementId).css("max-height",n)},t.prototype.Toggle=function(){this.IsOpen(!this.IsOpen())},t}();n.LeftPanel=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(){this.TrafficLayerActive=ko.observable(!1)}return n.prototype.Initialise=function(n){var t=this;this.Parent=n;this.trafficLayer=new google.maps.TrafficLayer;this.TrafficLayerActive.subscribe(function(n){n?t.trafficLayer.setMap(t.Parent.Map.GoogleMap):t.trafficLayer.setMap(null)})},n.prototype.ToggleGoogleTraffic=function(){this.TrafficLayerActive(!this.TrafficLayerActive())},n}();n.PoiControl=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(){this.IsOpen=ko.observable(!n.Settings.IsSmallMobile);this.PoiControl=new n.PoiControl}return t.prototype.Initialise=function(n){var t=this;this.Parent=n;this.htmlElementId="#rightmenu";this.PoiControl.Initialise(this.Parent);this.resize();$(this.htmlElementId).show();$(window).resize(function(){t.resize()})},t.prototype.resize=function(){var n=$("body").height();$(this.htmlElementId).css("max-height",n)},t.prototype.Toggle=function(){this.IsOpen(!this.IsOpen())},t}();n.RightPanel=t}(Mrwa||(Mrwa={})),function(n){var t=function(){function n(){this.GreyScale=new google.maps.StyledMapType([{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative",elementType:"geometry",stylers:[{visibility:"off"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],{name:"Greyscale"});this.Roadmap=new google.maps.StyledMapType([{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"administrative",stylers:[{visibility:"on"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"road",stylers:[{visibility:"on"},{saturation:-100}]}],{name:"Roadmap"})}return n}(),i;n.MapStyles=t;i=function(){function i(){this.ViewPortFilteringActive=ko.observable(!1);this.filteredFeatures=ko.observableArray([])}return i.prototype.Initialise=function(i,r,u){var f=this,o,e,s;this.parent=r;o={center:i.center,zoom:i.zoom,zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},mapTypeControlOptions:i.mapTypeControlOptions,streetViewControl:!1,gestureHandling:"greedy"};this.GoogleMap=new google.maps.Map(i.mapDiv,o);e=new t;this.GoogleMap.mapTypes.set("mrwaRoadmap",e.Roadmap);this.GoogleMap.mapTypes.set("mrwaGreyscale",e.GreyScale);this.GoogleMap.setMapTypeId("mrwaRoadmap");this.GoogleMap.setTilt(0);this.ViewPortFilteringActive.subscribe(function(n){n?f.filterFeatures():f.resetFilter()});google.maps.event.addListenerOnce(this.GoogleMap,"idle",function(){f.infoWindow!=null&&(f.infoWindow.close(),f.infoWindow=null);var t=!1,i=function(){$(f.infoWindow.getWrapper()).removeClass("active");setTimeout(function(){t=!0;f.infoWindow.close()},300)};f.infoWindow=new SnazzyInfoWindow({wrapperClass:"custom-window",map:f.GoogleMap,offset:{top:"-50px"},border:!1,panOnOpen:!1,closeButtonMarkup:'<button type="button" class="custom-close">&#215;<\/button>',callbacks:{open:function(){$(this.getWrapper()).addClass("open")},afterOpen:function(){var t=$(this.getWrapper());t.addClass("active");t.find(".custom-close").on("click",i);n.Settings.IsMobile||$('.custom-body img[data-toggle="tooltip"]').tooltip()},beforeClose:function(){return t?!0:(i(),!1)},afterClose:function(){var n=$(this.getWrapper());n.find(".custom-close").off();n.removeClass("open");t=!1}}});f.SetupClusters();u()});s={classNames:{menu:"context_menu",menuSeparator:"context_menu_separator"},menuItems:[{label:"Directions from here",id:"directionsOriginMenuItem",className:"menu_item",eventName:"directions_origin_click"},{label:"Directions to here",id:"directionsDestinationMenuItem",className:"menu_item",eventName:"directions_destination_click"},{},{label:"Zoom in",id:"zoomInMenuItem",className:"menu_item",eventName:"zoom_in_click"},{label:"Zoom out",id:"zoomOutMenuItem",className:"menu_item",eventName:"zoom_out_click"},{},{label:"Center map",id:"centerMapMenuItem",className:"menu_item",eventName:"center_map_click"}],pixelOffset:new google.maps.Point(10,-5),zIndex:5};this.contextMenu=new ContextMenu(this.GoogleMap,s);google.maps.event.addListener(this.contextMenu,"menu_item_selected",function(n,t){switch(t){case"directions_origin_click":f.parent.LeftPanel.PlanJourneyControl.IsOpen()||f.parent.LeftPanel.PlanJourneyControl.Open();f.parent.LeftPanel.PlanJourneyControl.fromInputValue(n.toUrlValue());f.parent.LeftPanel.PlanJourneyControl.calculateRoute();break;case"directions_destination_click":f.parent.LeftPanel.PlanJourneyControl.IsOpen()||f.parent.LeftPanel.PlanJourneyControl.Open();f.parent.LeftPanel.PlanJourneyControl.toInputValue(n.toUrlValue());f.parent.LeftPanel.PlanJourneyControl.calculateRoute();break;case"zoom_in_click":f.GoogleMap.panTo(n);f.GoogleMap.setZoom(f.GoogleMap.getZoom()+2);break;case"zoom_out_click":f.GoogleMap.panTo(n);f.GoogleMap.setZoom(f.GoogleMap.getZoom()-2);break;case"center_map_click":f.GoogleMap.panTo(n)}});google.maps.event.addListener(this.GoogleMap,"idle",function(){f.ViewPortFilteringActive()&&f.filterFeatures()});google.maps.event.addListener(this.GoogleMap,"rightclick",function(n){f.contextMenu.show(n.latLng,f.GoogleMap)})},i.prototype.SetupClusters=function(){var t=this;$.each(this.parent.ArcGisDataLoader.FeatureClusters(),function(i,r){r.DataLayerCluster().SetMap(t.GoogleMap);r.DataLayerCluster().addListener("click",function(i){n.Settings.IsMobile&&t.parent.LeftPanel.IsOpen()&&t.parent.LeftPanel.Toggle();t.ToggleInfoWindow(i,r)});r.DataLayerCluster().redraw()})},i.prototype.filterFeatures=function(){var t=this,i=this.GoogleMap.getBounds();$.each(this.parent.ArcGisDataLoader.FeatureClusters(),function(r,u){$.each(u.Features(),function(r,u){var f=null,o=!1,s,e;if(u instanceof n.Models.RoadClosureLine){for(f=u.GoogleFeature().getGeometry().getArray(),s=new google.maps.LatLngBounds,e=0;e<f.length;e++)s.extend(f[e]);o=i.intersects(s)}else f=u.GoogleFeature().getGeometry().get(),o=i.contains(f);o?(u.RemoveFilter(n.Enums.FilteredBy.MapBounds),t.filteredFeatures.remove(u)):(u.AddFilter(n.Enums.FilteredBy.MapBounds),t.filteredFeatures().indexOf(u)<0&&t.filteredFeatures.push(u))});u.DataLayerCluster().redraw()})},i.prototype.resetFilter=function(){$.each(this.filteredFeatures(),function(t,i){i.RemoveFilter(n.Enums.FilteredBy.MapBounds)});this.filteredFeatures([]);$.each(this.parent.ArcGisDataLoader.FeatureClusters(),function(n,t){t.DataLayerCluster().redraw()})},i.prototype.GoToPlaceWithZoom=function(n,t,i){this.GoogleMap.panTo(n);this.GoogleMap.setZoom(t);this.marker!=null&&(this.marker.setMap(null),this.marker=null);this.marker=new google.maps.Marker({position:n,map:this.GoogleMap,title:i.name});this.infoWindow.isOpen()&&this.infoWindow.close();this.infoWindow.setContent('<div class="place-adress">'+i.formatted_address+"<\/div>");this.infoWindow.setPosition(n);this.infoWindow.open()},i.prototype.ClearPlacesMarker=function(){this.marker!=null&&(this.marker.setMap(null),this.marker=null);this.infoWindow.isOpen()&&this.infoWindow.close()},i.prototype.GoToPointNoZoom=function(t){this.GoogleMap.panTo(t);var i=$("#map").height();n.Settings.IsMobile?this.GoogleMap.panBy(0,-(i/16*6)):this.GoogleMap.panBy(0,-(i/4))},i.prototype.ToggleInfoWindow=function(n,t){this.parent.Footer.IsOpen(!1);this.infoWindow.isOpen()&&this.infoWindow.destroy();this.infoWindow.setContent(t.GetInfoWindowFor(n.feature));this.infoWindow.setPosition(n.latLng);this.infoWindow.open();var i=n.feature.getProperty("in_cluster");i?this.GoToFeatureZoom(n.latLng,16):this.GoToPointNoZoom(n.latLng)},i.prototype.GoToFeatureZoom=function(n,t){this.GoogleMap.setZoom(t);this.GoToPointNoZoom(n)},i}();n.Map=i}(Mrwa||(Mrwa={})),function(n){var t=function(){function t(){this.Map=new n.Map;this.LeftPanel=new n.LeftPanel;this.RightPanel=new n.RightPanel;this.Footer=new n.Footer}return t.prototype.Initialise=function(t){var i=this;this.ArcGisDataLoader=t;this.ArcGisDataLoader.IsInitialising.subscribe(function(t){if(!t){var r=n.Settings.IsMobile?new google.maps.LatLng(-29.434752,118.204406):new google.maps.LatLng(-27.333108,119.47614);i.Map.Initialise({mapDiv:$("#map")[0],center:r,zoom:n.Settings.IsMobile?4:6,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DEFAULT,position:google.maps.ControlPosition.RIGHT_BOTTOM,mapTypeIds:["mrwaRoadmap","mrwaGreyscale","hybrid"]}},i,function(){i.LeftPanel.Initialise(i);i.RightPanel.Initialise(i);i.Footer.Initialise();ko.applyBindings(i);n.Settings.IsMobile||$('[data-toggle="tooltip"]').tooltip();$(".mainsection").LoadingOverlay("hide",{})})}})},t}();n.MapView=t}(Mrwa||(Mrwa={}))