!function(t){t.VCO={VERSION:"0.1",_originalL:t.VCO}}(this),VCO.debug=!0,VCO.Bind=function(t,e){return function(){return t.apply(e,arguments)}},trace=function(t){VCO.debug&&(window.console?console.log(t):"undefined"!=typeof jsTrace&&jsTrace.send(t))},VCO.Util={extend:function(t){for(var e=Array.prototype.slice.call(arguments,1),i=0,n=e.length,o;n>i;i++){o=e[i]||{};for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t},setOptions:function(t,e){t.options=VCO.Util.extend({},t.options,e),""===t.options.uniqueid&&(t.options.uniqueid=VCO.Util.unique_ID(6))},findArrayNumberByUniqueID:function(t,e,i){for(var n=0,o=0;oi;i++)e+=n();return e};return e?e+"-"+o(t):"vco-"+o(t)},htmlify:function(t){return VCO.Browser.chrome&&(t=VCO.Emoji(t)),t.match(/[\s\S]*?<\/p>/)?t:"
"+t+"
"},getParamString:function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i+"="+t[i]);return"?"+e.join("&")},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},falseFn:function(){return!1},requestAnimFrame:function(){function t(t){window.setTimeout(t,1e3/60)}var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||t;return function(i,n,o,s){i=n?VCO.Util.bind(i,n):i,o&&e===t?i():e(i,s)}}(),bind:function(t,e){return function(){return t.apply(e,arguments)}},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw new Error("No value provided for variable "+t);return n})},hexToRgb:function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,n){return e+e+i+i+n+n});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},ratio:{square:function(t){var e={w:0,h:0};return t.w>t.h&&t.h>0?(e.h=t.h,e.w=t.h):(e.w=t.w,e.h=t.w),e},r16_9:function(t){return null!==t.w&&""!==t.w?Math.round(t.w/16*9):null!==t.h&&""!==t.h?Math.round(t.h/9*16):0},r4_3:function(t){return null!==t.w&&""!==t.w?Math.round(t.w/4*3):null!==t.h&&""!==t.h?Math.round(t.h/3*4):void 0}},getObjectAttributeByIndex:function(t,e){if("undefined"!=typeof t){var i=0;for(var n in t){if(e===i)return t[n];i++}return""}return""},getUrlVars:function(t){var e,i=[],n,o;e=t.toString(),e.match("&")?e=e.replace("&","&"):e.match("&")?e=e.replace("&","&"):e.match("&")&&(e=e.replace("&","&")),o=e.slice(e.indexOf("?")+1).split("&");for(var s=0;s0?$.fn.concat.apply([],t):t}function l(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function c(t){return t in k?k[t]:k[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function u(t,e){return"number"!=typeof e||P[l(t)]?e:e+"px"}function d(t){var e,i;return D[t]||(e=T.createElement(t),T.body.appendChild(e),i=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==i&&(i="block"),D[t]=i),D[t]}function m(t){return"children"in t?M.call(t.children):$.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function p(t,e,i){for(x in e)i&&(s(e[x])||Q(e[x]))?(s(e[x])&&!s(t[x])&&(t[x]={}),Q(e[x])&&!Q(t[x])&&(t[x]=[]),p(t[x],e[x],i)):e[x]!==w&&(t[x]=e[x])}function _(t,e){return null==e?$(t):$(t).filter(e)}function f(t,i,n,o){return e(i)?i.call(t,n,o):i}function g(t,e,i){null==i?t.removeAttribute(e):t.setAttribute(e,i)}function v(t,e){var i=t.className,n=i&&i.baseVal!==w;return e===w?n?i.baseVal:i:void(n?i.baseVal=e:t.className=e)}function y(t){var e;try{return t?"true"==t||("false"==t?!1:"null"==t?null:/^0/.test(t)||isNaN(e=Number(t))?/^[\[\{]/.test(t)?$.parseJSON(t):t:e):t}catch(i){return t}}function L(t,e){e(t);for(var i in t.childNodes)L(t.childNodes[i],e)}var w,x,$,b,C=[],M=C.slice,O=C.filter,T=window.document,D={},k={},P={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},E=/^\s*<(\w+|!)[^>]*>/,S=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,V=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,z=/^(?:body|html)$/i,A=/([A-Z])/g,B=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],U=T.createElement("table"),N=T.createElement("tr"),Z={tr:T.createElement("tbody"),tbody:U,thead:U,tfoot:U,td:N,th:N,"*":T.createElement("div")},R=/complete|loaded|interactive/,j=/^\.([\w-]+)$/,F=/^#([\w-]*)$/,W=/^[\w-]*$/,H={},q=H.toString,G={},Y,X,J=T.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return G.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var i=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(i)return i.call(t,e);var n,o=t.parentNode,s=!o;return s&&(o=J).appendChild(t),n=~G.qsa(o,e).indexOf(t),s&&J.removeChild(t),n},Y=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},X=function(t){return O.call(t,function(e,i){return t.indexOf(e)==i})},G.fragment=function(t,e,i){var n,o,a;return S.test(t)&&(n=$(T.createElement(RegExp.$1))),n||(t.replace&&(t=t.replace(V,"<$1>$2>")),e===w&&(e=E.test(t)&&RegExp.$1),e in Z||(e="*"),a=Z[e],a.innerHTML=""+t,n=$.each(M.call(a.childNodes),function(){a.removeChild(this)})),s(i)&&(o=$(n),$.each(i,function(t,e){B.indexOf(t)>-1?o[t](e):o.attr(t,e)})),n},G.Z=function(t,e){return t=t||[],t.__proto__=$.fn,t.selector=e||"",t},G.isZ=function(t){return t instanceof G.Z},G.init=function(t,i){var n;if(!t)return G.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&E.test(t))n=G.fragment(t,RegExp.$1,i),t=null;else{if(i!==w)return $(i).find(t);n=G.qsa(T,t)}else{if(e(t))return $(T).ready(t);if(G.isZ(t))return t;if(Q(t))n=r(t);else if(o(t))n=[t],t=null;else if(E.test(t))n=G.fragment(t.trim(),RegExp.$1,i),t=null;else{if(i!==w)return $(i).find(t);n=G.qsa(T,t)}}return G.Z(n,t)},$=function(t,e){return G.init(t,e)},$.extend=function(t){var e,i=M.call(arguments,1);return"boolean"==typeof t&&(e=t,t=i.shift()),i.forEach(function(i){p(t,i,e)}),t},G.qsa=function(t,e){var i,o="#"==e[0],s=!o&&"."==e[0],a=o||s?e.slice(1):e,r=W.test(a);return n(t)&&r&&o?(i=t.getElementById(a))?[i]:[]:1!==t.nodeType&&9!==t.nodeType?[]:M.call(r&&!o?s?t.getElementsByClassName(a):t.getElementsByTagName(e):t.querySelectorAll(e))},$.contains=function(t,e){return t!==e&&t.contains(e)},$.type=t,$.isFunction=e,$.isWindow=i,$.isArray=Q,$.isPlainObject=s,$.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},$.inArray=function(t,e,i){return C.indexOf.call(e,t,i)},$.camelCase=Y,$.trim=function(t){return null==t?"":String.prototype.trim.call(t)},$.uuid=0,$.support={},$.expr={},$.map=function(t,e){var i,n=[],o,s;if(a(t))for(o=0;o=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return C.every.call(this,function(e,i){return t.call(e,i,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):$(O.call(this,function(e){return G.matches(e,t)}))},add:function(t,e){return $(X(this.concat($(t,e))))},is:function(t){return this.length>0&&G.matches(this[0],t)},not:function(t){var i=[];if(e(t)&&t.call!==w)this.each(function(e){t.call(this,e)||i.push(this)});else{var n="string"==typeof t?this.filter(t):a(t)&&e(t.item)?M.call(t):$(t);this.forEach(function(t){n.indexOf(t)<0&&i.push(t)})}return $(i)},has:function(t){return this.filter(function(){return o(t)?$.contains(this,t):$(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!o(t)?t:$(t)},last:function(){var t=this[this.length-1];return t&&!o(t)?t:$(t)},find:function(t){var e,i=this;return e="object"==typeof t?$(t).filter(function(){var t=this;return C.some.call(i,function(e){return $.contains(e,t)})}):1==this.length?$(G.qsa(this[0],t)):this.map(function(){return G.qsa(this,t)})},closest:function(t,e){var i=this[0],o=!1;for("object"==typeof t&&(o=$(t));i&&!(o?o.indexOf(i)>=0:G.matches(i,t));)i=i!==e&&!n(i)&&i.parentNode;return $(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=$.map(i,function(t){return(t=t.parentNode)&&!n(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return _(e,t)},parent:function(t){return _(X(this.pluck("parentNode")),t)},children:function(t){return _(this.map(function(){return m(this)}),t)},contents:function(){return this.map(function(){return M.call(this.childNodes)})},siblings:function(t){return _(this.map(function(t,e){return O.call(m(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return $.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=d(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var i=e(t);if(this[0]&&!i)var n=$(t).get(0),o=n.parentNode||this.length>1;return this.each(function(e){$(this).wrapAll(i?t.call(this,e):o?n.cloneNode(!0):n)})},wrapAll:function(t){if(this[0]){$(this[0]).before(t=$(t));for(var e;(e=t.children()).length;)t=e.first();$(t).append(this)}return this},wrapInner:function(t){var i=e(t);return this.each(function(e){var n=$(this),o=n.contents(),s=i?t.call(this,e):t;o.length?o.wrapAll(s):n.append(s)})},unwrap:function(){return this.parent().each(function(){$(this).replaceWith($(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=$(this);(t===w?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return $(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return $(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0===arguments.length?this.length>0?this[0].innerHTML:null:this.each(function(e){var i=this.innerHTML;$(this).empty().append(f(this,t,e,i))})},text:function(t){return 0===arguments.length?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t===w?"":""+t})},attr:function(t,e){var i;return"string"==typeof t&&e===w?0==this.length||1!==this[0].nodeType?w:"value"==t&&"INPUT"==this[0].nodeName?this.val():!(i=this[0].getAttribute(t))&&t in this[0]?this[0][t]:i:this.each(function(i){if(1===this.nodeType)if(o(t))for(x in t)g(this,x,t[x]);else g(this,t,f(this,e,i,this.getAttribute(t)))})},removeAttr:function(t){return this.each(function(){1===this.nodeType&&g(this,t)})},prop:function(t,e){return t=K[t]||t,e===w?this[0]&&this[0][t]:this.each(function(i){this[t]=f(this,e,i,this[t])})},data:function(t,e){var i=this.attr("data-"+t.replace(A,"-$1").toLowerCase(),e);return null!==i?y(i):w},val:function(t){return 0===arguments.length?this[0]&&(this[0].multiple?$(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(e){this.value=f(this,t,e,this.value)})},offset:function(t){if(t)return this.each(function(e){var i=$(this),n=f(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:n.top-o.top,left:n.left-o.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)});if(0==this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,i){if(arguments.length<2){var n=this[0],o=getComputedStyle(n,"");if(!n)return;if("string"==typeof e)return n.style[Y(e)]||o.getPropertyValue(e);if(Q(e)){var s={};return $.each(Q(e)?e:[e],function(t,e){s[e]=n.style[Y(e)]||o.getPropertyValue(e)}),s}}var a="";if("string"==t(e))i||0===i?a=l(e)+":"+u(e,i):this.each(function(){this.style.removeProperty(l(e))});else for(x in e)e[x]||0===e[x]?a+=l(x)+":"+u(x,e[x])+";":this.each(function(){this.style.removeProperty(l(x))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf($(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?C.some.call(this,function(t){return this.test(v(t))},c(t)):!1},addClass:function(t){return t?this.each(function(e){b=[];var i=v(this),n=f(this,t,e,i);n.split(/\s+/g).forEach(function(t){$(this).hasClass(t)||b.push(t)},this),b.length&&v(this,i+(i?" ":"")+b.join(" "))}):this},removeClass:function(t){return this.each(function(e){return t===w?v(this,""):(b=v(this),f(this,t,e,b).split(/\s+/g).forEach(function(t){b=b.replace(c(t)," ")}),void v(this,b.trim()))})},toggleClass:function(t,e){return t?this.each(function(i){var n=$(this),o=f(this,t,i,v(this));o.split(/\s+/g).forEach(function(t){(e===w?!n.hasClass(t):e)?n.addClass(t):n.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===w?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===w?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),n=z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat($(t).css("margin-top"))||0,i.left-=parseFloat($(t).css("margin-left"))||0,n.top+=parseFloat($(e[0]).css("border-top-width"))||0,n.left+=parseFloat($(e[0]).css("border-left-width"))||0,{top:i.top-n.top,left:i.left-n.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||T.body;t&&!z.test(t.nodeName)&&"static"==$(t).css("position");)t=t.offsetParent;return t})}},$.fn.detach=$.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});$.fn[t]=function(o){var s,a=this[0];return o===w?i(a)?a["inner"+e]:n(a)?a.documentElement["scroll"+e]:(s=this.offset())&&s[t]:this.each(function(e){a=$(this),a.css(t,f(this,o,e,a[t]()))})}}),I.forEach(function(e,i){var n=i%2;$.fn[e]=function(){var e,o=$.map(arguments,function(i){return e=t(i),"object"==e||"array"==e||null==i?i:G.fragment(i)}),s,a=this.length>1;return o.length<1?this:this.each(function(t,e){s=n?e:e.parentNode,e=0==i?e.nextSibling:1==i?e.firstChild:2==i?e:null,o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!s)return $(t).remove();L(s.insertBefore(t,e),function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},$.fn[n?e+"To":"insert"+(i?"Before":"After")]=function(t){return $(t)[e](this),this}}),G.Z.prototype=$.fn,G.uniq=X,G.deserializeValue=y,$.zepto=G,$}();window.Zepto=e,void 0===window.$&&(window.$=e),function($){function t(t){return t._zid||(t._zid=u++)}function e(e,o,s,a){if(o=i(o),o.ns)var r=n(o.ns);return(f[t(e)]||[]).filter(function(e){return!(!e||o.e&&e.e!=o.e||o.ns&&!r.test(e.ns)||s&&t(e.fn)!==t(s)||a&&e.sel!=a)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function n(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!v&&t.e in y||!!e}function s(t){return L[t]||v&&y[t]||t}function a(e,n,a,r,l,c,u){var m=t(e),p=f[m]||(f[m]=[]);n.split(/\s/).forEach(function(t){if("ready"==t)return $(document).ready(a);var n=i(t);n.fn=a,n.sel=l,n.e in L&&(a=function(t){var e=t.relatedTarget;return!e||e!==this&&!$.contains(this,e)?n.fn.apply(this,arguments):void 0}),n.del=c;var m=c||a;n.proxy=function(t){if(t=h(t),!t.isImmediatePropagationStopped()){t.data=r;var i=m.apply(e,t._args==d?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},n.i=p.length,p.push(n),"addEventListener"in e&&e.addEventListener(s(n.e),n.proxy,o(n,u))})}function r(i,n,a,r,h){var l=t(i);(n||"").split(/\s/).forEach(function(t){e(i,t,a,r).forEach(function(t){delete f[l][t.i],"removeEventListener"in i&&i.removeEventListener(s(t.e),t.proxy,o(t,h))})})}function h(t,e){return(e||!t.isDefaultPrevented)&&(e||(e=t),$.each(C,function(i,n){var o=e[i];t[i]=function(){return this[n]=w,o&&o.apply(e,arguments)},t[n]=x}),(e.defaultPrevented!==d?e.defaultPrevented:"returnValue"in e?e.returnValue===!1:e.getPreventDefault&&e.getPreventDefault())&&(t.isDefaultPrevented=w)),t}function l(t){var e,i={originalEvent:t};for(e in t)b.test(e)||t[e]===d||(i[e]=t[e]);return h(i,t)}var c=$.zepto.qsa,u=1,d,m=Array.prototype.slice,p=$.isFunction,_=function(t){return"string"==typeof t},f={},g={},v="onfocusin"in window,y={focus:"focusin",blur:"focusout"},L={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",$.event={add:a,remove:r},$.proxy=function(e,i){if(p(e)){var n=function(){return e.apply(i,arguments)};return n._zid=t(e),n}if(_(i))return $.proxy(e[i],e);throw new TypeError("expected function")},$.fn.bind=function(t,e,i){return this.on(t,e,i)},$.fn.unbind=function(t,e){return this.off(t,e)},$.fn.one=function(t,e,i,n){return this.on(t,e,i,n,1)};var w=function(){return!0},x=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$)/,C={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};$.fn.delegate=function(t,e,i){return this.on(e,t,i)},$.fn.undelegate=function(t,e,i){return this.off(e,t,i)},$.fn.live=function(t,e){return $(document.body).delegate(this.selector,t,e),this},$.fn.die=function(t,e){return $(document.body).undelegate(this.selector,t,e),this},$.fn.on=function(t,e,i,n,o){var s,h,c=this;return t&&!_(t)?($.each(t,function(t,n){c.on(t,e,i,n,o)}),c):(_(e)||p(n)||n===!1||(n=i,i=e,e=d),(p(i)||i===!1)&&(n=i,i=d),n===!1&&(n=x),c.each(function(c,u){o&&(s=function(t){return r(u,t.type,n),n.apply(this,arguments)}),e&&(h=function(t){var i,o=$(t.target).closest(e,u).get(0);return o&&o!==u?(i=$.extend(l(t),{currentTarget:o,liveFired:u}),(s||n).apply(o,[i].concat(m.call(arguments,1)))):void 0}),a(u,t,n,i,e,h||s)}))},$.fn.off=function(t,e,i){var n=this;return t&&!_(t)?($.each(t,function(t,i){n.off(t,e,i)}),n):(_(e)||p(i)||i===!1||(i=e,e=d),i===!1&&(i=x),n.each(function(){r(this,t,i,e)}))},$.fn.trigger=function(t,e){return t=_(t)||$.isPlainObject(t)?$.Event(t):h(t),t._args=e,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(t):$(this).triggerHandler(t,e)})},$.fn.triggerHandler=function(t,i){var n,o;return this.each(function(s,a){n=l(_(t)?$.Event(t):t),n._args=i,n.target=a,$.each(e(a,t.type||t),function(t,e){return o=e.proxy(n),n.isImmediatePropagationStopped()?!1:void 0})}),o},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){$.fn[t]=function(e){return e?this.bind(t,e):this.trigger(t)}}),["focus","blur"].forEach(function(t){$.fn[t]=function(e){return e?this.bind(t,e):this.each(function(){try{this[t]()}catch(e){}}),this}}),$.Event=function(t,e){_(t)||(e=t,t=e.type);var i=document.createEvent(g[t]||"Events"),n=!0;if(e)for(var o in e)"bubbles"==o?n=!!e[o]:i[o]=e[o];return i.initEvent(t,n,!0),h(i)}}(e),function($){function t(t,e,i){var n=$.Event(e);return $(t).trigger(n,i),!n.isDefaultPrevented()}function e(e,i,n,o){return e.global?t(i||_,n,o):void 0}function i(t){t.global&&0===$.active++&&e(t,null,"ajaxStart")}function n(t){t.global&&!--$.active&&e(t,null,"ajaxStop")}function o(t,i){var n=i.context;return i.beforeSend.call(n,t,i)===!1||e(i,n,"ajaxBeforeSend",[t,i])===!1?!1:void e(i,n,"ajaxSend",[t,i])}function s(t,i,n,o){var s=n.context,a="success";n.success.call(s,t,a,i),o&&o.resolveWith(s,[t,a,i]),e(n,s,"ajaxSuccess",[i,n,t]),r(a,i,n)}function a(t,i,n,o,s){var a=o.context;o.error.call(a,n,i,t),s&&s.rejectWith(a,[n,i,t]),e(o,a,"ajaxError",[n,o,t||i]),r(i,n,o)}function r(t,i,o){var s=o.context;o.complete.call(s,i,t),e(o,s,"ajaxComplete",[i,o]),n(o)}function h(){}function l(t){return t&&(t=t.split(";",2)[0]),t&&(t==x?"html":t==w?"json":y.test(t)?"script":L.test(t)&&"xml")||"text"}function c(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function u(t){t.processData&&t.data&&"string"!=$.type(t.data)&&(t.data=$.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()||(t.url=c(t.url,t.data),t.data=void 0)}function d(t,e,i,n){var o=!$.isFunction(e);return{url:t,data:o?e:void 0,success:o?$.isFunction(i)?i:void 0:e,dataType:o?n||i:i}}function m(t,e,i,n){var o,s=$.isArray(e),a=$.isPlainObject(e);$.each(e,function(e,r){o=$.type(r),n&&(e=i?n:n+"["+(a||"object"==o||"array"==o?e:"")+"]"),!n&&s?t.add(r.name,r.value):"array"==o||!i&&"object"==o?m(t,r,i,e):t.add(e,r)})}var p=0,_=window.document,f,g,v=/",this._el.content_item.innerHTML=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}}),VCO.Media.Text=VCO.Class.extend({includes:[VCO.Events],_el:{container:{},content_container:{},content:{},headline:{},date:{},start_btn:{}},data:{uniqueid:"",headline:"headline",text:"text"},options:{title:!1},initialize:function(t,e,i){VCO.Util.setData(this,t),VCO.Util.mergeData(this.options,e),this._el.container=VCO.Dom.create("div","vco-text"),this._el.container.id=this.data.uniqueid,this._initLayout(),i&&i.appendChild(this._el.container)},show:function(){},hide:function(){},addTo:function(t){t.appendChild(this._el.container)},removeFrom:function(t){t.removeChild(this._el.container)},headlineHeight:function(){return this._el.headline.offsetHeight+40},addDateText:function(t){this._el.date.innerHTML=t},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){if(this._el.content_container=VCO.Dom.create("div","vco-text-content-container",this._el.container),this._el.date=VCO.Dom.create("h3","vco-headline-date",this._el.content_container),""!=this.data.headline){var t="vco-headline";this.options.title&&(t="vco-headline vco-headline-title"),this._el.headline=VCO.Dom.create("h2",t,this._el.content_container),this._el.headline.innerHTML=this.data.headline}if(""!=this.data.text){var e="";e+=VCO.Util.htmlify(this.data.text),this.data.date&&this.data.date.created_time&&""!=this.data.date.created_time&&this.data.date.created_time.length>10&&(e+="undefined"!=typeof moment?""+moment(this.data.date.created_time,"YYYY-MM-DD h:mm:ss").fromNow()+"
":""+VCO.Util.convertUnixTime(this.data.date.created_time)+"
"),this._el.content=VCO.Dom.create("div","vco-text-content",this._el.content_container),this._el.content.innerHTML=e}this.onLoaded()}}),VCO.Media.Twitter=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var t,e=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name),this._el.content_item=VCO.Dom.create("div","vco-media-twitter",this._el.content),this.media_id=this.data.url.match("status/")?this.data.url.split("status/")[1]:url.match("statuses/")?this.data.url.split("statuses/")[1]:"",t="https://api.twitter.com/1/statuses/oembed.json?id="+this.media_id+"&omit_script=true&include_entities=true&callback=?",VCO.ajax({type:"GET",url:t,dataType:"json",success:function(t){e.createMedia(t)},error:function(t,i){var n="";n+="Unable to load Tweet.
"+e.media_id+"
"+i,e.loadErrorDisplay(n)}})},createMedia:function(t){trace("create_media");var e="",i="",n="",o="",s="",a="";i=t.html.split("
—")[0]+"",n=t.author_url.split("twitter.com/")[1],o=t.html.split("—")[1].split('')[0],a=o.split('">')[1].split("")[0],e+=i,e+="",this._el.content_item.innerHTML=e,this.onLoaded()},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),VCO.Media.Vimeo=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var t,e=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name),this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-vimeo vco-media-shadow",this._el.content),this.media_id=this.data.url.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0],t="http://player.vimeo.com/video/"+this.media_id+"?api=1&title=0&byline=0&portrait=0&color=ffffff",this.player=VCO.Dom.create("iframe","",this._el.content_item),this.player.width="100%",this.player.height="100%",this.player.frameBorder="0",this.player.src=t,this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){try{this.player.contentWindow.postMessage(JSON.stringify({method:"pause"}),"http://player.vimeo.com")}catch(t){trace(t)}}}),VCO.Media.DailyMotion=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var t,e=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name),this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-dailymotion",this._el.content),this.media_id=this.data.url.match("video")?this.data.url.split("video/")[1].split(/[?&]/)[0]:this.data.url.split("embed/")[1].split(/[?&]/)[0],t="http://www.dailymotion.com/embed/video/"+this.media_id,this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"}}),VCO.Media.Vine=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var t,e=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name),this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-vine vco-media-shadow",this._el.content),this.media_id=this.data.url.split("vine.co/v/")[1],t="https://vine.co/v/"+this.media_id+"/embed/simple",this._el.content_item.innerHTML="",this.onLoaded()},_updateMediaDisplay:function(){var t=VCO.Util.ratio.square({w:this._el.content_item.offsetWidth,h:this.options.height});this._el.content_item.style.height=t.h+"px"}}),VCO.Media.Website=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){},createMedia:function(t){this.onLoaded()}}),VCO.Media.Wikipedia=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var t,e,i=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name),this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-wikipedia",this._el.content),this.media_id=this.data.url.split("wiki/")[1].split("#")[0].replace("_"," "),this.media_id=this.media_id.replace(" ","%20"),e=this.data.url.split("//")[1].split(".wikipedia")[0],t="http://"+e+".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles="+this.media_id+"&exintro=1&format=json&callback=?",VCO.ajax({type:"GET",url:t,dataType:"json",success:function(t){i.createMedia(t)},error:function(t,e){var n="";n+="Unable to load Wikipedia entry.
"+i.media_id+"
"+e,i.loadErrorDisplay(n)}})},createMedia:function(t){var e="";if(t.query){var i,e={entry:{},title:"",text:"",extract:"",paragraphs:1,text_array:[]};e.entry=VCO.Util.getObjectAttributeByIndex(t.query.pages,0),e.extract=e.entry.extract,e.title=e.entry.title,e.extract.match("")?e.text_array=e.extract.split("
"):e.text_array.push(e.extract);for(var n=0;n"+e.text_array[n+1]);i="",i+=""+VCO.Language.messages.wikipedia+"",i+=e.text,e.extract.match("REDIRECT")||(this._el.content_item.innerHTML=i,this.onLoaded())}},updateMediaDisplay:function(){},_updateMediaDisplay:function(){}}),VCO.Media.YouTube=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var t=this,e;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name),this.youtube_loaded=!1,this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-youtube vco-media-shadow",this._el.content),this._el.content_item.id=VCO.Util.unique_ID(7),e=VCO.Util.getUrlVars(this.data.url),this.media_id={},this.data.url.match("v=")?this.media_id.id=e.v:this.data.url.match("/embed/")?this.media_id.id=this.data.url.split("embed/")[1].split(/[?&]/)[0]:this.data.url.match(/v\/|v=|youtu\.be\//)?this.media_id.id=this.data.url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]:trace("YOUTUBE IN URL BUT NOT A VALID VIDEO"),this.media_id.start=e.t,this.media_id.hd=e.hd,VCO.Load.js("https://www.youtube.com/player_api",function(){t.createMedia()})},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){if(this.youtube_loaded)try{this.player.pauseVideo()}catch(t){trace(t)}},createMedia:function(){var t=this;if("undefined"!=typeof this.media_id.start){var e=this.media_id.start.toString(),i=0,n=0;e.match("m")?(i=parseInt(e.split("m")[0],10),n=parseInt(e.split("m")[1].split("s")[0],10),this.media_id.start=60*i+n):this.media_id.start=0}else this.media_id.start=0;this.media_id.hd="undefined"!=typeof this.media_id.hd?!0:!1,this.createPlayer()},createPlayer:function(){var t=this;clearTimeout(this.timer),"undefined"!=typeof YT&&"undefined"!=typeof YT.Player?this.player=new YT.Player(this._el.content_item.id,{playerVars:{enablejsapi:1,color:"white",autohide:1,showinfo:0,theme:"light",start:this.media_id.start,fs:0,rel:0},videoId:this.media_id.id,events:{onReady:function(){t.onPlayerReady()},onStateChange:t.onStateChange}}):this.timer=setTimeout(function(){t.createPlayer()},1e3),this.onLoaded()},onPlayerReady:function(t){this.youtube_loaded=!0,this._el.content_item=document.getElementById(this._el.content_item.id),this.onMediaLoaded(),this.onLoaded()},onStateChange:function(t){}}),VCO.Media.Slider=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image",this._el.content),this._el.content_item.src=this.data.url,this.onLoaded()}}),VCO.Slide=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(t,e,i){this._el={container:{},scroll_container:{},background:{},content_container:{},content:{},call_to_action:null},this._media=null,this._mediaclass={},this._text={},this._state={loaded:!1},this.has={headline:!1,text:!1,media:!1,title:!1,background:{image:!1,color:!1,color_value:""}},this.has.title=i,this.title="",this.data={uniqueid:null,background:null,date:null,location:null,text:null,media:null},this.options={duration:1e3,slide_padding_lr:40,ease:VCO.Ease.easeInSpline,width:600,height:600,skinny_size:650,media_name:""},this.active=!1,this.animator={},VCO.Util.mergeData(this.options,e),VCO.Util.mergeData(this.data,t),this._initLayout(),this._initEvents()},show:function(){this.animator=VCO.Animate(this._el.slider_container,{left:-(this._el.container.offsetWidth*n)+"px",duration:this.options.duration,easing:this.options.ease})},hide:function(){},setActive:function(t){this.active=t,this.active?(this.data.background&&this.fire("background_change",this.has.background),this.loadMedia()):this.stopMedia()},addTo:function(t){t.appendChild(this._el.container)
},removeFrom:function(t){t.removeChild(this._el.container)},updateDisplay:function(t,e,i){this._updateDisplay(t,e,i)},loadMedia:function(){this._media&&!this._state.loaded&&(this._media.loadMedia(),this._state.loaded=!0)},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getBackground:function(){return this.has.background},scrollToTop:function(){this._el.container.scrollTop=0},addCallToAction:function(t){this._el.call_to_action=VCO.Dom.create("div","vco-slide-calltoaction",this._el.content_container),this._el.call_to_action.innerHTML=""+t+"",VCO.DomEvent.addListener(this._el.call_to_action,"click",this._onCallToAction,this)},_onCallToAction:function(t){this.fire("call_to_action",t)},_initLayout:function(){this._el.container=VCO.Dom.create("div","vco-slide"),this.data.uniqueid&&(this._el.container.id=this.data.uniqueid),this._el.scroll_container=VCO.Dom.create("div","vco-slide-scrollable-container",this._el.container),this._el.content_container=VCO.Dom.create("div","vco-slide-content-container",this._el.scroll_container),this._el.content=VCO.Dom.create("div","vco-slide-content",this._el.content_container),this._el.background=VCO.Dom.create("div","vco-slide-background",this._el.container),this.data.background&&(this.data.background.url&&(this.has.background.image=!0,this._el.container.className+=" vco-full-image-background",this.has.background.color_value="#000",this._el.background.style.backgroundImage="url('"+this.data.background.url+"')",this._el.background.style.display="block"),this.data.background.color&&(this.has.background.color=!0,this._el.container.className+=" vco-full-color-background",this.has.background.color_value=this.data.background.color),this.data.background.text_background&&(this._el.container.className+=" vco-text-background")),this.data.media&&this.data.media.url&&""!=this.data.media.url&&(this.has.media=!0),this.data.text&&this.data.text.text&&(this.has.text=!0),this.data.text&&this.data.text.headline&&(this.has.headline=!0,this.title=this.data.text.headline),this.has.media&&(this.data.media.mediatype=VCO.MediaType(this.data.media),this.options.media_name=this.data.media.mediatype.name,this.options.media_type=this.data.media.mediatype.type,this._media=new this.data.media.mediatype.cls(this.data.media,this.options)),(this.has.text||this.has.headline)&&(this._text=new VCO.Media.Text(this.data.text,{title:this.has.title})),this.has.text||this.has.headline||!this.has.media?this.has.headline&&this.has.media&&!this.has.text?(this._el.container.className+=" vco-slide-media-only",this._text.addTo(this._el.content),this._media.addTo(this._el.content)):this.has.text&&this.has.media?(this._media.addTo(this._el.content),this._text.addTo(this._el.content)):(this.has.text||this.has.headline)&&(this._el.container.className+=" vco-slide-text-only",this._text.addTo(this._el.content)):(this._el.container.className+=" vco-slide-media-only",this._media.addTo(this._el.content)),this.onLoaded()},_initEvents:function(){},_updateDisplay:function(t,e,i){var n,o,s;this.options.width=t?t:this._el.container.offsetWidth,VCO.Browser.mobile&&this.options.width<=this.options.skinny_size?(n="0px",o="0px",s=this.options.width-0+"px"):"landscape"==i?(n="40px",o="75px",s=this.options.width-115+"px"):this.options.width<=this.options.skinny_size?(n=this.options.slide_padding_lr+"px",o=this.options.slide_padding_lr+"px",s=this.options.width-2*this.options.slide_padding_lr+"px"):(n=this.options.slide_padding_lr+"px",o=this.options.slide_padding_lr+"px",s=this.options.width-2*this.options.slide_padding_lr+"px"),this._el.content.style.paddingLeft=n,this._el.content.style.paddingRight=o,this._el.content.style.width=s,this._el.call_to_action&&(this._el.call_to_action.style.paddingLeft=n,this._el.call_to_action.style.paddingRight=o,this._el.call_to_action.style.width=s),this.options.height=e?e:this._el.container.offsetHeight,this._media&&(!this.has.text&&this.has.headline?this._media.updateDisplay(this.options.width,this.options.height-this._text.headlineHeight(),i):this._media.updateDisplay(this.options.width,this.options.height,i))}}),VCO.SlideNav=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(t,e,i){this._el={container:{},content_container:{},icon:{},title:{},description:{}},this.mediatype={},this.data={title:"Navigation",description:"Description"},this.options={direction:"previous"},this.animator=null,this.animator_position=null,VCO.Util.mergeData(this.options,e),VCO.Util.mergeData(this.data,t),this._el.container=VCO.Dom.create("div","vco-slidenav-"+this.options.direction),VCO.Browser.mobile&&this._el.container.setAttribute("ontouchstart"," "),this._initLayout(),this._initEvents(),i&&i.appendChild(this._el.container)},update:function(t){this._update(t)},setColor:function(t){this._el.content_container.className=t?"vco-slidenav-content-container vco-slidenav-inverted":"vco-slidenav-content-container"},updatePosition:function(t,e,i,n,o,s){var a=this,r={duration:i,easing:n,complete:function(){a._onUpdatePositionComplete(s)}},h=o;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e?t[l]+"%":t[l]+"px");this.animator_position&&this.animator_position.stop();var c;c=r.right?"right":"left",this._el.container.style[c]=e?h+"%":h+"px",this.animator_position=VCO.Animate(this._el.container,r)},_onUpdatePositionComplete:function(t){t&&(this._el.container.style.left="",this._el.container.style.right="")},_onMouseClick:function(){this.fire("clicked",this.options)},_update:function(t){this.data=VCO.Util.mergeData(this.data,t),""!=this.data.title&&(this._el.title.innerHTML=this.data.title),""!=this.data.date&&(this._el.description.innerHTML=this.data.description)},_initLayout:function(){this._el.content_container=VCO.Dom.create("div","vco-slidenav-content-container",this._el.container),this._el.icon=VCO.Dom.create("div","vco-slidenav-icon",this._el.content_container),this._el.title=VCO.Dom.create("div","vco-slidenav-title",this._el.content_container),this._el.description=VCO.Dom.create("div","vco-slidenav-description",this._el.content_container),this._el.icon.innerHTML=" ",this._update()},_initEvents:function(){VCO.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)}}),VCO.StorySlider=VCO.Class.extend({includes:VCO.Events,initialize:function(t,e,i,n){this._el={container:{},background:{},slider_container_mask:{},slider_container:{},slider_item_container:{}},this._nav={},this._nav.previous={},this._nav.next={},this.slide_spacing=0,this._slides=[],this._swipable,this.preloadTimer,this._message,this.current_slide=0,this.current_bg_color=null,this.data={},this.options={id:"",layout:"portrait",width:600,height:600,default_bg_color:{r:256,g:256,b:256},slide_padding_lr:40,start_at_slide:1,slide_default_fade:"0%",duration:1e3,ease:VCO.Ease.easeInOutQuint,dragging:!0,trackResize:!0},"object"==typeof t?(this._el.container=t,this.options.id=VCO.Util.unique_ID(6,"vco")):(this.options.id=t,this._el.container=VCO.Dom.get(t)),this._el.container.id||(this._el.container.id=this.options.id),this.animator=null,this.animator_background=null,VCO.Util.mergeData(this.options,i),VCO.Util.mergeData(this.data,e),n&&this.init()},init:function(){this._initLayout(),this._initEvents(),this._initData(),this._updateDisplay(),this.goTo(this.options.start_at_slide),this._onLoaded(),this._introInterface()},updateDisplay:function(t,e,i,n){this._updateDisplay(t,e,i,n)},createSlide:function(t){this._createSlide(t)},createSlides:function(t){this._createSlides(t)},_createSlides:function(t){for(var e=0;e=0&&(this.current_slide=t,this.animator&&this.animator.stop(),this._swipable&&this._swipable.stopMomentum(),e?(this._el.slider_container.style.left=-(this.slide_spacing*t)+"px",this._onSlideChange(i)):this.animator=VCO.Animate(this._el.slider_container,{left:-(this.slide_spacing*t)+"px",duration:this.options.duration,easing:this.options.ease,complete:this._onSlideChange(i)}),this._slides[this.current_slide].setActive(!0),this._slides[this.current_slide+1]?(this.showNav(this._nav.next,!0),this._nav.next.update(this.getNavInfo(this._slides[this.current_slide+1]))):this.showNav(this._nav.next,!1),this._slides[this.current_slide-1]?(this.showNav(this._nav.previous,!0),this._nav.previous.update(this.getNavInfo(this._slides[this.current_slide-1]))):this.showNav(this._nav.previous,!1),this.preloadTimer=setTimeout(function(){n.preloadSlides()},this.options.duration))},preloadSlides:function(){this._slides[this.current_slide+1]&&(this._slides[this.current_slide+1].loadMedia(),this._slides[this.current_slide+1].scrollToTop()),this._slides[this.current_slide+2]&&(this._slides[this.current_slide+2].loadMedia(),this._slides[this.current_slide+2].scrollToTop()),this._slides[this.current_slide-1]&&(this._slides[this.current_slide-1].loadMedia(),this._slides[this.current_slide-1].scrollToTop()),this._slides[this.current_slide-2]&&(this._slides[this.current_slide-2].loadMedia(),this._slides[this.current_slide-2].scrollToTop())},getNavInfo:function(t){var e={title:"",description:""};return t.data.text&&t.data.text.headline&&(e.title=t.data.text.headline),e},next:function(){this.goTo(this.current_slide+1=0?this.current_slide-1:this.current_slide)},showNav:function(t,e){this.options.width<=500&&VCO.Browser.mobile||(e?t.show():t.hide())},changeBackground:function(t){var e=this,i=!1,n={r:256,g:256,b:256},o,s=this.options.slide_default_fade,a="15%",r="0.87",h="",l=this._el.background.getAttribute("style");n=t.color_value?VCO.Util.hexToRgb(t.color_value):this.options.default_bg_color,this.animator_background&&this.animator_background.stop(),o=n.r+","+n.g+","+n.b,this.current_bg_color&&this.current_bg_color==o||(this.current_bg_color=o,i=!0),i&&("landscape"==this.options.layout?(this._nav.next.setColor(!1),this._nav.previous.setColor(!1),n.r<255&&n.g<255&&n.b<255&&(s="15%"),t.image&&(s="0%"),h+="opacity:0;",h+="background-image: -webkit-linear-gradient(left, color-stop(rgba("+o+",0.0001 ) "+s+"), color-stop(rgba("+o+","+r+") "+a+"));",h+="background-image: linear-gradient(to right, rgba("+o+",0.0001 ) "+s+", rgba("+o+","+r+") "+a+");",h+="background-repeat: repeat-x;",h+="filter: e(%('progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)',argb("+o+", 0.0001),argb("+o+",0.80)));"):(h+=t.color_value?"background-color:"+t.color_value+";":"background-color:#FFF;",n.r<255&&n.g<255&&n.b<255||t.image?(this._nav.next.setColor(!0),this._nav.previous.setColor(!0)):(this._nav.next.setColor(!1),this._nav.previous.setColor(!1))),this.animator_background=VCO.Animate(this._el.background,{opacity:0,duration:this.options.duration/2,easing:this.options.ease,complete:function(){e.fadeInBackground(h)}}))},fadeInBackground:function(t){this.animator_background&&this.animator_background.stop(),t&&this._el.background.setAttribute("style",t),this.animator_background=VCO.Animate(this._el.background,{opacity:1,duration:this.options.duration/2,easing:this.options.ease})},_updateDisplay:function(t,e,i,n){var o,s;s="undefined"==typeof n?this.options.layout:n,this.options.layout=s,this.slide_spacing=2*this.options.width,this.options.width=t?t:this._el.container.offsetWidth,this.options.height=e?e:this._el.container.offsetHeight,o=this.options.height/2,this._nav.next.setPosition({top:o}),this._nav.previous.setPosition({top:o});for(var a=0;aOK"),this._message.addTo(this._el.container))},_initEvents:function(){this._nav.next.on("clicked",this._onNavigation,this),this._nav.previous.on("clicked",this._onNavigation,this),this._message&&this._message.on("clicked",this._onMessageClick,this),this._swipable&&(this._swipable.on("swipe_left",this._onNavigation,this),this._swipable.on("swipe_right",this._onNavigation,this),this._swipable.on("swipe_nodirection",this._onSwipeNoDirection,this))},_initData:function(){this._createSlides(this.data.slides)},_onBackgroundChange:function(t){var e=this._slides[this.current_slide].getBackground();this.changeBackground(t),this.fire("colorchange",e)},_onMessageClick:function(t){this._message.hide()},_onSwipeNoDirection:function(t){this.goTo(this.current_slide)},_onNavigation:function(t){"next"==t.direction||"left"==t.direction?this.next():("previous"==t.direction||"right"==t.direction)&&this.previous(),this.fire("nav_"+t.direction,this.data)},_onSlideAdded:function(t){trace("slideadded"),this.fire("slideAdded",this.data)},_onSlideRemoved:function(t){this.fire("slideAdded",this.data)},_onSlideChange:function(t){t||this.fire("change",{current_slide:this.current_slide,uniqueid:this._slides[this.current_slide].data.uniqueid})},_onMouseClick:function(t){},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)&&("contextmenu"===e&&VCO.DomEvent.preventDefault(t),this.fire(e,{latlng:"something",layerPoint:"something else"}))}},_onLoaded:function(){this.fire("loaded",this.data),this.fire("title",{title:this._slides[0].title})}});var oldL=window.L,L={};L.version="0.7.2","object"==typeof module&&"object"==typeof module.exports?module.exports=L:"function"==typeof define&&define.amd&&define(L),L.noConflict=function(){return window.L=oldL,this},window.L=L,L.Util={extend:function(t){var e=Array.prototype.slice.call(arguments,1),i,n,o,s;for(n=0,o=e.length;o>n;n++){s=e[n]||{};for(i in s)s.hasOwnProperty(i)&&(t[i]=s[i])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?void(o=!0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),void t.apply(i,a))}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return L.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=L.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n})},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var e,i,n=["webkit","moz","o","ms"];for(e=0;et;t++)n._initHooks[t].call(this)}},e},L.Class.include=function(t){L.extend(this.prototype,t)},L.Class.mergeOptions=function(t){L.extend(this.prototype.options,t)},L.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var eventsKey="_leaflet_events";L.Mixin={},L.Mixin.Events={addEventListener:function(t,e,i){if(L.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n=this[eventsKey]=this[eventsKey]||{},o=i&&i!==this&&L.stamp(i),s,a,r,h,l,c,u;for(t=L.Util.splitWords(t),s=0,a=t.length;a>s;s++)r={action:e,context:i||this},h=t[s],o?(l=h+"_idx",c=l+"_len",u=n[l]=n[l]||{},u[o]||(u[o]=[],n[c]=(n[c]||0)+1),u[o].push(r)):(n[h]=n[h]||[],n[h].push(r));return this},hasEventListeners:function(t){var e=this[eventsKey];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[eventsKey])return this;if(!t)return this.clearAllEventListeners();if(L.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n=this[eventsKey],o=i&&i!==this&&L.stamp(i),s,a,r,h,l,c,u,d,m;for(t=L.Util.splitWords(t),s=0,a=t.length;a>s;s++)if(r=t[s],c=r+"_idx",u=c+"_len",d=n[c],e){if(h=o&&d?d[o]:n[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(m=h.splice(l,1),m[0].action=L.Util.falseFn);i&&d&&0===h.length&&(delete d[o],n[u]--)}}else delete n[r],delete n[c],delete n[u];return this},clearAllEventListeners:function(){return delete this[eventsKey],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i=L.Util.extend({},e,{type:t,target:this}),n=this[eventsKey],o,s,a,r,h;if(n[t])for(o=n[t].slice(),s=0,a=o.length;a>s;s++)o[s].action.call(o[s].context,i);r=n[t+"_idx"];for(h in r)if(o=r[h].slice())for(s=0,a=o.length;a>s;s++)o[s].action.call(o[s].context,i);return this},addOneTimeEventListener:function(t,e,i){if(L.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=L.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},L.Mixin.Events.on=L.Mixin.Events.addEventListener,L.Mixin.Events.off=L.Mixin.Events.removeEventListener,L.Mixin.Events.once=L.Mixin.Events.addOneTimeEventListener,L.Mixin.Events.fire=L.Mixin.Events.fireEvent,function(){var t="ActiveXObject"in window,e=t&&!document.addEventListener,i=navigator.userAgent.toLowerCase(),n=-1!==i.indexOf("webkit"),o=-1!==i.indexOf("chrome"),s=-1!==i.indexOf("phantom"),a=-1!==i.indexOf("android"),r=-1!==i.search("android [23]"),h=-1!==i.indexOf("gecko"),l=typeof orientation!=void 0+"",c=window.navigator&&window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints&&!window.PointerEvent,u=window.PointerEvent&&window.navigator.pointerEnabled&&window.navigator.maxTouchPoints||c,d="devicePixelRatio"in window&&window.devicePixelRatio>1||"matchMedia"in window&&window.matchMedia("(min-resolution:144dpi)")&&window.matchMedia("(min-resolution:144dpi)").matches,m=document.documentElement,p=t&&"transition"in m.style,_="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!r,f="MozPerspective"in m.style,g="OTransition"in m.style,v=!window.L_DISABLE_3D&&(p||_||f||g)&&!s,y=!window.L_NO_TOUCH&&!s&&function(){var t="ontouchstart";if(u||t in m)return!0;var e=document.createElement("div"),i=!1;return e.setAttribute?(e.setAttribute(t,"return;"),"function"==typeof e[t]&&(i=!0),e.removeAttribute(t),e=null,i):!1}();L.Browser={ie:t,ielt9:e,webkit:n,gecko:h&&!n&&!window.opera&&!t,android:a,android23:r,chrome:o,ie3d:p,webkit3d:_,gecko3d:f,opera3d:g,any3d:v,mobile:l,mobileWebkit:l&&n,mobileWebkit3d:l&&_,mobileOpera:l&&window.opera,touch:y,msPointer:c,pointer:u,retina:d}}(),L.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},L.Point.prototype={clone:function(){return new L.Point(this.x,this.y)},add:function(t){return this.clone()._add(L.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(L.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=L.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=L.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=L.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+L.Util.formatNum(this.x)+", "+L.Util.formatNum(this.y)+")"}},L.point=function(t,e,i){return t instanceof L.Point?t:L.Util.isArray(t)?new L.Point(t[0],t[1]):void 0===t||null===t?t:new L.Point(t,e,i)},L.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},L.Bounds.prototype={extend:function(t){return t=L.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new L.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new L.Point(this.min.x,this.max.y)},getTopRight:function(){return new L.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof L.Point?L.point(t):L.bounds(t),t instanceof L.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=L.bounds(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,a=o.y>=e.y&&n.y<=i.y;return s&&a},isValid:function(){return!(!this.min||!this.max)}},L.bounds=function(t,e){return!t||t instanceof L.Bounds?t:new L.Bounds(t,e)},L.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},L.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new L.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},L.DomUtil={get:function(t){return"string"==typeof t?document.getElementById(t):t},getStyle:function(t,e){var i=t.style[e];if(!i&&t.currentStyle&&(i=t.currentStyle[e]),(!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i},getViewportOffset:function(t){var e=0,i=0,n=t,o=document.body,s=document.documentElement,a;do{if(e+=n.offsetTop||0,i+=n.offsetLeft||0,e+=parseInt(L.DomUtil.getStyle(n,"borderTopWidth"),10)||0,i+=parseInt(L.DomUtil.getStyle(n,"borderLeftWidth"),10)||0,a=L.DomUtil.getStyle(n,"position"),n.offsetParent===o&&"absolute"===a)break;if("fixed"===a){e+=o.scrollTop||s.scrollTop||0,i+=o.scrollLeft||s.scrollLeft||0;break}if("relative"===a&&!n.offsetLeft){var r=L.DomUtil.getStyle(n,"width"),h=L.DomUtil.getStyle(n,"max-width"),l=n.getBoundingClientRect();("none"!==r||"none"!==h)&&(i+=l.left+n.clientLeft),e+=l.top+(o.scrollTop||s.scrollTop||0);break}n=n.offsetParent}while(n);n=t;do{if(n===o)break;e-=n.scrollTop||0,i-=n.scrollLeft||0,n=n.parentNode}while(n);return new L.Point(i,e)},documentIsLtr:function(){return L.DomUtil._docIsLtrCached||(L.DomUtil._docIsLtrCached=!0,L.DomUtil._docIsLtr="ltr"===L.DomUtil.getStyle(document.body,"direction")),L.DomUtil._docIsLtr},create:function(t,e,i){var n=document.createElement(t);return n.className=e,i&&i.appendChild(n),n},hasClass:function(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=L.DomUtil._getClass(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)},addClass:function(t,e){if(void 0!==t.classList)for(var i=L.Util.splitWords(e),n=0,o=i.length;o>n;n++)t.classList.add(i[n]);else if(!L.DomUtil.hasClass(t,e)){var s=L.DomUtil._getClass(t);L.DomUtil._setClass(t,(s?s+" ":"")+e)}},removeClass:function(t,e){void 0!==t.classList?t.classList.remove(e):L.DomUtil._setClass(t,L.Util.trim((" "+L.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e},_getClass:function(t){return void 0===t.className.baseVal?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var e=document.documentElement.style,i=0;ii||i===e?e:t),new L.LatLng(this.lat,i)}},L.latLng=function(t,e){return t instanceof L.LatLng?t:L.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new L.LatLng(t[0],t[1],t[2]):null:void 0===t||null===t?t:"object"==typeof t&&"lat"in t?new L.LatLng(t.lat,"lng"in t?t.lng:t.lon):void 0===e?null:new L.LatLng(t,e)},L.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},L.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=L.latLng(t);return t=null!==e?e:L.latLngBounds(t),t instanceof L.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new L.LatLng(t.lat,t.lng),this._northEast=new L.LatLng(t.lat,t.lng)):t instanceof L.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this
},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new L.LatLngBounds(new L.LatLng(e.lat-n,e.lng-o),new L.LatLng(i.lat+n,i.lng+o))},getCenter:function(){return new L.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new L.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new L.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof L.LatLng?L.latLng(t):L.latLngBounds(t);var e=this._southWest,i=this._northEast,n,o;return t instanceof L.LatLngBounds?(n=t.getSouthWest(),o=t.getNorthEast()):n=o=t,n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=L.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,a=o.lng>=e.lng&&n.lng<=i.lng;return s&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=L.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},L.latLngBounds=function(t,e){return!t||t instanceof L.LatLngBounds?t:new L.LatLngBounds(t,e)},L.Projection={},L.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=L.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=t.lng*e,s=n*e;return s=Math.log(Math.tan(Math.PI/4+s/2)),new L.Point(o,s)},unproject:function(t){var e=L.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new L.LatLng(n,i)}},L.Projection.LonLat={project:function(t){return new L.Point(t.lng,t.lat)},unproject:function(t){return new L.LatLng(t.y,t.x)}},L.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return L.point(e,e)}},L.CRS.Simple=L.extend({},L.CRS,{projection:L.Projection.LonLat,transformation:new L.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),L.CRS.EPSG3857=L.extend({},L.CRS,{code:"EPSG:3857",projection:L.Projection.SphericalMercator,transformation:new L.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),L.CRS.EPSG900913=L.extend({},L.CRS.EPSG3857,{code:"EPSG:900913"}),L.CRS.EPSG4326=L.extend({},L.CRS,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/360,.5,-1/360,.5)}),L.Map=L.Class.extend({includes:L.Mixin.Events,options:{crs:L.CRS.EPSG3857,fadeAnimation:L.DomUtil.TRANSITION&&!L.Browser.android23,trackResize:!0,markerZoomAnimation:L.DomUtil.TRANSITION&&L.Browser.any3d},initialize:function(t,e){e=L.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=L.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&void 0!==e.zoom&&this.setView(L.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=void 0===e?this.getZoom():e,this._resetView(L.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=t instanceof L.Point?t:this.latLngToContainerPoint(t),a=s.subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(a));return this.setView(r,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():L.latLngBounds(t);var i=L.point(e.paddingTopLeft||e.padding||[0,0]),n=L.point(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n)),s=n.subtract(i).divideBy(2),a=this.project(t.getSouthWest(),o),r=this.project(t.getNorthEast(),o),h=this.unproject(a.add(r).divideBy(2).add(s),o);return o=e&&e.maxZoom?Math.min(e.maxZoom,o):o,this.setView(h,o,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(L.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=L.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=L.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&L.TileLayer&&t instanceof L.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=L.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&L.TileLayer&&t instanceof L.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return t?L.stamp(t)in this._layers:!1},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){if(!this._loaded)return this;t=L.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(L.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=void 0}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new L.LatLngBounds(e,i)},getMinZoom:function(){return void 0===this.options.minZoom?void 0===this._layersMinZoom?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=L.latLngBounds(t);var n=this.getMinZoom()-(e?1:0),o=this.getMaxZoom(),s=this.getSize(),a=t.getNorthWest(),r=t.getSouthEast(),h=!0,l;i=L.point(i||[0,0]);do n++,l=this.project(r,n).subtract(this.project(a,n)).add(i),h=e?l.x=n);return h&&e?null:e?n:n-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new L.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new L.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(L.latLng(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(L.point(t),e)},layerPointToLatLng:function(t){var e=L.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(L.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return L.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return L.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(L.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(L.latLng(t)))},mouseEventToContainerPoint:function(t){return L.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=L.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;L.DomUtil.addClass(t,"leaflet-container"+(L.Browser.touch?" leaflet-touch":"")+(L.Browser.retina?" leaflet-retina":"")+(L.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=L.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(L.DomUtil.addClass(t.markerPane,e),L.DomUtil.addClass(t.shadowPane,e),L.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return L.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?L.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var o=this._zoom!==e;n||(this.fire("movestart"),o&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):L.DomUtil.setPosition(this._mapPane,new L.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var s=!this._loaded;this._loaded=!0,s&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(o||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){L.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers){var o=this._zoomBoundLayers[t];isNaN(o.options.minZoom)||(e=Math.min(e,o.options.minZoom)),isNaN(o.options.maxZoom)||(i=Math.max(i,o.options.maxZoom))}void 0===t?this._layersMaxZoom=this._layersMinZoom=void 0:(this._layersMaxZoom=i,this._layersMinZoom=e),n!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){if(L.DomEvent){t=t||"on",L.DomEvent[t](this._container,"click",this._onMouseClick,this);var e=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"],i,n;for(i=0,n=e.length;n>i;i++)L.DomEvent[t](this._container,e[i],this._fireMouseEvent,this);this.options.trackResize&&L.DomEvent[t](window,"resize",this._onResize,this)}},_onResize:function(){L.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=L.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||L.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!L.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&L.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),o=this.layerPointToLatLng(n);this.fire(e,{latlng:o,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return L.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new L.Bounds(n.subtract(o),n.add(o)),a=this._getBoundsOffset(s,i,e);return this.unproject(n.add(a),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new L.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),o=this.project(e.getSouthEast(),i).subtract(t.max),s=this._rebound(n.x,-o.x),a=this._rebound(n.y,-o.y);return new L.Point(s,a)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),L.map=function(t,e){return new L.Map(t,e)},L.DomEvent={addListener:function(t,e,i,n){var o=L.stamp(i),s="_leaflet_"+e+o,a,r,h;return t[s]?this:(a=function(e){return i.call(n||t,e||L.DomEvent._getEvent())},L.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,a,o):(L.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,o),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return L.DomEvent._checkMouse(t,e)?r(e):void 0},t.addEventListener(h,a,!1)):"click"===e&&L.Browser.android?(r=a,a=function(t){return L.DomEvent._filterClick(t,r)},t.addEventListener(e,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[s]=a,this))},removeListener:function(t,e,i){var n=L.stamp(i),o="_leaflet_"+e+n,s=t[o];return s?(L.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):L.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",s,!1),t.removeEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1):t.removeEventListener(e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s),t[o]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,L.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=L.DomEvent.stopPropagation;return L.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=L.DomEvent.stopPropagation,i=L.Draggable.START.length-1;i>=0;i--)L.DomEvent.on(t,L.Draggable.START[i],e);return L.DomEvent.on(t,"click",L.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return L.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,e){if(!e)return new L.Point(t.clientX,t.clientY);var i=e.getBoundingClientRect();return new L.Point(t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop)},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){L.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var t=window.event;if(!t)for(var e=arguments.callee.caller;e&&(t=e.arguments[0],!t||window.Event!==t.constructor);)e=e.caller;return t},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=L.DomEvent._lastClick&&i-L.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?void L.DomEvent.stop(t):(L.DomEvent._lastClick=i,e(t))}},L.DomEvent.on=L.DomEvent.addListener,L.DomEvent.off=L.DomEvent.removeListener,L.Draggable=L.Class.extend({includes:L.Mixin.Events,statics:{START:L.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=L.Draggable.START.length-1;t>=0;t--)L.DomEvent.on(this._dragStartTarget,L.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=L.Draggable.START.length-1;t>=0;t--)L.DomEvent.off(this._dragStartTarget,L.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(L.DomEvent.stopPropagation(t),L.Draggable._disabled||(L.DomUtil.disableImageDrag(),L.DomUtil.disableTextSelection(),this._moving)))){var e=t.touches?t.touches[0]:t;this._startPoint=new L.Point(e.clientX,e.clientY),this._startPos=this._newPos=L.DomUtil.getPosition(this._element),L.DomEvent.on(document,L.Draggable.MOVE[t.type],this._onMove,this).on(document,L.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new L.Point(e.clientX,e.clientY),n=i.subtract(this._startPoint);(n.x||n.y)&&(L.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=L.DomUtil.getPosition(this._element).subtract(n),L.DomUtil.addClass(document.body,"leaflet-dragging"),L.DomUtil.addClass(t.target||t.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,L.Util.cancelAnimFrame(this._animRequest),this._animRequest=L.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))},_updatePosition:function(){this.fire("predrag"),L.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){L.DomUtil.removeClass(document.body,"leaflet-dragging"),L.DomUtil.removeClass(t.target||t.srcElement,"leaflet-drag-target");for(var e in L.Draggable.MOVE)L.DomEvent.off(document,L.Draggable.MOVE[e],this._onMove).off(document,L.Draggable.END[e],this._onUp);L.DomUtil.enableImageDrag(),L.DomUtil.enableTextSelection(),this._moved&&this._moving&&(L.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),L.Handler=L.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),L.Control=L.Class.extend({options:{position:"topright"},initialize:function(t){L.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return L.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),L.control=function(t){return new L.Control(t)},L.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,o){var s=i+t+" "+i+o;e[t+o]=L.DomUtil.create("div",s,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=L.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),L.TileLayer=L.Class.extend({includes:L.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:L.Browser.mobile,updateWhenIdle:L.Browser.mobile},initialize:function(t,e){e=L.setOptions(this,e),e.detectRetina&&L.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=L.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=L.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i=t.children,n=-e(1/0,-1/0),o,s,a;for(s=0,a=i.length;a>s;s++)i[s]!==this._container&&(o=parseInt(i[s].style.zIndex,10),isNaN(o)||(n=e(n,o)));this.options.zIndex=this._container.style.zIndex=(isFinite(n)?n:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(L.Browser.ielt9)for(t in e)L.DomUtil.setOpacity(e[t],this.options.opacity);else L.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=L.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=L.DomUtil.create("div",e,this._container),this._tileContainer=L.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map,e=t.getPixelBounds(),i=t.getZoom(),n=this._getTileSize();if(isNaN(t.getZoom())&&(i=this.options.minZoom||1,t.setZoom(i)),!(i>this.options.maxZoom||io;o++)this._addTile(e[o],r);this._tileContainer.appendChild(r)}},_tilePointIsCached:function(t){return"undefined"==typeof t?!1:t.x+":"+t.y in this._tiles},_tileShouldBeLoaded:function(t){var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(L.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),L.Browser.android||(e.onload=null,e.src=L.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();L.DomUtil.setPosition(n,i,L.Browser.chrome),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+=t.zoomOffset,t.maxNativeZoom?Math.min(e,t.maxNativeZoom):e},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this._getTileSize();return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return L.Util.template(this._url,L.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){var t=this._map.options.crs,e=t.getSize(this._map.getZoom());return e.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=L.DomUtil.create("img","leaflet-tile");return t.style.width=t.style.height=this._getTileSize()+"px",t.galleryimg="no",t.onselectstart=t.onmousemove=L.Util.falseFn,L.Browser.ielt9&&void 0!==this.options.opacity&&L.DomUtil.setOpacity(t,this.options.opacity),L.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&L.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(L.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==L.Util.emptyImageUrl&&(L.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),L.tileLayer=function(t,e){return new L.TileLayer(t,e)},L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(t){L.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTile:function(){var t=L.DomUtil.create("canvas","leaflet-tile");return t.width=t.height=this.options.tileSize,t.onselectstart=t.onmousemove=L.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),L.tileLayer.canvas=function(t){return new L.TileLayer.Canvas(t)},L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=L.latLngBounds(e),L.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&L.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()
},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&L.Browser.any3d?L.DomUtil.addClass(this._image,"leaflet-zoom-animated"):L.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),L.extend(this._image,{galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:L.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),o=this._bounds.getNorthWest(),s=this._bounds.getSouthEast(),a=e._latLngToNewLayerPoint(o,t.zoom,t.center),r=e._latLngToNewLayerPoint(s,t.zoom,t.center)._subtract(a),h=a._add(r._multiplyBy(.5*(1-1/n)));i.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(h)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);L.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){L.DomUtil.setOpacity(this._image,this.options.opacity)}}),L.imageOverlay=function(t,e,i){return new L.ImageOverlay(t,e,i)},L.Icon=L.Class.extend({options:{className:""},initialize:function(t){L.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=L.point(i[e+"Size"]),o;o=L.point("shadow"===e?i.shadowAnchor||i.iconAnchor:i.iconAnchor),!o&&n&&(o=n.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+i.className,o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return L.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),L.icon=function(t){return new L.Icon(t)},L.Icon.Default=L.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];L.Browser.retina&&"icon"===t&&(t+="-2x");var i=L.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),L.Icon.Default.imagePath=function(){var t=document.getElementsByTagName("script"),e=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,i,n,o,s,a;for(i=0,n=t.length;n>i;i++)if(o=t[i].src,s=o.match(e))return a=o.split(e)[0],(a?a+"/":"")+"images"}(),L.Marker=L.Class.extend({includes:L.Mixin.Events,options:{icon:new L.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){L.setOptions(this,e),this._latlng=L.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=L.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",o=t.icon.createIcon(this._icon),s=!1;o!==this._icon&&(this._icon&&this._removeIcon(),s=!0,t.title&&(o.title=t.title),t.alt&&(o.alt=t.alt)),L.DomUtil.addClass(o,n),t.keyboard&&(o.tabIndex="0"),this._icon=o,this._initInteraction(),t.riseOnHover&&L.DomEvent.on(o,"mouseover",this._bringToFront,this).on(o,"mouseout",this._resetZIndex,this);var a=t.icon.createShadow(this._shadow),r=!1;a!==this._shadow&&(this._removeShadow(),r=!0),a&&L.DomUtil.addClass(a,n),this._shadow=a,t.opacity<1&&this._updateOpacity();var h=this._map._panes;s&&h.markerPane.appendChild(this._icon),a&&r&&h.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&L.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){L.DomUtil.setPosition(this._icon,t),this._shadow&&L.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this),L.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;ie;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e=Array.prototype.slice.call(arguments,1),i,n;for(i in this._layers)n=this._layers[i],n[t]&&n[t].apply(n,e);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return L.stamp(t)}}),L.layerGroup=function(t){return new L.LayerGroup(t)},L.FeatureGroup=L.LayerGroup.extend({includes:L.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(L.FeatureGroup.EVENTS,this._propagateEvent,this),L.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(L.FeatureGroup.EVENTS,this._propagateEvent,this),L.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new L.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof L.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=L.extend({layer:t.target,target:this},t),this.fire(t.type,t)}}),L.featureGroup=function(t){return new L.FeatureGroup(t)},L.Path=L.Class.extend({includes:[L.Mixin.Events],statics:{CLIP_PADDING:function(){var t=L.Browser.mobile?1280:2e3,e=(t/Math.max(window.outerWidth,window.outerHeight)-1)/2;return Math.max(0,Math.min(.5,e))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){L.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,L.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return L.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),L.Map.include({_updatePathViewport:function(){var t=L.Path.CLIP_PADDING,e=this.getSize(),i=L.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),o=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new L.Bounds(n,o)}}),L.Path.SVG_NS="http://www.w3.org/2000/svg",L.Browser.svg=!(!document.createElementNS||!document.createElementNS(L.Path.SVG_NS,"svg").createSVGRect),L.Path=L.Path.extend({statics:{SVG:L.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return document.createElementNS(L.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&L.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(L.Browser.svg||!L.Browser.vml)&&L.DomUtil.addClass(this._path,"leaflet-clickable"),L.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;et;t++){for(e=0,n=this._parts[t].length;n>e;e++)o=this._parts[t][e],s=(0===e?"move":"line")+"To",this._ctx[s](o.x,o.y);this instanceof L.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),L.Map.include(L.Path.SVG&&!window.L_PREFER_CANVAS||!L.Browser.canvas?{}:{_initPathRoot:function(){var t=this._pathRoot,e;t||(t=this._pathRoot=document.createElement("canvas"),t.style.position="absolute",e=this._canvasCtx=t.getContext("2d"),e.lineCap="round",e.lineJoin="round",this._panes.overlayPane.appendChild(t),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;L.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),L.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var i=t.length,n=typeof Uint8Array!=void 0+""?Uint8Array:Array,o=new n(i);o[0]=o[i-1]=1,this._simplifyDPStep(t,o,e,0,i-1);var s,a=[];for(s=0;i>s;s++)o[s]&&a.push(t[s]);return a},_simplifyDPStep:function(t,e,i,n,o){var s=0,a,r,h;for(r=n+1;o-1>=r;r++)h=this._sqClosestPointOnSegment(t[r],t[n],t[o],!0),h>s&&(a=r,s=h);s>i&&(e[a]=1,this._simplifyDPStep(t,e,i,n,a),this._simplifyDPStep(t,e,i,a,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o=n?this._lastCode:this._getBitCode(t,i),s=this._getBitCode(e,i),a,r,h;for(this._lastCode=s;;){if(!(o|s))return[t,e];if(o&s)return!1;a=o||s,r=this._getEdgeIntersection(t,e,a,i),h=this._getBitCode(r,i),a===o?(t=r,o=h):(e=r,s=h)}},_getEdgeIntersection:function(t,e,i,n){var o=e.x-t.x,s=e.y-t.y,a=n.min,r=n.max;return 8&i?new L.Point(t.x+o*(r.y-t.y)/s,r.y):4&i?new L.Point(t.x+o*(a.y-t.y)/s,a.y):2&i?new L.Point(r.x,t.y+s*(r.x-t.x)/o):1&i?new L.Point(a.x,t.y+s*(a.x-t.x)/o):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var o=e.x,s=e.y,a=i.x-o,r=i.y-s,h=a*a+r*r,l;return h>0&&(l=((t.x-o)*a+(t.y-s)*r)/h,l>1?(o=i.x,s=i.y):l>0&&(o+=a*l,s+=r*l)),a=t.x-o,r=t.y-s,n?a*a+r*r:new L.Point(o,s)}},L.Polyline=L.Path.extend({initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(L.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e=1/0,i=this._parts,n,o,s=null,a=0,r=i.length;r>a;a++)for(var h=i[a],l=1,c=h.length;c>l;l++){n=h[l-1],o=h[l];var u=L.LineUtil._sqClosestPointOnSegment(t,n,o,!0);e>u&&(e=u,s=L.LineUtil._sqClosestPointOnSegment(t,n,o))}return s&&(s.distance=Math.sqrt(e)),s},getBounds:function(){return new L.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,o=e?t:[];for(i=0,n=t.length;n>i;i++){if(L.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;o[i]=L.latLng(t[i])}return o},_initEvents:function(){L.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e=L.Path.VML,i=0,n=t.length,o="",s;n>i;i++)s=t[i],e&&s._round(),o+=(i?"L":"M")+s.x+" "+s.y;return o},_clipPoints:function(){var t=this._originalPoints,e=t.length,i,n,o;if(this.options.noClip)return void(this._parts=[t]);this._parts=[];var s=this._parts,a=this._map._pathViewport,r=L.LineUtil;for(i=0,n=0;e-1>i;i++)o=r.clipSegment(t[i],t[i+1],a,i),o&&(s[n]=s[n]||[],s[n].push(o[0]),(o[1]!==t[i+1]||i===e-2)&&(s[n].push(o[1]),n++))},_simplifyPoints:function(){for(var t=this._parts,e=L.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),L.Path.prototype._updatePath.call(this))}}),L.polyline=function(t,e){return new L.Polyline(t,e)},L.PolyUtil={},L.PolyUtil.clipPolygon=function(t,e){var i,n=[1,4,2,8],o,s,a,r,h,l,c,u,d=L.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=d._getBitCode(t[o],e);for(a=0;4>a;a++){for(c=n[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&c?h._code&c||(u=d._getEdgeIntersection(h,r,c,e),u._code=d._getBitCode(u,e),i.push(u)):(h._code&c&&(u=d._getEdgeIntersection(h,r,c,e),u._code=d._getBitCode(u,e),i.push(u)),i.push(r));t=i}return t},L.Polygon=L.Polyline.extend({options:{fill:!0},initialize:function(t,e){L.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&L.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(L.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&L.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):L.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var o=L.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);o.length&&e.push(o)}this._parts=e}},_getPathPartStr:function(t){var e=L.Polyline.prototype._getPathPartStr.call(this,t);return e+(L.Browser.svg?"z":"x")}}),L.polygon=function(t,e){return new L.Polygon(t,e)},function(){function t(t){return L.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}L.MultiPolyline=t(L.Polyline),L.MultiPolygon=t(L.Polygon),L.multiPolyline=function(t,e){return new L.MultiPolyline(t,e)},L.multiPolygon=function(t,e){return new L.MultiPolygon(t,e)}}(),L.Rectangle=L.Polygon.extend({initialize:function(t,e){L.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=L.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),L.rectangle=function(t,e){return new L.Rectangle(t,e)},L.Circle=L.Path.extend({initialize:function(t,e,i){L.Path.prototype.initialize.call(this,i),this._latlng=L.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=L.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new L.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":L.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(L.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(h=this._parts[i],n=0,a=h.length,o=a-1;a>n;o=n++)if((e||0!==n)&&(r=L.LineUtil.pointToSegmentDistance(t,h[o],h[n]),l>=r))return!0;return!1}}:{}),L.Map.mergeOptions({dragging:!0,inertia:!L.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:L.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),L.Map.Drag=L.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new L.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),o)e.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+n-this._times[0])/1e3,r=i.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,l),u=h.multiplyBy(c/l),d=c/(i.inertiaDeceleration*r),m=u.multiplyBy(-d/2).round();m.x&&m.y?(m=e._limitOffset(m,e.options.maxBounds),L.Util.requestAnimFrame(function(){e.panBy(m,{duration:d,easeLinearity:r,noMoveStart:!0})})):e.fire("moveend")}}}),L.Map.addInitHook("addHandler","dragging",L.Map.Drag),L.Map.mergeOptions({doubleClickZoom:!0}),L.Map.DoubleClickZoom=L.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),L.Map.addInitHook("addHandler","doubleClickZoom",L.Map.DoubleClickZoom),L.Map.mergeOptions({scrollWheelZoom:!0}),L.Map.ScrollWheelZoom=L.Handler.extend({addHooks:function(){L.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),L.DomEvent.on(this._map._container,"MozMousePixelScroll",L.DomEvent.preventDefault),this._delta=0},removeHooks:function(){L.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),L.DomEvent.off(this._map._container,"MozMousePixelScroll",L.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=L.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(L.bind(this._performZoom,this),i),L.DomEvent.preventDefault(t),L.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();
e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),L.Map.addInitHook("addHandler","scrollWheelZoom",L.Map.ScrollWheelZoom),L.extend(L.DomEvent,{_touchstart:L.Browser.msPointer?"MSPointerDown":L.Browser.pointer?"pointerdown":"touchstart",_touchend:L.Browser.msPointer?"MSPointerUp":L.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,e,i){function n(t){var e;if(L.Browser.pointer?(d.push(t.pointerId),e=d.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(s||i);h=t.touches?t.touches[0]:t,a=n>0&&r>=n,s=i}}function o(t){if(L.Browser.pointer){var i=d.indexOf(t.pointerId);if(-1===i)return;d.splice(i,1)}if(a){if(L.Browser.pointer){var n={},o;for(var r in h)o=h[r],n[r]="function"==typeof o?o.bind(h):o;h=n}h.type="dblclick",e(h),s=null}}var s,a=!1,r=250,h,l="_leaflet_",c=this._touchstart,u=this._touchend,d=[];t[l+c+i]=n,t[l+u+i]=o;var m=L.Browser.pointer?document.documentElement:t;return t.addEventListener(c,n,!1),m.addEventListener(u,o,!1),L.Browser.pointer&&m.addEventListener(L.DomEvent.POINTER_CANCEL,o,!1),this},removeDoubleTapListener:function(t,e){var i="_leaflet_";return t.removeEventListener(this._touchstart,t[i+this._touchstart+e],!1),(L.Browser.pointer?document.documentElement:t).removeEventListener(this._touchend,t[i+this._touchend+e],!1),L.Browser.pointer&&document.documentElement.removeEventListener(L.DomEvent.POINTER_CANCEL,t[i+this._touchend+e],!1),this}}),L.extend(L.DomEvent,{POINTER_DOWN:L.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:L.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:L.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:L.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,e,i,n){var o="_leaflet_",s=this._pointers,a=function(t){L.DomEvent.preventDefault(t);for(var e=!1,n=0;n1))&&(this._moved||(L.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),L.Util.cancelAnimFrame(this._animRequest),this._animRequest=L.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),L.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var t=this._map;this._zooming=!1,L.DomUtil.removeClass(t._mapPane,"leaflet-touching"),L.Util.cancelAnimFrame(this._animRequest),L.DomEvent.off(document,"touchmove",this._onTouchMove).off(document,"touchend",this._onTouchEnd);var e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getZoom(),o=t.getScaleZoom(this._scale)-n,s=o>0?Math.ceil(o):Math.floor(o),a=t._limitZoom(n+s),r=t.getZoomScale(a)/this._scale;t._animateZoom(i,a,e,r)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),L.Map.addInitHook("addHandler","touchZoom",L.Map.TouchZoom),L.Map.mergeOptions({tap:!0,tapTolerance:15}),L.Map.Tap=L.Handler.extend({addHooks:function(){L.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){L.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(L.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new L.Point(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&L.DomUtil.addClass(i,"leaflet-active"),this._holdTimeout=setTimeout(L.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))},this),1e3),L.DomEvent.on(document,"touchmove",this._onMove,this).on(document,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),L.DomEvent.off(document,"touchmove",this._onMove,this).off(document,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&L.DomUtil.removeClass(i,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new L.Point(e.clientX,e.clientY)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}}),L.Browser.touch&&!L.Browser.pointer&&L.Map.addInitHook("addHandler","tap",L.Map.Tap),L.Control.Zoom=L.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=L.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,o,s){var a=L.DomUtil.create("a",i,n);a.innerHTML=t,a.href="#",a.title=e;var r=L.DomEvent.stopPropagation;return L.DomEvent.on(a,"click",r).on(a,"mousedown",r).on(a,"dblclick",r).on(a,"click",L.DomEvent.preventDefault).on(a,"click",o,s).on(a,"click",this._refocusOnMap,s),a},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";L.DomUtil.removeClass(this._zoomInButton,e),L.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&L.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&L.DomUtil.addClass(this._zoomInButton,e)}}),L.Map.mergeOptions({zoomControl:!0}),L.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new L.Control.Zoom,this.addControl(this.zoomControl))}),L.control.zoom=function(t){return new L.Control.Zoom(t)},L.Control.Attribution=L.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){L.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=L.DomUtil.create("div","leaflet-control-attribution"),L.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),L.Map.mergeOptions({attributionControl:!0}),L.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new L.Control.Attribution).addTo(this))}),L.control.attribution=function(t){return new L.Control.Attribution(t)},L.PosAnimation=L.Class.extend({includes:L.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[L.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",L.DomEvent.on(t,L.DomUtil.TRANSITION_END,this._onTransitionEnd,this),L.DomUtil.setPosition(t,e),L.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(L.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(L.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),L.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var t,e,i,n=this._el,o=window.getComputedStyle(n);if(L.Browser.any3d){if(i=o[L.DomUtil.TRANSFORM].match(this._transformRe),!i)return;t=parseFloat(i[1]),e=parseFloat(i[2])}else t=parseFloat(o.left),e=parseFloat(o.top);return new L.Point(t,e,!0)},_onTransitionEnd:function(){L.DomEvent.off(this._el,L.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[L.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),L.Map.include({setView:function(t,e,i){if(e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(L.latLng(t),e,this.options.maxBounds),i=i||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!i.reset&&i!==!0){void 0!==i.animate&&(i.zoom=L.extend({animate:i.animate},i.zoom),i.pan=L.extend({animate:i.animate},i.pan));var n=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan);if(n)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=L.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new L.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){L.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){L.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),L.PosAnimation=L.DomUtil.TRANSITION?L.PosAnimation:L.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=L.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=L.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));L.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){L.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),L.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),L.DomUtil.TRANSITION&&L.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&L.DomUtil.TRANSITION&&L.Browser.any3d&&!L.Browser.android23&&!L.Browser.mobileOpera,this._zoomAnimated&&L.DomEvent.on(this._mapPane,L.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),L.Map.include(L.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,o,s){this._animatingZoom=!0,L.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,L.Draggable&&(L.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:o,backwards:s})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,L.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),L.Draggable&&(L.Draggable._disabled=!1)}}:{}),L.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=L.DomUtil.TRANSFORM,n=t.delta?L.DomUtil.getTranslateString(t.delta):e.style[i],o=L.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?o+" "+n:n+" "+o},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),L.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[L.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",void this._stopLoadingImages(t)):(e.style.visibility="hidden",e.style[L.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(t){var e=t.getElementsByTagName("img"),i,n,o=0;for(i=0,n=e.length;n>i;i++)e[i].complete&&o++;return o/n},_stopLoadingImages:function(t){var e=Array.prototype.slice.call(t.getElementsByTagName("img")),i,n,o;for(i=0,n=e.length;n>i;i++)o=e[i],o.complete||(o.onload=L.Util.falseFn,o.onerror=L.Util.falseFn,o.src=L.Util.emptyImageUrl,o.parentNode.removeChild(o))}}),L.TileLayer.Zoomify=L.TileLayer.extend({options:{continuousWorld:!0,tolerance:.8},initialize:function(t,e){e=L.setOptions(this,e),this._url=t;var i=L.point(e.width,e.height),n=e.tileSize;for(this._imageSize=[i],this._gridSize=[this._getGridSize(i)];i.x>n||i.y>n;)i=i.divideBy(2).floor(),this._imageSize.push(i),this._gridSize.push(this._getGridSize(i));this._imageSize.reverse(),this._gridSize.reverse(),this.options.maxZoom=this._gridSize.length-1},onAdd:function(t){L.TileLayer.prototype.onAdd.call(this,t);var e=t.getSize(),i=this._getBestFitZoom(e),n=this._imageSize[i],o=t.options.crs.pointToLatLng(L.point(n.x/2,n.y/2),i)},getZoomifyBounds:function(t){var e=this._imageSize[0],i=t.options.crs.pointToLatLng(L.point(0,0),0),n=t.options.crs.pointToLatLng(L.point(e.x,e.y),0),o=L.latLngBounds(i,n);return o},getCenterZoom:function(t){var e=t.getSize(),i=this._getBestFitZoom(e),n=this._imageSize[i],o=t.options.crs.pointToLatLng(L.point(n.x/2,n.y/2),i);return{center:o,lat:o.lat,lon:o.lng,zoom:i}},_getGridSize:function(t){var e=this.options.tileSize;return L.point(Math.ceil(t.x/e),Math.ceil(t.y/e))},_getBestFitZoom:function(t){for(var e=this.options.tolerance,i=this._imageSize.length-1,n,i;i;){if(n=this._imageSize[i],n.x*e=0&&t.x=0&&t.yz;z++)n=this._gridSize[z],i+=n.x*n.y;return i+=t.y*this._gridSize[e].x+t.x,Math.floor(i/256)}}),L.tileLayer.zoomify=function(t,e){return new L.TileLayer.Zoomify(t,e)},L.Control.MiniMap=L.Control.extend({options:{position:"bottomright",toggleDisplay:!1,zoomLevelOffset:-5,zoomLevelFixed:!1,zoomAnimation:!1,autoToggleDisplay:!1,show_view:!0,width:150,height:150,aimingRectOptions:{color:"#c34528",weight:1,clickable:!1,stroke:!0},shadowRectOptions:{color:"#000000",weight:1,clickable:!1,opacity:0,fillOpacity:0}},hideText:"Hide MiniMap",showText:"Show MiniMap",initialize:function(t,e){L.Util.setOptions(this,e),this.options.aimingRectOptions.clickable=!1,this.options.shadowRectOptions.clickable=!1,this._layer=t},onAdd:function(t){return this._mainMap=t,this._container=L.DomUtil.create("div","leaflet-control-minimap"),this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",L.DomEvent.disableClickPropagation(this._container),L.DomEvent.on(this._container,"mousewheel",L.DomEvent.stopPropagation),this._miniMap=new L.Map(this._container,{attributionControl:!1,zoomControl:!1,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:!1,scrollWheelZoom:!1,doubleClickZoom:!1,boxZoom:!1,dragging:!1,crs:t.options.crs}),this._miniMap.addLayer(this._layer),this._mainMapMoving=!1,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(L.Util.bind(function(){this._aimingRect=L.rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=L.rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._miniMap),this._locationCircle=L.circleMarker(this._mainMap.getCenter(),{fillColor:"#c34528",color:"#FFFFFF",weight:2,radius:10,fill:!0,fillOpacity:1,stroke:!0,clickable:!1}).addTo(this._miniMap),this._locationCircle.setRadius(5),this._mainMap.on("moveend",this._onMainMapMoved,this),this._mainMap.on("move",this._onMainMapMoving,this),this.options.bounds_array&&this._miniMap.fitBounds(this.options.bounds_array,{padding:[15,15]})},this)),this._container},minimize:function(t){this._minimized||this._minimize()},restore:function(){this._minimized&&(this._restore(),this._miniMap.fitBounds(this.options.bounds_array,{padding:[15,15]}))},addTo:function(t){return L.Control.prototype.addTo.call(this,t),this._miniMap.setView(this._mainMap.getCenter(),this._decideZoom(!0)),this._setDisplay(this._decideMinimized()),this},onRemove:function(t){this._mainMap.off("moveend",this._onMainMapMoved,this),this._mainMap.off("move",this._onMainMapMoving,this),this._miniMap.off("moveend",this._onMiniMapMoved,this),this._miniMap.removeLayer(this._layer)},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this.hideText,"leaflet-control-minimap-toggle-display",this._container,this._toggleDisplayButtonClicked,this):void 0},_createButton:function(t,e,i,n,o,s){var a=L.DomUtil.create("a",i,n);a.innerHTML=t,a.href="#",a.title=e;var r=L.DomEvent.stopPropagation;return L.DomEvent.on(a,"click",r).on(a,"mousedown",r).on(a,"dblclick",r).on(a,"click",L.DomEvent.preventDefault).on(a,"click",o,s),a},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?(this._restore(),this._toggleDisplayButton.title=this.hideText):(this._minimize(),this._toggleDisplayButton.title=this.showText)},_setDisplay:function(t){t!=this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this._container.style.width="0px",this._container.style.height="0px",this._minimized=!0},_restore:function(){this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._minimized=!1},_onMainMapMoved:function(t){if(this._miniMapMoving)this._miniMapMoving=!1;else{var e=this._decideZoom(!0);this._mainMapMoving=!0,this._setDisplay(this._decideMinimized())}this.options.show_view&&this._aimingRect.setBounds(this._mainMap.getBounds()),this._locationCircle.setLatLng(this._mainMap.getCenter())},_onMainMapMoving:function(t){this.options.show_view&&this._aimingRect.setBounds(this._mainMap.getBounds()),this._locationCircle.setLatLng(this._mainMap.getCenter())},_onMiniMapMoveStarted:function(t){var e=this._aimingRect.getBounds(),i=this._miniMap.latLngToContainerPoint(e.getSouthWest()),n=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:i,ne:n}},_onMiniMapMoving:function(t){!this._mainMapMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new L.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){this._mainMapMoving?this._mainMapMoving=!1:(this._miniMapMoving=!0,this._mainMap.setView(this._miniMap.getCenter(),this._decideZoom(!1)),this._shadowRect.setStyle({opacity:0,fillOpacity:0}))},_decideZoom:function(t){if(this.options.zoomLevelFixed||0==this.options.zoomLevelFixed)return t?this.options.zoomLevelFixed:this._mainMap.getZoom();if(t)return this._mainMap.getZoom()+this.options.zoomLevelOffset;var e=this._miniMap.getZoom()-this._mainMap.getZoom(),i=this._miniMap.getZoom()-this.options.zoomLevelOffset,n;return e>this.options.zoomLevelOffset&&this._mainMap.getZoom()this._lastMiniMapZoom?(n=this._mainMap.getZoom()+1,this._miniMap.setZoom(this._miniMap.getZoom()-1)):n=this._mainMap.getZoom():n=i,this._lastMiniMapZoom=this._miniMap.getZoom(),n},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?this._mainMap.getBounds().contains(this._miniMap.getBounds())?!0:!1:this._minimized}}),L.Map.mergeOptions({miniMapControl:!1}),L.Map.addInitHook(function(){this.options.miniMapControl&&(this.miniMapControl=(new L.Control.MiniMap).addTo(this))}),L.control.minimap=function(t){return new L.Control.MiniMap(t)},function(t){function e(t,e,n){for(var a=i(t),r=0;rLeaflet | ",'Map tiles by Stamen Design, ','under CC BY 3.0. ','Data by OpenStreetMap, ','under CC BY SA.'].join("")}},s={toner:o("toner","png",0,20),terrain:o("terrain","jpg",4,18),watercolor:o("watercolor","jpg",1,16),"trees-cabs-crime":{url:"http://{S}.tiles.mapbox.com/v3/stamen.trees-cabs-crime/{Z}/{X}/{Y}.png",type:"png",subdomains:"a b c d".split(" "),minZoom:11,maxZoom:18,extent:[{lat:37.853,lon:-122.577},{lat:37.684,lon:-122.313}],attribution:['Design by Shawn Allen at Stamen.','Data courtesy of FuF,','Yellow Cab','& SFPD.'].join(" ")}};if(e("toner",["hybrid","labels","lines","background","lite"]),e("toner",["2010"]),e("toner",["2011","2011-lines","2011-labels","2011-lite"]),e("terrain",["background"]),e("terrain",["labels","lines"],"png"),t.stamen=t.stamen||{},t.stamen.tile=t.stamen.tile||{},t.stamen.tile.providers=s,t.stamen.tile.getProvider=i,"object"==typeof MM){var a="function"==typeof MM.Template?MM.Template:MM.TemplatedMapProvider;MM.StamenTileLayer=function(t){var e=i(t);this._provider=e,MM.Layer.call(this,new a(e.url,e.subdomains)),this.provider.setZoomRange(e.minZoom,e.maxZoom),this.attribution=e.attribution},MM.StamenTileLayer.prototype={setCoordLimits:function(t){var e=this._provider;return e.extent?(t.coordLimits=[t.locationCoordinate(e.extent[0]).zoomTo(e.minZoom),t.locationCoordinate(e.extent[1]).zoomTo(e.maxZoom)],!0):!1}},MM.extend(MM.StamenTileLayer,MM.Layer)}"object"==typeof L&&(L.StamenTileLayer=L.TileLayer.extend({initialize:function(t,e){var n=i(t),o=n.url.replace(/({[A-Z]})/g,function(t){return t.toLowerCase()}),s={minZoom:n.minZoom,maxZoom:n.maxZoom,subdomains:n.subdomains,scheme:"xyz",attribution:n.attribution};e&&VCO.Util.mergeData(s,e),L.TileLayer.prototype.initialize.call(this,o,s)}})),"object"==typeof google&&"object"==typeof google.maps&&(google.maps.StamenMapType=function(t){var e=i(t),n=e.subdomains;return google.maps.ImageMapType.call(this,{getTileUrl:function(t,i){var o=1<s?s+o:s,r=t.y,h=(i+a+r)%n.length;return e.url.replace("{S}",n[h]).replace("{Z}",i).replace("{X}",a).replace("{Y}",r)},tileSize:new google.maps.Size(256,256),name:t,minZoom:e.minZoom,maxZoom:e.maxZoom})},google.maps.StamenMapType.prototype=new google.maps.ImageMapType("_"))}("undefined"==typeof exports?this:exports),VCO.MapMarker=VCO.Class.extend({includes:[VCO.Events],initialize:function(t,e){this._el={container:{},content_container:{},content:{}},this._marker={},this._icon={},this._custom_icon=!1,this._custom_icon_url="",this._custom_image_icon=!1,this.marker_number=0,this.media_icon_class="",this.timer={},this.data={},this.options={duration:1e3,ease:VCO.Ease.easeInSpline,width:600,height:600,map_popup:!1,use_custom_markers:!1},this.animator=null,VCO.Util.mergeData(this.options,e),VCO.Util.mergeData(this.data,t),this._initLayout()},show:function(){},hide:function(){},addTo:function(t){this._addTo(t)},removeFrom:function(t){this._removeFrom(t)},updateDisplay:function(t,e,i){this._updateDisplay(t,e,i)},createMarker:function(t,e){this._createMarker(t,e)},createPopup:function(t,e){this._createPopup(t,e)},active:function(t){this._active(t)},location:function(){return this._location()},_createMarker:function(t,e){},_addTo:function(t){},_removeFrom:function(t){},_createPopup:function(t,e){},_active:function(t){},_location:function(){return{lat:0,lng:0}},_onMarkerClick:function(t){this.fire("markerclick",{marker_number:this.marker_number})},_initLayout:function(){this._createMarker(this.data,this.options)},_updateDisplay:function(t,e,i){}}),VCO.Map=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(t,e,i){this._el={container:{},map:{},map_mask:{}},this._el.container="object"==typeof t?t:VCO.Dom.get(t),this._loaded={data:!1,map:!1},this._map=null,this._mini_map=null,this._markers=[],this.zoom_min_max={min:null,max:null},this._line=null,this._line_active=null,this.current_marker=0,this.bounds_array=null,this._tile_layer=null,this._tile_layer_mini=null,this._image_layer=null,this.data={uniqueid:"",slides:[{test:"yes"},{test:"yes"},{test:"yes"}]},this.options={map_type:"stamen:toner-lite",map_as_image:!1,map_mini:!1,map_background_color:"#d9d9d9",map_subdomains:"",zoomify:{path:"",width:"",height:"",tolerance:.8,attribution:""},skinny_size:650,less_bounce:!0,path_gfx:"gfx",start_at_slide:0,map_popup:!1,zoom_distance:100,calculate_zoom:!0,line_follows_path:!0,line_color:"#333",line_color_inactive:"#000",line_weight:5,line_opacity:.2,line_dash:"5,5",line_join:"miter",show_lines:!0,show_history_line:!0,use_custom_markers:!1,map_center_offset:null},this.animator=null,this.timer=null,this.touch_scale=1,this.scroll={start_time:null},VCO.Util.mergeData(this.options,i),VCO.Util.mergeData(this.data,e),this._initLayout(),this._initEvents(),this._createMap(),this._initData()},updateDisplay:function(t,e,i,n,o){this._updateDisplay(t,e,i,n,o)},goTo:function(t,e){if(t=0){var i=0,n=this.current_marker;this.current_marker=t;var o=this._markers[this.current_marker];if(this.animator&&this.animator.stop(),this._resetMarkersActive(),o.data.type&&"overview"==o.data.type)this._markerOverview(),e||this._onMarkerChange();
else if(o.active(!0),e)o.data.location&&this._viewTo(o.data.location);else{if(o.data.location&&o.data.location.lat)if(i=this._calculateZoomChange(this._getMapCenter(!0),o.location()),this._viewTo(o.data.location,{calculate_zoom:this.options.calculate_zoom,zoom:i}),this.options.line_follows_path){if(this.options.show_history_line&&o.data.real_marker&&this._markers[n].data.real_marker){var s=[],a=n,r;if(athis.current_marker)for(;a>this.current_marker;)this._markers[a].data.location&&this._markers[a].data.location.lat&&(r={lat:this._markers[a].data.location.lat,lon:this._markers[a].data.location.lon},s.push(r)),a--;s.push({lat:o.data.location.lat,lon:o.data.location.lon}),this._replaceLines(this._line_active,s)}}else this.options.show_history_line&&o.data.real_marker&&this._markers[n].data.real_marker&&this._replaceLines(this._line_active,[{lat:o.data.location.lat,lon:o.data.location.lon},{lat:this._markers[n].data.location.lat,lon:this._markers[n].data.location.lon}]);else this._markerOverview(),e||this._onMarkerChange();this._onMarkerChange()}}},panTo:function(t,e){this._panTo(t,e)},zoomTo:function(t,e){this._zoomTo(t,e)},viewTo:function(t,e){this._viewTo(t,e)},getBoundsZoom:function(t,e,i,n){this.__getBoundsZoom(t,e,i,n)},markerOverview:function(){this._markerOverview()},calculateMarkerZooms:function(){this._calculateMarkerZooms()},createMiniMap:function(){this._createMiniMap()},setMapOffset:function(t,e){this.options.map_center_offset.left=t,this.options.map_center_offset.top=e},calculateMinMaxZoom:function(){for(var t=0;tt&&(this.zoom_min_max.min=t)},initialMapLocation:function(){this._loaded.data&&this._loaded.map&&(this.goTo(this.options.start_at_slide,!0),this._initialMapLocation())},show:function(){},hide:function(){},addTo:function(t){t.appendChild(this._el.container),this.onAdd()},removeFrom:function(t){t.removeChild(this._el.container),this.onRemove()},createMarkers:function(t){this._createMarkers(t)},createMarker:function(t){this._createMarker(t)},_destroyMarker:function(t){this._removeMarker(t);for(var e=0;e◼ StoryMapJS");var t=this.options.map_type.split(":");this._tile_layer=this._createTileLayer(this.options.map_type),this._tile_layer.on("load",this._onTilesLoaded,this),this._map.addLayer(this._tile_layer),this._image_layer&&this._map.addLayer(this._image_layer),this._line=this._createLine(this._line),this._line.setStyle({color:this.options.line_color_inactive}),this._addLineToMap(this._line),this._line_active=this._createLine(this._line_active),this._line_active.setStyle({opacity:1}),this._addLineToMap(this._line_active),this.options.map_as_image&&(this._line_active.setStyle({opacity:0}),this._line.setStyle({opacity:0}))},_createMiniMap:function(){this.options.map_as_image&&(this.zoom_min_max.min=0),this.bounds_array||(this.bounds_array=this._getAllMarkersBounds(this._markers)),this._tile_layer_mini=this._createTileLayer(this.options.map_type),this._mini_map=new L.Control.MiniMap(this._tile_layer_mini,{width:150,height:100,position:"topleft",bounds_array:this.bounds_array,zoomLevelFixed:this.zoom_min_max.min,zoomAnimation:!0,aimingRectOptions:{fillColor:"#FFFFFF",color:"#FFFFFF",opacity:.4,weight:1,stroke:!0}}).addTo(this._map),this._mini_map.getContainer().style.backgroundColor=this.options.map_background_color},_createBackgroundMap:function(t){if(trace("CREATE BACKGROUND MAP"),this._image_layer?this._image_layer.clearLayers():(this._image_layer=new L.layerGroup,this._map.addLayer(this._image_layer)),t)for(x in t){var e=t[x],i={},n={x:0,y:0,url:e.src,height:parseInt(e.style.height.split("px")[0]),width:parseInt(e.style.width.split("px")[0]),pos:{start:0,end:0}};if(e.style.left||e.style.top)e.style.left&&(n.x=parseInt(e.style.left.split("px")[0])),e.style.top&&(n.y=parseInt(e.style.top.split("px")[0]));else if(e.style["-webkit-transform"]||e.style.transform||e.style["-ms-transform"]){var o;e.style["-webkit-transform"]?o=e.style["-webkit-transform"].split("3d(")[1].split(", 0)")[0].split(", "):e.style.transform?o=e.style.transform.split("3d(")[1].split(", 0)")[0].split(", "):e.style["-ms-transform"]&&(o=e.style["-ms-transform"].split("3d(")[1].split(", 0)")[0].split(", ")),n.x=parseInt(o[0].split("px")[0]),n.y=parseInt(o[1].split("px")[0])}n.url.match("toner")&&(n.url=n.url.replace("/toner-hybrid/","/toner-lines/"),n.url=n.url.replace("/toner/","/toner-background/")),n.pos.start=this._map.containerPointToLatLng([n.x,n.y]),n.pos.end=this._map.containerPointToLatLng([n.x+n.width,n.y+n.height]),i=new L.imageOverlay(n.url,[n.pos.start,n.pos.end]),this._image_layer.addLayer(i)}},_createTileLayer:function(t,e){var i=null,n=t.split(":"),o={},s="Leaflet | ";switch(e&&(o=e),n[0]){case"mapbox":var a=n[1]||"nuknightlab.hif6ioi4";o.subdomains="abcd",o.attribution=s+"ยฉ Mapbox ยฉ OpenStreetMap",i=new L.TileLayer("https://{s}.tiles.mapbox.com/v2/"+a+"/{z}/{x}/{y}.png",o);break;case"stamen":i=new L.StamenTileLayer(n[1]||"toner-lite",o),this._map.getContainer().style.backgroundColor="#FFFFFF";break;case"zoomify":o.width=this.options.zoomify.width,o.height=this.options.zoomify.height,o.tolerance=this.options.zoomify.tolerance,o.attribution=s+this.options.zoomify.attribution,i=new L.tileLayer.zoomify(this.options.zoomify.path,o);break;case"osm":o.subdomains="ab",o.attribution=s+"ยฉ OpenStreetMap and contributors, under an open license",i=new L.TileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",o);break;case"http":case"https":o.subdomains=this.options.map_subdomains,i=new L.TileLayer(this.options.map_type,o);break;default:i=new L.StamenTileLayer("toner",o)}return i},_onMapMoveEnd:function(t){},_onTilesLoaded:function(t){this._createBackgroundMap(t.target._tiles),this._tile_layer.off("load",this._onTilesLoaded,this)},_onMapZoomed:function(t){trace("FIRST ZOOM"),this._map.off("zoomend",this._onMapZoomed,this)},_onMapZoom:function(t){},_createMarker:function(t){var e=new VCO.MapMarker.Leaflet(t,this.options);e.on("markerclick",this._onMarkerClick,this),this._addMarker(e),this._markers.push(e),e.marker_number=this._markers.length-1,this.fire("markerAdded",e)},_addMarker:function(t){t.addTo(this._map)},_removeMarker:function(t){},_markerOverview:function(){var t,e;if(this._line_active.setStyle({opacity:0}),"zoomify"==this.options.map_type&&this.options.map_as_image){var i=this._tile_layer.getCenterZoom(this._map);t=i.center,(this.options.map_center_offset&&0!=this.options.map_center_offset.left||0!=this.options.map_center_offset.top)&&(i.zoom=i.zoom-1,t=this._getMapCenterOffset(t,i.zoom)),this._map.setView(t,i.zoom,{pan:{animate:!0,duration:this.options.duration/1e3,easeLinearity:.1},zoom:{animate:!0,duration:this.options.duration/1e3,easeLinearity:.1}})}else if(this.bounds_array=this._getAllMarkersBounds(this._markers),this.options.map_center_offset&&0!=this.options.map_center_offset.left||0!=this.options.map_center_offset.top){var n=new L.latLngBounds(this.bounds_array);t=n.getCenter(),e=this._map.getBoundsZoom(n),t=this._getMapCenterOffset(t,e-1),this._map.setView(t,e-1,{pan:{animate:!0,duration:this.options.duration/1e3,easeLinearity:.1},zoom:{animate:!0,duration:this.options.duration/1e3,easeLinearity:.1}})}else this._map.fitBounds(this.bounds_array,{padding:[15,15]});this._mini_map&&this._mini_map.minimize()},_getAllMarkersBounds:function(t){for(var e=[],i=0;i0?this._markers[t-1].location():this._getMapCenter(!0),s=this._calculateZoomChange(i,o),n=ts?s:a?a:s,(this.options.map_center_offset&&0!=this.options.map_center_offset.left||0!=this.options.map_center_offset.top)&&(r-=1),e.data.location.zoom=r}},_createLine:function(t){return new L.Polyline([],{clickable:!1,color:this.options.line_color,weight:this.options.line_weight,opacity:this.options.line_opacity,dashArray:this.options.line_dash,lineJoin:this.options.line_join,className:"vco-map-line"})},_addLineToMap:function(t){this._map.addLayer(t)},_addToLine:function(t,e){t.addLatLng({lon:e.location.lon,lat:e.location.lat})},_replaceLines:function(t,e){t.setLatLngs(e)},_panTo:function(t,e){this._map.panTo({lat:t.lat,lon:t.lon},{animate:!0,duration:this.options.duration/1e3,easeLinearity:.1})},_zoomTo:function(t,e){this._map.setZoom(t)},_viewTo:function(t,e){var i=!0,n=this.options.duration/1e3,o=this._getMapZoom(),s={lat:t.lat,lon:t.lon};this.options.map_as_image||this._line_active.setStyle({opacity:1}),t.zoom&&(o=t.zoom),e&&(e.duration&&(0==e.duration?i=!1:n=duration),e.zoom&&this.options.calculate_zoom&&(o=e.zoom)),this.options.map_center_offset&&(s=this._getMapCenterOffset(s,o)),this._map.setView(s,o,{pan:{animate:i,duration:n,easeLinearity:.1},zoom:{animate:i,duration:n,easeLinearity:.1}}),this._mini_map&&this.options.width>this.options.skinny_size&&(o-1<=this.zoom_min_max.min?this._mini_map.minimize():this._mini_map.restore())},_getMapLocation:function(t){return this._map.latLngToContainerPoint(t)},_getMapZoom:function(){return this._map.getZoom()},_getMapCenter:function(t){return this._map.getCenter()},_getMapCenterOffset:function(t,e){var i,n;return i=this._map.project(t,e).subtract([this.options.map_center_offset.left,this.options.map_center_offset.top]),n=this._map.unproject(i,e)},_getBoundsZoom:function(t,e,i){var n=t,o=[3*Math.abs(this.options.map_center_offset.left),3*Math.abs(this.options.map_center_offset.top)];if(i){var s=n.lat+(n.lat-e.lat)/2,a=n.lng+(n.lng-e.lng)/2;n=new L.LatLng(s,a)}var r=new L.LatLngBounds([n,e]);return this.options.less_bounce?this._map.getBoundsZoom(r,!1,o):this._map.getBoundsZoom(r,!0,o)},_getZoomifyZoom:function(){},_initialMapLocation:function(){this._map.on("zoomend",this._onMapZoomed,this)},_updateMapDisplay:function(t,e){if(t){var i=this.options.duration,n=this;e&&(i=e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){n._refreshMap()},i)}else this.timer||this._refreshMap();this._mini_map&&this._el.container.offsetWidth_;_++)n++,c=this.project(h,n).subtract(this.project(r,n)).add(i),u.push({x:Math.abs(a.x-c.x),y:Math.abs(a.y-c.y)});m=u[0];for(var f=0;f