window.loadBlockerApi=window.loadBlockerApi||new function(){var o=[],i=null;this.showSpinner=function(n){n=n||"noId",-1==$.inArray(n,o)&&o.push(n),i=i||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(e){e=e||"noId",0==(o=jQuery.grep(o,function(n){return n!=e})).length&&i&&(i.modal("hide"),i=null)},this.manualRemove=function(n){n=document.querySelector(n);n.style.visibility="hidden",n.nextElementSibling.remove(),n.remove(),i=null}};
var AjaxCache=function(){var e={},u=new Hashtable,i=(e.Remove=function(e){u.remove(e)},e.Get=function(n,e,t,a){var r,c=$.Deferred(),o=(r=n,(o=u.get(r))?(new Date).getTime()<o.cacheTTL?o.data:(u.remove(r),null):null);return!a&&o?c=o:(r=c,u.put(n,new i(r,e)),$.ajax(t).done(function(e){c.resolve(e),$(document).trigger("layerIconsUpdated",[n,e])}).fail(c.reject)),c.promise()},function(e,n){var t={};return t.data=e,t.cacheTTL=(new Date).getTime()+6e4*n,t});return e};
!function(k,v){var w,L,T,B,S,x,P,I,z,A,D,r,O,E,R=k(".locationBtn"),F="off",Z="map-canvas",o=!1;function V(e,o){for(var t='"'+e+'":',a=o.split(","),r=0;r<a.length;r++){for(var i=a[r];" "==i.charAt(0);)i=i.substring(1,i.length);var n=i.substring(t.length,i.length);if(0==i.indexOf(t))return"true"===n.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"")}return null}var G=!0,_=function(){O=!O,Cookies.set("mapClrMode",O?"dark":"light"),MapComp.toggleMapMode({isDarkMode:O,displayPois:F}),K()};function U(){S=MapComp.ControlPosition([resources.MapTypePos]),x=MapComp.MapTypeControlStyle([resources.MapTypeStyle]),P=MapComp.ControlPosition([resources.MapControlPos]),I=MapComp.ControlPosition([resources.MapControlPos]),D=MapComp.ControlPosition([resources.TruckerModeMapControlPos]),z=MapComp.ControlPosition([resources.MapControlPos]),A=MapComp.ControlPosition([resources.MapControlPos]),G="true"===resources.UseGoogleMapZoom}function N(){S=MapComp.ControlPosition([resources.MobileFirstMapTypePos]),P=MapComp.ControlPosition([resources.MobileFirstMapControlPos]),I=MapComp.ControlPosition([resources.MobileFirstMapControlPos]),D=MapComp.ControlPosition([resources.TruckerModeMobileFirstMapControlPos])}function W(e,o,t){var a=0<k("#embedmap").length;Modernizr.mq("(min-width: 993px)")||a?U():(e||o||t?N():(S=MapComp.ControlPosition([resources.MobileMapTypePos]),P=MapComp.ControlPosition([resources.MobileMapTypePos]),I=MapComp.ControlPosition([resources.MobileMapControlPos]),D=MapComp.ControlPosition([resources.TruckerModeMobileMapControlPos])),x=MapComp.MapTypeControlStyle([resources.MapTypeStyle]),z=MapComp.ControlPosition([resources.MobileMapControlPos]),G=!0)}let $;function q(){var e=k("body").hasClass("mobileFirst")&&0<!k(".ersLogo").length;isWta=0<k("#wtaMap").length,"True"==resources.EnableLocationSearchBar&&t(),Modernizr.mq("(max-width: 992px)")&&e&&!isWta&&(t(),k(".myCamerasContainer").appendTo(".myCamerasGroup"),k("footer").hide())}function H(e,o){var[e,t]=MapComp.setupZoomButtons({controlDiv:e,text:{ZoomInMap:resources.ZoomInMap,ZoomOutMap:resources.ZoomOutMap}});MapComp.setZoomEvents({zoomInButton:e,zoomOutButton:t})}function j(e,o){e=new google.maps.LatLng(e[0],e[1]),w.panTo(e),o&&w.setZoom(o)}function i(e){return e=n(e),MapComp.mapPoint(e)}var t=function(){var t,e,a;o||(o=!0,t=document.getElementById("mapLocation"),e={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"]},t&&MapComp.isGoogle&&((a=new google.maps.places.Autocomplete(t,e)).bindTo("bounds",w),r=new google.maps.Marker({map:w}),google.maps.event.addDomListener(t,"keydown",function(e){var o;e.cancelBubble=!0,13!==e.keyCode&&9!==e.keyCode||0<k(".pac-item-selected").length||e.hasRanOnce||((o=new Event("keydown")).keyCode=40,o.hasRanOnce=!0,google.maps.event.trigger(e.target,"keydown",o))}),google.maps.event.addListener(a,"place_changed",function(e){r.setVisible(!1),t.className="";var o=a.getPlace();o.geometry?(o.geometry.viewport?w.fitBounds(o.geometry.viewport):(w.setCenter(o.geometry.location),w.setZoom(17)),r.setPosition(o.geometry.location),r.setVisible(!0),k(".mobileLocationBar .clearLocateBtn").show()):bootbox.dialog({title:resources.InvalidLocation,message:"<div class='alert alert-info'><i class='far fa-exclamation-circle'></i>"+resources.SelectValidLocationList+"</div>",className:"mapLocationMsg"})})))},K=function(){MapComp.setDarkLabelsState({darkLabelsLayerType:E,isDarkMode:O})},Q=function(e){var o=k(".topBanner .socialIcons"),t=k(".TruckerInfoLegendSection ul[id$='-children']");e?("undefined"!=typeof ga&&ga("send","event","TruckerMode","Show"),k(".truckerModeIndicator").show(),0<o.length&&o.addClass("down"),k(".mapLegend > .TruckerInfoLegendSection").is(":first")||a(!0,"TruckerInfoLegendSection"),0<t.length&&(t.show(),t.find("input[type='checkbox']").show())):(k(".truckerModeIndicator").hide(),0<o.length&&o.removeClass("down"),a(!1,"TruckerInfoLegendSection"),e=!1,0<t.length&&(t.hide(),t.find("input[type='checkbox']").hide())),k(".TruckerInfoLegendSection label input[type='checkbox']").prop("checked",e),T&&k.each(k(".TruckerInfoLegendSection label input[type='checkbox']"),function(e,o){T.layerToggled(k(o).attr("data-layerid"),!1)})},a=function(e,o){var t=0<k("."+o+" .collapse.in").length;e?(document.querySelector(".groupHeaderSection").before(document.querySelector("."+o)),t||k("."+o+" .toggleButton").trigger("click")):(k("."+o).insertBefore(".markerClusterLegend"),t&&k("."+o+" .toggleButton").trigger("click"))},J=function(e){var o,t,a=e.attr("data-icon");return a?(t=e.attr("data-iconsize"),o=e.attr("data-iconanchor"),e=e.attr("data-iconorigin"),a={url:a},t&&(a.size=(t=n(t),MapComp.mapSize(t))),o&&(a.anchor=i(o)),e&&(a.origin=i(e)),a):null},n=function(e){for(var o=[],t=e.split(","),a=0;a<t.length;a++)o[a]=+t[a];return o};k(".setToRegion").on("click",function(){var e=k(this).val().split(",");w.panTo(new google.maps.LatLng(e[0],e[1])),w.setZoom(parseInt(e[2]))});k("#layerSelection button").on("click",function(){var e=k(this).find("i");!0===e.hasClass("fa-minus-circle")?(e.removeClass("fa-minus-circle"),e.addClass("fa-plus-circle")):(e.addClass("fa-minus-circle"),e.removeClass("fa-plus-circle"))}),k(document).on("MapResize",function(){"object"==typeof google&&"object"==typeof google.maps&&google.maps.event.trigger(w,"resize")}),k(".myRouteBtn").on("click",function(e,o){Modernizr.mq("(min-width: 993px)")&&!R.is(":visible")&&R.show(),k(".sideBarGroup, #sideBar").show(),null==o&&k("#RoutesTab > a").trigger("click"),k(".mapPage .sideBarColContainer").show(),k(".mobileLocationBar").hide(),o&&o.skipPtBSetup||(k("#endLocationText").val(""),k("#endLocationText").focusout(),0<(o=k("#mapLocation").val()).length&&k("#endLocationText").val(o),k("#endLocationText").focusout(),k("#startLocationText").focus())}),k(".UIControls .directions").on("click",function(e,o){k(".mobileFirst .mobileSetting").hide(),k(".showSideBar").hide();var t=k("#mapLocation").val();0<t.length&&k("#endLocationText").val(t),k(".sideBarGroup").show(),k("#sideBar").show(),null==o&&k("#RoutesTab > a").trigger("click"),k("#startLocationText").focus(),k(".mapPage .sideBarColContainer").show(),k(".mobileLocationBar").hide(),k("#routingResults").is(":visible")&&k(document).trigger("checkEventOnRoutePlanner"),v.location.pathname.includes("map/page")&&document.getElementById("AlertsTab").querySelector("a").click()}),k(".UIControls .openInfoTab").on("click",function(){k(".mobileFirst .mobileSetting").hide(),k(".sideBarGroup").show(),k("#sideBar").show(),k(".showSideBar").hide(),k(".mobileLocationBar").hide(),k(".mapPage .sideBarColContainer").show(),k("#AlertsTab > a").trigger("click")}),k(".clearLocateBtn").on("click",function(){k(this).hide(),k("#mapLocation").val(""),r&&r.setVisible(!1)}),k(".closeSettings").on("click",function(){k(".mobileFirst .mobileSetting").hide(),k("#layerSelection").hide()}),k(".myCamerasContainer .fa-times, .myCam").on("click",function(){var e;""===resources.MobileCamBtnLink?(e=k(".myCamerasGroup")).is(":visible")?e.hide():(v.DisplayMyCameras(),e.show()):v.location.href=v.location.origin+resources.MobileCamBtnLink}),k("#setCurrentLocation").click(function(e){return v.GetUserGeolocation(function(e){r&&r.setVisible(!1),k(document).trigger("removeMyLocationMarker"),(new google.maps.Geocoder).geocode({location:e},function(e,o){"OK"===o?e[0]&&(w.setZoom(17),k("#mapLocation").val(e[0].formatted_address),w.setCenter(e[0].geometry.location),r.setPosition(e[0].geometry.location),r.setVisible(!0),k(".mobileLocationBar .clearLocateBtn").show()):bootbox.alert(resources.CouldNotFindCurrentLocation)})}),e.preventDefault(),!1}),k(".navbar-toggle").on("click",function(){k(".myCamerasGroup").is(":visible")&&k(".UIControls .myCam").trigger("click")}),k(document).on("ChangeCursorToWait",function(){w.setOptions({draggableCursor:"wait"})}),k(document).on("ChangeCursorToDefault",function(){w.setOptions({draggableCursor:""})}),k(document).on("hideLocationMarker",function(){r&&r.setVisible(!1)}),v.$mapping={init:function(c,a){$=new AppResize;function p(e,o){(e||o)&&(k(".mobileSetting").show(),k(".legend-toggle").show(),k(".bootbox").is(":visible")||k("#layerSelection").hide())}var o,e,t,d=0<k(".ersLogo").length,u=0<k("#wtaMap").length,r=URI().hasQuery("mode","trucker"),m=(k(document).trigger("adjustHeightTriggered"),"True"==resources.MobileFirst),i=(W(m,d,u),c.DisplayPOIs&&(F="on"),resources.MaxZoom=parseInt(resources.MaxZoom),resources.MinZoom=parseInt(resources.MinZoom),{mapTypeControlOptions:{style:x,position:S},center:MapComp.latLng(c.MapCenter),zoom:c.DefaultZoom,maxZoom:resources.MaxZoom,minZoom:resources.MinZoom,mapTypeId:c.MapTypeId,scaleControl:!0,zoomControl:G,zoomControlOptions:{position:P},fullscreenControl:!1,streetViewControlOptions:{position:P},gestureHandling:"greedy",disableDefaultUI:!c.DisplayControls,styles:Cookies.get("mapClrMode")?MapComp.mapModeStyles[Cookies.get("mapClrMode")](F):MapComp.mapModeStyles.light(F)}),i=(URI().hasQuery("maponly","true")&&(i.disableDefaultUI=!0,k(".legend-container").hide()),MapComp.callback.mapDoneLoading=()=>{if("undefined"!=typeof specialEvent&&specialEvent.method.setLegend(),MapComp.isLibre)console.warn("Only going up to here with Map Libre.");else{T=new AppHelper(w,c,function(){var n={iconDetails:{},apiUrls:{},tooltipBaseUrls:{},tooltipRegular:{},tooltipSize:{},feed:{},tile:{},icon:{},filterData:{}},e=k("#layerSelection"),o=k("input[type='checkbox'][data-icon], [data-polyline]",e),t=k("input[type='checkbox'][data-feedurl]",e),a=k("input[type='checkbox'][data-tileurlformat]",e);if(o.each(function(e,o){var t=k(o);var a=t.attr("data-layerId");var r=t.attr("data-hasFilter");n.filterData[a]={layerId:a,hasFilter:r};n.apiUrls[a]=t.attr("data-jsonurl");n.tooltipBaseUrls[a]=t.attr("data-tooltipbaseurl");n.tooltipRegular[a]=t.attr("data-tooltipregular");n.tooltipSize[a]=t.attr("data-tooltipsize")!=null?t.attr("data-tooltipsize"):null;n.icon[a]={minZoom:t.attr("data-minzoom"),maxZoom:t.attr("data-maxzoom")};var i=J(t);if(i)n.iconDetails[a]=i}),t.each(function(e,o){var t=k(o);var a=t.attr("data-layerId");n.feed[a]={url:t.attr("data-feedurl"),tooltipsize:t.attr("data-tooltipsize")!=null?t.attr("data-tooltipsize"):null,clickable:t.attr("data-clickable").toLowerCase()==="true",styleOptions:t.attr("data-styleOptions"),infoWindowTemplate:t.attr("data-infoWindowTemplate"),suppressInfoWindow:t.attr("data-suppressinfowindow").toLowerCase()==="true",type:t.attr("data-type"),cacheTime:t.attr("data-cachetime")}}),a.each(function(e,o){var t=k(o);var a=t.attr("data-layerId");n.tile[a]={urlFormat:t.attr("data-tileurlformat"),minZoom:t.attr("data-minzoom"),maxZoom:t.attr("data-maxzoom"),tooltipUrlFormat:t.attr("data-tooltipurlformat"),highwayFill:t.attr("data-highwayfill"),highwayStroke:t.attr("data-highwaystroke"),animationFrames:t.attr("data-animationframes"),startingFrame:t.attr("data-startingframe"),startPlaying:t.attr("data-startPlaying")=="True",opacity:t.attr("data-opacity"),zlevel:t.attr("data-zlevel"),cache:t.attr("data-cache")=="True"}}),typeof specialEvent!=="undefined")n.tooltipSize=specialEvent.method.setTooltipWidth(n.tooltipSize);return n}()),"undefined"!=typeof specialEvent&&specialEvent.method.getAppHelper(T),L={center:j,map:w,layerSelectorClosed:T.layerSelectorClosed,tileManager:T.tileManager,appHelper:T},v.SetUserRegion=function(e){var o;e&&(o=[e[0],e[1]],L.center(o,parseInt(e[2])))},Modernizr.mq("(min-width: 993px)")&&"true"===resources.MapLegendDisplayByDefault&&k(".legend-toggle").trigger("click"),UserCameras=new CameraLocater(L),k(document).trigger("appInitComplete",[L,c]),a&&a(L);for(var e=k(".layerSelection .toggleButton"),o=0;o<e.length+2;o++){var t=".panel-collapse."+o;0<k(t).length&&!k(t).hasClass("in")&&k(t+" input[type=checkbox]").is(":checked")&&(k(t).addClass("in"),k(t).parent().find(".fa-plus-circle").removeClass("fa-plus-circle").addClass("fa-minus-circle"))}}},MapComp.callback.maptypeid_changed=function(e){"hybrid"===w.getMapTypeId()||"satellite"===w.getMapTypeId()?(w.setOptions({styles:MapComp.mapModeStyles.light(F,!0)}),-1<(o=w.overlayMapTypes.getArray().indexOf(E))&&w.overlayMapTypes.removeAt(o),O=!1,Cookies.set("mapClrMode",O?"dark":"light")):(w.setOptions({styles:O?MapComp.mapModeStyles.dark(F):MapComp.mapModeStyles.light(F)}),K());var o=w.overlayMapTypes.getArray(),o=-1!=o.indexOf(g)?o.indexOf(g):o.indexOf(l),t="hybrid"==w.getMapTypeId()?l:g;-1!=o?"satellite"===w.getMapTypeId()?w.overlayMapTypes.removeAt(o):w.overlayMapTypes.setAt(o,t):w.overlayMapTypes.push(t)},O=!(!Cookies.get("mapClrMode")||"dark"!==Cookies.get("mapClrMode")),{...i,idTag:Z,bounds:[[c.RoutingModel.MapBottomLeftBounds.Longitude,c.RoutingModel.MapBottomLeftBounds.Latitude],[c.RoutingModel.MapTopRightBounds.Longitude,c.RoutingModel.MapTopRightBounds.Latitude]],mapDoneLoading:MapComp.callback.mapDoneLoading,maptypeid_changed:MapComp.callback.maptypeid_changed,isDarkMode:O}),i=(w=MapComp.mountMap(i),MapComp.mapModeStyles.lightLabelsLayer(F)),n=MapComp.mapModeStyles.darkLabelsLayer(F),s=MapComp.mapModeStyles.satelliteLabels(F),l=MapComp.StyledMapType(s),g=MapComp.StyledMapType(i,{name:"labels"});E=MapComp.StyledMapType(n,{name:"darkLabels"}),MapComp.addOverlayMapTypes({labelsLayerType:g}),MapComp.isGoogle&&K(),MapComp.isLibre?(MapComp.createControlsBox({mapContainerId:"map-canvas"}),c.DisplayControls&&MapComp.setupZoomButtons({text:{ZoomInMap:resources.ZoomInMap,ZoomOutMap:resources.ZoomOutMap}}),MapComp.setupDarkModeBtn({toggleMapMode:_,text:{ToggleDarkLightMap:resources.ToggleDarkLightMap}}),"true"===resources.EnableSaveMapView&&MapComp.setupSaveMapViewCtrl({text:{SaveMapView:resources.SaveMapView,GoToMapView:resources.GoToMapView},saveMapViewSuccessFeedback:()=>{k(".map-feedback-msg span").html(resources.SaveMapViewSuccess),k(".map-feedback-msg").show().delay(3e3).fadeOut()},goToMapViewErrorFeedback:()=>{k(".map-feedback-msg span").html(resources.GoToMapViewError),k(".map-feedback-msg").show().delay(3e3).fadeOut()}})):(!G&&c.DisplayControls&&(s=document.createElement("div"),H(s),s.index=1,MapComp.MountZoomControl({zoomPos:P,zoomControlDiv:s,mapContainerId:Z})),"number"==typeof A?(i=document.createElement("div"),MapComp.setupDarkModeBtn({controlDiv:i,toggleMapMode:_,text:{ToggleDarkLightMap:resources.ToggleDarkLightMap}}),w.controls[A].push(i)):(n=document.createElement("div"),mobileToggleMapModeControl(n,w),w.controls[P].push(n),MapComp.EventAddDomListener(n,"click",_)),"true"===resources.EnableSaveMapView&&(s=document.createElement("div"),new SaveMapViewControl(s,w),s.index=1,w.controls[P].push(s)),c.DisplayControls&&(i=document.createElement("div"),o=w,(n=i).className="locateMeContainer customMapCtrl",(s=document.createElement("button")).className="locateMeBtn btn btn-default",s.setAttribute("id","locateMeBtn"),s.setAttribute("type","button"),s.setAttribute("title",resources.CurrentLocation),s.setAttribute("aria-label",resources.CurrentLocation),(e=document.createElement("i")).className="fas fa-crosshairs",e.setAttribute("aria-hidden","true"),e.setAttribute("title",resources.CurrentLocation),s.appendChild(e),n.appendChild(s),s.addEventListener("click",function(){null==v.GetUserGeolocation&&new UserGeolocation(null,null,null,null,null),v.GetUserGeolocation(function(e){o.panTo(e),k(document).trigger("removeMyLocationMarker"),B=new google.maps.Marker({position:e,map:o,title:resources.CurrentLocation,icon:{url:"Content/images/locationDot.png",size:new google.maps.Size(24,24)}});e=o.getZoom();o.setZoom(12<e?e:12)})}),k(document).on("removeMyLocationMarker",function(){B&&B.setMap(null)}),w.controls[I].push(i)),"true"===resources.EnableToggleFullScreenMapBtn&&(e=document.createElement("div"),(n=e).className="toggleFullScreenMapContainer customMapCtrl",(s=document.createElement("button")).className="toggleFullScreenMapBtn btn btn-default",s.setAttribute("id","toggleFullScreenMapBtn"),s.setAttribute("type","button"),s.setAttribute("title",resources.ToggleFullscreen),s.setAttribute("aria-label",resources.ToggleFullscreen),(i=document.createElement("i")).className="far fa-arrows-alt",i.setAttribute("aria-hidden","true"),i.setAttribute("title",resources.ToggleFullscreen),s.appendChild(i),n.appendChild(s),s.addEventListener("click",function(){Modernizr.mq("(min-width: 993px)")&&(k(".navbar, .scrollRow, footer").toggle(),k(document).trigger("fullScreenMapMode"))}),w.controls[z].push(e)),"True"!==resources.EnableTruckerMode||d?Cookies.remove("_truckerMode"):(i=document.createElement("div"),r&&Cookies.set("_truckerMode",!0),(n=i).className="truckerModeContainer customMapCtrl",(s=document.createElement("button")).className=Cookies.get("_truckerMode")?"truckerModeBtn btn btn-default active":"truckerModeBtn btn btn-default",s.setAttribute("id","truckerModeBtn"),s.setAttribute("type","button"),s.setAttribute("title",resources.TruckerMode),s.setAttribute("aria-label",resources.TruckerMode),s.setAttribute("tabindex",0),(r=document.createElement("i")).className="far fa-truck-moving",r.setAttribute("aria-label","true"),(t=document.createElement("span")).innerHTML=resources.TruckerMode,r.setAttribute("aria-hidden","true"),r.setAttribute("title",resources.TruckerMode),s.appendChild(r),s.appendChild(t),n.appendChild(s),s.addEventListener("click",function(){k(".truckerModeBtn").hasClass("active")?(Cookies.remove("_truckerMode"),Q(!1)):(Cookies.set("_truckerMode",!0),Q(!0)),k(".truckerModeBtn").toggleClass("active")}),w.controls[D].push(i))),"True"==resources.EnableNearby511Kml&&!d&!u&&(r={clickable:!0,suppressInfoWindows:!0,preserveViewport:!0,map:w},t=MapComp.startKmlLayer(URI(resources.Nearby511Kml).addSearch("t",roundDate(moment(),5).unix()).addSearch("lang",Cookies.get("_culture")).toString(),r),MapComp.isGoogle)&&t.addListener("click",function(e){T.showInfoWindow(e.featureData.description,null,!0,e.latLng,"Nearby511",!0,!1,MapComp.mapSize(0,-32))});function C(){return{mapTypeControlOptions:{style:x,position:S},zoomControlOptions:{position:P},streetViewControlOptions:{position:P}}}var M,h,n=navigator.userAgent.toLowerCase();const b=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(n);function f(){if("Android"!==getMobileOs()){if(d=0<k(".ersLogo").length,u=0<k("#wtaMap").length,k(v).outerWidth()<993?(0<k(".draggableWindowContainer").length&&k(document).trigger("closeDraggableWindow"),!m||d||u?p(u,d):(k("body").addClass("mobileFirst"),k(".mobileSetting").hide(),k("#layerSelection").hide(),k(".closeSideBar").is(":visible")&&k(".closeSideBar").trigger("click"),k(".showSideBar").is(":visible")?k(".mobileLocationBar").hide():k(".mobileLocationBar").is(":visible")||k(".mobileLocationBar").show(),k(".myCamerasContainer").appendTo(".myCamerasGroup")),b||k("footer").hide(),q()):(0<k("body.mobileFirst").length&&(k("body").removeClass("mobileFirst"),"True"!=resources.EnableLocationSearchBar?(k(".showSideBar").is(":visible")||k(".showSideBar").trigger("click"),k(".mobileLocationBar").is(":visible")&&k(".mobileLocationBar").hide()):"true"===resources.OpenDesktopRoutePlannerDefault.toLowerCase()||"#:MyRoutes"==v.location.hash.substr(0)||-1!==v.location.hash.indexOf("#route")?k(".myRouteBtn").trigger("click",[!0]):(R.hide(),k("#sideBar").hide())),k(".mobileSetting").show(),(e=k(".myCamerasGroup")).is(":visible")&&e.hide(),null!=e.html()&&0<e.html().trim().length&&k(".myCamerasGroup .myCamerasContainer").appendTo(".myCamerasRoutePlanner"),k("footer").is(":visible")||d||k("footer").show()),MapComp.isLibre)return;var e=S,o=I,t=D;if(W(m,d,u),e!=S){k(".zoomControlContainer").length<1&&!G&&c.DisplayControls&&(e=document.createElement("div"),H(e),e.index=1,MapComp.MountZoomControl({zoomPos:P,zoomControlDiv:e,mapContainerId:Z}));var a,r=w.controls[o].getArray();for(a in r)if("locateMeContainer"==k(r[a]).attr("class")){var i=w.controls[o].getAt(a);w.controls[o].removeAt(a),w.controls[I].push(i);break}var n,s=w.controls[t].getArray();for(n in s)if("truckerModeContainer"==k(s[n]).attr("class")){var l=w.controls[t].getAt(n);w.controls[t].removeAt(n),w.controls[D].push(l);break}e=C();e.zoomControl=G,w.setOptions(e)}}MapComp.isGoogle&&($.checkRightBtmCtrls(),$.checkTopCenterCtrls(w,U,N,C)),clearTimeout(v.resizedFinished),v.resizedFinished=setTimeout(function(){k("#routingResults").is(":visible")&&k(document).trigger("checkEventOnRoutePlanner",["windowResize"])},250)}f(),MapComp.EventAddDomListener(v,"resize",f),MapComp.isGoogle&&(M=w.getStreetView(),h=k("#backToMapView"),MapComp.EventAddDomListener(M,"visible_changed",function(){var e=k(".mobileLocationBar").is(":visible"),e=d?k(".locationBar, #ERS_LocationBar_Info"):e?k(".mobileLocationBar, .myRouteBtn"):null;null==e&&(e=k(".showSideBar").is(":visible")?k(".showSideBar, .locationBtn"):k(".sideBarColContainer, .locationBtn")),M.getVisible()?(M.setOptions({enableCloseButton:!1,fullscreenControl:!1}),h.show(),e.hide(),k(".showSideBar").addClass("streetViewTop"),k(".mobileFirst.sideBarGroup.showSideBar").addClass("streetViewTop")):(h.hide(),e.show(),k(".showSideBar").removeClass("streetViewTop")),k(h).on("click",function(){M.setVisible(!1)}),Modernizr.mq("(min-width: 993px)")&&(e=k(".locationBtn.shiftLeft")).is(":visible")&&k(".sideBarColContainer").is(":visible")&&e.removeClass("shiftLeft")}));var y,s=!1,i=!1,r=k("#avoidTollsCheckBox"),n=(r&&(null!=(y=Cookies.get("map"))&&(s=V("AvoidTolls",y)),r.attr("checked",s)),k("#avoidFerriesCheckBox")),r=(n&&(null!=(y=Cookies.get("map"))&&(i=V("AvoidFerries",y)),n.attr("checked",i)),""!=resources.StateOutline&&new google.maps.Polyline({path:google.maps.geometry.encoding.decodePath(resources.StateOutline),strokeColor:"#00000",strokeOpacity:1,strokeWeight:1,map:w}),Modernizr.mq("(max-width: 992px)")?m&&"#:MyRoutes"==v.location.hash.substr(0)&&k(".UIControls .directions").click():"true"===resources.OpenDesktopRoutePlannerDefault.toLowerCase()||"#:MyRoutes"==v.location.hash.substr(0)||-1!==v.location.hash.indexOf("#route")?k(".myRouteBtn").trigger("click",[!0]):(R.hide(),k("#sideBar").hide()),getMobileOs());"unknown"!=r&&(k(".printRoute").hide(),"iOS"==r&&k(".twitter.newsContent").addClass("isIos"),"Android"==r)&&k("#ersRegion-Combobox .bs-searchbox, #mobileErsRegion-Combobox .bs-searchbox").hide(),q(),p(u,d),"True"==resources.EnableTruckerMode&&(s=Cookies.get("_truckerMode"),Q(!!s)),0<k("#routeOptions-toggle input[type='checkbox']:checked").length&&0==k("#routeOptions-toggle.in").length&&k("#routeOptions").click(),k(".clearAll").click(function(){k(".mapLegend input[type=checkbox]:checked").not(".mapLegend ul input[type=checkbox]").not("#LegendTopCheckbox").trigger("click")})},map:function(){return w}}}($,window),$(window).on("load",function(){$("body").hasClass("mobileFirst")&&0<!$(".ersLogo").length&&$(".featureModal").on("shown.bs.modal",function(){$(".bootbox").is(":visible")&&$(".featureModal").modal("hide")})}),$(document).on("show.bs.modal",".modal",function(){const e=1040+10*$(".modal:visible").length;$(this).css("z-index",e),setTimeout(()=>$(".modal-backdrop").not(".modal-stack").css("z-index",e-1).addClass("modal-stack"))});
var AppCookie=function(e,o){var t={},n={selectedLayers:null,prevZoom:null,prevLatLng:null,mapView:null};let i="map";"undefined"!=typeof specialEvent&&(i=window.location.pathname.replaceAll("/","").toLowerCase());function s(){var e=JSON.stringify(n);Cookies.set(i,e,{expires:365,path:"/"})}return getCookie=function(){var e=Cookies.get(i);return n=e?JSON.parse(e):n},t.getCookie=getCookie,t.SetLayer=function(o,e){e&&-1==n.selectedLayers.indexOf(o)?n.selectedLayers.push(o):e||(n.selectedLayers=$.grep(n.selectedLayers,function(e){return e!=o})),s()},t.SetMap=function(e,o,t){n.prevLatLng=[e,o],n.prevZoom=t,n.mapView=moment.utc(),s()},t.RestoreCheckboxes=function(t,e){$(n.selectedLayers).each(function(e,o){t(o)}),e&&e()},$("#avoidTollsCheckBox").on("change",function(){var e=$("#avoidTollsCheckBox").is(":checked");n.AvoidTolls=e,s()}),$("#avoidFerriesCheckBox").on("change",function(){var e=$("#avoidFerriesCheckBox").is(":checked");n.AvoidFerries=e,s()}),function(){n=this.getCookie(),null===(n="undefined"!=typeof specialEvent?specialEvent.method.setCookieSelectedLayers(n):n).selectedLayers&&(n.selectedLayers=[]),"undefined"==typeof specialEvent&&(n.selectedLayers=e.SelectedLayers)}(),t};
var AppEventBinding=function(r){var c=768,e=($(document).on("appInitComplete",()=>{var e=new URL(window.location),e=new URLSearchParams(e.search);e.has("hiderouteplanner")&&"true"===e.get("hiderouteplanner")?$(".hideSideBar").click():e.has("hiderouteplanner")&&"true"!==e.get("hiderouteplanner")&&$(".showSideBar").click(),e.has("hidelegend")&&"true"===e.get("hidelegend")?$("#layerSelection").hide():e.has("hidelegend")&&"true"!==e.get("hidelegend")&&$("#layerSelection").show()}),function(){var e=$("#layerSelection");$("input[type='checkbox']",e).bind("click.layerSelectorCheckboxes_desktopMode",function(){r.layerToggled($(this).attr("data-layerid"),!1)})}),t=function(){var e=$("#layerSelection");$("input[type='checkbox']",e).on("change.layerSelectorCheckboxes_mobileMode",function(){r.layerToggled($(this).attr("data-layerid"),!1)})},o=function(e,t){var o,a=0<$(".ersLogo").length,a=0<$(".mobileFirst").length&&!a,n=0<$(".wtaPage").length,i=$(window).outerWidth(),l=$("#layerSelection");"none"==l.css("display")?((c="768"!==resources.ScreenWidthERSLegend?parseInt(resources.ScreenWidthERSLegend):c)<i?(l.attr("class","layerSelection"),$("#legend-container").append(l.detach()),$(".mobileSetting").show()):a?($(".mobileFirst .mobileSetting").show(),l.attr("class","layerSelection"),$("#legend-container").append(l.detach()),n?$(".mobileSetting").addClass("show"):(i=$(".legend-container").outerHeight()+20,adjustLegendHeight(i))):(l.attr("class","layerSelectionModal"),o=l.detach(),bootbox.mapPageDialog({message:" ",animate:!1,closeButton:!1,buttons:{main:{label:resources.OK,className:"btn-info",container:".map-container",callback:function(){t.trigger("click"),$("#legend-container").append(o),r.layerSelectorClosed(!0)}}}}),bootbox.setDialogToJqueryObj(o.show())),"block"==$(".mapFiltersContainer").css("display")&&$(".layerSelection").addClass("expand"),l.show(),e.preventDefault()):(e.preventDefault(),l.hide(),a&&0===$("#embedmap").length&&window.innerWidth<992&&$(".mobileFirst .mobileSetting").hide(),n&&$(".mobileSetting").removeClass("show"))},a=$(".locationBtn");let i=(e,t)=>{e=Array.from(e.querySelectorAll("label>input"));t?e.forEach((e,t)=>{(!e.checked&&0===t||0<t&&e.checked)&&e.click()}):e.forEach(e=>{e.checked&&e.click()})};$(".hideSideBar").click(function(){$(".mapPage .sideBarColContainer").hide(),$(".guideIcon").hide(),$(".mapColContainer").toggleClass("full"),0<a.length&&a.addClass("shiftLeft"),$(".showSideBar").show(100),r.resizeMap()}),$(".showSideBar").click(function(){$(".showSideBar").hide(100),0<a.length&&a.removeClass("shiftLeft"),$(".mapPage .sideBarColContainer").show(),$(".guideIcon").show(),$(".mapColContainer").toggleClass("full"),r.resizeMap()}),$(".closeSideBar, .locationBtn").on("click",function(){$(document).trigger("clearUserRouteTrigger"),0<a.length&&(a.hide(),a.removeClass("shiftLeft")),$(".showSideBar").hide(),$(".mapPage .sideBarColContainer").hide(),$(".mapColContainer").toggleClass("full"),$(".mobileLocationBar, .myRouteBtn").show(),$("#mapLocation").val("").focus(),r.resizeMap()});var n,l=$(".legend-toggle"),d=$(".settingToggle"),d=($(window).outerWidth()>c?e():t(),$(l).on("click",function(e){o(e,l)}),$(d).on("click",function(e){o(e,null)}),d=$("#layerSelection"),$("input[type='checkbox'][data-layerid]",d).bind("click.layerSelectorCheckboxes_cookie",function(){r.appCookie.SetLayer($(this).attr("data-layerid"),$(this).is(":checked"))}),n=r.map,d=function(){var e=n.getCenter(),t=n.getZoom();r.appCookie.SetMap(e.lat(),e.lng(),t)},google.maps.event.addListener(n,"zoom_changed",d),google.maps.event.addListener(n,"dragend",d),document.querySelector("#layerSelection").querySelectorAll("input[type='checkbox'][data-icon],input[type='checkbox'][data-feedurl],input[type='checkbox'][data-tileurlformat]").forEach(function(e){var t=e.dataset.layerid;let n=document.querySelector("ul#"+t+"-children");n&&e.addEventListener("change",function(){var e=this.checked,t=this.dataset.dontselectchildlayers;if(null!=t&&"true"===t.toLowerCase())i(n,e);else for(var o of n.children){o=o.querySelector("label>input");(e&&!o.checked||!e&&o.checked)&&o.click()}var a,t=n.querySelectorAll("li>label>input");n.hidden=!0;for(a of t)e?"True"==a.dataset.visible&&(a.hidden=!1,n.hidden=!1):a.hidden=!0})}),$("#embedmap")),e=$("#accessServicesMap");0<!d.length&&0<!e.length?r.appCookie.RestoreCheckboxes(function(e){var t=document.querySelector("#layerSelection").querySelector("input[type='checkbox'][data-layerid='"+e+"']:not(:disabled)");t&&(t.checked=!0,t.dispatchEvent(new Event("change"))),0<$("ul#"+e+"-children").children(":visible").length&&$("ul#"+e+"-children").toggle(!0)},function(){r.layerSelectorClosed(!0)}):r.layerSelectorClosed(!0)};
var AppHelper=function(f,e,n){function t(e){$("input[type='checkbox'][data-layerid]","#layerSelection").each(function(e,n){o($(n).attr("data-layerid"),!0)}),U(e,!0)}function o(a,i){function e(e,n,t){if(e=$(e),C.containsKey(a)||C.put(a,!1),e.is(":checked")){if(0==C.get(a)){if(C.put(a,!0),n(),e.attr("data-conflicts"))for(var o=e.attr("data-conflicts").split(","),r=0;r<o.length;r++)$("input[type='checkbox'][data-layerid='"+o[r]+"']:checked",$("#layerSelection")).click();i||"undefined"==typeof ga||ga("send","event","MapLayer",a),$(document).trigger("mapLayerToggle",[a,!0])}}else 1==C.get(a)&&(C.put(a,!1),t(),$(document).trigger("mapLayerToggle",[a,!1]))}var n,t=$("#layerSelection"),o=$('input[type="checkbox"][data-layerid="'+a+'"]',t);let r="true"===o[0].dataset.hasmapicons,l="true"===o[0].dataset.polylinetooltip;0<o.length&&(n=o[0].parentNode.parentNode.parentNode,o[0].checked)&&n.classList.contains("TopLegendSection")&&"none"===n.style.display&&(n.style.display="block",document.getElementById("LegendTopCheckbox").checked=!0),o.is('[data-polyline="true"]')?e(o[0],function(){g.AddPolylineLayer(a,[],$(o[0]).data("polylineopacity"),$(o[0]).data("polylineweight"),$(o[0]).data("polylinezindex"),0,20,function(i,e,n){M(a,n,e).done(function(e){var n,t,o=[],r=e.item2;for(n in r)r[n].polyline&&(t=null,r[n].polyline.symbolJSON&&(t=JSON.parse(r[n].polyline.symbolJSON)),o.push({id:r[n].itemId,lineColor:r[n].polyline.color,decodedPoints:google.maps.geometry.encoding.decodePath(r[n].polyline.path),icons:t}));i(o,l)})},L[a],!!o.is("[data-icon]")),$(document).on("layerRefreshed-polylineManager."+a,function(e,n){n==a&&($(document).off("layerRefreshed-polylineManager."+a),r)&&(d.AddIconLayer(a,[],M,function(r,i){var a=V(r,i);return i.polyline&&a.addListener("marker-clustered",function(e){var n,t=g.GetPolylines(r);for(n in t){var o=t[n];if(o.sourceData.id==i.itemId){a.clustered?(o.gMapLine.setMap(null),o.gMapLine.canDraw=!1):(o.gMapLine.setMap(f),o.gMapLine.canDraw=!0);break}}}),a},L[a],j[a]),d.RefreshLayer(a).done(d.Redraw))}),g.RefreshLayer(a),$("#legend-icon-"+a,t).toggle(!0)},function(){g.RemovePolylineLayer(a),d.RemoveIconLayer(a),i||d.Redraw(),$(document).off("layerRefreshed-polylineManager."+a),$("#legend-icon-"+a,t).toggle(!1),a==h&&P()}):r?e(o[0],function(){d.AddIconLayer(a,[],M,V,L[a],j[a]),i||d.RefreshLayer(a).done(d.Redraw),$("#legend-icon-"+a,t).toggle(!0)},function(){0==b.indexOf(a)&&(b=""),d.RemoveIconLayer(a),$("#legend-icon-"+a,t).toggle(!1),i||d.Redraw(),a==h&&P()}):o.is("[data-feedurl]")?e(o[0],function(){u.AddLayer(a,w[a]),$("#legend-feed-"+a,t).toggle(!0)},function(){a==h&&(z()||CTVars.tooltipOpen)&&P(),u.RemoveLayer(a),$("#legend-feed-"+a,t).toggle(!1)}):o.is("[data-tileurlformat]")&&e(o[0],function(){c.AddTileLayer(a,N[a]),$("#legend-tile-"+a,t).toggle(!0)},function(){c.RemoveTileLayer(a),a==h&&(z()||CTVars.tooltipOpen)&&P(),$("#legend-tile-"+a,t).toggle(!1)})}function s(e,n){return n.icon.json?JSON.parse(n.icon.json):n.icon?{url:(n=n.icon).url,size:new google.maps.Size(n.size[0],n.size[1]),anchor:new google.maps.Point(n.anchor[0],n.anchor[1]),origin:new google.maps.Point(n.origin[0],n.origin[1]),scaledSize:new google.maps.Size(n.size[0],n.size[1])}:H[e]}var r,d,c,g,u,y,i,h,p,H=n.iconDetails,F=n.apiUrls,m=n.tooltipBaseUrls,E=n.tooltipRegular,v=n.tooltipSize,w=n.feed,N=n.tile,j=n.icon,C=new Hashtable,a=!1,I=new google.maps.InfoWindow({maxWidth:365}),B='<div id="infoWindowLoading">'+resources.Loading+"</div>",k={},L={},M=function(e,n,t){var o={type:"GET",url:F[e],dataType:"json",timeout:3e4,tryCount:0,retryLimit:3,error:function(e,n,t){"timeout"==n&&(this.tryCount++,this.tryCount<=this.retryLimit)&&$.ajax(this)}};return null!=t&&(o.type="POST",o.data=JSON.stringify(t.getFilter()),o.contentType="application/json",o.url+="?time="+$.now()),r.Get(e,.5,o,n)},V=function(r,i){var n,t,o,a,e=new google.maps.LatLng(i.location[0],i.location[1]),l=new google.maps.Marker({clickable:i.icon.isClickable,position:e,title:i.title,zIndex:i.zindex,preventClustering:i.icon.preventClustering}),e=s(r,i);return e&&l.setIcon(e),google.maps.event.addListener(l,"spider_format",function(e){var n,t=s(r,i),o=e==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIED?t.url:e==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIABLE?null==(o=t.url)?null:(n=(o=o.split("/")).splice(o.length-1,1)[0],o.join("/")+"/plus/"+n):e==OverlappingMarkerSpiderfier.markerStatus.UNSPIDERFIABLE?t.url:null;t&&(t.url=o,l.setIcon(t))}),""!=m[r]&&(t=l,o=i,a=r,google.maps.event.addListener(t,"spider_click",function(e){var n=!0;"true"===resources.TooltipDisplayOnHover&&(S?n=!1:(S=!0,setTimeout(()=>{S=!1},500))),n&&(R(a,o.itemId,t),$(document).trigger("marker-click",[k,a,o.itemId,t]))}),"true"===resources.TooltipDisplayOnHover)&&(n=l,google.maps.event.addListener(n,"mouseover",function(e){p=setTimeout(function(){google.maps.event.trigger(n,"click")},500)}),google.maps.event.addListener(n,"mouseout",function(){p&&clearTimeout(p)})),l},S=!1,l=null,b="",R=function(n,e,t,o,r){var i,a,l=n+e;z()&&l===b||($(document).trigger("closeDraggableWindow"),z()&&P(),b=l,"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),J(),$(document).trigger("cameraImagesClearIntervals"),i=Cookies.get("_culture")?Cookies.get("_culture"):"",i=URI.expand(m[n],{layerId:n,id:e,lang:i}).toString(),a=$(window).width()<768,isRegular="true"==E[n]&&!a,T(B,t,!0,o,n,!1,void 0,r||void 0),$(document).trigger("ShowInfoWindow",[k,n,e,t,o]),$.ajax({url:i,success:function(e){b==l&&T(e,t,!1,o,n,!isRegular,void 0,r||void 0)}}))};const O=new CenterTooltip(f);O.startTriggers(),window.centerTooltip=O,$(document).on("info-content-trigger",(e,n,t,o)=>{n===resources.MessageSignsLayerId&&_(),void 0!==t&&(-1==t.indexOf("cctvImage")&&-1==t.indexOf("cctvCameraCarousel")||$(document).trigger("cameraImagesInitialized",[b]),-1!=t.indexOf("data-convert-from-utc"))&&$(document).trigger("update-time-to-locale");n=$("#detourCollapse"),n[0]&&arrowDirection.setTooltip(n[0]),t=document.querySelector(".map-tooltip .slick-track"),n=document.querySelector(".map-tooltip .singleCamTd");t&&$(document).trigger("setup-fullscreen-img-modal",[t,"multiCam"]),n&&$(document).trigger("setup-fullscreen-img-modal",[n,"singleCam"]),applyDetourArrowIcon(),O.run(o)}),$(document).on("update-time-to-locale",function(){$("[data-type='time']").each(function(e,n){var n=$(n),t=n.html(),t=moment.utc(t).local().format("M/D/YYYY h:mm A");n.html(t)})});function T(e,n,t,o,r,i,a,l){var s,d,c,g,u,p,m;O.tooltipOpened(),i&&(i=!0,document.querySelector(".closeDraggableWindow"))&&""!==e&&$(document).trigger("closeDraggableWindow"),(h=r)&&""!==e&&(d="iOS"==getMobileOs(),s=v[r]&&0<v[r].length?parseInt(v[r]):365,d=992<$(window).width()&&!d,c=I,w[r]&&w[r].tooltipsize&&(s=parseInt(w[r].tooltipsize),l=30),i&&d?(I.close(),g=CreateDraggableInfoWindow(y,l),u=null!=n?n:new google.maps.Marker({position:o}),(y=new g(f,u,r,e,s,function(){e&&""!=e&&$(document).trigger("info-content-trigger",[r,e])},l)).position=u.position,y.content=e,c=y):(google.maps.event.addListenerOnce(I,"domready",function(){e&&(t?O.run(c):$(document).trigger("info-content-trigger",[r,e,c]))}),I.setContent(e)),bootbox.setDialogContent(e),$(document).trigger("info-content-trigger",[r,e]),c.maxWidth=s,t?d?(n||a?i?(I.close(),c.position=null!=o?o:n.position):I.setOptions({position:o,pixelOffset:{height:0}}):I.setOptions({position:o,pixelOffset:l=l||{height:-32}}),n&&n.latLngs?(I.setOptions({position:new google.maps.LatLng(n.defaultPosition.lat(),n.defaultPosition.lng())}),I.open(f)):i||($(document).trigger("closeDraggableWindow"),I.open(f,n)),r===resources.MessageSignsLayerId&&$(document).trigger("MsgSignMapTooltipTriggered")):bootbox.isOpen()||bootbox.mapPageDialog({message:e,animate:!1,buttons:{main:{label:resources.OK,className:"btn-info"}}}):z()?(p=$(".map-tooltip table img:not(.agencyLogo)"),m=b,p.length?p.on("load",function(){m==b&&(I.open(f,n),p.off("load"))}):I.open(f,n)):i||e&&""!=e&&$(document).trigger("info-content-trigger",[r,e]))}var D,x,_=function(){clearInterval(l),1<$(".msgContent div").length&&(l=setInterval(function(){for(var e=$(".msgContent").children(),n=e.length,t=!1,o=0;o<n;o++)if($(e[o]).hasClass("hide")){if(1==t){$(e[o]).toggleClass("hide"),t=!1;break}}else $(e[o]).toggleClass("hide"),t=!0;1==t&&$(e[0]).toggleClass("hide")},2500))},J=function(){clearInterval(l),l=null},U=(google.maps.event.addListener(I,"closeclick",function(){P(),O.tooltipClosed()}),$(document).on("layer-changed",function(e,n){"MyCameras"==n&&r.Remove(n),d.RefreshLayer(n,!0).done(d.Redraw),g.RefreshLayer(n,!0)}),function(e,n){e||loadBlockerApi.showSpinner("refreshMapData");var t=0;$(document).on("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper",function(){2==++t&&(loadBlockerApi.hideSpinner("refreshMapData"),$(document).unbind("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper"))}),$(document).on("layersRefreshed-iconManager.appHelper",function(){d.Redraw(),$(document).unbind("layersRefreshed-iconManager.appHelper")}),d.RefreshLayers(),g.RefreshLayers(),n||c.RefreshLayers(),u.Refresh(w)}),q=function(e){e||loadBlockerApi.showSpinner("repaintMap");var n=0;$(document).on("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper",function(){2==++n&&(loadBlockerApi.hideSpinner("repaintMap"),$(document).unbind("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper"))}),d.MapChanged(),d.Redraw(),g.MapChanged()},G=function(){return!bootbox.isOpen()&&!a},z=function(){return!!I.getMap()},P=function(){"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),$(document).trigger("closeDraggableWindow"),I.close(),b="",$(document).trigger("info-window-close"),O.tooltipClosed()},Y=($(document).on("callCloseInfoWindow",P),k.map=f,k.resizeMap=function(){google.maps.event.trigger(f,"resize")},k.isLayerIdChecked=function(e){return $('input[type="checkbox"][data-layerId="'+e+'"]').is(":checked")},k.layerSelectorClosed=t,k.layerToggled=o,k.showInfoWindow=T,k.showInfoWindowForItem=R,k.closeInfoWindow=P,k.clearInfoWindowId=function(){b=""},k.centerTooltip=O,n.filterData);for(W in Y){var A,W=Y[W];"True"==W.hasFilter&&"undefined"!=typeof FilterDataTableParams&&((A=new FilterDataTableParams(1,0,25,!0,null)).search=new FilterDataTableSearchParam,A.search.objValue=null,A.search.regex=!1,A.search.searchOnColumn=!1,A.search.value=null,A.order[0]=new FilterDataTableOrderParam,A.order[0].column=0,A.order[0].dir="asc",(A=new ColumnFilters("map-filter-div",W.layerId,"List/UniqueColumnValuesForErsEvents/{typeId}",A)).initListColumnFilters(),L[W.layerId]=A)}return n=new OverlappingMarkerSpiderfier(f,{markersWontMove:!1,markersWontHide:!1,keepSpiderfied:!0,nearbyDistance:10}),i={maxZoom:e.ClustererModel.MaximumZoom,minimumClusterSize:e.ClustererModel.MinimumClusterSize,gridSize:e.ClustererModel.GridSize,title:resources.AClusterOfIcons,imagePath:"/Content/images/markerClustererPlus/m"},(i=new MarkerClusterer(f,[],i,n)).setCalculator(function(e,n){for(var t=0,e=e.length.toString(),o=e;0!==o;)o=parseInt(o/10,10),t++;return 3==t&&(t=2),resources.MarkererIndexOveride&&(t=resources.MarkererIndexOveride),{text:e,index:t=Math.min(t,n),title:""}}),r=new AjaxCache,d=new IconManager(f,i),k.iconManager=d,c=new TileManager(f,k),k.tileManager=c,g=new PolylineManager(f,k.showInfoWindowForItem),$(document).trigger("polylineManagerReady-appHelper",[g,R]),u=new KmlManager(f,k),k.kmlManager=u,i=new AppCookie(e,(n=$("input[type='checkbox'][data-layerid]",$("#layerSelection")),$.makeArray(n.map(function(){return $(this).attr("data-layerid")})))),new AppEventBinding((k.appCookie=i,k.layerSelectorClosed=t,k)),D={timer:null,refreshData:!1},x=function(e){e&&(D.refreshData=e),clearTimeout(D.timer),D.timer=setTimeout(function(){(D.refreshData?U:q)(!0),D.timer=null,D.refreshData=!1},300)},setInterval(function(){G()&&x(!0)},61e3),google.maps.event.addListener(f,"zoom_changed",function(){P(),x(!1)}),google.maps.event.addListener(f,"bounds_changed",function(){x(!1)}),google.maps.event.addListener(f,"dragstart",function(){a=!0}),google.maps.event.addListener(f,"dragend",function(){a=!1}),noPanOffEarth(f),$(document).trigger("appHelperInitComplete"),k};
window.resizeVars={isEmbedded:void 0,initalLoadOnMobile:!1,state:{mobile:!1,desktop:!1},initialStackDone:!1};class AppResize{constructor(){resizeVars.isEmbedded=0<$("#embedmap").length,"RIGHT_BOTTOM"===resources.MapControlPos&&$("#legend-container").addClass("legendMovedLeft"),window.innerWidth<=992?(resizeVars.initalLoadOnMobile=!0,"RIGHT_BOTTOM"===resources.MapControlPos&&this.stackMapControlsOnMobile()):"RIGHT_BOTTOM"===resources.MapControlPos&&(this.stackMapControlsOnDesktop(),this.checkRightBtmCtrls())}tryAgain(e,t){setTimeout(()=>{++e<10?t.call(this,e):console.warn("Could not find element to resize")},200)}checkRightBtmCtrls(){"RIGHT_BOTTOM"===resources.MapControlPos&&(992<window.innerWidth&&!resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&this.setBtmRtCtrlsOnDesktop(),window.innerWidth<=992&&resizeVars.initalLoadOnMobile&&!resizeVars.state.mobile&&this.setBtmRtCtrlsOnMobile(),992<window.innerWidth&&resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&this.reuseBtmRtMobileControlsOnDesktop(),resizeVars.isEmbedded)&&(this.fixEmbeddedCtrlStack(),this.addEmbeddedCtrlClass())}checkTopCenterCtrls(e,t,s,o){"TOP_CENTER"===resources.MapControlPos&&(992<window.innerWidth&&resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&(t(),e.setOptions(o()),this.reuseMobileControlsOnDesktop()),window.innerWidth<=992&&resizeVars.initalLoadOnMobile&&!resizeVars.state.mobile&&(resizeVars.isEmbedded?this.addEmbeddedCtrlClass():(s(),e.setOptions(o()),this.reuseMobileControlsOnMobile())),window.innerWidth<=992&&!resizeVars.initalLoadOnMobile&&!resizeVars.state.mobile&&(s(),e.setOptions(o()),this.reuseDesktopControlsOnMobile()),992<window.innerWidth)&&!resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&(t(),e.setOptions(o()),resizeVars.state.desktop=!0,resizeVars.state.mobile=!1)}stackMapControlsOnMobile(t=0){setTimeout(()=>{var e;resizeVars.initialStackDone||(0<(e=$(".gm-svpc")).length?(resizeVars.isEmbedded?this.stackEmbeddedControls():($(".saveMapViewControlContainer").addClass("stackSaveCtrls"),$(".darkModeControlContainer").addClass("stackDarkModeCtrl"),e.addClass("stackPegman2")),this.stackFullScreenMapBtn(),resizeVars.initialStackDone=!0):this.tryAgain(t,this.stackMapControlsOnMobile))},200)}stackMapControlsOnDesktop(t=0){setTimeout(()=>{var e;resizeVars.initialStackDone||(0<(e=$(".zoomControlContainer")).length?(resizeVars.isEmbedded?this.stackEmbeddedControls():(e.addClass("stackZoomCtrl"),$(".saveMapViewControlContainer").addClass("stackSaveCtrls")),$(".toggleDarkLMapContainer").addClass("stackDarkToggle"),this.stackFullScreenMapBtn(),resizeVars.initialStackDone=!0):this.tryAgain(t,this.stackMapControlsOnDesktop))},200)}stackFullScreenMapBtn(){var e;"true"===resources.EnableToggleFullScreenMapBtn&&(e=$(".toggleFullScreenMapContainer"),window.innerWidth<=992&&resizeVars.initalLoadOnMobile?(e.addClass("stackFullScreenToggleMobile"),stackFullScreenToggle()):resizeVars.initalLoadOnMobile||(resizeVars.isEmbedded?e.hide():e.addClass("stackFullScreenToggleDesktop")))}stackEmbeddedControls(){var e=document.querySelector("#embedmap").getBoundingClientRect().width,t=$(".zoomControlContainer");e<800?t.hide():t.addClass("embeddedZoomCtrl"),$(".saveMapViewControlContainer").addClass("embeddedStackSaveCtrls")}reuseMobileControlsOnDesktop(o=0){setTimeout(()=>{var e,t,s;resizeVars.state.desktop||((e=document.getElementsByClassName("gm-bundled-control")[0])?(e.classList.add("reuseMobileControls"),t=document.querySelector(".darkModeControlContainer"),e.appendChild(t),(s=document.querySelector(".saveMapViewControlContainer"))?e.appendChild(s):t.classList.add("darkModeNoSave"),"true"===resources.EnableToggleFullScreenMapBtn&&e.appendChild(document.querySelector(".toggleFullScreenMapContainer")),resizeVars.state.mobile=!1,resizeVars.state.desktop=!0):this.tryAgain(o,this.reuseMobileControlsOnDesktop))},200)}fixEmbeddedCtrlStack(t=0){setTimeout(()=>{var e;document.querySelector(".gm-svpc")?((e=$("#toggleDarkLMapContainer")).removeClass("stackDarkToggle"),e.hide(),$(".gm-svpc").hide(),$(".zoomControlContainer").hide(),(e=$(".gm-svpc")).show(),e.addClass("embeddedPeg"),(e=document.querySelector(".saveMapViewControlContainer"))&&e.classList.add("embeddedStackSaveCtrls")):this.tryAgain(t,this.fixEmbeddedCtrlStack)},200)}addEmbeddedCtrlClass(t=0){setTimeout(()=>{var e=document.querySelector(".gm-svpc");e?(e.classList.add("embeddedCtrl"),(e=document.querySelector(".saveMapViewControl"))&&e.classList.add("embeddedCtrl"),document.querySelector(".gmnoprint").classList.add("embeddedCtrl")):this.tryAgain(t,this.addEmbeddedCtrlClass)},200)}stackFullScreenToggle(t=0){setTimeout(()=>{var e=document.querySelector(".darkModeControlContainer");e?e.parentElement.appendChild(document.querySelector(".stackFullScreenToggleMobile")):this.tryAgain(t,this.stackFullScreenToggle)},200)}setBtmRtCtrlsOnMobile(t=0){setTimeout(()=>{var e;resizeVars.state.mobile||((e=document.querySelector(".darkModeControlContainer"))?(e.classList.add("stackDarkModeMobile"),resizeVars.state.mobile=!0,resizeVars.state.desktop=!1):this.tryAgain(t,this.setBtmRtCtrlsOnMobile))},200)}reuseBtmRtMobileControlsOnDesktop(s=0){setTimeout(()=>{var e,t;resizeVars.state.desktop||((e=document.querySelector(".saveMapViewControlContainer"))?(e.classList.add("reuseSaveMapViewControlOnDesk"),"true"===resources.EnableToggleFullScreenMapBtn&&((t=document.querySelector(".toggleFullScreenMapContainer")).classList.add("reuseFullScreenControlOnDesk"),e.parentElement.appendChild(t)),resizeVars.state.desktop=!0,resizeVars.state.mobile=!1):this.tryAgain(s,this.reuseBtmRtMobileControlsOnDesktop))},200)}setBtmRtCtrlsOnDesktop(t=0){setTimeout(()=>{var e;resizeVars.state.desktop||(e=document.querySelector(".gm-svpc"),!resizeVars.isEmbedded&&e?(e.classList.add("stackPegman1"),resizeVars.state.desktop=!0,resizeVars.state.mobile=!1):this.tryAgain(t,this.setBtmRtCtrlsOnDesktop))},200)}reuseDesktopControlsOnMobile(t=0){setTimeout(()=>{var e;resizeVars.state.mobile||((e=document.querySelector(".gm-svpc"))?(e.classList.add("pegmanForMobile"),(e=document.querySelector(".gm-bundled-control-on-bottom").parentElement).classList.add("reuseDektopCtrls"),e.appendChild(document.querySelector(".zoomControlContainer")),e.appendChild(document.querySelector(".toggleDarkLMapContainer")),document.querySelector(".saveMapViewControlContainer")&&e.appendChild(document.querySelector(".saveMapViewControlContainer")),document.querySelector(".ersMode")&&"block"===document.querySelector("#layerSelection").style.display&&$(".legend-toggle").trigger("click"),resizeVars.state.desktop=!1,resizeVars.state.mobile=!0):this.tryAgain(t,this.reuseDesktopControlsOnMobile))},200)}reuseMobileControlsOnMobile(s=0){setTimeout(()=>{var e,t;resizeVars.state.mobile||((e=document.querySelector(".gm-bundled-control-on-bottom"))?(e=e.parentElement,(t=document.querySelector(".saveMapViewControlContainer"))&&e.appendChild(t),e.appendChild(document.querySelector(".darkModeControlContainer")),resizeVars.state.desktop=!1,resizeVars.state.mobile=!0):this.tryAgain(s,this.reuseMobileControlsOnMobile))},200)}}
var setupSlickCarousel=function(t){t.each(function(){this.dataset.lazy=this.dataset.lazy+"?t="+roundDateToDuration(moment().startOf("second"),moment.duration(1),"floor").unix()});var a,e=$(t).closest(".cctvCameraCarousel");return $(e).hasClass("slick-initialized")?Modernizr.mq("(max-width: 992px)")&&0<(a=$(".bootbox-body .map-tooltip").outerWidth()-10)&&($(".bootbox-body .slick-initialized, .bootbox-body .slick-slide").css("width",a+"px"),$(e).slick("setPosition")):($(e).slick({dots:!0,arrows:!0,autoplay:!0,lazyLoad:"ondemand",autoplaySpeed:1e4,accessibility:!0,infinite:!1}),$(e).on("beforeChange",function(t,a,e,i){a=$(a.$slides.get(i)),i=$("img",a);"true"==i.attr("data-needsrefresh")&&i[0].hasAttribute("src")&&(i.attr("src",URI(i.attr("src")).hash((new Date).getTime())),i.attr("data-needsrefresh","false"))})),$(t).removeClass("carouselCctvImage"),$(e)},setUpImageSlide=function(t,a){0<t.$slides.length&&((a=(t=$("img",$(t.$slides.get(a)))).data("title"))?($("#myCameraTitle").text(a),a=t.data("id"),$("#myCameraLocation").show(),$("#myCameraLocation").attr("href","#camera-"+a)):$("#myCameraLocation").hide(),t.attr("data-lazy",URI(t.data("url")).hash((new Date).getTime())),0<(a=t.data("refresh-rate")))&&setInterval(function(t){t=$("#"+t);t.attr("src",URI(t.data("url")).hash((new Date).getTime()))},a,t.attr("id"))};
"use strict";var UserCameras=null,LatLng=function(){},CameraLocater=function(){function e(e){var n=this;this.avoidZoom=!1,this.appPublicApi=e,this.map=this.appPublicApi.map,this.centerTooltip=e.appHelper.centerTooltip,$(document).on("hashChanged-urlHash",function(e,t){var o,a=urlHash.hash();a&&0==a.toLowerCase().lastIndexOf("camera-",0)?(o=decodeURIComponent(n.getUrlHashAsId()))&&n.zoomToCamera(o,"Camera","Cameras"):a&&-1<a.indexOf("-")&&n.zoomToObject(n.getUrlHashAsId(),a.split("-")[0],null==t?void 0:t.autoZoom)})}return e.prototype.zoomToObject=function(i,l,r){var p=this,e=(void 0===r&&(r=!0),$("input[type='checkbox'][data-layerid=\""+l+'"]',$("#layerSelection")));e.is(":checked")||"True"===e.attr("data-ischild")&&(e=null==(e=null==(e=document.querySelector('[data-layerId="'+l+'"]').parentElement.parentElement.parentElement)?void 0:e.id)?void 0:e.split("-")[0],(e=$("input[type='checkbox'][data-layerid=\""+e+'"]',$("#layerSelection"))).click(),"True"!==e.attr("data-dontselectchildlayers"))||$("input[type='checkbox'][data-layerid=\""+l+'"]',$("#layerSelection")).click(),this.appPublicApi.appHelper.iconManager.RefreshLayer(l,!0),$(document).on("layerIconsUpdated",function(e,t,o){var a,n;t==l&&(i=decodeURIComponent(i),1==(o=o.item2.filter(function(e){return e.itemId==i})).length?(a=new google.maps.LatLng(o[0].location[0],o[0].location[1]),p.centerTooltip.externalPanCheck(),p.map.panTo(a),r&&!p.avoidZoom?(n=p.map.getZoom(),992<$(window).width()?n<13&&p.map.setZoom(13):n<17&&p.map.setZoom(17)):(p.avoidZoom=!0,setTimeout(function(){p.avoidZoom=!1},500)),p.appPublicApi.appHelper.showInfoWindowForItem(t,i,null,a),$(document).off("layerIconsUpdated")):0==o.length&&$(document).trigger("closeDraggableWindow"))})},e.prototype.zoomToCamera=function(o,a,n){var i=this;$.ajax("/"+a+"/GetLatLng?id="+o,{type:"POST"}).done(function(e){var t;e&&e.latitude&&e.longitude&&(e=new google.maps.LatLng(e.latitude,e.longitude),i.centerTooltip.externalPanCheck(),i.map.panTo(e),t=i.map.getZoom(),992<$(window).width()?(t<13&&i.map.setZoom(13),i.appPublicApi.appHelper.showInfoWindowForItem(n,o,null,e),urlHash.hash(a)):(t<17&&i.map.setZoom(17),i.appPublicApi.appHelper.showInfoWindowForItem(n,o,null,e),urlHash.hash("map-col-container")),$("input[type='checkbox'][data-layerid=\""+n+'"]',$("#layerSelection")).is(":checked")||($("input[type='checkbox'][data-layerid=\""+n+'"]',$("#layerSelection")).click(),i.appPublicApi.appHelper.layerToggled(n,!1)))})},e.prototype.getUrlHashAsId=function(){var e=urlHash.hash();return e=e.substring(e.indexOf("-")+1)},e.prototype.setUrlHashAsObjectId=function(e,t){t=(t="{0}-{1}".replace("{0}",t||"")).replace("{1}",e||"");urlHash.hash(t)},e}();
$(function(){var o=[];function d(e,i,t,o,d,n,a,l){let s=e+"-video",r=document.getElementById(d),c=r.getAttribute("data-videourl");e=r.getAttribute("data-videoauth");let u=r.getAttribute("data-streamtype");d=r.getAttribute("data-cameraid");"true"!==e&&c&&""!=c?m(r,i,t,o,s,c,u,n,a,l):$.ajax("/Camera/GetVideoUrl?imageId="+d,{type:"GET",cache:!1}).done(function(e){"object"==typeof e?$.ajax(resources.CameraVideoUrl,{type:"POST",cache:!1,data:JSON.stringify(e),contentType:"application/json"}).done(function(e){m(r,i,t,o,s,c+e,u,n,a,l)}):m(r,i,t,o,s,e,u,n,a,l)})}function m(i,e,t,o,d,n,a,l,s,r){n='<video id="'+d+'" class="video-js vjs-default-skin" preload="auto" autoplay data-setup=\'{ "controls": true }\'>\t<source src="'+n+'" type="'+a+'" /> \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>';videojs.addLanguage("en",{"No compatible source was found for this media.":window.resources.IE8ErrorMessage}),i.appendChild(jQuery.parseHTML(n)[0]);let c,u=videojs(document.getElementById(d),{width:s,height:r});$(i).children("div.video-js").css({width:s+"px",height:r+"px"}),function e(){if(null!=u&&null==document.getElementById(d)){try{u.dispose()}catch(e){}u=null}null!=u&&setTimeout(function(){e()},5e3)}(),this.errorFunction=function(){videoElement=document.getElementById(d);var e=videojs(videoElement);4==!e.error().code&&(e.dispose(),e="<img src='"+resources.CctvVideoCustomErrorImage+"' style='display:block;width:100%'>",i.appendChild(jQuery.parseHTML(e)[0]))},resources.CctvVideoCustomErrorImage&&u.on("error",errorFunction),c=document.getElementById(e);let m=$(l)[0],h=$(l).next()[0];p()&&((a=$(".child div[id='"+i.id+"']")).length<2&&$(a).html($(i).children()),c=$(".child img[id='"+e+"']")[0],m=$(".child button[id='"+t+"']")[0],h=$(".child button[id='"+o+"']")[0]),c.style.display="none",m.style.display="none",h.style.display="inline",$(l).parent().prevUntil("video-js").children().css({width:s+"px"});{n=u.el_;let e=0;n.addEventListener("mouseout",function(){0<window.scrollY&&(e=window.scrollY),0===window.scrollY&&window.scrollTo(0,e)}),n.addEventListener("mouseover",function(){0<window.scrollY&&(e=window.scrollY)})}u.on("fullscreenchange",()=>{u.isFullscreen_||$(document).trigger("exitFullScreenVideo")})}function n(e,i,t,o,d,n){e=document.getElementById(e+"-video");let a=document.getElementById(i),l=$(n).prev()[0],s=$(n)[0];p()&&(a=$(".child img[id='"+i+"']")[0],l=$(".child button[id='"+t+"']")[0],s=$(".child button[id='"+o+"']")[0]),null!=e&&videojs(e).dispose();for(var r=document.getElementById(d);r.firstChild;)r.removeChild(r.firstChild);a.style.display="block",l.style.display="inline",s.style.display="none"}function a(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!1).slick("slickPause")}function l(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!0).slick("slickPlay")}function p(){return 0<$(".child .cctvImage").length}$(document).on("click",".showVideo",function(t){if(!(t.detail&&1<t.detail)&&"undefined"!=typeof videojs){a(".cctvCameraCarousel");t=$(this).parent().parent().find(".cctvImage");let e=t.width();t=t.height();let i=$(this).data("camera-id");null==e&&(e=parseInt(resources.CamTooltipMaxWidth)),d(i,i+"img","showVideo-"+i,"hideVideo-"+i,i+"-videoContainer",this,e,t),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[i]),o[i]=setTimeout(function(){var e;e=i,l(".cctvCameraCarousel"),document.getElementById(e+"-video")&&n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",$(document).find("[id='hideVideo-"+e+"']"))},parseInt(resources.VideoTimeoutInMilliseconds)))}}),$(document).on("click",".hideVideo",function(){var e;"undefined"!=typeof videojs&&(l(".cctvCameraCarousel"),e=$(this).data("camera-id"),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[e]),o[e]=null),n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",this))}),$(document).on("click",".showMyVideo",function(e){if(!(e.detail&&1<e.detail)&&"undefined"!=typeof videojs){a(".cameraCarousel");var e=$(this).parent().parent().find(".myCamImg"),t=e.width(),e=e.height();let i=$(this).data("camera-id");d(i+"my","carouselId-"+i,"showMyVideo-"+i,"hideMyVideo-"+i,i+"-myVideoContainer",this,t,e),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[i]),o[i]=setTimeout(function(){var e;e=i,l(".cameraCarousel"),document.getElementById(e+"-video")&&n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",$(document).find("[id='hideVideo-"+e+"']"))},parseInt(resources.VideoTimeoutInMilliseconds)))}}),$(document).on("click",".hideMyVideo",function(){var e;"undefined"!=typeof videojs&&(l(".cameraCarousel"),e=$(this).data("camera-id"),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[e]),o[e]=null),n(e+"my","carouselId-"+e,"showMyVideo-"+e,"hideMyVideo-"+e,e+"-myVideoContainer",this))}),$(document).on("CallRemoveVideo",function(){var e=$(".map-tooltip video");0<e.length&&$(e).each(function(){var e=$(this).parent().attr("id");videojs(document.getElementById(e)).dispose()})})});
window.CTVars={isErs:void 0,map:void 0,mapBounds:void 0,mapBottom:void 0,mapTop:void 0,tooltip:void 0,infoWindowObj:void 0,firstImage:void 0,imagesAlreadyLoaded:[],draggedMap:!1,contentHeightAdjusted:!1,externalPanListener:void 0,externalPanDone:!0,tooltipOpen:!1,firstMove:void 0,panByNotBusy:!0,widthAdjusted:void 0,widthHasIncreased:void 0,maxTooltipWidth:450};class CenterTooltip{constructor(t){CTVars.map=t,CTVars.isErs=0<$(".ersMode").length}startTriggers(){CTVars.map.addListener("dragend",()=>{CTVars.draggedMap=!0})}adjustTooltipScroll(){var t,e,o;centerTooltip.scrollTooltipMoreInfoIntoView(),centerTooltip.panBy(),CTVars.widthHasIncreased&&(t=document.getElementById("draggableBorder"))&&(e=t.querySelector(".row .event"),o=CTVars.mapBottom-CTVars.mapTop,e)&&e.scrollHeight!==t.scrollHeight+20&&e.scrollHeight<o&&(t.style.height=e.scrollHeight+20+"px")}externalPanCheck(){CTVars.externalPanDone=!1,CTVars.externalPanListener=CTVars.map.addListener("idle",this.externalPanEvent.bind(this))}externalPanEvent(){CTVars.externalPanListener&&CTVars.externalPanListener.instance&&(google.maps.event.removeListener(CTVars.externalPanListener),CTVars.externalPanListener=void 0,CTVars.externalPanDone=!0)}run(t){CTVars.panByNotBusy&&CTVars.externalPanDone&&CTVars.tooltipOpen?(this.resetRun(t),this.doFirstMove()):CTVars.tooltipOpen&&setTimeout(()=>{this.run()},100)}resetRun(t){CTVars.draggedMap=!1,CTVars.panByNotBusy=!0,CTVars.firstMove=!0,CTVars.widthHasIncreased=!1,CTVars.firstImage=void 0,CTVars.contentHeightAdjusted=!1,CTVars.firstImage&&CTVars.firstImage.removeEventListener("load",this.imageLoadedEvent.bind(this)),CTVars.tooltip=void 0,CTVars.infoWindowObj=t}tooltipClosed(){CTVars.tooltipOpen=!1}tooltipOpened(){CTVars.tooltipOpen=!0}doFirstMove(){this.setupImageLoadEvent(),this.setupTabEvent(),this.setTooltipScrolling(),this.panBy()}setTooltipScrolling(){CTVars.tooltip.dom&&CTVars.tooltip.isDraggable&&(CTVars.tooltip.dom.addEventListener("mouseover",()=>{CTVars.tooltip.dom.focus(),CTVars.map.set("scrollwheel",!1)}),CTVars.tooltip.dom.addEventListener("mouseout",()=>{CTVars.map.set("scrollwheel",!0)}))}imageLoadedEvent(){CTVars.firstImage&&(CTVars.firstImage.id&&-1===CTVars.imagesAlreadyLoaded.indexOf(CTVars.firstImage.id)&&CTVars.imagesAlreadyLoaded.push(CTVars.firstImage.id),CTVars.firstImage.removeEventListener("load",this.imageLoadedEvent.bind(this))),this.tryToPanBy()}panByEvent(){CTVars.panByListener&&CTVars.panByListener.instance&&(google.maps.event.removeListener(CTVars.panByListener),CTVars.panByListener=void 0,CTVars.panByNotBusy=!0,CTVars.firstMove)&&(CTVars.firstMove=!1,this.panBy())}tryToPanBy(){CTVars.panByNotBusy?this.panBy():setTimeout(()=>{this.tryToPanBy()},50)}panBy(){var t,e;this.setTooltip(),CTVars.tooltip.dom&&CTVars.tooltip.measures&&!CTVars.tooltip.insideBootbox&&CTVars.panByNotBusy&&(this.setMapBounds(),this.adjustTooltipSize(),this.setTooltip(),t=this.yTooltipMove(),0!==(e=this.xTooltipMove())||0!==t?(CTVars.panByNotBusy=!1,CTVars.panByListener=CTVars.map.addListener("idle",this.panByEvent.bind(this)),CTVars.map.panBy(e,t),this.adjustTooltipTop()):CTVars.firstMove&&(CTVars.firstMove=!1,this.panBy()))}adjustTooltipSize(){var e=document.getElementById("draggableBorder");if(e){var t=Math.round(e.scrollHeight);Math.round(e.getBoundingClientRect().height);if(t<CTVars.mapBottom-CTVars.mapTop?(e.style.height="unset",e.style.maxHeight="unset",e.style.overflowY="hidden",document.querySelector(".closeDraggableWindow").style.right="3px"):(e.style.height=CTVars.mapBottom-CTVars.mapTop+"px",e.style.maxHeight="unset",e.style.overflowY="auto",document.querySelector(".closeDraggableWindow").style.right="11px",CTVars.tooltip.hasSingleImg||CTVars.tooltip.hasSlickSlider||this.adjustTooltipWidth(),CTVars.tooltip.weatherForecast&&(t=document.querySelector(".draggableWindow"),o=CTVars.tooltip.dom.querySelector(".largeScreen table"),t)&&o&&(s=o.getBoundingClientRect().width,o.style.width=s+"px",t.style.width=s+55+"px")),CTVars.widthHasIncreased){let t=e.querySelector(".row .event");var o=(t=(t=null===t?e.querySelector(".map-tooltip"):t)||e.querySelector(".draggable-tooltip")).getBoundingClientRect().height;t&&t.scrollHeight!==e.scrollHeight+10&&o<CTVars.mapBottom-CTVars.mapTop&&!CTVars.contentHeightAdjusted&&(e.style.height=t.scrollHeight+10+"px",CTVars.contentHeightAdjusted=!0,setTimeout(()=>{this.tryToPanBy()}))}this.trimExcessTabHeight(e),CTVars.tooltip.hasInfoToggle&&$(document).on("tooltip-info-toggled",this.adjustTooltipScroll)}else CTVars.tooltip.hasSingleImg||CTVars.tooltip.hasSlickSlider||(t=document.querySelector(".gm-style-iw-d"))&&t.scrollHeight>t.clientHeight&&CTVars.infoWindowObj&&CTVars.infoWindowObj.maxWidth!==this.maxTooltipWidth&&(CTVars.widthAdjusted=CTVars.map.addListener("idle",this.googlewidthAdjustedEvent.bind(this)),CTVars.infoWindowObj.maxWidth=this.maxTooltipWidth);var s=document.querySelector(".draggableWindowContainer");s&&(s.style.visibility="visible")}trimExcessTabHeight(t){var e;0<CTVars.tooltip.dom.querySelectorAll(".nav-tabs a").length&&(e=CTVars.tooltip.dom.querySelector(".map-tooltip").getBoundingClientRect().height)<CTVars.mapBottom-CTVars.mapTop&&(t.style.height=e+15+"px")}googlewidthAdjustedEvent(){CTVars.widthAdjusted&&CTVars.widthAdjusted.instance&&(google.maps.event.removeListener(CTVars.widthAdjusted),CTVars.widthAdjusted=void 0,CTVars.draggedMap)&&this.panBy()}adjustTooltipWidth(){var t=document.querySelector(".draggableWindowContainer");t.getBoundingClientRect().width<this.maxTooltipWidth&&(t.style.width=this.maxTooltipWidth+"px",CTVars.widthHasIncreased=!0,(t=document.getElementById("draggableBorder")).scrollHeight===t.clientHeight)&&(document.querySelector(".closeDraggableWindow").style.right="3px")}setupImageLoadEvent(){var t,e;this.setTooltip(),CTVars.tooltip.dom&&CTVars.tooltip.measures&&(CTVars.tooltip.hasSlickSlider||CTVars.tooltip.hasSingleImg||CTVars.tooltip.weatherForecast)&&(CTVars.tooltip.dom.querySelector(".slick-slide")&&(CTVars.firstImage=CTVars.tooltip.dom.querySelector(".slick-slide").getElementsByTagName("img")[0]),t=CTVars.tooltip.dom.querySelector(".cctvCameraCarousel "),CTVars.firstImage||(CTVars.firstImage=CTVars.tooltip.dom.querySelector(".cctvImage")),CTVars.firstImage||(e=CTVars.tooltip.dom.querySelector(".largeScreen").getElementsByTagName("img"),CTVars.firstImage=e[e.length-1]),CTVars.firstImage&&-1===CTVars.imagesAlreadyLoaded.indexOf(CTVars.firstImage.id)||t)&&CTVars.firstImage.addEventListener("load",this.imageLoadedEvent.bind(this))}setMapBounds(){CTVars.mapBounds=document.getElementById("map-canvas").getBoundingClientRect(),CTVars.mapBottom=CTVars.mapBounds.bottom-100,CTVars.mapTop=CTVars.mapBounds.top+60+(CTVars.isErs?25:0)}setTooltip(){let t=document.querySelector(".draggableWindow"),e=!0,o=!1,s=!1,a={},r=!1,i=!1,l=!1;var n=document.querySelector(".bootbox");let d=!1;n&&n.querySelector(".map-tooltip")&&(d=!0),t||(t=(t=document.querySelector(".map-tooltip"))&&t.parentElement.parentElement,e=!1),t||(t=document.querySelector(".gm-style-iw"),e=!1),t&&(t.querySelector(".slick-slider")&&(o=!0),e?(n=document.querySelector("#draggableBorder")).scrollHeight>n.clientHeight&&(s=!0):t.scrollHeight>t.clientHeight&&(s=!0),t.querySelector(".cctvImage")&&(r=!0),a=t.getBoundingClientRect(),t.querySelector(".weatherForecast")&&(i=!0),t.querySelector("#toggleDetourText")||t.querySelector(".tooltip-comments"))&&(l=!0),CTVars.tooltip={dom:t,isDraggable:e,hasSlickSlider:o,hasScroll:s,measures:a,insideBootbox:d,hasSingleImg:r,weatherForecast:i,hasInfoToggle:l}}setupTabEvent(){var t;CTVars.tooltip&&CTVars.tooltip.dom&&(t=CTVars.tooltip.dom.querySelectorAll(".nav-tabs a"))&&$(t).on("shown.bs.tab",()=>{this.panBy()})}yTooltipMove(){let t=0;var e;return CTVars.firstMove||(CTVars.mapTop>CTVars.tooltip.measures.top?(t=CTVars.tooltip.measures.top-CTVars.mapTop,e=CTVars.mapBottom-CTVars.mapTop,-1*t>e&&(t=-1*e)):CTVars.mapBottom<CTVars.tooltip.measures.bottom&&(t=CTVars.tooltip.measures.bottom-CTVars.mapBottom+(CTVars.tooltip.isDraggable?0:10),e=CTVars.tooltip.measures.top-t,CTVars.mapTop>e)&&(t=0,CTVars.tooltip.hasScroll||CTVars.tooltip.isDraggable||(e=CTVars.tooltip.dom.parentElement.parentElement.getBoundingClientRect(),t=e.top-CTVars.mapTop))),t}xTooltipMove(){let t=0;var e=CTVars.tooltip.isDraggable;let o=!1,s;0<$(".col-md-12.mapColContainer").length?(a=$("#sideBarColContainer"))&&a.is(":visible")?(o=!0,s=a[0].getBoundingClientRect(),CTVars.tooltip.measures.left<s.right&&(t=-1*(s.right-CTVars.tooltip.measures.left+(e?10:20)))):CTVars.tooltip.measures.left<0&&(t=CTVars.tooltip.measures.left-CTVars.mapBounds.left+(e?-10:-25)):CTVars.tooltip.measures.left<CTVars.mapBounds.left&&(t=CTVars.tooltip.measures.left-CTVars.mapBounds.left+(e?-10:-25));var a=$("#layerSelection"),r=a&&a.is(":visible");let i;return r?(i=a[0].getBoundingClientRect(),CTVars.tooltip.measures.right>i.left&&(t=-1*(i.left-CTVars.tooltip.measures.right-(e?10:25)))):CTVars.tooltip.measures.right>CTVars.mapBounds.right&&(t=CTVars.tooltip.measures.right-CTVars.mapBounds.right-(e?-10:-25)+("TOP_CENTER"===resources.MapControlPos?0:50)),t=r&&o&&(a=s.x+s.width,e=i.x,!CTVars.firstMove)&&e-a<CTVars.tooltip.measures.width?0:t}scrollTooltipMoreInfoIntoView(){let t=document.getElementById("toggleDetourText");t=t||document.getElementById("toggleComment");var e,o=document.getElementById("draggableBorder");let s=o?!0:!1;this.setMapBounds(),s&&((e=document.getElementById("detourCollapse"))&&(e.classList.contains("in")?o.scrollHeight<CTVars.mapBottom-CTVars.mapTop?(o.style.height=o.scrollHeight+"px",o.style.maxHeight="unset"):(o.style.height=CTVars.mapBottom-CTVars.mapTop+"px",o.style.maxHeight="unset",e=t.getBoundingClientRect().top-o.getBoundingClientRect().top,o.scroll({top:e,left:0,behavior:"smooth"})):(o.removeAttribute("style"),this.adjustTooltipSize())),e=document.getElementById("lastUserComment"))&&("none"!==e.style.display?(e=e.getBoundingClientRect().bottom-o.getBoundingClientRect().top,o.scroll({top:e,left:0,behavior:"smooth"})):(o.removeAttribute("style"),this.adjustTooltipSize()))}clickInsideTooltip(t,e){if(!CTVars.tooltip||!CTVars.tooltipOpen)return!1;this.setTooltip();var o=CTVars.tooltip.measures,t=t>o.x&&t<o.x+o.width,e=e>o.y&&e<o.y+o.height;return t&&e}adjustTooltipTop(){var t,e=document.getElementById("draggableBorder");e&&e.scrollHeight>e.clientHeight&&0<document.getElementsByClassName("ersMode").length&&!e.querySelector("#draggableHeader")&&((t=document.createElement("div")).className="tooltipWhiteStrip",t.id="draggableHeader",e.prepend(t))}}
var ContextMenu=function(n,e){var a=this;this.onTouchStart=function(e){a.touchTimer||(a.touchTimer=setTimeout(function(){return a.onRightClick(e)},600))},this.onTouchEnd=function(e){a.touchTimer&&(clearTimeout(a.touchTimer),a.touchTimer=null,e.domEvent.preventDefault())},this.onDragStart=function(){a.touchTimer&&(clearTimeout(a.touchTimer),a.touchTimer=null)},this.onRightClick=function(e){a.touchTimer=null,a.contextMenu.hide();var t=e.pixel.x,n=e.pixel.y,e=e.latLng;a.helper.populateMenu(a.contextMenu,t,n,e,a.displayMenu),$(document).trigger("closeDraggableWindow")},this.displayMenu=function(e,t,n,o){a.contextMenu.empty(),a.contextMenu.append(e),a.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>"),a.setUpMenuEventHandlers(o);e=$(a.map.getDiv());t>e.width()-a.contextMenu.width()&&(t-=a.contextMenu.width()),n>e.height()-a.contextMenu.height()&&(n-=a.contextMenu.height()),a.contextMenu.css({top:n,left:t}).fadeIn(300)},this.AddWaypointToContextMenu=function(e){a.helper.AddWaypointToContextMenu(e)},this.setUpMenuEventHandlers=function(o){a.contextMenu.find("a").click(function(e){e.preventDefault(),t=("FONT"===e.target.tagName?e.target.parentElement.parentElement.getAttribute("href"):$(e.target).attr("href")).substr(1);var t,n=a.possiblyParseInt(t);if(null!=n)a.helper.doAction(a.contextMenu,e,n);else switch(a.contextMenu.fadeOut(75),t){case"resetMarkers":a.helper.resetMarkers(a.contextMenu);break;case"zoomIn":a.map.setZoom(a.map.getZoom()+1),a.map.panTo(o);break;case"zoomOut":a.map.setZoom(a.map.getZoom()-1),a.map.panTo(o);break;case"centerMap":a.map.panTo(o)}}),a.helper.setupEventHandlers(a.contextMenu)},this.possiblyParseInt=function(e){try{var t=parseInt(e);return isNaN(t)?null:t}catch(e){return null}},this.helper=e,this.contextMenu=$(document.createElement("ul")).attr("id","contextMenu"),this.contextMenu.bind("contextmenu",function(){return!1}),this.map=n,$(n.getDiv()).append(this.contextMenu),$.each("mousedown dragstart zoom_changed maptypeid_changed".split(" "),function(e,t){google.maps.event.addListener(n,t,function(){a.contextMenu.hide()})}),google.maps.event.addListener(n,"contextmenu",this.onRightClick),google.maps.event.addListener(n,"dragstart",this.onDragStart),google.maps.event.addDomListener(n,"mousedown",this.onTouchStart),google.maps.event.addDomListener(n,"mouseup",this.onTouchEnd)};
var CreateDraggableInfoWindow=function(l,t){var g,s,r,c,d,u=0;$(document).on("closeDraggableWindow",function(){d.set("scrollwheel",!0),d.gestureHandling="greedy","True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),l&&null!=l.container&&l.onRemove(),$(document).trigger("info-window-close"),$(document).off("closeDraggableWindow"),$(document).off("tooltip-info-toggled")});function o(t,e,o,n,a){google.maps.event.addDomListener(e,n,function(e){null==(e.changedTouches?e.changedTouches.item(t.touchTracker):null)&&"touchcancel"==e.type||google.maps.event.trigger(o,a,e)})}function n(i,e,r,t){return google.maps.event.addDomListener(e,t,function(e){var t,o,n,a=e.changedTouches?e.changedTouches.item(i.touchTracker):null;null==a&&"touchmove"==e.type||(null!=a&&0==$(document.elementFromPoint(a.pageX,a.pageY)).parents(".draggableWindow").length&&google.maps.event.trigger(r,"touchend",e),e.preventDefault(),t=(o=i.get("origin")).changedTouches?o.changedTouches.item(i.touchTracker):null,n="touchmove"==e.type?t.clientX-a.clientX:o.clientX-e.clientX,t="touchmove"==e.type?t.clientY-a.clientY:o.clientY-e.clientY,a=i.getProjection().fromLatLngToDivPixel(i.get("position")),o=i.getProjection().fromDivPixelToLatLng(new google.maps.Point(a.x-n,a.y-t)),i.set("origin",e),i.set("position",o),i.draw(),n=i,(a=g)&&l&&(n=n.getProjection().fromDivPixelToLatLng(new google.maps.Point(c.x-u,c.y-40)),a=[a.getPosition(),n],s.setPath(a)))})}function a(t,o,e){google.maps.event.addDomListener(o,e,function(e){-1!=e.target.className.indexOf("closeDraggableWindow")?($(document).trigger("callCloseInfoWindow"),document.getElementsByTagName("body")[0].style.userSelect="unset"):(e.stopPropagation(),"draggableBorder"!==e.target.getAttribute("id")&&"draggableHeader"!=e.target.getAttribute("id")||(document.getElementsByTagName("body")[0].style.userSelect="none",t.set("origin",e),e.changedTouches&&(t.touchTracker=e.changedTouches[0].identifier),t.moveHandler=n(t,t.get("map").getDiv(),o,"mousemove"),t.moveTouchHandler=n(t,t.get("map").getDiv(),o,"touchmove")))}),google.maps.event.addDomListener(d,"click",function(e){CTVars.tooltipOpen&&e.stop()})}function i(t,e,o){google.maps.event.addDomListener(e,o,function(e){document.getElementsByTagName("body")[0].style.userSelect="unset",null==(e.changedTouches?e.changedTouches.item(t.touchTracker):null)&&"touchend"==e.type||(t.touchTracker=null,google.maps.event.removeListener(t.moveHandler),google.maps.event.removeListener(t.moveTouchHandler))})}let e=["customMapCtrl","gm-svpc","gmnoprint"];function m(o){e.forEach(e=>{Array.from(document.getElementsByClassName(e)).forEach(e=>{var t;t=o,e.addEventListener("mouseover",()=>{google.maps.event.removeListener(t.moveHandler),google.maps.event.removeListener(t.moveTouchHandler),document.getElementsByTagName("body")[0].style.userSelect="unset"})})})}function p(e,t,o){"function"==typeof draw&&(this.draw=draw),this.setValues({position:t,container:null,content:o,map:e})}return(p.prototype=new google.maps.OverlayView).onAdd=function(){var e=document.createElement("div"),t=(that=this,$(e).ready(r),this.get("content"));if(void 0!==t.nodeName)e.appendChild(t);else{if("string"!=typeof t)return;e.innerHTML=t}e.style.position="absolute";var t=t.indexOf("infoWindowLoading");google.maps.OverlayView.preventMapHitsAndGesturesFrom(e),-1==t&&(o(that,this.get("map").getDiv(),e,"touchcancel","touchend"),o(that,this.get("map").getDiv(),e,"mouseleave","mouseup"),a(that,e,"touchstart"),a(that,e,"mousedown"),a(that,e,"contextmenu"),m(that),that,t="mouseenter",google.maps.event.addDomListener(e,t,function(e){d.gestureHandling="none"}),that,t="mouseleave",google.maps.event.addDomListener(e,t,function(e){d.gestureHandling="greedy"})),i(that,e,"touchend"),i(that,e,"mouseup"),this.set("container",e),this.getPanes().floatPane.appendChild(e),c=that.getProjection().fromLatLngToDivPixel(that.get("position")),latLng=that.getProjection().fromDivPixelToLatLng(new google.maps.Point(c.x,c.y))},p.prototype.draw=function(){c=this.getProjection().fromLatLngToDivPixel(this.get("position"));var e=this.get("container");e&&(e.style.left=c.x+"px",e.style.top=c.y+(t&&"number"==typeof t?t:0)+"px")},p.prototype.onRemove=function(){var e=this.get("container");e&&e.parentNode&&(e.parentNode.removeChild(e),this.set("container",null)),$(document).trigger("closeGoogleWindow"),s&&s.setMap(null)},function(e,t,o,n,a,i){g=t,d=e,r=i,-1===n.indexOf("infoWindowLoading")&&(n=n.replace('map-tooltip"','map-tooltip draggable-tooltip"')),t='<div class="draggableWindowContainer" style="width: '+a+'px;"><div class="draggableWindow">'+(n=(n="<div id='draggableBorder' class='tooltipPadding'>".concat(n)).concat("</div>"))+'<button class="fal fa-times closeDraggableWindow" aria-label="Close"></button></div></div>',l=new p(e,g.getPosition(),t),s=new google.maps.Polyline({strokeColor:"#999",strokeOpacity:1,strokeWeight:2,map:e}),$("#contextMenu").hide()}};
var Hashtable=function(h){var c,y,l="function",e="string";return"undefined"==typeof encodeURIComponent||Array.prototype.splice===h||Object.prototype.hasOwnProperty===h?null:(c=t("key"),y=t("value"),g.prototype={getEqualityFunction:function(t){return typeof t.equals==l?n:r},getEntryForKey:u(1),getEntryAndIndexForKey:u(2),removeEntryForKey:function(t){t=this.getEntryAndIndexForKey(t);return t?(this.entries.splice(t[0],1),t[1]):null},addEntry:function(t,n){this.entries.push([t,n])},keys:o(0),values:o(1),getEntries:function(t){for(var n=t.length,e=0,r=this.entries,i=r.length;e<i;++e)t[n+e]=r[e].slice(0)},containsKey:u(0),containsValue:function(t){for(var n=this.entries,e=n.length;e--;)if(t===n[e][1])return!0;return!1}},(s.prototype={each:function(t){for(var n,e=this.entries(),r=e.length;r--;)t((n=e[r])[0],n[1])},equals:function(t){var n,e,r,i=this.size();if(i!=t.size())return!1;for(n=this.keys();i--;)if(e=n[i],null===(r=t.get(e))||r!==this.get(e))return!1;return!0},putAll:function(t,n){for(var e,r,i,u=t.entries(),o=u.length,s=typeof n==l;o--;)e=(r=u[o])[0],r=r[1],s&&(i=this.get(e))&&(r=n(e,i,r)),this.put(e,r)},clone:function(){var t=new s(this.properties);return t.putAll(this),t}}).toQueryString=function(){for(var t,n=this.entries(),e=n.length,r=[];e--;)t=n[e],r[e]=encodeURIComponent(i(t[0]))+"="+encodeURIComponent(i(t[1]));return r.join("&")},s);function i(t){return typeof t==e?t:""+t}function p(t){var n;return typeof t==e?t:typeof t.hashCode==l?typeof(n=t.hashCode())==e?n:p(n):i(t)}function n(t,n){return t.equals(n)}function r(t,n){return typeof n.equals==l?n.equals(t):t===n}function t(n){return function(t){if(null===t)throw new Error("null is not a valid "+n);if(t===h)throw new Error(n+" must not be undefined")}}function g(t,n,e,r){this[0]=t,this.entries=[],this.addEntry(n,e),null!==r&&(this.getEqualityFunction=function(){return r})}function u(i){return function(t){for(var n,e=this.entries.length,r=this.getEqualityFunction(t);e--;)if(r(t,(n=this.entries[e])[0]))switch(i){case 0:return!0;case 1:return n;case 2:return[e,n[1]]}return!1}}function o(u){return function(t){for(var n=t.length,e=0,r=this.entries,i=r.length;e<i;++e)t[n+e]=r[e][u]}}function v(t,n){t=t[n];return t&&t instanceof g?t:null}function s(){var o=[],s={},l={replaceDuplicateKey:!0,hashCode:p,equals:null},t=arguments[0],n=arguments[1];if(n!==h)l.hashCode=t,l.equals=n;else if(t!==h){var e,r=l,i=t;for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e])}function u(e){return function(){for(var t=[],n=o.length;n--;)o[n][e](t);return t}}var f=l.hashCode,a=l.equals;this.properties=l,this.put=function(t,n){c(t),y(n);var e,r=f(t),i=null,u=v(s,r);return u?(e=u.getEntryForKey(t))?(l.replaceDuplicateKey&&(e[0]=t),i=e[1],e[1]=n):u.addEntry(t,n):(u=new g(r,t,n,a),o.push(u),s[r]=u),i},this.get=function(t){c(t);var n=f(t),n=v(s,n);if(n){n=n.getEntryForKey(t);if(n)return n[1]}return null},this.containsKey=function(t){c(t);var n=f(t),n=v(s,n);return!!n&&n.containsKey(t)},this.containsValue=function(t){y(t);for(var n=o.length;n--;)if(o[n].containsValue(t))return!0;return!1},this.clear=function(){o.length=0,s={}},this.isEmpty=function(){return!o.length};this.keys=u("keys"),this.values=u("values"),this.entries=u("getEntries"),this.remove=function(t){c(t);var n=f(t),e=null,r=v(s,n);return r&&null!==(e=r.removeEntryForKey(t))&&0==r.entries.length&&(t=function(t,n){for(var e=t.length;e--;)if(n===t[e][0])return e;return null}(o,n),o.splice(t,1),delete s[n]),e},this.size=function(){for(var t=0,n=o.length;n--;)t+=o[n].entries.length;return t}}}();
var IconManager=function(i,c){var e={},s=[],u=new MapFctns,d=(e.AddIconLayer=function(e,r,n,o,a,t){if(-1!=d(e))throw"layerid is already active.";n=new IconLayer(e,r,n,o,a,t);s.push(n),n.MapChanged(i,u,c),$(document).trigger("layerAdded-iconManager",[e,r])},e.RemoveIconLayer=function(e){e=d(e);-1!=e&&(s[e].Delete(c),s.splice(e,1))},e.GetIconLayer=function(e){e=d(e);if(-1!=e)return s[e]},e.RefreshLayers=function(){var e=s.length,r=0;if(e)for(var n in s)s[n].RefreshLayer(i,u,c).done(function(){++r==e&&$(document).trigger("layersRefreshed-iconManager")});else $(document).trigger("layersRefreshed-iconManager")},e.RefreshLayer=function(e,r){var e=d(e);return-1!=e?s[e].RefreshLayer(i,u,c,r):((e=jQuery.Deferred()).resolve(),e.promise())},e.MapChanged=function(){for(var e in s)s[e].MapChanged(i,u,c);$(document).trigger("mapChangedFinished-iconManager")},e.Redraw=function(){c.repaint(),$(document).trigger("markerClustererRepainted")},function(e){for(var r in s)if(s[r].layerId===e)return r;return-1});return e},IconLayer=function(h,e,t,v,i,r){var n={},y=(n.layerId=h,new Hashtable),c=!1,p=e.item2,M=e.item1,I=0,k=22,o=(r&&(r.minZoom&&(I=r.minZoom),r.maxZoom)&&(k=r.maxZoom),n.RefreshLayer=function(r,n,o,e){var a=jQuery.Deferred();return t(h,e,i).done(function(e){c||(p=e.item2,M=e.item1,s(r,n,o))}).always(function(e){$(document).trigger("layerRefreshed-iconManager."+h,[h,e]),a.resolve()}),a.promise()},n.MapChanged=function(e,r,n){s(e,r,n)},n.Delete=function(e){c=!0,o(e),$(document).trigger("layerDeleted-iconManager",[h])},n.GetIcons=function(){for(var e=y.keys(),r=[],n=0;n<e.length;n++){var o=y.get(e[n]);r.push(o.gmapsMarker)}return r},function(e){for(var r=y.keys(),n=new Array,o=0;o<r.length;o++){var a=y.get(r[o]);1==a.status&&(n.push(a.gmapsMarker),a.status=0)}e.removeMarkers(n,!0)}),s=function(e,r,n){var o=new Array,a=new Array,t={},i={},c=r.GetMapBoundsObject(e),s=e.getZoom();for(g in p){p[g]=(u=p[g],d=M,u.merged||(d.url&&!u.icon.url&&(u.icon.url=d.url),!d.json||u.icon.json&&"{"==u.icon.json[0]||(u.icon.json=d.json.replace("{jsondata}",u.icon.json)),u.zindex=d.zindex,void 0===u.icon.anchor&&(u.icon.anchor=d.anchor),void 0===u.icon.origin&&(u.icon.origin=d.origin),void 0===u.icon.size&&(u.icon.size=d.size),u.merged=!0),u);var u,d=h+"-"+p[g].type+"-"+p[g].itemId+"-"+p[g].icon.url+"-"+p[g].location[0]+"-"+p[g].location[1];t[d]=1,s<I||k<s||!R(p[g],c,r)||(i[d]=1,y.get(d))||(u=new IconItem(p[g],v(h,p[g])),y.put(d,u))}var g,f=y.keys();for(g in f){var m=f[g],l=y.get(m);0==l.status?t[m]?i[m]&&(l.status=1,o.push(l.gmapsMarker)):y.remove(m):t[m]?i[m]||(l.status=0,a.push(l.gmapsMarker)):(a.push(l.gmapsMarker),y.remove(m))}n.removeMarkers(a,!0),n.addMarkers(o,!0),0<y.values().length&&$(document).trigger("layerRefreshed-iconsAdded."+h,[h,o])},R=function(e,r,n){return n.CoordinateIsContained(e.location[0],e.location[1],r)};return n},IconItem=function(e,r){var n={};return n.icon=e,n.gmapsMarker=r,n.status=0,n};
var KmlManager=function(map,appHelper){var publicItem={},layers=new Hashtable;return publicItem.AddLayer=function(layerId,config){var kmlOptions,url,cacheTime,kmlLayer,layer;layers.get(layerId)||("Kml"==config.type?(kmlOptions={clickable:config.clickable,suppressInfoWindows:!0,preserveViewport:!0,map:map},config.url&&(url=URI(config.url),cacheTime=5,0<config.cacheTime&&(cacheTime=config.cacheTime/60),url.addSearch("t",roundDateToDuration(moment(),moment.duration(cacheTime,"minutes"),"floor").unix()),url.addSearch("lang",Cookies.get("_culture")).toString(),kmlLayer=new google.maps.KmlLayer(url.toString(),kmlOptions),config.suppressInfoWindow||kmlLayer.addListener("click",function(l){if(!l.domEvent||!appHelper.centerTooltip.clickInsideTooltip(l.domEvent.x,l.domEvent.y)){let e=l.featureData.description;var a="<div>"===e.slice(0,5)&&"</div>"===e.slice(e.length-6,e.length);e="<div class='map-tooltip'>"+(e=a?e.slice(0,4)+" class='kmlTooltip'"+e.slice(4,e.length):e)+"</div>",appHelper.showInfoWindow(e,null,!0,l.latLng,layerId,!0,!1,l.pixelOffset)}}),layers.put(layerId,kmlLayer))):"GeoJson"==config.type&&(layer=new google.maps.Data,layer.loadGeoJson(config.url),config.styleOptions&&layer.setStyle(JSON.parse(config.styleOptions)),layer.setMap(map),layers.put(layerId,layer),config.suppressInfoWindow||layer.addListener("click",function(event){appHelper.showInfoWindow(eval("`"+config.infoWindowTemplate+"`"),null,!0,event.latLng,null,!0,!0)})))},publicItem.RemoveLayer=function(e){layers.get(e)&&(layers.get(e).setMap(null),layers.remove(e))},publicItem.GetLayer=function(e){return layers.get(e)},publicItem.Refresh=function(e){for(var l=[...layers.keys()],a=0;a<l.length;a++)publicItem.RemoveLayer(l[a]);for(a=0;a<l.length;a++)publicItem.AddLayer(l[a],e[l[a]])},publicItem};
var MapFctns=function(){if(MapFctns.instance)return MapFctns.instance;var e={};function c(e){for(var n=e.split(","),t=[],o=n.length,r=0;r<o;r++){var s=n[r].trim().split(" "),s=new google.maps.LatLng(s[1],s[0]);t.push(s)}return t}e.CoordinateIsContained=function(e,n,t){return t.contains(new google.maps.LatLng(e,n))},e.GetMapBoundsObject=function(e){return e.getBounds()},e.GetMapSwLatLng=function(e){return e.getBounds().getSouthWest()},e.GetMapSpanLatLng=function(e){return e.getBounds().toSpan()},e.GetPolygonFromWKT=function(e){if(""!=e){var n,t=[],o=!1,r=(-1!==e.indexOf("MULTIPOLYGON")&&(o=!0,e=e.substring(e.indexOf("(")+1,e.length-1)),/\)\)(\s?,\s?)\(\(/g),s=/\(([^()]+)\)/g,a=[];if(o){for(var g=0;n=r.exec(e);){for(var i=[],u=e.substring(g,n.index+2),g=n.index+2;n=s.exec(u);)i.push(c(n[1]));a.push(i)}for(i=[],u=e.substring(g);n=s.exec(u);)i.push(c(n[1]))}else for(i=[];n=s.exec(e);)i.push(c(n[1]));a.push(i);for(var l=0;l<a.length;l++){var p=new google.maps.Polygon({paths:a[l],strokeColor:resources.EventPolygonStrokeColor,strokeOpacity:resources.EventPolygonStrokeOpacity,strokeWeight:resources.EventPolygonStrokeWeight,fillColor:resources.EventPolygonFillColor,fillOpacity:resources.EventPolygonFillOpacity});t.push(p)}return t}},e.getPolygonBounds=function(e){for(var n=new google.maps.LatLngBounds,t=0;t<e.length;t++)for(var o=e[t].getPaths(),t=0;t<o.getLength();t++)for(var r=o.getAt(t),s=0;s<r.getLength();s++)n.extend(r.getAt(s));return n},e.fitMapToRoute=function(g,e){var i=new google.maps.LatLngBounds,n=google.maps.event.addListenerOnce(g,"bounds_changed",function(e){var n=i.getNorthEast(),t=i.getSouthWest(),o=t.lng(),r=n.lng(),s=g.getZoom(),s=360/Math.pow(2,s)/256,a=$("#sideBarColContainer"),a=(a&&a.is(":visible")&&Modernizr.mq("(min-width: 993px)")&&(o-=s*a.outerWidth(!0)),$("#layerSelection"));a&&a.is(":visible")&&Modernizr.mq("(min-width: 993px)")&&(r+=s*a.outerWidth(!0)),u(g,n.lat(),o,t.lat(),r)}),i=t(g,e,i);setTimeout(function(){google.maps.event.removeListener(n)},3e3)};var t=function(e,n,t){for(var o=0;o<n.length;o++)t.extend(new google.maps.LatLng(n[o].point.latitude,n[o].point.longitude));return e.fitBounds(t),e.panBy(0,0),t},u=function(e,n,t,o,r){var s=new google.maps.LatLngBounds;s.extend(new google.maps.LatLng(n,t)),s.extend(new google.maps.LatLng(o,r)),e.fitBounds(s),e.panBy(0,0)};return MapFctns.instance=e};
var SaveMapViewControl=function(e,t){e.className="saveMapViewControlContainer customMapCtrl";var a=document.createElement("div"),e=(a.className="saveMapViewControl",e.appendChild(a),document.createElement("i")),o=(e.className="far fa-save",e.setAttribute("title",resources.SaveMapView),e.setAttribute("aria-label",resources.SaveMapView),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),a.appendChild(e),document.createElement("i"));o.className="far fa-map-marked",o.setAttribute("title",resources.GoToMapView),o.setAttribute("aria-label",resources.GoToMapView),o.setAttribute("role","button"),o.setAttribute("tabindex","0"),a.appendChild(o),google.maps.event.addDomListener(e,"click",function(){saveMapViewInfo(t)}),google.maps.event.addDomListener(e,"keydown",function(e){"Enter"!==e.code&&"Space"!==e.code||saveMapViewInfo(t)}),google.maps.event.addDomListener(o,"click",function(){setMapViewInfo(t)}),google.maps.event.addDomListener(o,"keydown",function(e){"Enter"!==e.code&&"Space"!==e.code||setMapViewInfo(t)})},saveMapViewInfo=function(e){e={lat:e.getCenter().lat(),lng:e.getCenter().lng(),zoom:e.getZoom()};Cookies.set("_saveMapView",JSON.stringify(e),{expires:365,path:"/"}),$(".map-feedback-msg span").html(resources.SaveMapViewSuccess),$(".map-feedback-msg").show().delay(3e3).fadeOut()},setMapViewInfo=function(e){var t,a;null!=Cookies.get("_saveMapView")?(t=JSON.parse(Cookies.get("_saveMapView")),a=new google.maps.LatLng(t.lat,t.lng),e.panTo(a),t.zoom&&e.setZoom(t.zoom)):($(".map-feedback-msg span").html(resources.GoToMapViewError),$(".map-feedback-msg").show().delay(3e3).fadeOut())},mobileToggleMapModeControl=function(e,t){e.className="darkModeControlContainer customMapCtrl";var a=document.createElement("div"),e=(a.className="darkModeControl",e.appendChild(a),document.createElement("i"));e.className="fas fa-adjust",e.setAttribute("title",resources.ToggleDarkLightMap),e.setAttribute("aria-label",resources.ToggleDarkLightMap),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),a.appendChild(e)};
function MarkerClusterer(t,e,r,s){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=t,this.oms_=s,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var s=r||{},i=(this.gridSize_=s.gridSize||60,this.minClusterSize_=s.minimumClusterSize||2,this.maxZoom_=s.maxZoom||null,this.styles_=s.styles||[],this.imagePath_=s.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=s.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,null!=s.zoomOnClick&&(this.zoomOnClick_=s.zoomOnClick),this.averageCenter_=!1,null!=s.averageCenter&&(this.averageCenter_=s.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom(),this);google.maps.event.addListener(this.map_,"zoom_changed",function(){var t=i.map_.getZoom();i.prevZoom_!=t&&(i.prevZoom_=t,i.resetViewport())}),e&&e.length&&this.addMarkers(e,!1)}function Cluster(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,t.getStyles(),t.getGridSize())}function ClusterIcon(t,e,r){t.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.styles_=e,this.padding_=r||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}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(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var t,e=0;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var t,e=this.getMarkers(),r=new google.maps.LatLngBounds,s=0;t=e[s];s++)r.extend(t.getPosition());this.map_.fitBounds(r),this.map_.panBy(0,0)},MarkerClusterer.prototype.setStyles=function(t){this.styles_=t},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(t){this.maxZoom_=t},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.calculator_=function(t,e){for(var r=0,t=t.length,s=t;0!==s;)s=parseInt(s/10,10),r++;return{text:t,index:r=Math.min(r,e)}},MarkerClusterer.prototype.setCalculator=function(t){this.calculator_=t},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(t,e){for(var r,s=0;r=t[s];s++)r.preventClustering||this.oms_.addMarker(r),this.pushMarkerTo_(r);e||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(t){var e;t.isAdded=!1,t.draggable&&(e=this,google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})),this.markers_.push(t)},MarkerClusterer.prototype.addMarker=function(t,e){t.preventClustering||this.oms_.addMarker(t),this.pushMarkerTo_(t),e||this.redraw()},MarkerClusterer.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r,s=0;r=this.markers_[s];s++)if(r==t){e=s;break}return-1!=e&&(t.setMap(null),t.clustered=!0,google.maps.event.trigger(t,"marker-clustered",!0),this.markers_.splice(e,1),!0)},MarkerClusterer.prototype.removeMarker=function(t,e){this.oms_.removeMarker(t);t=this.removeMarker_(t);return!(e||!t||(this.resetViewport(),this.redraw(),0))},MarkerClusterer.prototype.removeMarkers=function(t,e){for(var r=!1,s=0;i=t[s];s++){this.oms_.removeMarker(i);var i=this.removeMarker_(i),r=r||i}if(!e&&r)return this.resetViewport(),this.redraw(),!0},MarkerClusterer.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(t){this.map_=t},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(t){this.gridSize_=t},MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},MarkerClusterer.prototype.getExtendedBounds=function(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),s=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),r=e.fromLatLngToDivPixel(r),s=(r.x+=this.gridSize_,r.y-=this.gridSize_,e.fromLatLngToDivPixel(s)),r=(s.x-=this.gridSize_,s.y+=this.gridSize_,e.fromDivPixelToLatLng(r)),e=e.fromDivPixelToLatLng(s);return t.extend(r),t.extend(e),t},MarkerClusterer.prototype.isMarkerInBounds_=function(t,e){return!!t.getPosition&&e.contains(t.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},MarkerClusterer.prototype.resetViewport=function(t){for(var e,r=0;e=this.clusters_[r];r++)e.remove();for(var s,r=0;s=this.markers_[r];r++)s.isAdded=!1,t&&s.setMap(null);this.clusters_=[]},MarkerClusterer.prototype.repaint=function(){var r=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var t,e=0;t=r[e];e++)t.remove()},0)},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.distanceBetweenPoints_=function(t,e){var r,s;return t&&e?(s=(e.lat()-t.lat())*Math.PI/180,r=(e.lng()-t.lng())*Math.PI/180,s=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2),6371*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))):0},MarkerClusterer.prototype.addToClosestCluster_=function(t){for(var e,r=4e4,s=null,i=(t.getPosition(),0);e=this.clusters_[i];i++){var o=e.getCenter();o&&(o=this.distanceBetweenPoints_(o,t.getPosition()))<r&&(r=o,s=e)}s&&s.isMarkerInClusterBounds(t)?s.addMarker(t):((e=new Cluster(this)).addMarker(t),this.clusters_.push(e))},MarkerClusterer.prototype.createClusters_=function(){if(this.ready_)for(var t,e=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),r=this.getExtendedBounds(e),s=0;t=this.markers_[s];s++)!t.isAdded&&this.isMarkerInBounds_(t,r)&&this.addToClosestCluster_(t)},Cluster.prototype.isMarkerAlreadyAdded=function(t){if(this.markers_.indexOf)return-1!=this.markers_.indexOf(t);for(var e,r=0;e=this.markers_[r];r++)if(e==t)return!0;return!1},Cluster.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded(t))return!1;this.center_?this.averageCenter_&&(r=this.markers_.length+1,e=(this.center_.lat()*(r-1)+t.getPosition().lat())/r,r=(this.center_.lng()*(r-1)+t.getPosition().lng())/r,this.center_=new google.maps.LatLng(e,r),this.calculateBounds_()):(this.center_=t.getPosition(),this.calculateBounds_()),t.isAdded=!0,t.preventClustering||this.markers_.push(t);var e,r,s=this.markers_.length;if((s<this.minClusterSize_||t.preventClustering)&&(t.getMap()!=this.map_&&t.setMap(this.map_),t.clustered=!1,google.maps.event.trigger(t,"marker-clustered",!1)),s==this.minClusterSize_)for(var i=0;i<s;i++)this.markers_[i].setMap(null),this.markers_[i].clustered=!0,google.maps.event.trigger(this.markers_[i],"marker-clustered",!0);return s>=this.minClusterSize_&&!t.preventClustering&&(t.setMap(null),t.clustered=!0,google.maps.event.trigger(t,"marker-clustered",!0)),this.updateIcon(),!0},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var t,e=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),s=0;t=r[s];s++)e.extend(t.getPosition());return e},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 t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},Cluster.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&e<t)for(var r,s=0;r=this.markers_[s];s++)r.map!==this.map_&&(r.setMap(this.map_),r.clustered=!1,google.maps.event.trigger(r,"marker-clustered",!1));else this.markers_.length<this.minClusterSize_?this.clusterIcon_.hide():(e=this.markerClusterer_.getStyles().length,t=this.markerClusterer_.getCalculator()(this.markers_,e),this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(t),this.clusterIcon_.show())},ClusterIcon.prototype.triggerClusterClick=function(t){var e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e,"clusterclick",this.cluster_,t),e.isZoomOnClick()&&(this.map_.fitBounds(this.cluster_.getBounds()),this.map_.panBy(0,0))},ClusterIcon.prototype.onAdd=function(){var t;this.div_=document.createElement("DIV"),this.visible_&&(t=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text);this.getPanes().overlayMouseTarget.appendChild(this.div_);var e=this;google.maps.event.addDomListener(this.div_,"click",function(t){t.stopPropagation(),e.triggerClusterClick(t)})},ClusterIcon.prototype.getPosFromLatLng_=function(t){t=this.getProjection().fromLatLngToDivPixel(t);return"object"==typeof this.iconAnchor_&&2===this.iconAnchor_.length?(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(){var t;this.visible_&&(t=this.getPosFromLatLng_(this.center_),this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px")},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){var t;this.div_&&(t=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(t),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(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()},ClusterIcon.prototype.useStyle=function(){var t=Math.max(0,this.sums_.index-1),t=Math.min(this.styles_.length-1,t),t=this.styles_[t];this.url_=t.url,this.height_=t.height,this.width_=t.width,this.textColor_=t.textColor,this.anchor_=t.anchor,this.textSize_=t.textSize,this.backgroundPosition_=t.backgroundPosition,this.iconAnchor_=t.iconAnchor},ClusterIcon.prototype.setCenter=function(t){this.center_=t},ClusterIcon.prototype.createCss=function(t){var e=[],r=(e.push("background-image:url("+this.url_+");"),this.backgroundPosition_||"0 0"),r=(e.push("background-position:"+r+";"),"object"==typeof this.anchor_?("number"==typeof this.anchor_[0]&&0<this.anchor_[0]&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):"number"==typeof this.anchor_[0]&&this.anchor_[0]<0&&-this.anchor_[0]<this.height_?e.push("height:"+this.height_+"px; line-height:"+(this.height_+this.anchor_[0])+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),"number"==typeof this.anchor_[1]&&0<this.anchor_[1]&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;"),this.textColor_||"black"),s=this.textSize_||11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+r+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")};
function getMobileOs(){var n=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(n)?"Windows Phone":/android/i.test(n)?"Android":["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document?"iOS":"unknown"}
var noPanOffEarth=function(g){var o=new google.maps.LatLngBounds(new google.maps.LatLng(-75.05113,-180),new google.maps.LatLng(75.05113,180));google.maps.event.addListener(g,"center_changed",function(){var n,a,e,t;t=g.getCenter(),t=new google.maps.LatLng(t.lat(),t.lng(),!1),o.contains(t)||(n=t.lng(),t=t.lat(),(a=o.getNorthEast().lat())<(t=t<(e=o.getSouthWest().lat())?e:t)&&(t=a),g.panTo(new google.maps.LatLng(t,n)))})};
!function(){var t,s,e,o,f={}.hasOwnProperty,g=[].slice;this.OverlappingMarkerSpiderfier=function(){function t(t,e){var r,i,n,s,o;for(r in this.map=t,null==e&&(e={}),null==this.constructor.N&&(this.constructor.N=!0,c=google.maps,u=c.event,a=c.MapTypeId,l.keepSpiderfied=!1,l.ignoreMapClick=!1,l.markersWontHide=!1,l.markersWontMove=!1,l.basicFormatEvents=!1,l.nearbyDistance=20,l.circleSpiralSwitchover=9,l.circleFootSeparation=23,l.circleStartAngle=h/12,l.spiralFootSeparation=26,l.spiralLengthStart=11,l.spiralLengthFactor=4,l.spiderfiedZIndex=c.Marker.MAX_ZINDEX+2e4,l.highlightedLegZIndex=c.Marker.MAX_ZINDEX+1e4,l.usualLegZIndex=c.Marker.MAX_ZINDEX+1,l.legWeight=1.5,l.legColors={usual:{},highlighted:{}},t=l.legColors.usual,i=l.legColors.highlighted,t[a.HYBRID]=t[a.SATELLITE]="#fff",i[a.HYBRID]=i[a.SATELLITE]="#f00",t[a.TERRAIN]=t[a.ROADMAP]="#444",i[a.TERRAIN]=i[a.ROADMAP]="#f00",this.constructor.j=function(t){return this.setMap(t)},this.constructor.j.prototype=new c.OverlayView,this.constructor.j.prototype.draw=function(){}),e)f.call(e,r)&&(i=e[r],this[r]=i);this.g=new this.constructor.j(this.map),this.C(),this.c={},this.B=this.l=null,this.addListener("click",function(t,e){return u.trigger(t,"spider_click",e)}),this.addListener("format",function(t,e){return u.trigger(t,"spider_format",e)}),this.ignoreMapClick||u.addListener(this.map,"click",(n=this,function(){return n.unspiderfy()})),u.addListener(this.map,"maptypeid_changed",(s=this,function(){return s.unspiderfy()})),u.addListener(this.map,"zoom_changed",(o=this,function(){if(o.unspiderfy(),!o.basicFormatEvents)return o.h()}))}for(var u,c,a,h,l=t.prototype,e=[t,l],r=0,i=e.length;r<i;r++)e[r].VERSION="1.0.3";return h=2*Math.PI,c=u=a=null,t.markerStatus={SPIDERFIED:"SPIDERFIED",SPIDERFIABLE:"SPIDERFIABLE",UNSPIDERFIABLE:"UNSPIDERFIABLE",UNSPIDERFIED:"UNSPIDERFIED"},l.C=function(){this.a=[],this.s=[]},l.addMarker=function(t,e){return t.setMap(this.map),this.trackMarker(t,e)},l.trackMarker=function(e,t){var r,i,n,s;return null==e._oms&&(e._oms=!0,r=[u.addListener(e,"click",(i=this,function(t){return i.V(e,t)}))],this.markersWontHide||r.push(u.addListener(e,"visible_changed",(n=this,function(){return n.D(e,!1)}))),this.markersWontMove||r.push(u.addListener(e,"position_changed",(s=this,function(){return s.D(e,!0)}))),null!=t&&r.push(u.addListener(e,"spider_click",t)),this.s.push(r),this.a.push(e),this.basicFormatEvents?this.trigger("format",e,this.constructor.markerStatus.UNSPIDERFIED):(this.trigger("format",e,this.constructor.markerStatus.UNSPIDERFIABLE),this.h())),this},l.D=function(t,e){if(!this.J&&!this.K)return null==t._omsData||!e&&t.getVisible()||this.unspiderfy(e?t:null),this.h()},l.getMarkers=function(){return this.a.slice(0)},l.removeMarker=function(t){return this.forgetMarker(t),t.setMap(null)},l.forgetMarker=function(t){var e,r,i,n,s;if(null!=t._omsData&&this.unspiderfy(),!((e=this.A(this.a,t))<0)){for(r=0,i=(s=this.s.splice(e,1)[0]).length;r<i;r++)n=s[r],u.removeListener(n);delete t._oms,this.a.splice(e,1),this.h()}return this},l.removeAllMarkers=l.clearMarkers=function(){var t,e,r=this.getMarkers();for(this.forgetAllMarkers(),t=0,e=r.length;t<e;t++)r[t].setMap(null);return this},l.forgetAllMarkers=function(){var t,e,r,i,n,s,o,a;for(this.unspiderfy(),t=e=0,r=(a=this.a).length;e<r;t=++e){for(s=a[t],o=0,t=(n=this.s[t]).length;o<t;o++)i=n[o],u.removeListener(i);delete s._oms}return this.C(),this},l.addListener=function(t,e){var r;return(null!=(r=this.c)[t]?r[t]:r[t]=[]).push(e),this},l.removeListener=function(t,e){e=this.A(this.c[t],e);return e<0||this.c[t].splice(e,1),this},l.clearListeners=function(t){return this.c[t]=[],this},l.trigger=function(){for(var t,e=arguments[0],r=2<=arguments.length?g.call(arguments,1):[],i=[],n=0,s=(e=null!=(t=this.c[e])?t:[]).length;n<s;n++)t=e[n],i.push(t.apply(null,r));return i},l.L=function(t,e){for(var r,i=this.circleFootSeparation*(2+t)/h,n=h/t,s=[],o=r=0;0<=t?r<t:t<r;o=0<=t?++r:--r)o=this.circleStartAngle+o*n,s.push(new c.Point(e.x+i*Math.cos(o),e.y+i*Math.sin(o)));return s},l.M=function(t,e){for(var r,i=this.spiralLengthStart,n=0,s=[],o=r=0;0<=t?r<t:t<r;o=0<=t?++r:--r)n+=this.spiralFootSeparation/i+5e-4*o,o=new c.Point(e.x+i*Math.cos(n),e.y+i*Math.sin(n)),i+=h*this.spiralLengthFactor/n,s.push(o);return s},l.V=function(t,e){var r,i,n,s,o,a,h,l,u;if((a=null!=t._omsData)&&this.keepSpiderfied||this.unspiderfy(),a||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",t,e);for(a=[],h=[],l=(r=this.nearbyDistance)*r,o=this.f(t.position),r=0,i=(u=this.a).length;r<i;r++)null!=(n=u[r]).map&&n.getVisible()&&(s=this.f(n.position),this.i(s,o)<l?a.push({R:n,G:s}):h.push(n));return 1===a.length?this.trigger("click",t,e):this.W(a,h)},l.markersNearMarker=function(t,e){var r,i,n,s,o,a,h,l;if(null==e&&(e=!1),null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";for(a=(r=this.nearbyDistance)*r,s=this.f(t.position),o=[],r=0,i=(h=this.a).length;r<i&&!((n=h[r])!==t&&null!=n.map&&n.getVisible()&&(l=this.f(null!=(l=null!=(l=n._omsData)?l.v:void 0)?l:n.position),this.i(l,s)<a)&&(o.push(n),e));r++);return o},l.F=function(){var t,e,r,i,n,s,o,a,h,l,u,c;if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";for(h=this.nearbyDistance,h*=h,c=[],l=0,e=(n=this.a).length;l<e;l++)i=n[l],c.push({H:this.f(null!=(t=null!=(r=i._omsData)?r.v:void 0)?t:i.position),b:!1});for(t=r=0,i=(l=this.a).length;r<i;t=++r)if(null!=(e=l[t]).getMap()&&e.getVisible()&&!(s=c[t]).b)for(e=a=0,n=(u=this.a).length;a<n;e=++a)if(o=u[e],e!==t&&null!=o.getMap()&&o.getVisible()&&(o=c[e],!(e<t)||o.b)&&this.i(s.H,o.H)<h){s.b=o.b=!0;break}return c},l.markersNearAnyOtherMarker=function(){for(var t,e,r=this.F(),i=this.a,n=[],s=t=0,o=i.length;t<o;s=++t)e=i[s],r[s].b&&n.push(e);return n},l.setImmediate=function(t){return window.setTimeout(t,0)},l.h=function(){if(!this.basicFormatEvents&&null==this.l)return this.l=this.setImmediate((t=this,function(){return(t.l=null)!=t.g.getProjection()?t.w():null!=t.B?void 0:t.B=u.addListenerOnce(t.map,"idle",function(){return t.w()})}));var t},l.w=function(){var t,e,r,i,n,s,o;if(this.basicFormatEvents){for(n=[],e=0,r=markers.length;e<r;e++)t=null!=(i=markers[e])._omsData?"SPIDERFIED":"UNSPIDERFIED",n.push(this.trigger("format",i,this.constructor.markerStatus[t]));return n}for(n=this.F(),o=[],t=r=0,e=(s=this.a).length;r<e;t=++r)t=null!=(i=s[t])._omsData?"SPIDERFIED":n[t].b?"SPIDERFIABLE":"UNSPIDERFIABLE",o.push(this.trigger("format",i,this.constructor.markerStatus[t]));return o},l.P=function(t){return{m:function(){return t._omsData.o.setOptions({strokeColor:r.legColors.highlighted[r.map.mapTypeId],zIndex:r.highlightedLegZIndex})},u:(e=r=this,function(){return t._omsData.o.setOptions({strokeColor:e.legColors.usual[e.map.mapTypeId],zIndex:e.usualLegZIndex})})};var e,r},l.W=function(i,t){var e,n,s,o,a,h,l,r;return this.J=!0,r=i.length,e=this.T(function(){for(var t=[],e=0,r=i.length;e<r;e++)h=i[e],t.push(h.G);return t}()),o=r>=this.circleSpiralSwitchover?this.M(r,e).reverse():this.L(r,e),e=function(){for(var t=[],e=0,r=o.length;e<r;e++)s=o[e],n=this.U(s),l=this.S(i,function(e){return function(t){return e.i(t.G,s)}}(this)),l=l.R,a=new c.Polyline({map:this.map,path:[l.position,n],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight,zIndex:this.usualLegZIndex}),l._omsData={v:l.getPosition(),X:l.getZIndex(),o:a},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(a=this.P(l),l._omsData.O={m:u.addListener(l,"mouseover",a.m),u:u.addListener(l,"mouseout",a.u)}),this.trigger("format",l,this.constructor.markerStatus.SPIDERFIED),l.setPosition(n),l.setZIndex(Math.round(this.spiderfiedZIndex+s.y)),t.push(l);return t}.call(this),delete this.J,this.I=!0,this.trigger("spiderfy",e,t)},l.unspiderfy=function(t){var e,r,i,n,s,o,a;if(null==t&&(t=null),null!=this.I){for(this.K=!0,a=[],s=[],e=0,r=(o=this.a).length;e<r;e++)(null!=(n=o[e])._omsData?(n._omsData.o.setMap(null),n!==t&&n.setPosition(n._omsData.v),n.setZIndex(n._omsData.X),null!=(i=n._omsData.O)&&(u.removeListener(i.m),u.removeListener(i.u)),delete n._omsData,n!==t&&(i=this.basicFormatEvents?"UNSPIDERFIED":"SPIDERFIABLE",this.trigger("format",n,this.constructor.markerStatus[i])),a):s).push(n);delete this.K,delete this.I,this.trigger("unspiderfy",a,s)}return this},l.i=function(t,e){var r=t.x-e.x,t=t.y-e.y;return r*r+t*t},l.T=function(t){for(var e,r,i,n=r=i=0,s=t.length;n<s;n++)r+=(e=t[n]).x,i+=e.y;return t=t.length,new c.Point(r/t,i/t)},l.f=function(t){return this.g.getProjection().fromLatLngToDivPixel(t)},l.U=function(t){return this.g.getProjection().fromDivPixelToLatLng(t)},l.S=function(t,e){for(var r,i,n,s,o=s=0,a=t.length;s<a;o=++s)n=e(t[o]),(null==r||n<i)&&(i=n,r=o);return t.splice(r,1)[0]},l.A=function(t,e){var r,i,n;if(null!=t.indexOf)return t.indexOf(e);for(r=i=0,n=t.length;i<n;r=++i)if(t[r]===e)return r;return-1},t}(),s=/(\?.*(&|&amp;)|\?)spiderfier_callback=(\w+)/,null!=(t=null==(t=document.currentScript)?function(){for(var t,e=document.getElementsByTagName("script"),r=[],i=0,n=e.length;i<n;i++)null!=(t=(o=e[i]).getAttribute("src"))&&t.match(s)&&r.push(o);return r}()[0]:t)&&(t=null!=(e=t.getAttribute("src"))&&null!=(e=e.match(s))?e[3]:void 0)&&"function"==typeof window[t]&&window[t](),"function"==typeof window.spiderfier_callback&&window.spiderfier_callback()}.call(this);
var PolylineManager=function(s,y){var e={},d=[],c=new MapFctns,g=(e.AddPolylineLayer=function(e,n,r,a,i,l,o,t,u,f){if(-1!=g(e))throw"layerid is already active.";e=new PolylineLayer(e,n,r,a,i,l,o,t,u,f,y);d.push(e),e.MapChanged(s,c)},e.GetPolylines=function(e){for(var n=0;n<d.length;n++)if(d[n].layerId==e)return d[n].layerPolyLines()},e.RemovePolylineLayer=function(e){e=g(e);-1!=e&&(d[e].Delete(),d.splice(e,1))},e.RefreshLayers=function(e){var n=0,r=0;if(d.length)for(var a in $(document).on("layerRefreshed-polylineManager.internal",function(){++r==n&&($(document).trigger("layersRefreshed-polylineManager"),$(document).unbind("layerRefreshed-polylineManager.internal"))}),n=d.length,d)d[a].RefreshLayer(s,c,e);else $(document).trigger("layersRefreshed-polylineManager")},e.RefreshLayer=function(e,n){for(var r in d){r=d[r];if(r.layerId==e)return void r.RefreshLayer(s,c,n)}},e.MapChanged=function(){for(var e in d)d[e].MapChanged(s,c);$(document).trigger("mapChangedFinished-polylineManager")},function(e){for(var n in d)if(d[n].layerId===e)return n;return-1});return e},PolylineLayer=function(l,o,t,u,f,s,y,n,i,e,d){var c={},g=!1,p=null;function h(e){for(var n in oldPolylines=p,p=[],o){var r,a={strokeColor:o[n].lineColor,strokeOpacity:null==o[n].icons?t:0,strokeWeight:u,zIndex:f,map:null,path:o[n].decodedPoints,icons:o[n].icons},i=new google.maps.Polyline(a);for(r in e&&google.maps.event.addListener(i,"click",function(n){return e=>{d(l,n,null,e.latLng,20)}}(o[n].id)),i.canDraw=!0,oldPolylines)o[n].id==oldPolylines[r].sourceData.id&&(i.canDraw=oldPolylines[r].gMapLine.canDraw);p.push({gMapLine:i,sourceData:o[n]})}$(document).trigger("polylineLayer-polylinesBuilt",[l,p])}c.layerId=l,h(),c.layerPolyLines=function(){return p},c.RefreshLayer=function(r,a,e){n(function(e,n){g||(o=e,v(),h(n),c.MapChanged(r,a)),$(document).trigger("layerRefreshed-polylineManager",[l])},i,e)},c.MapChanged=function(e,n){var r=e.getZoom();if(y<r||r<s)for(var a in p)p[a].gMapLine.setMap(null);else{var i=n.GetMapBoundsObject(e);for(a in p){var l,o=p[a].gMapLine,t=!1,u=o.getPath().getArray();for(l in u){var f=u[l];if(n.CoordinateIsContained(f.lat(),f.lng(),i)){t=!0;break}}o.setMap(t&&o.canDraw?e:null)}}},c.Delete=function(){g=!0,v()};var v=function(){for(var e in p)p[e].gMapLine.setMap(null)};return c};
var cctvIntervalIds=[],cctvPictures=[],activeSliders=[],cctvRefreshInterval=2e3;$(function(){function r(){for(var e=0;e<cctvIntervalIds.length;e++)clearInterval(cctvIntervalIds[e]);if(cctvIntervalIds=[],document.getElementById("map-canvas")){for(e=0;e<activeSliders.length;e++)void 0!==activeSliders[e]&&activeSliders[e].slick("unslick");activeSliders=[]}}$(document).on("cameraImagesInitialized",function(e,t){r(),$(".carouselCctvImage").each(function(e){activeSliders.push(setupSlickCarousel($(this)))}),$(".cctvImage").one("load",function(){var e=$(this).prev(),e=(e.hasClass("agencyLogo")&&e.show(),$("button.showVideo")),t=0<$(".camTooltip").length||0<$(".myCamTooltip").length;e&&0<e.length&&"True"==resources.StartVideoOnDisplay&&t&&e[0].click()}).each(function(){this.complete&&$(this).trigger("load")}),$(".cctvCameraCarousel").hasClass("setVisibility")&&$(".cctvCameraCarousel").removeClass("setVisibility");var a={},s=[];$(".cctvImage").each(function(){var e=$(this).attr("data-refresh-rate");e&&!a[e]&&0<e&&(s.push(e),a[e]=!0)});for(var c=0;c<s.length;c++)cctvIntervalIds.push(setInterval(function(e){$('.cctvImage[data-refresh-rate="'+e+'"]').each(function(){0!=$(this).parents(".slick-slide").length&&!$(this).parents(".slick-slide").hasClass("slick-active")||null==$(this).attr("src")||$(this).attr("src",URI($(this).attr("src")).search("t="+roundDateToDuration(moment().startOf("second"),moment.duration(parseInt(e)),"floor").unix())),0<$(this).parents(".slick-slide").length&&!$(this).parents(".slick-slide").hasClass("slick-active")&&$(this).attr("data-needsrefresh","true")})},s[c],s[c]));{let e=document.querySelector(".map-tooltip");(e=(e=(e=(e=e||document.querySelector("#cctvTable tbody"))||document.querySelector("#myCctvTable tbody"))||document.querySelector("#eventTable tbody"))||document.querySelector(".list-page tbody"))&&$(document).trigger("setup-fullscreen-img-modal",[e,t])}}),$(document).on("cameraImagesClearIntervals",function(){r()})});
var TileManager=function(s,y){var e,t={},i=((new Date).getTime(),null),m={},g=null,h=null,n=(t.AddTileLayer=function(n,r){if(0<u(n).length)throw"layerid is already active.";var e,a=new TileLayer(n,r.urlFormat,r.tooltipUrlFormat,r.animationFrames,r.cache),t=new TileOverlayMapType({name:n,getTileUrl:function(e,t,i,n){var a=s.getZoom();return a>r.maxZoom||a<r.minZoom?null:e.getTileUrl(t.x,t.y,i,n)},tileSize:new google.maps.Size(256,256),isPng:!0,opacity:r.opacity,startingFrame:r.startingFrame,startPlaying:r.startPlaying},a,r.animationFrames);if(r.tooltipUrlFormat&&(e=google.maps.event.addListener(s,"click",function(e){var t,i;e.domEvent&&y.centerTooltip.clickInsideTooltip(e.domEvent.x,e.domEvent.y)||(t=e.latLng.lat(),i=e.latLng.lng(),(e=s.getZoom())<=r.maxZoom&&e>=r.minZoom&&$.ajax(a.getTooltipUrl(t,i,e)).done(function(e){y.showInfoWindow(e,null,!0,new google.maps.LatLng(t,i),n,!0,!0),y.centerTooltip.run()}))}),m[n]=e),""!=r.highwayFill||""!=r.highwayStroke){var i=s.get("styles")||[],l=!1,o=!1;if(0!=i.length)for(style in i)if("road.highway"==i[style].featureType&&"geometry.fill"==i[style].elementType){for(styler in i[style].stylers)void 0!==i[style].stylers[styler].color&&(g=i[style].stylers[styler].color,i[style].stylers[styler].color=r.highwayFill,l=!0);l||(i[style].stylers.push({color:r.highwayFill}),l=!0)}else if("road.highway"==i[style].featureType&&"geometry.stroke"==i[style].elementType){for(styler in i[style].stylers)void 0!==i[style].stylers[styler].color&&(h=i[style].stylers[styler].color,i[style].stylers[styler].color=r.highwayStroke,o=!0);o||(tyles[style].stylers.push({color:r.highwayStroke}),o=!0)}l||i.push({featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:r.highwayFill}]}),o||i.push({featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:r.highwayStroke}]}),s.setOptions({styles:i})}0<=r.zlevel?s.overlayMapTypes.insertAt(0,t):s.overlayMapTypes.push(t)},t.RemoveTileLayer=function(e){var t=u(e);if(0<=t.length)for(var i=0;i<t.length;i++)s.overlayMapTypes.getArray()[t[0]].clearAnimationTimer(),s.overlayMapTypes.removeAt(t[0]);var n=s.get("styles");for(style in n)if("road.highway"==n[style].featureType&&"geometry.fill"==n[style].elementType)for(styler in n[style].stylers)n[style].stylers[styler].color&&(n[style].stylers[styler].color=g);else if("road.highway"==n[style].featureType&&"geometry.stroke"==n[style].elementType)for(styler in n[style].stylers)n[style].stylers[styler].color&&(n[style].stylers[styler].color=h);s.setOptions({styles:n}),m[e]&&(google.maps.event.removeListener(m[e]),m[e]=null)},t.RefreshLayers=function(){e=(new Date).getTime(),(null==i||i<e)&&n()},function(){for(var e=s.overlayMapTypes.getArray(),t=0;t<e.length;t++){var i=e[t];i.isTileOverlayMapType&&null===i.animationTimer&&i.refreshTiles(!1)}}),u=function(e){for(var t=s.overlayMapTypes.getArray(),i=[],n=0;n<t.length;n++)t[n].name==e&&t[n].isTileOverlayMapType&&i.push(n);return i};function a(){i=(new Date).getTime()}return google.maps.event.addListener(s,"bounds_changed",a),google.maps.event.addListener(s,"zoom_changed",a),t},TileLayer=function(e,t,i,n,a){var r={},l=t,o=i,s=n;return r.layerId=e,r.getTileUrl=function(e,t,i,n){e=URI.expand(l,{x:e,y:t,z:i});return 0<s?e.addSearch("frame",n):a?e.addSearch("t",moment().startOf("minute").unix()):e.addSearch("tmTime",moment().unix()),e.toString()},r.getTooltipUrl=function(e,t,i){return URI.expand(o,{lat:e,lng:t,z:i}).toString()},r},TileOverlayMapType=function(e,t,i){var o={};if(this.isTileOverlayMapType=!0,this.name=e.name,this.getTileUrl=e.getTileUrl,this.tileSize=e.tileSize,this.isPng=e.isPng,this.tileLayer=t,this.animationCounter=e.startingFrame,this.animationFrames=i,this.opacity=e.opacity,this.startPlaying=e.startPlaying,this.animationTimer=null,this.isAnimating=!1,this.getTile=function(e,t,i){var n,a=this.getTileUrl(this.tileLayer,e,t,this.animationCounter),r="x_"+e.x+"_y_"+e.y+"_zoom_"+t,l=i.createElement("div");return l.style.backgroundPosition="center center",l.style.backgroundRepeat="no-repeat",l.style.height=this.tileSize.height+"px",l.style.width=this.tileSize.width+"px",l.style.opacity=this.opacity,l.tileId=r,l.coord=e,l.zoom=t,l.timestamp=new Date,o[r]=l,a&&((n=new Image).onload=function(){l.style.backgroundImage="url("+a+")",n.onload=null,n=null},n.src=a,0<this.animationFrames)&&(l.img=n),l},this.refreshTiles=function(e){if(0!=e&&0<this.animationFrames){var t=!0;for(const[r,a]of Object.entries(o))if(void 0===a.img||!a.img.complete){t=!1;break}if(this.isAnimating||!t)return;this.animationCounter=(this.animationCounter+1)%this.animationFrames,this.isAnimating=!0}for(var i in o){var n,a=o[i],i=this.getTileUrl(this.tileLayer,a.coord,a.zoom,this.animationCounter);i&&((n=new Image).onload=function(e,t,i){return function(){t.style.backgroundImage="url("+i+")",e.onload=null,e=null}}(n,a,i),n.src=i,0<this.animationFrames)&&(a.img=n)}this.isAnimating=!1},this.getOpacity=function(){return this.opacity},this.releaseTile=function(e){o[e.tileId]&&e.timestamp==o[e.tileId].timestamp&&delete o[e.tileId]},this.clearAnimationTimer=function(){null!=this.animationTimer&&(window.clearInterval(this.animationTimer),this.animationTimer=null,$(document).off("animation-toggle-"+this.name))},0<this.animationFrames){var n=this;const a=parseInt(window.resources.WeatherRadarFramesAnimation);this.startPlaying?n.animationTimer=window.setInterval(function(){n.refreshTiles(),$(document).trigger("animation-update-"+n.name,[n.animationCounter])},a):$(document).trigger("timerbox-update-"+n.name,[n.animationCounter]),$(document).on("animation-toggle-"+n.name,function(e,t){"pause"==t&&n.animationTimer?(window.clearInterval(n.animationTimer),n.animationTimer=null):"play"==t&&(n.animationTimer=window.setInterval(function(){n.refreshTiles(),$(document).trigger("animation-update-"+n.name,[n.animationCounter])},a))})}};
"use strict";var UrlHash=function(){var e=this;this.hashEvent="hashchange.urlHash",this.hashChangeHandler=function(){$(document).trigger("hashChanged-urlHash",[e.hash()])},this.whileWeSetHashHandler=function(){$(window).off(e.hashEvent),$(window).on(e.hashEvent,e.hashChangeHandler)},this.setWhileWeSetHashHandler=function(){$(window).off(e.hashEvent),$(window).on(e.hashEvent,e.whileWeSetHashHandler)},this.clearHash=function(){e.setWhileWeSetHashHandler(),window.location.hash="route"},this.hash=function(h,a){var n=window.location.hash.substr(1);return h&&n!=h&&(e.setWhileWeSetHashHandler(),a?window.location.replace(h):window.location.hash=h),n},$._data(window,"events").hashchange||$(window).on(this.hashEvent,this.hashChangeHandler)},urlHash=new UrlHash;
var UserGeolocation=function(e,i,o,a,n){function t(t){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition?navigator.geolocation.getCurrentPosition(function(o){o=new google.maps.LatLng(o.coords.latitude,o.coords.longitude);t(o)}):t(null)}var l={};return l.AttemptToSetLocationWithUsersGeolocation=function(n,o){l.GetUserGeolocation(function(o){var t;o&&(t=e.GetCustomSimplePlace("",null,o.lat(),o.lng(),!1),i.SetLocationByGeo(n,t),a.panTo(o))})},l.AttemptToSetWaypointWithUsersGeolocation=function(n){l.GetUserGeolocation(function(o){var t;o&&(t=e.GetCustomSimplePlace("",null,o.lat(),o.lng(),!1),i.SetLocationByGeo(null,t,!0,n),a.panTo(o))})},window.SetUserRegion=function(o){var t;o&&(t=[o[0],o[1]],n.center(t,parseInt(o[2])))},window.GetUserGeolocation=function(o){t(o)},l.GetUserGeolocation=function(o){t(o)},l};
var WaypointManager=function(u,d,o,p){function a(l,s,c,u){s.name?c?g.setWaypoint(s,u,!0):g.setLocation(l,s,!0):(new google.maps.Geocoder).geocode({location:new google.maps.LatLng(s.point.latitude,s.point.longitude)},function(e,t){if("OK"===t)if(e[0]){for(var n,o,a=0,i=1e4,r=0;r<e.length;r++)-1==e[r].types.indexOf("route")&&-1==e[r].types.indexOf("street_address")||(o=e[r].geometry.location.lat(),n=e[r].geometry.location.lng(),(o=Math.sqrt(Math.pow(s.point.latitude+90-(o+90),2)+Math.pow(s.point.longitude+180-(n+180),2)))<i&&(i=o,a=r));t=d.GetAddressDetails(e[a].address_components);s.streetNumber=t.streetNumber,s.streetName=t.streetName,s.postalCode=t.postalCode,s.state=t.state,s.name=e[a].formatted_address}else s.name=s.point.latitude+", "+s.point.longitude;else s.name=s.point.latitude+", "+s.point.longitude;c?g.setWaypoint(s,u,!0,!0):g.setLocation(l,s,!0)})}function l(o,e){var t,a,n=0==o,i=o==m.length-1,r=g,l=m[o].marker,s=n?"A":i?"B":"W",c=h(((new Date).getTime()+1e9*(e.lat()+e.lng())).toString());n?t="/Content/Images/Green-A.png":i?(t="/Content/Images/Red-B-New.png",$(document).trigger("hideLocationMarker")):t={path:google.maps.SymbolPath.CIRCLE,scale:4,fillColor:"#ffffff",fillOpacity:1},l?(l.setPosition(e),l.setMap(u),l.setIcon(t)):(a=new google.maps.Marker({map:u,position:e,draggable:!0,icon:t,letter:s,zIndex:-98,title:n||i?"":resources.ClickToRemove,hash:c}),m[o].marker=a,m[o].hash=c,n||i?google.maps.event.addListener(a,"dragend",function(e){g.clearLoationsWithoutPoints();e={point:{latitude:e.latLng.lat(),longitude:e.latLng.lng()}};r.getNameForSimplePlace(e,function(e){var t=m[n?0:m.length-1].marker!==a;g.setLocation(t?i:n,e,!0),m[0].point&&m[m.length-1].point&&"True"!==resources.AutoGenerateDriveRoute&&(0<$("#transitRouteResults").children().length&&0<$("#routeTabContent").children().length||0<$("#transitRouteResults").children().length?p.calculateRoute():"True"!==resources.AutoGenerateDriveRoute&&p.calculateRoute("drive"))})}):(google.maps.event.addListener(a,"dragend",function(e){loadBlockerApi.showSpinner("getNearestLocations"),g.clearLoationsWithoutPoints();for(var t=o,n=1;n<m.length;++n)if(m[n].marker===a){t=n;break}e={point:{latitude:e.latLng.lat(),longitude:e.latLng.lng()}};r.getNameForSimplePlace(e,function(e){f(t,e,!0),p.calculateRoute(),loadBlockerApi.hideSpinner("getNearestLocations")})}),a.addListener("click",function(){g.ClearWaypoint(o,a,!0),p.redrawWaypoints(!1)})))}var g={},m=[{selector:"#startLocationText"},{selector:"#endLocationText"}],f=(g.setMarker=l,g.getNameForSimplePlace=function(l,s){(new google.maps.Geocoder).geocode({location:new google.maps.LatLng(l.point.latitude,l.point.longitude)},function(e,t){if("OK"===t)if(e[0]){for(var n,o,a=0,i=1e4,r=0;r<e.length;r++)-1==e[r].types.indexOf("route")&&1==e[r].types.indexOf("street_address")||(o=e[r].geometry.location.lat(),n=e[r].geometry.location.lng(),(o=Math.sqrt(Math.pow(l.point.latitude+90-(o+90),2)+Math.pow(l.point.longitude+180-(n+180),2)))<i&&(i=o,a=r));t=d.GetAddressDetails(e[a].address_components);l.streetNumber=t.streetNumber,l.streetName=t.streetName,l.postalCode=t.postalCode,l.state=t.state,l.name=e[a].formatted_address}else l.name=l.point.latitude+", "+l.point.longitude;else l.name=l.point.latitude+", "+l.point.longitude;s(l)})},function(e,t,n){var o=0===e,a=e===m.length-1,n=(t.letter=o?"A":a?"B":"W",t.point&&l(e,new google.maps.LatLng(t.point.latitude,t.point.longitude)),n&&(o||a?$(o?"#startLocationText":"#endLocationText"):$("#waypointText-"+e)).val(t.nameDirection||t.name),m[e].point=t,0<$("body.mobileFirst").length);Modernizr.mq("(max-width: 992px)")&&n&&m[0].point&&m[m.length-1].point&&$(".mobileLocationBar .directions").trigger("click")}),h=function(e){for(var t=0,n=0;n<e.length;n++)t=~~((t<<5)-t+e.charCodeAt(n));return t};g.ClearWaypoint=function(e,t,n){var o;if(g.getLocationsTextFromUI(),!(0===e||e===m.length-1)||t&&null!=t.hash){if(t&&null!=t.hash){for(var a=0;a<m.length;a++)if(m[a].hash===t.hash){o=a;break}}else t=m[e].marker,o=e;if(null!=o){m.splice(o,1),g.updateTransitBtnState(),p.redrawWaypoints();for(let e=1;e<m.length-1;e++)m[e].selector="#waypointText-"+e;t&&(t.setMap(null),n)&&p.calculateRoute()}}},g.updateTransitBtnState=function(){m.length<3?($("#generateTransitRouteBtn").prop("disabled",!1),$("#generateDriveTransitRouteBtn").prop("disabled",!1),$("#generateWalkOnlyRouteBtn").prop("disabled",!1),$("#generateBicycleOnlyRouteBtn").prop("disabled",!1)):($("#generateTransitRouteBtn").prop("disabled",!0),$("#generateDriveTransitRouteBtn").prop("disabled",!0),$("#generateWalkOnlyRouteBtn").prop("disabled",!0),$("#generateBicycleOnlyRouteBtn").prop("disabled",!0))};function e(e){e.hash=null,e.marker=null,e.poiId=null,e.point=null,e.simplePlace=null,e.text=null}return g.clearAll=function(){g.clearMarkers(),m=[m[0],m[m.length-1]],e(m[0]),e(m[1]),$("#startLocationText").val(""),$("#endLocationText").val(""),$("#waypoints").html(""),o.AddWaypointToContextMenu(!1),g.updateTransitBtnState()},g.clearMarkers=function(){m.forEach(function(e){e&&e.marker&&e.marker.setMap(null)})},g.removeWaypoints=function(){g.clearMarkers(),m=[m[0],m[m.length-1]],g.updateTransitBtnState()},g.getLocationArray=function(){g.getLocationsTextFromUI();var e=m.map(e=>d.GetLocationDetails(e));return Promise.all(e).then(e=>e)},g.enterkeyHandler=function(e){13==e.which&&document.activeElement!=document.getElementById("mapLocation")&&document.activeElement!=document.getElementById("Passwordmodal")&&($("#RoutesTab").hasClass("active")||$("#RoutesTab > a").click(),$("#generateRouteBtn").click())},g.setLocation=function(e,t,n){f(e?0:m.length-1,t,n),m[0].point&&m[m.length-1].point?(o.AddWaypointToContextMenu(!0),"True"===resources.AutoGenerateDriveRoute&&p.calculateRoute()):o.AddWaypointToContextMenu(!1),$(document).trigger("removeMyLocationMarker"),$(document).off("keypress",null,g.enterkeyHandler),$(document).on("keypress",null,g.enterkeyHandler)},g.setWaypoint=function(e,t,n,o,a){var i,r;g.updateTransitBtnState(),r=t,n=n,o=o,(i=e).letter="W",o?(m[r].marker&&m[r].marker.setMap(null),m[r]={point:i,text:i.name,selector:"#waypointText-"+r}):g.addWaypoint(r,i),n&&$("#waypointText-"+r).val(i.nameDirection||i.name),"True"!==resources.AutoGenerateDriveRoute||a||p.calculateRoute(),e.point&&l(t,new google.maps.LatLng(e.point.latitude,e.point.longitude))},g.SetLocationByGeo=a,g.setDetails=function(){for(var e=0;e<m.length;++e)m[e].point&&f(e,m[e].point,!0)},g.setStartEndPoint=function(e,t){g.clearAll(),f(0,e,!0),f(m.length-1,t,!0)},g.setAllLocations=function(e){g.setStartEndPoint(e[0],e[e.length-1]);for(var t=1;t<e.length-1;++t)g.setWaypoint(e[t],t,null,null,!0);for(t=0;t<e.length;++t)m[t].text||(m[t].text=e[t].nameDirection||e[t].name)},g.swapStartEnd=function(){m.reverse(),g.resetSelectors()},g.resetSelectors=function(){m[0].selector="#startLocationText";for(let e=1;e<m.length;e++)m[e].selector="#waypointText-"+e;m[m.length-1].selector="#endLocationText"},g.getLocations=function(){return m},g.adjustMarker=function(e,t,n){t=new google.maps.LatLng(t,n);l(e,t)},g.addWaypoint=function(e,t){var n={selector:"#waypointText-"+e};t&&(n.point=t,n.text=t.name),m.splice(e,0,n),g.updateTransitBtnState(),g.resetSelectors()},g.getLocationsTextFromUI=function(){m.forEach(e=>{var t=$(e.selector).val();e.text=null!=t?t:e.text})},g.clearLoationsWithoutPoints=function(){var t=[m[0]];for(let e=1;e<m.length-1;e++)m[e].point&&t.push(m[e]);t.push(m[m.length-1]),m=t,g.resetSelectors()},$(document).on("locationSelected-contextMenu",function(e,t,n){var o;"waypoint"==t?(o=m.length-1,p.AddWaypointToPlanner("",!0),a(null,n,!0,o)):a(0==t.indexOf("from"),n)}),$(document).on("locationSelected-autocomplete",function(e,t){var n=m.findIndex(e=>e.selector===t.selector);n<0||(t.selector.startsWith("#waypoint")?g.setWaypoint(t.point,n,!1,!0):null!=t.marker&&null!=t.marker.map&&g.setLocation(0===n,t.point,!0))}),g};
var CitizenReporter=function(){this.addReport=function(t,o){$.ajax("/wta/wtaoptions",{data:{id:t,modalType:"CitizenReport"}}).done(function(e){e=bootbox.dialog({title:o,message:e,closeButton:!1,className:"wtaContentModel crStatus",buttons:{save:{label:resources.Save,className:"btn-primary bootboxSave",callback:function(){var e=[];$(".wtaOptionsParent select",this).each(function(){$.each($.makeArray($(this).val()),function(){e.push({Id:this})})}),$.ajax("/wta/addCitizenReport",{type:"POST",data:{data:{id:t,statuses:e}}}).done(function(e){bootbox.alert(resources.CitizenReporterReportSubmited,null)}).fail(function(){bootbox.alert(resources.CitizenReporterReportFailed,null)})}},cancel:{label:resources.Cancel,className:"btn-primary"}}});$(".selectpicker",e).selectpicker({noneSelectedText:resources.NoneSelected,selectedTextFormat:"count > 3"})}).fail(function(){bootbox.alert(resources.ErrorLoadingWtaContent,null)})}},citizenReporter=new CitizenReporter;
!function(r){var d;r.fn.printThis=function(e){d=r.extend({},r.fn.printThis.defaults,e);var t,n,i=this instanceof jQuery?this:r(this),e="printThis-"+(new Date).getTime(),a=(window.location.hostname!==document.domain&&navigator.userAgent.match(/msie/i)?(t='javascript:document.write("<head><script>document.domain=\\"'+document.domain+'\\";<\/script></head><body></body>")',(n=document.createElement("iframe")).name="printIframe",n.id=e,n.className="MSIE",document.body.appendChild(n),n.src=t):r("<iframe id='"+e+"' name='printIframe' />").appendTo("body"),r("#"+e));d.debug||a.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"}),setTimeout(function(){var e,o=a.contents(),n=o.find("head"),t=o.find("body");n.append('<base href="'+document.location.protocol+"//"+document.location.host+'">'),d.importCSS&&r("link[rel=stylesheet]").each(function(){var e,t=r(this).attr("href");t&&(e=r(this).attr("media")||"all",n.append("<link type='text/css' rel='stylesheet' href='"+t+"' media='"+e+"'>"))}),d.importStyle&&r("style").each(function(){r(this).clone().appendTo(n)}),d.pageTitle&&n.append("<title>"+d.pageTitle+"</title>"),d.loadCSS&&(r.isArray(d.loadCSS)?jQuery.each(d.loadCSS,function(e,t){n.append("<link type='text/css' rel='stylesheet' href='"+this+"'>")}):n.append("<link type='text/css' rel='stylesheet' href='"+d.loadCSS+"'>")),d.header&&t.append(d.header),d.printContainer?t.append(i.outer()):i.each(function(){t.append(r(this).html())}),d.formValues&&((e=i.find("input")).length&&e.each(function(){var e=r(this),t=r(this).attr("name"),n=e.is(":checkbox")||e.is(":radio"),i=o.find('input[name="'+t+'"]'),a=e.val();n?e.is(":checked")&&(e.is(":checkbox")?i.attr("checked","checked"):e.is(":radio")&&o.find('input[name="'+t+'"][value='+a+"]").attr("checked","checked")):i.val(a)}),(e=i.find("select")).length&&e.each(function(){var e=r(this),t=r(this).attr("name"),e=e.val();o.find('select[name="'+t+'"]').val(e)}),(e=i.find("textarea")).length)&&e.each(function(){var e=r(this),t=r(this).attr("name"),e=e.val();o.find('textarea[name="'+t+'"]').val(e)}),d.removeInline&&(r.isFunction(r.removeAttr)?o.find("body *").removeAttr("style"):o.find("body *").attr("style","")),setTimeout(function(){a.hasClass("MSIE")?(window.frames.printIframe.focus(),n.append("<script>  window.print(); <\/script>")):(a[0].contentWindow.focus(),a[0].contentWindow.print()),d.debug||setTimeout(function(){a.remove()},1e3)},d.printDelay)},333)},r.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 r(r("<div></div>").html(this.clone())).html()}}(jQuery);
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){var t,s=window.Slick||{};(s=(t=0,function s(e,o){var n,l=this;l.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" type="button">Previous</button>',nextArrow:'<button class="slick-next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,s){return i('<button type="button" />').text(s+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},l.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},i.extend(l,l.initials),l.activeBreakpoint=null,l.animType=null,l.animProp=null,l.breakpoints=[],l.breakpointSettings=[],l.cssTransitions=!1,l.focussed=!1,l.interrupted=!1,l.hidden="hidden",l.paused=!0,l.positionProp=null,l.respondTo=null,l.rowCount=1,l.shouldClick=!0,l.$slider=i(e),l.$slidesCache=null,l.transformType=null,l.transitionType=null,l.visibilityChange="visibilitychange",l.windowWidth=0,l.windowTimer=null,n=i(e).data("slick")||{},l.options=i.extend({},l.defaults,o,n),l.currentSlide=l.options.initialSlide,l.originalSettings=l.options,void 0!==document.mozHidden?(l.hidden="mozHidden",l.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(l.hidden="webkitHidden",l.visibilityChange="webkitvisibilitychange"),l.autoPlay=i.proxy(l.autoPlay,l),l.autoPlayClear=i.proxy(l.autoPlayClear,l),l.autoPlayIterator=i.proxy(l.autoPlayIterator,l),l.changeSlide=i.proxy(l.changeSlide,l),l.clickHandler=i.proxy(l.clickHandler,l),l.selectHandler=i.proxy(l.selectHandler,l),l.setPosition=i.proxy(l.setPosition,l),l.swipeHandler=i.proxy(l.swipeHandler,l),l.dragHandler=i.proxy(l.dragHandler,l),l.keyHandler=i.proxy(l.keyHandler,l),l.instanceUid=t++,l.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,l.registerBreakpoints(),l.init(!0)})).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},s.prototype.addSlide=s.prototype.slickAdd=function(t,s,e){var o=this;if("boolean"==typeof s)e=s,s=null;else if(s<0||s>=o.slideCount)return!1;o.unload(),"number"==typeof s?0===s&&0===o.$slides.length?i(t).appendTo(o.$slideTrack):e?i(t).insertBefore(o.$slides.eq(s)):i(t).insertAfter(o.$slides.eq(s)):!0===e?i(t).prependTo(o.$slideTrack):i(t).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each(function(t,s){i(s).attr("data-slick-index",t)}),o.$slidesCache=o.$slides,o.reinit()},s.prototype.animateHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.animate({height:i},this.options.speed)}},s.prototype.animateSlide=function(t,s){var e={},o=this;o.animateHeight(),!0===o.options.rtl&&!1===o.options.vertical&&(t=-t),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:t},o.options.speed,o.options.easing,s):o.$slideTrack.animate({top:t},o.options.speed,o.options.easing,s):!1===o.cssTransitions?(!0===o.options.rtl&&(o.currentLeft=-o.currentLeft),i({animStart:o.currentLeft}).animate({animStart:t},{duration:o.options.speed,easing:o.options.easing,step:function(i){i=Math.ceil(i),!1===o.options.vertical?(e[o.animType]="translate("+i+"px, 0px)",o.$slideTrack.css(e)):(e[o.animType]="translate(0px,"+i+"px)",o.$slideTrack.css(e))},complete:function(){s&&s.call()}})):(o.applyTransition(),t=Math.ceil(t),!1===o.options.vertical?e[o.animType]="translate3d("+t+"px, 0px, 0px)":e[o.animType]="translate3d(0px,"+t+"px, 0px)",o.$slideTrack.css(e),s&&setTimeout(function(){o.disableTransition(),s.call()},o.options.speed))},s.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=i(t).not(this.$slider)),t},s.prototype.asNavFor=function(t){var s=this.getNavTarget();null!==s&&"object"==typeof s&&s.each(function(){var s=i(this).slick("getSlick");s.unslicked||s.slideHandler(t,!0)})},s.prototype.applyTransition=function(i){var t=this,s={};!1===t.options.fade?s[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:s[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(s):t.$slides.eq(i).css(s)},s.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},s.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},s.prototype.autoPlayIterator=function(){var i=this,t=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(t=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(t))},s.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=i(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=i(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),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},s.prototype.buildDots=function(){var t,s,e=this;if(!0===e.options.dots&&e.slideCount>e.options.slidesToShow){for(e.$slider.addClass("slick-dotted"),s=i("<ul />").addClass(e.options.dotsClass),t=0;t<=e.getDotCount();t+=1)s.append(i("<li />").append(e.options.customPaging.call(this,e,t)));e.$dots=s.appendTo(e.options.appendDots),e.$dots.find("li").first().addClass("slick-active")}},s.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,s){i(s).attr("data-slick-index",t).data("originalStyling",i(s).attr("style")||"")}),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?i('<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),(!0===t.options.centerMode||!0===t.options.swipeToSlide)&&(t.options.slidesToScroll=1),i("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},s.prototype.buildRows=function(){var i,t,s,e,o,n,l;if(e=document.createDocumentFragment(),n=this.$slider.children(),this.options.rows>0){for(i=0,l=this.options.slidesPerRow*this.options.rows,o=Math.ceil(n.length/l);i<o;i++){var r=document.createElement("div");for(t=0;t<this.options.rows;t++){var d=document.createElement("div");for(s=0;s<this.options.slidesPerRow;s++){var a=i*l+(t*this.options.slidesPerRow+s);n.get(a)&&d.appendChild(n.get(a))}r.appendChild(d)}e.appendChild(r)}this.$slider.empty().append(e),this.$slider.children().children().children().css({width:100/this.options.slidesPerRow+"%",display:"inline-block"})}},s.prototype.checkResponsive=function(t,s){var e,o,n,l=this,r=!1,d=l.$slider.width(),a=window.innerWidth||i(window).width();if("window"===l.respondTo?n=a:"slider"===l.respondTo?n=d:"min"===l.respondTo&&(n=Math.min(a,d)),l.options.responsive&&l.options.responsive.length&&null!==l.options.responsive){for(e in o=null,l.breakpoints)l.breakpoints.hasOwnProperty(e)&&(!1===l.originalSettings.mobileFirst?n<l.breakpoints[e]&&(o=l.breakpoints[e]):n>l.breakpoints[e]&&(o=l.breakpoints[e]));null!==o?null!==l.activeBreakpoint?(o!==l.activeBreakpoint||s)&&(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):null!==l.activeBreakpoint&&(l.activeBreakpoint=null,l.options=l.originalSettings,!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t),r=o),t||!1===r||l.$slider.trigger("breakpoint",[l,r])}},s.prototype.changeSlide=function(t,s){var e,o,n,l=i(t.currentTarget);switch(l.is("a")&&t.preventDefault(),l.is("li")||(l=l.closest("li")),e=(n=this.slideCount%this.options.slidesToScroll!=0)?0:(this.slideCount-this.currentSlide)%this.options.slidesToScroll,t.data.message){case"previous":o=0===e?this.options.slidesToScroll:this.options.slidesToShow-e,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide-o,!1,s);break;case"next":o=0===e?this.options.slidesToScroll:e,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide+o,!1,s);break;case"index":var r=0===t.data.index?0:t.data.index||l.index()*this.options.slidesToScroll;this.slideHandler(this.checkNavigable(r),!1,s),l.children().trigger("focus");break;default:return}},s.prototype.checkNavigable=function(i){var t,s;if(t=this.getNavigableIndexes(),s=0,i>t[t.length-1])i=t[t.length-1];else for(var e in t){if(i<t[e]){i=s;break}s=t[e]}return i},s.prototype.cleanUpEvents=function(){this.options.dots&&null!==this.$dots&&(i("li",this.$dots).off("click.slick",this.changeSlide).off("mouseenter.slick",i.proxy(this.interrupt,this,!0)).off("mouseleave.slick",i.proxy(this.interrupt,this,!1)),!0===this.options.accessibility&&this.$dots.off("keydown.slick",this.keyHandler)),this.$slider.off("focus.slick blur.slick"),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow&&this.$prevArrow.off("click.slick",this.changeSlide),this.$nextArrow&&this.$nextArrow.off("click.slick",this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow&&this.$prevArrow.off("keydown.slick",this.keyHandler),this.$nextArrow&&this.$nextArrow.off("keydown.slick",this.keyHandler))),this.$list.off("touchstart.slick mousedown.slick",this.swipeHandler),this.$list.off("touchmove.slick mousemove.slick",this.swipeHandler),this.$list.off("touchend.slick mouseup.slick",this.swipeHandler),this.$list.off("touchcancel.slick mouseleave.slick",this.swipeHandler),this.$list.off("click.slick",this.clickHandler),i(document).off(this.visibilityChange,this.visibility),this.cleanUpSlideEvents(),!0===this.options.accessibility&&this.$list.off("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().off("click.slick",this.selectHandler),i(window).off("orientationchange.slick.slick-"+this.instanceUid,this.orientationChange),i(window).off("resize.slick.slick-"+this.instanceUid,this.resize),i("[draggable!=true]",this.$slideTrack).off("dragstart",this.preventDefault),i(window).off("load.slick.slick-"+this.instanceUid,this.setPosition)},s.prototype.cleanUpSlideEvents=function(){this.$list.off("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.off("mouseleave.slick",i.proxy(this.interrupt,this,!1))},s.prototype.cleanUpRows=function(){var i;this.options.rows>0&&((i=this.$slides.children().children()).removeAttr("style"),this.$slider.empty().append(i))},s.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},s.prototype.destroy=function(t){var s=this;s.autoPlayClear(),s.touchObject={},s.cleanUpEvents(),i(".slick-cloned",s.$slider).detach(),s.$dots&&s.$dots.remove(),s.$prevArrow&&s.$prevArrow.length&&(s.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),s.htmlExpr.test(s.options.prevArrow)&&s.$prevArrow.remove()),s.$nextArrow&&s.$nextArrow.length&&(s.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),s.htmlExpr.test(s.options.nextArrow)&&s.$nextArrow.remove()),s.$slides&&(s.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.detach(),s.$list.detach(),s.$slider.append(s.$slides)),s.cleanUpRows(),s.$slider.removeClass("slick-slider"),s.$slider.removeClass("slick-initialized"),s.$slider.removeClass("slick-dotted"),s.unslicked=!0,t||s.$slider.trigger("destroy",[s])},s.prototype.disableTransition=function(i){var t=this,s={};s[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(s):t.$slides.eq(i).css(s)},s.prototype.fadeSlide=function(i,t){var s=this;!1===s.cssTransitions?(s.$slides.eq(i).css({zIndex:s.options.zIndex}),s.$slides.eq(i).animate({opacity:1},s.options.speed,s.options.easing,t)):(s.applyTransition(i),s.$slides.eq(i).css({opacity:1,zIndex:s.options.zIndex}),t&&setTimeout(function(){s.disableTransition(i),t.call()},s.options.speed))},s.prototype.fadeSlideOut=function(i){!1===this.cssTransitions?this.$slides.eq(i).animate({opacity:0,zIndex:this.options.zIndex-2},this.options.speed,this.options.easing):(this.applyTransition(i),this.$slides.eq(i).css({opacity:0,zIndex:this.options.zIndex-2}))},s.prototype.filterSlides=s.prototype.slickFilter=function(i){var t=this;null!==i&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(i).appendTo(t.$slideTrack),t.reinit())},s.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(s){var e=i(this);setTimeout(function(){t.options.pauseOnFocus&&e.is(":focus")&&(t.focussed=!0,t.autoPlay())},0)}).on("blur.slick","*",function(s){i(this),t.options.pauseOnFocus&&(t.focussed=!1,t.autoPlay())})},s.prototype.getCurrent=s.prototype.slickCurrentSlide=function(){return this.currentSlide},s.prototype.getDotCount=function(){var i=0,t=0,s=0;if(!0===this.options.infinite){if(this.slideCount<=this.options.slidesToShow)++s;else for(;i<this.slideCount;)++s,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow}else if(!0===this.options.centerMode)s=this.slideCount;else if(this.options.asNavFor)for(;i<this.slideCount;)++s,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;else s=1+Math.ceil((this.slideCount-this.options.slidesToShow)/this.options.slidesToScroll);return s-1},s.prototype.getLeft=function(i){var t,s,e,o,n=this,l=0;return n.slideOffset=0,s=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=-(n.slideWidth*n.options.slidesToShow*1),o=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?o=-1.5:1===n.options.slidesToShow&&(o=-2)),l=s*n.options.slidesToShow*o),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=-((n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*1),l=-((n.options.slidesToShow-(i-n.slideCount))*s*1)):(n.slideOffset=-(n.slideCount%n.options.slidesToScroll*n.slideWidth*1),l=-(n.slideCount%n.options.slidesToScroll*s*1)))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,l=(i+n.options.slidesToShow-n.slideCount)*s),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,l=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),t=!1===n.options.vertical?-(i*n.slideWidth*1)+n.slideOffset:-(i*s*1)+l,!0===n.options.variableWidth&&(e=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),t=!0===n.options.rtl?e[0]?-((n.$slideTrack.width()-e[0].offsetLeft-e.width())*1):0:e[0]?-1*e[0].offsetLeft:0,!0===n.options.centerMode&&(e=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),t=!0===n.options.rtl?e[0]?-((n.$slideTrack.width()-e[0].offsetLeft-e.width())*1):0:e[0]?-1*e[0].offsetLeft:0,t+=(n.$list.width()-e.outerWidth())/2)),t},s.prototype.getOption=s.prototype.slickGetOption=function(i){return this.options[i]},s.prototype.getNavigableIndexes=function(){var i,t=0,s=0,e=[];for(!1===this.options.infinite?i=this.slideCount:(t=-1*this.options.slidesToScroll,s=-1*this.options.slidesToScroll,i=2*this.slideCount);t<i;)e.push(t),t=s+this.options.slidesToScroll,s+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;return e},s.prototype.getSlick=function(){return this},s.prototype.getSlideCount=function(){var t,s,e,o,n=this;return(o=!0===n.options.centerMode?Math.floor(n.$list.width()/2):0,e=-1*n.swipeLeft+o,!0===n.options.swipeToSlide)?(n.$slideTrack.find(".slick-slide").each(function(t,o){var l,r,d;if(l=i(o).outerWidth(),r=o.offsetLeft,!0!==n.options.centerMode&&(r+=l/2),e<(d=r+l))return s=o,!1}),t=Math.abs(i(s).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},s.prototype.goTo=s.prototype.slickGoTo=function(i,t){this.changeSlide({data:{message:"index",index:parseInt(i)}},t)},s.prototype.init=function(t){var s=this;i(s.$slider).hasClass("slick-initialized")||(i(s.$slider).addClass("slick-initialized"),s.buildRows(),s.buildOut(),s.setProps(),s.startLoad(),s.loadSlider(),s.initializeEvents(),s.updateArrows(),s.updateDots(),s.checkResponsive(!0),s.focusHandler()),t&&s.$slider.trigger("init",[s]),!0===s.options.accessibility&&s.initADA(),s.options.autoplay&&(s.paused=!1,s.autoPlay())},s.prototype.initADA=function(){var t=this,s=Math.ceil(t.slideCount/t.options.slidesToShow),e=t.getNavigableIndexes().filter(function(i){return i>=0&&i<t.slideCount});t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(s){var o=e.indexOf(s);if(i(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+s,tabindex:-1}),-1!==o){var n="slick-slide-control"+t.instanceUid+o;i("#"+n).length&&i(this).attr({"aria-describedby":n})}}),t.$dots.attr("role","tablist").find("li").each(function(o){var n=e[o];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+o,"aria-controls":"slick-slide"+t.instanceUid+n,"aria-label":o+1+" of "+s,"aria-selected":null,tabindex:"-1"})}).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var o=t.currentSlide,n=o+t.options.slidesToShow;o<n;o++)t.options.focusOnChange?t.$slides.eq(o).attr({tabindex:"0"}):t.$slides.eq(o).removeAttr("tabindex");t.activateADA()},s.prototype.initArrowEvents=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},this.changeSlide),this.$nextArrow.off("click.slick").on("click.slick",{message:"next"},this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow.on("keydown.slick",this.keyHandler),this.$nextArrow.on("keydown.slick",this.keyHandler)))},s.prototype.initDotEvents=function(){!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&(i("li",this.$dots).on("click.slick",{message:"index"},this.changeSlide),!0===this.options.accessibility&&this.$dots.on("keydown.slick",this.keyHandler)),!0===this.options.dots&&!0===this.options.pauseOnDotsHover&&this.slideCount>this.options.slidesToShow&&i("li",this.$dots).on("mouseenter.slick",i.proxy(this.interrupt,this,!0)).on("mouseleave.slick",i.proxy(this.interrupt,this,!1))},s.prototype.initSlideEvents=function(){this.options.pauseOnHover&&(this.$list.on("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.on("mouseleave.slick",i.proxy(this.interrupt,this,!1)))},s.prototype.initializeEvents=function(){this.initArrowEvents(),this.initDotEvents(),this.initSlideEvents(),this.$list.on("touchstart.slick mousedown.slick",{action:"start"},this.swipeHandler),this.$list.on("touchmove.slick mousemove.slick",{action:"move"},this.swipeHandler),this.$list.on("touchend.slick mouseup.slick",{action:"end"},this.swipeHandler),this.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},this.swipeHandler),this.$list.on("click.slick",this.clickHandler),i(document).on(this.visibilityChange,i.proxy(this.visibility,this)),!0===this.options.accessibility&&this.$list.on("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().on("click.slick",this.selectHandler),i(window).on("orientationchange.slick.slick-"+this.instanceUid,i.proxy(this.orientationChange,this)),i(window).on("resize.slick.slick-"+this.instanceUid,i.proxy(this.resize,this)),i("[draggable!=true]",this.$slideTrack).on("dragstart",this.preventDefault),i(window).on("load.slick.slick-"+this.instanceUid,this.setPosition),i(this.setPosition)},s.prototype.initUI=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.show(),this.$nextArrow.show()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.show()},s.prototype.keyHandler=function(i){i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===this.options.accessibility?this.changeSlide({data:{message:!0===this.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===this.options.accessibility&&this.changeSlide({data:{message:!0===this.options.rtl?"previous":"next"}}))},s.prototype.lazyLoad=function(){var t,s,e,o,n=this;function l(t){i("img[data-lazy]",t).each(function(){var t=i(this),s=i(this).attr("data-lazy"),e=i(this).attr("data-srcset"),o=i(this).attr("data-srcloaded"),l=i(this).attr("data-sizes")||n.$slider.attr("data-sizes");o||(t.attr("data-srcloaded","true"),t.animate({opacity:0},100,function(){e&&(t.attr("srcset",e),l&&t.attr("sizes",l)),t.attr("src",s).animate({opacity:1},200,function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,t,s])}))})}if(!0===n.options.centerMode?!0===n.options.infinite?o=(e=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(e=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),o=2+(n.options.slidesToShow/2+1)+n.currentSlide):(o=Math.ceil((e=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide)+n.options.slidesToShow),!0===n.options.fade&&(e>0&&e--,o<=n.slideCount&&o++)),t=n.$slider.find(".slick-slide").slice(e,o),"anticipated"===n.options.lazyLoad)for(var r=e-1,d=o,a=n.$slider.find(".slick-slide"),c=0;c<n.options.slidesToScroll;c++)r<0&&(r=n.slideCount-1),t=(t=t.add(a.eq(r))).add(a.eq(d)),r--,d++;l(t),n.slideCount<=n.options.slidesToShow?l(s=n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?l(s=n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&l(s=n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},s.prototype.loadSlider=function(){this.setPosition(),this.$slideTrack.css({opacity:1}),this.$slider.removeClass("slick-loading"),this.initUI(),"progressive"===this.options.lazyLoad&&this.progressiveLazyLoad()},s.prototype.next=s.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},s.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},s.prototype.pause=s.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},s.prototype.play=s.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},s.prototype.postSlide=function(t){var s=this;!s.unslicked&&(s.$slider.trigger("afterChange",[s,t]),s.animating=!1,s.slideCount>s.options.slidesToShow&&s.setPosition(),s.swipeLeft=null,s.options.autoplay&&s.autoPlay(),!0===s.options.accessibility&&(s.initADA(),s.options.focusOnChange))&&i(s.$slides.get(s.currentSlide)).attr("tabindex",0).focus()},s.prototype.prev=s.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},s.prototype.preventDefault=function(i){i.preventDefault()},s.prototype.progressiveLazyLoad=function(t){t=t||1;var s,e,o,n,l,r=this,d=i("img[data-lazy]",r.$slider);d.length?(e=(s=d.first()).attr("data-lazy"),o=s.attr("data-srcset"),n=s.attr("data-sizes")||r.$slider.attr("data-sizes"),(l=document.createElement("img")).onload=function(){o&&(s.attr("srcset",o),n&&s.attr("sizes",n)),s.attr("src",e).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===r.options.adaptiveHeight&&r.setPosition(),r.$slider.trigger("lazyLoaded",[r,s,e]),r.progressiveLazyLoad()},l.onerror=function(){t<3?setTimeout(function(){r.progressiveLazyLoad(t+1)},500):(s.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,s,e]),r.progressiveLazyLoad())},l.src=e):r.$slider.trigger("allImagesLoaded",[r])},s.prototype.refresh=function(t){var s,e,o=this;e=o.slideCount-o.options.slidesToShow,!o.options.infinite&&o.currentSlide>e&&(o.currentSlide=e),o.slideCount<=o.options.slidesToShow&&(o.currentSlide=0),s=o.currentSlide,o.destroy(!0),i.extend(o,o.initials,{currentSlide:s}),o.init(),t||o.changeSlide({data:{message:"index",index:s}},!1)},s.prototype.registerBreakpoints=function(){var t,s,e,o=this,n=o.options.responsive||null;if("array"===i.type(n)&&n.length){for(t in o.respondTo=o.options.respondTo||"window",n)if(e=o.breakpoints.length-1,n.hasOwnProperty(t)){for(s=n[t].breakpoint;e>=0;)o.breakpoints[e]&&o.breakpoints[e]===s&&o.breakpoints.splice(e,1),e--;o.breakpoints.push(s),o.breakpointSettings[s]=n[t].settings}o.breakpoints.sort(function(i,t){return o.options.mobileFirst?i-t:t-i})}},s.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(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),!0===t.options.focusOnSelect&&i(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},s.prototype.resize=function(){var t=this;i(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=i(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()},50))},s.prototype.removeSlide=s.prototype.slickRemove=function(i,t,s){var e=this;if(i="boolean"==typeof i?!0===(t=i)?0:e.slideCount-1:!0===t?--i:i,e.slideCount<1||i<0||i>e.slideCount-1)return!1;e.unload(),!0===s?e.$slideTrack.children().remove():e.$slideTrack.children(this.options.slide).eq(i).remove(),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slidesCache=e.$slides,e.reinit()},s.prototype.setCSS=function(i){var t,s,e=this,o={};!0===e.options.rtl&&(i=-i),t="left"==e.positionProp?Math.ceil(i)+"px":"0px",s="top"==e.positionProp?Math.ceil(i)+"px":"0px",o[e.positionProp]=i,!1===e.transformsEnabled?e.$slideTrack.css(o):(o={},!1===e.cssTransitions?(o[e.animType]="translate("+t+", "+s+")",e.$slideTrack.css(o)):(o[e.animType]="translate3d("+t+", "+s+", 0px)",e.$slideTrack.css(o)))},s.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var t=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-t)},s.prototype.setFade=function(){var t,s=this;s.$slides.each(function(e,o){t=-(s.slideWidth*e*1),!0===s.options.rtl?i(o).css({position:"relative",right:t,top:0,zIndex:s.options.zIndex-2,opacity:0}):i(o).css({position:"relative",left:t,top:0,zIndex:s.options.zIndex-2,opacity:0})}),s.$slides.eq(s.currentSlide).css({zIndex:s.options.zIndex-1,opacity:1})},s.prototype.setHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.css("height",i)}},s.prototype.setOption=s.prototype.slickSetOption=function(){var t,s,e,o,n,l=this,r=!1;if("object"===i.type(arguments[0])?(e=arguments[0],r=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(e=arguments[0],o=arguments[1],r=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)l.options[e]=o;else if("multiple"===n)i.each(e,function(i,t){l.options[i]=t});else if("responsive"===n)for(s in o)if("array"!==i.type(l.options.responsive))l.options.responsive=[o[s]];else{for(t=l.options.responsive.length-1;t>=0;)l.options.responsive[t].breakpoint===o[s].breakpoint&&l.options.responsive.splice(t,1),t--;l.options.responsive.push(o[s])}r&&(l.unload(),l.reinit())},s.prototype.setPosition=function(){this.setDimensions(),this.setHeight(),!1===this.options.fade?this.setCSS(this.getLeft(this.currentSlide)):this.setFade(),this.$slider.trigger("setPosition",[this])},s.prototype.setProps=function(){var i=this,t=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),(void 0!==t.WebkitTransition||void 0!==t.MozTransition||void 0!==t.msTransition)&&!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==t.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(i.animType=!1)),void 0!==t.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===t.msTransform&&(i.animType=!1)),void 0!==t.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},s.prototype.setSlideClasses=function(i){var t,s,e,o;if(s=this.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),this.$slides.eq(i).addClass("slick-current"),!0===this.options.centerMode){var n=this.options.slidesToShow%2==0?1:0;t=Math.floor(this.options.slidesToShow/2),!0===this.options.infinite&&(i>=t&&i<=this.slideCount-1-t?this.$slides.slice(i-t+n,i+t+1).addClass("slick-active").attr("aria-hidden","false"):(e=this.options.slidesToShow+i,s.slice(e-t+1+n,e+t+2).addClass("slick-active").attr("aria-hidden","false")),0===i?s.eq(s.length-1-this.options.slidesToShow).addClass("slick-center"):i===this.slideCount-1&&s.eq(this.options.slidesToShow).addClass("slick-center")),this.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=this.slideCount-this.options.slidesToShow?this.$slides.slice(i,i+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):s.length<=this.options.slidesToShow?s.addClass("slick-active").attr("aria-hidden","false"):(o=this.slideCount%this.options.slidesToShow,e=!0===this.options.infinite?this.options.slidesToShow+i:i,this.options.slidesToShow==this.options.slidesToScroll&&this.slideCount-i<this.options.slidesToShow?s.slice(e-(this.options.slidesToShow-o),e+o).addClass("slick-active").attr("aria-hidden","false"):s.slice(e,e+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));("ondemand"===this.options.lazyLoad||"anticipated"===this.options.lazyLoad)&&this.lazyLoad()},s.prototype.setupInfinite=function(){var t,s,e,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(s=null,o.slideCount>o.options.slidesToShow)){for(e=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,t=o.slideCount;t>o.slideCount-e;t-=1)s=t-1,i(o.$slides[s]).clone(!0).attr("id","").attr("data-slick-index",s-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(t=0;t<e+o.slideCount;t+=1)s=t,i(o.$slides[s]).clone(!0).attr("id","").attr("data-slick-index",s+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},s.prototype.interrupt=function(i){var t=this;i||t.autoPlay(),t.interrupted=i},s.prototype.selectHandler=function(t){var s=parseInt((i(t.target).is(".slick-slide")?i(t.target):i(t.target).parents(".slick-slide")).attr("data-slick-index"));if(s||(s=0),this.slideCount<=this.options.slidesToShow){this.slideHandler(s,!1,!0);return}this.slideHandler(s)},s.prototype.slideHandler=function(i,t,s){var e,o,n,l,r,d=null,a=this;if(t=t||!1,(!0!==a.animating||!0!==a.options.waitForAnimate)&&(!0!==a.options.fade||a.currentSlide!==i)){if(!1===t&&a.asNavFor(i),e=i,d=a.getLeft(e),l=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?l:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)||!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll)){!1===a.options.fade&&(e=a.currentSlide,!0!==s&&a.slideCount>a.options.slidesToShow?a.animateSlide(l,function(){a.postSlide(e)}):a.postSlide(e));return}if(a.options.autoplay&&clearInterval(a.autoPlayTimer),o=e<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+e:e>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:e-a.slideCount:e,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,o]),n=a.currentSlide,a.currentSlide=o,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(r=(r=a.getNavTarget()).slick("getSlick")).slideCount<=r.options.slidesToShow&&r.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade){!0!==s?(a.fadeSlideOut(n),a.fadeSlide(o,function(){a.postSlide(o)})):a.postSlide(o),a.animateHeight();return}!0!==s&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(o)}):a.postSlide(o)}},s.prototype.startLoad=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.hide(),this.$nextArrow.hide()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.hide(),this.$slider.addClass("slick-loading")},s.prototype.swipeDirection=function(){var i,t,s,e;return(i=this.touchObject.startX-this.touchObject.curX,(e=Math.round(180*(s=Math.atan2(t=this.touchObject.startY-this.touchObject.curY,i))/Math.PI))<0&&(e=360-Math.abs(e)),e<=45&&e>=0||e<=360&&e>=315)?!1===this.options.rtl?"left":"right":e>=135&&e<=225?!1===this.options.rtl?"right":"left":!0===this.options.verticalSwiping?e>=35&&e<=135?"down":"up":"vertical"},s.prototype.swipeEnd=function(i){var t,s,e=this;if(e.dragging=!1,e.swiping=!1,e.scrolling)return e.scrolling=!1,!1;if(e.interrupted=!1,e.shouldClick=!(e.touchObject.swipeLength>10),void 0===e.touchObject.curX)return!1;if(!0===e.touchObject.edgeHit&&e.$slider.trigger("edge",[e,e.swipeDirection()]),e.touchObject.swipeLength>=e.touchObject.minSwipe){switch(s=e.swipeDirection()){case"left":case"down":t=e.options.swipeToSlide?e.checkNavigable(e.currentSlide+e.getSlideCount()):e.currentSlide+e.getSlideCount(),e.currentDirection=0;break;case"right":case"up":t=e.options.swipeToSlide?e.checkNavigable(e.currentSlide-e.getSlideCount()):e.currentSlide-e.getSlideCount(),e.currentDirection=1}"vertical"!=s&&(e.slideHandler(t),e.touchObject={},e.$slider.trigger("swipe",[e,s]))}else e.touchObject.startX!==e.touchObject.curX&&(e.slideHandler(e.currentSlide),e.touchObject={})},s.prototype.swipeHandler=function(i){var t=this;if(!1!==t.options.swipe&&(!("ontouchend"in document)||!1!==t.options.swipe)){if(!1!==t.options.draggable||-1===i.type.indexOf("mouse"))switch(t.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),i.data.action){case"start":t.swipeStart(i);break;case"move":t.swipeMove(i);break;case"end":t.swipeEnd(i)}}},s.prototype.swipeMove=function(i){var t,s,e,o,n,l,r=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!!r.dragging&&!r.scrolling&&(!n||1===n.length)&&((t=r.getLeft(r.currentSlide),r.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,r.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curX-r.touchObject.startX,2))),l=Math.round(Math.sqrt(Math.pow(r.touchObject.curY-r.touchObject.startY,2))),r.options.verticalSwiping||r.swiping||!(l>4))?(!0===r.options.verticalSwiping&&(r.touchObject.swipeLength=l),s=r.swipeDirection(),void 0!==i.originalEvent&&r.touchObject.swipeLength>4&&(r.swiping=!0,i.preventDefault()),o=(!1===r.options.rtl?1:-1)*(r.touchObject.curX>r.touchObject.startX?1:-1),!0===r.options.verticalSwiping&&(o=r.touchObject.curY>r.touchObject.startY?1:-1),e=r.touchObject.swipeLength,r.touchObject.edgeHit=!1,!1===r.options.infinite&&(0===r.currentSlide&&"right"===s||r.currentSlide>=r.getDotCount()&&"left"===s)&&(e=r.touchObject.swipeLength*r.options.edgeFriction,r.touchObject.edgeHit=!0),!1===r.options.vertical?r.swipeLeft=t+e*o:r.swipeLeft=t+e*(r.$list.height()/r.listWidth)*o,!0===r.options.verticalSwiping&&(r.swipeLeft=t+e*o),!0!==r.options.fade&&!1!==r.options.touchMove&&(!0===r.animating?(r.swipeLeft=null,!1):void r.setCSS(r.swipeLeft))):(r.scrolling=!0,!1))},s.prototype.swipeStart=function(i){var t,s=this;if(s.interrupted=!0,1!==s.touchObject.fingerCount||s.slideCount<=s.options.slidesToShow)return s.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(t=i.originalEvent.touches[0]),s.touchObject.startX=s.touchObject.curX=void 0!==t?t.pageX:i.clientX,s.touchObject.startY=s.touchObject.curY=void 0!==t?t.pageY:i.clientY,s.dragging=!0},s.prototype.unfilterSlides=s.prototype.slickUnfilter=function(){null!==this.$slidesCache&&(this.unload(),this.$slideTrack.children(this.options.slide).detach(),this.$slidesCache.appendTo(this.$slideTrack),this.reinit())},s.prototype.unload=function(){i(".slick-cloned",this.$slider).remove(),this.$dots&&this.$dots.remove(),this.$prevArrow&&this.htmlExpr.test(this.options.prevArrow)&&this.$prevArrow.remove(),this.$nextArrow&&this.htmlExpr.test(this.options.nextArrow)&&this.$nextArrow.remove(),this.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},s.prototype.unslick=function(i){this.$slider.trigger("unslick",[this,i]),this.destroy()},s.prototype.updateArrows=function(){var i;i=Math.floor(this.options.slidesToShow/2),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&!this.options.infinite&&(this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===this.currentSlide?(this.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-this.options.slidesToShow&&!1===this.options.centerMode?(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-1&&!0===this.options.centerMode&&(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},s.prototype.updateDots=function(){null!==this.$dots&&(this.$dots.find("li").removeClass("slick-active").end(),this.$dots.find("li").eq(Math.floor(this.currentSlide/this.options.slidesToScroll)).addClass("slick-active"))},s.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,e=this,o=arguments[0],n=Array.prototype.slice.call(arguments,1),l=e.length;for(i=0;i<l;i++)if("object"==typeof o||void 0===o?e[i].slick=new s(e[i],o):t=e[i].slick[o].apply(e[i].slick,n),void 0!==t)return t;return e}});
!function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)}(this,function(o,e,u,r){function d(t,e){var r=1<=arguments.length;if(!(this instanceof d))return r?2<=arguments.length?new d(t,e):new d(t):new d;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}function s(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function i(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function h(t){return"Array"===i(t)}function a(t,e){var r={};if("RegExp"===i(e))r=null;else if(h(e))for(var n=0,s=e.length;n<s;n++)r[e[n]]=!0;else r[e]=!0;for(n=0,s=t.length;n<s;n++)(r&&void 0!==r[t[n]]||!r&&e.test(t[n]))&&(t.splice(n,1),s--,n--);return t}function p(t,e){if(h(e)){for(var r=0,n=e.length;r<n;r++)if(!p(t,e[r]))return!1;return!0}var s=i(e),r=0;for(n=t.length;r<n;r++)if("RegExp"===s){if("string"==typeof t[r]&&t[r].match(e))return!0}else if(t[r]===e)return!0;return!1}function c(t,e){if(!h(t)||!h(e)||t.length!==e.length)return!1;t.sort(),e.sort();for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function l(t){return t.replace(/^\/+|\/+$/g,"")}function n(t){return escape(t)}function f(t){return encodeURIComponent(t).replace(/[!'()*]/g,n).replace(/\*/g,"%2A")}function t(r){return function(t,e){return void 0===t?this._parts[r]||"":(this._parts[r]=t||null,this.build(!e),this)}}function m(r,n){return function(t,e){return void 0===t?this._parts[r]||"":(null!==t&&(t+="").charAt(0)===n&&(t=t.substring(1)),this._parts[r]=t,this.build(!e),this)}}function g(r,n){return function(e){try{return d[n](e+"").replace(d.characters[r][n].expression,function(t){return d.characters[r][n].map[t]})}catch(t){return e}}}var _,y=r&&r.URI,v=(d.version="1.19.7",d.prototype),b=Object.prototype.hasOwnProperty,w=(d._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:d.preventInvalidHostname,duplicateQueryParameters:d.duplicateQueryParameters,escapeQuerySpace:d.escapeQuerySpace}},d.preventInvalidHostname=!1,d.duplicateQueryParameters=!1,d.escapeQuerySpace=!0,d.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,d.idn_expression=/[^a-z0-9\._-]/i,d.punycode_expression=/(xn--)/i,d.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,d.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*$/,d.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]))/gi,d.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},d.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},d.hostProtocols=["http","https"],d.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,d.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"},d.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return d.domAttributes[e]}},d.encode=f,d.decode=decodeURIComponent,d.iso8859=function(){d.encode=escape,d.decode=unescape},d.unicode=function(){d.encode=f,d.decode=decodeURIComponent},d.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,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)/gi,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)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},d.encodeQuery=function(t,e){t=d.encode(t+"");return(e=void 0===e?d.escapeQuerySpace:e)?t.replace(/%20/g,"+"):t},d.decodeQuery=function(e,t){e+="",void 0===t&&(t=d.escapeQuerySpace);try{return d.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}},{encode:"encode",decode:"decode"});for(_ in w)d[_+"PathSegment"]=g("pathname",w[_]),d[_+"UrnPathSegment"]=g("urnpath",w[_]);d.decodePath=(w=function(s,a,i){return function(t){for(var e=i?function(t){return d[a](d[i](t))}:d[a],r=0,n=(t=(t+"").split(s)).length;r<n;r++)t[r]=e(t[r]);return t.join(s)}})("/","decodePathSegment"),d.decodeUrnPath=w(":","decodeUrnPathSegment"),d.recodePath=w("/","encodePathSegment","decode"),d.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),d.encodeReserved=g("reserved","encode"),d.parse=function(t,e){e=e||{preventInvalidHostname:d.preventInvalidHostname};var r=t.indexOf("#");return-1<r&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),-1<(r=t.indexOf("?"))&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=t.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=d.parseAuthority(t,e)):-1<(r=t.indexOf(":"))&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(d.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=d.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},d.parseHost=function(t,e){var r,n,s=(t=(t=t||"").replace(/\\/g,"/")).indexOf("/");return-1===s&&(s=t.length),"["===t.charAt(0)?(r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,s)||null,"/"===e.port&&(e.port=null)):(n=t.indexOf(":"),r=t.indexOf("/"),-1!==(n=t.indexOf(":",n+1))&&(-1===r||n<r)?(e.hostname=t.substring(0,s)||null,e.port=null):(r=t.substring(0,s).split(":"),e.hostname=r[0]||null,e.port=r[1]||null)),e.hostname&&"/"!==t.substring(s).charAt(0)&&(s++,t="/"+t),e.preventInvalidHostname&&d.ensureValidHostname(e.hostname,e.protocol),e.port&&d.ensureValidPort(e.port),t.substring(s)||"/"},d.parseAuthority=function(t,e){return t=d.parseUserinfo(t,e),d.parseHost(t,e)},d.parseUserinfo=function(t,e){var r=t,n=(t=-1!==t.indexOf("\\")?t.replace(/\\/g,"/"):t).indexOf("/"),s=t.lastIndexOf("@",-1<n?n:t.length-1);return-1<s&&(-1===n||s<n)?(n=t.substring(0,s).split(":"),e.username=n[0]?d.decode(n[0]):null,n.shift(),e.password=n[0]?d.decode(n.join(":")):null,t=r.substring(s+1)):(e.username=null,e.password=null),t},d.parseQuery=function(t,e){if(!t)return{};if(!(t=t.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,s={},a=t.split("&"),i=a.length,o=0;o<i;o++)r=a[o].split("="),n=d.decodeQuery(r.shift(),e),r=r.length?d.decodeQuery(r.join("="),e):null,"__proto__"!==n&&(b.call(s,n)?("string"!=typeof s[n]&&null!==s[n]||(s[n]=[s[n]]),s[n].push(r)):s[n]=r);return s},d.build=function(t){var e="",r=!1;return t.protocol&&(e+=t.protocol+":"),t.urn||!e&&!t.hostname||(e+="//",r=!0),e+=d.buildAuthority(t)||"","string"==typeof t.path&&("/"!==t.path.charAt(0)&&r&&(e+="/"),e+=t.path),"string"==typeof t.query&&t.query&&(e+="?"+t.query),"string"==typeof t.fragment&&t.fragment&&(e+="#"+t.fragment),e},d.buildHost=function(t){var e="";return t.hostname?(e=d.ip6_expression.test(t.hostname)?e+("["+t.hostname)+"]":e+t.hostname,t.port&&(e+=":"+t.port),e):""},d.buildAuthority=function(t){return d.buildUserinfo(t)+d.buildHost(t)},d.buildUserinfo=function(t){var e="";return t.username&&(e+=d.encode(t.username)),t.password&&(e+=":"+d.encode(t.password)),e&&(e+="@"),e},d.buildQuery=function(t,e,r){var n,s="";for(n in t)if("__proto__"!==n&&b.call(t,n))if(h(t[n]))for(var a={},i=0,o=t[n].length;i<o;i++)void 0!==t[n][i]&&void 0===a[t[n][i]+""]&&(s+="&"+d.buildQueryParameter(n,t[n][i],r),!0!==e)&&(a[t[n][i]+""]=!0);else void 0!==t[n]&&(s+="&"+d.buildQueryParameter(n,t[n],r));return s.substring(1)},d.buildQueryParameter=function(t,e,r){return d.encodeQuery(t,r)+(null!==e?"="+d.encodeQuery(e,r):"")},d.addQuery=function(t,e,r){if("object"==typeof e)for(var n in e)b.call(e,n)&&d.addQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");void 0===t[e]?t[e]=r:("string"==typeof t[e]&&(t[e]=[t[e]]),h(r)||(r=[r]),t[e]=(t[e]||[]).concat(r))}},d.setQuery=function(t,e,r){if("object"==typeof e)for(var n in e)b.call(e,n)&&d.setQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");t[e]=void 0===r?null:r}},d.removeQuery=function(t,e,r){if(h(e))for(r=0,n=e.length;r<n;r++)t[e[r]]=void 0;else if("RegExp"===i(e))for(var n in t)e.test(n)&&(t[n]=void 0);else if("object"==typeof e)for(n in e)b.call(e,n)&&d.removeQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===i(r)?!h(t[e])&&r.test(t[e])?t[e]=void 0:t[e]=a(t[e],r):t[e]!==String(r)||h(r)&&1!==r.length?h(t[e])&&(t[e]=a(t[e],r)):t[e]=void 0:t[e]=void 0}},d.hasQuery=function(t,e,r,n){switch(i(e)){case"String":break;case"RegExp":for(var s in t)if(b.call(t,s)&&e.test(s)&&(void 0===r||d.hasQuery(t,s,r)))return!0;return!1;case"Object":for(var a in e)if(b.call(e,a)&&!d.hasQuery(t,a,e[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(i(r)){case"Undefined":return e in t;case"Boolean":return r===(t=!(h(t[e])?!t[e].length:!t[e]));case"Function":return!!r(t[e],e,t);case"Array":return!!h(t[e])&&(n?p:c)(t[e],r);case"RegExp":return h(t[e])?!!n&&p(t[e],r):!(!t[e]||!t[e].match(r));case"Number":r=String(r);case"String":return h(t[e])?!!n&&p(t[e],r):t[e]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},d.joinPaths=function(){for(var t=[],e=[],r=0,n=0;n<arguments.length;n++){var s=new d(arguments[n]);t.push(s);for(var s=s.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&e.push(s[a]),s[a]&&r++}return e.length&&r?(e=new d("").segment(e),""!==t[0].path()&&"/"!==t[0].path().slice(0,1)||e.path("/"+e.path()),e.normalize()):new d("")},d.commonPath=function(t,e){for(var r=Math.min(t.length,e.length),n=0;n<r;n++)if(t.charAt(n)!==e.charAt(n)){n--;break}return n<1?t.charAt(0)===e.charAt(0)&&"/"===t.charAt(0)?"/":"":("/"===t.charAt(n)&&"/"===e.charAt(n)||(n=t.substring(0,n).lastIndexOf("/")),t.substring(0,n+1))},d.withinString=function(t,e,r){var n=(r=r||{}).start||d.findUri.start,s=r.end||d.findUri.end,a=r.trim||d.findUri.trim,i=r.parens||d.findUri.parens,o=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var h=n.exec(t);if(!h)break;var u=h.index;if(r.ignoreHtml){var p=t.slice(Math.max(u-3,0),u);if(p&&o.test(p))continue}for(var c=u+t.slice(u).search(s),p=t.slice(u,c),c=-1;;){var l=i.exec(p);if(!l)break;c=Math.max(c,l.index+l[0].length)}(p=-1<c?p.slice(0,c)+p.slice(c).replace(a,""):p.replace(a,"")).length<=h[0].length||r.ignore&&r.ignore.test(p)||(void 0===(h=e(p,u,c=u+p.length,t))?n.lastIndex=c:(h=String(h),t=t.slice(0,u)+h+t.slice(c),n.lastIndex=u+h.length))}return n.lastIndex=0,t},d.ensureValidHostname=function(t,e){var r=!!t,n=!1;if((n=e?p(d.hostProtocols,e):n)&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+e);if(t&&t.match(d.invalid_hostname_characters)){if(!o)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(o.toASCII(t).match(d.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},d.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&0<e&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},d.noConflict=function(t){return t?(t={URI:this.noConflict()},r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t):(r.URI===this&&(r.URI=y),this)},v.build=function(t){return!0===t?this._deferred_build=!0:void 0!==t&&!this._deferred_build||(this._string=d.build(this._parts),this._deferred_build=!1),this},v.clone=function(){return new d(this)},v.valueOf=v.toString=function(){return this.build(!1)._string},v.protocol=t("protocol"),v.username=t("username"),v.password=t("password"),v.hostname=t("hostname"),v.port=t("port"),v.query=m("query","?"),v.fragment=m("fragment","#"),v.search=function(t,e){t=this.query(t,e);return"string"==typeof t&&t.length?"?"+t:t},v.hash=function(t,e){t=this.fragment(t,e);return"string"==typeof t&&t.length?"#"+t:t},v.pathname=function(t,e){var r;return void 0===t||!0===t?(r=this._parts.path||(this._parts.hostname?"/":""),t?(this._parts.urn?d.decodeUrnPath:d.decodePath)(r):r):(this._parts.path=this._parts.urn?t?d.recodeUrnPath(t):"":t?d.recodePath(t):"/",this.build(!e),this)},v.path=v.pathname,v.href=function(t,e){if(void 0===t)return this.toString();this._string="",this._parts=d._parts();var r=t instanceof d,n="object"==typeof t&&(t.hostname||t.path||t.pathname);if(t.nodeName&&(t=t[n=d.getDomAttribute(t)]||"",n=!1),"string"==typeof(t=!r&&n&&void 0!==t.pathname?t.toString():t)||t instanceof String)this._parts=d.parse(String(t),this._parts);else{if(!r&&!n)throw new TypeError("invalid input");for(var s in r=r?t._parts:t)"query"!==s&&b.call(this._parts,s)&&(this._parts[s]=r[s]);r.query&&this.query(r.query,!1)}return this.build(!e),this},v.is=function(t){var e=!1,r=!1,n=!1,s=!1,a=!1,i=!1,o=!1,h=!this._parts.urn;switch(this._parts.hostname&&(h=!1,r=d.ip4_expression.test(this._parts.hostname),n=d.ip6_expression.test(this._parts.hostname),a=(s=!(e=r||n))&&u&&u.has(this._parts.hostname),i=s&&d.idn_expression.test(this._parts.hostname),o=s&&d.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return h;case"absolute":return!h;case"domain":case"name":return s;case"sld":return a;case"ip":return e;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return n;case"idn":return i;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return o}return null};var x=v.protocol,A=v.port,Q=v.hostname,I=(v.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(d.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,t,e)},v.scheme=v.protocol,v.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(t=0===t?null:t)&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),d.ensureValidPort(t)),A.call(this,t,e))},v.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==d.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&d.ensureValidHostname(t,this._parts.protocol)}return Q.call(this,t,e)},v.origin=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t?(r=this.protocol(),this.authority()?(r?r+"://":"")+this.authority():""):(r=d(t),this.protocol(r.protocol()).authority(r.authority()).build(!e),this)},v.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?d.buildHost(this._parts):"";if("/"!==d.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},v.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?d.buildAuthority(this._parts):"";if("/"!==d.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},v.userinfo=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t?(r=d.buildUserinfo(this._parts))&&r.substring(0,r.length-1):("@"!==t[t.length-1]&&(t+="@"),d.parseUserinfo(t,this._parts),this.build(!e),this)},v.resource=function(t,e){return void 0===t?this.path()+this.search()+this.hash():(t=d.parse(t),this._parts.path=t.path,this._parts.query=t.query,this._parts.fragment=t.fragment,this.build(!e),this)},v.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if(void 0===t)return this._parts.hostname&&!this.is("IP")&&(r=this._parts.hostname.length-this.domain().length-1,this._parts.hostname.substring(0,r))||"";if(r=this._parts.hostname.length-this.domain().length,r=this._parts.hostname.substring(0,r),r=new RegExp("^"+s(r)),t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&d.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},v.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.match(/\./g))&&r.length<2?this._parts.hostname:(r=this._parts.hostname.length-this.tld(e).length-1,r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||"");if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return d.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP")?this._parts.hostname=t:(r=new RegExp(s(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(r,t)),this.build(!e),this},v.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(r+1),!0!==e&&u&&u.list[r.toLowerCase()]&&u.get(this._parts.hostname)||r);if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!u||!u.is(t))throw new TypeError('TLD "'+t+'" 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");return r=new RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},v.directory=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t||!0===t?this._parts.path||this._parts.hostname?"/"===this._parts.path?"/":(r=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,r)||(this._parts.hostname?"/":""),t?d.decodePath(r):r):"":(r=this._parts.path.length-this.filename().length,r=this._parts.path.substring(0,r),r=new RegExp("^"+s(r)),this.is("relative")||"/"!==(t=t||"/").charAt(0)&&(t="/"+t),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=d.recodePath(t),this._parts.path=this._parts.path.replace(r,t),this.build(!e),this)},v.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("string"!=typeof t)return this._parts.path&&"/"!==this._parts.path?(r=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(r+1),t?d.decodePathSegment(r):r):"";r=!1,(t="/"===t.charAt(0)?t.substring(1):t).match(/\.?\//)&&(r=!0);var n=new RegExp(s(this.filename())+"$");return t=d.recodePath(t),this._parts.path=this._parts.path.replace(n,t),r?this.normalizePath(e):this.build(!e),this},v.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r,n;if(void 0===t||!0===t)return!this._parts.path||"/"===this._parts.path||-1===(n=(r=this.filename()).lastIndexOf("."))?"":(r=r.substring(n+1),r=/^[a-z0-9%]+$/i.test(r)?r:"",t?d.decodePathSegment(r):r);if("."===t.charAt(0)&&(t=t.substring(1)),r=this.suffix())n=t?new RegExp(s(r)+"$"):new RegExp(s("."+r)+"$");else{if(!t)return this;this._parts.path+="."+d.recodePath(t)}return n&&(t=d.recodePath(t),this._parts.path=this._parts.path.replace(n,t)),this.build(!e),this},v.segment=function(t,e,r){var n=this._parts.urn?":":"/",s="/"===(a=this.path()).substring(0,1),a=a.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw Error('Bad segment "'+t+'", must be 0-based integer');if(s&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(h(e)){a=[],t=0;for(var i=e.length;t<i;t++)(e[t].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(l(e[t])))}else!e&&"string"!=typeof e||(e=l(e),""===a[a.length-1]?a[a.length-1]=e:a.push(e));else e?a[t]=l(e):a.splice(t,1);return s&&a.unshift(""),this.path(a.join(n),r)},v.segmentCoded=function(t,e,r){if("number"!=typeof t&&(r=e,e=t,t=void 0),void 0===e){if(h(t=this.segment(t,e,r)))for(var n=0,s=t.length;n<s;n++)t[n]=d.decode(t[n]);else t=void 0!==t?d.decode(t):void 0;return t}if(h(e))for(n=0,s=e.length;n<s;n++)e[n]=d.encode(e[n]);else e="string"==typeof e||e instanceof String?d.encode(e):e;return this.segment(t,e,r)},v.query);return v.query=function(t,e){var r,n;return!0===t?d.parseQuery(this._parts.query,this._parts.escapeQuerySpace):"function"==typeof t?(r=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=t.call(this,r),this._parts.query=d.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):void 0!==t&&"string"!=typeof t?(this._parts.query=d.buildQuery(t,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):I.call(this,t,e)},v.setQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof t||t instanceof String)n[t]=void 0!==e?e:null;else{if("object"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var s in t)b.call(t,s)&&(n[s]=t[s])}return this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.addQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.addQuery(n,t,void 0===e?null:e),this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.removeQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.removeQuery(n,t,e),this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.hasQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.hasQuery(n,t,e,r)},v.setSearch=v.setQuery,v.addSearch=v.addQuery,v.removeSearch=v.removeQuery,v.hasSearch=v.hasQuery,v.normalize=function(){return(this._parts.urn?this.normalizeProtocol(!1):this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1)).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},v.normalizeProtocol=function(t){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!t)),this},v.normalizeHostname=function(t){return this._parts.hostname&&(this.is("IDN")&&o?this._parts.hostname=o.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!t)),this},v.normalizePort=function(t){return"string"==typeof this._parts.protocol&&this._parts.port===d.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!t)),this},v.normalizePath=function(t){if(r=this._parts.path)if(this._parts.urn)this._parts.path=d.recodeUrnPath(this._parts.path),this.build(!t);else if("/"!==this._parts.path){var e,r,n="";for("/"!==(r=d.recodePath(r)).charAt(0)&&(e=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(n=(n=r.substring(1).match(/^(\.\.\/)+/)||"")&&n[0]);;){var s,a=r.search(/\/\.\.(\/|$)/);if(-1===a)break;0===a?r=r.substring(3):(-1===(s=r.substring(0,a).lastIndexOf("/"))&&(s=a),r=r.substring(0,s)+r.substring(a+3))}e&&this.is("relative")&&(r=n+r.substring(1)),this._parts.path=r,this.build(!t)}return this},v.normalizePathname=v.normalizePath,v.normalizeQuery=function(t){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(d.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!t)),this},v.normalizeFragment=function(t){return this._parts.fragment||(this._parts.fragment=null,this.build(!t)),this},v.normalizeSearch=v.normalizeQuery,v.normalizeHash=v.normalizeFragment,v.iso8859=function(){var t=d.encode,e=d.decode;d.encode=escape,d.decode=decodeURIComponent;try{this.normalize()}finally{d.encode=t,d.decode=e}return this},v.unicode=function(){var t=d.encode,e=d.decode;d.encode=f,d.decode=unescape;try{this.normalize()}finally{d.encode=t,d.decode=e}return this},v.readable=function(){var t=this.clone(),e=(t.username("").password("").normalize(),"");if(t._parts.protocol&&(e+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&o?(e+=o.toUnicode(t._parts.hostname),t._parts.port&&(e+=":"+t._parts.port)):e+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(e+="/"),e+=t.path(!0),t._parts.query){for(var r="",n=0,s=t._parts.query.split("&"),a=s.length;n<a;n++){var i=(s[n]||"").split("=");r+="&"+d.decodeQuery(i[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==i[1]&&(r+="="+d.decodeQuery(i[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}e+="?"+r.substring(1)}return e+d.decodeQuery(t.hash(),!0)},v.absoluteTo=function(t){var e,r,n=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(t instanceof d||(t=new d(t)),!n._parts.protocol&&(n._parts.protocol=t._parts.protocol,!this._parts.hostname)){for(e=0;r=s[e];e++)n._parts[r]=t._parts[r];n._parts.path?(".."===n._parts.path.substring(-2)&&(n._parts.path+="/"),"/"!==n.path().charAt(0)&&(s=(s=t.directory())||(0===t.path().indexOf("/")?"/":""),n._parts.path=(s?s+"/":"")+n._parts.path,n.normalizePath())):(n._parts.path=t._parts.path,n._parts.query||(n._parts.query=t._parts.query)),n.build()}return n},v.relativeTo=function(t){var e=this.clone().normalize();if(e._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");t=new d(t).normalize();var r=e._parts,n=t._parts,s=e.path();if(t=t.path(),"/"!==s.charAt(0))throw Error("URI is already relative");if("/"!==t.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");return r.protocol===n.protocol&&(r.protocol=null),r.username===n.username&&r.password===n.password&&null===r.protocol&&null===r.username&&null===r.password&&r.hostname===n.hostname&&r.port===n.port&&(r.hostname=null,r.port=null,s===t?r.path="":(s=d.commonPath(s,t))&&(n=n.path.substring(s.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),r.path=n+r.path.substring(s.length)||"./")),e.build()},v.equals=function(t){var e,r=this.clone(),n=new d(t);if(t={},r.normalize(),n.normalize(),r.toString()!==n.toString()){var s=r.query(),a=n.query();if(r.query(""),n.query(""),r.toString()!==n.toString()||s.length!==a.length)return!1;for(e in r=d.parseQuery(s,this._parts.escapeQuerySpace),a=d.parseQuery(a,this._parts.escapeQuerySpace),r)if(b.call(r,e)){if(h(r[e])){if(!c(r[e],a[e]))return!1}else if(r[e]!==a[e])return!1;t[e]=!0}for(e in a)if(b.call(a,e)&&!t[e])return!1}return!0},v.preventInvalidHostname=function(t){return this._parts.preventInvalidHostname=!!t,this},v.duplicateQueryParameters=function(t){return this._parts.duplicateQueryParameters=!!t,this},v.escapeQuerySpace=function(t){return this._parts.escapeQuerySpace=!!t,this},d}),function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("./URI")):"function"==typeof define&&define.amd?define(["./URI"],e):t.URITemplate=e(t.URI,t)}(this,function(d,t){function f(t){return f._cache[t]||(this instanceof f?(this.expression=t,f._cache[t]=this):new f(t))}function a(t){this.data=t,this.cache={}}var e=t&&t.URITemplate,s=Object.prototype.hasOwnProperty,r=f.prototype,m={"":{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 f._cache={},f.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,f.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/,f.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,f.LITERAL_PATTERN=/[<>{}"`^| \\]/,f.expand=function(t,e,r){for(var n,s=m[t.operator],a=s.named?"Named":"Unnamed",i=(t=t.variables,[]),o=0;n=t[o];o++){var h=e.get(n.name);if(0===h.type&&r&&r.strict)throw Error('Missing expansion value for variable "'+n.name+'"');if(h.val.length){if(1<h.type&&n.maxlength)throw Error('Invalid expression: Prefix modifier not applicable to variable "'+n.name+'"');i.push(f["expand"+a](h,s,n.explode,n.explode&&s.separator||",",n.maxlength,n.name))}else h.type&&i.push("")}return i.length?s.prefix+i.join(s.separator):""},f.expandNamed=function(t,e,r,n,s,a){for(var i,o="",h=e.encode,u=(e=e.empty_name_separator,!t[h].length),p=2===t.type?"":d[h](a),c=0,l=t.val.length;c<l;c++)s?(i=d[h](t.val[c][1].substring(0,s)),2===t.type&&(p=d[h](t.val[c][0].substring(0,s)))):u?(i=d[h](t.val[c][1]),2===t.type?(p=d[h](t.val[c][0]),t[h].push([p,i])):t[h].push([void 0,i])):(i=t[h][c][1],2===t.type&&(p=t[h][c][0])),o&&(o+=n),r?o+=p+(e||i?"=":"")+i:(c||(o+=d[h](a)+(e||i?"=":"")),2===t.type&&(o+=p+","),o+=i);return o},f.expandUnnamed=function(t,e,r,n,s){for(var a,i="",o=e.encode,h=(e=e.empty_name_separator,!t[o].length),u=0,p=t.val.length;u<p;u++)s?a=d[o](t.val[u][1].substring(0,s)):h?(a=d[o](t.val[u][1]),t[o].push([2===t.type?d[o](t.val[u][0]):void 0,a])):a=t[o][u][1],i&&(i+=n),2===t.type&&(i+=s?d[o](t.val[u][0].substring(0,s)):t[o][u][0],i=r?i+(e||a?"=":""):i+","),i+=a;return i},f.noConflict=function(){return t.URITemplate===f&&(t.URITemplate=e),f},r.expand=function(t,e){var r="";this.parts&&this.parts.length||this.parse(),t instanceof a||(t=new a(t));for(var n=0,s=this.parts.length;n<s;n++)r+="string"==typeof this.parts[n]?this.parts[n]:f.expand(this.parts[n],t,e);return r},r.parse=function(){function t(t){if(t.match(a))throw Error('Invalid Literal "'+t+'"');return t}var e=this.expression,r=f.EXPRESSION_PATTERN,n=f.VARIABLE_PATTERN,s=f.VARIABLE_NAME_PATTERN,a=f.LITERAL_PATTERN,i=[],o=0;for(r.lastIndex=0;;){var h=r.exec(e);if(null===h){i.push(t(e.substring(o)));break}if(i.push(t(e.substring(o,h.index))),o=h.index+h[0].length,!m[h[1]])throw Error('Unknown Operator "'+h[1]+'" in "'+h[0]+'"');if(!h[3])throw Error('Unclosed Expression "'+h[0]+'"');for(var u=h[2].split(","),p=0,c=u.length;p<c;p++){var l=u[p].match(n);if(null===l)throw Error('Invalid Variable "'+u[p]+'" in "'+h[0]+'"');if(l[1].match(s))throw Error('Invalid Variable Name "'+l[1]+'" in "'+h[0]+'"');u[p]={name:l[1],explode:!!l[3],maxlength:l[4]&&parseInt(l[4],10)}}if(!u.length)throw Error('Expression Missing Variable(s) "'+h[0]+'"');i.push({expression:h[0],operator:h[1],variables:u})}return i.length||i.push(t(e)),this.parts=i,this},a.prototype.get=function(t){var e=this.data,r={type:0,val:[],encode:[],encodeReserved:[]};if(void 0!==this.cache[t])return this.cache[t];if(this.cache[t]=r,null!=(e="[object Function]"===String(Object.prototype.toString.call(e))?e(t):"[object Function]"===String(Object.prototype.toString.call(e[t]))?e[t](t):e[t]))if("[object Array]"===String(Object.prototype.toString.call(e))){var n=0;for(t=e.length;n<t;n++)void 0!==e[n]&&null!==e[n]&&r.val.push([void 0,String(e[n])]);r.val.length&&(r.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(e))){for(n in e)s.call(e,n)&&void 0!==e[n]&&null!==e[n]&&r.val.push([n,String(e[n])]);r.val.length&&(r.type=2)}else r.type=1,r.val.push([void 0,String(e)]);return r},d.expand=function(t,e){t=new f(t).expand(e);return new d(t)},f}),function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("jquery"),require("./URI")):"function"==typeof define&&define.amd?define(["jquery","./URI"],e):e(t.jQuery,t.URI)}(this,function(n,a){function s(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function i(t){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return a.domAttributes[e]}function o(t,e){var r;return!(!i(t)||!e||!(e=e.match(p))||!e[5]&&":"!==e[2]&&!u[e[2]])&&(t=n(t).uri(),e[5]?t.is(e[5]):":"===e[2]?(r=e[1].toLowerCase()+":",!!u[r]&&u[r](t,e[4])):(r=e[1].toLowerCase(),!!h[r]&&u[e[2]](t[r](),e[4],r)))}function r(t,e){return n(t).uri().href(e).toString()}var h={},u={"=":function(t,e){return t===e},"^=":function(t,e){return!!(t+"").match(new RegExp("^"+s(e),"i"))},"$=":function(t,e){return!!(t+"").match(new RegExp(s(e)+"$","i"))},"*=":function(t,e,r){return"directory"===r&&(t+="/"),!!(t+"").match(new RegExp(s(e),"i"))},"equals:":function(t,e){return t.equals(e)},"is:":function(t,e){return t.is(e)}},p=(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,e){var r;h[e]=!0,n.attrHooks["uri:"+e]=(r=e,{get:function(t){return n(t).uri()[r]()},set:function(t,e){return n(t).uri()[r](e),e}})}),n.each(["src","href","action","uri","cite"],function(t,e){n.attrHooks[e]={set:r}}),n.attrHooks.uri.get=function(t){return n(t).uri()},n.fn.uri=function(t){var e=this.first(),r=e.get(0),n=i(r);if(!n)throw Error('Element "'+r.nodeName+'" does not have either property: href, src, action, cite');if(void 0!==t){var s=e.data("uri");if(s)return s.href(t);t instanceof a||(t=a(t||""))}else{if(t=e.data("uri"))return t;t=a(e.attr(n)||"")}return t._dom_element=r,t._dom_attribute=n,t.normalize(),e.data("uri",t),t},a.prototype.build=function(t){return this._dom_element?(this._string=a.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===t?this._deferred_build=!0:void 0!==t&&!this._deferred_build||(this._string=a.build(this._parts),this._deferred_build=!1),this},/^([a-zA-Z]+)\s*([\^\$*]?=|:)\s*(['"]?)(.+)\3|^\s*([a-zA-Z0-9]+)\s*$/),t=n.expr.createPseudo?n.expr.createPseudo(function(e){return function(t){return o(t,e)}}):function(t,e,r){return o(t,r[3])};return n.expr[":"].uri=t,n});
$(".quickSaveForRouteAlert").on("click",function(){var e=$("#subscriberRouteName").attr("data-subscriberRouteId"),o=$("#quickRouteNotificationModal #subscriberRouteName").text(),i=0<$(".mapPage").length;$.ajax("/My511/SaveQuickRouteAlert",{data:{routeId:e,routeName:o},type:"POST"}).done(function(){i?AlertHelper.addAlertText(AlertType.Success,window.resources.AlertSavedSuccessfully+" "+window.resources.ViewLinkOnAlertSavedSuccessfully,7e3):window.location.href="/my511"}).fail(function(){AlertHelper.addAlertText(AlertType.Error,window.resources.AlertFailedToSave,7e3)})}),$("#hideSimplifyRouteNotification").on("change",function(){$(this).is(":checked")?Cookies.set("_hideSimplifyRouteNotificationModal",!0):Cookies.remove("_hideSimplifyRouteNotificationModal")}),$("#hideRouteNotification").on("change",function(){$(this).is(":checked")?Cookies.set("_hideRouteNotificationModal",!0):Cookies.remove("_hideRouteNotificationModal")});
