!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});
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),0<!e)&&Bugsnag.notify("Undefined refreshRateMs",function(e){e.context="Happened in setUpCameraRefreshTimers()",e.setMetadata("html",$("<div/>").append($(".cctvImage").clone()).html())})});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||document.querySelector("#cctvTable tbody"))||document.querySelector("#myCctvTable tbody"))||document.querySelector("#eventTable tbody"))&&$(document).trigger("setup-fullscreen-img-modal",[e,t])}}),$(document).on("cameraImagesClearIntervals",function(){r()})});
var setupSlickCarousel=function(t){var e,a=$(t).closest(".cctvCameraCarousel");return $(a).hasClass("slick-initialized")?Modernizr.mq("(max-width: 992px)")&&0<(e=$(".bootbox-body .map-tooltip").outerWidth()-10)&&($(".bootbox-body .slick-initialized, .bootbox-body .slick-slide").css("width",e+"px"),$(a).slick("setPosition")):($(a).slick({dots:!0,arrows:!0,autoplay:!0,lazyLoad:"ondemand",autoplaySpeed:1e4,accessibility:!0,infinite:!1}),$(a).on("beforeChange",function(t,e,a,i){e=$(e.$slides.get(i)),i=$("img",e),"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")),e=document.querySelector("#CameraTooltipDescriptionColumn b");e&&(e.textContent=i.attr("alt"))})),$(t).removeClass("carouselCctvImage"),$(a)},setUpImageSlide=function(t,e){var a;0<t.$slides.length&&((t=(a=$("img",$(t.$slides.get(e)))).data("title"))?($("#myCameraTitle").text(t),e=a.data("id"),$("#myCameraLocation").show(),$("#myCameraLocation").attr("href","#camera-"+e)):$("#myCameraLocation").hide(),a.attr("data-lazy",URI(a.data("url")).hash((new Date).getTime())),0<(t=a.data("refresh-rate"))?setInterval(function(t){t=$("#"+t);t.attr("src",URI(t.data("url")).hash((new Date).getTime()))},t,a.attr("id")):"undefined"!=typeof Bugsnag&&Bugsnag.notify("Undefined refreshRateMs",function(t){t.setMetadata("html",$("<div/>").append(a.clone()).html())}))};
!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(){var o=[];function d(e,i,t,o,d,n,a,r){var s=e+"-video",l=document.getElementById(d),c=l.getAttribute("data-videourl"),e=l.getAttribute("data-videoauth"),u=l.getAttribute("data-streamtype"),d=l.getAttribute("data-cameraid");"true"!==e&&c&&""!=c?m(l,i,t,o,s,c,u,n,a,r):$.ajax("/Camera/GetVideoUrl?cameraId="+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(l,i,t,o,s,c+e,u,n,a,r)}):m(l,i,t,o,s,e,u,n,a,r)})}function m(i,e,t,o,d,n,a,r,s,l){var 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>',c=(videojs.addLanguage("en",{"No compatible source was found for this media.":window.resources.IE8ErrorMessage}),i.appendChild(jQuery.parseHTML(n)[0]),videojs(document.getElementById(d),{width:s,height:l}));$(i).children("div.video-js").css({width:s+"px",height:l+"px"}),function e(){if(null!=c&&null==document.getElementById(d)){try{c.dispose()}catch(e){}c=null}null!=c&&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&&c.on("error",errorFunction);a=document.getElementById(e),n=$(r)[0],l=$(r).next()[0];h()&&((u=$(".child div[id='"+i.id+"']")).length<2&&$(u).html($(i).children()),a=$(".child img[id='"+e+"']")[0],n=$(".child button[id='"+t+"']")[0],l=$(".child button[id='"+o+"']")[0]),a.style.display="none",n.style.display="none",l.style.display="inline",$(r).parent().prevUntil("video-js").children().css({width:s+"px"});{var u=c.el_;let e=0;u.addEventListener("mouseout",function(){0<window.scrollY&&(e=window.scrollY),0===window.scrollY&&window.scrollTo(0,e)}),u.addEventListener("mouseover",function(){0<window.scrollY&&(e=window.scrollY)})}c.on("fullscreenchange",()=>{c.isFullscreen_||$(document).trigger("exitFullScreenVideo")})}function n(e,i,t,o,d,n){for(var e=document.getElementById(e+"-video"),a=document.getElementById(i),r=$(n).prev()[0],n=$(n)[0],s=(h()&&(a=$(".child img[id='"+i+"']")[0],r=$(".child button[id='"+t+"']")[0],n=$(".child button[id='"+o+"']")[0]),null!=e&&videojs(e).dispose(),document.getElementById(d));s.firstChild;)s.removeChild(s.firstChild);a.style.display="block",r.style.display="inline",n.style.display="none"}function a(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!1).slick("slickPause")}function r(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!0).slick("slickPlay")}function h(){return 0<$(".child .cctvImage").length}$(document).on("click",".showVideo",function(e){var i,t;e.detail&&1<e.detail||"undefined"!=typeof videojs&&(a(".cctvCameraCarousel"),i=(e=$(this).parent().parent().find(".cctvImage")).width(),e=e.height(),t=$(this).data("camera-id"),null==i&&(i=parseInt(resources.CamTooltipMaxWidth)),d(t,t+"img","showVideo-"+t,"hideVideo-"+t,t+"-videoContainer",this,i,e),"True"==resources.EnableVideoTimeout)&&(clearTimeout(o[t]),o[t]=setTimeout(function(){var e;e=t,r(".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&&(r(".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){var i,t;e.detail&&1<e.detail||"undefined"!=typeof videojs&&(a(".cameraCarousel"),i=(e=$(this).parent().parent().find(".myCamImg")).width(),e=e.height(),d((t=$(this).data("camera-id"))+"my","carouselId-"+t,"showMyVideo-"+t,"hideMyVideo-"+t,t+"-myVideoContainer",this,i,e),"True"==resources.EnableVideoTimeout)&&(clearTimeout(o[t]),o[t]=setTimeout(function(){var e;e=t,r(".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&&(r(".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()})})});
function GetVideoHTML(a,e,i,r){var s="",d=Array.isArray(a.videoUrl)?a.videoUrl[i]:a.videoUrl,t=Array.isArray(a.videoType)?a.videoType[i]:a.videoType,o=Array.isArray(a.displayCamera)?!a.displayCamera[i]:!a.displayCamera,i=Array.isArray(a.videoDisabled)?a.videoDisabled[i]:a.videoDisabled;return"True"==resources.CctvEnableVideo&&null!=d&&null!=t?(s=(s=(s+='<div class="text-center"><button class="btn btn-default btn-xs showVideo" id="showVideo-'+e+'" data-camera-id="'+e+'"'+(o&&!r?"disabled":"")+">"+resources.ShowVideo+"</button>")+'<button class="btn btn-default btn-xs hideVideo" id="hideVideo-'+e+'" data-camera-id="'+e+'" style="display:none">'+resources.HideVideo+"</button></div>")+'<div id="'+e+'-videoContainer" data-videourl="'+d+'" data-streamtype="'+t+'" data-videoauth="'+a.isVideoAuthRequired+'" data-cameraid="'+e+'"></div>',resources.cctvProviderText&&(s=(s+='<div class="text-center small">')+resources.cctvProviderText+"</div>")):(resources.cctvProviderText&&(s=(s+='<div class="text-center small">')+resources.cctvProviderText+"</div>"),s+=i?'<div class="text-center noVideoText">'+resources.CctvNoVideoAtThisTime+"</div>":'<div class="text-center noVideoText">'+resources.CctvNoVideo+"</div>"),s}function GetImageHTML(a,e,i,r,s){i='<img class="'+i+'" ';return i+('data-lazy="'+s+e+'" ')+('id="'+e+'img" ')+('title="'+r+'" ')+('data-refresh-rate="'+a.refreshRateMs+'" ')+('alt="'+r+" "+resources.CameraImage+'" />')}function CamInfoHtml(a,e,i,r,s,d,t,o,l,n,c){var m='<div id="carouselDiv-'+e+'">';return m+='<div class="imgContainer">',"True"==resources.CctvEnableVideo&&(m+=GetVideoHTML(a,e,s,d)),"True"==resources.isImageLink&&(m+='<a href="'+t+e+'" target="_blank">'),m+=GetImageHTML(a,e,"cctvImage carouselCctvImage",i,t),"True"==resources.isImageLink&&(m+="</a>"),m+="</div>",d||(m+='<h4 class="text-left">'+i+"</h4>",null==a.cityName||"N/A"==a.cityName||l||(m+='<div class="areaName">'+a.cityName+"</div>"),(s=null==r||""==r||r==resources.NA||"N/A"==r?"":o?resources.Direction+": "+r:""+r)&&(m+='<span class="dirHeader">'+s+"</span>"),c&&(m+='<div class="roadwayName">'+a.roadway+"</div>"),(n||null==a.county&&null==a.region)&&null==a.state)||(m+='<div class="region">',null!=a.county&&(m+='<span class="areaName">'+a.county+"</span>"),null!=a.region&&(m+=', <span class="areaName">'+a.region+"</span>"),null!=a.state&&(m+='<div class="areaName">'+a.state+"</div>"),m+="</div>"),m+="</div>"}function OptionsHtml(e,a,i,r){var s=(s='<div class="dropup optionsDropdown"><button class="btn btn-default dropdown-toggle" id="ddl_'+a+'" aria-label="'+resources.Options+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">')+'<i class="fas fa-ellipsis-v" aria-hidden="true"></i></button>'+('<ul class="dropdown-menu dropdown-menu-right '+(i?"camera-options-dropdown":"")+'" aria-labelledby="ddl_'+a+'">');if(null!=a&&(s+='<li><a href="/map#camera-'+e.DT_RowId+'"><i class="far fa-map-marked" aria-hidden="true"></i>'+resources.ViewOnMap+"</a></li>",r||(s+='<li id="'+(i?"loggedInDivider":"")+'" class="divider">&nbsp;</li>')),i)if(e.groupedIds&&1<e.groupedIds.length)if(r)s+='<li><a id="'+e.groupedIds.join()+'" class="deleteMyCameraBtn"><i class="far fa-trash-alt" aria-hidden="true"></i>'+resources.RemoveCamera+"</a></li>";else{s+='<li class="text"><i class="far fa-tasks" aria-hidden="true"></i>'+resources.MyCameras+"</li>";for(var d=0;d<window.MyCameras.length;d++){for(var t=!1,o=htmlEncode(window.MyCameras[d].name),l=0;l<e.groupedIds.length;l++){var n=e.groupedIds[l].split("--");window.MyCameras[d].cameras.find(a=>a.cameraId==n[0]&&a.agencyId==n[1])&&(t=!0)}t?($("tr[data-id='"+e.DT_RowId+"']").children().find(".myCamIndicator").show(),s+='<li><label title="'+o+'"><input type="checkbox" checked="checked" class="cameraListCheckbox" data-list-id="'+window.MyCameras[d].id+'" data-camera-id="'+e.groupedIds.join()+'"/><span>'+o+"</span></label></li>"):s+='<li><label title="'+o+'"><input type="checkbox" class="cameraListCheckbox" data-list-id="'+window.MyCameras[d].id+'" data-camera-id="'+e.groupedIds.join()+'"/><span>'+o+"</span></label></li>"}}else if(r)s+='<li><a id="'+e.DT_RowId+'" class="deleteMyCameraBtn"><i class="far fa-trash-alt" aria-hidden="true"></i>'+resources.RemoveCamera+"</a></li>";else{s+='<li class="text"><i class="far fa-tasks" aria-hidden="true"></i>'+resources.MyCameras+"</li>";for(d=0;d<window.MyCameras.length;d++){o=htmlEncode(window.MyCameras[d].name);window.MyCameras[d].cameras.find(a=>a.cameraId==e.cameraId&&a.agencyId==e.agencyId)?($("tr[data-id='"+e.DT_RowId+"']").children().find(".myCamIndicator").show(),s+='<li><label title="'+o+'"><input type="checkbox" checked="checked" class="cameraListCheckbox" data-list-id="'+window.MyCameras[d].id+'" data-camera-id="'+a+'"/><span>'+o+"</span></label></li>"):s+='<li><label title="'+o+'"><input type="checkbox" class="cameraListCheckbox" data-list-id="'+window.MyCameras[d].id+'" data-camera-id="'+a+'"/><span>'+o+"</span></label></li>"}}else s+='<li id="loggedOutLi"><a href="#" id="login-button" class="camLogin" role="button" data-toggle="modal" data-target="#loginModalDialog" aria-label="'+resources.Login+'"><i class="far fa-sign-in-alt" aria-hidden="true"></i><span>'+resources.LoginAccessMyCameras+"</span></a></li>";return s+="</ul></div>"}function addToMyCameras(e,a){var i=a.split(","),r=window.MyCameras.findIndex(a=>a.id==e);if(-1<r)for(var s=0;s<i.length;s++){var d=i[s].split("--");window.MyCameras[r].cameras.push({cameraId:d[0],agencyId:parseInt(d[1])||null,id:i[s]})}}function htmlEncode(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")}function removeFromMyCameras(e,a){var r=window.MyCameras.findIndex(a=>a.id==e);-1<r&&a.split(",").forEach(function(a){for(var e=a.split("--"),i=window.MyCameras[r].cameras.length-1;0<=i;--i)window.MyCameras[r].cameras[i].cameraId==e[0]&&window.MyCameras[r].cameras[i].agencyId==e[1]&&window.MyCameras[r].cameras.splice(i,1)})}RenderCctvDataTableRow=function(o,l,n,c,m,u,p,v,y){return function(a,e,i,r){var s='<div class="myCamIndicator'+("True"==resources.CctvEnableVideo?" hasVideo":"")+'" style="display:none;"><span class="circleBorder"><span class="fas fa-star fa-1x" aria-label="'+resources.MyCamera+'" title="'+resources.MyCamera+'"></span></span></div>';if(i.agencyLogoEnabled&&i.agencyId&&(s+='<img class="agencyLogo" src="/NoSession/GetCctvAgencyImage?agencyId='+i.agencyId+'">'),o||(s+=OptionsHtml(i,i.groupedIds||i.id,l,p)),s+='<div class="cctvCameraCarousel" id="'+i.DT_RowId+'">',i.groupedIds){for(var d in i.groupedIds){var t=(y?i.directionDescriptions:i.description2)[d];s+=CamInfoHtml(i,i.groupedIds[d],i.description1[d],t,d,o,n,c,m,u,v)}s+="</div>"}else t=y?i.directionDescriptions:i.description2,s=s+CamInfoHtml(i,i.id,i.description1,t,0,o,n,c,m,u,v)+"</div>";return p&&(s+='<input type="text" class="myCameraNickname form-control" aria-label="'+resources.Nickname+'" id="'+i.DT_RowId+'" placeholder="'+resources.Nickname+'" value="'+(i.nickname||"")+'"></input>'),s}};
