function MarkerClusterer(n,t,i,r){var u,f;this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=n;this.oms_=r;this.markers_=[];this.clusters_=[];this.sizes=[53,56,66,78,90];this.styles_=[];this.ready_=!1;u=i||{};this.gridSize_=u.gridSize||60;this.minClusterSize_=u.minimumClusterSize||2;this.maxZoom_=u.maxZoom||null;this.styles_=u.styles||[];this.imagePath_=u.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=u.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=!0;u.zoomOnClick!=undefined&&(this.zoomOnClick_=u.zoomOnClick);this.averageCenter_=!1;u.averageCenter!=undefined&&(this.averageCenter_=u.averageCenter);this.setupStyles_();this.setMap(n);this.prevZoom_=this.map_.getZoom();f=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var n=f.map_.getZoom();f.prevZoom_!=n&&(f.prevZoom_=n,f.resetViewport())});t&&t.length&&this.addMarkers(t,!1)}function Cluster(n){this.markerClusterer_=n;this.map_=n.getMap();this.gridSize_=n.getGridSize();this.minClusterSize_=n.getMinClusterSize();this.averageCenter_=n.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,n.getStyles(),n.getGridSize())}function ClusterIcon(n,t,i){n.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.styles_=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.setMap(this.map_)}function getMobileOs(){var n=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(n)?"Windows Phone":/android/i.test(n)?"Android":/iPad|iPhone|iPod/.test(n)&&!window.MSStream?"iOS":"unknown"}var AjaxCache,noPanOffEarth;window.loadBlockerApi=window.loadBlockerApi||new function(){var n=[],t=null;this.showSpinner=function(i){i=i||"noId";$.inArray(i,n)==-1&&n.push(i);t||(t=bootbox.dialog({message:"<i class='far fa-spinner fa-spin fa-3x fa-fw'><\/i><span class='sr-only'>"+resources.Loading+"<\/span>",closeButton:!1,className:"loadingModal",show:!0}))};this.hideSpinner=function(i){i=i||"noId";n=jQuery.grep(n,function(n){return n!=i});n.length==0&&t&&(t.modal("hide"),t=null)}};AjaxCache=function(){var t={},n=new Hashtable,r=function(t){var i=n.get(t);return i?(new Date).getTime()<i.cacheTTL?i.data:(n.remove(t),null):null},u=function(t,r,u){n.put(r,new i(t,u))},i;return t.Remove=function(t){n.remove(t)},t.Get=function(n,t,i,f){var e=$.Deferred(),o=r(n);return!f&&o?e=o:(u(e,n,t),$.ajax(i).done(function(t){e.resolve(t);$(document).trigger("layerIconsUpdated",[n,t])}).fail(e.reject)),e.promise()},i=function(n,t){var i={};return i.data=n,i.cacheTTL=(new Date).getTime()+6e4*t,i},t},function(n,t){function w(n,t){for(var i,e,o,u='"'+n+'":',f=t.split(","),r=0;r<f.length;r++){for(i=f[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(e=i.substring(u.length,i.length),i.indexOf(u)==0)return o=e.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,""),o==="true"?!0:!1}return null}var i,c,f,y,e,l,u,o,p,s,r,a=n(".locationBtn"),h=!0,b=function(t,i,r){var f=n("#embedmap").length>0;Modernizr.mq("(min-width: 993px)")||f&&Modernizr.mq("(min-width: 810px)")?(e=google.maps.ControlPosition[resources.MapTypePos],l=google.maps.MapTypeControlStyle[resources.MapTypeStyle],u=google.maps.ControlPosition[resources.MapControlPos],o=google.maps.ControlPosition[resources.MapControlPos],s=google.maps.ControlPosition[resources.TruckerModeMapControlPos],p=google.maps.ControlPosition[resources.MapControlPos],h=resources.UseGoogleMapZoom==="true"):(t||i||r?(e=google.maps.ControlPosition[resources.MobileFirstMapTypePos],u=google.maps.ControlPosition[resources.MobileFirstMapControlPos],o=google.maps.ControlPosition[resources.MobileFirstMapControlPos],s=google.maps.ControlPosition[resources.TruckerModeMobileFirstMapControlPos]):(e=google.maps.ControlPosition[resources.MobileMapTypePos],u=google.maps.ControlPosition[resources.MobileMapTypePos],o=google.maps.ControlPosition[resources.MobileMapControlPos],s=google.maps.ControlPosition[resources.TruckerModeMobileMapControlPos]),l=google.maps.MapTypeControlStyle[resources.MapTypeStyle],p=google.maps.ControlPosition[resources.MobileMapControlPos],h=!0)},ut=function(r,y){var ci=n("#map-canvas"),d=n(".ersLogo").length>0,nt=n("#wtaMap").length>0,li=URI().hasQuery("mode","trucker"),it,yt,pt,wt,ut,bt,rt,ht,ai,ct,vi,kt,dt,gt,ii,ri,ti,yi,vt,si,hi;n(document).trigger("adjustHeightTriggered");it=resources.MobileFirst=="True";b(it,d,nt);yt={mapTypeControlOptions:{style:l,position:e},center:new google.maps.LatLng(r.MapCenter.Latitude,r.MapCenter.Longitude),zoom:r.DefaultZoom,mapTypeId:r.MapTypeId,scaleControl:!0,zoomControl:h,zoomControlOptions:{position:u},fullscreenControl:!1,streetViewControlOptions:{position:u},gestureHandling:"greedy",disableDefaultUI:!r.DisplayControls,styles:[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{visibility:"on"},{gamma:"10.00"},{lightness:"-100"},{weight:"1.13"},{color:"#000080"}]}]};URI().hasQuery("maponly","true")&&(yt.disableDefaultUI=!0,n(".legend-container").hide());pt="off";r.DisplayPOIs&&(pt="on");wt=[{featureType:"all",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:pt}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"on"}]}];ut=wt.slice();ut.push({elementType:"labels.text.fill",stylers:[{color:"#ffffff"}]});ut.push({elementType:"labels.text.stroke",stylers:[{color:"#222222"}]});bt=new google.maps.StyledMapType(ut);rt=new google.maps.StyledMapType(wt,{name:"labels"});i=new google.maps.Map(ci[0],yt);i.overlayMapTypes.push(rt);google.maps.event.addListener(i,"maptypeid_changed",function(){var n=i.overlayMapTypes.getArray(),t=n.indexOf(rt)!=-1?n.indexOf(rt):n.indexOf(bt),r=i.getMapTypeId()=="hybrid"?bt:rt;t!=-1?i.overlayMapTypes.setAt(t,r):i.overlayMapTypes.push(r)});!h&&r.DisplayControls&&(ht=document.createElement("div"),ai=new g(ht,i),ht.index=1,i.controls[u].push(ht));resources.EnableSaveMapView==="true"&&(ct=document.createElement("div"),vi=new SaveMapViewControl(ct,i),ct.index=1,i.controls[u].push(ct));r.DisplayControls&&(kt=document.createElement("div"),ft(kt,i),i.controls[o].push(kt));resources.EnableToggleFullScreenMapBtn==="true"&&(dt=document.createElement("div"),et(dt,i),i.controls[p].push(dt));resources.EnableTruckerMode!=="True"||d?Cookies.remove("_truckerMode"):(gt=document.createElement("div"),li&&Cookies.set("_truckerMode",!0),ot(gt,i),i.controls[s].push(gt));resources.EnableNearby511Kml=="True"&&!d&!nt&&(ii={clickable:!0,suppressInfoWindows:!0,preserveViewport:!0,map:i},ri=new google.maps.KmlLayer(URI(resources.Nearby511Kml).addSearch("t",roundDate(moment(),5).unix()).addSearch("lang",Cookies.get("_culture")).toString(),ii),ri.addListener("click",function(n){f.showInfoWindow(n.featureData.description,null,!0,n.latLng,"Nearby511",null,!1,new google.maps.Size(0,-32))}));google.maps.event.addListenerOnce(i,"idle",function(){var o,e,u,s,h;for(f=new AppHelper(i,r,lt()),c={center:st,map:i,layerSelectorClosed:f.layerSelectorClosed,tileManager:f.tileManager,appHelper:f},t.SetUserRegion=function(n){if(n){var t=[n[0],n[1]];c.center(t,parseInt(n[2]))}},Modernizr.mq("(min-width: 993px)")&&resources.MapLegendDisplayByDefault==="true"&&n(".legend-toggle").trigger("click"),UserCameras=new CameraLocater(c),n(document).trigger("appInitComplete",[c,r]),y&&y(c),o=n(".layerSelection .toggleButton"),e=0;e<o.length+2;e++)u=".panel-collapse."+e,n(u).length>0&&!n(u).hasClass("in")&&(s=u+" input[type=checkbox]",h=n(s).is(":checked"),h&&(n(u).addClass("in"),n(u).parent().find(".fa-plus-circle").removeClass("fa-plus-circle").addClass("fa-minus-circle")))});google.maps.event.addDomListener(t,"resize",function(){var ot=getMobileOs(),f,c,ht,tt,v,ut,rt,y,ft,et;if(ot!=="Android"){d=n(".ersLogo").length>0;nt=n("#wtaMap").length>0;n(t).outerWidth()<993?(n(".draggableWindowContainer").length>0&&n(document).trigger("closeDraggableWindow"),!it||d||nt?ui(nt,d):(n("body").addClass("mobileFirst"),n(".mobileSetting").hide(),n("#layerSelection").hide(),n(".closeSideBar").is(":visible")&&n(".closeSideBar").trigger("click"),n(".showSideBar").is(":visible")?n(".mobileLocationBar").hide():n(".mobileLocationBar").is(":visible")||n(".mobileLocationBar").show(),n(".myCamerasContainer").appendTo(".myCamerasGroup")),n("footer").hide(),k()):(n("body.mobileFirst").length>0&&(n("body").removeClass("mobileFirst"),resources.EnableLocationSearchBar!="True"?(n(".showSideBar").is(":visible")||n(".showSideBar").trigger("click"),n(".mobileLocationBar").is(":visible")&&n(".mobileLocationBar").hide()):resources.OpenDesktopRoutePlannerDefault.toLowerCase()==="true"||t.location.hash.substr(0)=="#:MyRoutes"||t.location.hash.indexOf("#route")!==-1?n(".myRouteBtn").trigger("click"):(a.hide(),n("#sideBar").hide())),n(".mobileSetting").show(),f=n(".myCamerasGroup"),f.is(":visible")&&f.hide(),f.html()!=undefined&&f.html().trim().length>0&&n(".myCamerasGroup .myCamerasContainer").appendTo(".myCamerasRoutePlanner"),n("footer").is(":visible")||d||n("footer").show());var st=e,p=o,w=s;if(b(it,d,nt),st!=e){n(".zoomControlContainer").length<1&&!h&&r.DisplayControls&&(c=document.createElement("div"),ht=new g(c,i),c.index=1,i.controls[u].push(c));tt=i.controls[p].getArray();for(v in tt)if(n(tt[v]).attr("class")=="locateMeContainer"){ut=i.controls[p].getAt(v);i.controls[p].removeAt(v);i.controls[o].push(ut);break}rt=i.controls[w].getArray();for(y in rt)if(n(rt[y]).attr("class")=="truckerModeContainer"){ft=i.controls[w].getAt(y);i.controls[w].removeAt(y);i.controls[s].push(ft);break}et={mapTypeControlOptions:{style:l,position:e},zoomControl:h,zoomControlOptions:{position:u},streetViewControlOptions:{position:u}};i.setOptions(et)}}clearTimeout(t.resizedFinished);t.resizedFinished=setTimeout(function(){n("#routingResults").is(":visible")&&n(document).trigger("checkEventOnRoutePlanner",["windowResize"])},250)});var ui=function(t,i){(t||i)&&(n(".mobileSetting").show(),n(".legend-toggle").show(),n(".bootbox").is(":visible")||n("#layerSelection").hide())},at=i.getStreetView(),ni=n("#backToMapView");google.maps.event.addListener(at,"visible_changed",function(){if(at.getVisible()){at.setOptions({enableCloseButton:!1,fullscreenControl:!1});ni.show();n(ni).on("click",function(){at.setVisible(!1)});n(".showSideBar").addClass("streetViewTop");n(".mobileFirst.sideBarGroup.showSideBar").addClass("streetViewTop")}else ni.hide(),n(".showSideBar").removeClass("streetViewTop")});var fi=!1,ei=!1,tt,oi=n("#avoidTollsCheckBox");oi&&(tt=Cookies.get("map"),tt!=null&&(fi=w("AvoidTolls",tt)),oi.attr("checked",fi));ti=n("#avoidFerriesCheckBox");ti&&(tt=Cookies.get("map"),tt!=null&&(ei=w("AvoidFerries",tt)),ti.attr("checked",ei));resources.StateOutline!=""&&(yi=new google.maps.Polyline({path:google.maps.geometry.encoding.decodePath(resources.StateOutline),strokeColor:"#00000",strokeOpacity:1,strokeWeight:1,map:i}));Modernizr.mq("(max-width: 992px)")?it&&t.location.hash.substr(0)=="#:MyRoutes"&&n(".UIControls .directions").click():resources.OpenDesktopRoutePlannerDefault.toLowerCase()==="true"||t.location.hash.substr(0)=="#:MyRoutes"||t.location.hash.indexOf("#route")!==-1?n(".myRouteBtn").trigger("click"):(a.hide(),n("#sideBar").hide());vt=getMobileOs();vt!="unknown"&&(n(".printRoute").hide(),vt=="iOS"&&n(".twitter.newsContent").addClass("isIos"),vt=="Android"&&n("#ersRegion-Combobox .bs-searchbox, #mobileErsRegion-Combobox .bs-searchbox").hide());k();ui(nt,d);si=resources.EnableTruckerMode;si=="True"&&(hi=Cookies.get("_truckerMode"),hi?v(!0):v(!1))},k=function(){var t=n("body").hasClass("mobileFirst")&&!n(".ersLogo").length>0;isWta=n("#wtaMap").length>0;resources.EnableLocationSearchBar=="True"&&d();Modernizr.mq("(max-width: 992px)")&&t&&!isWta&&(d(),n(".myCamerasContainer").appendTo(".myCamerasGroup"),n("footer").hide())},d=function(){var t=document.getElementById("mapLocation"),f={componentRestrictions:{country:resources.AutocompleteCountryCode.split(",")},fields:["address_component,adr_address,alt_id,formatted_address,geometry,icon,id,name,place_id,plus_code,scope,type,url,utc_offset,vicinity"]},u;t&&(u=new google.maps.places.Autocomplete(t,f),u.bindTo("bounds",i),r=new google.maps.Marker({map:i}),google.maps.event.addDomListener(t,"keydown",function(t){var r,i;t.cancelBubble=!0;(t.keyCode===13||t.keyCode===9)&&(r=n(".pac-item-selected").length>0,r||t.hasRanOnce||(i=new Event("keydown"),i.keyCode=40,i.hasRanOnce=!0,google.maps.event.trigger(t.target,"keydown",i)))}),google.maps.event.addListener(u,"place_changed",function(){r.setVisible(!1);t.className="";var f=u.getPlace();if(!f.geometry){bootbox.dialog({title:resources.InvalidLocation,message:"<div class='alert alert-info'><i class='far fa-exclamation-circle'><\/i>"+resources.SelectValidLocationList+"<\/div>",className:"mapLocationMsg"});return}f.geometry.viewport?i.fitBounds(f.geometry.viewport):(i.setCenter(f.geometry.location),i.setZoom(17));r.setPosition(f.geometry.location);r.setVisible(!0);n(".mobileLocationBar .clearLocateBtn").show()}))},ft=function(i,r){var u,f;i.className="locateMeContainer";u=document.createElement("button");u.className="locateMeBtn btn btn-default";u.setAttribute("id","locateMeBtn");u.setAttribute("type","button");u.setAttribute("title",resources.CurrentLocation);u.setAttribute("aria-label",resources.CurrentLocation);f=document.createElement("i");f.className="fas fa-crosshairs";f.setAttribute("aria-hidden","true");f.setAttribute("title",resources.CurrentLocation);u.appendChild(f);i.appendChild(u);u.addEventListener("click",function(){if(t.GetUserGeolocation==undefined)var i=new UserGeolocation(null,null,null,null,null);t.GetUserGeolocation(function(t){r.panTo(t);n(document).trigger("removeMyLocationMarker");y=new google.maps.Marker({position:t,map:r,title:resources.CurrentLocation,icon:{url:"Content/images/locationDot.png",size:new google.maps.Size(24,24)}});var i=r.getZoom();r.setZoom(12<i?i:12)})});n(document).on("removeMyLocationMarker",function(){y&&y.setMap(null)})},et=function(t){var i,r;t.className="toggleFullScreenMapContainer";i=document.createElement("button");i.className="toggleFullScreenMapBtn btn btn-default";i.setAttribute("id","toggleFullScreenMapBtn");i.setAttribute("type","button");i.setAttribute("title",resources.ToggleFullscreen);i.setAttribute("aria-label",resources.ToggleFullscreen);r=document.createElement("i");r.className="far fa-arrows-alt";r.setAttribute("aria-hidden","true");r.setAttribute("title",resources.ToggleFullscreen);i.appendChild(r);t.appendChild(i);i.addEventListener("click",function(){Modernizr.mq("(min-width: 993px)")&&(n(".navbar, .scrollRow, footer").toggle(),n(document).trigger("fullScreenMapMode"))})},g=function(n,t){var u,i,f,r,e;n.className="zoomControlContainer";u=document.createElement("div");u.className="zoomControl";n.appendChild(u);i=document.createElement("i");i.className="far fa-plus";i.setAttribute("title",resources.ZoomInMap);i.setAttribute("aria-hidden","true");i.setAttribute("tabindex","0");f=document.createElement("span");f.className="sr-only";f.innerText=resources.ZoomInMap;u.appendChild(i);u.appendChild(f);r=document.createElement("i");r.className="far fa-minus";r.setAttribute("title",resources.ZoomOutMap);r.setAttribute("aria-hidden","true");r.setAttribute("tabindex","0");e=document.createElement("span");e.className="sr-only";e.innerText=resources.ZoomOutMap;u.appendChild(r);u.appendChild(e);google.maps.event.addDomListener(i,"click",function(){t.setZoom(t.getZoom()+1)});google.maps.event.addDomListener(i,"keydown",function(){t.setZoom(t.getZoom()+1)});google.maps.event.addDomListener(r,"click",function(){t.setZoom(t.getZoom()-1)});google.maps.event.addDomListener(r,"keydown",function(){t.setZoom(t.getZoom()-1)})},ot=function(t){var i,r,u;t.className="truckerModeContainer";i=document.createElement("button");i.className=Cookies.get("_truckerMode")?"truckerModeBtn btn btn-default active":"truckerModeBtn btn btn-default";i.setAttribute("id","truckerModeBtn");i.setAttribute("type","button");i.setAttribute("title",resources.TruckerMode);i.setAttribute("aria-label",resources.TruckerMode);i.setAttribute("tabindex",0);r=document.createElement("i");r.className="far fa-truck-moving";r.setAttribute("aria-label","true");u=document.createElement("span");u.innerHTML=resources.TruckerMode;r.setAttribute("aria-hidden","true");r.setAttribute("title",resources.TruckerMode);i.appendChild(r);i.appendChild(u);t.appendChild(i);i.addEventListener("click",function(){var t=n(".truckerModeBtn").hasClass("active");t?(Cookies.remove("_truckerMode"),v(!1)):(Cookies.set("_truckerMode",!0),v(!0));n(".truckerModeBtn").toggleClass("active")})},v=function(t){var r=n(".topBanner .socialIcons"),i=n(".TruckerInfoLegendSection ul[id$='-children']");t?(typeof ga!="undefined"&&ga("send","event","TruckerMode","Show"),n(".truckerModeIndicator").show(),r.length>0&&r.addClass("down"),n(".mapLegend > .TruckerInfoLegendSection").is(":first")||nt(!0),i.length>0&&(i.show(),i.find("input[type='checkbox']").show())):(n(".truckerModeIndicator").hide(),r.length>0&&r.removeClass("down"),nt(!1),t=!1,i.length>0&&(i.hide(),i.find("input[type='checkbox']").hide()));n(".TruckerInfoLegendSection label input[type='checkbox']").prop("checked",t);f&&n.each(n(".TruckerInfoLegendSection label input[type='checkbox']"),function(t,i){f.layerToggled(n(i).attr("data-layerid"),!1)})},nt=function(t){var i=n(".TruckerInfoLegendSection .collapse.in").length>0;t?(n(".TruckerInfoLegendSection").insertAfter(".clearAllLayers"),i||n(".TruckerInfoLegendSection .toggleButton").trigger("click")):(n(".TruckerInfoLegendSection").insertBefore(".markerClusterLegend"),i&&n(".TruckerInfoLegendSection .toggleButton").trigger("click"))},st=function(n,t){var r=new google.maps.LatLng(n[0],n[1]);i.panTo(r);t&&i.setZoom(t)},ht=function(n){var i=n.attr("data-icon");if(!i)return null;var r=n.attr("data-iconsize"),u=n.attr("data-iconanchor"),f=n.attr("data-iconorigin"),t={url:i};return r&&(t.size=ct(r)),u&&(t.anchor=tt(u)),f&&(t.origin=tt(f)),t},ct=function(n){var t=it(n);return new google.maps.Size(t[0],t[1])},tt=function(n){var t=it(n);return new google.maps.Point(t[0],t[1])},it=function(n){for(var i=[],r=n.split(","),t=0;t<r.length;t++)i[t]=+r[t];return i},lt=function(){var t={iconDetails:{},apiUrls:{},tooltipBaseUrls:{},tooltipDraggable:{},tooltipSize:{},feed:{},tile:{},icon:{},filterData:{}},i=n("#layerSelection"),r=n("input[type='checkbox'][data-icon], [data-polyline]",i),u=n("input[type='checkbox'][data-feedurl]",i),f=n("input[type='checkbox'][data-tileurlformat]",i);return r.each(function(i,r){var u=n(r),f=u.attr("data-layerId"),o=u.attr("data-hasFilter"),e;t.filterData[f]={layerId:f,hasFilter:o};t.apiUrls[f]=u.attr("data-jsonurl");t.tooltipBaseUrls[f]=u.attr("data-tooltipbaseurl");t.tooltipDraggable[f]=u.attr("data-tooltipdraggable");t.tooltipSize[f]=u.attr("data-tooltipsize")!=null?u.attr("data-tooltipsize"):null;t.icon[f]={minZoom:u.attr("data-minzoom"),maxZoom:u.attr("data-maxzoom")};e=ht(u);e&&(t.iconDetails[f]=e)}),u.each(function(i,r){var u=n(r),f=u.attr("data-layerId");t.feed[f]={url:u.attr("data-feedurl"),clickable:u.attr("data-clickable").toLowerCase()==="true",styleOptions:u.attr("data-styleOptions"),infoWindowTemplate:u.attr("data-infoWindowTemplate"),suppressInfoWindow:u.attr("data-suppressinfowindow").toLowerCase()==="true",type:u.attr("data-type"),cacheTime:u.attr("data-cachetime")}}),f.each(function(i,r){var u=n(r),f=u.attr("data-layerId");t.tile[f]={urlFormat:u.attr("data-tileurlformat"),minZoom:u.attr("data-minzoom"),maxZoom:u.attr("data-maxzoom"),tooltipUrlFormat:u.attr("data-tooltipurlformat"),highwayFill:u.attr("data-highwayfill"),highwayStroke:u.attr("data-highwaystroke"),animationFrames:u.attr("data-animationframes"),startingFrame:u.attr("data-startingframe"),startPlaying:u.attr("data-startPlaying")=="True",opacity:u.attr("data-opacity"),zlevel:u.attr("data-zlevel"),cache:u.attr("data-cache")=="True"}}),t},rt;n(".setToRegion").on("click",function(){var r=n(this).val(),t=r.split(",");i.panTo(new google.maps.LatLng(t[0],t[1]));i.setZoom(parseInt(t[2]))});rt=function(){return i};n("#layerSelection button").on("click",function(){var t=n(this).find("i");t.hasClass("fa-minus-circle")===!0?(t.removeClass("fa-minus-circle"),t.addClass("fa-plus-circle")):(t.addClass("fa-minus-circle"),t.removeClass("fa-plus-circle"))});n(document).on("MapResize",function(){typeof google=="object"&&typeof google.maps=="object"&&google.maps.event.trigger(i,"resize")});n(".myRouteBtn").on("click",function(t,i){Modernizr.mq("(min-width: 993px)")&&!a.is(":visible")&&a.show();var r=n("#mapLocation").val();r.length>0&&n("#endLocationText").val(r);n(".sideBarGroup, #sideBar").show();i==undefined&&n("#RoutesTab > a").trigger("click");n("#startLocationText").focus();n(".mapPage .sideBarColContainer").show();n(".mobileLocationBar").hide()});n(".UIControls .directions").on("click",function(t,i){n(".mobileFirst .mobileSetting").hide();n(".showSideBar").hide();var r=n("#mapLocation").val();r.length>0&&n("#endLocationText").val(r);n(".sideBarGroup").show();n("#sideBar").show();i==undefined&&n("#RoutesTab > a").trigger("click");n("#startLocationText").focus();n(".mapPage .sideBarColContainer").show();n(".mobileLocationBar").hide();n("#routingResults").is(":visible")&&n(document).trigger("checkEventOnRoutePlanner")});n(".clearLocateBtn").on("click",function(){n(this).hide();n("#mapLocation").val("");r&&r.setVisible(!1)});n(".closeSettings").on("click",function(){n(".mobileFirst .mobileSetting").hide();n("#layerSelection").hide()});n(".myCamerasContainer .fa-times, .myCam").on("click",function(){var i=n(".myCamerasGroup");i.is(":visible")?i.hide():(t.DisplayMyCameras(),i.show())});n("#setCurrentLocation").click(function(u){return t.GetUserGeolocation(function(t){r&&r.setVisible(!1);n(document).trigger("removeMyLocationMarker");var u=new google.maps.Geocoder;u.geocode({location:t},function(t,u){u==="OK"?t[0]&&(i.setZoom(17),n("#mapLocation").val(t[0].formatted_address),i.setCenter(t[0].geometry.location),r.setPosition(t[0].geometry.location),r.setVisible(!0),n(".mobileLocationBar .clearLocateBtn").show()):bootbox.alert(resources.CouldNotFindCurrentLocation)})}),u.preventDefault(),!1});n(".navbar-toggle").on("click",function(){var t=n(".myCamerasGroup").is(":visible");t&&n(".UIControls .myCam").trigger("click")});n(document).on("ChangeCursorToWait",function(){i.setOptions({draggableCursor:"wait"})});n(document).on("ChangeCursorToDefault",function(){i.setOptions({draggableCursor:""})});n(document).on("hideLocationMarker",function(){r&&r.setVisible(!1)});t.$mapping={init:ut,map:rt}}($,window);$(window).on("load",function(){var t=$(".emergencyAlertModal.in").length>0,n;if(t||resources.FeatureSlideModal!="True"||$(document).trigger("displayFeatureModal"),n=$("body").hasClass("mobileFirst")&&!$(".ersLogo").length>0,n)$(".featureModal").on("shown.bs.modal",function(){var n=$(".bootbox").is(":visible");n&&$(".featureModal").modal("hide")})});var AppCookie=function(n){var i={},t={selectedLayers:null,prevZoom:null,prevLatLng:null,mapView:null},u=function(){t=this.getCookie();t.selectedLayers=n.SelectedLayers},r=function(){var n=JSON.stringify(t);Cookies.set("map",n,{expires:365,path:"/"})};getCookie=function(){var n=Cookies.get("map");return n&&(t=JSON.parse(n)),t};i.getCookie=getCookie;i.SetLayer=function(n,i){i&&t.selectedLayers.indexOf(n)==-1?t.selectedLayers.push(n):i||(t.selectedLayers=$.grep(t.selectedLayers,function(t){return t!=n}));r()};i.SetMap=function(n,i,u){t.prevLatLng=[n,i];t.prevZoom=u;t.mapView=moment.utc();r()};i.RestoreCheckboxes=function(n,i){$(t.selectedLayers).each(function(t,i){n(i)});i&&i()};$("#avoidTollsCheckBox").on("change",function(){var n=$("#avoidTollsCheckBox").is(":checked");t.AvoidTolls=n;r()});$("#avoidFerriesCheckBox").on("change",function(){var n=$("#avoidFerriesCheckBox").is(":checked");t.AvoidFerries=n;r()});return u(),i},AppEventBinding=function(n){var i=768,u=function(){c();h();f();e();l();var t=$("#embedmap"),i=$("#accessServicesMap");!t.length>0&&!i.length>0?n.appCookie.RestoreCheckboxes(function(n){$("input[type='checkbox'][data-layerid='"+n+"'][disabled!=disabled]",$("#layerSelection")).prop("checked",!0).change();$("ul#"+n+"-children").children(":visible").length>0&&$("ul#"+n+"-children").toggle(!0)},function(){n.layerSelectorClosed(!0)}):n.layerSelectorClosed(!0)},f=function(){var t=$("#layerSelection");$("input[type='checkbox'][data-layerid]",t).bind("click.layerSelectorCheckboxes_cookie",function(){n.appCookie.SetLayer($(this).attr("data-layerid"),$(this).is(":checked"))})},e=function(){var t=n.map,i=function(){var i=t.getCenter(),r=t.getZoom();n.appCookie.SetMap(i.lat(),i.lng(),r)};google.maps.event.addListener(t,"zoom_changed",i);google.maps.event.addListener(t,"dragend",i)},o=function(){var t=$("#layerSelection");$("input[type='checkbox']",t).bind("click.layerSelectorCheckboxes_desktopMode",function(){n.layerToggled($(this).attr("data-layerid"),!1)})},s=function(){var t=$("#layerSelection");$("input[type='checkbox']",t).on("change.layerSelectorCheckboxes_mobileMode",function(){n.layerToggled($(this).attr("data-layerid"),!1)})},h=function(){var n=$(".legend-toggle"),t=$(".settingToggle");$(window).outerWidth()>i?o():s();$(n).on("click",function(t){r(t,n)});$(t).on("click",function(n){r(n,null)})},r=function(t,r){var h=$(".ersLogo").length>0,e=$(".mobileFirst").length>0&&!h,o=$(".wtaPage").length>0,c=$(window).outerWidth(),u=$("#layerSelection"),s,f;u.css("display")=="none"?(resources.ScreenWidthERSLegend!=="768"&&(i=parseInt(resources.ScreenWidthERSLegend)),c>i?(u.attr("class","layerSelection"),$("#legend-container").append(u.detach()),$(".mobileSetting").show()):e?($(".mobileFirst .mobileSetting").show(),u.attr("class","layerSelection"),$("#legend-container").append(u.detach()),o?$(".mobileSetting").addClass("show"):(s=$(".legend-container").outerHeight()+20,adjustLegendHeight(s))):(u.attr("class","layerSelectionModal"),f=u.detach(),bootbox.mapPageDialog({message:" ",animate:!1,closeButton:!1,buttons:{main:{label:resources.OK,className:"btn-info",container:".map-container",callback:function(){r.trigger("click");$("#legend-container").append(f);n.layerSelectorClosed(!0)}}}}),bootbox.setDialogToJqueryObj(f.show())),$(".mapFiltersContainer").css("display")=="block"&&$(".layerSelection").addClass("expand"),u.show(),t.preventDefault()):(t.preventDefault(),u.hide(),e&&$(".mobileFirst .mobileSetting").hide(),o&&$(".mobileSetting").removeClass("show"))},t=$(".locationBtn"),c=function(){$(".hideSideBar").click(function(){$(".mapPage .sideBarColContainer").hide();$(".mapColContainer").toggleClass("full");t.length>0&&t.addClass("shiftLeft");$(".showSideBar").show(100);n.resizeMap()});$(".showSideBar").click(function(){$(".showSideBar").hide(100);t.length>0&&t.removeClass("shiftLeft");$(".mapPage .sideBarColContainer").show();$(".mapColContainer").toggleClass("full");n.resizeMap()});$(".closeSideBar, .locationBtn").on("click",function(){$(document).trigger("clearUserRouteTrigger");t.length>0&&(t.hide(),t.removeClass("shiftLeft"));$(".showSideBar").hide();$(".mapPage .sideBarColContainer").hide();$(".mapColContainer").toggleClass("full");$(".mobileLocationBar").show();$("#mapLocation").val("").focus();n.resizeMap()})},l=function(){var n=$("#layerSelection"),t=$("input[type='checkbox'][data-icon],input[type='checkbox'][data-feedurl],input[type='checkbox'][data-tileurlformat]",n);t.each(function(n,t){var r=$(t),u=r.attr("data-layerId"),i=$("ul#"+u+"-children");i.length&&$(t).change(function(){var n=this.checked,r=$(this).attr("data-dontselectchildlayers"),t,u;r!=undefined&&r.toLowerCase()==="true"&&n?(t=$(i[0].children[0]).find("input"),i[0].children.length>1&&(n&&!t.is(":checked")||!n&&t.is(":checked"))&&t.click()):i.children().each(function(){var t=$(this).find("input");(n&&!t.is(":checked")||!n&&t.is(":checked"))&&t.click()});u=i.find("input");i.hide();u.each(function(){var t=$(this);n?t.attr("data-visible")=="True"&&(t.show(),i.show()):t.hide()})})})};u()},AppHelper=function(n,t,i){var bt=i.iconDetails,kt=i.apiUrls,ut=i.tooltipBaseUrls,ft=i.tooltipDraggable,y=i.tooltipSize,dt=i.feed,gt=i.tile,et=i.icon,h=new Hashtable,ot=365,k,st,d,g=!1,u,c,e,p,f=new google.maps.InfoWindow({maxWidth:ot}),ni='<div id="infoWindowLoading">'+resources.Loading+"<\/div>",l,r={},ti,ht,w={},a,ct,lt=!1,ii=function(){ct=new OverlappingMarkerSpiderfier(n,{markersWontMove:!1,markersWontHide:!1,keepSpiderfied:!0,nearbyDistance:10});st={maxZoom:t.ClustererModel.MaximumZoom,minimumClusterSize:t.ClustererModel.MinimumClusterSize,gridSize:t.ClustererModel.GridSize,title:resources.AClusterOfIcons,imagePath:"/Content/images/markerClustererPlus/m"};k=new MarkerClusterer(n,[],st,ct);k.setCalculator(function(n,t){for(var i=0,u=n.length.toString(),r=u;r!==0;)r=parseInt(r/10,10),i++;return i==3&&(i=2),resources.MarkererIndexOveride&&(i=resources.MarkererIndexOveride),i=Math.min(i,t),{text:u,index:i,title:""}});d=new AjaxCache;u=new IconManager(n,k);r.iconManager=u;c=new TileManager(n,r);r.tileManager=c;e=new PolylineManager(n);$(document).trigger("polylineManagerReady-appHelper",[e,it]);p=new KmlManager(n,r);r.kmlManager=p,function(){ht=new AppCookie(t,pi())}();ti=new AppEventBinding(function(){return r.appCookie=ht,r.layerSelectorClosed=at,r}());li();$(document).trigger("appHelperInitComplete")},ri=function(n){var u,i,t,r;for(u in n)i=n[u],i.hasFilter=="True"&&typeof FilterDataTableParams!="undefined"&&(t=new FilterDataTableParams(1,0,25,!0,null),t.search=new FilterDataTableSearchParam,t.search.objValue=null,t.search.regex=!1,t.search.searchOnColumn=!1,t.search.value=null,t.order[0]=new FilterDataTableOrderParam,t.order[0].column=0,t.order[0].dir="asc",r=new ColumnFilters("map-filter-div",i.layerId,"List/UniqueColumnValuesForErsEvents/{typeId}",t),r.initListColumnFilters(),w[i.layerId]=r)},at=function(n){var t=$("input[type='checkbox'][data-layerid]","#layerSelection");t.each(function(n,t){vt($(t).attr("data-layerid"),!0)});wt(n,!0)},vt=function(t,i){var f=$("#layerSelection"),l=function(n,r,u){var e=$(n),o,f;if(h.containsKey(t)||h.put(t,!1),e.is(":checked")){if(h.get(t)==!1){if(h.put(t,!0),r(),e.attr("data-conflicts"))for(o=e.attr("data-conflicts").split(","),f=0;f<o.length;f++)$("input[type='checkbox'][data-layerid='"+o[f]+"']:checked",$("#layerSelection")).click();i||typeof ga=="undefined"||ga("send","event","MapLayer",t);$(document).trigger("mapLayerToggle",[t,!0])}}else h.get(t)==!0&&(h.put(t,!1),u(),ft[t]=="true"&&$(document).trigger("closeDraggableWindow"),$(document).trigger("mapLayerToggle",[t,!1]))},r=$('input[type="checkbox"][data-layerid="'+t+'"]',f);r.is('[data-polyline="true"]')?l(r[0],function(){e.AddPolylineLayer(t,[],$(r[0]).data("polylineopacity"),$(r[0]).data("polylineweight"),0,20,function(n,i,r){var u=nt(t,r,i).done(function(t){var f=[],i=t.item2,r,u;for(r in i)i[r].polyline&&(u=null,i[r].polyline.symbolJSON&&(u=JSON.parse(i[r].polyline.symbolJSON)),f.push({id:i[r].itemId,lineColor:i[r].polyline.color,decodedPoints:google.maps.geometry.encoding.decodePath(i[r].polyline.path),icons:u}));n(f)})},w[t],r.is("[data-icon]")?!0:!1);$(document).on("layerRefreshed-polylineManager."+t,function(i,f){f==t&&($(document).off("layerRefreshed-polylineManager."+t),r.is("[data-icon]")&&(u.AddIconLayer(t,[],nt,function(t,i){var r=yt(t,i);return i.polyline&&r.addListener("marker-clustered",function(){var f=e.GetPolylines(t),o,u;for(o in f)if(u=f[o],u.sourceData.id==i.itemId){r.clustered?(u.gMapLine.setMap(null),u.gMapLine.canDraw=!1):(u.gMapLine.setMap(n),u.gMapLine.canDraw=!0);break}}),r},w[t],et[t]),u.RefreshLayer(t).done(u.Redraw)))});e.RefreshLayer(t);$("#legend-icon-"+t,f).toggle(!0)},function(){e.RemovePolylineLayer(t);u.RemoveIconLayer(t);i||u.Redraw();$(document).off("layerRefreshed-polylineManager."+t);$("#legend-icon-"+t,f).toggle(!1);t==a&&s()}):r.is("[data-icon]")?l(r[0],function(){u.AddIconLayer(t,[],nt,yt,w[t],et[t]);i||u.RefreshLayer(t).done(u.Redraw);$("#legend-icon-"+t,f).toggle(!0)},function(){o.indexOf(t)==0&&(o="");u.RemoveIconLayer(t);$("#legend-icon-"+t,f).toggle(!1);i||u.Redraw();t==a&&s()}):r.is("[data-feedurl]")?l(r[0],function(){p.AddLayer(t,dt[t]);$("#legend-feed-"+t,f).toggle(!0)},function(){t==a&&v()&&s();p.RemoveLayer(t);$("#legend-feed-"+t,f).toggle(!1)}):r.is("[data-tileurlformat]")&&l(r[0],function(){c.AddTileLayer(t,gt[t]);$("#legend-tile-"+t,f).toggle(!0)},function(){c.RemoveTileLayer(t);t==a&&v()&&s();$("#legend-tile-"+t,f).toggle(!1)})},nt=function(n,t,i){var u=kt[n],r={type:"GET",url:u,dataType:"json",timeout:3e4,tryCount:0,retryLimit:3,error:function(n,t){if(t=="timeout"){if(this.tryCount++,this.tryCount<=this.retryLimit){$.ajax(this);return}var i=this;Bugsnag.notify("AjaxError",function(n){n.context=t+" "+i.url.split("?")[0];n.setMetadata("ajaxData",{url:i.url,type:i.type,data:i.data?JSON.parse('{"'+decodeURIComponent(i.data).replace(/\+/g," ").replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}'):{}})})}}};return i!=null&&(r.type="POST",r.data=JSON.stringify(i.getFilter()),r.contentType="application/json",r.url+="?time="+$.now()),d.Get(n,.5,r,t)},ui=function(n){if(n==undefined)return null;var t=n.split("/"),i=t.splice(t.length-1,1)[0];return t.join("/")+"/plus/"+i},yt=function(n,t){var u=new google.maps.LatLng(t.location[0],t.location[1]),i=new google.maps.Marker({clickable:t.icon.isClickable,position:u,title:t.title,zIndex:t.zindex,preventClustering:t.icon.preventClustering}),r=pt(n,t);return r&&i.setIcon(r),google.maps.event.addListener(i,"spider_format",function(r){var u=pt(n,t),f=r==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIED?u.url:r==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIABLE?ui(u.url):r==OverlappingMarkerSpiderfier.markerStatus.UNSPIDERFIABLE?u.url:null;u&&(u.url=f,i.setIcon(u))}),ut[n]!=""&&(fi(i,t,n),resources.TooltipDisplayOnHover==="true"&&ei(i,t,n)),i},pt=function(n,t){if(t.icon.json)return JSON.parse(t.icon.json);if(t.icon){var i=t.icon;return{url:i.url,size:new google.maps.Size(i.size[0],i.size[1]),anchor:new google.maps.Point(i.anchor[0],i.anchor[1]),origin:new google.maps.Point(i.origin[0],i.origin[1]),scaledSize:new google.maps.Size(i.size[0],i.size[1])}}return bt[n]},fi=function(n,t,i){google.maps.event.addListener(n,"spider_click",function(){it(i,t.itemId,n);$(document).trigger("marker-click",[r,i,t.itemId,n])})},tt,ei=function(n){google.maps.event.addListener(n,"mouseover",function(){tt=setTimeout(function(){google.maps.event.trigger(n,"click")},500)});google.maps.event.addListener(n,"mouseout",function(){tt&&clearTimeout(tt)})},b=null,o="",it=function(n,t,i,u){var f=n+t;if(!v()||f!==o){$(document).trigger("closeDraggableWindow");v()&&s();o=f;resources.CctvEnableVideo=="True"&&$(document).trigger("CallRemoveVideo");hi();var e=Cookies.get("_culture")?Cookies.get("_culture"):"",h=URI.expand(ut[n],{layerId:n,id:t,lang:e}).toString(),c=$(window).width()<768;lt=ft[n]=="true"&&!c;rt(ni,i,!0,u,n,!1);$(document).trigger("ShowInfoWindow",[r,n,t,i,u]);$.ajax({url:h,success:function(t){o==f&&rt(t,i,!1,u,n,lt)}})}};$(document).on("info-content-trigger",function(n,t,i){t===resources.MessageSignsLayerId&&oi();typeof i!="undefined"&&((i.indexOf("cctvImage")!=-1||i.indexOf("cctvCameraCarousel")!=-1)&&$(document).trigger("cameraImagesInitialized"),i.indexOf("data-convert-from-utc")!=-1&&$(document).trigger("update-time-to-locale"))});$(document).on("update-time-to-locale",function(){$("[data-type='time']").each(function(n,t){var i=$(t),r=i.html(),u=moment.utc(r).local().format("M/D/YYYY h:mm A");i.html(u)})});var oi=function(){clearInterval(b);$(".msgContent div").length>1&&(b=setInterval(function(){for(var n=$(".msgContent").children(),r=n.length,i=!1,t=0;t<r;t++)if($(n[t]).hasClass("hide")){if(i==!0){$(n[t]).toggleClass("hide");i=!1;break}}else $(n[t]).toggleClass("hide"),i=!0;i==!0&&$(n[0]).toggleClass("hide")},2500))},si=function(){clearInterval(b);b=null},hi=function(){si();$(document).trigger("cameraImagesClearIntervals")};google.maps.event.addListener(f,"closeclick",function(){s()});$(document).on("hidden.bs.modal",".bootbox.modal",function(){google.maps.event.trigger(f,"closeclick")});$(document).on("layer-changed",function(n,t){t=="MyCameras"&&d.Remove(t);u.RefreshLayer(t,!0).done(u.Redraw);e.RefreshLayer(t,!0)});var wt=function(n,t){n||loadBlockerApi.showSpinner("refreshMapData");var i=0;$(document).on("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper",function(){++i==2&&(loadBlockerApi.hideSpinner("refreshMapData"),$(document).unbind("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper"))});$(document).on("layersRefreshed-iconManager.appHelper",function(){u.Redraw();$(document).unbind("layersRefreshed-iconManager.appHelper")});u.RefreshLayers();e.RefreshLayers();t||c.RefreshLayers()},ci=function(n){n||loadBlockerApi.showSpinner("repaintMap");var t=0;$(document).on("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper",function(){++t==2&&(loadBlockerApi.hideSpinner("repaintMap"),$(document).unbind("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper"))});u.MapChanged();u.Redraw();e.MapChanged()},li=function(){var t={timer:null,refreshData:!1},i=function(n){n&&(t.refreshData=n);clearTimeout(t.timer);t.timer=setTimeout(function(){t.refreshData?wt(!0):ci(!0);t.timer=null;t.refreshData=!1},300)};setInterval(function(){vi()&&i(!0)},61e3);google.maps.event.addListener(n,"zoom_changed",function(){s();i(!1);resources.MinimumZoom>0&&n.getZoom()<resources.MinimumZoom&&n.setZoom(Number(resources.MinimumZoom))});google.maps.event.addListener(n,"bounds_changed",function(){i(!1)});google.maps.event.addListener(n,"dragstart",function(){g=!0});google.maps.event.addListener(n,"dragend",function(){g=!1});noPanOffEarth(n)},ai=function(n){return $('input[type="checkbox"][data-layerId="'+n+'"]').is(":checked")},vi=function(){var n=bootbox.isOpen();return!n&&!g},v=function(){return f.getMap()?!0:!1},rt=function(t,i,r,u,e,s,h,c){var tt,it,p,ft,rt,b,k,d,g,nt,et;if(a=e,e&&t!=="")if(tt=y[e]&&y[e].length>0?parseInt(y[e]):ot,google.maps.event.addListenerOnce(f,"domready",function(){t&&t!=""&&!r&&$(document).trigger("info-content-trigger",[e,t])}),it=$(window).width()>992,p=f,s&&it?(f.close(),ft=CreateDraggableInfoWindow(l),rt=i!=null?i:new google.maps.Marker({position:u}),l=new ft(n,rt,e,t,tt,function(){t&&t!=""&&($(document).trigger("info-content-trigger",[e,t]),bi(y[e],e,p,s))}),l.position=rt.position,l.content=t,p=l):f.setContent(t),bootbox.setDialogContent(t),p.maxWidth=tt,r)if(it){i||h?s?(f.close(),p.position=u!=undefined?u:i.position):f.setOptions({position:u,pixelOffset:{height:0}}):(c||(c={height:-32}),f.setOptions({position:u,pixelOffset:c}));i&&i.latLngs?(f.setOptions({position:new google.maps.LatLng(i.defaultPosition.lat(),i.defaultPosition.lng())}),f.open(n)):s||($(document).trigger("closeDraggableWindow"),f.open(n,i));e===resources.MessageSignsLayerId&&$(document).trigger("MsgSignMapTooltipTriggered");var ut=new google.maps.LatLngBounds,st=n.getZoom(),ht=360/Math.pow(2,st),w=ht/256,ct=$(".col-md-12.mapColContainer").length>0;ct&&(b=p.position.lng()-w*(p.maxWidth+85)/2,k=$("#sideBarColContainer"),k&&k.is(":visible")&&(b=b-w*k.outerWidth(!0)),ut.extend(new google.maps.LatLng(p.position.lat(),b)));d=$("#layerSelection");g=p.position.lng()+w*(p.maxWidth+55)/2;d&&d.is(":visible")&&(g=g+w*d.outerWidth(!0));ut.extend(new google.maps.LatLng(p.position.lat(),g));n.panToBounds(ut)}else bootbox.isOpen()||bootbox.mapPageDialog({message:t,animate:!1,buttons:{main:{label:resources.OK,className:"btn-info"}}});else if(v())if(nt=$(".map-tooltip table img:not(.agencyLogo)"),et=o,nt.length)nt.on("load",function(){et==o&&(f.open(n,i),nt.off("load"))});else f.open(n,i);else s||t&&t!=""&&$(document).trigger("info-content-trigger",[e,t])},s=function(){resources.CctvEnableVideo=="True"&&$(document).trigger("CallRemoveVideo");$(document).trigger("closeDraggableWindow");f.close();o="";$(document).trigger("info-window-close")},yi=function(){o=""};$(document).on("callCloseInfoWindow",s);var pi=function(){var n=$("input[type='checkbox'][data-layerid]",$("#layerSelection"));return $.makeArray(n.map(function(){return $(this).attr("data-layerid")}))},wi=function(){google.maps.event.trigger(n,"resize")},bi=function(t,i,r,u){var o;if(resources.MapControlPos=="TOP_CENTER"||u&&r.content.indexOf("infoWindowLoading")==-1){var s=new google.maps.LatLngBounds,h=n.getZoom(),c=360/Math.pow(2,h),e=c/256,l=u?$(".draggableWindowContainer .draggableWindow").outerHeight()/1.5:$(".gm-style-iw").outerHeight()/2,f=r.position.lat()+e*l,a=t>500||i===resources.WeatherForecastLayerId||i===resources.CamerasLayerId||i===resources.MyCamerasLayerId,v=a?280:100;u&&(f=f+e*v);o=$(".zoomControlContainer");o.is(":visible")&&(f=f+e*o.outerHeight(!0));s.extend(new google.maps.LatLng(f,r.position.lng()));n.panToBounds(s)}};return r.map=n,r.resizeMap=wi,r.isLayerIdChecked=ai,r.layerSelectorClosed=at,r.layerToggled=vt,r.showInfoWindow=rt,r.showInfoWindowForItem=it,r.closeInfoWindow=s,r.clearInfoWindowId=yi,ri(i.filterData),ii(),r},setupSlickCarousel=function(n){var t=$(n).closest(".cctvCameraCarousel"),i,r;if($(t).hasClass("slick-initialized"))Modernizr.mq("(max-width: 992px)")&&(i=$(".bootbox-body .map-tooltip").outerWidth()-10,i>0&&($(".bootbox-body .slick-initialized, .bootbox-body .slick-slide").css("width",i+"px"),$(t).slick("setPosition")));else{r=$(t).slick({dots:!0,arrows:!0,autoplay:!0,lazyLoad:"ondemand",autoplaySpeed:1e4,accessibility:!0,infinite:!1});$(t).on("beforeChange",function(n,t,i,r){var f=$(t.$slides.get(r)),u=$("img",f);u.attr("data-needsrefresh")=="true"&&u[0].hasAttribute("src")&&(u.attr("src",URI(u.attr("src")).hash((new Date).getTime())),u.attr("data-needsrefresh","false"))})}$(n).removeClass("carouselCctvImage")},setUpImageSlide=function(n,t){var e,i,r,f,u;n.$slides.length>0&&(i=$("img",$(n.$slides.get(t))),r=i.data("title"),r?($("#myCameraTitle").text(r),f=i.data("id"),$("#myCameraLocation").show(),$("#myCameraLocation").attr("href","#camera-"+f)):$("#myCameraLocation").hide(),i.attr("data-lazy",URI(i.data("url")).hash((new Date).getTime())),u=i.data("refresh-rate"),u>0?e=setInterval(function(n){var t=$("#"+n);t.attr("src",URI(t.data("url")).hash((new Date).getTime()))},u,i.attr("id")):typeof Bugsnag!="undefined"&&Bugsnag.notify("Undefined refreshRateMs",function(n){n.setMetadata("html",$("<div/>").append(i.clone()).html())}))};"use strict";var UserCameras=null,LatLng=function(){function n(){}return n}(),CameraLocater=function(){function n(n){var t=this;this.appPublicApi=n;this.map=this.appPublicApi.map;$(document).on("hashChanged-urlHash",function(){var n=urlHash.hash(),i;n&&n.toLowerCase().lastIndexOf("camera-",0)==0?(i=decodeURIComponent(t.getUrlHashAsId()),i&&t.zoomToCamera(i,"Camera","Cameras")):n&&n.indexOf("-")>-1&&t.zoomToObject(t.getUrlHashAsId(),n.split("-")[0])})}return n.prototype.zoomToObject=function(n,t){var i=this,f=$("input[type='checkbox'][data-layerid=\""+t+'"]',$("#layerSelection")),r,u,e;f.is(":checked")?this.appPublicApi.appHelper.iconManager.RefreshLayer(t,!0):(r=f.attr("data-parent"),r?(u=$("input[type='checkbox'][data-layerid=\""+r+'"]',$("#layerSelection")),u.click(),e=u.attr("data-dontselectchildlayers"),e==="True"&&$("input[type='checkbox'][data-layerid=\""+t+'"]',$("#layerSelection")).click()):$("input[type='checkbox'][data-layerid=\""+t+'"]',$("#layerSelection")).click());$(document).on("layerIconsUpdated",function(r,u,f){var e,o,s;u==t&&(n=decodeURIComponent(n),e=f.item2.filter(function(t){return t.itemId==n}),e.length==1&&(o=new google.maps.LatLng(e[0].location[0],e[0].location[1]),i.map.panTo(o),s=i.map.getZoom(),$(window).width()>992?s<13&&i.map.setZoom(13):s<17&&i.map.setZoom(17),i.appPublicApi.appHelper.showInfoWindowForItem(u,n,null,o,u),$(document).off("layerIconsUpdated")))})},n.prototype.zoomToCamera=function(n,t,i){var r=this;$.ajax("/"+t+"/GetLatLng?id="+n,{type:"POST"}).done(function(n){var u,f;n&&n.latitude&&n.longitude&&(u=new google.maps.LatLng(n.latitude,n.longitude),r.map.panTo(u),f=r.map.getZoom(),$(window).width()>992?(f<13&&r.map.setZoom(13),r.appPublicApi.appHelper.showInfoWindowForItem(i,n.id,null,u),urlHash.hash(t)):(f<17&&r.map.setZoom(17),r.appPublicApi.appHelper.showInfoWindowForItem(i,n.id,null,u),urlHash.hash("map-col-container")),$("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection")).is(":checked")||($("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection")).click(),r.appPublicApi.appHelper.layerToggled(i,!1)))})},n.prototype.getUrlHashAsId=function(){var n=urlHash.hash();return n.substring(n.indexOf("-")+1)},n.prototype.setUrlHashAsObjectId=function(n,t){var i="{0}-{1}".replace("{0}",t||"");i=i.replace("{1}",n||"");urlHash.hash(i)},n}();$(function(){function u(n,t,i,u,f,e,o,s){var l=n+"-video",h=document.getElementById(f),c=h.getAttribute("data-videourl"),v=h.getAttribute("data-videoauth"),a=h.getAttribute("data-streamtype"),y=h.getAttribute("data-cameraid");v!=="true"&&c&&c!=""?r(h,t,i,u,l,c,a,e,o,s):$.ajax("/Camera/GetVideoUrl?cameraId="+y,{type:"GET",cache:!1}).done(function(n){typeof n=="object"?$.ajax(resources.CameraVideoUrl,{type:"POST",cache:!1,data:JSON.stringify(n),contentType:"application/json"}).done(function(n){r(h,t,i,u,l,c+n,a,e,o,s)}):r(h,t,i,u,l,n,a,e,o,s)})}function r(n,t,i,r,u,f,o,s,c,l){function d(){if(a!=null&&document.getElementById(u)==null){try{a.dispose()}catch(n){}a=null}}function b(){d();a!=null&&setTimeout(function(){b()},5e3)}var k=h(u,f,o),v,a,y,p,w;if(videojs.addLanguage("en",{"No compatible source was found for this media.":window.resources.IE8ErrorMessage}),n.appendChild(jQuery.parseHTML(k)[0]),a=videojs(document.getElementById(u),{width:c,height:l}),$(n).children("div.video-js").css({width:c+"px",height:l+"px"}),b(),this.errorFunction=function(){videoElement=document.getElementById(u);var t=videojs(videoElement);!t.error().code==4&&(t.dispose(),errorHtml="<img src='"+resources.CctvVideoCustomErrorImage+"' style='display:block;width:100%'>",n.appendChild(jQuery.parseHTML(errorHtml)[0]))},resources.CctvVideoCustomErrorImage)a.on("error",errorFunction);v=document.getElementById(t);y=$(s)[0];p=$(s).next()[0];e()&&(w=$(".child div[id='"+n.id+"']"),w.length<2&&$(w).html($(n).children()),v=$(".child img[id='"+t+"']")[0],y=$(".child button[id='"+i+"']")[0],p=$(".child button[id='"+r+"']")[0]);v.style.display="none";y.style.display="none";p.style.display="inline";$(s).parent().prevUntil("video-js").children().css({width:c+"px"})}function t(n,t,i,r,u,f){var a=n+"-video",s,h,c,l,o;for(s=document.getElementById(a),h=document.getElementById(t),c=$(f).prev()[0],l=$(f)[0],e()&&(h=$(".child img[id='"+t+"']")[0],c=$(".child button[id='"+i+"']")[0],l=$(".child button[id='"+r+"']")[0]),s!=null&&videojs(s).dispose(),o=document.getElementById(u);o.firstChild;)o.removeChild(o.firstChild);h.style.display="block";c.style.display="inline";l.style.display="none"}function h(n,t,i){return'<video id="'+n+'" class="video-js vjs-default-skin" preload="auto" autoplay data-setup=\'{ }\'>\t<source src="'+t+'" type="'+i+'" /> \n\t\t<p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video<\/p>\n<\/video>'}function c(){var n=$(".map-tooltip video");n.length>0&&$(n).each(function(){var n=$(this).parent().attr("id"),t=videojs(document.getElementById(n));t.dispose()})}function f(n){var t=$(n+".slick-initialized");typeof t!="undefined"&&t.length>0&&t.slick("slickSetOption","autoplay",!1).slick("slickPause")}function i(n){var t=$(n+".slick-initialized");typeof t!="undefined"&&t.length>0&&t.slick("slickSetOption","autoplay",!0).slick("slickPlay")}function e(){return $(".child .cctvImage").length>0}var n=[],o=function(n){i(".cctvCameraCarousel");document.getElementById(n+"-video")&&t(n,n+"img","showVideo-"+n,"hideVideo-"+n,n+"-videoContainer",$(document).find("[id='hideVideo-"+n+"']"))},s=function(n){i(".cameraCarousel");document.getElementById(n+"-video")&&t(n,n+"img","showVideo-"+n,"hideVideo-"+n,n+"-videoContainer",$(document).find("[id='hideVideo-"+n+"']"))};$(document).on("click",".showVideo",function(){if(typeof videojs!="undefined"){f(".cctvCameraCarousel");var r=$(this).parent().parent().find(".cctvImage"),i=r.width(),e=r.height(),t=$(this).data("camera-id");i==undefined&&(i=parseInt(resources.CamTooltipMaxWidth));u(t,t+"img","showVideo-"+t,"hideVideo-"+t,t+"-videoContainer",this,i,e);resources.EnableVideoTimeout=="True"&&(clearTimeout(n[t]),n[t]=setTimeout(function(){o(t)},parseInt(resources.VideoTimeoutInMilliseconds)))}});$(document).on("click",".hideVideo",function(){if(typeof videojs!="undefined"){i(".cctvCameraCarousel");var r=$(this).data("camera-id");resources.EnableVideoTimeout=="True"&&(clearTimeout(n[r]),n[r]=null);t(r,r+"img","showVideo-"+r,"hideVideo-"+r,r+"-videoContainer",this)}});$(document).on("click",".showMyVideo",function(){if(typeof videojs!="undefined"){f(".cameraCarousel");var i=$(this).parent().parent().find(".myCamImg"),r=i.width(),e=i.height(),t=$(this).data("camera-id");u(t+"my","carouselId-"+t,"showMyVideo-"+t,"hideMyVideo-"+t,t+"-myVideoContainer",this,r,e);resources.EnableVideoTimeout=="True"&&(clearTimeout(n[t]),n[t]=setTimeout(function(){s(t)},parseInt(resources.VideoTimeoutInMilliseconds)))}});$(document).on("click",".hideMyVideo",function(){if(typeof videojs!="undefined"){i(".cameraCarousel");var r=$(this).data("camera-id");resources.EnableVideoTimeout=="True"&&(clearTimeout(n[r]),n[r]=null);t(r+"my","carouselId-"+r,"showMyVideo-"+r,"hideMyVideo-"+r,r+"-myVideoContainer",this)}});$(document).on("CallRemoveVideo",c)});var ContextMenu=function(){function n(n,t){var i=this;this.onRightClick=function(n){i.contextMenu.hide();var t=n.pixel.x,r=n.pixel.y,u=n.latLng,f=i.helper.populateMenu(i.contextMenu,t,r,u,i.displayMenu)};this.displayMenu=function(n,t,r,u){i.contextMenu.empty();i.contextMenu.append(n);i.contextMenu.append('<li class="divider"><a href="#resetMarkers" class="list-group-item"><i class="far fa-redo"><\/i>'+resources.StartOver+'<\/a><\/li><li><a href="#zoomIn" class="list-group-item"><i class="far fa-plus"><\/i>'+resources.ZoomIn+'<\/a><\/li><li><a href="#zoomOut" class="list-group-item"><i class="far fa-minus"><\/i>'+resources.ZoomOut+'<\/a><\/li><li><a href="#centerMap" class="list-group-item"><i class="far fa-compress-alt"><\/i>'+resources.CenterHere+"<\/a><\/li>");i.setUpMenuEventHandlers(u);var f=$(i.map.getDiv());t>f.width()-i.contextMenu.width()&&(t-=i.contextMenu.width());r>f.height()-i.contextMenu.height()&&(r-=i.contextMenu.height());i.contextMenu.css({top:r,left:t}).fadeIn(300)};this.AddWaypointToContextMenu=function(n){i.helper.AddWaypointToContextMenu(n)};this.setUpMenuEventHandlers=function(n){i.contextMenu.find("a").click(function(t){t.preventDefault();var r=$(t.target).attr("href").substr(1),u=i.possiblyParseInt(r);if(u!=null)i.helper.doAction(i.contextMenu,t,u);else{i.contextMenu.fadeOut(75);switch(r){case"resetMarkers":i.helper.resetMarkers(i.contextMenu);break;case"zoomIn":i.map.setZoom(i.map.getZoom()+1);i.map.panTo(n);break;case"zoomOut":i.map.setZoom(i.map.getZoom()-1);i.map.panTo(n);break;case"centerMap":i.map.panTo(n)}}});i.helper.setupEventHandlers(i.contextMenu)};this.possiblyParseInt=function(n){try{var t=parseInt(n);return isNaN(t)?null:t}catch(i){return null}};this.helper=t;this.contextMenu=$(document.createElement("ul")).attr("id","contextMenu");this.contextMenu.bind("contextmenu",function(){return!1});this.map=n;$(n.getDiv()).append(this.contextMenu);$.each("click dragstart zoom_changed maptypeid_changed".split(" "),function(t,r){google.maps.event.addListener(n,r,function(){i.contextMenu.hide()})});google.maps.event.addListener(n,"contextmenu",this.onRightClick)}return n}(),CreateDraggableInfoWindow=function(n){function y(t,i,e,o,h,c){var l,a;f=i;t=t;s=c;l=$("#map-canvas").outerHeight()-180;l=l>400?400:l;a=o.indexOf("infoWindowLoading")!==-1;a||(o=o.replace('map-tooltip"','map-tooltip" style="max-height:'+l+'px"'));draggableContent='<div class="draggableWindowContainer" style="width: '+h+'px;"><div class="draggableWindow">'+o+'<button class="fal fa-times closeDraggableWindow" aria-label="Close"><\/button><\/div><\/div>';n=new r(t,f.getPosition(),draggableContent);u=new google.maps.Polyline({strokeColor:"#999",strokeOpacity:1,strokeWeight:2,map:t})}function r(n,t,i){typeof draw=="function"&&(this.draw=draw);this.setValues({position:t,container:null,content:i,map:n})}function p(){u&&u.setMap(null)}function w(i,r){if(i&&n){var f=r.getProjection().fromDivPixelToLatLng(new google.maps.Point(t.x-e,t.y-40)),o=[i.getPosition(),f];u.setPath(o)}}var f,u,s,i,e,h,t,o;$(document).on("closeDraggableWindow",function(){resources.CctvEnableVideo=="True"&&$(document).trigger("CallRemoveVideo");n&&n.container!=null&&n.onRemove();$(document).trigger("info-window-close")});var c=function(n,t,i,r,u){google.maps.event.addDomListener(t,r,function(t){var r=t.changedTouches?t.changedTouches.item(n.touchTracker):null;(r!=null||t.type!="touchcancel")&&google.maps.event.trigger(i,u,t)})},l=function(n,r,u,s){return google.maps.event.addDomListener(r,s,function(r){var s=r.changedTouches?r.changedTouches.item(n.touchTracker):null;(s!=null||r.type!="touchmove")&&(s!=null&&$(document.elementFromPoint(s.pageX,s.pageY)).parents(".draggableWindow").length==0&&google.maps.event.trigger(u,"touchend",r),r.preventDefault(),i=n.get("origin"),originTouch=i.changedTouches?i.changedTouches.item(n.touchTracker):null,e=r.type=="touchmove"?originTouch.clientX-s.clientX:i.clientX-r.clientX,h=r.type=="touchmove"?originTouch.clientY-s.clientY:i.clientY-r.clientY,t=n.getProjection().fromLatLngToDivPixel(n.get("position")),o=n.getProjection().fromDivPixelToLatLng(new google.maps.Point(t.x-e,t.y-h)),n.set("origin",r),n.set("position",o),n.draw(),w(f,n))})},a=function(n,t,i){google.maps.event.addDomListener(t,i,function(i){i.target.className.indexOf("closeDraggableWindow")!=-1?$(document).trigger("callCloseInfoWindow"):i.which==3?i.stopPropagation():(this.style.cursor="move",n.map.set("draggable",!1),n.set("origin",i),i.changedTouches&&(n.touchTracker=i.changedTouches[0].identifier),n.moveHandler=l(n,n.get("map").getDiv(),t,"mousemove"),n.moveTouchHandler=l(n,n.get("map").getDiv(),t,"touchmove"))})},v=function(n,t,i){google.maps.event.addDomListener(t,i,function(t){var i=t.changedTouches?t.changedTouches.item(n.touchTracker):null;(i!=null||t.type!="touchend")&&(n.map.set("draggable",!0),n.touchTracker=null,google.maps.event.removeListener(n.moveHandler),google.maps.event.removeListener(n.moveTouchHandler))})};return r.prototype=new google.maps.OverlayView,r.prototype.onAdd=function(){var n=document.createElement("div"),i,r;if(that=this,$(n).ready(s),i=this.get("content"),typeof i.nodeName!="undefined")n.appendChild(i);else if(typeof i=="string")n.innerHTML=i;else return;n.style.position="absolute";r=i.indexOf("infoWindowLoading");r==-1&&(n.draggable=!0,c(that,this.get("map").getDiv(),n,"touchcancel","touchend"),c(that,this.get("map").getDiv(),n,"mouseleave","mouseup"),a(that,n,"touchstart"),a(that,n,"mousedown"));v(that,n,"touchend");v(that,n,"mouseup");this.set("container",n);this.getPanes().floatPane.appendChild(n);t=that.getProjection().fromLatLngToDivPixel(that.get("position"));o=that.getProjection().fromDivPixelToLatLng(new google.maps.Point(t.x,t.y))},r.prototype.draw=function(){t=this.getProjection().fromLatLngToDivPixel(this.get("position"));var n=this.get("container");n&&(n.style.left=t.x+"px",n.style.top=t.y+"px")},r.prototype.onRemove=function(){var n=this.get("container");n&&n.parentNode&&(n.parentNode.removeChild(n),this.set("container",null));$(document).trigger("closeGoogleWindow");p()},y},Hashtable=function(n){function e(n){return typeof n==f?n:""+n}function c(n){var t;return typeof n==f?n:typeof n.hashCode==i?(t=n.hashCode(),typeof t==f?t:c(t)):e(n)}function w(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])}function b(n,t){return n.equals(t)}function k(n,t){return typeof t.equals==i?t.equals(n):n===t}function l(t){return function(i){if(i===null)throw new Error("null is not a valid "+t);else if(i===n)throw new Error(t+" must not be undefined");}}function s(n,t,i,r){this[0]=n;this.entries=[];this.addEntry(t,i);r!==null&&(this.getEqualityFunction=function(){return r})}function h(n){return function(t){for(var r=this.entries.length,i,u=this.getEqualityFunction(t);r--;)if(i=this.entries[r],u(t,i[0]))switch(n){case a:return!0;case v:return i;case y:return[r,i[1]]}return!1}}function p(n){return function(t){for(var u=t.length,i=0,r=this.entries,f=r.length;i<f;++i)t[u+i]=r[i][n]}}function d(n,t){for(var i=n.length,r;i--;)if(r=n[i],t===r[0])return i;return null}function r(n,t){var i=n[t];return i&&i instanceof s?i:null}function u(){var i=[],u={},f={replaceDuplicateKey:!0,hashCode:c,equals:null},l=arguments[0],a=arguments[1],e,v,h;a!==n?(f.hashCode=l,f.equals=a):l!==n&&w(f,l);e=f.hashCode;v=f.equals;this.properties=f;this.put=function(n,h){t(n);o(h);var a=e(n),c,l,y=null;return c=r(u,a),c?(l=c.getEntryForKey(n),l?(f.replaceDuplicateKey&&(l[0]=n),y=l[1],l[1]=h):c.addEntry(n,h)):(c=new s(a,n,h,v),i.push(c),u[a]=c),y};this.get=function(n){var o,i,f;return(t(n),o=e(n),i=r(u,o),i&&(f=i.getEntryForKey(n),f))?f[1]:null};this.containsKey=function(n){t(n);var f=e(n),i=r(u,f);return i?i.containsKey(n):!1};this.containsValue=function(n){o(n);for(var t=i.length;t--;)if(i[t].containsValue(n))return!0;return!1};this.clear=function(){i.length=0;u={}};this.isEmpty=function(){return!i.length};h=function(n){return function(){for(var t=[],r=i.length;r--;)i[r][n](t);return t}};this.keys=h("keys");this.values=h("values");this.entries=h("getEntries");this.remove=function(n){t(n);var f=e(n),h,o=null,s=r(u,f);return s&&(o=s.removeEntryForKey(n),o!==null&&s.entries.length==0&&(h=d(i,f),i.splice(h,1),delete u[f])),o};this.size=function(){for(var n=0,t=i.length;t--;)n+=i[t].entries.length;return n}}var i="function",f="string",t,o;if(typeof encodeURIComponent=="undefined"||Array.prototype.splice===n||Object.prototype.hasOwnProperty===n)return null;t=l("key");o=l("value");var a=0,v=1,y=2;return s.prototype={getEqualityFunction:function(n){return typeof n.equals==i?b:k},getEntryForKey:h(v),getEntryAndIndexForKey:h(y),removeEntryForKey:function(n){var t=this.getEntryAndIndexForKey(n);return t?(this.entries.splice(t[0],1),t[1]):null},addEntry:function(n,t){this.entries.push([n,t])},keys:p(0),values:p(1),getEntries:function(n){for(var r=n.length,t=0,i=this.entries,u=i.length;t<u;++t)n[r+t]=i[t].slice(0)},containsKey:h(a),containsValue:function(n){for(var t=this.entries,i=t.length;i--;)if(n===t[i][1])return!0;return!1}},u.prototype={each:function(n){for(var i=this.entries(),r=i.length,t;r--;)t=i[r],n(t[0],t[1])},equals:function(n){var u,t,i,r=this.size();if(r==n.size()){for(u=this.keys();r--;)if(t=u[r],i=n.get(t),i===null||i!==this.get(t))return!1;return!0}return!1},putAll:function(n,t){for(var e=n.entries(),f,r,u,o,s=e.length,h=typeof t==i;s--;)f=e[s],r=f[0],u=f[1],h&&(o=this.get(r))&&(u=t(r,o,u)),this.put(r,u)},clone:function(){var n=new u(this.properties);return n.putAll(this),n}},u.prototype.toQueryString=function(){for(var i=this.entries(),n=i.length,t,r=[];n--;)t=i[n],r[n]=encodeURIComponent(e(t[0]))+"="+encodeURIComponent(e(t[1]));return r.join("&")},u}(),IconManager=function(n,t){var r={},i=[],f=new MapFctns,u;return r.AddIconLayer=function(r,e,o,s,h,c){if(u(r)!=-1)throw"layerid is already active.";var l=new IconLayer(r,e,o,s,h,c);i.push(l);l.MapChanged(n,f,t);$(document).trigger("layerAdded-iconManager",[r,e])},r.RemoveIconLayer=function(n){var r=u(n);r!=-1&&(i[r].Delete(t),i.splice(r,1))},r.GetIconLayer=function(n){var t=u(n);if(t!=-1)return i[t]},r.RefreshLayers=function(){var r=i.length,e=0,u;if(!r){$(document).trigger("layersRefreshed-iconManager");return}for(u in i)i[u].RefreshLayer(n,f,t).done(function(){++e==r&&$(document).trigger("layersRefreshed-iconManager")})},r.RefreshLayer=function(r,e){var s=u(r),o;return s!=-1?i[s].RefreshLayer(n,f,t,e):(o=jQuery.Deferred(),o.resolve(),o.promise())},r.MapChanged=function(){for(var r in i)i[r].MapChanged(n,f,t);$(document).trigger("mapChangedFinished-iconManager")},r.Redraw=function(){t.repaint();$(document).trigger("markerClustererRepainted")},u=function(n){for(var t in i)if(i[t].layerId===n)return t;return-1},r},IconLayer=function(n,t,i,r,u,f){var s={};s.layerId=n;var o=new Hashtable,h=!1,e=t.item2,c=t.item1,l=0,a=22;f&&(f.minZoom&&(l=f.minZoom),f.maxZoom&&(a=f.maxZoom));s.RefreshLayer=function(t,r,f,o){var s=jQuery.Deferred();return i(n,o,u).done(function(n){h||(e=n.item2,c=n.item1,v(t,r,f))}).always(function(t){$(document).trigger("layerRefreshed-iconManager."+n,[n,t]);s.resolve()}),s.promise()};s.MapChanged=function(n,t,i){v(n,t,i)};s.Delete=function(t){h=!0;y(t);$(document).trigger("layerDeleted-iconManager",[n])};s.GetIcons=function(){for(var r,t=o.keys(),i=[],n=0;n<t.length;n++)r=o.get(t[n]),i.push(r.gmapsMarker);return i};var y=function(n){for(var t,r=o.keys(),u=[],i=0;i<r.length;i++)t=o.get(r[i]),t.status==1&&(u.push(t.gmapsMarker),t.status=0);n.removeMarkers(u,!0)},p=function(n,t){return n.merged||(t.url&&!n.icon.url&&(n.icon.url=t.url),t.json&&(!n.icon.json||n.icon.json[0]!="{")&&(n.icon.json=t.json.replace("{jsondata}",n.icon.json)),n.zindex=t.zindex,typeof n.icon.anchor=="undefined"&&(n.icon.anchor=t.anchor),typeof n.icon.origin=="undefined"&&(n.icon.origin=t.origin),typeof n.icon.size=="undefined"&&(n.icon.size=t.size),n.merged=!0),n},v=function(t,i,u){var b=[],k=[],d={},g={},it=i.GetMapBoundsObject(t),tt=t.getZoom(),v,y,nt,f,s,h;for(f in e)(e[f]=p(e[f],c),v=n+"-"+e[f].type+"-"+e[f].itemId+"-"+e[f].icon.url+"-"+e[f].location[0]+"-"+e[f].location[1],d[v]=1,tt<l||tt>a||!w(e[f],it,i))||(g[v]=1,y=o.get(v),y||(y=new IconItem(e[f],r(n,e[f])),o.put(v,y)));nt=o.keys();for(f in nt)s=nt[f],h=o.get(s),h.status==0?d[s]?g[s]&&(h.status=1,b.push(h.gmapsMarker)):o.remove(s):d[s]?g[s]||(h.status=0,k.push(h.gmapsMarker)):(k.push(h.gmapsMarker),o.remove(s));u.removeMarkers(k,!0);u.addMarkers(b,!0);o.values().length>0&&$(document).trigger("layerRefreshed-iconsAdded."+n,[n,b])},w=function(n,t,i){return i.CoordinateIsContained(n.location[0],n.location[1],t)};return s},IconItem=function(n,t){var i={};return i.icon=n,i.gmapsMarker=t,i.status=0,i},KmlManager=function(n,t){var r={},i=new Hashtable;return r.AddLayer=function(r,u){var h,e,o,s,f;i.get(r)||(u.type=="Kml"?(h={clickable:u.clickable,suppressInfoWindows:!0,preserveViewport:!0,map:n},u.url&&(e=URI(u.url),o=5,u.cacheTime>0&&(o=u.cacheTime/60),e.addSearch("t",roundDateToDuration(moment(),moment.duration(o,"minutes"),"floor").unix()),e.addSearch("lang",Cookies.get("_culture")).toString(),s=new google.maps.KmlLayer(e.toString(),h),u.suppressInfoWindow||s.addListener("click",function(n){t.showInfoWindow(n.featureData.description,null,!0,n.latLng,r,null,!1,n.pixelOffset)}),i.put(r,s))):u.type=="GeoJson"&&(f=new google.maps.Data,f.loadGeoJson(u.url),u.styleOptions&&f.setStyle(JSON.parse(u.styleOptions)),f.setMap(n),i.put(r,f),u.suppressInfoWindow||f.addListener("click",function(event){t.showInfoWindow(eval("`"+u.infoWindowTemplate+"`"),null,!0,event.latLng,null,null,!0)})))},r.RemoveLayer=function(n){if(i.get(n)){var t=i.get(n);t.setMap(null);i.remove(n)}},r.GetLayer=function(n){return i.get(n)},r},MapFctns=function(){var n,t,i;return MapFctns.instance?MapFctns.instance:(n={},n.CoordinateIsContained=function(n,t,i){return i.contains(new google.maps.LatLng(n,t))},n.GetMapBoundsObject=function(n){return n.getBounds()},n.GetMapSwLatLng=function(n){return n.getBounds().getSouthWest()},n.GetMapSpanLatLng=function(n){return n.getBounds().toSpan()},n.fitMapToRoute=function(n,r){var u=new google.maps.LatLngBounds,f=google.maps.event.addListenerOnce(n,"bounds_changed",function(){var o=u.getNorthEast(),s=u.getSouthWest(),c=s.lng(),l=o.lng(),r=c,f=l,a=n.getZoom(),v=360/Math.pow(2,a),h=v/256,e=$("#sideBarColContainer"),t;e&&e.is(":visible")&&Modernizr.mq("(min-width: 993px)")&&(r=r-h*e.outerWidth(!0));t=$("#layerSelection");t&&t.is(":visible")&&Modernizr.mq("(min-width: 993px)")&&(f=f+h*t.outerWidth(!0));i(n,o.lat(),r,s.lat(),f)});u=t(n,r,u);setTimeout(function(){google.maps.event.removeListener(f)},3e3)},t=function(n,t,i){for(var r=0;r<t.length;r++)i.extend(new google.maps.LatLng(t[r].point.latitude,t[r].point.longitude));return n.fitBounds(i),n.panBy(0,0),i},i=function(n,t,i,r,u){var f=new google.maps.LatLngBounds;f.extend(new google.maps.LatLng(t,i));f.extend(new google.maps.LatLng(r,u));n.fitBounds(f);n.panBy(0,0)},MapFctns.instance=n,n)},SaveMapViewControl=function(n,t){var u,i,f,r,e;n.className="saveMapViewControlContainer";u=document.createElement("div");u.className="saveMapViewControl";n.appendChild(u);i=document.createElement("i");i.className="far fa-save";i.setAttribute("title",resources.SaveMapView);i.setAttribute("aria-hidden","true");i.setAttribute("tabindex","0");f=document.createElement("span");f.className="sr-only";f.innerText=resources.SaveMapView;u.appendChild(i);u.appendChild(f);r=document.createElement("i");r.className="far fa-map-marked";r.setAttribute("title",resources.GoToMapView);r.setAttribute("aria-hidden","true");r.setAttribute("tabindex","0");e=document.createElement("span");e.className="sr-only";e.innerText=resources.GoToMapView;u.appendChild(r);u.appendChild(e);google.maps.event.addDomListener(i,"click",function(){saveMapViewInfo(t)});google.maps.event.addDomListener(i,"keydown",function(){saveMapViewInfo(t)});google.maps.event.addDomListener(r,"click",function(){setMapViewInfo(t)});google.maps.event.addDomListener(r,"keydown",function(){setMapViewInfo(t)})},saveMapViewInfo=function(n){var t={lat:n.getCenter().lat(),lng:n.getCenter().lng(),zoom:n.getZoom()};Cookies.set("_saveMapView",JSON.stringify(t),{expires:365,path:"/"});$(".map-feedback-msg span").html(resources.SaveMapViewSuccess);$(".map-feedback-msg").show().delay(3e3).fadeOut()},setMapViewInfo=function(n){if(Cookies.get("_saveMapView")!=null){var t=JSON.parse(Cookies.get("_saveMapView")),i=new google.maps.LatLng(t.lat,t.lng);n.panTo(i);t.zoom&&n.setZoom(t.zoom)}else $(".map-feedback-msg span").html(resources.GoToMapViewError),$(".map-feedback-msg").show().delay(3e3).fadeOut()};MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(n,t){return function(n){for(var t in n.prototype)this.prototype[t]=n.prototype[t];return this}.apply(n,[t])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var n=0,t;t=this.sizes[n];n++)this.styles_.push({url:this.imagePath_+(n+1)+"."+this.imageExtension_,height:t,width:t})};MarkerClusterer.prototype.fitMapToMarkers=function(){for(var r=this.getMarkers(),n=new google.maps.LatLngBounds,t=0,i;i=r[t];t++)n.extend(i.getPosition());this.map_.fitBounds(n);this.map_.panBy(0,0)};MarkerClusterer.prototype.setStyles=function(n){this.styles_=n};MarkerClusterer.prototype.getStyles=function(){return this.styles_};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};MarkerClusterer.prototype.getMarkers=function(){return this.markers_};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length};MarkerClusterer.prototype.setMaxZoom=function(n){this.maxZoom_=n};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};MarkerClusterer.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}};MarkerClusterer.prototype.setCalculator=function(n){this.calculator_=n};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(n,t){for(var r=0,i;i=n[r];r++)i.preventClustering||this.oms_.addMarker(i),this.pushMarkerTo_(i);t||this.redraw()};MarkerClusterer.prototype.pushMarkerTo_=function(n){if(n.isAdded=!1,n.draggable){var t=this;google.maps.event.addListener(n,"dragend",function(){n.isAdded=!1;t.repaint()})}this.markers_.push(n)};MarkerClusterer.prototype.addMarker=function(n,t){n.preventClustering||this.oms_.addMarker(n);this.pushMarkerTo_(n);t||this.redraw()};MarkerClusterer.prototype.removeMarker_=function(n){var t=-1,i,r;if(this.markers_.indexOf)t=this.markers_.indexOf(n);else for(i=0;r=this.markers_[i];i++)if(r==n){t=i;break}return t==-1?!1:(n.setMap(null),n.clustered=!0,google.maps.event.trigger(n,"marker-clustered",!0),this.markers_.splice(t,1),!0)};MarkerClusterer.prototype.removeMarker=function(n,t){this.oms_.removeMarker(n);var i=this.removeMarker_(n);return!t&&i?(this.resetViewport(),this.redraw(),!0):!1};MarkerClusterer.prototype.removeMarkers=function(n,t){for(var f,i=!1,u=0,r;r=n[u];u++)this.oms_.removeMarker(r),f=this.removeMarker_(r),i=i||f;if(!t&&i)return this.resetViewport(),this.redraw(),!0};MarkerClusterer.prototype.setReady_=function(n){this.ready_||(this.ready_=n,this.createClusters_())};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(n){this.map_=n};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(n){this.gridSize_=n};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};MarkerClusterer.prototype.setMinClusterSize=function(n){this.minClusterSize_=n};MarkerClusterer.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};MarkerClusterer.prototype.isMarkerInBounds_=function(n,t){return n.getPosition?t.contains(n.getPosition()):!1};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0);this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(n){for(var r,i,t=0;r=this.clusters_[t];t++)r.remove();for(t=0;i=this.markers_[t];t++)i.isAdded=!1,n&&i.setMap(null);this.clusters_=[]};MarkerClusterer.prototype.repaint=function(){var n=this.clusters_.slice();this.clusters_.length=0;this.resetViewport();this.redraw();window.setTimeout(function(){for(var t=0,i;i=n[t];t++)i.remove()},0)};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.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};MarkerClusterer.prototype.addToClosestCluster_=function(n){for(var r,u,t,f=4e4,i=null,o=n.getPosition(),e=0;t=this.clusters_[e];e++)r=t.getCenter(),r&&(u=this.distanceBetweenPoints_(r,n.getPosition()),u<f&&(f=u,i=t));i&&i.isMarkerInClusterBounds(n)?i.addMarker(n):(t=new Cluster(this),t.addMarker(n),this.clusters_.push(t))};MarkerClusterer.prototype.createClusters_=function(){var i,r,t,n;if(this.ready_)for(i=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),r=this.getExtendedBounds(i),t=0;n=this.markers_[t];t++)!n.isAdded&&this.isMarkerInBounds_(n,r)&&this.addToClosestCluster_(n)};Cluster.prototype.isMarkerAlreadyAdded=function(n){if(this.markers_.indexOf)return this.markers_.indexOf(n)!=-1;for(var t=0,i;i=this.markers_[t];t++)if(i==n)return!0;return!1};Cluster.prototype.addMarker=function(n){var i,t;if(this.isMarkerAlreadyAdded(n))return!1;if(this.center_){if(this.averageCenter_){var r=this.markers_.length+1,u=(this.center_.lat()*(r-1)+n.getPosition().lat())/r,f=(this.center_.lng()*(r-1)+n.getPosition().lng())/r;this.center_=new google.maps.LatLng(u,f);this.calculateBounds_()}}else this.center_=n.getPosition(),this.calculateBounds_();if(n.isAdded=!0,n.preventClustering||this.markers_.push(n),i=this.markers_.length,(i<this.minClusterSize_||n.preventClustering)&&(n.getMap()!=this.map_&&n.setMap(this.map_),n.clustered=!1,google.maps.event.trigger(n,"marker-clustered",!1)),i==this.minClusterSize_)for(t=0;t<i;t++)this.markers_[t].setMap(null),this.markers_[t].clustered=!0,google.maps.event.trigger(this.markers_[t],"marker-clustered",!0);return i>=this.minClusterSize_&&!n.preventClustering&&(n.setMap(null),n.clustered=!0,google.maps.event.trigger(n,"marker-clustered",!0)),this.updateIcon(),!0};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){for(var n=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),t=0,i;i=r[t];t++)n.extend(i.getPosition());return n};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_};Cluster.prototype.getSize=function(){return this.markers_.length};Cluster.prototype.getMarkers=function(){return this.markers_};Cluster.prototype.getCenter=function(){return this.center_};Cluster.prototype.calculateBounds_=function(){var n=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(n)};Cluster.prototype.isMarkerInClusterBounds=function(n){return this.bounds_.contains(n.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var f=this.map_.getZoom(),i=this.markerClusterer_.getMaxZoom(),t,n,r,u;if(i&&f>i){for(t=0;n=this.markers_[t];t++)n.map!==this.map_&&(n.setMap(this.map_),n.clustered=!1,google.maps.event.trigger(n,"marker-clustered",!1));return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}r=this.markerClusterer_.getStyles().length;u=this.markerClusterer_.getCalculator()(this.markers_,r);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.setSums(u);this.clusterIcon_.show()};ClusterIcon.prototype.triggerClusterClick=function(n){var t=this.cluster_.getMarkerClusterer();google.maps.event.trigger(t,"clusterclick",this.cluster_,n);t.isZoomOnClick()&&(this.map_.fitBounds(this.cluster_.getBounds()),this.map_.panBy(0,0))};ClusterIcon.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_.innerHTML=this.sums_.text);t=this.getPanes();t.overlayMouseTarget.appendChild(this.div_);i=this;google.maps.event.addDomListener(this.div_,"click",function(n){i.triggerClusterClick(n)})};ClusterIcon.prototype.getPosFromLatLng_=function(n){var t=this.getProjection().fromLatLngToDivPixel(n);return typeof this.iconAnchor_=="object"&&this.iconAnchor_.length===2?(t.x-=this.iconAnchor_[0],t.y-=this.iconAnchor_[1]):(t.x-=parseInt(this.width_/2,10),t.y-=parseInt(this.height_/2,10)),t};ClusterIcon.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"}};ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none");this.visible_=!1};ClusterIcon.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};ClusterIcon.prototype.remove=function(){this.setMap(null)};ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)};ClusterIcon.prototype.setSums=function(n){this.sums_=n;this.text_=n.text;this.index_=n.index;this.div_&&(this.div_.innerHTML=n.text);this.useStyle()};ClusterIcon.prototype.useStyle=function(){var t=Math.max(0,this.sums_.index-1),n;t=Math.min(this.styles_.length-1,t);n=this.styles_[t];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;this.iconAnchor_=n.iconAnchor};ClusterIcon.prototype.setCenter=function(n){this.center_=n};ClusterIcon.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+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?t.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):typeof this.anchor_[0]=="number"&&this.anchor_[0]<0&&-this.anchor_[0]<this.height_?t.push("height:"+this.height_+"px; line-height:"+(this.height_+this.anchor_[0])+"px;"):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?t.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):t.push("width:"+this.width_+"px; text-align:center;")):t.push("height:"+this.height_+"px; line-height:"+this.height_+"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("")};noPanOffEarth=function(n){function i(){var i=n.getCenter();if(i=new google.maps.LatLng(i.lat(),i.lng(),!1),!t.contains(i)){var e=i.lng(),r=i.lat(),u=t.getNorthEast().lat(),f=t.getSouthWest().lat();r<f&&(r=f);r>u&&(r=u);n.panTo(new google.maps.LatLng(r,e))}}var t=new google.maps.LatLngBounds(new google.maps.LatLng(-75.05113,-180),new google.maps.LatLng(75.05113,180));google.maps.event.addListener(n,"center_changed",function(){i()});n.setOptions({minZoom:3})},function(){var n,t,r,u,i,f={}.hasOwnProperty,e=[].slice;this.OverlappingMarkerSpiderfier=function(){function o(e,o){var c,s,h;this.map=e;null==o&&(o={});null==this.constructor.N&&(this.constructor.N=!0,i=google.maps,t=i.event,r=i.MapTypeId,n.keepSpiderfied=!1,n.ignoreMapClick=!1,n.markersWontHide=!1,n.markersWontMove=!1,n.basicFormatEvents=!1,n.nearbyDistance=20,n.circleSpiralSwitchover=9,n.circleFootSeparation=23,n.circleStartAngle=u/12,n.spiralFootSeparation=26,n.spiralLengthStart=11,n.spiralLengthFactor=4,n.spiderfiedZIndex=i.Marker.MAX_ZINDEX+2e4,n.highlightedLegZIndex=i.Marker.MAX_ZINDEX+1e4,n.usualLegZIndex=i.Marker.MAX_ZINDEX+1,n.legWeight=1.5,n.legColors={usual:{},highlighted:{}},h=n.legColors.usual,s=n.legColors.highlighted,h[r.HYBRID]=h[r.SATELLITE]="#fff",s[r.HYBRID]=s[r.SATELLITE]="#f00",h[r.TERRAIN]=h[r.ROADMAP]="#444",s[r.TERRAIN]=s[r.ROADMAP]="#f00",this.constructor.j=function(n){return this.setMap(n)},this.constructor.j.prototype=new i.OverlayView,this.constructor.j.prototype.draw=function(){});for(c in o)f.call(o,c)&&(s=o[c],this[c]=s);this.g=new this.constructor.j(this.map);this.C();this.c={};this.B=this.l=null;this.addListener("click",function(n,i){return t.trigger(n,"spider_click",i)});this.addListener("format",function(n,i){return t.trigger(n,"spider_format",i)});this.ignoreMapClick||t.addListener(this.map,"click",function(n){return function(){return n.unspiderfy()}}(this));t.addListener(this.map,"maptypeid_changed",function(n){return function(){return n.unspiderfy()}}(this));t.addListener(this.map,"zoom_changed",function(n){return function(){return n.unspiderfy(),n.basicFormatEvents?void 0:n.h()}}(this))}var t,i,s,c,r,n,h,u,l;for(n=o.prototype,h=[o,n],s=0,c=h.length;s<c;s++)l=h[s],l.VERSION="1.0.3";return u=2*Math.PI,i=t=r=null,o.markerStatus={SPIDERFIED:"SPIDERFIED",SPIDERFIABLE:"SPIDERFIABLE",UNSPIDERFIABLE:"UNSPIDERFIABLE",UNSPIDERFIED:"UNSPIDERFIED"},n.C=function(){this.a=[];this.s=[]},n.addMarker=function(n,t){return n.setMap(this.map),this.trackMarker(n,t)},n.trackMarker=function(n,i){var r;return null!=n._oms?this:(n._oms=!0,r=[t.addListener(n,"click",function(t){return function(i){return t.V(n,i)}}(this))],this.markersWontHide||r.push(t.addListener(n,"visible_changed",function(t){return function(){return t.D(n,!1)}}(this))),this.markersWontMove||r.push(t.addListener(n,"position_changed",function(t){return function(){return t.D(n,!0)}}(this))),null!=i&&r.push(t.addListener(n,"spider_click",i)),this.s.push(r),this.a.push(n),this.basicFormatEvents?this.trigger("format",n,this.constructor.markerStatus.UNSPIDERFIED):(this.trigger("format",n,this.constructor.markerStatus.UNSPIDERFIABLE),this.h()),this)},n.D=function(n,t){if(!this.J&&!this.K)return null==n._omsData||!t&&n.getVisible()||this.unspiderfy(t?n:null),this.h()},n.getMarkers=function(){return this.a.slice(0)},n.removeMarker=function(n){return this.forgetMarker(n),n.setMap(null)},n.forgetMarker=function(n){var i,r,f,e,u;if(null!=n._omsData&&this.unspiderfy(),i=this.A(this.a,n),0>i)return this;for(u=this.s.splice(i,1)[0],r=0,f=u.length;r<f;r++)e=u[r],t.removeListener(e);return delete n._oms,this.a.splice(i,1),this.h(),this},n.removeAllMarkers=n.clearMarkers=function(){var n,i,r,t;for(t=this.getMarkers(),this.forgetAllMarkers(),n=0,i=t.length;n<i;n++)r=t[n],r.setMap(null);return this},n.forgetAllMarkers=function(){var n,r,e,o,u,s,i,f;for(this.unspiderfy(),f=this.a,n=r=0,e=f.length;r<e;n=++r){for(s=f[n],u=this.s[n],i=0,n=u.length;i<n;i++)o=u[i],t.removeListener(o);delete s._oms}return this.C(),this},n.addListener=function(n,t){var i;return(null!=(i=this.c)[n]?i[n]:i[n]=[]).push(t),this},n.removeListener=function(n,t){var i;return i=this.A(this.c[n],t),0>i||this.c[n].splice(i,1),this},n.clearListeners=function(n){return this.c[n]=[],this},n.trigger=function(){var u,n,t,i,f,r;for(n=arguments[0],u=2<=arguments.length?e.call(arguments,1):[],n=null!=(t=this.c[n])?t:[],r=[],i=0,f=n.length;i<f;i++)t=n[i],r.push(t.apply(null,u));return r},n.L=function(n,t){var r,s,f,e,o;for(e=this.circleFootSeparation*(2+n)/u,s=u/n,o=[],r=f=0;0<=n?f<n:f>n;r=0<=n?++f:--f)r=this.circleStartAngle+r*s,o.push(new i.Point(t.x+e*Math.cos(r),t.y+e*Math.sin(r)));return o},n.M=function(n,t){var r,f,e,o,s;for(o=this.spiralLengthStart,r=0,s=[],f=e=0;0<=n?e<n:e>n;f=0<=n?++e:--e)r+=this.spiralFootSeparation/o+.0005*f,f=new i.Point(t.x+o*Math.cos(r),t.y+o*Math.sin(r)),o+=u*this.spiralLengthFactor/r,s.push(f);return s},n.V=function(n,t){var i,s,r,f,h,u,e,c,o;if((u=null!=n._omsData)&&this.keepSpiderfied||this.unspiderfy(),u||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",n,t);for(u=[],e=[],i=this.nearbyDistance,c=i*i,h=this.f(n.position),o=this.a,i=0,s=o.length;i<s;i++)r=o[i],null!=r.map&&r.getVisible()&&(f=this.f(r.position),this.i(f,h)<c?u.push({R:r,G:f}):e.push(r));return 1===u.length?this.trigger("click",n,t):this.W(u,e)},n.markersNearMarker=function(n,t){var i,e,r,o,s,u,h,f,c,l;if(null==t&&(t=!1),null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";for(i=this.nearbyDistance,h=i*i,s=this.f(n.position),u=[],f=this.a,i=0,e=f.length;i<e&&!(r=f[i],r!==n&&null!=r.map&&r.getVisible()&&(o=this.f(null!=(c=null!=(l=r._omsData)?l.v:void 0)?c:r.position),this.i(o,s)<h&&(u.push(r),t)));i++);return u},n.F=function(){var t,n,u,f,e,s,i,c,h,r,l,o;if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";for(h=this.nearbyDistance,h*=h,e=this.a,o=[],r=0,n=e.length;r<n;r++)f=e[r],o.push({H:this.f(null!=(t=null!=(u=f._omsData)?u.v:void 0)?t:f.position),b:!1});for(r=this.a,t=u=0,f=r.length;u<f;t=++u)if(n=r[t],null!=n.getMap()&&n.getVisible()&&(s=o[t],!s.b))for(l=this.a,n=c=0,e=l.length;c<e;n=++c)if(i=l[n],n!==t&&null!=i.getMap()&&i.getVisible()&&(i=o[n],(!(n<t)||i.b)&&this.i(s.H,i.H)<h)){s.b=i.b=!0;break}return o},n.markersNearAnyOtherMarker=function(){var n,t,u,f,e,i,r;for(e=this.F(),i=this.a,r=[],n=t=0,u=i.length;t<u;n=++t)f=i[n],e[n].b&&r.push(f);return r},n.setImmediate=function(n){return window.setTimeout(n,0)},n.h=function(){if(!this.basicFormatEvents&&null==this.l)return this.l=this.setImmediate(function(n){return function(){return n.l=null,null!=n.g.getProjection()?n.w():null!=n.B?void 0:n.B=t.addListenerOnce(n.map,"idle",function(){return n.w()})}}(this))},n.w=function(){var n,t,r,i,u,f,e;if(this.basicFormatEvents){for(u=[],t=0,r=markers.length;t<r;t++)i=markers[t],n=null!=i._omsData?"SPIDERFIED":"UNSPIDERFIED",u.push(this.trigger("format",i,this.constructor.markerStatus[n]));return u}for(u=this.F(),f=this.a,e=[],n=r=0,t=f.length;r<t;n=++r)i=f[n],n=null!=i._omsData?"SPIDERFIED":u[n].b?"SPIDERFIABLE":"UNSPIDERFIABLE",e.push(this.trigger("format",i,this.constructor.markerStatus[n]));return e},n.P=function(n){return{m:function(t){return function(){return n._omsData.o.setOptions({strokeColor:t.legColors.highlighted[t.map.mapTypeId],zIndex:t.highlightedLegZIndex})}}(this),u:function(t){return function(){return n._omsData.o.setOptions({strokeColor:t.legColors.usual[t.map.mapTypeId],zIndex:t.usualLegZIndex})}}(this)}},n.W=function(n,r){var f,s,e,h,c,l,u,a,v,o;return this.J=!0,o=n.length,f=this.T(function(){var t,r,i;for(i=[],t=0,r=n.length;t<r;t++)a=n[t],i.push(a.G);return i}()),h=o>=this.circleSpiralSwitchover?this.M(o,f).reverse():this.L(o,f),f=function(){var r,o,f;for(f=[],r=0,o=h.length;r<o;r++)e=h[r],s=this.U(e),v=this.S(n,function(n){return function(t){return n.i(t.G,e)}}(this)),u=v.R,l=new i.Polyline({map:this.map,path:[u.position,s],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight,zIndex:this.usualLegZIndex}),u._omsData={v:u.getPosition(),X:u.getZIndex(),o:l},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(c=this.P(u),u._omsData.O={m:t.addListener(u,"mouseover",c.m),u:t.addListener(u,"mouseout",c.u)}),this.trigger("format",u,this.constructor.markerStatus.SPIDERFIED),u.setPosition(s),u.setZIndex(Math.round(this.spiderfiedZIndex+e.y)),f.push(u);return f}.call(this),delete this.J,this.I=!0,this.trigger("spiderfy",f,r)},n.unspiderfy=function(n){var u,s,r,i,f,e,o;if(null==n&&(n=null),null==this.I)return this;for(this.K=!0,o=[],f=[],e=this.a,u=0,s=e.length;u<s;u++)i=e[u],null!=i._omsData?(i._omsData.o.setMap(null),i!==n&&i.setPosition(i._omsData.v),i.setZIndex(i._omsData.X),r=i._omsData.O,null!=r&&(t.removeListener(r.m),t.removeListener(r.u)),delete i._omsData,i!==n&&(r=this.basicFormatEvents?"UNSPIDERFIED":"SPIDERFIABLE",this.trigger("format",i,this.constructor.markerStatus[r])),o.push(i)):f.push(i);return delete this.K,delete this.I,this.trigger("unspiderfy",o,f),this},n.i=function(n,t){var i,r;return i=n.x-t.x,r=n.y-t.y,i*i+r*r},n.T=function(n){for(var r,u,f,t=u=f=0,e=n.length;t<e;t++)r=n[t],u+=r.x,f+=r.y;return n=n.length,new i.Point(u/n,f/n)},n.f=function(n){return this.g.getProjection().fromLatLngToDivPixel(n)},n.U=function(n){return this.g.getProjection().fromDivPixelToLatLng(n)},n.S=function(n,t){for(var r,e,i,f,u=f=0,o=n.length;f<o;u=++f)(i=n[u],i=t(i),"undefined"==typeof r||null===r||i<e)&&(e=i,r=u);return n.splice(r,1)[0]},n.A=function(n,t){var i,r,u,f;if(null!=n.indexOf)return n.indexOf(t);for(i=r=0,u=n.length;r<u;i=++r)if(f=n[i],f===t)return i;return-1},o}();t=/(\?.*(&|&amp;)|\?)spiderfier_callback=(\w+)/;n=document.currentScript;null==n&&(n=function(){var n,f,r,e,u;for(r=document.getElementsByTagName("script"),u=[],n=0,f=r.length;n<f;n++)i=r[n],null!=(e=i.getAttribute("src"))&&e.match(t)&&u.push(i);return u}()[0]);null!=n&&(n=null!=(r=n.getAttribute("src"))?null!=(u=r.match(t))?u[3]:void 0:void 0)&&"function"==typeof window[n]&&window[n]();"function"==typeof spiderfier_callback&&window.spiderfier_callback()}.call(this);var PolylineManager=function(n){var i={},t=[],r=new MapFctns,u;return i.AddPolylineLayer=function(i,f,e,o,s,h,c,l,a){if(u(i)!=-1)throw"layerid is already active.";var v=new PolylineLayer(i,f,e,o,s,h,c,l,a);t.push(v);v.MapChanged(n,r)},i.GetPolylines=function(n){for(var i=0;i<t.length;i++)if(t[i].layerId==n)return t[i].layerPolyLines()},i.RemovePolylineLayer=function(n){var i=u(n);i!=-1&&(t[i].Delete(),t.splice(i,1))},i.RefreshLayers=function(i){var u=0,o=0,f,e;if(!t.length){$(document).trigger("layersRefreshed-polylineManager");return}$(document).on("layerRefreshed-polylineManager.internal",function(){++o==u&&($(document).trigger("layersRefreshed-polylineManager"),$(document).unbind("layerRefreshed-polylineManager.internal"))});u=t.length;for(f in t)e=t[f],e.RefreshLayer(n,r,i)},i.RefreshLayer=function(i,u){var e,f;for(e in t)if(f=t[e],f.layerId==i){f.RefreshLayer(n,r,u);return}},i.MapChanged=function(){for(var i in t)t[i].MapChanged(n,r);$(document).trigger("mapChangedFinished-polylineManager")},u=function(n){for(var i in t)if(t[i].layerId===n)return i;return-1},i},PolylineLayer=function(n,t,i,r,u,f,e,o){var h={},l=!1,s=null,a=function(){var u,o,f,e;oldPolylines=s;s=[];for(u in t){o={strokeColor:t[u].lineColor,strokeOpacity:t[u].icons==null?i:0,strokeWeight:r,map:null,path:t[u].decodedPoints,icons:t[u].icons};f=new google.maps.Polyline(o);f.canDraw=!0;for(e in oldPolylines)t[u].id==oldPolylines[e].sourceData.id&&(f.canDraw=oldPolylines[e].gMapLine.canDraw);s.push({gMapLine:f,sourceData:t[u]})}$(document).trigger("polylineLayer-polylinesBuilt",[n,s])},c;return h.layerId=n,a(),h.layerPolyLines=function(){return s},h.RefreshLayer=function(i,r,u){e(function(u){l||(t=u,c(),a(i),h.MapChanged(i,r));$(document).trigger("layerRefreshed-polylineManager",[n])},o,u)},h.MapChanged=function(n,t){var o=n.getZoom(),h,i,a,e;if(o>f||o<u){for(i in s)s[i].gMapLine.setMap(null);return}h=t.GetMapBoundsObject(n);for(i in s){var r=s[i].gMapLine,c=!1,l=r.getPath().getArray();for(a in l)if(e=l[a],t.CoordinateIsContained(e.lat(),e.lng(),h)){c=!0;break}r.setMap(c&&r.canDraw?n:null)}},h.Delete=function(){l=!0;c()},c=function(){for(var n in s)s[n].gMapLine.setMap(null)},h},cctvIntervalIds=[],cctvPictures=[],cctvRefreshInterval=2e3;$(function(){var t=function(){var i={},t=[],n;for($(".cctvImage").each(function(){var n=$(this).attr("data-refresh-rate");n&&(!i[n]&&n>0&&(t.push(n),i[n]=!0),!n>0&&Bugsnag.notify("Undefined refreshRateMs",function(n){n.context="Happened in setUpCameraRefreshTimers()";n.setMetadata("html",$("<div/>").append($(".cctvImage").clone()).html())}))}),n=0;n<t.length;n++)cctvIntervalIds.push(setInterval(function(n){$('.cctvImage[data-refresh-rate="'+n+'"]').each(function(){($(this).parents(".slick-slide").length==0||$(this).parents(".slick-slide").hasClass("slick-active"))&&$(this).attr("src")!=undefined&&$(this).attr("src",URI($(this).attr("src")).search("t="+roundDateToDuration(moment().startOf("second"),moment.duration(parseInt(n)),"floor").unix()));$(this).parents(".slick-slide").length>0&&!$(this).parents(".slick-slide").hasClass("slick-active")&&$(this).attr("data-needsrefresh","true")})},t[n],t[n]))},n=function(){for(var n=0;n<cctvIntervalIds.length;n++)clearInterval(cctvIntervalIds[n]);cctvIntervalIds=[]};$(document).on("cameraImagesInitialized",function(){n();$(".carouselCctvImage").each(function(){setupSlickCarousel($(this))});$(".cctvImage").one("load",function(){var t=$(this).prev(),n,i;t.hasClass("agencyLogo")&&t.show();n=$("button.showVideo");i=$(".camTooltip").length>0||$(".myCamTooltip").length>0;n&&n.length>0&&resources.StartVideoOnDisplay=="True"&&i&&n[0].click()}).each(function(){this.complete&&$(this).trigger("load")});$(".cctvCameraCarousel").hasClass("setVisibility")&&$(".cctvCameraCarousel").removeClass("setVisibility");t()});$(document).on("cameraImagesClearIntervals",function(){n()})});var TileManager=function(n,t){var i={},f=(new Date).getTime(),u=null,r={},e=null,o=null;i.AddTileLayer=function(i,u){var l,a,v;if(s(i).length>0)throw"layerid is already active.";if(l=new TileLayer(i,u.urlFormat,u.tooltipUrlFormat,u.animationFrames,u.cache),a=new TileOverlayMapType({name:i,getTileUrl:function(t,i,r,f){var e=n.getZoom();return e>u.maxZoom||e<u.minZoom?null:t.getTileUrl(i.x,i.y,r,f)},tileSize:new google.maps.Size(256,256),isPng:!0,opacity:u.opacity,startingFrame:u.startingFrame,startPlaying:u.startPlaying},l,u.animationFrames),u.tooltipUrlFormat&&(v=google.maps.event.addListener(n,"click",function(r){var e=r.latLng.lat(),o=r.latLng.lng(),f=n.getZoom();f<=u.maxZoom&&f>=u.minZoom&&$.ajax(l.getTooltipUrl(e,o,f)).done(function(n){t.showInfoWindow(n,null,!0,new google.maps.LatLng(e,o),i,null,!0)})}),r[i]=v),u.highwayFill!=""||u.highwayStroke!=""){var f=n.get("styles")||[],h=!1,c=!1;if(f.length!=0)for(style in f)if(f[style].featureType=="road.highway"&&f[style].elementType=="geometry.fill"){for(styler in f[style].stylers)typeof f[style].stylers[styler].color!="undefined"&&(e=f[style].stylers[styler].color,f[style].stylers[styler].color=u.highwayFill,h=!0);h||(f[style].stylers.push({color:u.highwayFill}),h=!0)}else if(f[style].featureType=="road.highway"&&f[style].elementType=="geometry.stroke"){for(styler in f[style].stylers)typeof f[style].stylers[styler].color!="undefined"&&(o=f[style].stylers[styler].color,f[style].stylers[styler].color=u.highwayStroke,c=!0);c||(tyles[style].stylers.push({color:u.highwayStroke}),c=!0)}h||f.push({featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:u.highwayFill}]});c||f.push({featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:u.highwayStroke}]});n.setOptions({styles:f})}u.zlevel>=0?n.overlayMapTypes.insertAt(0,a):n.overlayMapTypes.push(a)};i.RemoveTileLayer=function(t){var u=s(t),f,i;if(u.length>=0)for(f=0;f<u.length;f++)n.overlayMapTypes.getArray()[u[0]].clearAnimationTimer(),n.overlayMapTypes.removeAt(u[0]);i=n.get("styles");for(style in i)if(i[style].featureType=="road.highway"&&i[style].elementType=="geometry.fill")for(styler in i[style].stylers)i[style].stylers[styler].color&&(i[style].stylers[styler].color=e);else if(i[style].featureType=="road.highway"&&i[style].elementType=="geometry.stroke")for(styler in i[style].stylers)i[style].stylers[styler].color&&(i[style].stylers[styler].color=o);n.setOptions({styles:i});r[t]&&(google.maps.event.removeListener(r[t]),r[t]=null)};i.RefreshLayers=function(){f=(new Date).getTime();(u==null||u<f)&&h()};var l=function(n){$("input[type='checkbox'][data-tileurlformat]:checked:not([data-layerid='"+n+"'])",$("#layerSelection")).click()},h=function(){for(var t,r=n.overlayMapTypes.getArray(),i=0;i<r.length;i++)t=r[i],t.isTileOverlayMapType&&t.animationTimer===null&&t.refreshTiles(!1)},s=function(t){for(var r=n.overlayMapTypes.getArray(),u=[],i=0;i<r.length;i++)r[i].name==t&&r[i].isTileOverlayMapType&&u.push(i);return u},c=function(){var t=function(){u=(new Date).getTime()};google.maps.event.addListener(n,"bounds_changed",t);google.maps.event.addListener(n,"zoom_changed",t)};return c(),i},TileLayer=function(n,t,i,r,u){var f={},e=t,o=i,s=r;return f.layerId=n,f.getTileUrl=function(n,t,i,r){var f=URI.expand(e,{x:n,y:t,z:i});return s>0?f.addSearch("frame",r):u?f.addSearch("t",moment().startOf("minute").unix()):f.addSearch("tmTime",moment().unix()),f.toString()},f.getTooltipUrl=function(n,t,i){return URI.expand(o,{lat:n,lng:t,z:i}).toString()},f},TileOverlayMapType=function(n,t,i){var u={},r;if(this.isTileOverlayMapType=!0,this.name=n.name,this.getTileUrl=n.getTileUrl,this.tileSize=n.tileSize,this.isPng=n.isPng,this.tileLayer=t,this.animationCounter=n.startingFrame-1,this.animationFrames=i,this.opacity=n.opacity,this.startPlaying=n.startPlaying,this.animationTimer=null,this.isAnimating=!1,this.getTile=function(n,t,i){var e=this.getTileUrl(this.tileLayer,n,t,this.animationCounter),o="x_"+n.x+"_y_"+n.y+"_zoom_"+t,r=i.createElement("div"),f;return r.style.backgroundPosition="center center",r.style.backgroundRepeat="no-repeat",r.style.height=this.tileSize.height+"px",r.style.width=this.tileSize.width+"px",r.style.opacity=this.opacity,r.tileId=o,r.coord=n,r.zoom=t,r.timestamp=new Date,u[o]=r,e&&(f=new Image,f.onload=function(){r.style.backgroundImage="url("+e+")";f.onload=null;f=null},f.src=e,this.animationFrames>0&&(r.img=f)),r},this.refreshTiles=function(n){function s(n,t,i){return function(){t.style.backgroundImage="url("+i+")";n.onload=null;n=null}}var e,r,o,t,f,i;if(n!=!1&&this.animationFrames>0){for(e=!0,r=0;r<u.length;r++)t=u[r],t.img.complete||(e=!1);!this.isAnimating&&e&&(this.animationCounter=(this.animationCounter+1)%this.animationFrames);this.isAnimating=!0}for(o in u)t=u[o],f=this.getTileUrl(this.tileLayer,t.coord,t.zoom,this.animationCounter),f&&(i=new Image,i.onload=s(i,t,f),i.src=f,this.animationFrames>0&&(t.img=i));this.isAnimating=!1},this.getOpacity=function(){return this.opacity},this.releaseTile=function(n){u[n.tileId]&&n.timestamp==u[n.tileId].timestamp&&delete u[n.tileId]},this.clearAnimationTimer=function(){this.animationTimer!=null&&(window.clearInterval(this.animationTimer),this.animationTimer=null,$(document).off("animation-toggle-"+this.name))},this.animationFrames>0){r=this;this.startPlaying?r.animationTimer=window.setInterval(function(){r.refreshTiles();$(document).trigger("animation-update-"+r.name,[r.animationCounter])},2e3):$(document).trigger("timerbox-update-"+r.name,[r.animationCounter]);$(document).on("animation-toggle-"+r.name,function(){r.animationTimer?(window.clearInterval(r.animationTimer),r.animationTimer=null):r.animationTimer=window.setInterval(function(){r.refreshTiles();$(document).trigger("animation-update-"+r.name,[r.animationCounter])},2e3)})}};"use strict";var UrlHash=function(){function n(){var n=this;if(this.hashEvent="hashchange.urlHash",this.hashChangeHandler=function(){$(document).trigger("hashChanged-urlHash",[n.hash()])},this.whileWeSetHashHandler=function(){$(window).off(n.hashEvent);$(window).on(n.hashEvent,n.hashChangeHandler)},this.setWhileWeSetHashHandler=function(){$(window).off(n.hashEvent);$(window).on(n.hashEvent,n.whileWeSetHashHandler)},this.clearHash=function(){n.setWhileWeSetHashHandler();window.location.hash="route"},this.hash=function(t,i){var r=window.location.hash.substr(1);return t&&r!=t&&(n.setWhileWeSetHashHandler(),i?window.location.replace(t):window.location.hash=t),r},!$._data(window,"events").hashchange)$(window).on(this.hashEvent,this.hashChangeHandler)}return n}(),urlHash=new UrlHash,UserGeolocation=function(n,t,i,r,u){var f={},e=function(n){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition?navigator.geolocation.getCurrentPosition(function(t){var i=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);n(i)}):n(null)};return f.AttemptToSetLocationWithUsersGeolocation=function(i){f.GetUserGeolocation(function(u){if(u){var f=n.GetCustomSimplePlace("",null,u.lat(),u.lng(),!1);t.SetLocationByGeo(i,f);r.panTo(u)}})},f.AttemptToSetWaypointWithUsersGeolocation=function(i){f.GetUserGeolocation(function(u){if(u){var f=n.GetCustomSimplePlace("",null,u.lat(),u.lng(),!1);t.SetLocationByGeo(null,f,!0,i);r.panTo(u)}})},window.SetUserRegion=function(n){if(n){var t=[n[0],n[1]];u.center(t,parseInt(n[2]))}},window.GetUserGeolocation=function(n){e(n)},f.GetUserGeolocation=function(n){e(n)},f},WaypointManager=function(n,t,i,r){var f={},u=[{},{}],c=function(){$(document).on("locationSelected-contextMenu",function(n,t,i){if(t=="waypoint"){var f=u.length-1;r.AddWaypointToPlanner("",!0);o(null,i,!0,f)}else o(h(t),i)});$(document).on("locationSelected-autocomplete",function(n,i,r,u,e){i=="waypoint"?t.GetWaypointLocationDetails(r,u,function(n){f.setWaypoint(n,u,!1,e)}):f.setLocation(h(i),{dummy:!0,name:r.item.label},!1)})},o=function(n,i,r,u){if(i.name)r?f.setWaypoint(i,u,!0):f.setLocation(n,i,!0);else{var e=new google.maps.Geocoder;e.geocode({location:new google.maps.LatLng(i.point.latitude,i.point.longitude)},function(e,o){var c,l,s,h;if(o==="OK")if(e[0]){for(c=0,l=1e4,s=0;s<e.length;s++)if(e[s].types.indexOf("route")!=-1||e[s].types.indexOf("street_address")!=-1){var v=e[s].geometry.location.lat(),y=e[s].geometry.location.lng(),a=Math.sqrt(Math.pow(i.point.latitude+90-(v+90),2)+Math.pow(i.point.longitude+180-(y+180),2));a<l&&(l=a,c=s)}h=t.GetAddressDetails(e[c].address_components);i.streetNumber=h.streetNumber;i.streetName=h.streetName;i.postalCode=h.postalCode;i.state=h.state;i.name=e[c].formatted_address}else i.name=i.point.latitude+", "+i.point.longitude;else i.name=i.point.latitude+", "+i.point.longitude;r?f.setWaypoint(i,u,!0):f.setLocation(n,i,!0)})}},h=function(n){return n.indexOf("from")==0},s=function(t,i){var s=t==0,h=t==u.length-1,v=f,l=u[t].marker,p=s?"A":h?"B":"W",y=a(((new Date).getTime()+(i.lat()+i.lng())*1e9).toString()),c,o;s?c="/Content/Images/Green-A.png":h?(c="/Content/Images/Red-B-New.png",$(document).trigger("hideLocationMarker")):c={path:google.maps.SymbolPath.CIRCLE,scale:4,fillColor:"#ffffff",fillOpacity:1};l?(l.setPosition(i),l.setMap(n),l.setIcon(c)):(o=new google.maps.Marker({map:n,position:i,draggable:!0,icon:c,letter:p,zIndex:-98,title:s||h?"":resources.ClickToRemove,hash:y}),u[t].marker=o,u[t].hash=y,s||h?google.maps.event.addListener(o,"dragend",function(n){var t={point:{latitude:n.latLng.lat(),longitude:n.latLng.lng()}};v.getNameForSimplePlace(t,function(n){var t=u[s?0:u.length-1].marker!==o;f.setLocation(t?h:s,n,!0);u[0].point&&u[u.length-1].point&&($("#transitRouteResults").children().length>0&&$("#routeTabContent").children().length>0?r.calculateRoute("generateDriveTransitRouteBtn"):$("#transitRouteResults").children().length>0?r.calculateRoute("generateTransitRouteBtn"):resources.AutoGenerateDriveRoute!=="True"&&r.calculateRoute("drive"))})}):(google.maps.event.addListener(o,"dragend",function(n){var f,i,s;for(loadBlockerApi.showSpinner("getNearestLocations"),f=t,i=1;i<u.length;++i)if(u[i].marker===o){f=i;break}s={point:{latitude:n.latLng.lat(),longitude:n.latLng.lng()}};v.getNameForSimplePlace(s,function(n){e(f,n,!1);r.calculateRoute();loadBlockerApi.hideSpinner("getNearestLocations")})}),o.addListener("click",function(){f.ClearWaypoint(t,o,!0);r.redrawWaypoints(!1)})))};f.getNameForSimplePlace=function(n,i){var r=new google.maps.Geocoder;r.geocode({location:new google.maps.LatLng(n.point.latitude,n.point.longitude)},function(r,u){var o,s,f,e;if(u==="OK")if(r[0]){for(o=0,s=1e4,f=0;f<r.length;f++)if(r[f].types.indexOf("route")!=-1||r[f].types.indexOf("street_address")!=1){var c=r[f].geometry.location.lat(),l=r[f].geometry.location.lng(),h=Math.sqrt(Math.pow(n.point.latitude+90-(c+90),2)+Math.pow(n.point.longitude+180-(l+180),2));h<s&&(s=h,o=f)}e=t.GetAddressDetails(r[o].address_components);n.streetNumber=e.streetNumber;n.streetName=e.streetName;n.postalCode=e.postalCode;n.state=e.state;n.name=r[o].formatted_address}else n.name=n.point.latitude+", "+n.point.longitude;else n.name=n.point.latitude+", "+n.point.longitude;i(n)})};var e=function(n,t,i){var r=n===0,f=n===u.length-1,o=r?"A":f?"B":"W",e;t.letter=o;t.point&&s(n,new google.maps.LatLng(t.point.latitude,t.point.longitude));i&&(r||f?($(r?"#startLocationText":"#endLocationText").val(t.nameDirection||t.name),$("#generateRouteBtn").focus()):$("#waypointText-"+n).val(t.nameDirection||t.name));u[n].point=t;e=$("body.mobileFirst").length>0;Modernizr.mq("(max-width: 992px)")&&e&&u[0].point&&u[u.length-1].point&&($(".mobileLocationBar .directions").trigger("click"),$("#generateRouteBtn").focus())},l=function(n,t,i,r){n.letter="W";r==!0?u[t].point.letter=="W"&&(u[t].marker.setMap(null),u[t]={point:n}):u.splice(t,0,{point:n});i&&$("#waypointText-"+t).val(n.nameDirection||n.name)},v=function(n,t){u[n]&&u[n].marker&&u[n].marker.setMap(null);u[n]={};var i=n===0,r=n===u.length-1;t&&(i||r)&&$(i?"#startLocationText":"#endLocationText").val("")},a=function(n){for(var t=0,i=0;i<n.length;i++)t=~~((t<<5)-t+n.charCodeAt(i));return t};return f.ClearWaypoint=function(n,t,i){var e,o=n===0||n===u.length-1,f;if(!o||t&&t.hash!=null){if(t&&t.hash!=null){for(f=0;f<u.length;f++)if(u[f].hash===t.hash){e=f;break}}else t=u[n].marker,e=n;e!=null&&(u.splice(e,1),t.setMap(null),i&&r.calculateRoute())}},f.clearAll=function(){f.clearMarkers();u=[{},{}];$("#startLocationText").val("");$("#endLocationText").val("");$("#waypoints").html("");i.AddWaypointToContextMenu(!1);u.length>2?($("#generateTransitRouteBtn").prop("disabled",!0),$("#generateDriveTransitRouteBtn").prop("disabled",!0)):($("#generateTransitRouteBtn").prop("disabled",!1),$("#generateDriveTransitRouteBtn").prop("disabled",!1));t.clearEntries()},f.clearMarkers=function(){u.forEach(function(n){n&&n.marker&&n.marker.setMap(null)})},f.removeWaypoints=function(){f.clearMarkers();u=[u[0],u[u.length-1]]},f.getLocationArray=function(n){var r,o,s,f,e;if(u[u.length-1].point=(u[u.length-1].point||{}).dummy==!0?null:u[u.length-1].point,u[0].point=(u[0].point||{}).dummy==!0?null:u[0].point,u.length>2?($("#generateTransitRouteBtn").prop("disabled",!0),$("#generateDriveTransitRouteBtn").prop("disabled",!0)):($("#generateTransitRouteBtn").prop("disabled",!1),$("#generateDriveTransitRouteBtn").prop("disabled",!1)),u[0].point&&u[u.length-1].point&&u.length>1){i.AddWaypointToContextMenu(!0);r=[];u.forEach(function(n){r.push(n.point)});n(r);return}e=function(){if(f=f||0,++f==2){u[0].point=u[0].point||o;u[u.length-1].point=u[u.length-1].point||s;var t=[];if(u.forEach(function(n){t.push(n.point)}),t=$.grep(t,function(n){return n!=null}),t.length<2){n(null);return}n(t)}};t.GetLocationDetails(!0,function(n){o=n;e()});t.GetLocationDetails(!1,function(n){s=n;e()})},f.setLocation=function(n,t,r){e(n?0:u.length-1,t,r);u[0].point&&u[u.length-1].point?(i.AddWaypointToContextMenu(!0),$(document).trigger("generateRoute-waypointManager")):i.AddWaypointToContextMenu(!1);$(document).trigger("removeMyLocationMarker")},f.setWaypoint=function(n,t,i,r){u.length>2?($("#generateTransitRouteBtn").prop("disabled",!0),$("#generateDriveTransitRouteBtn").prop("disabled",!0)):($("#generateTransitRouteBtn").prop("disabled",!1),$("#generateDriveTransitRouteBtn").prop("disabled",!1));l(n,t,i,r);n.point&&s(t,new google.maps.LatLng(n.point.latitude,n.point.longitude))},f.SetLocationByGeo=o,f.setDetails=function(){for(var n=0;n<u.length;++n)u[n].point&&e(n,u[n].point,!0)},f.setStartEndPoint=function(n,t){f.clearAll();e(0,n,!0);e(u.length-1,t,!0)},f.setAllLocations=function(n){f.setStartEndPoint(n[0],n[n.length-1]);for(var t=1;t<n.length-1;++t)f.setWaypoint(n[t],t)},f.swapStartEnd=function(){u.reverse()},f.getLocations=function(){return u},f.adjustMarker=function(n,t,i){var r=new google.maps.LatLng(t,i);s(n,r)},c(),f},CitizenReporter=function(){function n(){this.addReport=function(n,t){$.ajax("/wta/wtaoptions",{data:{id:n,modalType:"CitizenReport"}}).done(function(i){var r=bootbox.dialog({title:t,message:i,closeButton:!1,className:"wtaContentModel crStatus",buttons:{save:{label:resources.Save,className:"btn-primary bootboxSave",callback:function(){var t=[];$(".wtaOptionsParent select",this).each(function(){$.each($.makeArray($(this).val()),function(){t.push({Id:this})})});$.ajax("/wta/addCitizenReport",{type:"POST",data:{data:{id:n,statuses:t}}}).done(function(){bootbox.alert(resources.CitizenReporterReportSubmited,null)}).fail(function(){bootbox.alert(resources.CitizenReporterReportFailed,null)})}},cancel:{label:resources.Cancel,className:"btn-primary"}}});$(".selectpicker",r).selectpicker({noneSelectedText:resources.NoneSelected,selectedTextFormat:"count > 3"})}).fail(function(){bootbox.alert(resources.ErrorLoadingWtaContent,null)})}}return n}(),citizenReporter=new CitizenReporter;(function(n){var t;n.fn.printThis=function(i){var u,e,o,f,s,r;t=n.extend({},n.fn.printThis.defaults,i);u=this instanceof jQuery?this:n(this);e="printThis-"+(new Date).getTime();window.location.hostname!==document.domain&&navigator.userAgent.match(/msie/i)?(o='javascript:document.write("<head><script>document.domain=\\"'+document.domain+'\\";<\/script><\/head><body><\/body>")',f=document.createElement("iframe"),f.name="printIframe",f.id=e,f.className="MSIE",document.body.appendChild(f),f.src=o):(s=n("<iframe id='"+e+"' name='printIframe' />"),s.appendTo("body"));r=n("#"+e);t.debug||r.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"});setTimeout(function(){var i=r.contents(),f=i.find("head"),e=i.find("body"),o,s,h;f.append('<base href="'+document.location.protocol+"//"+document.location.host+'">');t.importCSS&&n("link[rel=stylesheet]").each(function(){var t=n(this).attr("href"),i;t&&(i=n(this).attr("media")||"all",f.append("<link type='text/css' rel='stylesheet' href='"+t+"' media='"+i+"'>"))});t.importStyle&&n("style").each(function(){n(this).clone().appendTo(f)});t.pageTitle&&f.append("<title>"+t.pageTitle+"<\/title>");t.loadCSS&&(n.isArray(t.loadCSS)?jQuery.each(t.loadCSS,function(){f.append("<link type='text/css' rel='stylesheet' href='"+this+"'>")}):f.append("<link type='text/css' rel='stylesheet' href='"+t.loadCSS+"'>"));t.header&&e.append(t.header);t.printContainer?e.append(u.outer()):u.each(function(){e.append(n(this).html())});t.formValues&&(o=u.find("input"),o.length&&o.each(function(){var t=n(this),r=n(this).attr("name"),e=t.is(":checkbox")||t.is(":radio"),u=i.find('input[name="'+r+'"]'),f=t.val();e?t.is(":checked")&&(t.is(":checkbox")?u.attr("checked","checked"):t.is(":radio")&&i.find('input[name="'+r+'"][value='+f+"]").attr("checked","checked")):u.val(f)}),s=u.find("select"),s.length&&s.each(function(){var t=n(this),r=n(this).attr("name"),u=t.val();i.find('select[name="'+r+'"]').val(u)}),h=u.find("textarea"),h.length&&h.each(function(){var t=n(this),r=n(this).attr("name"),u=t.val();i.find('textarea[name="'+r+'"]').val(u)}));t.removeInline&&(n.isFunction(n.removeAttr)?i.find("body *").removeAttr("style"):i.find("body *").attr("style",""));setTimeout(function(){r.hasClass("MSIE")?(window.frames.printIframe.focus(),f.append("<script>  window.print(); <\/script>")):(r[0].contentWindow.focus(),r[0].contentWindow.print());t.debug||setTimeout(function(){r.remove()},1e3)},t.printDelay)},333)};n.fn.printThis.defaults={debug:!1,importCSS:!0,importStyle:!1,printContainer:!0,loadCSS:"",pageTitle:"",removeInline:!1,printDelay:333,header:null,formValues:!0};jQuery.fn.outer=function(){return n(n("<div><\/div>").html(this.clone())).html()}})(jQuery),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports!="undefined"?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";var t=window.Slick||{};t=function(){function i(i,r){var u=this,f;u.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:n(i),appendDots:n(i),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous<\/button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next<\/button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,i){return n('<button type="button" />').text(i+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3};u.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1};n.extend(u,u.initials);u.activeBreakpoint=null;u.animType=null;u.animProp=null;u.breakpoints=[];u.breakpointSettings=[];u.cssTransitions=!1;u.focussed=!1;u.interrupted=!1;u.hidden="hidden";u.paused=!0;u.positionProp=null;u.respondTo=null;u.rowCount=1;u.shouldClick=!0;u.$slider=n(i);u.$slidesCache=null;u.transformType=null;u.transitionType=null;u.visibilityChange="visibilitychange";u.windowWidth=0;u.windowTimer=null;f=n(i).data("slick")||{};u.options=n.extend({},u.defaults,r,f);u.currentSlide=u.options.initialSlide;u.originalSettings=u.options;typeof document.mozHidden!="undefined"?(u.hidden="mozHidden",u.visibilityChange="mozvisibilitychange"):typeof document.webkitHidden!="undefined"&&(u.hidden="webkitHidden",u.visibilityChange="webkitvisibilitychange");u.autoPlay=n.proxy(u.autoPlay,u);u.autoPlayClear=n.proxy(u.autoPlayClear,u);u.autoPlayIterator=n.proxy(u.autoPlayIterator,u);u.changeSlide=n.proxy(u.changeSlide,u);u.clickHandler=n.proxy(u.clickHandler,u);u.selectHandler=n.proxy(u.selectHandler,u);u.setPosition=n.proxy(u.setPosition,u);u.swipeHandler=n.proxy(u.swipeHandler,u);u.dragHandler=n.proxy(u.dragHandler,u);u.keyHandler=n.proxy(u.keyHandler,u);u.instanceUid=t++;u.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;u.registerBreakpoints();u.init(!0)}var t=0;return i}();t.prototype.activateADA=function(){var n=this;n.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})};t.prototype.addSlide=t.prototype.slickAdd=function(t,i,r){var u=this;if(typeof i=="boolean")r=i,i=null;else if(i<0||i>=u.slideCount)return!1;u.unload();typeof i=="number"?i===0&&u.$slides.length===0?n(t).appendTo(u.$slideTrack):r?n(t).insertBefore(u.$slides.eq(i)):n(t).insertAfter(u.$slides.eq(i)):r===!0?n(t).prependTo(u.$slideTrack):n(t).appendTo(u.$slideTrack);u.$slides=u.$slideTrack.children(this.options.slide);u.$slideTrack.children(this.options.slide).detach();u.$slideTrack.append(u.$slides);u.$slides.each(function(t,i){n(i).attr("data-slick-index",t)});u.$slidesCache=u.$slides;u.reinit()};t.prototype.animateHeight=function(){var n=this,t;n.options.slidesToShow===1&&n.options.adaptiveHeight===!0&&n.options.vertical===!1&&(t=n.$slides.eq(n.currentSlide).outerHeight(!0),n.$list.animate({height:t},n.options.speed))};t.prototype.animateSlide=function(t,i){var u={},r=this;r.animateHeight();r.options.rtl===!0&&r.options.vertical===!1&&(t=-t);r.transformsEnabled===!1?r.options.vertical===!1?r.$slideTrack.animate({left:t},r.options.speed,r.options.easing,i):r.$slideTrack.animate({top:t},r.options.speed,r.options.easing,i):r.cssTransitions===!1?(r.options.rtl===!0&&(r.currentLeft=-r.currentLeft),n({animStart:r.currentLeft}).animate({animStart:t},{duration:r.options.speed,easing:r.options.easing,step:function(n){n=Math.ceil(n);r.options.vertical===!1?(u[r.animType]="translate("+n+"px, 0px)",r.$slideTrack.css(u)):(u[r.animType]="translate(0px,"+n+"px)",r.$slideTrack.css(u))},complete:function(){i&&i.call()}})):(r.applyTransition(),t=Math.ceil(t),u[r.animType]=r.options.vertical===!1?"translate3d("+t+"px, 0px, 0px)":"translate3d(0px,"+t+"px, 0px)",r.$slideTrack.css(u),i&&setTimeout(function(){r.disableTransition();i.call()},r.options.speed))};t.prototype.getNavTarget=function(){var i=this,t=i.options.asNavFor;return t&&t!==null&&(t=n(t).not(i.$slider)),t};t.prototype.asNavFor=function(t){var r=this,i=r.getNavTarget();i!==null&&typeof i=="object"&&i.each(function(){var i=n(this).slick("getSlick");i.unslicked||i.slideHandler(t,!0)})};t.prototype.applyTransition=function(n){var t=this,i={};i[t.transitionType]=t.options.fade===!1?t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:"opacity "+t.options.speed+"ms "+t.options.cssEase;t.options.fade===!1?t.$slideTrack.css(i):t.$slides.eq(n).css(i)};t.prototype.autoPlay=function(){var n=this;n.autoPlayClear();n.slideCount>n.options.slidesToShow&&(n.autoPlayTimer=setInterval(n.autoPlayIterator,n.options.autoplaySpeed))};t.prototype.autoPlayClear=function(){var n=this;n.autoPlayTimer&&clearInterval(n.autoPlayTimer)};t.prototype.autoPlayIterator=function(){var n=this,t=n.currentSlide+n.options.slidesToScroll;n.paused||n.interrupted||n.focussed||(n.options.infinite===!1&&(n.direction===1&&n.currentSlide+1===n.slideCount-1?n.direction=0:n.direction===0&&(t=n.currentSlide-n.options.slidesToScroll,n.currentSlide-1==0&&(n.direction=1))),n.slideHandler(t))};t.prototype.buildArrows=function(){var t=this;t.options.arrows===!0&&(t.$prevArrow=n(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=n(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),t.options.infinite!==!0&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))};t.prototype.buildDots=function(){var t=this,i,r;if(t.options.dots===!0&&t.slideCount>t.options.slidesToShow){for(t.$slider.addClass("slick-dotted"),r=n("<ul />").addClass(t.options.dotsClass),i=0;i<=t.getDotCount();i+=1)r.append(n("<li />").append(t.options.customPaging.call(this,t,i)));t.$dots=r.appendTo(t.options.appendDots);t.$dots.find("li").first().addClass("slick-active")}};t.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide");t.slideCount=t.$slides.length;t.$slides.each(function(t,i){n(i).attr("data-slick-index",t).data("originalStyling",n(i).attr("style")||"")});t.$slider.addClass("slick-slider");t.$slideTrack=t.slideCount===0?n('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent();t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent();t.$slideTrack.css("opacity",0);(t.options.centerMode===!0||t.options.swipeToSlide===!0)&&(t.options.slidesToScroll=1);n("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading");t.setupInfinite();t.buildArrows();t.buildDots();t.updateDots();t.setSlideClasses(typeof t.currentSlide=="number"?t.currentSlide:0);t.options.draggable===!0&&t.$list.addClass("draggable")};t.prototype.buildRows=function(){var n=this,t,i,r,f,c,u,e,o,s,h;if(f=document.createDocumentFragment(),u=n.$slider.children(),n.options.rows>0){for(e=n.options.slidesPerRow*n.options.rows,c=Math.ceil(u.length/e),t=0;t<c;t++){for(o=document.createElement("div"),i=0;i<n.options.rows;i++){for(s=document.createElement("div"),r=0;r<n.options.slidesPerRow;r++)h=t*e+(i*n.options.slidesPerRow+r),u.get(h)&&s.appendChild(u.get(h));o.appendChild(s)}f.appendChild(o)}n.$slider.empty().append(f);n.$slider.children().children().children().css({width:100/n.options.slidesPerRow+"%",display:"inline-block"})}};t.prototype.checkResponsive=function(t,i){var r=this,f,u,e,o=!1,s=r.$slider.width(),h=window.innerWidth||n(window).width();if(r.respondTo==="window"?e=h:r.respondTo==="slider"?e=s:r.respondTo==="min"&&(e=Math.min(h,s)),r.options.responsive&&r.options.responsive.length&&r.options.responsive!==null){u=null;for(f in r.breakpoints)r.breakpoints.hasOwnProperty(f)&&(r.originalSettings.mobileFirst===!1?e<r.breakpoints[f]&&(u=r.breakpoints[f]):e>r.breakpoints[f]&&(u=r.breakpoints[f]));u!==null?r.activeBreakpoint!==null?(u!==r.activeBreakpoint||i)&&(r.activeBreakpoint=u,r.breakpointSettings[u]==="unslick"?r.unslick(u):(r.options=n.extend({},r.originalSettings,r.breakpointSettings[u]),t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),o=u):(r.activeBreakpoint=u,r.breakpointSettings[u]==="unslick"?r.unslick(u):(r.options=n.extend({},r.originalSettings,r.breakpointSettings[u]),t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),o=u):r.activeBreakpoint!==null&&(r.activeBreakpoint=null,r.options=r.originalSettings,t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t),o=u);t||o===!1||r.$slider.trigger("breakpoint",[r,o])}};t.prototype.changeSlide=function(t,i){var r=this,u=n(t.currentTarget),f,e,o,s;u.is("a")&&t.preventDefault();u.is("li")||(u=u.closest("li"));o=r.slideCount%r.options.slidesToScroll!=0;f=o?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll;switch(t.data.message){case"previous":e=f===0?r.options.slidesToScroll:r.options.slidesToShow-f;r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-e,!1,i);break;case"next":e=f===0?r.options.slidesToScroll:f;r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+e,!1,i);break;case"index":s=t.data.index===0?0:t.data.index||u.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(s),!1,i);u.children().trigger("focus");break;default:return}};t.prototype.checkNavigable=function(n){var u=this,t,i,r;if(t=u.getNavigableIndexes(),i=0,n>t[t.length-1])n=t[t.length-1];else for(r in t){if(n<t[r]){n=i;break}i=t[r]}return n};t.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&t.$dots!==null&&(n("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",n.proxy(t.interrupt,t,!0)).off("mouseleave.slick",n.proxy(t.interrupt,t,!1)),t.options.accessibility===!0&&t.$dots.off("keydown.slick",t.keyHandler));t.$slider.off("focus.slick blur.slick");t.options.arrows===!0&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide),t.options.accessibility===!0&&(t.$prevArrow&&t.$prevArrow.off("keydown.slick",t.keyHandler),t.$nextArrow&&t.$nextArrow.off("keydown.slick",t.keyHandler)));t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler);t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler);t.$list.off("touchend.slick mouseup.slick",t.swipeHandler);t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler);t.$list.off("click.slick",t.clickHandler);n(document).off(t.visibilityChange,t.visibility);t.cleanUpSlideEvents();t.options.accessibility===!0&&t.$list.off("keydown.slick",t.keyHandler);t.options.focusOnSelect===!0&&n(t.$slideTrack).children().off("click.slick",t.selectHandler);n(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange);n(window).off("resize.slick.slick-"+t.instanceUid,t.resize);n("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault);n(window).off("load.slick.slick-"+t.instanceUid,t.setPosition)};t.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",n.proxy(t.interrupt,t,!0));t.$list.off("mouseleave.slick",n.proxy(t.interrupt,t,!1))};t.prototype.cleanUpRows=function(){var n=this,t;n.options.rows>0&&(t=n.$slides.children().children(),t.removeAttr("style"),n.$slider.empty().append(t))};t.prototype.clickHandler=function(n){var t=this;t.shouldClick===!1&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault())};t.prototype.destroy=function(t){var i=this;i.autoPlayClear();i.touchObject={};i.cleanUpEvents();n(".slick-cloned",i.$slider).detach();i.$dots&&i.$dots.remove();i.$prevArrow&&i.$prevArrow.length&&(i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove());i.$nextArrow&&i.$nextArrow.length&&(i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove());i.$slides&&(i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){n(this).attr("style",n(this).data("originalStyling"))}),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.detach(),i.$list.detach(),i.$slider.append(i.$slides));i.cleanUpRows();i.$slider.removeClass("slick-slider");i.$slider.removeClass("slick-initialized");i.$slider.removeClass("slick-dotted");i.unslicked=!0;t||i.$slider.trigger("destroy",[i])};t.prototype.disableTransition=function(n){var t=this,i={};i[t.transitionType]="";t.options.fade===!1?t.$slideTrack.css(i):t.$slides.eq(n).css(i)};t.prototype.fadeSlide=function(n,t){var i=this;i.cssTransitions===!1?(i.$slides.eq(n).css({zIndex:i.options.zIndex}),i.$slides.eq(n).animate({opacity:1},i.options.speed,i.options.easing,t)):(i.applyTransition(n),i.$slides.eq(n).css({opacity:1,zIndex:i.options.zIndex}),t&&setTimeout(function(){i.disableTransition(n);t.call()},i.options.speed))};t.prototype.fadeSlideOut=function(n){var t=this;t.cssTransitions===!1?t.$slides.eq(n).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(n),t.$slides.eq(n).css({opacity:0,zIndex:t.options.zIndex-2}))};t.prototype.filterSlides=t.prototype.slickFilter=function(n){var t=this;n!==null&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(n).appendTo(t.$slideTrack),t.reinit())};t.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(){var i=n(this);setTimeout(function(){t.options.pauseOnFocus&&i.is(":focus")&&(t.focussed=!0,t.autoPlay())},0)}).on("blur.slick","*",function(){var i=n(this);t.options.pauseOnFocus&&(t.focussed=!1,t.autoPlay())})};t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){var n=this;return n.currentSlide};t.prototype.getDotCount=function(){var n=this,i=0,r=0,t=0;if(n.options.infinite===!0)if(n.slideCount<=n.options.slidesToShow)++t;else while(i<n.slideCount)++t,i=r+n.options.slidesToScroll,r+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;else if(n.options.centerMode===!0)t=n.slideCount;else if(n.options.asNavFor)while(i<n.slideCount)++t,i=r+n.options.slidesToScroll,r+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;else t=1+Math.ceil((n.slideCount-n.options.slidesToShow)/n.options.slidesToScroll);return t-1};t.prototype.getLeft=function(n){var t=this,f,r,u=0,i,e;return t.slideOffset=0,r=t.$slides.first().outerHeight(!0),t.options.infinite===!0?(t.slideCount>t.options.slidesToShow&&(t.slideOffset=t.slideWidth*t.options.slidesToShow*-1,e=-1,t.options.vertical===!0&&t.options.centerMode===!0&&(t.options.slidesToShow===2?e=-1.5:t.options.slidesToShow===1&&(e=-2)),u=r*t.options.slidesToShow*e),t.slideCount%t.options.slidesToScroll!=0&&n+t.options.slidesToScroll>t.slideCount&&t.slideCount>t.options.slidesToShow&&(n>t.slideCount?(t.slideOffset=(t.options.slidesToShow-(n-t.slideCount))*t.slideWidth*-1,u=(t.options.slidesToShow-(n-t.slideCount))*r*-1):(t.slideOffset=t.slideCount%t.options.slidesToScroll*t.slideWidth*-1,u=t.slideCount%t.options.slidesToScroll*r*-1))):n+t.options.slidesToShow>t.slideCount&&(t.slideOffset=(n+t.options.slidesToShow-t.slideCount)*t.slideWidth,u=(n+t.options.slidesToShow-t.slideCount)*r),t.slideCount<=t.options.slidesToShow&&(t.slideOffset=0,u=0),t.options.centerMode===!0&&t.slideCount<=t.options.slidesToShow?t.slideOffset=t.slideWidth*Math.floor(t.options.slidesToShow)/2-t.slideWidth*t.slideCount/2:t.options.centerMode===!0&&t.options.infinite===!0?t.slideOffset+=t.slideWidth*Math.floor(t.options.slidesToShow/2)-t.slideWidth:t.options.centerMode===!0&&(t.slideOffset=0,t.slideOffset+=t.slideWidth*Math.floor(t.options.slidesToShow/2)),f=t.options.vertical===!1?n*t.slideWidth*-1+t.slideOffset:n*r*-1+u,t.options.variableWidth===!0&&(i=t.slideCount<=t.options.slidesToShow||t.options.infinite===!1?t.$slideTrack.children(".slick-slide").eq(n):t.$slideTrack.children(".slick-slide").eq(n+t.options.slidesToShow),f=t.options.rtl===!0?i[0]?(t.$slideTrack.width()-i[0].offsetLeft-i.width())*-1:0:i[0]?i[0].offsetLeft*-1:0,t.options.centerMode===!0&&(i=t.slideCount<=t.options.slidesToShow||t.options.infinite===!1?t.$slideTrack.children(".slick-slide").eq(n):t.$slideTrack.children(".slick-slide").eq(n+t.options.slidesToShow+1),f=(t.options.rtl===!0?i[0]?(t.$slideTrack.width()-i[0].offsetLeft-i.width())*-1:0:i[0]?i[0].offsetLeft*-1:0)+(t.$list.width()-i.outerWidth())/2)),f};t.prototype.getOption=t.prototype.slickGetOption=function(n){var t=this;return t.options[n]};t.prototype.getNavigableIndexes=function(){var n=this,t=0,i=0,u=[],r;for(n.options.infinite===!1?r=n.slideCount:(t=n.options.slidesToScroll*-1,i=n.options.slidesToScroll*-1,r=n.slideCount*2);t<r;)u.push(t),t=i+n.options.slidesToScroll,i+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;return u};t.prototype.getSlick=function(){return this};t.prototype.getSlideCount=function(){var t=this,i,r,u;return u=t.options.centerMode===!0?Math.floor(t.$list.width()/2):0,r=t.swipeLeft*-1+u,t.options.swipeToSlide===!0?(t.$slideTrack.find(".slick-slide").each(function(u,f){var e,o,s;return e=n(f).outerWidth(),o=f.offsetLeft,t.options.centerMode!==!0&&(o+=e/2),s=o+e,r<s?(i=f,!1):void 0}),Math.abs(n(i).attr("data-slick-index")-t.currentSlide)||1):t.options.slidesToScroll};t.prototype.goTo=t.prototype.slickGoTo=function(n,t){var i=this;i.changeSlide({data:{message:"index",index:parseInt(n)}},t)};t.prototype.init=function(t){var i=this;n(i.$slider).hasClass("slick-initialized")||(n(i.$slider).addClass("slick-initialized"),i.buildRows(),i.buildOut(),i.setProps(),i.startLoad(),i.loadSlider(),i.initializeEvents(),i.updateArrows(),i.updateDots(),i.checkResponsive(!0),i.focusHandler());t&&i.$slider.trigger("init",[i]);i.options.accessibility===!0&&i.initADA();i.options.autoplay&&(i.paused=!1,i.autoPlay())};t.prototype.initADA=function(){var t=this,f=Math.ceil(t.slideCount/t.options.slidesToShow),r=t.getNavigableIndexes().filter(function(n){return n>=0&&n<t.slideCount}),i,u;for(t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),t.$dots!==null&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(i){var f=r.indexOf(i),u;n(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+i,tabindex:-1});f!==-1&&(u="slick-slide-control"+t.instanceUid+f,n("#"+u).length&&n(this).attr({"aria-describedby":u}))}),t.$dots.attr("role","tablist").find("li").each(function(i){var u=r[i];n(this).attr({role:"presentation"});n(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+i,"aria-controls":"slick-slide"+t.instanceUid+u,"aria-label":i+1+" of "+f,"aria-selected":null,tabindex:"-1"})}).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end()),i=t.currentSlide,u=i+t.options.slidesToShow;i<u;i++)t.options.focusOnChange?t.$slides.eq(i).attr({tabindex:"0"}):t.$slides.eq(i).removeAttr("tabindex");t.activateADA()};t.prototype.initArrowEvents=function(){var n=this;if(n.options.arrows===!0&&n.slideCount>n.options.slidesToShow){n.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},n.changeSlide);n.$nextArrow.off("click.slick").on("click.slick",{message:"next"},n.changeSlide);if(n.options.accessibility===!0){n.$prevArrow.on("keydown.slick",n.keyHandler);n.$nextArrow.on("keydown.slick",n.keyHandler)}}};t.prototype.initDotEvents=function(){var t=this;if(t.options.dots===!0&&t.slideCount>t.options.slidesToShow){n("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide);if(t.options.accessibility===!0)t.$dots.on("keydown.slick",t.keyHandler)}if(t.options.dots===!0&&t.options.pauseOnDotsHover===!0&&t.slideCount>t.options.slidesToShow)n("li",t.$dots).on("mouseenter.slick",n.proxy(t.interrupt,t,!0)).on("mouseleave.slick",n.proxy(t.interrupt,t,!1))};t.prototype.initSlideEvents=function(){var t=this;if(t.options.pauseOnHover){t.$list.on("mouseenter.slick",n.proxy(t.interrupt,t,!0));t.$list.on("mouseleave.slick",n.proxy(t.interrupt,t,!1))}};t.prototype.initializeEvents=function(){var t=this;t.initArrowEvents();t.initDotEvents();t.initSlideEvents();t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler);t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler);t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler);t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler);t.$list.on("click.slick",t.clickHandler);n(document).on(t.visibilityChange,n.proxy(t.visibility,t));if(t.options.accessibility===!0)t.$list.on("keydown.slick",t.keyHandler);if(t.options.focusOnSelect===!0)n(t.$slideTrack).children().on("click.slick",t.selectHandler);n(window).on("orientationchange.slick.slick-"+t.instanceUid,n.proxy(t.orientationChange,t));n(window).on("resize.slick.slick-"+t.instanceUid,n.proxy(t.resize,t));n("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault);n(window).on("load.slick.slick-"+t.instanceUid,t.setPosition);n(t.setPosition)};t.prototype.initUI=function(){var n=this;n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&(n.$prevArrow.show(),n.$nextArrow.show());n.options.dots===!0&&n.slideCount>n.options.slidesToShow&&n.$dots.show()};t.prototype.keyHandler=function(n){var t=this;n.target.tagName.match("TEXTAREA|INPUT|SELECT")||(n.keyCode===37&&t.options.accessibility===!0?t.changeSlide({data:{message:t.options.rtl===!0?"next":"previous"}}):n.keyCode===39&&t.options.accessibility===!0&&t.changeSlide({data:{message:t.options.rtl===!0?"previous":"next"}}))};t.prototype.lazyLoad=function(){function e(i){n("img[data-lazy]",i).each(function(){var i=n(this),r=n(this).attr("data-lazy"),u=n(this).attr("data-srcset"),e=n(this).attr("data-srcloaded"),f=n(this).attr("data-sizes")||t.$slider.attr("data-sizes");e||(i.attr("data-srcloaded","true"),i.animate({opacity:0},100,function(){u&&(i.attr("srcset",u),f&&i.attr("sizes",f));i.attr("src",r).animate({opacity:1},200,function(){i.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")});t.$slider.trigger("lazyLoaded",[t,i,r])}))})}var t=this,u,f,i,r,s;if(t.options.centerMode===!0?t.options.infinite===!0?(i=t.currentSlide+(t.options.slidesToShow/2+1),r=i+t.options.slidesToShow+2):(i=Math.max(0,t.currentSlide-(t.options.slidesToShow/2+1)),r=2+(t.options.slidesToShow/2+1)+t.currentSlide):(i=t.options.infinite?t.options.slidesToShow+t.currentSlide:t.currentSlide,r=Math.ceil(i+t.options.slidesToShow),t.options.fade===!0&&(i>0&&i--,r<=t.slideCount&&r++)),u=t.$slider.find(".slick-slide").slice(i,r),t.options.lazyLoad==="anticipated"){var o=i-1,h=r,c=t.$slider.find(".slick-slide");for(s=0;s<t.options.slidesToScroll;s++)o<0&&(o=t.slideCount-1),u=u.add(c.eq(o)),u=u.add(c.eq(h)),o--,h++}e(u);t.slideCount<=t.options.slidesToShow?(f=t.$slider.find(".slick-slide"),e(f)):t.currentSlide>=t.slideCount-t.options.slidesToShow?(f=t.$slider.find(".slick-cloned").slice(0,t.options.slidesToShow),e(f)):t.currentSlide===0&&(f=t.$slider.find(".slick-cloned").slice(t.options.slidesToShow*-1),e(f))};t.prototype.loadSlider=function(){var n=this;n.setPosition();n.$slideTrack.css({opacity:1});n.$slider.removeClass("slick-loading");n.initUI();n.options.lazyLoad==="progressive"&&n.progressiveLazyLoad()};t.prototype.next=t.prototype.slickNext=function(){var n=this;n.changeSlide({data:{message:"next"}})};t.prototype.orientationChange=function(){var n=this;n.checkResponsive();n.setPosition()};t.prototype.pause=t.prototype.slickPause=function(){var n=this;n.autoPlayClear();n.paused=!0};t.prototype.play=t.prototype.slickPlay=function(){var n=this;n.autoPlay();n.options.autoplay=!0;n.paused=!1;n.focussed=!1;n.interrupted=!1};t.prototype.postSlide=function(t){var i=this,r;i.unslicked||(i.$slider.trigger("afterChange",[i,t]),i.animating=!1,i.slideCount>i.options.slidesToShow&&i.setPosition(),i.swipeLeft=null,i.options.autoplay&&i.autoPlay(),i.options.accessibility===!0&&(i.initADA(),i.options.focusOnChange&&(r=n(i.$slides.get(i.currentSlide)),r.attr("tabindex",0).focus())))};t.prototype.prev=t.prototype.slickPrev=function(){var n=this;n.changeSlide({data:{message:"previous"}})};t.prototype.preventDefault=function(n){n.preventDefault()};t.prototype.progressiveLazyLoad=function(t){t=t||1;var i=this,s=n("img[data-lazy]",i.$slider),r,u,e,o,f;s.length?(r=s.first(),u=r.attr("data-lazy"),e=r.attr("data-srcset"),o=r.attr("data-sizes")||i.$slider.attr("data-sizes"),f=document.createElement("img"),f.onload=function(){e&&(r.attr("srcset",e),o&&r.attr("sizes",o));r.attr("src",u).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");i.options.adaptiveHeight===!0&&i.setPosition();i.$slider.trigger("lazyLoaded",[i,r,u]);i.progressiveLazyLoad()},f.onerror=function(){t<3?setTimeout(function(){i.progressiveLazyLoad(t+1)},500):(r.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),i.$slider.trigger("lazyLoadError",[i,r,u]),i.progressiveLazyLoad())},f.src=u):i.$slider.trigger("allImagesLoaded",[i])};t.prototype.refresh=function(t){var i=this,r,u;u=i.slideCount-i.options.slidesToShow;!i.options.infinite&&i.currentSlide>u&&(i.currentSlide=u);i.slideCount<=i.options.slidesToShow&&(i.currentSlide=0);r=i.currentSlide;i.destroy(!0);n.extend(i,i.initials,{currentSlide:r});i.init();t||i.changeSlide({data:{message:"index",index:r}},!1)};t.prototype.registerBreakpoints=function(){var t=this,u,f,i,r=t.options.responsive||null;if(n.type(r)==="array"&&r.length){t.respondTo=t.options.respondTo||"window";for(u in r)if(i=t.breakpoints.length-1,r.hasOwnProperty(u)){for(f=r[u].breakpoint;i>=0;)t.breakpoints[i]&&t.breakpoints[i]===f&&t.breakpoints.splice(i,1),i--;t.breakpoints.push(f);t.breakpointSettings[f]=r[u].settings}t.breakpoints.sort(function(n,i){return t.options.mobileFirst?n-i:i-n})}};t.prototype.reinit=function(){var t=this;if(t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&t.currentSlide!==0&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),t.options.focusOnSelect===!0)n(t.$slideTrack).children().on("click.slick",t.selectHandler);t.setSlideClasses(typeof t.currentSlide=="number"?t.currentSlide:0);t.setPosition();t.focusHandler();t.paused=!t.options.autoplay;t.autoPlay();t.$slider.trigger("reInit",[t])};t.prototype.resize=function(){var t=this;n(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=n(window).width();t.checkResponsive();t.unslicked||t.setPosition()},50))};t.prototype.removeSlide=t.prototype.slickRemove=function(n,t,i){var r=this;if(typeof n=="boolean"?(t=n,n=t===!0?0:r.slideCount-1):n=t===!0?--n:n,r.slideCount<1||n<0||n>r.slideCount-1)return!1;r.unload();i===!0?r.$slideTrack.children().remove():r.$slideTrack.children(this.options.slide).eq(n).remove();r.$slides=r.$slideTrack.children(this.options.slide);r.$slideTrack.children(this.options.slide).detach();r.$slideTrack.append(r.$slides);r.$slidesCache=r.$slides;r.reinit()};t.prototype.setCSS=function(n){var t=this,i={},r,u;t.options.rtl===!0&&(n=-n);r=t.positionProp=="left"?Math.ceil(n)+"px":"0px";u=t.positionProp=="top"?Math.ceil(n)+"px":"0px";i[t.positionProp]=n;t.transformsEnabled===!1?t.$slideTrack.css(i):(i={},t.cssTransitions===!1?(i[t.animType]="translate("+r+", "+u+")",t.$slideTrack.css(i)):(i[t.animType]="translate3d("+r+", "+u+", 0px)",t.$slideTrack.css(i)))};t.prototype.setDimensions=function(){var n=this,t;n.options.vertical===!1?n.options.centerMode===!0&&n.$list.css({padding:"0px "+n.options.centerPadding}):(n.$list.height(n.$slides.first().outerHeight(!0)*n.options.slidesToShow),n.options.centerMode===!0&&n.$list.css({padding:n.options.centerPadding+" 0px"}));n.listWidth=n.$list.width();n.listHeight=n.$list.height();n.options.vertical===!1&&n.options.variableWidth===!1?(n.slideWidth=Math.ceil(n.listWidth/n.options.slidesToShow),n.$slideTrack.width(Math.ceil(n.slideWidth*n.$slideTrack.children(".slick-slide").length))):n.options.variableWidth===!0?n.$slideTrack.width(5e3*n.slideCount):(n.slideWidth=Math.ceil(n.listWidth),n.$slideTrack.height(Math.ceil(n.$slides.first().outerHeight(!0)*n.$slideTrack.children(".slick-slide").length)));t=n.$slides.first().outerWidth(!0)-n.$slides.first().width();n.options.variableWidth===!1&&n.$slideTrack.children(".slick-slide").width(n.slideWidth-t)};t.prototype.setFade=function(){var t=this,i;t.$slides.each(function(r,u){i=t.slideWidth*r*-1;t.options.rtl===!0?n(u).css({position:"relative",right:i,top:0,zIndex:t.options.zIndex-2,opacity:0}):n(u).css({position:"relative",left:i,top:0,zIndex:t.options.zIndex-2,opacity:0})});t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})};t.prototype.setHeight=function(){var n=this,t;n.options.slidesToShow===1&&n.options.adaptiveHeight===!0&&n.options.vertical===!1&&(t=n.$slides.eq(n.currentSlide).outerHeight(!0),n.$list.css("height",t))};t.prototype.setOption=t.prototype.slickSetOption=function(){var t=this,u,f,e,i,o=!1,r;if(n.type(arguments[0])==="object"?(e=arguments[0],o=arguments[1],r="multiple"):n.type(arguments[0])==="string"&&(e=arguments[0],i=arguments[1],o=arguments[2],arguments[0]==="responsive"&&n.type(arguments[1])==="array"?r="responsive":typeof arguments[1]!="undefined"&&(r="single")),r==="single")t.options[e]=i;else if(r==="multiple")n.each(e,function(n,i){t.options[n]=i});else if(r==="responsive")for(f in i)if(n.type(t.options.responsive)!=="array")t.options.responsive=[i[f]];else{for(u=t.options.responsive.length-1;u>=0;)t.options.responsive[u].breakpoint===i[f].breakpoint&&t.options.responsive.splice(u,1),u--;t.options.responsive.push(i[f])}o&&(t.unload(),t.reinit())};t.prototype.setPosition=function(){var n=this;n.setDimensions();n.setHeight();n.options.fade===!1?n.setCSS(n.getLeft(n.currentSlide)):n.setFade();n.$slider.trigger("setPosition",[n])};t.prototype.setProps=function(){var n=this,t=document.body.style;n.positionProp=n.options.vertical===!0?"top":"left";n.positionProp==="top"?n.$slider.addClass("slick-vertical"):n.$slider.removeClass("slick-vertical");(t.WebkitTransition!==undefined||t.MozTransition!==undefined||t.msTransition!==undefined)&&n.options.useCSS===!0&&(n.cssTransitions=!0);n.options.fade&&(typeof n.options.zIndex=="number"?n.options.zIndex<3&&(n.options.zIndex=3):n.options.zIndex=n.defaults.zIndex);t.OTransform!==undefined&&(n.animType="OTransform",n.transformType="-o-transform",n.transitionType="OTransition",t.perspectiveProperty===undefined&&t.webkitPerspective===undefined&&(n.animType=!1));t.MozTransform!==undefined&&(n.animType="MozTransform",n.transformType="-moz-transform",n.transitionType="MozTransition",t.perspectiveProperty===undefined&&t.MozPerspective===undefined&&(n.animType=!1));t.webkitTransform!==undefined&&(n.animType="webkitTransform",n.transformType="-webkit-transform",n.transitionType="webkitTransition",t.perspectiveProperty===undefined&&t.webkitPerspective===undefined&&(n.animType=!1));t.msTransform!==undefined&&(n.animType="msTransform",n.transformType="-ms-transform",n.transitionType="msTransition",t.msTransform===undefined&&(n.animType=!1));t.transform!==undefined&&n.animType!==!1&&(n.animType="transform",n.transformType="transform",n.transitionType="transition");n.transformsEnabled=n.options.useTransform&&n.animType!==null&&n.animType!==!1};t.prototype.setSlideClasses=function(n){var t=this,u,i,r,f,e;i=t.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");t.$slides.eq(n).addClass("slick-current");t.options.centerMode===!0?(e=t.options.slidesToShow%2==0?1:0,u=Math.floor(t.options.slidesToShow/2),t.options.infinite===!0&&(n>=u&&n<=t.slideCount-1-u?t.$slides.slice(n-u+e,n+u+1).addClass("slick-active").attr("aria-hidden","false"):(r=t.options.slidesToShow+n,i.slice(r-u+1+e,r+u+2).addClass("slick-active").attr("aria-hidden","false")),n===0?i.eq(i.length-1-t.options.slidesToShow).addClass("slick-center"):n===t.slideCount-1&&i.eq(t.options.slidesToShow).addClass("slick-center")),t.$slides.eq(n).addClass("slick-center")):n>=0&&n<=t.slideCount-t.options.slidesToShow?t.$slides.slice(n,n+t.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):i.length<=t.options.slidesToShow?i.addClass("slick-active").attr("aria-hidden","false"):(f=t.slideCount%t.options.slidesToShow,r=t.options.infinite===!0?t.options.slidesToShow+n:n,t.options.slidesToShow==t.options.slidesToScroll&&t.slideCount-n<t.options.slidesToShow?i.slice(r-(t.options.slidesToShow-f),r+f).addClass("slick-active").attr("aria-hidden","false"):i.slice(r,r+t.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));(t.options.lazyLoad==="ondemand"||t.options.lazyLoad==="anticipated")&&t.lazyLoad()};t.prototype.setupInfinite=function(){var t=this,i,r,u;if(t.options.fade===!0&&(t.options.centerMode=!1),t.options.infinite===!0&&t.options.fade===!1&&(r=null,t.slideCount>t.options.slidesToShow)){for(u=t.options.centerMode===!0?t.options.slidesToShow+1:t.options.slidesToShow,i=t.slideCount;i>t.slideCount-u;i-=1)r=i-1,n(t.$slides[r]).clone(!0).attr("id","").attr("data-slick-index",r-t.slideCount).prependTo(t.$slideTrack).addClass("slick-cloned");for(i=0;i<u+t.slideCount;i+=1)r=i,n(t.$slides[r]).clone(!0).attr("id","").attr("data-slick-index",r+t.slideCount).appendTo(t.$slideTrack).addClass("slick-cloned");t.$slideTrack.find(".slick-cloned").find("[id]").each(function(){n(this).attr("id","")})}};t.prototype.interrupt=function(n){var t=this;n||t.autoPlay();t.interrupted=n};t.prototype.selectHandler=function(t){var i=this,u=n(t.target).is(".slick-slide")?n(t.target):n(t.target).parents(".slick-slide"),r=parseInt(u.attr("data-slick-index"));if(r||(r=0),i.slideCount<=i.options.slidesToShow){i.slideHandler(r,!1,!0);return}i.slideHandler(r)};t.prototype.slideHandler=function(n,t,i){var u,f,s,o,h=null,r=this,e;if((t=t||!1,r.animating!==!0||r.options.waitForAnimate!==!0)&&(r.options.fade!==!0||r.currentSlide!==n)){if(t===!1&&r.asNavFor(n),u=n,h=r.getLeft(u),o=r.getLeft(r.currentSlide),r.currentLeft=r.swipeLeft===null?o:r.swipeLeft,r.options.infinite===!1&&r.options.centerMode===!1&&(n<0||n>r.getDotCount()*r.options.slidesToScroll)){r.options.fade===!1&&(u=r.currentSlide,i!==!0&&r.slideCount>r.options.slidesToShow?r.animateSlide(o,function(){r.postSlide(u)}):r.postSlide(u));return}if(r.options.infinite===!1&&r.options.centerMode===!0&&(n<0||n>r.slideCount-r.options.slidesToScroll)){r.options.fade===!1&&(u=r.currentSlide,i!==!0&&r.slideCount>r.options.slidesToShow?r.animateSlide(o,function(){r.postSlide(u)}):r.postSlide(u));return}if(r.options.autoplay&&clearInterval(r.autoPlayTimer),f=u<0?r.slideCount%r.options.slidesToScroll!=0?r.slideCount-r.slideCount%r.options.slidesToScroll:r.slideCount+u:u>=r.slideCount?r.slideCount%r.options.slidesToScroll!=0?0:u-r.slideCount:u,r.animating=!0,r.$slider.trigger("beforeChange",[r,r.currentSlide,f]),s=r.currentSlide,r.currentSlide=f,r.setSlideClasses(r.currentSlide),r.options.asNavFor&&(e=r.getNavTarget(),e=e.slick("getSlick"),e.slideCount<=e.options.slidesToShow&&e.setSlideClasses(r.currentSlide)),r.updateDots(),r.updateArrows(),r.options.fade===!0){i!==!0?(r.fadeSlideOut(s),r.fadeSlide(f,function(){r.postSlide(f)})):r.postSlide(f);r.animateHeight();return}i!==!0&&r.slideCount>r.options.slidesToShow?r.animateSlide(h,function(){r.postSlide(f)}):r.postSlide(f)}};t.prototype.startLoad=function(){var n=this;n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&(n.$prevArrow.hide(),n.$nextArrow.hide());n.options.dots===!0&&n.slideCount>n.options.slidesToShow&&n.$dots.hide();n.$slider.addClass("slick-loading")};t.prototype.swipeDirection=function(){var i,r,u,n,t=this;return(i=t.touchObject.startX-t.touchObject.curX,r=t.touchObject.startY-t.touchObject.curY,u=Math.atan2(r,i),n=Math.round(u*180/Math.PI),n<0&&(n=360-Math.abs(n)),n<=45&&n>=0)?t.options.rtl===!1?"left":"right":n<=360&&n>=315?t.options.rtl===!1?"left":"right":n>=135&&n<=225?t.options.rtl===!1?"right":"left":t.options.verticalSwiping===!0?n>=35&&n<=135?"down":"up":"vertical"};t.prototype.swipeEnd=function(){var n=this,i,t;if(n.dragging=!1,n.swiping=!1,n.scrolling)return n.scrolling=!1,!1;if(n.interrupted=!1,n.shouldClick=n.touchObject.swipeLength>10?!1:!0,n.touchObject.curX===undefined)return!1;if(n.touchObject.edgeHit===!0&&n.$slider.trigger("edge",[n,n.swipeDirection()]),n.touchObject.swipeLength>=n.touchObject.minSwipe){t=n.swipeDirection();switch(t){case"left":case"down":i=n.options.swipeToSlide?n.checkNavigable(n.currentSlide+n.getSlideCount()):n.currentSlide+n.getSlideCount();n.currentDirection=0;break;case"right":case"up":i=n.options.swipeToSlide?n.checkNavigable(n.currentSlide-n.getSlideCount()):n.currentSlide-n.getSlideCount();n.currentDirection=1}t!="vertical"&&(n.slideHandler(i),n.touchObject={},n.$slider.trigger("swipe",[n,t]))}else n.touchObject.startX!==n.touchObject.curX&&(n.slideHandler(n.currentSlide),n.touchObject={})};t.prototype.swipeHandler=function(n){var t=this;if(t.options.swipe!==!1&&(!("ontouchend"in document)||t.options.swipe!==!1)&&(t.options.draggable!==!1||n.type.indexOf("mouse")===-1)){t.touchObject.fingerCount=n.originalEvent&&n.originalEvent.touches!==undefined?n.originalEvent.touches.length:1;t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold;t.options.verticalSwiping===!0&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold);switch(n.data.action){case"start":t.swipeStart(n);break;case"move":t.swipeMove(n);break;case"end":t.swipeEnd(n)}}};t.prototype.swipeMove=function(n){var t=this,f,e,r,u,i,o;if(i=n.originalEvent!==undefined?n.originalEvent.touches:null,!t.dragging||t.scrolling||i&&i.length!==1)return!1;if(f=t.getLeft(t.currentSlide),t.touchObject.curX=i!==undefined?i[0].pageX:n.clientX,t.touchObject.curY=i!==undefined?i[0].pageY:n.clientY,t.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(t.touchObject.curX-t.touchObject.startX,2))),o=Math.round(Math.sqrt(Math.pow(t.touchObject.curY-t.touchObject.startY,2))),!t.options.verticalSwiping&&!t.swiping&&o>4)return t.scrolling=!0,!1;if(t.options.verticalSwiping===!0&&(t.touchObject.swipeLength=o),e=t.swipeDirection(),n.originalEvent!==undefined&&t.touchObject.swipeLength>4&&(t.swiping=!0,n.preventDefault()),u=(t.options.rtl===!1?1:-1)*(t.touchObject.curX>t.touchObject.startX?1:-1),t.options.verticalSwiping===!0&&(u=t.touchObject.curY>t.touchObject.startY?1:-1),r=t.touchObject.swipeLength,t.touchObject.edgeHit=!1,t.options.infinite===!1&&(t.currentSlide===0&&e==="right"||t.currentSlide>=t.getDotCount()&&e==="left")&&(r=t.touchObject.swipeLength*t.options.edgeFriction,t.touchObject.edgeHit=!0),t.swipeLeft=t.options.vertical===!1?f+r*u:f+r*(t.$list.height()/t.listWidth)*u,t.options.verticalSwiping===!0&&(t.swipeLeft=f+r*u),t.options.fade===!0||t.options.touchMove===!1)return!1;if(t.animating===!0)return t.swipeLeft=null,!1;t.setCSS(t.swipeLeft)};t.prototype.swipeStart=function(n){var t=this,i;if(t.interrupted=!0,t.touchObject.fingerCount!==1||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;n.originalEvent!==undefined&&n.originalEvent.touches!==undefined&&(i=n.originalEvent.touches[0]);t.touchObject.startX=t.touchObject.curX=i!==undefined?i.pageX:n.clientX;t.touchObject.startY=t.touchObject.curY=i!==undefined?i.pageY:n.clientY;t.dragging=!0};t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var n=this;n.$slidesCache!==null&&(n.unload(),n.$slideTrack.children(this.options.slide).detach(),n.$slidesCache.appendTo(n.$slideTrack),n.reinit())};t.prototype.unload=function(){var t=this;n(".slick-cloned",t.$slider).remove();t.$dots&&t.$dots.remove();t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove();t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove();t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};t.prototype.unslick=function(n){var t=this;t.$slider.trigger("unslick",[t,n]);t.destroy()};t.prototype.updateArrows=function(){var n=this,t;t=Math.floor(n.options.slidesToShow/2);n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&!n.options.infinite&&(n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),n.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),n.currentSlide===0?(n.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):n.currentSlide>=n.slideCount-n.options.slidesToShow&&n.options.centerMode===!1?(n.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):n.currentSlide>=n.slideCount-1&&n.options.centerMode===!0&&(n.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))};t.prototype.updateDots=function(){var n=this;n.$dots!==null&&(n.$dots.find("li").removeClass("slick-active").end(),n.$dots.find("li").eq(Math.floor(n.currentSlide/n.options.slidesToScroll)).addClass("slick-active"))};t.prototype.visibility=function(){var n=this;n.options.autoplay&&(n.interrupted=document[n.hidden]?!0:!1)};n.fn.slick=function(){for(var i=this,r=arguments[0],f=Array.prototype.slice.call(arguments,1),e=i.length,u,n=0;n<e;n++)if(typeof r=="object"||typeof r=="undefined"?i[n].slick=new t(i[n],r):u=i[n].slick[r].apply(i[n].slick,f),typeof u!="undefined")return u;return i}}),function(n,t){"object"==typeof module&&module.exports?module.exports=t(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):n.URI=t(n.punycode,n.IPv6,n.SecondLevelDomains,n)}(this,function(n,t,i,r){function u(n,t){var i=1<=arguments.length,r=2<=arguments.length;if(!(this instanceof u))return i?r?new u(n,t):new u(n):new u;if(void 0===n){if(i)throw new TypeError("undefined is not a valid argument for URI");n="undefined"!=typeof location?location.href+"":""}if(null===n&&i)throw new TypeError("null is not a valid argument for URI");return this.href(n),void 0!==t?this.absoluteTo(t):this}function h(n){return n.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(n){return void 0===n?"Undefined":String(Object.prototype.toString.call(n)).slice(8,-1)}function e(n){return"Array"===c(n)}function b(n,t){var r={},u,i;if("RegExp"===c(t))r=null;else if(e(t))for(i=0,u=t.length;i<u;i++)r[t[i]]=!0;else r[t]=!0;for(i=0,u=n.length;i<u;i++)(r&&void 0!==r[n[i]]||!r&&t.test(n[i]))&&(n.splice(i,1),u--,i--);return n}function l(n,t){var r,i,u;if(e(t)){for(i=0,r=t.length;i<r;i++)if(!l(n,t[i]))return!1;return!0}for(u=c(t),i=0,r=n.length;i<r;i++)if("RegExp"===u){if("string"==typeof n[i]&&n[i].match(t))return!0}else if(n[i]===t)return!0;return!1}function k(n,t){if(!e(n)||!e(t)||n.length!==t.length)return!1;n.sort();t.sort();for(var i=0,r=n.length;i<r;i++)if(n[i]!==t[i])return!1;return!0}function p(n){return n.replace(/^\/+|\/+$/g,"")}function nt(n){return escape(n)}function w(n){return encodeURIComponent(n).replace(/[!'()*]/g,nt).replace(/\*/g,"%2A")}function a(n){return function(t,i){return void 0===t?this._parts[n]||"":(this._parts[n]=t||null,this.build(!i),this)}}function d(n,t){return function(i,r){return void 0===i?this._parts[n]||"":(null!==i&&(i+="",i.charAt(0)===t&&(i=i.substring(1))),this._parts[n]=i,this.build(!r),this)}}var tt=r&&r.URI,f,o,s,v,y,g;u.version="1.19.7";f=u.prototype;o=Object.prototype.hasOwnProperty;u._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:u.preventInvalidHostname,duplicateQueryParameters:u.duplicateQueryParameters,escapeQuerySpace:u.escapeQuerySpace}};u.preventInvalidHostname=!1;u.duplicateQueryParameters=!1;u.escapeQuerySpace=!0;u.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;u.idn_expression=/[^a-z0-9\._-]/i;u.punycode_expression=/(xn--)/i;u.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;u.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;u.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;u.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g};u.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};u.hostProtocols=["http","https"];u.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/;u.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};u.getDomAttribute=function(n){if(n&&n.nodeName){var t=n.nodeName.toLowerCase();if("input"!==t||"image"===n.type)return u.domAttributes[t]}};u.encode=w;u.decode=decodeURIComponent;u.iso8859=function(){u.encode=escape;u.decode=unescape};u.unicode=function(){u.encode=w;u.decode=decodeURIComponent};u.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}};u.encodeQuery=function(n,t){var i=u.encode(n+"");return void 0===t&&(t=u.escapeQuerySpace),t?i.replace(/%20/g,"+"):i};u.decodeQuery=function(n,t){n+="";void 0===t&&(t=u.escapeQuerySpace);try{return u.decode(t?n.replace(/\+/g,"%20"):n)}catch(i){return n}};s={encode:"encode",decode:"decode"};y=function(n,t){return function(i){try{return u[t](i+"").replace(u.characters[n][t].expression,function(i){return u.characters[n][t].map[i]})}catch(r){return i}}};for(v in s)u[v+"PathSegment"]=y("pathname",s[v]),u[v+"UrnPathSegment"]=y("urnpath",s[v]);s=function(n,t,i){return function(r){var o=i?function(n){return u[t](u[i](n))}:u[t],f,e;for(r=(r+"").split(n),f=0,e=r.length;f<e;f++)r[f]=o(r[f]);return r.join(n)}};u.decodePath=s("/","decodePathSegment");u.decodeUrnPath=s(":","decodeUrnPathSegment");u.recodePath=s("/","encodePathSegment","decode");u.recodeUrnPath=s(":","encodeUrnPathSegment","decode");u.encodeReserved=y("reserved","encode");u.parse=function(n,t){t||(t={preventInvalidHostname:u.preventInvalidHostname});var i=n.indexOf("#");return-1<i&&(t.fragment=n.substring(i+1)||null,n=n.substring(0,i)),i=n.indexOf("?"),-1<i&&(t.query=n.substring(i+1)||null,n=n.substring(0,i)),n=n.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://"),"//"===n.substring(0,2)?(t.protocol=null,n=n.substring(2),n=u.parseAuthority(n,t)):(i=n.indexOf(":"),-1<i&&(t.protocol=n.substring(0,i)||null,t.protocol&&!t.protocol.match(u.protocol_expression)?t.protocol=void 0:"//"===n.substring(i+1,i+3).replace(/\\/g,"/")?(n=n.substring(i+3),n=u.parseAuthority(n,t)):(n=n.substring(i+1),t.urn=!0))),t.path=n,t};u.parseHost=function(n,t){var i,r,f;return n||(n=""),n=n.replace(/\\/g,"/"),i=n.indexOf("/"),-1===i&&(i=n.length),"["===n.charAt(0)?(r=n.indexOf("]"),t.hostname=n.substring(1,r)||null,t.port=n.substring(r+2,i)||null,"/"===t.port&&(t.port=null)):(f=n.indexOf(":"),r=n.indexOf("/"),f=n.indexOf(":",f+1),-1!==f&&(-1===r||f<r)?(t.hostname=n.substring(0,i)||null,t.port=null):(r=n.substring(0,i).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)),t.hostname&&"/"!==n.substring(i).charAt(0)&&(i++,n="/"+n),t.preventInvalidHostname&&u.ensureValidHostname(t.hostname,t.protocol),t.port&&u.ensureValidPort(t.port),n.substring(i)||"/"};u.parseAuthority=function(n,t){return n=u.parseUserinfo(n,t),u.parseHost(n,t)};u.parseUserinfo=function(n,t){var f=n,i,r;return-1!==n.indexOf("\\")&&(n=n.replace(/\\/g,"/")),i=n.indexOf("/"),r=n.lastIndexOf("@",-1<i?i:n.length-1),-1<r&&(-1===i||r<i)?(i=n.substring(0,r).split(":"),t.username=i[0]?u.decode(i[0]):null,i.shift(),t.password=i[0]?u.decode(i.join(":")):null,n=f.substring(r+1)):(t.username=null,t.password=null),n};u.parseQuery=function(n,t){if(!n)return{};if(n=n.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!n)return{};for(var r={},s=n.split("&"),h=s.length,f,i,e=0;e<h;e++)(f=s[e].split("="),i=u.decodeQuery(f.shift(),t),f=f.length?u.decodeQuery(f.join("="),t):null,"__proto__"!==i)&&(o.call(r,i)?(("string"==typeof r[i]||null===r[i])&&(r[i]=[r[i]]),r[i].push(f)):r[i]=f);return r};u.build=function(n){var t="",i=!1;return n.protocol&&(t+=n.protocol+":"),!n.urn&&(t||n.hostname)&&(t+="//",i=!0),t+=u.buildAuthority(n)||"","string"==typeof n.path&&("/"!==n.path.charAt(0)&&i&&(t+="/"),t+=n.path),"string"==typeof n.query&&n.query&&(t+="?"+n.query),"string"==typeof n.fragment&&n.fragment&&(t+="#"+n.fragment),t};u.buildHost=function(n){var t="";if(n.hostname)t=u.ip6_expression.test(n.hostname)?t+("["+n.hostname+"]"):t+n.hostname;else return"";return n.port&&(t+=":"+n.port),t};u.buildAuthority=function(n){return u.buildUserinfo(n)+u.buildHost(n)};u.buildUserinfo=function(n){var t="";return n.username&&(t+=u.encode(n.username)),n.password&&(t+=":"+u.encode(n.password)),t&&(t+="@"),t};u.buildQuery=function(n,t,i){var s="",r,c,h,f;for(r in n)if("__proto__"!==r&&o.call(n,r))if(e(n[r]))for(h={},f=0,c=n[r].length;f<c;f++)void 0!==n[r][f]&&void 0===h[n[r][f]+""]&&(s+="&"+u.buildQueryParameter(r,n[r][f],i),!0!==t&&(h[n[r][f]+""]=!0));else void 0!==n[r]&&(s+="&"+u.buildQueryParameter(r,n[r],i));return s.substring(1)};u.buildQueryParameter=function(n,t,i){return u.encodeQuery(n,i)+(null!==t?"="+u.encodeQuery(t,i):"")};u.addQuery=function(n,t,i){if("object"==typeof t)for(var r in t)o.call(t,r)&&u.addQuery(n,r,t[r]);else if("string"==typeof t)void 0===n[t]?n[t]=i:("string"==typeof n[t]&&(n[t]=[n[t]]),e(i)||(i=[i]),n[t]=(n[t]||[]).concat(i));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};u.setQuery=function(n,t,i){if("object"==typeof t)for(var r in t)o.call(t,r)&&u.setQuery(n,r,t[r]);else if("string"==typeof t)n[t]=void 0===i?null:i;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");};u.removeQuery=function(n,t,i){var r;if(e(t))for(i=0,r=t.length;i<r;i++)n[t[i]]=void 0;else if("RegExp"===c(t))for(r in n)t.test(r)&&(n[r]=void 0);else if("object"==typeof t)for(r in t)o.call(t,r)&&u.removeQuery(n,r,t[r]);else if("string"==typeof t)void 0!==i?"RegExp"===c(i)?n[t]=!e(n[t])&&i.test(n[t])?void 0:b(n[t],i):n[t]!==String(i)||e(i)&&1!==i.length?e(n[t])&&(n[t]=b(n[t],i)):n[t]=void 0:n[t]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};u.hasQuery=function(n,t,i,r){var f,s;switch(c(t)){case"String":break;case"RegExp":for(f in n)if(o.call(n,f)&&t.test(f)&&(void 0===i||u.hasQuery(n,f,i)))return!0;return!1;case"Object":for(s in t)if(o.call(t,s)&&!u.hasQuery(n,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");}switch(c(i)){case"Undefined":return t in n;case"Boolean":return n=!(e(n[t])?!n[t].length:!n[t]),i===n;case"Function":return!!i(n[t],t,n);case"Array":return e(n[t])?(r?l:k)(n[t],i):!1;case"RegExp":return e(n[t])?r?l(n[t],i):!1:!(!n[t]||!n[t].match(i));case"Number":i=String(i);case"String":return e(n[t])?r?l(n[t],i):!1:n[t]===i;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};u.joinPaths=function(){for(var n,i,r=[],t=[],e=0,f=0;f<arguments.length;f++)for(n=new u(arguments[f]),r.push(n),n=n.segment(),i=0;i<n.length;i++)"string"==typeof n[i]&&t.push(n[i]),n[i]&&e++;return!t.length||!e?new u(""):(t=new u("").segment(t),""!==r[0].path()&&"/"!==r[0].path().slice(0,1)||t.path("/"+t.path()),t.normalize())};u.commonPath=function(n,t){for(var r=Math.min(n.length,t.length),i=0;i<r;i++)if(n.charAt(i)!==t.charAt(i)){i--;break}return 1>i?n.charAt(0)===t.charAt(0)&&"/"===n.charAt(0)?"/":"":(("/"!==n.charAt(i)||"/"!==t.charAt(i))&&(i=n.substring(0,i).lastIndexOf("/")),n.substring(0,i+1))};u.withinString=function(n,t,i){var e,o,r,f,h;i||(i={});var s=i.start||u.findUri.start,l=i.end||u.findUri.end,c=i.trim||u.findUri.trim,a=i.parens||u.findUri.parens;for(s.lastIndex=0;;){if(e=s.exec(n),!e)break;if(o=e.index,!i.ignoreHtml||(r=n.slice(Math.max(o-3,0),o),!r||!/[a-z0-9-]=["']?$/i.test(r))){for(f=o+n.slice(o).search(l),r=n.slice(o,f),f=-1;;){if(h=a.exec(r),!h)break;f=Math.max(f,h.index+h[0].length)}r=-1<f?r.slice(0,f)+r.slice(f).replace(c,""):r.replace(c,"");r.length<=e[0].length||i.ignore&&i.ignore.test(r)||(f=o+r.length,e=t(r,o,f,n),void 0===e?s.lastIndex=f:(e=String(e),n=n.slice(0,o)+e+n.slice(f),s.lastIndex=o+e.length))}}return s.lastIndex=0,n};u.ensureValidHostname=function(t,i){var f=!!t,r=!1;if(i&&(r=l(u.hostProtocols,i)),r&&!f)throw new TypeError("Hostname cannot be empty, if protocol is "+i);if(t&&t.match(u.invalid_hostname_characters)){if(!n)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(n.toASCII(t).match(u.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]');}};u.ensureValidPort=function(n){if(n){var t=Number(n);if(!(/^[0-9]+$/.test(t)&&0<t&&65536>t))throw new TypeError('Port "'+n+'" is not a valid port');}};u.noConflict=function(n){return n?(n={URI:this.noConflict()},r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(n.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(n.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(n.SecondLevelDomains=r.SecondLevelDomains.noConflict()),n):(r.URI===this&&(r.URI=tt),this)};f.build=function(n){return!0===n?this._deferred_build=!0:(void 0===n||this._deferred_build)&&(this._string=u.build(this._parts),this._deferred_build=!1),this};f.clone=function(){return new u(this)};f.valueOf=f.toString=function(){return this.build(!1)._string};f.protocol=a("protocol");f.username=a("username");f.password=a("password");f.hostname=a("hostname");f.port=a("port");f.query=d("query","?");f.fragment=d("fragment","#");f.search=function(n,t){var i=this.query(n,t);return"string"==typeof i&&i.length?"?"+i:i};f.hash=function(n,t){var i=this.fragment(n,t);return"string"==typeof i&&i.length?"#"+i:i};f.pathname=function(n,t){if(void 0===n||!0===n){var i=this._parts.path||(this._parts.hostname?"/":"");return n?(this._parts.urn?u.decodeUrnPath:u.decodePath)(i):i}return this._parts.path=this._parts.urn?n?u.recodeUrnPath(n):"":n?u.recodePath(n):"/",this.build(!t),this};f.path=f.pathname;f.href=function(n,t){var f,i,r;if(void 0===n)return this.toString();if(this._string="",this._parts=u._parts(),i=n instanceof u,r="object"==typeof n&&(n.hostname||n.path||n.pathname),n.nodeName&&(r=u.getDomAttribute(n),n=n[r]||"",r=!1),!i&&r&&void 0!==n.pathname&&(n=n.toString()),"string"==typeof n||n instanceof String)this._parts=u.parse(String(n),this._parts);else if(i||r){i=i?n._parts:n;for(f in i)"query"!==f&&o.call(this._parts,f)&&(this._parts[f]=i[f]);i.query&&this.query(i.query,!1)}else throw new TypeError("invalid input");return this.build(!t),this};f.is=function(n){var r=!1,f=!1,e=!1,t=!1,s=!1,h=!1,c=!1,o=!this._parts.urn;this._parts.hostname&&(o=!1,f=u.ip4_expression.test(this._parts.hostname),e=u.ip6_expression.test(this._parts.hostname),r=f||e,s=(t=!r)&&i&&i.has(this._parts.hostname),h=t&&u.idn_expression.test(this._parts.hostname),c=t&&u.punycode_expression.test(this._parts.hostname));switch(n.toLowerCase()){case"relative":return o;case"absolute":return!o;case"domain":case"name":return t;case"sld":return s;case"ip":return r;case"ip4":case"ipv4":case"inet4":return f;case"ip6":case"ipv6":case"inet6":return e;case"idn":return h;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var it=f.protocol,rt=f.port,ut=f.hostname;return f.protocol=function(n,t){if(n&&(n=n.replace(/:(\/\/)?$/,""),!n.match(u.protocol_expression)))throw new TypeError('Protocol "'+n+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return it.call(this,n,t)},f.scheme=f.protocol,f.port=function(n,t){return this._parts.urn?void 0===n?"":this:(void 0!==n&&(0===n&&(n=null),n&&(n+="",":"===n.charAt(0)&&(n=n.substring(1)),u.ensureValidPort(n))),rt.call(this,n,t))},f.hostname=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0!==n){var i={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==u.parseHost(n,i))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');n=i.hostname;this._parts.preventInvalidHostname&&u.ensureValidHostname(n,this._parts.protocol)}return ut.call(this,n,t)},f.origin=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){var i=this.protocol();return this.authority()?(i?i+"://":"")+this.authority():""}return i=u(n),this.protocol(i.protocol()).authority(i.authority()).build(!t),this},f.host=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n)return this._parts.hostname?u.buildHost(this._parts):"";if("/"!==u.parseHost(n,this._parts))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.authority=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n)return this._parts.hostname?u.buildAuthority(this._parts):"";if("/"!==u.parseAuthority(n,this._parts))throw new TypeError('Hostname "'+n+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},f.userinfo=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){var i=u.buildUserinfo(this._parts);return i?i.substring(0,i.length-1):i}return"@"!==n[n.length-1]&&(n+="@"),u.parseUserinfo(n,this._parts),this.build(!t),this},f.resource=function(n,t){if(void 0===n)return this.path()+this.search()+this.hash();var i=u.parse(n);return this._parts.path=i.path,this._parts.query=i.query,this._parts.fragment=i.fragment,this.build(!t),this},f.subdomain=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,i)||""}if(i=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,i),i=new RegExp("^"+h(i)),n&&"."!==n.charAt(n.length-1)&&(n+="."),-1!==n.indexOf(":"))throw new TypeError("Domains cannot contain colons");return n&&u.ensureValidHostname(n,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,n),this.build(!t),this},f.domain=function(n,t){if(this._parts.urn)return void 0===n?"":this;if("boolean"==typeof n&&(t=n,n=void 0),void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.match(/\./g);return i&&2>i.length?this._parts.hostname:(i=this._parts.hostname.length-this.tld(t).length-1,i=this._parts.hostname.lastIndexOf(".",i-1)+1,this._parts.hostname.substring(i)||"")}if(!n)throw new TypeError("cannot set domain empty");if(-1!==n.indexOf(":"))throw new TypeError("Domains cannot contain colons");return u.ensureValidHostname(n,this._parts.protocol),!this._parts.hostname||this.is("IP")?this._parts.hostname=n:(i=new RegExp(h(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(i,n)),this.build(!t),this},f.tld=function(n,t){if(this._parts.urn)return void 0===n?"":this;if("boolean"==typeof n&&(t=n,n=void 0),void 0===n){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf(".");return r=this._parts.hostname.substring(r+1),!0!==t&&i&&i.list[r.toLowerCase()]?i.get(this._parts.hostname)||r:r}if(n)if(n.match(/[^a-zA-Z0-9-]/))if(i&&i.is(n))r=new RegExp(h(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,n);else throw new TypeError('TLD "'+n+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");r=new RegExp(h(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(r,n)}else throw new TypeError("cannot set TLD empty");return this.build(!t),this},f.directory=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n||!0===n){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var i=this._parts.path.length-this.filename().length-1;return i=this._parts.path.substring(0,i)||(this._parts.hostname?"/":""),n?u.decodePath(i):i}return i=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,i),i=new RegExp("^"+h(i)),this.is("relative")||(n||(n="/"),"/"!==n.charAt(0)&&(n="/"+n)),n&&"/"!==n.charAt(n.length-1)&&(n+="/"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(i,n),this.build(!t),this},f.filename=function(n,t){var i,r;return this._parts.urn?void 0===n?"":this:"string"!=typeof n?!this._parts.path||"/"===this._parts.path?"":(i=this._parts.path.lastIndexOf("/"),i=this._parts.path.substring(i+1),n?u.decodePathSegment(i):i):(i=!1,"/"===n.charAt(0)&&(n=n.substring(1)),n.match(/\.?\//)&&(i=!0),r=new RegExp(h(this.filename())+"$"),n=u.recodePath(n),this._parts.path=this._parts.path.replace(r,n),i?this.normalizePath(t):this.build(!t),this)},f.suffix=function(n,t){if(this._parts.urn)return void 0===n?"":this;if(void 0===n||!0===n){if(!this._parts.path||"/"===this._parts.path)return"";var i=this.filename(),r=i.lastIndexOf(".");return-1===r?"":(i=i.substring(r+1),i=/^[a-z0-9%]+$/i.test(i)?i:"",n?u.decodePathSegment(i):i)}if("."===n.charAt(0)&&(n=n.substring(1)),i=this.suffix())r=n?new RegExp(h(i)+"$"):new RegExp(h("."+i)+"$");else{if(!n)return this;this._parts.path+="."+u.recodePath(n)}return r&&(n=u.recodePath(n),this._parts.path=this._parts.path.replace(r,n)),this.build(!t),this},f.segment=function(n,t,i){var u=this._parts.urn?":":"/",r=this.path(),f="/"===r.substring(0,1),o;if(r=r.split(u),void 0!==n&&"number"!=typeof n&&(i=t,t=n,n=void 0),void 0!==n&&"number"!=typeof n)throw Error('Bad segment "'+n+'", must be 0-based integer');if(f&&r.shift(),0>n&&(n=Math.max(r.length+n,0)),void 0===t)return void 0===n?r:r[n];if(null===n||void 0===r[n])if(e(t))for(r=[],n=0,o=t.length;n<o;n++)(t[n].length||r.length&&r[r.length-1].length)&&(r.length&&!r[r.length-1].length&&r.pop(),r.push(p(t[n])));else(t||"string"==typeof t)&&(t=p(t),""===r[r.length-1]?r[r.length-1]=t:r.push(t));else t?r[n]=p(t):r.splice(n,1);return f&&r.unshift(""),this.path(r.join(u),i)},f.segmentCoded=function(n,t,i){var f,r;if("number"!=typeof n&&(i=t,t=n,n=void 0),void 0===t){if(n=this.segment(n,t,i),e(n))for(r=0,f=n.length;r<f;r++)n[r]=u.decode(n[r]);else n=void 0!==n?u.decode(n):void 0;return n}if(e(t))for(r=0,f=t.length;r<f;r++)t[r]=u.encode(t[r]);else t="string"==typeof t||t instanceof String?u.encode(t):t;return this.segment(n,t,i)},g=f.query,f.query=function(n,t){if(!0===n)return u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof n){var i=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=n.call(this,i);return this._parts.query=u.buildQuery(r||i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==n&&"string"!=typeof n?(this._parts.query=u.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):g.call(this,n,t)},f.setQuery=function(n,t,i){var f=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r;if("string"==typeof n||n instanceof String)f[n]=void 0!==t?t:null;else if("object"==typeof n)for(r in n)o.call(n,r)&&(f[r]=n[r]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=u.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.addQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.addQuery(r,n,void 0===t?null:t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.removeQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.removeQuery(r,n,t),this._parts.query=u.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof n&&(i=t),this.build(!i),this},f.hasQuery=function(n,t,i){var r=u.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return u.hasQuery(r,n,t,i)},f.setSearch=f.setQuery,f.addSearch=f.addQuery,f.removeSearch=f.removeQuery,f.hasSearch=f.hasQuery,f.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},f.normalizeProtocol=function(n){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!n)),this},f.normalizeHostname=function(i){return this._parts.hostname&&(this.is("IDN")&&n?this._parts.hostname=n.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!i)),this},f.normalizePort=function(n){return"string"==typeof this._parts.protocol&&this._parts.port===u.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!n)),this},f.normalizePath=function(n){var t=this._parts.path,r,e,i,f;if(!t)return this;if(this._parts.urn)return this._parts.path=u.recodeUrnPath(this._parts.path),this.build(!n),this;if("/"===this._parts.path)return this;for(t=u.recodePath(t),r="","/"!==t.charAt(0)&&(e=!0,t="/"+t),("/.."===t.slice(-3)||"/."===t.slice(-2))&&(t+="/"),t=t.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(r=t.substring(1).match(/^(\.\.\/)+/)||"")&&(r=r[0]);;){if(i=t.search(/\/\.\.(\/|$)/),-1===i)break;else if(0===i){t=t.substring(3);continue}f=t.substring(0,i).lastIndexOf("/");-1===f&&(f=i);t=t.substring(0,f)+t.substring(i+3)}return e&&this.is("relative")&&(t=r+t.substring(1)),this._parts.path=t,this.build(!n),this},f.normalizePathname=f.normalizePath,f.normalizeQuery=function(n){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(u.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!n)),this},f.normalizeFragment=function(n){return this._parts.fragment||(this._parts.fragment=null,this.build(!n)),this},f.normalizeSearch=f.normalizeQuery,f.normalizeHash=f.normalizeFragment,f.iso8859=function(){var n=u.encode,t=u.decode;u.encode=escape;u.decode=decodeURIComponent;try{this.normalize()}finally{u.encode=n;u.decode=t}return this},f.unicode=function(){var n=u.encode,t=u.decode;u.encode=w;u.decode=unescape;try{this.normalize()}finally{u.encode=n;u.decode=t}return this},f.readable=function(){var t=this.clone(),i,r;if(t.username("").password("").normalize(),i="",t._parts.protocol&&(i+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&n?(i+=n.toUnicode(t._parts.hostname),t._parts.port&&(i+=":"+t._parts.port)):i+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(i+="/"),i+=t.path(!0),t._parts.query){for(var f="",e=0,o=t._parts.query.split("&"),s=o.length;e<s;e++)r=(o[e]||"").split("="),f+="&"+u.decodeQuery(r[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==r[1]&&(f+="="+u.decodeQuery(r[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"));i+="?"+f.substring(1)}return i+u.decodeQuery(t.hash(),!0)},f.absoluteTo=function(n){var t=this.clone(),i=["protocol","username","password","hostname","port"],r,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if((n instanceof u||(n=new u(n)),t._parts.protocol)||(t._parts.protocol=n._parts.protocol,this._parts.hostname))return t;for(r=0;f=i[r];r++)t._parts[f]=n._parts[f];return t._parts.path?(".."===t._parts.path.substring(-2)&&(t._parts.path+="/"),"/"!==t.path().charAt(0)&&(i=(i=n.directory())?i:0===n.path().indexOf("/")?"/":"",t._parts.path=(i?i+"/":"")+t._parts.path,t.normalizePath())):(t._parts.path=n._parts.path,t._parts.query||(t._parts.query=n._parts.query)),t.build(),t},f.relativeTo=function(n){var r=this.clone().normalize();if(r._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");n=new u(n).normalize();var t=r._parts,i=n._parts,f=r.path();if(n=n.path(),"/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==n.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===i.protocol&&(t.protocol=null),t.username===i.username&&t.password===i.password&&null===t.protocol&&null===t.username&&null===t.password&&t.hostname===i.hostname&&t.port===i.port)t.hostname=null,t.port=null;else return r.build();return f===n?(t.path="",r.build()):(f=u.commonPath(f,n),!f)?r.build():(i=i.path.substring(f.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),t.path=i+t.path.substring(f.length)||"./",r.build())},f.equals=function(n){var t=this.clone(),f=new u(n),i,s,r;if(n={},t.normalize(),f.normalize(),t.toString()===f.toString())return!0;if(s=t.query(),r=f.query(),t.query(""),f.query(""),t.toString()!==f.toString()||s.length!==r.length)return!1;t=u.parseQuery(s,this._parts.escapeQuerySpace);r=u.parseQuery(r,this._parts.escapeQuerySpace);for(i in t)if(o.call(t,i)){if(e(t[i])){if(!k(t[i],r[i]))return!1}else if(t[i]!==r[i])return!1;n[i]=!0}for(i in r)if(o.call(r,i)&&!n[i])return!1;return!0},f.preventInvalidHostname=function(n){return this._parts.preventInvalidHostname=!!n,this},f.duplicateQueryParameters=function(n){return this._parts.duplicateQueryParameters=!!n,this},f.escapeQuerySpace=function(n){return this._parts.escapeQuerySpace=!!n,this},u}),function(n,t){"object"==typeof module&&module.exports?module.exports=t(require("./URI")):"function"==typeof define&&define.amd?define(["./URI"],t):n.URITemplate=t(n.URI,n)}(this,function(n,t){function i(n){return i._cache[n]?i._cache[n]:(this instanceof i)?(this.expression=n,i._cache[n]=this,this):new i(n)}function r(n){this.data=n;this.cache={}}var e=t&&t.URITemplate,o=Object.prototype.hasOwnProperty,u=i.prototype,f={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};return i._cache={},i.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,i.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/,i.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,i.LITERAL_PATTERN=/[<>{}"`^| \\]/,i.expand=function(n,t,r){var o=f[n.operator],c=o.named?"Named":"Unnamed",s,u,h,e;for(n=n.variables,s=[],h=0;u=n[h];h++){if(e=t.get(u.name),0===e.type&&r&&r.strict)throw Error('Missing expansion value for variable "'+u.name+'"');if(e.val.length){if(1<e.type&&u.maxlength)throw Error('Invalid expression: Prefix modifier not applicable to variable "'+u.name+'"');s.push(i["expand"+c](e,o,u.explode,u.explode&&o.separator||",",u.maxlength,u.name))}else e.type&&s.push("")}return s.length?o.prefix+s.join(o.separator):""},i.expandNamed=function(t,i,r,u,f,e){var c="",o=i.encode,h;i=i.empty_name_separator;for(var v=!t[o].length,l=2===t.type?"":n[o](e),s=0,a=t.val.length;s<a;s++)f?(h=n[o](t.val[s][1].substring(0,f)),2===t.type&&(l=n[o](t.val[s][0].substring(0,f)))):v?(h=n[o](t.val[s][1]),2===t.type?(l=n[o](t.val[s][0]),t[o].push([l,h])):t[o].push([void 0,h])):(h=t[o][s][1],2===t.type&&(l=t[o][s][0])),c&&(c+=u),r?c+=l+(i||h?"=":"")+h:(s||(c+=n[o](e)+(i||h?"=":"")),2===t.type&&(c+=l+","),c+=h);return c},i.expandUnnamed=function(t,i,r,u,f){var o="",s=i.encode,c,l,e,h,a;for(i=i.empty_name_separator,c=!t[s].length,e=0,l=t.val.length;e<l;e++)f?h=n[s](t.val[e][1].substring(0,f)):c?(h=n[s](t.val[e][1]),t[s].push([2===t.type?n[s](t.val[e][0]):void 0,h])):h=t[s][e][1],o&&(o+=u),2===t.type&&(a=f?n[s](t.val[e][0].substring(0,f)):t[s][e][0],o+=a,o=r?o+(i||h?"=":""):o+","),o+=h;return o},i.noConflict=function(){return t.URITemplate===i&&(t.URITemplate=e),i},u.expand=function(n,t){var f="",u,e;for(this.parts&&this.parts.length||this.parse(),n instanceof r||(n=new r(n)),u=0,e=this.parts.length;u<e;u++)f+="string"==typeof this.parts[u]?this.parts[u]:i.expand(this.parts[u],n,t);return f},u.parse=function(){var o=this.expression,c=i.EXPRESSION_PATTERN,a=i.VARIABLE_PATTERN,v=i.VARIABLE_NAME_PATTERN,y=i.LITERAL_PATTERN,u=[],s=0,h=function(n){if(n.match(y))throw Error('Invalid Literal "'+n+'"');return n},n,r,e,l,t;for(c.lastIndex=0;;){if(n=c.exec(o),null===n){u.push(h(o.substring(s)));break}else u.push(h(o.substring(s,n.index))),s=n.index+n[0].length;if(!f[n[1]])throw Error('Unknown Operator "'+n[1]+'" in "'+n[0]+'"');if(!n[3])throw Error('Unclosed Expression "'+n[0]+'"');for(r=n[2].split(","),e=0,l=r.length;e<l;e++){if(t=r[e].match(a),null===t)throw Error('Invalid Variable "'+r[e]+'" in "'+n[0]+'"');if(t[1].match(v))throw Error('Invalid Variable Name "'+t[1]+'" in "'+n[0]+'"');r[e]={name:t[1],explode:!!t[3],maxlength:t[4]&&parseInt(t[4],10)}}if(!r.length)throw Error('Expression Missing Variable(s) "'+n[0]+'"');u.push({expression:n[0],operator:n[1],variables:r})}return u.length||u.push(h(o)),this.parts=u,this},r.prototype.get=function(n){var t=this.data,r={type:0,val:[],encode:[],encodeReserved:[]},i;if(void 0!==this.cache[n])return this.cache[n];if(this.cache[n]=r,t="[object Function]"===String(Object.prototype.toString.call(t))?t(n):"[object Function]"===String(Object.prototype.toString.call(t[n]))?t[n](n):t[n],void 0!==t&&null!==t)if("[object Array]"===String(Object.prototype.toString.call(t))){for(i=0,n=t.length;i<n;i++)void 0!==t[i]&&null!==t[i]&&r.val.push([void 0,String(t[i])]);r.val.length&&(r.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(t))){for(i in t)o.call(t,i)&&void 0!==t[i]&&null!==t[i]&&r.val.push([i,String(t[i])]);r.val.length&&(r.type=2)}else r.type=1,r.val.push([void 0,String(t)]);return r},n.expand=function(t,r){var u=new i(t).expand(r);return new n(u)},i}),function(n,t){"object"==typeof module&&module.exports?module.exports=t(require("jquery"),require("./URI")):"function"==typeof define&&define.amd?define(["jquery","./URI"],t):t(n.jQuery,n.URI)}(this,function(n,t){function r(n){return n.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(n){var i=n.nodeName.toLowerCase();if("input"!==i||"image"===n.type)return t.domAttributes[i]}function c(t){return{get:function(i){return n(i).uri()[t]()},set:function(i,r){return n(i).uri()[t](r),r}}}function f(t,r){var f,h,o;return!u(t)||!r?!1:(f=r.match(s),!f||!f[5]&&":"!==f[2]&&!i[f[2]])?!1:(h=n(t).uri(),f[5])?h.is(f[5]):":"===f[2]?(o=f[1].toLowerCase()+":",i[o]?i[o](h,f[4]):!1):(o=f[1].toLowerCase(),e[o]?i[f[2]](h[o](),f[4],o):!1)}var e={},i={"=":function(n,t){return n===t},"^=":function(n,t){return!!(n+"").match(new RegExp("^"+r(t),"i"))},"$=":function(n,t){return!!(n+"").match(new RegExp(r(t)+"$","i"))},"*=":function(n,t,i){return"directory"===i&&(n+="/"),!!(n+"").match(new RegExp(r(t),"i"))},"equals:":function(n,t){return n.equals(t)},"is:":function(n,t){return n.is(t)}},o,s,h;return n.each("origin authority directory domain filename fragment hash host hostname href password path pathname port protocol query resource scheme search subdomain suffix tld username".split(" "),function(t,i){e[i]=!0;n.attrHooks["uri:"+i]=c(i)}),o=function(t,i){return n(t).uri().href(i).toString()},n.each(["src","href","action","uri","cite"],function(t,i){n.attrHooks[i]={set:o}}),n.attrHooks.uri.get=function(t){return n(t).uri()},n.fn.uri=function(n){var i=this.first(),r=i.get(0),f=u(r),e;if(!f)throw Error('Element "'+r.nodeName+'" does not have either property: href, src, action, cite');if(void 0!==n){if(e=i.data("uri"),e)return e.href(n);n instanceof t||(n=t(n||""))}else{if(n=i.data("uri"))return n;n=t(i.attr(f)||"")}return n._dom_element=r,n._dom_attribute=f,n.normalize(),i.data("uri",n),n},t.prototype.build=function(n){return this._dom_element?(this._string=t.build(this._parts),this._deferred_build=!1,this._dom_element.setAttribute(this._dom_attribute,this._string),this._dom_element[this._dom_attribute]=this._string):!0===n?this._deferred_build=!0:(void 0===n||this._deferred_build)&&(this._string=t.build(this._parts),this._deferred_build=!1),this},s=/^([a-zA-Z]+)\s*([\^\$*]?=|:)\s*(['"]?)(.+)\3|^\s*([a-zA-Z0-9]+)\s*$/,h=n.expr.createPseudo?n.expr.createPseudo(function(n){return function(t){return f(t,n)}}):function(n,t,i){return f(n,i[3])},n.expr[":"].uri=h,n})